Dos mitades de la misma experiencia: el primer día y todos los días después. El primer día. Un agente recién creado mostraba tres avisos ámbar sueltos —"no atiende", "no sabe nada"— sin ningún orden: el dueño sabía que faltaban cosas pero no cuál iba primero. Ahora hay una guía de tres pasos (contale de tu negocio → hacele una pregunta → ponelo a atender) donde solo el siguiente paso pendiente se resalta, porque una guía donde todo grita a la vez no guía nada. Mientras falte algo, la guía reemplaza al estado — una sola voz por etapa; con los pasos hechos desaparece para siempre y el estado operativo toma su lugar. Todos los días. La bandeja de conversaciones mostraba el último mensaje de cada sesión —casi siempre la respuesta del bot, "¡Hola! ¿En qué te ayudo?" cincuenta veces— y el session_id crudo (tg:8812). Ahora cada conversación muestra lo que el visitante preguntó al abrir, que es el dato que le importa al dueño: qué le preguntan de verdad a su negocio. Con canal deducido del prefijo de la sesión (WhatsApp, Telegram, Tu web, Prueba), cantidad de mensajes, y fecha relativa. Las pruebas propias se separan detrás de un filtro: mezcladas inflan la lista y el dueño no distingue cuáles son clientes reales. El contador del estado cuenta solo las reales, por lo mismo — si arriba dice 4 y la lista muestra 3, el número parece roto. El hilo muestra la hora de cada mensaje, y el backend gana una consulta que agrupa por sesión con el primer mensaje del visitante en vez de mandar filas crudas; la vieja quedó sin usos y se fue. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
27 lines
178 KiB
JavaScript
27 lines
178 KiB
JavaScript
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();/**
|
|
* @vue/shared v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/function Qs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ye={},en=[],xt=()=>{},xr=()=>!1,os=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),rs=e=>e.startsWith("onUpdate:"),Ne=Object.assign,Ys=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},zi=Object.prototype.hasOwnProperty,he=(e,t)=>zi.call(e,t),Y=Array.isArray,tn=e=>jn(e)==="[object Map]",pn=e=>jn(e)==="[object Set]",_o=e=>jn(e)==="[object Date]",oe=e=>typeof e=="function",$e=e=>typeof e=="string",it=e=>typeof e=="symbol",ve=e=>e!==null&&typeof e=="object",yr=e=>(ve(e)||oe(e))&&oe(e.then)&&oe(e.catch),_r=Object.prototype.toString,jn=e=>_r.call(e),Ji=e=>jn(e).slice(8,-1),wr=e=>jn(e)==="[object Object]",Zs=e=>$e(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,wn=Qs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),is=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Qi=/-\w/g,Ge=is(e=>e.replace(Qi,t=>t.slice(1).toUpperCase())),Yi=/\B([A-Z])/g,Qt=is(e=>e.replace(Yi,"-$1").toLowerCase()),ls=is(e=>e.charAt(0).toUpperCase()+e.slice(1)),_s=is(e=>e?`on${ls(e)}`:""),bt=(e,t)=>!Object.is(e,t),Gn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},kr=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},as=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let wo;const us=()=>wo||(wo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Jt(e){if(Y(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=$e(s)?tl(s):Jt(s);if(o)for(const r in o)t[r]=o[r]}return t}else if($e(e)||ve(e))return e}const Zi=/;(?![^(]*\))/g,Xi=/:([^]+)/,el=/\/\*[^]*?\*\//g;function tl(e){const t={};return e.replace(el,"").split(Zi).forEach(n=>{if(n){const s=n.split(Xi);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ce(e){let t="";if($e(e))t=e;else if(Y(e))for(let n=0;n<e.length;n++){const s=ce(e[n]);s&&(t+=s+" ")}else if(ve(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const nl="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",sl=Qs(nl);function Cr(e){return!!e||e===""}function ol(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Ft(e[s],t[s]);return n}function Ft(e,t){if(e===t)return!0;let n=_o(e),s=_o(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=it(e),s=it(t),n||s)return e===t;if(n=Y(e),s=Y(t),n||s)return n&&s?ol(e,t):!1;if(n=ve(e),s=ve(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const i in e){const a=e.hasOwnProperty(i),u=t.hasOwnProperty(i);if(a&&!u||!a&&u||!Ft(e[i],t[i]))return!1}}return String(e)===String(t)}function Xs(e,t){return e.findIndex(n=>Ft(n,t))}const $r=e=>!!(e&&e.__v_isRef===!0),I=e=>$e(e)?e:e==null?"":Y(e)||ve(e)&&(e.toString===_r||!oe(e.toString))?$r(e)?I(e.value):JSON.stringify(e,Ar,2):String(e),Ar=(e,t)=>$r(t)?Ar(e,t.value):tn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[ws(s,r)+" =>"]=o,n),{})}:pn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ws(n))}:it(t)?ws(t):ve(t)&&!Y(t)&&!wr(t)?String(t):t,ws=(e,t="")=>{var n;return it(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
* @vue/reactivity v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let De;class rl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&De&&(De.active?(this.parent=De,this.index=(De.scopes||(De.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=De;try{return De=this,t()}finally{De=n}}}on(){++this._on===1&&(this.prevScope=De,De=this)}off(){if(this._on>0&&--this._on===0){if(De===this)De=this.prevScope;else{let t=De;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function il(){return De}let _e;const ks=new WeakSet;class Sr{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,De&&(De.active?De.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ks.has(this)&&(ks.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ir(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ko(this),Rr(this);const t=_e,n=st;_e=this,st=!0;try{return this.fn()}finally{Pr(this),_e=t,st=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)no(t);this.deps=this.depsTail=void 0,ko(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ks.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ns(this)&&this.run()}get dirty(){return Ns(this)}}let Er=0,kn,Cn;function Ir(e,t=!1){if(e.flags|=8,t){e.next=Cn,Cn=e;return}e.next=kn,kn=e}function eo(){Er++}function to(){if(--Er>0)return;if(Cn){let t=Cn;for(Cn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;kn;){let t=kn;for(kn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Rr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Pr(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),no(s),ll(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Ns(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Tr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Tr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===En)||(e.globalVersion=En,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ns(e))))return;e.flags|=2;const t=e.dep,n=_e,s=st;_e=e,st=!0;try{Rr(e);const o=e.fn(e._value);(t.version===0||bt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{_e=n,st=s,Pr(e),e.flags&=-3}}function no(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)no(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ll(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let st=!0;const Or=[];function Ot(){Or.push(st),st=!1}function Dt(){const e=Or.pop();st=e===void 0?!0:e}function ko(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=_e;_e=void 0;try{t()}finally{_e=n}}}let En=0;class al{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class so{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!_e||!st||_e===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==_e)n=this.activeLink=new al(_e,this),_e.deps?(n.prevDep=_e.depsTail,_e.depsTail.nextDep=n,_e.depsTail=n):_e.deps=_e.depsTail=n,Dr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=_e.depsTail,n.nextDep=void 0,_e.depsTail.nextDep=n,_e.depsTail=n,_e.deps===n&&(_e.deps=s)}return n}trigger(t){this.version++,En++,this.notify(t)}notify(t){eo();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{to()}}}function Dr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Dr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const js=new WeakMap,Kt=Symbol(""),Vs=Symbol(""),In=Symbol("");function Ue(e,t,n){if(st&&_e){let s=js.get(e);s||js.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new so),o.map=s,o.key=n),o.track()}}function Et(e,t,n,s,o,r){const i=js.get(e);if(!i){En++;return}const a=u=>{u&&u.trigger()};if(eo(),t==="clear")i.forEach(a);else{const u=Y(e),f=u&&Zs(n);if(u&&n==="length"){const c=Number(s);i.forEach((h,m)=>{(m==="length"||m===In||!it(m)&&m>=c)&&a(h)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),f&&a(i.get(In)),t){case"add":u?f&&a(i.get("length")):(a(i.get(Kt)),tn(e)&&a(i.get(Vs)));break;case"delete":u||(a(i.get(Kt)),tn(e)&&a(i.get(Vs)));break;case"set":tn(e)&&a(i.get(Kt));break}}to()}function Yt(e){const t=me(e);return t===e?t:(Ue(t,"iterate",In),tt(e)?t:t.map(lt))}function cs(e){return Ue(e=me(e),"iterate",In),e}function vt(e,t){return Mt(e)?ln(zt(e)?lt(t):t):lt(t)}const ul={__proto__:null,[Symbol.iterator](){return Cs(this,Symbol.iterator,e=>vt(this,e))},concat(...e){return Yt(this).concat(...e.map(t=>Y(t)?Yt(t):t))},entries(){return Cs(this,"entries",e=>(e[1]=vt(this,e[1]),e))},every(e,t){return Ct(this,"every",e,t,void 0,arguments)},filter(e,t){return Ct(this,"filter",e,t,n=>n.map(s=>vt(this,s)),arguments)},find(e,t){return Ct(this,"find",e,t,n=>vt(this,n),arguments)},findIndex(e,t){return Ct(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ct(this,"findLast",e,t,n=>vt(this,n),arguments)},findLastIndex(e,t){return Ct(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ct(this,"forEach",e,t,void 0,arguments)},includes(...e){return $s(this,"includes",e)},indexOf(...e){return $s(this,"indexOf",e)},join(e){return Yt(this).join(e)},lastIndexOf(...e){return $s(this,"lastIndexOf",e)},map(e,t){return Ct(this,"map",e,t,void 0,arguments)},pop(){return vn(this,"pop")},push(...e){return vn(this,"push",e)},reduce(e,...t){return Co(this,"reduce",e,t)},reduceRight(e,...t){return Co(this,"reduceRight",e,t)},shift(){return vn(this,"shift")},some(e,t){return Ct(this,"some",e,t,void 0,arguments)},splice(...e){return vn(this,"splice",e)},toReversed(){return Yt(this).toReversed()},toSorted(e){return Yt(this).toSorted(e)},toSpliced(...e){return Yt(this).toSpliced(...e)},unshift(...e){return vn(this,"unshift",e)},values(){return Cs(this,"values",e=>vt(this,e))}};function Cs(e,t,n){const s=cs(e),o=s[t]();return s!==e&&!tt(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const cl=Array.prototype;function Ct(e,t,n,s,o,r){const i=cs(e),a=i!==e&&!tt(e),u=i[t];if(u!==cl[t]){const h=u.apply(e,r);return a?lt(h):h}let f=n;i!==e&&(a?f=function(h,m){return n.call(this,vt(e,h),m,e)}:n.length>2&&(f=function(h,m){return n.call(this,h,m,e)}));const c=u.call(i,f,s);return a&&o?o(c):c}function Co(e,t,n,s){const o=cs(e),r=o!==e&&!tt(e);let i=n,a=!1;o!==e&&(r?(a=s.length===0,i=function(f,c,h){return a&&(a=!1,f=vt(e,f)),n.call(this,f,vt(e,c),h,e)}):n.length>3&&(i=function(f,c,h){return n.call(this,f,c,h,e)}));const u=o[t](i,...s);return a?vt(e,u):u}function $s(e,t,n){const s=me(e);Ue(s,"iterate",In);const o=s[t](...n);return(o===-1||o===!1)&&io(n[0])?(n[0]=me(n[0]),s[t](...n)):o}function vn(e,t,n=[]){Ot(),eo();const s=me(e)[t].apply(e,n);return to(),Dt(),s}const dl=Qs("__proto__,__v_isRef,__isVue"),Mr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(it));function fl(e){it(e)||(e=String(e));const t=me(this);return Ue(t,"has",e),t.hasOwnProperty(e)}class Nr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(o?r?wl:Lr:r?Ur:Vr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=Y(t);if(!o){let u;if(i&&(u=ul[n]))return u;if(n==="hasOwnProperty")return fl}const a=Reflect.get(t,n,Fe(t)?t:s);if((it(n)?Mr.has(n):dl(n))||(o||Ue(t,"get",n),r))return a;if(Fe(a)){const u=i&&Zs(n)?a:a.value;return o&&ve(u)?Ls(u):u}return ve(a)?o?Ls(a):ds(a):a}}class jr extends Nr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const i=Y(t)&&Zs(n);if(!this._isShallow){const f=Mt(r);if(!tt(s)&&!Mt(s)&&(r=me(r),s=me(s)),!i&&Fe(r)&&!Fe(s))return f||(r.value=s),!0}const a=i?Number(n)<t.length:he(t,n),u=Reflect.set(t,n,s,Fe(t)?t:o);return t===me(o)&&u&&(a?bt(s,r)&&Et(t,"set",n,s):Et(t,"add",n,s)),u}deleteProperty(t,n){const s=he(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Et(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!it(n)||!Mr.has(n))&&Ue(t,"has",n),s}ownKeys(t){return Ue(t,"iterate",Y(t)?"length":Kt),Reflect.ownKeys(t)}}class pl extends Nr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const ml=new jr,hl=new pl,vl=new jr(!0);const Us=e=>e,Ln=e=>Reflect.getPrototypeOf(e);function gl(e,t,n){return function(...s){const o=this.__v_raw,r=me(o),i=tn(r),a=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,f=o[e](...s),c=n?Us:t?ln:lt;return!t&&Ue(r,"iterate",u?Vs:Kt),Ne(Object.create(f),{next(){const{value:h,done:m}=f.next();return m?{value:h,done:m}:{value:a?[c(h[0]),c(h[1])]:c(h),done:m}}})}}function Fn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function bl(e,t){const n={get(o){const r=this.__v_raw,i=me(r),a=me(o);e||(bt(o,a)&&Ue(i,"get",o),Ue(i,"get",a));const{has:u}=Ln(i),f=t?Us:e?ln:lt;if(u.call(i,o))return f(r.get(o));if(u.call(i,a))return f(r.get(a));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&Ue(me(o),"iterate",Kt),o.size},has(o){const r=this.__v_raw,i=me(r),a=me(o);return e||(bt(o,a)&&Ue(i,"has",o),Ue(i,"has",a)),o===a?r.has(o):r.has(o)||r.has(a)},forEach(o,r){const i=this,a=i.__v_raw,u=me(a),f=t?Us:e?ln:lt;return!e&&Ue(u,"iterate",Kt),a.forEach((c,h)=>o.call(r,f(c),f(h),i))}};return Ne(n,e?{add:Fn("add"),set:Fn("set"),delete:Fn("delete"),clear:Fn("clear")}:{add(o){const r=me(this),i=Ln(r),a=me(o),u=!t&&!tt(o)&&!Mt(o)?a:o;return i.has.call(r,u)||bt(o,u)&&i.has.call(r,o)||bt(a,u)&&i.has.call(r,a)||(r.add(u),Et(r,"add",u,u)),this},set(o,r){!t&&!tt(r)&&!Mt(r)&&(r=me(r));const i=me(this),{has:a,get:u}=Ln(i);let f=a.call(i,o);f||(o=me(o),f=a.call(i,o));const c=u.call(i,o);return i.set(o,r),f?bt(r,c)&&Et(i,"set",o,r):Et(i,"add",o,r),this},delete(o){const r=me(this),{has:i,get:a}=Ln(r);let u=i.call(r,o);u||(o=me(o),u=i.call(r,o)),a&&a.call(r,o);const f=r.delete(o);return u&&Et(r,"delete",o,void 0),f},clear(){const o=me(this),r=o.size!==0,i=o.clear();return r&&Et(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=gl(o,e,t)}),n}function oo(e,t){const n=bl(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(he(n,o)&&o in s?n:s,o,r)}const xl={get:oo(!1,!1)},yl={get:oo(!1,!0)},_l={get:oo(!0,!1)};const Vr=new WeakMap,Ur=new WeakMap,Lr=new WeakMap,wl=new WeakMap;function kl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ds(e){return Mt(e)?e:ro(e,!1,ml,xl,Vr)}function Fr(e){return ro(e,!1,vl,yl,Ur)}function Ls(e){return ro(e,!0,hl,_l,Lr)}function ro(e,t,n,s,o){if(!ve(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=o.get(e);if(r)return r;const i=kl(Ji(e));if(i===0)return e;const a=new Proxy(e,i===2?s:n);return o.set(e,a),a}function zt(e){return Mt(e)?zt(e.__v_raw):!!(e&&e.__v_isReactive)}function Mt(e){return!!(e&&e.__v_isReadonly)}function tt(e){return!!(e&&e.__v_isShallow)}function io(e){return e?!!e.__v_raw:!1}function me(e){const t=e&&e.__v_raw;return t?me(t):e}function Cl(e){return!he(e,"__v_skip")&&Object.isExtensible(e)&&kr(e,"__v_skip",!0),e}const lt=e=>ve(e)?ds(e):e,ln=e=>ve(e)?Ls(e):e;function Fe(e){return e?e.__v_isRef===!0:!1}function q(e){return qr(e,!1)}function $l(e){return qr(e,!0)}function qr(e,t){return Fe(e)?e:new Al(e,t)}class Al{constructor(t,n){this.dep=new so,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:me(t),this._value=n?t:lt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||tt(t)||Mt(t);t=s?t:me(t),bt(t,n)&&(this._rawValue=t,this._value=s?t:lt(t),this.dep.trigger())}}function Re(e){return Fe(e)?e.value:e}const Sl={get:(e,t,n)=>t==="__v_raw"?e:Re(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Fe(o)&&!Fe(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Hr(e){return zt(e)?e:new Proxy(e,Sl)}class El{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new so(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=En-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&_e!==this)return Ir(this,!0),!0}get value(){const t=this.dep.track();return Tr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Il(e,t,n=!1){let s,o;return oe(e)?s=e:(s=e.get,o=e.set),new El(s,o,n)}const qn={},Qn=new WeakMap;let Wt;function Rl(e,t=!1,n=Wt){if(n){let s=Qn.get(n);s||Qn.set(n,s=[]),s.push(e)}}function Pl(e,t,n=ye){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:a,call:u}=n,f=_=>o?_:tt(_)||o===!1||o===0?It(_,1):It(_);let c,h,m,b,$=!1,k=!1;if(Fe(e)?(h=()=>e.value,$=tt(e)):zt(e)?(h=()=>f(e),$=!0):Y(e)?(k=!0,$=e.some(_=>zt(_)||tt(_)),h=()=>e.map(_=>{if(Fe(_))return _.value;if(zt(_))return f(_);if(oe(_))return u?u(_,2):_()})):oe(e)?t?h=u?()=>u(e,2):e:h=()=>{if(m){Ot();try{m()}finally{Dt()}}const _=Wt;Wt=c;try{return u?u(e,3,[b]):e(b)}finally{Wt=_}}:h=xt,t&&o){const _=h,y=o===!0?1/0:o;h=()=>It(_(),y)}const P=il(),M=()=>{c.stop(),P&&P.active&&Ys(P.effects,c)};if(r&&t){const _=t;t=(...y)=>{const O=_(...y);return M(),O}}let E=k?new Array(e.length).fill(qn):qn;const C=_=>{if(!(!(c.flags&1)||!c.dirty&&!_))if(t){const y=c.run();if(_||o||$||(k?y.some((O,j)=>bt(O,E[j])):bt(y,E))){m&&m();const O=Wt;Wt=c;try{const j=[y,E===qn?void 0:k&&E[0]===qn?[]:E,b];E=y,u?u(t,3,j):t(...j)}finally{Wt=O}}}else c.run()};return a&&a(C),c=new Sr(h),c.scheduler=i?()=>i(C,!1):C,b=_=>Rl(_,!1,c),m=c.onStop=()=>{const _=Qn.get(c);if(_){if(u)u(_,4);else for(const y of _)y();Qn.delete(c)}},t?s?C(!0):E=c.run():i?i(C.bind(null,!0),!0):c.run(),M.pause=c.pause.bind(c),M.resume=c.resume.bind(c),M.stop=M,M}function It(e,t=1/0,n){if(t<=0||!ve(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Fe(e))It(e.value,t,n);else if(Y(e))for(let s=0;s<e.length;s++)It(e[s],t,n);else if(pn(e)||tn(e))e.forEach(s=>{It(s,t,n)});else if(wr(e)){for(const s in e)It(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&It(e[s],t,n)}return e}/**
|
|
* @vue/runtime-core v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/function Vn(e,t,n,s){try{return s?e(...s):e()}catch(o){fs(o,t,n)}}function at(e,t,n,s){if(oe(e)){const o=Vn(e,t,n,s);return o&&yr(o)&&o.catch(r=>{fs(r,t,n)}),o}if(Y(e)){const o=[];for(let r=0;r<e.length;r++)o.push(at(e[r],t,n,s));return o}}function fs(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ye;if(t){let a=t.parent;const u=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let h=0;h<c.length;h++)if(c[h](e,u,f)===!1)return}a=a.parent}if(r){Ot(),Vn(r,null,10,[e,u,f]),Dt();return}}Tl(e,n,o,s,i)}function Tl(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const We=[];let ht=-1;const nn=[];let Ut=null,Zt=0;const Br=Promise.resolve();let Yn=null;function lo(e){const t=Yn||Br;return e?t.then(this?e.bind(this):e):t}function Ol(e){let t=ht+1,n=We.length;for(;t<n;){const s=t+n>>>1,o=We[s],r=Rn(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function ao(e){if(!(e.flags&1)){const t=Rn(e),n=We[We.length-1];!n||!(e.flags&2)&&t>=Rn(n)?We.push(e):We.splice(Ol(t),0,e),e.flags|=1,Wr()}}function Wr(){Yn||(Yn=Br.then(Kr))}function Dl(e){if(!Y(e))Ut&&e.id===-1?Ut.splice(Zt+1,0,e):e.flags&1||(nn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)nn.push(e[t]);Wr()}function $o(e,t,n=ht+1){for(;n<We.length;n++){const s=We[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;We.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Gr(e){if(nn.length){const t=[...new Set(nn)].sort((n,s)=>Rn(n)-Rn(s));if(nn.length=0,Ut){for(let n=0;n<t.length;n++)Ut.push(t[n]);return}for(Ut=t,Zt=0;Zt<Ut.length;Zt++){const n=Ut[Zt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ut=null,Zt=0}}const Rn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Kr(e){try{for(ht=0;ht<We.length;ht++){const t=We[ht];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Vn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ht<We.length;ht++){const t=We[ht];t&&(t.flags&=-2)}ht=-1,We.length=0,Gr(),Yn=null,(We.length||nn.length)&&Kr()}}let Me=null,zr=null;function Zn(e){const t=Me;return Me=e,zr=e&&e.type.__scopeId||null,t}function nt(e,t=Me,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&ts(-1);const r=Zn(t),i=Tt.length;let a;try{a=e(...o)}finally{for(let u=Tt.length;u>i;u--)mo();Zn(r),s._d&&ts(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function Q(e,t){if(Me===null)return e;const n=bs(Me),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,i,a,u=ye]=t[o];r&&(oe(r)&&(r={mounted:r,updated:r}),r.deep&&It(i),s.push({dir:r,instance:n,value:i,oldValue:void 0,arg:a,modifiers:u}))}return e}function Ht(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let i=0;i<o.length;i++){const a=o[i];r&&(a.oldValue=r[i].value);let u=a.dir[s];u&&(Ot(),at(u,n,8,[e.el,a,e,t]),Dt())}}function Kn(e,t){if(Le){let n=Le.provides;const s=Le.parent&&Le.parent.provides;s===n&&(n=Le.provides=Object.create(s)),n[e]=t}}function ot(e,t,n=!1){const s=Ia();if(s||on){let o=on?on._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&oe(t)?t.call(s&&s.proxy):t}}const Ml=Symbol.for("v-scx"),Nl=()=>ot(Ml);function Pt(e,t,n){return Jr(e,t,n)}function Jr(e,t,n=ye){const{immediate:s,deep:o,flush:r,once:i}=n,a=Ne({},n),u=t&&s||!t&&r!=="post";let f;if(Dn){if(r==="sync"){const b=Nl();f=b.__watcherHandles||(b.__watcherHandles=[])}else if(!u){const b=()=>{};return b.stop=xt,b.resume=xt,b.pause=xt,b}}const c=Le;a.call=(b,$,k)=>at(b,c,$,k);let h=!1;r==="post"?a.scheduler=b=>{ze(b,c&&c.suspense)}:r!=="sync"&&(h=!0,a.scheduler=(b,$)=>{$?b():ao(b)}),a.augmentJob=b=>{t&&(b.flags|=4),h&&(b.flags|=2,c&&(b.id=c.uid,b.i=c))};const m=Pl(e,t,a);return Dn&&(f?f.push(m):u&&m()),m}function jl(e,t,n){const s=this.proxy,o=$e(e)?e.includes(".")?Qr(s,e):()=>s[e]:e.bind(s,s);let r;oe(t)?r=t:(r=t.handler,n=t);const i=Un(this),a=Jr(o,r.bind(s),n);return i(),a}function Qr(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Vl=Symbol("_vte"),ps=e=>e.__isTeleport,As=Symbol("_leaveCb");function Ul(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==_t){t=n;break}}return t}function Yr(e){if(!co(e))return ps(e.type)&&e.children?Ul(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&oe(n.default))return n.default()}}function uo(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;uo(ps(n.type)&&Yr(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Zr(e,t){return oe(e)?Ne({name:e.name},t,{setup:e}):e}function Xr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ao(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Xn=new WeakMap;function $n(e,t,n,s,o=!1){if(Y(e)){e.forEach((k,P)=>$n(k,t&&(Y(t)?t[P]:t),n,s,o));return}if(sn(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&$n(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?bs(s.component):s.el,i=o?null:r,{i:a,r:u}=e,f=t&&t.r,c=a.refs===ye?a.refs={}:a.refs,h=a.setupState,m=me(h),b=h===ye?xr:k=>Ao(c,k)?!1:he(m,k),$=(k,P)=>!(P&&Ao(c,P));if(f!=null&&f!==u){if(So(t),$e(f))c[f]=null,b(f)&&(h[f]=null);else if(Fe(f)){const k=t;$(f,k.k)&&(f.value=null),k.k&&(c[k.k]=null)}}if(oe(u))Vn(u,a,12,[i,c]);else{const k=$e(u),P=Fe(u);if(k||P){const M=()=>{if(e.f){const E=k?b(u)?h[u]:c[u]:$()||!e.k?u.value:c[e.k];if(o)Y(E)&&Ys(E,r);else if(Y(E))E.includes(r)||E.push(r);else if(k)c[u]=[r],b(u)&&(h[u]=c[u]);else{const C=[r];$(u,e.k)&&(u.value=C),e.k&&(c[e.k]=C)}}else k?(c[u]=i,b(u)&&(h[u]=i)):P&&($(u,e.k)&&(u.value=i),e.k&&(c[e.k]=i))};if(i){const E=()=>{M(),Xn.delete(e)};E.id=-1,Xn.set(e,E),ze(E,n)}else So(e),M()}}}function So(e){const t=Xn.get(e);t&&(t.flags|=8,Xn.delete(e))}us().requestIdleCallback;us().cancelIdleCallback;const sn=e=>!!e.type.__asyncLoader,co=e=>e.type.__isKeepAlive;function Ll(e,t){ei(e,"a",t)}function Fl(e,t){ei(e,"da",t)}function ei(e,t,n=Le){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ms(t,s,n),n){let o=n.parent;for(;o&&o.parent;)co(o.parent.vnode)&&ql(s,t,n,o),o=o.parent}}function ql(e,t,n,s){const o=ms(t,e,s,!0);ni(()=>{Ys(s[t],o)},n)}function ms(e,t,n=Le,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{Ot();const a=Un(n),u=at(t,n,e,i);return a(),Dt(),u});return s?o.unshift(r):o.push(r),r}}const Nt=e=>(t,n=Le)=>{(!Dn||e==="sp")&&ms(e,(...s)=>t(...s),n)},Hl=Nt("bm"),hs=Nt("m"),Bl=Nt("bu"),Wl=Nt("u"),ti=Nt("bum"),ni=Nt("um"),Gl=Nt("sp"),Kl=Nt("rtg"),zl=Nt("rtc");function Jl(e,t=Le){ms("ec",e,t)}const si="components";function mn(e,t){return ri(si,e,!0,t)||e}const oi=Symbol.for("v-ndc");function Ql(e){return $e(e)?ri(si,e,!1)||e:e||oi}function ri(e,t,n=!0,s=!1){const o=Me||Le;if(o){const r=o.type;{const a=Da(r,!1);if(a&&(a===t||a===Ge(t)||a===ls(Ge(t))))return r}const i=Eo(o[e]||r[e],t)||Eo(o.appContext[e],t);return!i&&s?r:i}}function Eo(e,t){return e&&(e[t]||e[Ge(t)]||e[ls(Ge(t))])}function we(e,t,n,s){let o;const r=n,i=Y(e);if(i||$e(e)){const a=i&&zt(e);let u=!1,f=!1;a&&(u=!tt(e),f=Mt(e),e=cs(e)),o=new Array(e.length);for(let c=0,h=e.length;c<h;c++)o[c]=t(u?f?ln(lt(e[c])):lt(e[c]):e[c],c,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,r)}else if(ve(e))if(e[Symbol.iterator])o=Array.from(e,(a,u)=>t(a,u,void 0,r));else{const a=Object.keys(e);o=new Array(a.length);for(let u=0,f=a.length;u<f;u++){const c=a[u];o[u]=t(e[c],c,u,r)}}else o=[];return o}function Yl(e,t,n,s,o,r){if(n==null&&(n={}),Me.ce||Me.parent&&sn(Me.parent)&&Me.parent.ce){const f=n,c=Object.keys(f).length>0;return v(),xe(ne,null,[ee("slot",f,s)],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const a=Tt.length;v();let u;try{const f=i&&ii(i(n)),c=n.key||r||f&&f.key;u=xe(ne,{key:(c&&!it(c)?c:`_${t}`)+(!f&&s?"_fb":"")},f||(s?s():[]),f&&e._===1?64:-2)}catch(f){for(let c=Tt.length;c>a;c--)mo();throw f}finally{i&&i._c&&(i._d=!0)}return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),u}function ii(e){return e.some(t=>Tn(t)?!(t.type===_t||t.type===ne&&!ii(t.children)):!0)?e:null}const Fs=e=>e?Ei(e)?bs(e):Fs(e.parent):null,An=Ne(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Fs(e.parent),$root:e=>Fs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ai(e),$forceUpdate:e=>e.f||(e.f=()=>{ao(e.update)}),$nextTick:e=>e.n||(e.n=lo.bind(e.proxy)),$watch:e=>jl.bind(e)}),Ss=(e,t)=>e!==ye&&!e.__isScriptSetup&&he(e,t),Zl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:a,appContext:u}=e;if(t[0]!=="$"){const m=i[t];if(m!==void 0)switch(m){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Ss(s,t))return i[t]=1,s[t];if(o!==ye&&he(o,t))return i[t]=2,o[t];if(he(r,t))return i[t]=3,r[t];if(n!==ye&&he(n,t))return i[t]=4,n[t];qs&&(i[t]=0)}}const f=An[t];let c,h;if(f)return t==="$attrs"&&Ue(e.attrs,"get",""),f(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==ye&&he(n,t))return i[t]=4,n[t];if(h=u.config.globalProperties,he(h,t))return h[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Ss(o,t)?(o[t]=n,!0):s!==ye&&he(s,t)?(s[t]=n,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:i}},a){let u;return!!(n[a]||e!==ye&&a[0]!=="$"&&he(e,a)||Ss(t,a)||he(r,a)||he(s,a)||he(An,a)||he(o.config.globalProperties,a)||(u=i.__cssModules)&&u[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:he(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Io(e){return Y(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let qs=!0;function Xl(e){const t=ai(e),n=e.proxy,s=e.ctx;qs=!1,t.beforeCreate&&Ro(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:i,watch:a,provide:u,inject:f,created:c,beforeMount:h,mounted:m,beforeUpdate:b,updated:$,activated:k,deactivated:P,beforeDestroy:M,beforeUnmount:E,destroyed:C,unmounted:_,render:y,renderTracked:O,renderTriggered:j,errorCaptured:V,serverPrefetch:ke,expose:Z,inheritAttrs:U,components:Se,directives:G,filters:Ke}=t;if(f&&ea(f,s,null),i)for(const fe in i){const ae=i[fe];oe(ae)&&(s[fe]=ae.bind(n))}if(o){const fe=o.call(n,n);ve(fe)&&(e.data=ds(fe))}if(qs=!0,r)for(const fe in r){const ae=r[fe],et=oe(ae)?ae.bind(n,n):oe(ae.get)?ae.get.bind(n,n):xt,qe=!oe(ae)&&oe(ae.set)?ae.set.bind(n):xt,Qe=ie({get:et,set:qe});Object.defineProperty(s,fe,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:je=>Qe.value=je})}if(a)for(const fe in a)li(a[fe],s,n,fe);if(u){const fe=oe(u)?u.call(n):u;Reflect.ownKeys(fe).forEach(ae=>{Kn(ae,fe[ae])})}c&&Ro(c,e,"c");function Ce(fe,ae){Y(ae)?ae.forEach(et=>fe(et.bind(n))):ae&&fe(ae.bind(n))}if(Ce(Hl,h),Ce(hs,m),Ce(Bl,b),Ce(Wl,$),Ce(Ll,k),Ce(Fl,P),Ce(Jl,V),Ce(zl,O),Ce(Kl,j),Ce(ti,E),Ce(ni,_),Ce(Gl,ke),Y(Z))if(Z.length){const fe=e.exposed||(e.exposed={});Z.forEach(ae=>{Object.defineProperty(fe,ae,{get:()=>n[ae],set:et=>n[ae]=et,enumerable:!0})})}else e.exposed||(e.exposed={});y&&e.render===xt&&(e.render=y),U!=null&&(e.inheritAttrs=U),Se&&(e.components=Se),G&&(e.directives=G),ke&&Xr(e)}function ea(e,t,n=xt){Y(e)&&(e=Hs(e));for(const s in e){const o=e[s];let r;ve(o)?"default"in o?r=ot(o.from||s,o.default,!0):r=ot(o.from||s):r=ot(o),Fe(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[s]=r}}function Ro(e,t,n){at(Y(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function li(e,t,n,s){let o=s.includes(".")?Qr(n,s):()=>n[s];if($e(e)){const r=t[e];oe(r)&&Pt(o,r)}else if(oe(e))Pt(o,e.bind(n));else if(ve(e))if(Y(e))e.forEach(r=>li(r,t,n,s));else{const r=oe(e.handler)?e.handler.bind(n):t[e.handler];oe(r)&&Pt(o,r,e)}}function ai(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,a=r.get(t);let u;return a?u=a:!o.length&&!n&&!s?u=t:(u={},o.length&&o.forEach(f=>es(u,f,i,!0)),es(u,t,i)),ve(t)&&r.set(t,u),u}function es(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&es(e,r,n,!0),o&&o.forEach(i=>es(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const a=ta[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const ta={data:Po,props:To,emits:To,methods:xn,computed:xn,beforeCreate:He,created:He,beforeMount:He,mounted:He,beforeUpdate:He,updated:He,beforeDestroy:He,beforeUnmount:He,destroyed:He,unmounted:He,activated:He,deactivated:He,errorCaptured:He,serverPrefetch:He,components:xn,directives:xn,watch:sa,provide:Po,inject:na};function Po(e,t){return t?e?function(){return Ne(oe(e)?e.call(this,this):e,oe(t)?t.call(this,this):t)}:t:e}function na(e,t){return xn(Hs(e),Hs(t))}function Hs(e){if(Y(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function He(e,t){return e?[...new Set([].concat(e,t))]:t}function xn(e,t){return e?Ne(Object.create(null),e,t):t}function To(e,t){return e?Y(e)&&Y(t)?[...new Set([...e,...t])]:Ne(Object.create(null),Io(e),Io(t??{})):t}function sa(e,t){if(!e)return t;if(!t)return e;const n=Ne(Object.create(null),e);for(const s in t)n[s]=He(e[s],t[s]);return n}function ui(){return{app:null,config:{isNativeTag:xr,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let oa=0;function ra(e,t){return function(s,o=null){oe(s)||(s=Ne({},s)),o!=null&&!ve(o)&&(o=null);const r=ui(),i=new WeakSet,a=[];let u=!1;const f=r.app={_uid:oa++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:Na,get config(){return r.config},set config(c){},use(c,...h){return i.has(c)||(c&&oe(c.install)?(i.add(c),c.install(f,...h)):oe(c)&&(i.add(c),c(f,...h))),f},mixin(c){return r.mixins.includes(c)||r.mixins.push(c),f},component(c,h){return h?(r.components[c]=h,f):r.components[c]},directive(c,h){return h?(r.directives[c]=h,f):r.directives[c]},mount(c,h,m){if(!u){const b=f._ceVNode||ee(s,o);return b.appContext=r,m===!0?m="svg":m===!1&&(m=void 0),e(b,c,m),u=!0,f._container=c,c.__vue_app__=f,bs(b.component)}},onUnmount(c){a.push(c)},unmount(){u&&(at(a,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(c,h){return r.provides[c]=h,f},runWithContext(c){const h=on;on=f;try{return c()}finally{on=h}}};return f}}let on=null;const ia=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ge(t)}Modifiers`]||e[`${Qt(t)}Modifiers`];function la(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ye;let o=n;const r=t.startsWith("update:"),i=r&&ia(s,t.slice(7));i&&(i.trim&&(o=n.map(c=>$e(c)?c.trim():c)),i.number&&(o=n.map(as)));let a,u=s[a=_s(t)]||s[a=_s(Ge(t))];!u&&r&&(u=s[a=_s(Qt(t))]),u&&at(u,e,6,o);const f=s[a+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,at(f,e,6,o)}}const aa=new WeakMap;function ci(e,t,n=!1){const s=n?aa:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let i={},a=!1;if(!oe(e)){const u=f=>{const c=ci(f,t,!0);c&&(a=!0,Ne(i,c))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!r&&!a?(ve(e)&&s.set(e,null),null):(Y(r)?r.forEach(u=>i[u]=null):Ne(i,r),ve(e)&&s.set(e,i),i)}function vs(e,t){return!e||!os(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,Qt(t))||he(e,t))}function Oo(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:a,emit:u,render:f,renderCache:c,props:h,data:m,setupState:b,ctx:$,inheritAttrs:k}=e,P=Zn(e);let M,E;try{if(n.shapeFlag&4){const _=o||s,y=_;M=gt(f.call(y,_,c,h,b,m,$)),E=a}else{const _=t;M=gt(_.length>1?_(h,{attrs:a,slots:i,emit:u}):_(h,null)),E=t.props?a:ua(a)}}catch(_){Tt.length=0,fs(_,e,1),M=ee(_t)}let C=M;if(E&&k!==!1){const _=Object.keys(E),{shapeFlag:y}=C;_.length&&y&7&&(r&&_.some(rs)&&(E=ca(E,r)),C=an(C,E,!1,!0))}if(n.dirs&&(C=an(C,null,!1,!0),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition){const _=ps(C.type)&&Yr(C)||C;uo(_,n.transition)}return M=C,Zn(P),M}const ua=e=>{let t;for(const n in e)(n==="class"||n==="style"||os(n))&&((t||(t={}))[n]=e[n]);return t},ca=(e,t)=>{const n={};for(const s in e)(!rs(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function da(e,t,n){const{props:s,children:o,component:r}=e,{props:i,children:a,patchFlag:u}=t,f=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return s?Do(s,i,f):!!i;if(u&8){const c=t.dynamicProps;for(let h=0;h<c.length;h++){const m=c[h];if(di(i,s,m)&&!vs(f,m))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:s===i?!1:s?i?Do(s,i,f):!0:!!i;return!1}function Do(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const r=s[o];if(di(t,e,r)&&!vs(n,r))return!0}return!1}function di(e,t,n){const s=e[n],o=t[n];return n==="style"&&ve(s)&&ve(o)?!Ft(s,o):s!==o}function fa({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const fi={},pi=()=>Object.create(fi),mi=e=>Object.getPrototypeOf(e)===fi;function pa(e,t,n,s=!1){const o={},r=pi();e.propsDefaults=Object.create(null),hi(e,t,o,r);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:Fr(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function ma(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:i}}=e,a=me(o),[u]=e.propsOptions;let f=!1;if((s||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let h=0;h<c.length;h++){let m=c[h];if(vs(e.emitsOptions,m))continue;const b=t[m];if(u)if(he(r,m))b!==r[m]&&(r[m]=b,f=!0);else{const $=Ge(m);o[$]=Bs(u,a,$,b,e,!1)}else b!==r[m]&&(r[m]=b,f=!0)}}}else{hi(e,t,o,r)&&(f=!0);let c;for(const h in a)(!t||!he(t,h)&&((c=Qt(h))===h||!he(t,c)))&&(u?n&&(n[h]!==void 0||n[c]!==void 0)&&(o[h]=Bs(u,a,h,void 0,e,!0)):delete o[h]);if(r!==a)for(const h in r)(!t||!he(t,h))&&(delete r[h],f=!0)}f&&Et(e.attrs,"set","")}function hi(e,t,n,s){const[o,r]=e.propsOptions;let i=!1,a;if(t)for(let u in t){if(wn(u))continue;const f=t[u];let c;o&&he(o,c=Ge(u))?!r||!r.includes(c)?n[c]=f:(a||(a={}))[c]=f:vs(e.emitsOptions,u)||(!(u in s)||f!==s[u])&&(s[u]=f,i=!0)}if(r){const u=me(n),f=a||ye;for(let c=0;c<r.length;c++){const h=r[c];n[h]=Bs(o,u,h,f[h],e,!he(f,h))}}return i}function Bs(e,t,n,s,o,r){const i=e[n];if(i!=null){const a=he(i,"default");if(a&&s===void 0){const u=i.default;if(i.type!==Function&&!i.skipFactory&&oe(u)){const{propsDefaults:f}=o;if(n in f)s=f[n];else{const c=Un(o);s=f[n]=u.call(null,t),c()}}else s=u;o.ce&&o.ce._setProp(n,s)}i[0]&&(r&&!a?s=!1:i[1]&&(s===""||s===Qt(n))&&(s=!0))}return s}const ha=new WeakMap;function vi(e,t,n=!1){const s=n?ha:t.propsCache,o=s.get(e);if(o)return o;const r=e.props,i={},a=[];let u=!1;if(!oe(e)){const c=h=>{u=!0;const[m,b]=vi(h,t,!0);Ne(i,m),b&&a.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!u)return ve(e)&&s.set(e,en),en;if(Y(r))for(let c=0;c<r.length;c++){const h=Ge(r[c]);Mo(h)&&(i[h]=ye)}else if(r)for(const c in r){const h=Ge(c);if(Mo(h)){const m=r[c],b=i[h]=Y(m)||oe(m)?{type:m}:Ne({},m),$=b.type;let k=!1,P=!0;if(Y($))for(let M=0;M<$.length;++M){const E=$[M],C=oe(E)&&E.name;if(C==="Boolean"){k=!0;break}else C==="String"&&(P=!1)}else k=oe($)&&$.name==="Boolean";b[0]=k,b[1]=P,(k||he(b,"default"))&&a.push(h)}}const f=[i,a];return ve(e)&&s.set(e,f),f}function Mo(e){return e[0]!=="$"&&!wn(e)}const fo=e=>e==="_"||e==="_ctx"||e==="$stable",po=e=>Y(e)?e.map(gt):[gt(e)],va=(e,t,n)=>{if(t._n)return t;const s=nt((...o)=>po(t(...o)),n);return s._c=!1,s},gi=(e,t,n)=>{const s=e._ctx;for(const o in e){if(fo(o))continue;const r=e[o];if(oe(r))t[o]=va(o,r,s);else if(r!=null){const i=po(r);t[o]=()=>i}}},bi=(e,t)=>{const n=po(t);e.slots.default=()=>n},xi=(e,t,n)=>{for(const s in t)(n||!fo(s))&&(e[s]=t[s])},ga=(e,t,n)=>{const s=e.slots=pi();if(e.vnode.shapeFlag&32){const o=t._;o?(xi(s,t,n),n&&kr(s,"_",o,!0)):gi(t,s)}else t&&bi(e,t)},ba=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,i=ye;if(s.shapeFlag&32){const a=t._;a?n&&a===1?r=!1:xi(o,t,n):(r=!t.$stable,gi(t,o)),i=t}else t&&(bi(e,t),i={default:1});if(r)for(const a in o)!fo(a)&&i[a]==null&&delete o[a]},ze=ka;function xa(e){return ya(e)}function ya(e,t){const n=us();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:i,createText:a,createComment:u,setText:f,setElementText:c,parentNode:h,nextSibling:m,setScopeId:b=xt,insertStaticContent:$}=e,k=(d,p,g,S=null,x=null,A=null,L=void 0,N=null,D=!!p.dynamicChildren)=>{if(d===p)return;d&&!gn(d,p)&&(S=R(d),je(d,x,A,!0),d=null),p.patchFlag===-2&&(D=!1,p.dynamicChildren=null);const{type:T,ref:J,shapeFlag:B}=p;switch(T){case gs:P(d,p,g,S);break;case _t:M(d,p,g,S);break;case zn:d==null&&E(p,g,S,L);break;case ne:Se(d,p,g,S,x,A,L,N,D);break;default:B&1?y(d,p,g,S,x,A,L,N,D):B&6?G(d,p,g,S,x,A,L,N,D):(B&64||B&128)&&T.process(d,p,g,S,x,A,L,N,D,K)}J!=null&&x?$n(J,d&&d.ref,A,p||d,!p):J==null&&d&&d.ref!=null&&$n(d.ref,null,A,d,!0)},P=(d,p,g,S)=>{if(d==null)s(p.el=a(p.children),g,S);else{const x=p.el=d.el;p.children!==d.children&&f(x,p.children)}},M=(d,p,g,S)=>{d==null?s(p.el=u(p.children||""),g,S):p.el=d.el},E=(d,p,g,S)=>{[d.el,d.anchor]=$(d.children,p,g,S,d.el,d.anchor)},C=({el:d,anchor:p},g,S)=>{let x;for(;d&&d!==p;)x=m(d),s(d,g,S),d=x;s(p,g,S)},_=({el:d,anchor:p})=>{let g;for(;d&&d!==p;)g=m(d),o(d),d=g;o(p)},y=(d,p,g,S,x,A,L,N,D)=>{if(p.type==="svg"?L="svg":p.type==="math"&&(L="mathml"),d==null)O(p,g,S,x,A,L,N,D);else{const T=d.el&&d.el._isVueCE?d.el:null;try{T&&T._beginPatch(),ke(d,p,x,A,L,N,D)}finally{T&&T._endPatch()}}},O=(d,p,g,S,x,A,L,N)=>{let D,T;const{props:J,shapeFlag:B,transition:z,dirs:X}=d;if(D=d.el=i(d.type,A,J&&J.is,J),B&8?c(D,d.children):B&16&&V(d.children,D,null,S,x,Es(d,A),L,N),X&&Ht(d,null,S,"created"),j(D,d,d.scopeId,L,S),J){for(const be in J)be!=="value"&&!wn(be)&&r(D,be,null,J[be],A,S);"value"in J&&r(D,"value",null,J.value,A),(T=J.onVnodeBeforeMount)&&mt(T,S,d)}X&&Ht(d,null,S,"beforeMount");const ue=_a(x,z);ue&&z.beforeEnter(D),s(D,p,g),((T=J&&J.onVnodeMounted)||ue||X)&&ze(()=>{try{T&&mt(T,S,d),ue&&z.enter(D),X&&Ht(d,null,S,"mounted")}finally{}},x)},j=(d,p,g,S,x)=>{if(g&&b(d,g),S)for(let A=0;A<S.length;A++)b(d,S[A]);if(x){let A=x.subTree;if(p===A||ki(A.type)&&(A.ssContent===p||A.ssFallback===p)){const L=x.vnode;j(d,L,L.scopeId,L.slotScopeIds,x.parent)}}},V=(d,p,g,S,x,A,L,N,D=0)=>{for(let T=D;T<d.length;T++){const J=d[T]=N?St(d[T]):gt(d[T]);k(null,J,p,g,S,x,A,L,N)}},ke=(d,p,g,S,x,A,L)=>{const N=p.el=d.el;let{patchFlag:D,dynamicChildren:T,dirs:J}=p;D|=d.patchFlag&16;const B=d.props||ye,z=p.props||ye;let X;if(g&&Bt(g,!1),(X=z.onVnodeBeforeUpdate)&&mt(X,g,p,d),J&&Ht(p,d,g,"beforeUpdate"),g&&Bt(g,!0),T&&(!d.dynamicChildren||d.dynamicChildren.length!==T.length)&&(D=0,L=!1,T=null),(B.innerHTML&&z.innerHTML==null||B.textContent&&z.textContent==null)&&c(N,""),T?Z(d.dynamicChildren,T,N,g,S,Es(p,x),A):L||ae(d,p,N,null,g,S,Es(p,x),A,!1),D>0){if(D&16)U(N,B,z,g,x);else if(D&2&&B.class!==z.class&&r(N,"class",null,z.class,x),D&4&&r(N,"style",B.style,z.style,x),D&8){const ue=p.dynamicProps;for(let be=0;be<ue.length;be++){const ge=ue[be],Ee=B[ge],Oe=z[ge];(Oe!==Ee||ge==="value")&&r(N,ge,Ee,Oe,x,g)}}D&1&&d.children!==p.children&&c(N,p.children)}else!L&&T==null&&U(N,B,z,g,x);((X=z.onVnodeUpdated)||J)&&ze(()=>{X&&mt(X,g,p,d),J&&Ht(p,d,g,"updated")},S)},Z=(d,p,g,S,x,A,L)=>{for(let N=0;N<p.length;N++){const D=d[N],T=p[N],J=D.el&&(D.type===ne||!gn(D,T)||D.shapeFlag&198)?h(D.el):g;k(D,T,J,null,S,x,A,L,!0)}},U=(d,p,g,S,x)=>{if(p!==g){if(p!==ye)for(const A in p)!wn(A)&&!(A in g)&&r(d,A,p[A],null,x,S);for(const A in g){if(wn(A))continue;const L=g[A],N=p[A];L!==N&&A!=="value"&&r(d,A,N,L,x,S)}"value"in g&&r(d,"value",p.value,g.value,x)}},Se=(d,p,g,S,x,A,L,N,D)=>{const T=p.el=d?d.el:a(""),J=p.anchor=d?d.anchor:a("");let{patchFlag:B,dynamicChildren:z,slotScopeIds:X}=p;X&&(N=N?N.concat(X):X),d==null?(s(T,g,S),s(J,g,S),V(p.children||[],g,J,x,A,L,N,D)):B>0&&B&64&&z&&d.dynamicChildren&&d.dynamicChildren.length===z.length?(Z(d.dynamicChildren,z,g,x,A,L,N),(p.key!=null||x&&p===x.subTree)&&yi(d,p,!0)):ae(d,p,g,J,x,A,L,N,D)},G=(d,p,g,S,x,A,L,N,D)=>{p.slotScopeIds=N,d==null?p.shapeFlag&512?x.ctx.activate(p,g,S,L,D):Ke(p,g,S,x,A,L,D):jt(d,p,D)},Ke=(d,p,g,S,x,A,L)=>{const N=d.component=Ea(d,S,x);if(co(d)&&(N.ctx.renderer=K),Ra(N,!1,L),N.asyncDep){if(x&&x.registerDep(N,Ce,L),!d.el){const D=N.subTree=ee(_t);M(null,D,p,g),d.placeholder=D.el}}else Ce(N,d,p,g,x,A,L)},jt=(d,p,g)=>{const S=p.component=d.component;if(da(d,p,g))if(S.asyncDep&&!S.asyncResolved){fe(S,p,g);return}else S.next=p,S.update();else p.el=d.el,S.vnode=p},Ce=(d,p,g,S,x,A,L)=>{const N=()=>{if(d.isMounted){let{next:B,bu:z,u:X,parent:ue,vnode:be}=d;{const ft=_i(d);if(ft){B&&(B.el=be.el,fe(d,B,L)),ft.asyncDep.then(()=>{ze(()=>{d.isUnmounted||T()},x)});return}}let ge=B,Ee;Bt(d,!1),B?(B.el=be.el,fe(d,B,L)):B=be,z&&Gn(z),(Ee=B.props&&B.props.onVnodeBeforeUpdate)&&mt(Ee,ue,B,be),Bt(d,!0);const Oe=Oo(d),dt=d.subTree;d.subTree=Oe,k(dt,Oe,h(dt.el),R(dt),d,x,A),B.el=Oe.el,ge===null&&fa(d,Oe.el),X&&ze(X,x),(Ee=B.props&&B.props.onVnodeUpdated)&&ze(()=>mt(Ee,ue,B,be),x)}else{let B;const{el:z,props:X}=p,{bm:ue,m:be,parent:ge,root:Ee,type:Oe}=d,dt=sn(p);Bt(d,!1),ue&&Gn(ue),!dt&&(B=X&&X.onVnodeBeforeMount)&&mt(B,ge,p),Bt(d,!0);{Ee.ce&&Ee.ce._hasShadowRoot()&&Ee.ce._injectChildStyle(Oe,d.parent?d.parent.type:void 0);const ft=d.subTree=Oo(d);k(null,ft,g,S,d,x,A),p.el=ft.el}if(be&&ze(be,x),!dt&&(B=X&&X.onVnodeMounted)){const ft=p;ze(()=>mt(B,ge,ft),x)}(p.shapeFlag&256||ge&&sn(ge.vnode)&&ge.vnode.shapeFlag&256)&&d.a&&ze(d.a,x),d.isMounted=!0,p=g=S=null}};d.scope.on();const D=d.effect=new Sr(N);d.scope.off();const T=d.update=D.run.bind(D),J=d.job=D.runIfDirty.bind(D);J.i=d,J.id=d.uid,D.scheduler=()=>ao(J),Bt(d,!0),T()},fe=(d,p,g)=>{p.component=d;const S=d.vnode.props;d.vnode=p,d.next=null,ma(d,p.props,S,g),ba(d,p.children,g),Ot(),$o(d),Dt()},ae=(d,p,g,S,x,A,L,N,D=!1)=>{const T=d&&d.children,J=d?d.shapeFlag:0,B=p.children,{patchFlag:z,shapeFlag:X}=p;if(z>0){if(z&128){qe(T,B,g,S,x,A,L,N,D);return}else if(z&256){et(T,B,g,S,x,A,L,N,D);return}}X&8?(J&16&&Ve(T,x,A),B!==T&&c(g,B)):J&16?X&16?qe(T,B,g,S,x,A,L,N,D):Ve(T,x,A,!0):(J&8&&c(g,""),X&16&&V(B,g,S,x,A,L,N,D))},et=(d,p,g,S,x,A,L,N,D)=>{d=d||en,p=p||en;const T=d.length,J=p.length,B=Math.min(T,J);let z;for(z=0;z<B;z++){const X=p[z]=D?St(p[z]):gt(p[z]);k(d[z],X,g,null,x,A,L,N,D)}T>J?Ve(d,x,A,!0,!1,B):V(p,g,S,x,A,L,N,D,B)},qe=(d,p,g,S,x,A,L,N,D)=>{let T=0;const J=p.length;let B=d.length-1,z=J-1;for(;T<=B&&T<=z;){const X=d[T],ue=p[T]=D?St(p[T]):gt(p[T]);if(gn(X,ue))k(X,ue,g,null,x,A,L,N,D);else break;T++}for(;T<=B&&T<=z;){const X=d[B],ue=p[z]=D?St(p[z]):gt(p[z]);if(gn(X,ue))k(X,ue,g,null,x,A,L,N,D);else break;B--,z--}if(T>B){if(T<=z){const X=z+1,ue=X<J?p[X].el:S;for(;T<=z;)k(null,p[T]=D?St(p[T]):gt(p[T]),g,ue,x,A,L,N,D),T++}}else if(T>z)for(;T<=B;)je(d[T],x,A,!0),T++;else{const X=T,ue=T,be=new Map;for(T=ue;T<=z;T++){const Ye=p[T]=D?St(p[T]):gt(p[T]);Ye.key!=null&&be.set(Ye.key,T)}let ge,Ee=0;const Oe=z-ue+1;let dt=!1,ft=0;const hn=new Array(Oe);for(T=0;T<Oe;T++)hn[T]=0;for(T=X;T<=B;T++){const Ye=d[T];if(Ee>=Oe){je(Ye,x,A,!0);continue}let pt;if(Ye.key!=null)pt=be.get(Ye.key);else for(ge=ue;ge<=z;ge++)if(hn[ge-ue]===0&&gn(Ye,p[ge])){pt=ge;break}pt===void 0?je(Ye,x,A,!0):(hn[pt-ue]=T+1,pt>=ft?ft=pt:dt=!0,k(Ye,p[pt],g,null,x,A,L,N,D),Ee++)}const bo=dt?wa(hn):en;for(ge=bo.length-1,T=Oe-1;T>=0;T--){const Ye=ue+T,pt=p[Ye],xo=p[Ye+1],yo=Ye+1<J?xo.el||wi(xo):S;hn[T]===0?k(null,pt,g,yo,x,A,L,N,D):dt&&(ge<0||T!==bo[ge]?Qe(pt,g,yo,2):ge--)}}},Qe=(d,p,g,S,x=null)=>{const{el:A,type:L,transition:N,children:D,shapeFlag:T}=d;if(T&6){Qe(d.component.subTree,p,g,S);return}if(T&128){d.suspense.move(p,g,S);return}if(T&64){L.move(d,p,g,K);return}if(L===ne){s(A,p,g);for(let B=0;B<D.length;B++)Qe(D[B],p,g,S);s(d.anchor,p,g);return}if(L===zn){C(d,p,g);return}if(S!==2&&T&1&&N)if(S===0)N.persisted&&!A[As]?s(A,p,g):(N.beforeEnter(A),s(A,p,g),ze(()=>N.enter(A),x));else{const{leave:B,delayLeave:z,afterLeave:X}=N,ue=()=>{d.ctx.isUnmounted?o(A):s(A,p,g)},be=()=>{const ge=A._isLeaving||!!A[As];A._isLeaving&&A[As](!0),N.persisted&&!ge?ue():B(A,()=>{ue(),X&&X()})};z?z(A,ue,be):be()}else s(A,p,g)},je=(d,p,g,S=!1,x=!1)=>{const{type:A,props:L,ref:N,children:D,dynamicChildren:T,shapeFlag:J,patchFlag:B,dirs:z,cacheIndex:X,memo:ue}=d;if(B===-2&&(x=!1),N!=null&&(Ot(),$n(N,null,g,d,!0),Dt()),X!=null&&(p.renderCache[X]=void 0),J&256){p.ctx.deactivate(d);return}const be=J&1&&z,ge=!sn(d);let Ee;if(ge&&(Ee=L&&L.onVnodeBeforeUnmount)&&mt(Ee,p,d),J&6)kt(d.component,g,S);else{if(J&128){d.suspense.unmount(g,S);return}be&&Ht(d,null,p,"beforeUnmount"),J&64?d.type.remove(d,p,g,K,S):T&&!T.hasOnce&&(A!==ne||B>0&&B&64)?Ve(T,p,g,!1,!0):(A===ne&&B&384||!x&&J&16)&&Ve(D,p,g),S&&ct(d)}const Oe=ue!=null&&X==null;(ge&&(Ee=L&&L.onVnodeUnmounted)||be||Oe)&&ze(()=>{Ee&&mt(Ee,p,d),be&&Ht(d,null,p,"unmounted"),Oe&&(d.el=null)},g)},ct=d=>{const{type:p,el:g,anchor:S,transition:x}=d;if(p===ne){wt(g,S);return}if(p===zn){_(d);return}const A=()=>{o(g),x&&!x.persisted&&x.afterLeave&&x.afterLeave()};if(d.shapeFlag&1&&x&&!x.persisted){const{leave:L,delayLeave:N}=x,D=()=>L(g,A);N?N(d.el,A,D):D()}else A()},wt=(d,p)=>{let g;for(;d!==p;)g=m(d),o(d),d=g;o(p)},kt=(d,p,g)=>{const{bum:S,scope:x,job:A,subTree:L,um:N,m:D,a:T}=d;No(D),No(T),S&&Gn(S),x.stop(),A&&(A.flags|=8,je(L,d,p,g)),N&&ze(N,p),ze(()=>{d.isUnmounted=!0},p)},Ve=(d,p,g,S=!1,x=!1,A=0)=>{for(let L=A;L<d.length;L++)je(d[L],p,g,S,x)},R=d=>{if(d.shapeFlag&6)return R(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const p=m(d.anchor||d.el),g=p&&p[Vl];return g?m(g):p};let H=!1;const F=(d,p,g)=>{let S;d==null?p._vnode&&(je(p._vnode,null,null,!0),S=p._vnode.component):k(p._vnode||null,d,p,null,null,null,g),p._vnode=d,H||(H=!0,$o(S),Gr(),H=!1)},K={p:k,um:je,m:Qe,r:ct,mt:Ke,mc:V,pc:ae,pbc:Z,n:R,o:e};return{render:F,hydrate:void 0,createApp:ra(F)}}function Es({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Bt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function _a(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function yi(e,t,n=!1){const s=e.children,o=t.children;if(Y(s)&&Y(o))for(let r=0;r<s.length;r++){const i=s[r];let a=o[r];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[r]=St(o[r]),a.el=i.el),!n&&a.patchFlag!==-2&&yi(i,a)),a.type===gs&&(a.patchFlag===-1&&(a=o[r]=St(a)),a.el=i.el),a.type===_t&&!a.el&&(a.el=i.el)}}function wa(e){const t=e.slice(),n=[0];let s,o,r,i,a;const u=e.length;for(s=0;s<u;s++){const f=e[s];if(f!==0){if(o=n[n.length-1],e[o]<f){t[s]=o,n.push(s);continue}for(r=0,i=n.length-1;r<i;)a=r+i>>1,e[n[a]]<f?r=a+1:i=a;f<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,i=n[r-1];r-- >0;)n[r]=i,i=t[i];return n}function _i(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:_i(t)}function No(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function wi(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?wi(t.subTree):null}const ki=e=>e.__isSuspense;function ka(e,t){t&&t.pendingBranch?Y(e)?t.effects.push(...e):t.effects.push(e):Dl(e)}const ne=Symbol.for("v-fgt"),gs=Symbol.for("v-txt"),_t=Symbol.for("v-cmt"),zn=Symbol.for("v-stc"),Tt=[];let Ze=null;function v(e=!1){Tt.push(Ze=e?null:[])}function mo(){Tt.pop(),Ze=Tt[Tt.length-1]||null}let Pn=1;function ts(e,t=!1){Pn+=e,e<0&&Ze&&t&&(Ze.hasOnce=!0)}function Ci(e){return e.dynamicChildren=Pn>0?Ze||en:null,mo(),Pn>0&&Ze&&Ze.push(e),e}function w(e,t,n,s,o,r){return Ci(l(e,t,n,s,o,r,!0))}function xe(e,t,n,s,o){return Ci(ee(e,t,n,s,o,!0))}function Tn(e){return e?e.__v_isVNode===!0:!1}function gn(e,t){return e.type===t.type&&e.key===t.key}const $i=({key:e})=>e??null,Jn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?$e(e)||Fe(e)||oe(e)?{i:Me,r:e,k:t,f:!!n}:e:null);function l(e,t=null,n=null,s=0,o=null,r=e===ne?0:1,i=!1,a=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&$i(t),ref:t&&Jn(t),scopeId:zr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Me};return a?(ns(u,n),r&128&&e.normalize(u)):n&&(u.shapeFlag|=$e(n)?8:16),Pn>0&&!i&&Ze&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&Ze.push(u),u}const ee=Ca;function Ca(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===oi)&&(e=_t),Tn(e)){const a=an(e,t,!0);return n&&ns(a,n),Pn>0&&!r&&Ze&&(a.shapeFlag&6?Ze[Ze.indexOf(e)]=a:Ze.push(a)),a.patchFlag=-2,a}if(Ma(e)&&(e=e.__vccOpts),t){t=$a(t);let{class:a,style:u}=t;a&&!$e(a)&&(t.class=ce(a)),ve(u)&&(io(u)&&!Y(u)&&(u=Ne({},u)),t.style=Jt(u))}const i=$e(e)?1:ki(e)?128:ps(e)?64:ve(e)?4:oe(e)?2:0;return l(e,t,n,s,o,i,r,!0)}function $a(e){return e?io(e)||mi(e)?Ne({},e):e:null}function an(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:i,children:a,transition:u}=e,f=t?Si(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&$i(f),ref:t&&t.ref?n&&r?Y(r)?r.concat(Jn(t)):[r,Jn(t)]:Jn(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ne?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&an(e.ssContent),ssFallback:e.ssFallback&&an(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&s&&uo(c,u.clone(c)),c}function re(e=" ",t=0){return ee(gs,null,e,t)}function Ai(e,t){const n=ee(zn,null,e);return n.staticCount=t,n}function W(e="",t=!1){return t?(v(),xe(_t,null,e)):ee(_t,null,e)}function gt(e){return e==null||typeof e=="boolean"?ee(_t):Y(e)?ee(ne,null,e.slice()):Tn(e)?St(e):ee(gs,null,String(e))}function St(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:an(e)}function ns(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Y(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),ns(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!mi(t)?t._ctx=Me:o===3&&Me&&(Me.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(oe(t)){if(s&65){ns(e,{default:t});return}t={default:t,_ctx:Me},n=32}else t=String(t),s&64?(n=16,t=[re(t)]):n=8;e.children=t,e.shapeFlag|=n}function Si(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=ce([t.class,s.class]));else if(o==="style")t.style=Jt([t.style,s.style]);else if(os(o)){const r=t[o],i=s[o];i&&r!==i&&!(Y(r)&&r.includes(i))?t[o]=r?[].concat(r,i):i:i==null&&r==null&&!rs(o)&&(t[o]=i)}else o!==""&&(t[o]=s[o])}return t}function mt(e,t,n,s=null){at(e,t,7,[n,s])}const Aa=ui();let Sa=0;function Ea(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Aa,r={uid:Sa++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new rl(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:vi(s,o),emitsOptions:ci(s,o),emit:null,emitted:null,propsDefaults:ye,inheritAttrs:s.inheritAttrs,ctx:ye,data:ye,props:ye,attrs:ye,slots:ye,refs:ye,setupState:ye,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=la.bind(null,r),e.ce&&e.ce(r),r}let Le=null;const Ia=()=>Le||Me;let ss,On;{const e=us(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(i=>i(r)):o[0](r)}};ss=t("__VUE_INSTANCE_SETTERS__",n=>Le=n),On=t("__VUE_SSR_SETTERS__",n=>Dn=n)}const Un=e=>{const t=Le;return ss(e),e.scope.on(),()=>{e.scope.off(),ss(t)}},jo=()=>{Le&&Le.scope.off(),ss(null)};function Ei(e){return e.vnode.shapeFlag&4}let Dn=!1;function Ra(e,t=!1,n=!1){t&&On(t);const{props:s,children:o}=e.vnode,r=Ei(e);pa(e,s,r,t),ga(e,o,n||t);const i=r?Pa(e,t):void 0;return t&&On(!1),i}function Pa(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Zl);const{setup:s}=n;if(s){Ot();const o=e.setupContext=s.length>1?Oa(e):null,r=Un(e),i=Vn(s,e,0,[e.props,o]),a=yr(i);if(Dt(),r(),(a||e.sp)&&!sn(e)&&Xr(e),a){if(i.then(jo,jo),t)return i.then(u=>{On(!0);try{Vo(e,u,t)}finally{On(!1)}}).catch(u=>{fs(u,e,0)});e.asyncDep=i}else Vo(e,i)}else Ii(e)}function Vo(e,t,n){oe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ve(t)&&(e.setupState=Hr(t)),Ii(e)}function Ii(e,t,n){const s=e.type;e.render||(e.render=s.render||xt);{const o=Un(e);Ot();try{Xl(e)}finally{Dt(),o()}}}const Ta={get(e,t){return Ue(e,"get",""),e[t]}};function Oa(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Ta),slots:e.slots,emit:e.emit,expose:t}}function bs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hr(Cl(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in An)return An[n](e)},has(t,n){return n in t||n in An}})):e.proxy}function Da(e,t=!0){return oe(e)?e.displayName||e.name:e.name||t&&e.__name}function Ma(e){return oe(e)&&"__vccOpts"in e}const ie=(e,t)=>Il(e,t,Dn);function Ri(e,t,n){try{ts(-1);const s=arguments.length;return s===2?ve(t)&&!Y(t)?Tn(t)?ee(e,null,[t]):ee(e,t):ee(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Tn(n)&&(n=[n]),ee(e,t,n))}finally{ts(1)}}const Na="3.5.41";/**
|
|
* @vue/runtime-dom v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let Ws;const Uo=typeof window<"u"&&window.trustedTypes;if(Uo)try{Ws=Uo.createPolicy("vue",{createHTML:e=>e})}catch{}const Pi=Ws?e=>Ws.createHTML(e):e=>e,ja="http://www.w3.org/2000/svg",Va="http://www.w3.org/1998/Math/MathML",At=typeof document<"u"?document:null,Lo=At&&At.createElement("template"),Ua={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?At.createElementNS(ja,e):t==="mathml"?At.createElementNS(Va,e):n?At.createElement(e,{is:n}):At.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>At.createTextNode(e),createComment:e=>At.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>At.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const i=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{Lo.innerHTML=Pi(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const a=Lo.content;if(s==="svg"||s==="mathml"){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},La=Symbol("_vtc");function Fa(e,t,n){const s=e[La];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Fo=Symbol("_vod"),qa=Symbol("_vsh"),Ha=Symbol(""),Ba=/(?:^|;)\s*display\s*:/;function Wa(e,t,n){const s=e.style,o=$e(n);let r=!1;if(n&&!o){if(t)if($e(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&yn(s,a,"")}else for(const i in t)n[i]==null&&yn(s,i,"");for(const i in n){i==="display"&&(r=!0);const a=n[i];a!=null?Ka(e,i,!$e(t)&&t?t[i]:void 0,a)||yn(s,i,a):yn(s,i,"")}}else if(o){if(t!==n){const i=s[Ha];i&&(n+=";"+i),s.cssText=n,r=Ba.test(n)}}else t&&e.removeAttribute("style");Fo in e&&(e[Fo]=r?s.display:"",e[qa]&&(s.display="none"))}const qo=/\s*!important$/;function yn(e,t,n){if(Y(n))n.forEach(s=>yn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ga(e,t);qo.test(n)?e.setProperty(Qt(s),n.replace(qo,""),"important"):e[s]=n}}const Ho=["Webkit","Moz","ms"],Is={};function Ga(e,t){const n=Is[t];if(n)return n;let s=Ge(t);if(s!=="filter"&&s in e)return Is[t]=s;s=ls(s);for(let o=0;o<Ho.length;o++){const r=Ho[o]+s;if(r in e)return Is[t]=r}return t}function Ka(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&$e(s)&&n===s}const Bo="http://www.w3.org/1999/xlink";function Wo(e,t,n,s,o,r=sl(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Bo,t.slice(6,t.length)):e.setAttributeNS(Bo,t,n):n==null||r&&!Cr(n)?e.removeAttribute(t):e.setAttribute(t,r?"":it(n)?String(n):n)}function Go(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Pi(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const a=r==="OPTION"?e.getAttribute("value")||"":e.value,u=n==null?e.type==="checkbox"?"on":"":String(n);(a!==u||!("_value"in e))&&(e.value=u),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Cr(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function Rt(e,t,n,s){e.addEventListener(t,n,s)}function za(e,t,n,s){e.removeEventListener(t,n,s)}const Ko=Symbol("_vei");function Ja(e,t,n,s,o=null){const r=e[Ko]||(e[Ko]={}),i=r[t];if(s&&i)i.value=s;else{const[a,u]=Za(t);if(s){const f=r[t]=tu(s,o);Rt(e,a,f,u)}else i&&(za(e,a,i,u),r[t]=void 0)}}const Qa=/(Once|Passive|Capture)$/,Ya=/^on:?(?:Once|Passive|Capture)$/;function Za(e){let t,n;for(;(n=e.match(Qa))&&!Ya.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Qt(e.slice(2)),t]}let Rs=0;const Xa=Promise.resolve(),eu=()=>Rs||(Xa.then(()=>Rs=0),Rs=Date.now());function tu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Y(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const i=o.slice(),a=[s];for(let u=0;u<i.length&&!s._stopped;u++){const f=i[u];f&&at(f,t,5,a)}}else at(o,t,5,[s])};return n.value=e,n.attached=eu(),n}const zo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,nu=(e,t,n,s,o,r)=>{const i=o==="svg";t==="class"?Fa(e,s,i):t==="style"?Wa(e,n,s):os(t)?rs(t)||Ja(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):su(e,t,s,i))?(Go(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Wo(e,t,s,i,r,t!=="value")):e._isVueCE&&(ou(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$e(s)))?Go(e,Ge(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Wo(e,t,s,i))};function su(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&zo(t)&&oe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return zo(t)&&$e(n)?!1:t in e}function ou(e,t){const n=e._def.props;if(!n)return!1;const s=Ge(t);return Array.isArray(n)?n.some(o=>Ge(o)===s):Object.keys(n).some(o=>Ge(o)===s)}const qt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Y(t)?n=>Gn(t,n):t};function ru(e){e.target.composing=!0}function Jo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Xe=Symbol("_assign"),Hn=Symbol("_initialValue");function Ps(e,t,n){return t&&(e=e.trim()),n&&(e=as(e)),e}const de={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Hn]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Hn]=e.defaultValue.replace(/\r\n?/g,`
|
|
`))),e[Xe]=qt(o);const r=s||o.props&&o.props.type==="number";Rt(e,t?"change":"input",i=>{i.target.composing||e[Xe](Ps(e.value,n,r))}),(n||r)&&Rt(e,"change",()=>{e.value=Ps(e.value,n,r)}),t||(Rt(e,"compositionstart",ru),Rt(e,"compositionend",Jo),Rt(e,"change",Jo))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",r=e[Hn];delete e[Hn],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[Xe](Ps(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},i){if(e[Xe]=qt(i),e.composing)return;const a=(r||e.type==="number")&&!/^0\d/.test(e.value)?as(e.value):e.value,u=t??"";if(a===u)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===u)||(e.value=u)}},yt={deep:!0,created(e,t,n){e[Xe]=qt(n),Rt(e,"change",()=>{const s=e._modelValue,o=cn(e),r=e.checked,i=e[Xe];if(Y(s)){const a=Xs(s,o),u=a!==-1;if(r&&!u)i(s.concat(o));else if(!r&&u){const f=[...s];f.splice(a,1),i(f)}}else if(pn(s)){const a=new Set(s);r?a.add(o):a.delete(o),i(a)}else i(Ti(e,r))})},mounted:Qo,beforeUpdate(e,t,n){e[Xe]=qt(n),Qo(e,t,n)}};function Qo(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(Y(t))o=Xs(t,s.props.value)>-1;else if(pn(t))o=t.has(s.props.value);else{if(t===n)return;o=Ft(t,Ti(e,!0))}e.checked!==o&&(e.checked=o)}const iu={created(e,{value:t},n){e.checked=Ft(t,n.props.value),e[Xe]=qt(n),Rt(e,"change",()=>{e[Xe](cn(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Xe]=qt(s),t!==n&&(e.checked=Ft(t,s.props.value))}},un={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Rt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?as(cn(r)):cn(r));e[Xe](e.multiple?pn(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,lo(()=>{e._assigning=!1})}),e[Xe]=qt(s)},mounted(e,{value:t}){Yo(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Xe]=qt(n)},updated(e,{value:t}){e._assigning||Yo(e,t)}};function Yo(e,t){const n=e.multiple,s=Y(t);if(!(n&&!s&&!pn(t))){for(let o=0,r=e.options.length;o<r;o++){const i=e.options[o],a=cn(i);if(n)if(s){const u=typeof a;u==="string"||u==="number"?i.selected=t.some(f=>String(f)===String(a)):i.selected=Xs(t,a)>-1}else i.selected=t.has(a);else if(Ft(cn(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cn(e){return"_value"in e?e._value:e.value}function Ti(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const lu=["ctrl","shift","alt","meta"],au={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>lu.some(n=>e[`${n}Key`]&&!t.includes(n))},Pe=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let i=0;i<t.length;i++){const a=au[t[i]];if(a&&a(o,t))return}return e(o,...r)}))},uu=Ne({patchProp:nu},Ua);let Zo;function cu(){return Zo||(Zo=xa(uu))}const du=((...e)=>{const t=cu().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=pu(s);if(!o)return;const r=t._component;!oe(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,fu(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function fu(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function pu(e){return $e(e)?document.querySelector(e):e}const mu=["width","height"],Te={__name:"UiIcono",props:{nombre:{type:String,required:!0},tam:{type:[Number,String],default:16}},setup(e){const t={luna:[["path",{d:"M20 14.5A8.5 8.5 0 0 1 9.5 4a8.5 8.5 0 1 0 10.5 10.5Z"}]],sol:[["circle",{cx:12,cy:12,r:4}],["path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"}]],lapiz:[["path",{d:"M12 20h9"}],["path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"}]],cerrar:[["path",{d:"M18 6 6 18M6 6l12 12"}]],atras:[["path",{d:"M19 12H5M12 19l-7-7 7-7"}]],grafico:[["path",{d:"M3 3v18h18"}],["path",{d:"M7 15v3M12 10v8M17 6v12"}]],cerebro:[["path",{d:"M9.5 3A2.5 2.5 0 0 0 7 5.5v.2A2.7 2.7 0 0 0 5 8.3c0 .8.3 1.5.9 2A2.8 2.8 0 0 0 5 12.5c0 1 .5 1.9 1.3 2.4-.2.4-.3.8-.3 1.2A2.9 2.9 0 0 0 9 19a2.5 2.5 0 0 0 3 2V3.8A2.5 2.5 0 0 0 9.5 3Z"}],["path",{d:"M14.5 3A2.5 2.5 0 0 1 17 5.5v.2a2.7 2.7 0 0 1 2 2.6c0 .8-.3 1.5-.9 2A2.8 2.8 0 0 1 19 12.5c0 1-.5 1.9-1.3 2.4.2.4.3.8.3 1.2A2.9 2.9 0 0 1 15 19a2.5 2.5 0 0 1-3 2"}]],imagen:[["rect",{x:3,y:3,width:18,height:18,rx:2}],["circle",{cx:8.5,cy:8.5,r:1.5}],["path",{d:"m21 15-5-5L5 21"}]],microfono:[["rect",{x:9,y:2,width:6,height:12,rx:3}],["path",{d:"M5 10a7 7 0 0 0 14 0M12 17v5"}]],escribir:[["path",{d:"M3 21h18"}],["path",{d:"M5 17 17.5 4.5a2.1 2.1 0 0 1 3 3L8 20l-4 1Z"}]],archivo:[["path",{d:"M14 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v5h5"}]],sitio:[["circle",{cx:12,cy:12,r:9}],["path",{d:"M3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18Z"}]],refrescar:[["path",{d:"M21 12a9 9 0 1 1-3-6.7"}],["path",{d:"M21 4v5h-5"}]],descargar:[["path",{d:"M12 3v12"}],["path",{d:"m7 11 5 5 5-5"}],["path",{d:"M4 21h16"}]],alerta:[["path",{d:"M12 9v4M12 17h.01"}],["path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"}]],ok:[["path",{d:"M20 6 9 17l-5-5"}]],copiar:[["rect",{x:9,y:9,width:12,height:12,rx:2}],["path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}]],mensaje:[["path",{d:"M21 11.5a8.4 8.4 0 0 1-9 8.4 8.5 8.5 0 0 1-3.9-.9L3 21l1.9-5.1A8.4 8.4 0 0 1 4 11.5a8.5 8.5 0 0 1 8.5-8.5A8.4 8.4 0 0 1 21 11.5Z"}]],auto:[["path",{d:"M17 2.1 21 6l-4 3.9"}],["path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}],["path",{d:"M7 21.9 3 18l4-3.9"}],["path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}]]};return(n,s)=>(v(),w("svg",{width:e.tam,height:e.tam,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round",class:"inline-block shrink-0 align-[-0.15em]","aria-hidden":"true"},[(v(!0),w(ne,null,we(t[e.nombre]||[],(o,r)=>(v(),xe(Ql(o[0]),Si({key:r},{ref_for:!0},o[1]),null,16))),128))],8,mu))}};/*!
|
|
* vue-router v4.6.4
|
|
* (c) 2025 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/const Xt=typeof document<"u";function Oi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function hu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Oi(e.default)}const pe=Object.assign;function Ts(e,t){const n={};for(const s in t){const o=t[s];n[s]=ut(o)?o.map(e):e(o)}return n}const Sn=()=>{},ut=Array.isArray;function Xo(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Di=/#/g,vu=/&/g,gu=/\//g,bu=/=/g,xu=/\?/g,Mi=/\+/g,yu=/%5B/g,_u=/%5D/g,Ni=/%5E/g,wu=/%60/g,ji=/%7B/g,ku=/%7C/g,Vi=/%7D/g,Cu=/%20/g;function ho(e){return e==null?"":encodeURI(""+e).replace(ku,"|").replace(yu,"[").replace(_u,"]")}function $u(e){return ho(e).replace(ji,"{").replace(Vi,"}").replace(Ni,"^")}function Gs(e){return ho(e).replace(Mi,"%2B").replace(Cu,"+").replace(Di,"%23").replace(vu,"%26").replace(wu,"`").replace(ji,"{").replace(Vi,"}").replace(Ni,"^")}function Au(e){return Gs(e).replace(bu,"%3D")}function Su(e){return ho(e).replace(Di,"%23").replace(xu,"%3F")}function Eu(e){return Su(e).replace(gu,"%2F")}function Mn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Iu=/\/$/,Ru=e=>e.replace(Iu,"");function Os(e,t,n="/"){let s,o={},r="",i="";const a=t.indexOf("#");let u=t.indexOf("?");return u=a>=0&&u>a?-1:u,u>=0&&(s=t.slice(0,u),r=t.slice(u,a>0?a:t.length),o=e(r.slice(1))),a>=0&&(s=s||t.slice(0,a),i=t.slice(a,t.length)),s=Du(s??t,n),{fullPath:s+r+i,path:s,query:o,hash:Mn(i)}}function Pu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function er(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Tu(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&dn(t.matched[s],n.matched[o])&&Ui(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function dn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ui(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Ou(e[n],t[n]))return!1;return!0}function Ou(e,t){return ut(e)?tr(e,t):ut(t)?tr(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function tr(e,t){return ut(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Du(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),o=s[s.length-1];(o===".."||o===".")&&s.push("");let r=n.length-1,i,a;for(i=0;i<s.length;i++)if(a=s[i],a!==".")if(a==="..")r>1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i).join("/")}const Vt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ks=(function(e){return e.pop="pop",e.push="push",e})({}),Ds=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Mu(e){if(!e)if(Xt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ru(e)}const Nu=/^[^#]+#/;function ju(e,t){return e.replace(Nu,"#")+t}function Vu(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const xs=()=>({left:window.scrollX,top:window.scrollY});function Uu(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Vu(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function nr(e,t){return(history.state?history.state.position-t:-1)+e}const zs=new Map;function Lu(e,t){zs.set(e,t)}function Fu(e){const t=zs.get(e);return zs.delete(e),t}function qu(e){return typeof e=="string"||e&&typeof e=="object"}function Li(e){return typeof e=="string"||typeof e=="symbol"}let Ae=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Fi=Symbol("");Ae.MATCHER_NOT_FOUND+"",Ae.NAVIGATION_GUARD_REDIRECT+"",Ae.NAVIGATION_ABORTED+"",Ae.NAVIGATION_CANCELLED+"",Ae.NAVIGATION_DUPLICATED+"";function fn(e,t){return pe(new Error,{type:e,[Fi]:!0},t)}function $t(e,t){return e instanceof Error&&Fi in e&&(t==null||!!(e.type&t))}const Hu=["params","query","hash"];function Bu(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Hu)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Wu(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;s<n.length;++s){const o=n[s].replace(Mi," "),r=o.indexOf("="),i=Mn(r<0?o:o.slice(0,r)),a=r<0?null:Mn(o.slice(r+1));if(i in t){let u=t[i];ut(u)||(u=t[i]=[u]),u.push(a)}else t[i]=a}return t}function sr(e){let t="";for(let n in e){const s=e[n];if(n=Au(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(ut(s)?s.map(o=>o&&Gs(o)):[s&&Gs(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function Gu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=ut(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const Ku=Symbol(""),or=Symbol(""),ys=Symbol(""),vo=Symbol(""),Js=Symbol("");function bn(){let e=[];function t(s){return e.push(s),()=>{const o=e.indexOf(s);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Lt(e,t,n,s,o,r=i=>i()){const i=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((a,u)=>{const f=m=>{m===!1?u(fn(Ae.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?u(m):qu(m)?u(fn(Ae.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(i&&s.enterCallbacks[o]===i&&typeof m=="function"&&i.push(m),a())},c=r(()=>e.call(s&&s.instances[o],t,n,f));let h=Promise.resolve(c);e.length<3&&(h=h.then(f)),h.catch(m=>u(m))})}function Ms(e,t,n,s,o=r=>r()){const r=[];for(const i of e)for(const a in i.components){let u=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(Oi(u)){const f=(u.__vccOpts||u)[t];f&&r.push(Lt(f,n,s,i,a,o))}else{let f=u();r.push(()=>f.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const h=hu(c)?c.default:c;i.mods[a]=c,i.components[a]=h;const m=(h.__vccOpts||h)[t];return m&&Lt(m,n,s,i,a,o)()}))}}return r}function zu(e,t){const n=[],s=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let i=0;i<r;i++){const a=t.matched[i];a&&(e.matched.find(f=>dn(f,a))?s.push(a):n.push(a));const u=e.matched[i];u&&(t.matched.find(f=>dn(f,u))||o.push(u))}return[n,s,o]}/*!
|
|
* vue-router v4.6.4
|
|
* (c) 2025 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/let Ju=()=>location.protocol+"//"+location.host;function qi(e,t){const{pathname:n,search:s,hash:o}=t,r=e.indexOf("#");if(r>-1){let i=o.includes(e.slice(r))?e.slice(r).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),er(a,"")}return er(n,e)+s+o}function Qu(e,t,n,s){let o=[],r=[],i=null;const a=({state:m})=>{const b=qi(e,location),$=n.value,k=t.value;let P=0;if(m){if(n.value=b,t.value=m,i&&i===$){i=null;return}P=k?m.position-k.position:0}else s(b);o.forEach(M=>{M(n.value,$,{delta:P,type:Ks.pop,direction:P?P>0?Ds.forward:Ds.back:Ds.unknown})})};function u(){i=n.value}function f(m){o.push(m);const b=()=>{const $=o.indexOf(m);$>-1&&o.splice($,1)};return r.push(b),b}function c(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(pe({},m.state,{scroll:xs()}),"")}}function h(){for(const m of r)m();r=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:u,listen:f,destroy:h}}function rr(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?xs():null}}function Yu(e){const{history:t,location:n}=window,s={value:qi(e,n)},o={value:t.state};o.value||r(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(u,f,c){const h=e.indexOf("#"),m=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+u:Ju()+e+u;try{t[c?"replaceState":"pushState"](f,"",m),o.value=f}catch(b){console.error(b),n[c?"replace":"assign"](m)}}function i(u,f){r(u,pe({},t.state,rr(o.value.back,u,o.value.forward,!0),f,{position:o.value.position}),!0),s.value=u}function a(u,f){const c=pe({},o.value,t.state,{forward:u,scroll:xs()});r(c.current,c,!0),r(u,pe({},rr(s.value,u,null),{position:c.position+1},f),!1),s.value=u}return{location:s,state:o,push:a,replace:i}}function Zu(e){e=Mu(e);const t=Yu(e),n=Qu(e,t.state,t.location,t.replace);function s(r,i=!0){i||n.pauseListeners(),history.go(r)}const o=pe({location:"",base:e,go:s,createHref:ju.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}let Gt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ie=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Ie||{});const Xu={type:Gt.Static,value:""},ec=/[a-zA-Z0-9_]/;function tc(e){if(!e)return[[]];if(e==="/")return[[Xu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${f}": ${b}`)}let n=Ie.Static,s=n;const o=[];let r;function i(){r&&o.push(r),r=[]}let a=0,u,f="",c="";function h(){f&&(n===Ie.Static?r.push({type:Gt.Static,value:f}):n===Ie.Param||n===Ie.ParamRegExp||n===Ie.ParamRegExpEnd?(r.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),r.push({type:Gt.Param,value:f,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),f="")}function m(){f+=u}for(;a<e.length;){if(u=e[a++],u==="\\"&&n!==Ie.ParamRegExp){s=n,n=Ie.EscapeNext;continue}switch(n){case Ie.Static:u==="/"?(f&&h(),i()):u===":"?(h(),n=Ie.Param):m();break;case Ie.EscapeNext:m(),n=s;break;case Ie.Param:u==="("?n=Ie.ParamRegExp:ec.test(u)?m():(h(),n=Ie.Static,u!=="*"&&u!=="?"&&u!=="+"&&a--);break;case Ie.ParamRegExp:u===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+u:n=Ie.ParamRegExpEnd:c+=u;break;case Ie.ParamRegExpEnd:h(),n=Ie.Static,u!=="*"&&u!=="?"&&u!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Ie.ParamRegExp&&t(`Unfinished custom RegExp for param "${f}"`),h(),i(),o}const ir="[^/]+?",nc={sensitive:!1,strict:!1,start:!0,end:!0};var Be=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Be||{});const sc=/[.+*?^${}()[\]/\\]/g;function oc(e,t){const n=pe({},nc,t),s=[];let o=n.start?"^":"";const r=[];for(const f of e){const c=f.length?[]:[Be.Root];n.strict&&!f.length&&(o+="/");for(let h=0;h<f.length;h++){const m=f[h];let b=Be.Segment+(n.sensitive?Be.BonusCaseSensitive:0);if(m.type===Gt.Static)h||(o+="/"),o+=m.value.replace(sc,"\\$&"),b+=Be.Static;else if(m.type===Gt.Param){const{value:$,repeatable:k,optional:P,regexp:M}=m;r.push({name:$,repeatable:k,optional:P});const E=M||ir;if(E!==ir){b+=Be.BonusCustomRegExp;try{`${E}`}catch(_){throw new Error(`Invalid custom RegExp for param "${$}" (${E}): `+_.message)}}let C=k?`((?:${E})(?:/(?:${E}))*)`:`(${E})`;h||(C=P&&f.length<2?`(?:/${C})`:"/"+C),P&&(C+="?"),o+=C,b+=Be.Dynamic,P&&(b+=Be.BonusOptional),k&&(b+=Be.BonusRepeatable),E===".*"&&(b+=Be.BonusWildcard)}c.push(b)}s.push(c)}if(n.strict&&n.end){const f=s.length-1;s[f][s[f].length-1]+=Be.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(f){const c=f.match(i),h={};if(!c)return null;for(let m=1;m<c.length;m++){const b=c[m]||"",$=r[m-1];h[$.name]=b&&$.repeatable?b.split("/"):b}return h}function u(f){let c="",h=!1;for(const m of e){(!h||!c.endsWith("/"))&&(c+="/"),h=!1;for(const b of m)if(b.type===Gt.Static)c+=b.value;else if(b.type===Gt.Param){const{value:$,repeatable:k,optional:P}=b,M=$ in f?f[$]:"";if(ut(M)&&!k)throw new Error(`Provided param "${$}" is an array but it is not repeatable (* or + modifiers)`);const E=ut(M)?M.join("/"):M;if(!E)if(P)m.length<2&&(c.endsWith("/")?c=c.slice(0,-1):h=!0);else throw new Error(`Missing required param "${$}"`);c+=E}}return c||"/"}return{re:i,score:s,keys:r,parse:a,stringify:u}}function rc(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Be.Static+Be.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Be.Static+Be.Segment?1:-1:0}function Hi(e,t){let n=0;const s=e.score,o=t.score;for(;n<s.length&&n<o.length;){const r=rc(s[n],o[n]);if(r)return r;n++}if(Math.abs(o.length-s.length)===1){if(lr(s))return 1;if(lr(o))return-1}return o.length-s.length}function lr(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const ic={strict:!1,end:!0,sensitive:!1};function lc(e,t,n){const s=oc(tc(e.path),n),o=pe(s,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function ac(e,t){const n=[],s=new Map;t=Xo(ic,t);function o(h){return s.get(h)}function r(h,m,b){const $=!b,k=ur(h);k.aliasOf=b&&b.record;const P=Xo(t,h),M=[k];if("alias"in h){const _=typeof h.alias=="string"?[h.alias]:h.alias;for(const y of _)M.push(ur(pe({},k,{components:b?b.record.components:k.components,path:y,aliasOf:b?b.record:k})))}let E,C;for(const _ of M){const{path:y}=_;if(m&&y[0]!=="/"){const O=m.record.path,j=O[O.length-1]==="/"?"":"/";_.path=m.record.path+(y&&j+y)}if(E=lc(_,m,P),b?b.alias.push(E):(C=C||E,C!==E&&C.alias.push(E),$&&h.name&&!cr(E)&&i(h.name)),Bi(E)&&u(E),k.children){const O=k.children;for(let j=0;j<O.length;j++)r(O[j],E,b&&b.children[j])}b=b||E}return C?()=>{i(C)}:Sn}function i(h){if(Li(h)){const m=s.get(h);m&&(s.delete(h),n.splice(n.indexOf(m),1),m.children.forEach(i),m.alias.forEach(i))}else{const m=n.indexOf(h);m>-1&&(n.splice(m,1),h.record.name&&s.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function a(){return n}function u(h){const m=dc(h,n);n.splice(m,0,h),h.record.name&&!cr(h)&&s.set(h.record.name,h)}function f(h,m){let b,$={},k,P;if("name"in h&&h.name){if(b=s.get(h.name),!b)throw fn(Ae.MATCHER_NOT_FOUND,{location:h});P=b.record.name,$=pe(ar(m.params,b.keys.filter(C=>!C.optional).concat(b.parent?b.parent.keys.filter(C=>C.optional):[]).map(C=>C.name)),h.params&&ar(h.params,b.keys.map(C=>C.name))),k=b.stringify($)}else if(h.path!=null)k=h.path,b=n.find(C=>C.re.test(k)),b&&($=b.parse(k),P=b.record.name);else{if(b=m.name?s.get(m.name):n.find(C=>C.re.test(m.path)),!b)throw fn(Ae.MATCHER_NOT_FOUND,{location:h,currentLocation:m});P=b.record.name,$=pe({},m.params,h.params),k=b.stringify($)}const M=[];let E=b;for(;E;)M.unshift(E.record),E=E.parent;return{name:P,path:k,params:$,matched:M,meta:cc(M)}}e.forEach(h=>r(h));function c(){n.length=0,s.clear()}return{addRoute:r,resolve:f,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:o}}function ar(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function ur(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:uc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function uc(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function cr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function cc(e){return e.reduce((t,n)=>pe(t,n.meta),{})}function dc(e,t){let n=0,s=t.length;for(;n!==s;){const r=n+s>>1;Hi(e,t[r])<0?s=r:n=r+1}const o=fc(e);return o&&(s=t.lastIndexOf(o,s-1)),s}function fc(e){let t=e;for(;t=t.parent;)if(Bi(t)&&Hi(e,t)===0)return t}function Bi({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function dr(e){const t=ot(ys),n=ot(vo),s=ie(()=>{const u=Re(e.to);return t.resolve(u)}),o=ie(()=>{const{matched:u}=s.value,{length:f}=u,c=u[f-1],h=n.matched;if(!c||!h.length)return-1;const m=h.findIndex(dn.bind(null,c));if(m>-1)return m;const b=fr(u[f-2]);return f>1&&fr(c)===b&&h[h.length-1].path!==b?h.findIndex(dn.bind(null,u[f-2])):m}),r=ie(()=>o.value>-1&&gc(n.params,s.value.params)),i=ie(()=>o.value>-1&&o.value===n.matched.length-1&&Ui(n.params,s.value.params));function a(u={}){if(vc(u)){const f=t[Re(e.replace)?"replace":"push"](Re(e.to)).catch(Sn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:s,href:ie(()=>s.value.href),isActive:r,isExactActive:i,navigate:a}}function pc(e){return e.length===1?e[0]:e}const mc=Zr({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:dr,setup(e,{slots:t}){const n=ds(dr(e)),{options:s}=ot(ys),o=ie(()=>({[pr(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[pr(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=t.default&&pc(t.default(n));return e.custom?r:Ri("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},r)}}}),hc=mc;function vc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function gc(e,t){for(const n in t){const s=t[n],o=e[n];if(typeof s=="string"){if(s!==o)return!1}else if(!ut(o)||o.length!==s.length||s.some((r,i)=>r.valueOf()!==o[i].valueOf()))return!1}return!0}function fr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const pr=(e,t,n)=>e??t??n,bc=Zr({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=ot(Js),o=ie(()=>e.route||s.value),r=ot(or,0),i=ie(()=>{let f=Re(r);const{matched:c}=o.value;let h;for(;(h=c[f])&&!h.components;)f++;return f}),a=ie(()=>o.value.matched[i.value]);Kn(or,ie(()=>i.value+1)),Kn(Ku,a),Kn(Js,o);const u=q();return Pt(()=>[u.value,a.value,e.name],([f,c,h],[m,b,$])=>{c&&(c.instances[h]=f,b&&b!==c&&f&&f===m&&(c.leaveGuards.size||(c.leaveGuards=b.leaveGuards),c.updateGuards.size||(c.updateGuards=b.updateGuards))),f&&c&&(!b||!dn(c,b)||!m)&&(c.enterCallbacks[h]||[]).forEach(k=>k(f))},{flush:"post"}),()=>{const f=o.value,c=e.name,h=a.value,m=h&&h.components[c];if(!m)return mr(n.default,{Component:m,route:f});const b=h.props[c],$=b?b===!0?f.params:typeof b=="function"?b(f):b:null,P=Ri(m,pe({},$,t,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(h.instances[c]=null)},ref:u}));return mr(n.default,{Component:P,route:f})||P}}});function mr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const xc=bc;function yc(e){const t=ac(e.routes,e),n=e.parseQuery||Wu,s=e.stringifyQuery||sr,o=e.history,r=bn(),i=bn(),a=bn(),u=$l(Vt);let f=Vt;Xt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ts.bind(null,R=>""+R),h=Ts.bind(null,Eu),m=Ts.bind(null,Mn);function b(R,H){let F,K;return Li(R)?(F=t.getRecordMatcher(R),K=H):K=R,t.addRoute(K,F)}function $(R){const H=t.getRecordMatcher(R);H&&t.removeRoute(H)}function k(){return t.getRoutes().map(R=>R.record)}function P(R){return!!t.getRecordMatcher(R)}function M(R,H){if(H=pe({},H||u.value),typeof R=="string"){const g=Os(n,R,H.path),S=t.resolve({path:g.path},H),x=o.createHref(g.fullPath);return pe(g,S,{params:m(S.params),hash:Mn(g.hash),redirectedFrom:void 0,href:x})}let F;if(R.path!=null)F=pe({},R,{path:Os(n,R.path,H.path).path});else{const g=pe({},R.params);for(const S in g)g[S]==null&&delete g[S];F=pe({},R,{params:h(g)}),H.params=h(H.params)}const K=t.resolve(F,H),le=R.hash||"";K.params=c(m(K.params));const d=Pu(s,pe({},R,{hash:$u(le),path:K.path})),p=o.createHref(d);return pe({fullPath:d,hash:le,query:s===sr?Gu(R.query):R.query||{}},K,{redirectedFrom:void 0,href:p})}function E(R){return typeof R=="string"?Os(n,R,u.value.path):pe({},R)}function C(R,H){if(f!==R)return fn(Ae.NAVIGATION_CANCELLED,{from:H,to:R})}function _(R){return j(R)}function y(R){return _(pe(E(R),{replace:!0}))}function O(R,H){const F=R.matched[R.matched.length-1];if(F&&F.redirect){const{redirect:K}=F;let le=typeof K=="function"?K(R,H):K;return typeof le=="string"&&(le=le.includes("?")||le.includes("#")?le=E(le):{path:le},le.params={}),pe({query:R.query,hash:R.hash,params:le.path!=null?{}:R.params},le)}}function j(R,H){const F=f=M(R),K=u.value,le=R.state,d=R.force,p=R.replace===!0,g=O(F,K);if(g)return j(pe(E(g),{state:typeof g=="object"?pe({},le,g.state):le,force:d,replace:p}),H||F);const S=F;S.redirectedFrom=H;let x;return!d&&Tu(s,K,F)&&(x=fn(Ae.NAVIGATION_DUPLICATED,{to:S,from:K}),Qe(K,K,!0,!1)),(x?Promise.resolve(x):Z(S,K)).catch(A=>$t(A)?$t(A,Ae.NAVIGATION_GUARD_REDIRECT)?A:qe(A):ae(A,S,K)).then(A=>{if(A){if($t(A,Ae.NAVIGATION_GUARD_REDIRECT))return j(pe({replace:p},E(A.to),{state:typeof A.to=="object"?pe({},le,A.to.state):le,force:d}),H||S)}else A=Se(S,K,!0,p,le);return U(S,K,A),A})}function V(R,H){const F=C(R,H);return F?Promise.reject(F):Promise.resolve()}function ke(R){const H=wt.values().next().value;return H&&typeof H.runWithContext=="function"?H.runWithContext(R):R()}function Z(R,H){let F;const[K,le,d]=zu(R,H);F=Ms(K.reverse(),"beforeRouteLeave",R,H);for(const g of K)g.leaveGuards.forEach(S=>{F.push(Lt(S,R,H))});const p=V.bind(null,R,H);return F.push(p),Ve(F).then(()=>{F=[];for(const g of r.list())F.push(Lt(g,R,H));return F.push(p),Ve(F)}).then(()=>{F=Ms(le,"beforeRouteUpdate",R,H);for(const g of le)g.updateGuards.forEach(S=>{F.push(Lt(S,R,H))});return F.push(p),Ve(F)}).then(()=>{F=[];for(const g of d)if(g.beforeEnter)if(ut(g.beforeEnter))for(const S of g.beforeEnter)F.push(Lt(S,R,H));else F.push(Lt(g.beforeEnter,R,H));return F.push(p),Ve(F)}).then(()=>(R.matched.forEach(g=>g.enterCallbacks={}),F=Ms(d,"beforeRouteEnter",R,H,ke),F.push(p),Ve(F))).then(()=>{F=[];for(const g of i.list())F.push(Lt(g,R,H));return F.push(p),Ve(F)}).catch(g=>$t(g,Ae.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function U(R,H,F){a.list().forEach(K=>ke(()=>K(R,H,F)))}function Se(R,H,F,K,le){const d=C(R,H);if(d)return d;const p=H===Vt,g=Xt?history.state:{};F&&(K||p?o.replace(R.fullPath,pe({scroll:p&&g&&g.scroll},le)):o.push(R.fullPath,le)),u.value=R,Qe(R,H,F,p),qe()}let G;function Ke(){G||(G=o.listen((R,H,F)=>{if(!kt.listening)return;const K=M(R),le=O(K,kt.currentRoute.value);if(le){j(pe(le,{replace:!0,force:!0}),K).catch(Sn);return}f=K;const d=u.value;Xt&&Lu(nr(d.fullPath,F.delta),xs()),Z(K,d).catch(p=>$t(p,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_CANCELLED)?p:$t(p,Ae.NAVIGATION_GUARD_REDIRECT)?(j(pe(E(p.to),{force:!0}),K).then(g=>{$t(g,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_DUPLICATED)&&!F.delta&&F.type===Ks.pop&&o.go(-1,!1)}).catch(Sn),Promise.reject()):(F.delta&&o.go(-F.delta,!1),ae(p,K,d))).then(p=>{p=p||Se(K,d,!1),p&&(F.delta&&!$t(p,Ae.NAVIGATION_CANCELLED)?o.go(-F.delta,!1):F.type===Ks.pop&&$t(p,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),U(K,d,p)}).catch(Sn)}))}let jt=bn(),Ce=bn(),fe;function ae(R,H,F){qe(R);const K=Ce.list();return K.length?K.forEach(le=>le(R,H,F)):console.error(R),Promise.reject(R)}function et(){return fe&&u.value!==Vt?Promise.resolve():new Promise((R,H)=>{jt.add([R,H])})}function qe(R){return fe||(fe=!R,Ke(),jt.list().forEach(([H,F])=>R?F(R):H()),jt.reset()),R}function Qe(R,H,F,K){const{scrollBehavior:le}=e;if(!Xt||!le)return Promise.resolve();const d=!F&&Fu(nr(R.fullPath,0))||(K||!F)&&history.state&&history.state.scroll||null;return lo().then(()=>le(R,H,d)).then(p=>p&&Uu(p)).catch(p=>ae(p,R,H))}const je=R=>o.go(R);let ct;const wt=new Set,kt={currentRoute:u,listening:!0,addRoute:b,removeRoute:$,clearRoutes:t.clearRoutes,hasRoute:P,getRoutes:k,resolve:M,options:e,push:_,replace:y,go:je,back:()=>je(-1),forward:()=>je(1),beforeEach:r.add,beforeResolve:i.add,afterEach:a.add,onError:Ce.add,isReady:et,install(R){R.component("RouterLink",hc),R.component("RouterView",xc),R.config.globalProperties.$router=kt,Object.defineProperty(R.config.globalProperties,"$route",{enumerable:!0,get:()=>Re(u)}),Xt&&!ct&&u.value===Vt&&(ct=!0,_(o.location).catch(K=>{}));const H={};for(const K in Vt)Object.defineProperty(H,K,{get:()=>u.value[K],enumerable:!0});R.provide(ys,kt),R.provide(vo,Fr(H)),R.provide(Js,u);const F=R.unmount;wt.add(R),R.unmount=function(){wt.delete(R),wt.size<1&&(f=Vt,G&&G(),G=null,u.value=Vt,ct=!1,fe=!1),F()}}};function Ve(R){return R.reduce((H,F)=>H.then(()=>ke(F)),Promise.resolve())}return kt}function go(){return ot(ys)}function Wi(e){return ot(vo)}const Bn=window.location.pathname.startsWith("/portal/"),Je={esPortal:Bn,baseRuta:Bn?"/portal/studio/":"/studio/",apiBase:Bn?"/portal":"/app",urlLogin:Bn?"/portal/login":"/login"};function te(e){return Je.apiBase+e}async function Wn(e,t={}){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t.headers}}),s=n.headers.get("content-type")||"";if(n.redirected||!s.includes("application/json"))throw window.location.href=Je.urlLogin,new Error("Sesión expirada");const o=await n.json();if(!n.ok){const r=typeof(o==null?void 0:o.error)=="string"?o.error:o==null?void 0:o.message;throw new Error(r||"Error de servidor")}return o}const se={get:e=>Wn(e),post:(e,t)=>Wn(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Wn(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>Wn(e,{method:"DELETE"})},_n=q(!1),_c={class:"h-14 px-4 flex items-center gap-2 border-b border-borde"},wc={key:0,class:"px-3 pt-3"},kc={key:1,class:"px-3 pt-2 text-xs text-red-600 dark:text-red-400"},Cc={class:"flex-1 overflow-y-auto px-2 py-3 space-y-0.5"},$c={key:0,class:"px-2 text-xs text-tenue"},Ac={key:1,class:"px-2 text-xs text-tenue"},Sc={class:"truncate"},Ec={class:"flex items-center gap-1 mt-0.5"},Ic={class:"text-[11px] text-tenue"},Rc={key:0,class:"flex opacity-0 group-hover:opacity-100 transition-opacity pr-1.5 gap-0.5"},Pc=["onClick"],Tc=["onClick"],Oc={class:"card w-full max-w-lg p-6 animate-escalar shadow-2xl"},Dc={class:"font-semibold text-texto mb-4"},Mc={key:0,class:"grid grid-cols-2 gap-3"},Nc=["value"],jc={class:"text-[11px] text-tenue mt-1"},Vc=["value"],Uc={class:"text-[11px] text-tenue mt-1"},Lc={class:"flex items-center gap-2 text-sm text-texto"},Fc={class:"flex justify-end gap-2 pt-2"},qc={__name:"Sidebar",setup(e,{expose:t}){const n=Wi(),s=go(),o=q([]),r=q([]),i=q([]),a=q(!0),u=q(""),f=q(!1),c=q(null),h=q(b()),m=ie(()=>n.params.tenantId||n.params.id);Pt(()=>n.fullPath,()=>{_n.value=!1});function b(){return{nombre:"",dominios_permitidos:"",activo:!0,cliente_id:null,plan_id:null}}async function $(){a.value=!0,u.value="";try{const y=await se.get(te("/umind/tenants"));o.value=y.items||[]}catch(y){u.value=y.message}finally{a.value=!1}}function k(y){return Array.isArray(y)?y:(y==null?void 0:y.items)||(y==null?void 0:y.registros)||[]}async function P(){if(Je.esPortal)return;const[y,O]=await Promise.allSettled([se.get("/app/api/clientes/select"),se.get("/app/umind-planes/list")]);r.value=y.status==="fulfilled"?k(y.value):[],i.value=O.status==="fulfilled"?k(O.value):[];const j=[];y.status==="rejected"&&j.push("clientes"),O.status==="rejected"&&j.push("planes"),j.length&&(u.value=`No se pudo cargar la lista de ${j.join(" ni ")}.`)}function M(){c.value=null,h.value=b(),f.value=!0}function E(y){c.value=y,h.value={nombre:y.nombre,dominios_permitidos:y.dominios_permitidos,activo:y.activo,cliente_id:y.cliente_id??null,plan_id:y.plan_id??null},f.value=!0}async function C(){const y={...h.value,dominios_permitidos:h.value.dominios_permitidos.split(",").map(O=>O.trim()).filter(Boolean)};try{if(c.value)await se.put(te(`/umind/tenants/${c.value.ID}`),y),f.value=!1,await $();else{const O=await se.post(te("/umind/tenants"),y);f.value=!1,await $(),s.push(`/tenants/${O.id}`)}}catch(O){u.value=O.message}}async function _(y){confirm(`¿Eliminar el espacio "${y.nombre}"? Esto borra también sus agentes. No se puede deshacer.`)&&(await se.del(te(`/umind/tenants/${y.ID}`)),m.value===String(y.ID)&&s.push("/"),await $())}return t({recargar:$}),hs(()=>{$(),P()}),(y,O)=>{const j=mn("router-link");return v(),w(ne,null,[Re(_n)?(v(),w("div",{key:0,class:"fixed inset-0 bg-black/50 z-30 md:hidden",onClick:O[0]||(O[0]=V=>_n.value=!1)})):W("",!0),l("aside",{class:ce(["w-64 shrink-0 flex flex-col border-r border-borde bg-superficie fixed inset-y-0 left-0 z-40 transition-transform duration-200 md:static md:h-screen md:sticky md:top-0 md:translate-x-0",Re(_n)?"translate-x-0":"-translate-x-full"])},[l("div",_c,[ee(j,{to:"/",class:"flex items-center gap-2 text-base font-semibold text-texto"},{default:nt(()=>[...O[8]||(O[8]=[l("svg",{viewBox:"0 0 96 96",class:"w-6 h-6 shrink-0","aria-hidden":"true"},[l("rect",{width:"96",height:"96",rx:"22",fill:"#8eb02f"}),l("path",{d:"M32,42 V58 A14,14 0 0 0 60,58 V42",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M60,58 V64",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round"}),l("circle",{cx:"60",cy:"28",r:"7",fill:"#fff"})],-1),l("span",null,[re("uMind "),l("span",{class:"text-brand"},"Studio")],-1)])]),_:1})]),Re(Je).esPortal?W("",!0):(v(),w("div",wc,[l("button",{class:"btn-primary w-full",onClick:M}," + Nuevo espacio ")])),u.value?(v(),w("p",kc,I(u.value),1)):W("",!0),l("nav",Cc,[a.value?(v(),w("p",$c,"Cargando...")):o.value.length===0?(v(),w("p",Ac,I(Re(Je).esPortal?"Todavía no tenés ningún espacio asignado. Escribinos y lo activamos.":"Sin espacios todavía."),1)):W("",!0),(v(!0),w(ne,null,we(o.value,V=>(v(),w("div",{key:V.ID,class:ce(["group flex items-center rounded-lg transition-colors",m.value===String(V.ID)?"bg-brand/10":"hover:bg-elevado"])},[ee(j,{to:`/tenants/${V.ID}`,class:ce(["flex-1 min-w-0 px-2.5 py-2 text-sm",m.value===String(V.ID)?"text-brand font-medium":"text-texto"])},{default:nt(()=>[l("div",Sc,I(V.nombre),1),l("div",Ec,[l("span",{class:ce(["w-1.5 h-1.5 rounded-full",V.activo?"bg-green-500":"bg-tenue/40"])},null,2),l("span",Ic,I(V.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),Re(Je).esPortal?W("",!0):(v(),w("div",Rc,[l("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:ke=>E(V)},[ee(Te,{nombre:"lapiz",tam:14})],8,Pc),l("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:ke=>_(V)},[ee(Te,{nombre:"cerrar",tam:14})],8,Tc)]))],2))),128))])],2),f.value?(v(),w("div",{key:1,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:O[7]||(O[7]=Pe(V=>f.value=!1,["self"]))},[l("div",Oc,[l("h2",Dc,I(c.value?"Editar espacio":"Nuevo espacio"),1),O[17]||(O[17]=l("p",{class:"text-xs text-tenue mb-3"}," Un espacio es el negocio o sitio dueño de los dominios permitidos. La config de IA, tono y demás se configuran por agente, dentro del tenant. ",-1)),l("form",{class:"space-y-3",onSubmit:Pe(C,["prevent"])},[l("div",null,[O[9]||(O[9]=l("label",{class:"label"},"Nombre",-1)),Q(l("input",{"onUpdate:modelValue":O[1]||(O[1]=V=>h.value.nombre=V),required:"",class:"input"},null,512),[[de,h.value.nombre]])]),l("div",null,[O[10]||(O[10]=l("label",{class:"label"},"Dominios permitidos (separados por coma)",-1)),Q(l("input",{"onUpdate:modelValue":O[2]||(O[2]=V=>h.value.dominios_permitidos=V),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"input"},null,512),[[de,h.value.dominios_permitidos]])]),Re(Je).esPortal?W("",!0):(v(),w("div",Mc,[l("div",null,[O[12]||(O[12]=l("label",{class:"label"},"Cliente",-1)),Q(l("select",{"onUpdate:modelValue":O[3]||(O[3]=V=>h.value.cliente_id=V),class:"input"},[O[11]||(O[11]=l("option",{value:null},"— sin asignar —",-1)),(v(!0),w(ne,null,we(r.value,V=>(v(),w("option",{key:V.ID,value:V.ID},I(V.nombre),9,Nc))),128))],512),[[un,h.value.cliente_id]]),l("p",jc,I(r.value.length?"Define quién ve este espacio desde el portal.":"No hay clientes activos — creá uno en Clientes."),1)]),l("div",null,[O[14]||(O[14]=l("label",{class:"label"},"Plan",-1)),Q(l("select",{"onUpdate:modelValue":O[4]||(O[4]=V=>h.value.plan_id=V),class:"input"},[O[13]||(O[13]=l("option",{value:null},"— sin plan —",-1)),(v(!0),w(ne,null,we(i.value,V=>(v(),w("option",{key:V.ID,value:V.ID},I(V.nombre)+" ("+I(V.max_agentes===0?"∞":V.max_agentes)+" agentes) ",9,Vc))),128))],512),[[un,h.value.plan_id]]),l("p",Uc,I(i.value.length?"Límite de agentes y precios de consumo.":"No hay planes — creá uno en uMind Planes."),1)])])),l("label",Lc,[Q(l("input",{"onUpdate:modelValue":O[5]||(O[5]=V=>h.value.activo=V),type:"checkbox"},null,512),[[yt,h.value.activo]]),O[15]||(O[15]=re(" Activo ",-1))]),l("div",Fc,[l("button",{type:"button",class:"btn-ghost",onClick:O[6]||(O[6]=V=>f.value=!1)}," Cancelar "),O[16]||(O[16]=l("button",{type:"submit",class:"btn-primary"}," Guardar ",-1))])],32)])])):W("",!0)],64)}}},Gi="umind-tema";function Hc(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"oscuro":"claro"}const rn=q(localStorage.getItem(Gi)||Hc());function Ki(){document.documentElement.classList.toggle("dark",rn.value==="oscuro")}function hr(){rn.value=rn.value==="oscuro"?"claro":"oscuro",localStorage.setItem(Gi,rn.value),Ki()}Ki();const vr="umind_despertar_visto",gr=1250,Bc={__name:"DespertarUmind",setup(e){const t=q(null),n=q(!1);let s=null,o=null;function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}return hs(()=>{r()||sessionStorage.getItem(vr)||(sessionStorage.setItem(vr,"1"),n.value=!0,o=setTimeout(()=>n.value=!1,gr),requestAnimationFrame(()=>{const i=t.value;if(!i)return;const a=i.getContext("2d"),u=Math.min(window.devicePixelRatio||1,2),f=window.innerWidth,c=window.innerHeight;i.width=Math.round(f*u),i.height=Math.round(c*u),a.setTransform(u,0,0,u,0,0);const h=f<640?22:46,m=Array.from({length:h},()=>({x:Math.random()*f,y:Math.random()*c,r:1+Math.random()*1.6,demora:Math.random()*.45})),b=performance.now(),$=k=>{const P=Math.min(1,(k-b)/gr);a.clearRect(0,0,f,c);const M=P<.75?1:1-(P-.75)/.25;for(let E=0;E<m.length;E++){const C=m[E],_=Math.max(0,Math.min(1,(P-C.demora)/.4));if(!(_<=0)){for(let y=E+1;y<m.length;y++){const O=m[y],j=C.x-O.x,V=C.y-O.y,ke=Math.sqrt(j*j+V*V);ke>170||(a.strokeStyle=`rgba(142, 176, 47, ${.16*(1-ke/170)*_*M})`,a.lineWidth=1,a.beginPath(),a.moveTo(C.x,C.y),a.lineTo(O.x,O.y),a.stroke())}a.beginPath(),a.arc(C.x,C.y,C.r*_,0,Math.PI*2),a.fillStyle=`rgba(142, 176, 47, ${.5*_*M})`,a.fill()}}P<1&&(s=requestAnimationFrame($))};s=requestAnimationFrame($)}))}),ti(()=>{s&&cancelAnimationFrame(s),o&&clearTimeout(o)}),(i,a)=>n.value?(v(),w("canvas",{key:0,ref_key:"lienzo",ref:t,class:"fixed inset-0 w-full h-full pointer-events-none z-50","aria-hidden":"true"},null,512)):W("",!0)}},Wc={class:"min-h-screen flex"},Gc={class:"flex-1 min-w-0 flex flex-col"},Kc={class:"h-14 shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-borde"},zc=["title"],Jc={class:"flex-1 max-w-5xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8 animate-aparecer"},Qc={__name:"App",setup(e){return(t,n)=>{const s=mn("router-view");return v(),w("div",Wc,[ee(Bc),ee(qc),l("main",Gc,[l("header",Kc,[l("button",{class:"btn-ghost !px-2 !py-1.5 md:hidden","aria-label":"Abrir menú",onClick:n[0]||(n[0]=o=>_n.value=!0)},[...n[2]||(n[2]=[l("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),n[3]||(n[3]=l("span",{class:"flex-1"},null,-1)),l("button",{class:"btn-ghost !px-2.5 !py-1.5",title:Re(rn)==="oscuro"?"Cambiar a claro":"Cambiar a oscuro",onClick:n[1]||(n[1]=(...o)=>Re(hr)&&Re(hr)(...o))},[ee(Te,{nombre:Re(rn)==="oscuro"?"sol":"luna",tam:17},null,8,["nombre"])],8,zc)]),l("div",Jc,[ee(s)])])])}}},Yc=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Zc=["width","height","aria-label"],Xc=["fill"],ed=["stroke"],td=["cy"],nd=["cy"],sd=["cy"],od=["cy"],rd={key:1,d:"M41,66 h12 M67,66 h12",class:"umi-linea","stroke-width":"5","stroke-linecap":"round",fill:"none"},id={key:4,d:"M50,78 q10,8 20,0",class:"umi-linea","stroke-width":"4",fill:"none","stroke-linecap":"round"},ld={__name:"UiMascota",props:{estado:{type:String,default:"normal"},tam:{type:[Number,String],default:72}},setup(e){return(t,n)=>(v(),w("svg",{width:e.tam,height:e.tam,viewBox:"0 0 120 120",class:"shrink-0",role:"img","aria-label":`Umi, la mascota de uMind (${e.estado})`},[l("circle",{cx:"60",cy:"26",r:"6",fill:e.estado==="alerta"?"#dc2626":"currentColor",class:ce(e.estado==="pensando"?"umi-late":"")},null,10,Xc),l("line",{x1:"60",y1:"32",x2:"60",y2:"44",stroke:e.estado==="alerta"?"#dc2626":"currentColor","stroke-width":"4","stroke-linecap":"round"},null,8,ed),n[7]||(n[7]=l("path",{d:"M30,46 V76 A30,30 0 0 0 90,76 V46 Z",fill:"currentColor"},null,-1)),e.estado==="normal"||e.estado==="contenta"||e.estado==="alerta"?(v(),w(ne,{key:0},[l("circle",{cx:"47",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,td),l("circle",{cx:"73",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,nd),l("circle",{cx:"48",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,sd),l("circle",{cx:"74",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,od)],64)):e.estado==="durmiendo"?(v(),w("path",rd)):e.estado==="pensando"?(v(),w(ne,{key:2},[n[0]||(n[0]=l("circle",{cx:"45",cy:"66",r:"4.5",class:"umi-ojo umi-p1"},null,-1)),n[1]||(n[1]=l("circle",{cx:"60",cy:"66",r:"4.5",class:"umi-ojo umi-p2"},null,-1)),n[2]||(n[2]=l("circle",{cx:"75",cy:"66",r:"4.5",class:"umi-ojo umi-p3"},null,-1))],64)):e.estado==="buscando"?(v(),w(ne,{key:3},[n[3]||(n[3]=l("circle",{cx:"47",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[4]||(n[4]=l("circle",{cx:"73",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[5]||(n[5]=l("circle",{cx:"50",cy:"66",r:"3",class:"umi-pupila"},null,-1)),n[6]||(n[6]=l("circle",{cx:"76",cy:"66",r:"3",class:"umi-pupila"},null,-1))],64)):W("",!0),e.estado==="contenta"?(v(),w("path",id)):W("",!0)],8,Zc))}},Nn=Yc(ld,[["__scopeId","data-v-551897a0"]]),ad={key:0,class:"flex flex-col items-center justify-center py-24 text-sm text-tenue"},ud={key:1,class:"max-w-md mx-auto text-center py-20"},cd={key:2,class:"flex flex-col items-center justify-center text-center py-24"},dd={class:"text-lg font-medium text-texto"},fd={class:"text-sm text-tenue mt-1"},pd={__name:"Home",setup(e){const t=go(),n=q(Je.esPortal),s=q(!1);async function o(){if(Je.esPortal)try{const i=(await se.get(te("/umind/tenants"))).items||[];if(i.length===0){s.value=!0;return}if(i.length!==1)return;const a=i[0].ID,f=(await se.get(te(`/umind/agentes?tenant_id=${a}`))).items||[];if(f.length===1){t.replace(`/tenants/${a}/agentes/${f[0].ID}`);return}t.replace(`/tenants/${a}`)}catch{}finally{n.value=!1}}return hs(o),(r,i)=>n.value?(v(),w("div",ad," Abriendo tu asistente… ")):s.value?(v(),w("div",ud,[ee(Nn,{estado:"durmiendo",tam:80,class:"mx-auto mb-4 text-brand"}),i[0]||(i[0]=Ai('<h1 class="text-lg font-medium text-texto">Todavía no tenés un asistente activo</h1><p class="text-sm text-tenue mt-2"> uMind contesta por vos en WhatsApp y en tu sitio, con la información de tu negocio. Entiende las notas de voz y lee las fotos y archivos que te mandan tus clientes. </p><a class="btn-primary inline-block mt-5" href="mailto:soporte@u-site.app?subject=Quiero%20activar%20uMind">Quiero activarlo</a><p class="text-xs text-tenue mt-4"><a href="/portal/dashboard" class="underline">Volver al portal</a></p>',4))])):(v(),w("div",cd,[ee(Nn,{estado:"normal",tam:64,class:"mx-auto mb-4 text-brand"}),l("h1",dd,I(Re(Je).esPortal?"Elegí tu espacio de la izquierda":"Elegí un espacio de la izquierda"),1),l("p",fd,I(Re(Je).esPortal?"Adentro vas a poder crear y configurar tus agentes.":"o creá uno nuevo para empezar a configurar su agente."),1)]))}},md={class:"flex flex-col items-center justify-center text-center py-12 px-6"},hd={key:0,class:"text-3xl mb-3 opacity-70"},vd={class:"text-sm font-medium text-texto"},gd={key:2,class:"text-xs text-tenue mt-1.5 max-w-sm leading-relaxed"},bd={key:3,class:"mt-4"},rt={__name:"UiEmptyState",props:{estado:{type:String,default:"durmiendo"},titulo:String,detalle:String,icono:{type:String,default:""}},setup(e){return(t,n)=>(v(),w("div",md,[e.icono?(v(),w("div",hd,I(e.icono),1)):(v(),xe(Nn,{key:1,estado:e.estado,tam:64,class:"mb-3 text-brand"},null,8,["estado"])),l("p",vd,I(e.titulo),1),e.detalle?(v(),w("p",gd,I(e.detalle),1)):W("",!0),t.$slots.default?(v(),w("div",bd,[Yl(t.$slots,"default")])):W("",!0)]))}},xd={key:0,class:"mb-6"},yd={class:"flex items-start justify-between gap-4"},_d={class:"text-xl font-semibold text-texto"},wd={class:"text-xs text-tenue mt-1"},kd={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Cd={class:"flex items-center justify-between mb-4"},$d={class:"flex items-center gap-2"},Ad={key:0,class:"badge-alerta"},Sd={key:1,class:"badge-neutro"},Ed=["disabled"],Id={key:2,class:"text-xs text-tenue -mt-2 mb-4"},Rd={key:3,class:"text-xs text-tenue -mt-2 mb-4"},Pd={key:4,class:"grid gap-3 sm:grid-cols-2"},Td=["disabled"],Od={key:6,class:"grid gap-3 sm:grid-cols-2"},Dd={class:"flex items-start gap-3"},Md={class:"min-w-0 flex-1"},Nd={class:"flex items-center gap-2"},jd={class:"font-medium text-texto truncate"},Vd={class:"text-xs text-tenue mt-0.5 truncate"},Ud={class:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"},Ld=["onClick"],Fd=["onClick"],qd=["onClick"],Hd={class:"flex items-center gap-4 mt-3.5 pt-3 border-t border-borde text-xs text-tenue"},Bd={class:"tabular-nums"},Wd={class:"text-texto font-medium"},Gd={class:"tabular-nums"},Kd={class:"text-texto font-medium"},zd={class:"tabular-nums"},Jd={class:"text-texto font-medium"},Qd={class:"bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 w-full max-w-lg max-h-[calc(100vh-2rem)] overflow-y-auto"},Yd={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},Zd={key:0},Xd={class:"grid gap-1.5"},ef=["value"],tf={class:"min-w-0"},nf={class:"block text-sm text-texto"},sf={class:"block text-xs text-tenue"},of={key:0,class:"block text-xs text-tenue mt-0.5"},rf=["value"],lf={class:"flex items-center gap-2"},af={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},uf={class:"flex justify-end gap-2 pt-2"},cf={type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},df={__name:"TenantAgentes",props:{id:{type:String,required:!0}},setup(e){const t=e,n=ie(()=>Number(t.id)),s=go(),o=q(null),r=q([]),i=q([]),a=q(""),u=q(!1),f=q(null),c=q(E()),h=q(null),m=q({}),b=q(!0);function $(Z){const U=m.value[Z.ID]||{};return Z.activo?U.documentos>0?{tipo:"ok",texto:"listo"}:{tipo:"alerta",texto:"sin conocimiento"}:{tipo:"neutro",texto:"inactivo"}}function k(Z){const U=m.value[Z.ID]||{};return{documentos:U.documentos||0,canales:U.canales||0,conversaciones:U.conversaciones_7d||0}}function P(Z){return String(Z||"?").trim().split(/\s+/).slice(0,2).map(U=>U[0]).join("").toUpperCase()}const M=ie(()=>{if(!h.value)return{sinPlan:!0};const Z=h.value.max_agentes||0;return{sinPlan:!1,nombre:h.value.nombre,ilimitado:Z<=0,max:Z,usados:r.value.length,lleno:Z>0&&r.value.length>=Z}});function E(){return{nombre:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",color:"#8eb02f",activo:!0,plantilla_rubro:""}}const C=q([]);async function _(){a.value="",b.value=!0;try{const[Z,U,Se,G]=await Promise.all([se.get(te("/umind/tenants")),se.get(te(`/umind/agentes?tenant_id=${t.id}`)),se.get(te("/umind/ai-configs")),se.get(te("/umind/plantillas-rubro"))]);o.value=(Z.items||[]).find(Ke=>String(Ke.ID)===t.id)||null,r.value=U.items||[],h.value=U.plan||null,m.value=U.resumen||{},i.value=Se.items||[],C.value=G.items||[]}catch(Z){a.value=Z.message}finally{b.value=!1}}async function y(Z){const U=prompt(`Nombre de la copia de "${Z.nombre}":`,`${Z.nombre} (copia)`);if(U!==null){a.value="";try{const Se=await se.post(te(`/umind/agentes/${Z.ID}/duplicar`),{tenant_id:Number(n.value),nombre:U.trim()});await _(),Se.aviso&&alert(Se.aviso)}catch(Se){a.value=Se.message}}}function O(){f.value=null,c.value=E(),u.value=!0}function j(Z){f.value=Z,c.value={nombre:Z.nombre,ai_config_id:Z.ai_config_id,tono:Z.tono,mensaje_bienvenida:Z.mensaje_bienvenida,color:Z.color||"#8eb02f",activo:Z.activo},u.value=!0}async function V(){try{if(f.value)await se.put(te(`/umind/agentes/${f.value.ID}`),{tenant_id:n.value,...c.value}),u.value=!1,await _();else{const Z=await se.post(te("/umind/agentes"),{tenant_id:n.value,...c.value});u.value=!1,s.push(`/tenants/${n.value}/agentes/${Z.id}`)}}catch(Z){a.value=Z.message}}async function ke(Z){confirm(`¿Eliminar el agente "${Z.nombre}"? Esto no se puede deshacer.`)&&(await se.del(te(`/umind/agentes/${Z.ID}`)),await _())}return Pt(()=>t.id,_,{immediate:!0}),(Z,U)=>{const Se=mn("router-link");return v(),w("div",null,[o.value?(v(),w("div",xd,[l("div",yd,[l("div",null,[l("h1",_d,I(o.value.nombre),1),l("p",wd,I(o.value.dominios_permitidos||"sin dominios configurados"),1)]),ee(Se,{to:`/tenants/${n.value??e.id}/ia`,class:"btn-ghost"},{default:nt(()=>[...U[10]||(U[10]=[re("Tu IA",-1)])]),_:1},8,["to"]),ee(Se,{to:`/tenants/${n.value??e.id}/uso`,class:"btn-ghost inline-flex items-center gap-1.5"},{default:nt(()=>[ee(Te,{nombre:"grafico"}),U[11]||(U[11]=re(" Consumo",-1))]),_:1},8,["to"])])])):W("",!0),a.value?(v(),w("p",kd,I(a.value),1)):W("",!0),l("div",Cd,[l("div",$d,[U[12]||(U[12]=l("h2",{class:"text-sm font-medium text-tenue"},"Agentes",-1)),M.value.sinPlan?(v(),w("span",Ad,"sin plan · sin límite")):M.value.ilimitado?(v(),w("span",Sd,I(M.value.nombre)+" · ilimitado",1)):(v(),w("span",{key:2,class:ce(M.value.lleno?"badge-alerta":"badge-neutro")},I(M.value.nombre)+" · "+I(M.value.usados)+" de "+I(M.value.max),3))]),l("button",{class:"btn-primary",disabled:M.value.lleno,onClick:O},"+ Nuevo agente",8,Ed)]),M.value.sinPlan&&!Re(Je).esPortal?(v(),w("p",Id," Este espacio no tiene plan asignado, así que no se le aplica ningún límite de agentes. Asignale uno desde el lápiz del espacio, en la barra izquierda. ")):M.value.lleno?(v(),w("p",Rd," Alcanzaste el máximo de agentes de tu plan. ")):W("",!0),b.value?(v(),w("div",Pd,[(v(),w(ne,null,we(2,G=>l("div",{key:G,class:"card p-4 animate-pulse"},[...U[13]||(U[13]=[Ai('<div class="flex items-center gap-3"><div class="w-10 h-10 rounded-xl bg-elevado"></div><div class="flex-1"><div class="h-3.5 w-28 rounded bg-elevado"></div><div class="h-2.5 w-16 rounded bg-elevado mt-2"></div></div></div><div class="h-2.5 w-full rounded bg-elevado mt-4"></div>',2)])])),64))])):r.value.length===0?(v(),xe(rt,{key:5,class:"card",estado:"durmiendo",titulo:"Todavía no hay agentes",detalle:"Creá el primero y cargale su base de conocimiento para que empiece a responder."},{default:nt(()=>[l("button",{class:"btn-primary",disabled:M.value.lleno,onClick:O},"+ Crear el primer agente",8,Td)]),_:1})):(v(),w("div",Od,[(v(!0),w(ne,null,we(r.value,G=>(v(),xe(Se,{key:G.ID,to:`/tenants/${n.value}/agentes/${G.ID}`,class:"card p-4 relative group hover:shadow-lg hover:-translate-y-0.5 transition-all overflow-hidden"},{default:nt(()=>[l("span",{class:"absolute inset-x-0 top-0 h-1",style:Jt({background:G.color||"#8eb02f"})},null,4),l("div",Dd,[l("span",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-semibold shrink-0",style:Jt({background:G.color||"#8eb02f",opacity:G.activo?1:.4})},I(P(G.nombre)),5),l("div",Md,[l("div",Nd,[l("span",jd,I(G.nombre),1),l("span",{class:ce(`badge-${$(G).tipo}`)},I($(G).texto),3)]),l("p",Vd,I(G.tono||"sin tono definido"),1)]),l("div",Ud,[l("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Pe(Ke=>j(G),["prevent","stop"])},[ee(Te,{nombre:"lapiz",tam:14})],8,Ld),l("button",{class:"p-1 text-tenue hover:text-texto",title:"Duplicar: copia el conocimiento y las herramientas a un agente nuevo",onClick:Pe(Ke=>y(G),["prevent","stop"])},[ee(Te,{nombre:"copiar",tam:14})],8,Fd),l("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Pe(Ke=>ke(G),["prevent","stop"])},[ee(Te,{nombre:"cerrar",tam:14})],8,qd)])]),l("div",Hd,[l("span",Bd,[l("b",Wd,I(k(G).conversaciones),1),U[14]||(U[14]=re(" conversaciones · 7d",-1))]),l("span",Gd,[l("b",Kd,I(k(G).documentos),1),U[15]||(U[15]=re(" fuentes",-1))]),l("span",zd,[l("b",Jd,I(k(G).canales),1),U[16]||(U[16]=re(" canales",-1))])])]),_:2},1032,["to"]))),128))])),u.value?(v(),w("div",{key:7,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:U[9]||(U[9]=Pe(G=>u.value=!1,["self"]))},[l("div",Qd,[l("h2",Yd,I(f.value?"Editar agente":"Nuevo agente"),1),l("form",{class:"space-y-3",onSubmit:Pe(V,["prevent"])},[l("div",null,[U[17]||(U[17]=l("label",{class:"label"},"Nombre",-1)),Q(l("input",{"onUpdate:modelValue":U[0]||(U[0]=G=>c.value.nombre=G),required:"",placeholder:"ej: Ventas, Soporte",class:"input"},null,512),[[de,c.value.nombre]])]),!f.value&&C.value.length?(v(),w("div",Zd,[U[18]||(U[18]=l("label",{class:"label"},"Arrancar con",-1)),l("div",Xd,[(v(!0),w(ne,null,we([{clave:"",nombre:"Agente en blanco",descripcion:"Sin conocimiento cargado. Lo escribís vos desde cero."},...C.value],G=>(v(),w("label",{key:G.clave,class:ce(["flex gap-2.5 p-2.5 rounded-lg border cursor-pointer transition-colors",c.value.plantilla_rubro===G.clave?"border-brand bg-brand/5":"border-borde hover:border-brand/40"])},[Q(l("input",{"onUpdate:modelValue":U[1]||(U[1]=Ke=>c.value.plantilla_rubro=Ke),type:"radio",value:G.clave,class:"mt-1 text-brand focus:ring-brand"},null,8,ef),[[iu,c.value.plantilla_rubro]]),l("span",tf,[l("span",nf,I(G.nombre),1),l("span",sf,I(G.descripcion),1),G.notas?(v(),w("span",of,I(G.notas)+" notas listas para editar · "+I(G.resumen),1)):W("",!0)])],2))),128))]),U[19]||(U[19]=l("p",{class:"text-xs text-tenue mt-1.5"}," Las notas vienen con ejemplos entre corchetes — abrilas y reemplazalas por tus datos reales. ",-1))])):W("",!0),l("div",null,[U[21]||(U[21]=l("label",{class:"label"},"Config de IA",-1)),Q(l("select",{"onUpdate:modelValue":U[2]||(U[2]=G=>c.value.ai_config_id=G),class:"input"},[U[20]||(U[20]=l("option",{value:null},"— sin asignar —",-1)),(v(!0),w(ne,null,we(i.value,G=>(v(),w("option",{key:G.ID,value:G.ID},I(G.nombre)+" ("+I(G.provider)+")",9,rf))),128))],512),[[un,c.value.ai_config_id]])]),l("div",null,[U[22]||(U[22]=l("label",{class:"label"},"Tono / personalidad",-1)),Q(l("textarea",{"onUpdate:modelValue":U[3]||(U[3]=G=>c.value.tono=G),rows:"2",class:"input"},null,512),[[de,c.value.tono]])]),l("div",null,[U[23]||(U[23]=l("label",{class:"label"},"Mensaje de bienvenida",-1)),Q(l("input",{"onUpdate:modelValue":U[4]||(U[4]=G=>c.value.mensaje_bienvenida=G),class:"input"},null,512),[[de,c.value.mensaje_bienvenida]])]),l("div",null,[U[24]||(U[24]=l("label",{class:"label"},"Color del widget",-1)),l("div",lf,[Q(l("input",{"onUpdate:modelValue":U[5]||(U[5]=G=>c.value.color=G),type:"color",class:"w-10 h-9 border border-gray-300 dark:border-gray-700 rounded cursor-pointer bg-white dark:bg-gray-800"},null,512),[[de,c.value.color]]),Q(l("input",{"onUpdate:modelValue":U[6]||(U[6]=G=>c.value.color=G),type:"text",pattern:"#[0-9a-fA-F]{6}",class:"flex-1 border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm font-mono"},null,512),[[de,c.value.color]])])]),l("label",af,[Q(l("input",{"onUpdate:modelValue":U[7]||(U[7]=G=>c.value.activo=G),type:"checkbox"},null,512),[[yt,c.value.activo]]),U[25]||(U[25]=re(" Activo ",-1))]),l("div",uf,[l("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:U[8]||(U[8]=G=>u.value=!1)},"Cancelar"),l("button",cf,I(f.value?"Guardar":"Crear"),1)])],32)])])):W("",!0)])}}},ff={class:"card divide-y divide-borde max-h-[32rem] overflow-y-auto"},pf={class:"cursor-pointer flex items-center gap-2 text-sm"},mf={class:"text-tenue text-xs shrink-0"},hf={class:"text-texto truncate"},vf={class:"text-tenue text-xs ml-auto shrink-0"},gf={key:0,class:"mt-2 bg-elevado border border-borde rounded-lg p-2 text-xs text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap"},bf={__name:"TabAuditoria",props:{eventos:{type:Array,default:()=>[]}},setup(e){const t=ie(()=>s=>({error:"badge-error",warn:"badge-alerta"})[s]||"badge-neutro");function n(s){try{return new Date(s).toLocaleString()}catch{return s}}return(s,o)=>(v(),w("div",null,[o[0]||(o[0]=l("p",{class:"label mb-4"}," Errores y eventos técnicos de este agente — fallos al llamar a la IA, a una herramienta, al correo o a los canales. Últimos 100. ",-1)),l("div",ff,[e.eventos.length===0?(v(),xe(rt,{key:0,estado:"contenta",titulo:"Ningún problema registrado",detalle:"Acá aparecen los errores: una herramienta que no responde, una fuente que no se pudo leer. Que esté vacío es buena señal."})):W("",!0),(v(!0),w(ne,null,we(e.eventos,r=>(v(),w("details",{key:r.ID,class:"p-3"},[l("summary",pf,[l("span",{class:ce(["px-1.5 py-0.5 rounded text-xs shrink-0",t.value(r.nivel)])},I(r.nivel),3),l("span",mf,I(r.origen),1),l("span",hf,I(r.mensaje),1),l("span",vf,I(n(r.CreatedAt)),1)]),r.detalle?(v(),w("pre",gf,I(r.detalle),1)):W("",!0)]))),128))])]))}},xf={class:"flex gap-2 mb-4"},yf={class:"card divide-y divide-borde"},_f={class:"font-medium text-texto capitalize"},wf={class:"ml-2 text-sm text-tenue"},kf=["onClick"],Cf={__name:"TabConexiones",props:{agenteId:{type:Number,required:!0},conexiones:{type:Array,default:()=>[]}},emits:["recargar"],setup(e,{emit:t}){const n=e,s=t;function o(i){window.location.href=te(`/umind/conexiones/conectar?agente_id=${n.agenteId}&proveedor=${i}`)}async function r(i){confirm(`¿Desconectar la cuenta ${i.email||i.proveedor}?`)&&(await se.del(te(`/umind/conexiones/${i.ID}`)),s("recargar"))}return(i,a)=>(v(),w("div",null,[a[2]||(a[2]=l("p",{class:"label mb-4"}," Conectá una cuenta de correo para que este agente pueda enviar y leer correo en su nombre. Se soporta una cuenta activa a la vez. ",-1)),l("div",xf,[l("button",{class:"border border-borde hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:a[0]||(a[0]=u=>o("google"))}," Conectar Google "),l("button",{class:"border border-borde hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:a[1]||(a[1]=u=>o("microsoft"))}," Conectar Outlook ")]),l("div",yf,[e.conexiones.length===0?(v(),xe(rt,{key:0,titulo:"Sin cuentas conectadas",detalle:"Conectando una cuenta de correo, el agente puede leer y responder mensajes con tu dirección."})):W("",!0),(v(!0),w(ne,null,we(e.conexiones,u=>(v(),w("div",{key:u.ID,class:"p-4 flex items-center justify-between"},[l("div",null,[l("span",_f,I(u.proveedor),1),l("span",wf,I(u.email),1),l("span",{class:ce(["ml-2 px-1.5 py-0.5 rounded text-xs",u.activo?"badge-ok":"badge-neutro"])},I(u.activo?"activa":"inactiva"),3)]),l("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:f=>r(u)},"Desconectar",8,kf)]))),128))])]))}},$f={class:"card p-4 flex flex-col h-[28rem]"},Af={class:"flex-1 overflow-y-auto space-y-2 mb-3"},Sf={key:0,class:"text-sm text-tenue"},Ef={key:1,class:"flex items-center gap-2"},If=["disabled"],br={__name:"TabChat",props:{agenteId:{type:Number,required:!0}},setup(e){const t=e,n=`staff-preview-${Math.random().toString(36).slice(2)}`,s=q([]),o=q(""),r=q(!1);async function i(){const a=o.value.trim();if(!(!a||r.value)){o.value="",s.value.push({role:"user",content:a}),r.value=!0;try{const u=await se.post(te("/umind/chat"),{agente_id:t.agenteId,session_id:n,mensaje:a});s.value.push({role:"assistant",content:u.respuesta})}catch(u){s.value.push({role:"assistant",content:`⚠ ${u.message}`})}finally{r.value=!1}}}return(a,u)=>(v(),w("div",$f,[l("div",Af,[s.value.length===0?(v(),w("p",Sf," Probá este agente tal cual lo va a ver un visitante — usa la misma config de IA, las mismas herramientas y la misma base de conocimiento. ")):W("",!0),(v(!0),w(ne,null,we(s.value,(f,c)=>(v(),w("div",{key:c,class:ce(["max-w-[80%] px-3 py-2 rounded-lg text-sm whitespace-pre-wrap",f.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},I(f.content),3))),128)),r.value?(v(),w("div",Ef,[ee(Nn,{estado:"pensando",tam:30,class:"text-brand"}),u[1]||(u[1]=l("span",{class:"text-xs text-tenue"},"Pensando…",-1))])):W("",!0)]),l("form",{class:"flex gap-2",onSubmit:Pe(i,["prevent"])},[Q(l("input",{"onUpdate:modelValue":u[0]||(u[0]=f=>o.value=f),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 input"},null,512),[[de,o.value]]),l("button",{type:"submit",disabled:r.value,class:"btn-primary disabled:opacity-50 transition-colors"}," Enviar ",8,If)],32)]))}},Rf={class:"grid lg:grid-cols-[minmax(16rem,22rem)_1fr] gap-4 items-start"},Pf={class:"card divide-y divide-borde max-h-[30rem] overflow-y-auto"},Tf=["onClick"],Of={class:"text-sm text-texto line-clamp-2"},Df={class:"flex items-center gap-2 mt-1.5 text-xs text-tenue"},Mf={class:"tabular-nums"},Nf={class:"ml-auto tabular-nums"},jf={key:2,class:"flex items-center gap-2 p-3 text-xs text-tenue cursor-pointer select-none"},Vf={class:"card p-4 max-h-[30rem] overflow-y-auto"},Uf={key:1,class:"text-sm text-tenue"},Lf={key:2,class:"space-y-2"},Ff={__name:"TabConversaciones",props:{agenteId:{type:Number,required:!0},sesiones:{type:Array,default:()=>[]}},setup(e){const t=e,n=q([]),s=q(null),o=q(!1);function r(m){const b=String(m||"");return b.startsWith("wa:")?{nombre:"WhatsApp",icono:"mensaje",clase:"badge-ok"}:b.startsWith("tg:")?{nombre:"Telegram",icono:"mensaje",clase:"badge-neutro"}:b.startsWith("staff-preview")?{nombre:"Prueba",icono:"escribir",clase:"badge-alerta"}:{nombre:"Tu web",icono:"sitio",clase:"badge-neutro"}}const i=q(!1),a=ie(()=>t.sesiones.filter(m=>!String(m.session_id).startsWith("staff-preview"))),u=ie(()=>t.sesiones.filter(m=>String(m.session_id).startsWith("staff-preview"))),f=ie(()=>i.value?t.sesiones:a.value);function c(m){if(!m)return"";const b=new Date(m),k=Math.floor((new Date().setHours(0,0,0,0)-new Date(b).setHours(0,0,0,0))/864e5),P=new Date(m).toLocaleTimeString("es",{hour:"2-digit",minute:"2-digit"});return k<=0?`hoy ${P}`:k===1?`ayer ${P}`:k<7?`hace ${k} días`:new Date(m).toLocaleDateString("es",{day:"numeric",month:"short"})}async function h(m){s.value=m,o.value=!0;try{const b=await se.get(te(`/umind/historial?agente_id=${t.agenteId}&session_id=${m}`));n.value=b.items||[]}finally{o.value=!1}}return(m,b)=>(v(),w("div",Rf,[l("div",Pf,[f.value.length===0&&u.value.length===0?(v(),xe(rt,{key:0,titulo:"Nadie escribió todavía",detalle:"Cuando alguien le hable a tu asistente —por WhatsApp, Telegram o tu web— la conversación aparece acá, con lo que preguntó y lo que se le respondió."})):f.value.length===0?(v(),xe(rt,{key:1,estado:"durmiendo",titulo:"Ningún cliente escribió todavía",detalle:`Hay ${u.value.length} ${u.value.length===1?"conversación de prueba tuya":"conversaciones de prueba tuyas"} — activá el filtro de abajo para verlas.`},null,8,["detalle"])):W("",!0),(v(!0),w(ne,null,we(f.value,$=>(v(),w("button",{key:$.session_id,class:ce(["w-full text-left p-3 hover:bg-elevado transition-colors",s.value===$.session_id?"bg-gray-50 dark:bg-gray-800":""]),onClick:k=>h($.session_id)},[l("div",Of,I($.primer_mensaje||"(sin mensaje)"),1),l("div",Df,[l("span",{class:ce(["px-1.5 py-0.5 rounded",r($.session_id).clase])},I(r($.session_id).nombre),3),l("span",Mf,I($.mensajes)+" msj",1),l("span",Nf,I(c($.ultimo)),1)])],10,Tf))),128)),u.value.length?(v(),w("label",jf,[Q(l("input",{"onUpdate:modelValue":b[0]||(b[0]=$=>i.value=$),type:"checkbox",class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[yt,i.value]]),re(" "+I(u.value.length===1?"Mostrar mi prueba":`Mostrar mis ${u.value.length} pruebas`),1)])):W("",!0)]),l("div",Vf,[s.value?o.value?(v(),w("p",Uf,"Cargando…")):(v(),w("div",Lf,[(v(!0),w(ne,null,we(n.value,$=>(v(),w("div",{key:$.ID,class:ce($.role==="user"?"text-right":"")},[l("div",{class:ce(["inline-block max-w-[80%] px-3 py-2 rounded-lg text-sm text-left whitespace-pre-wrap",$.role==="user"?"bg-brand text-white":"bg-elevado text-texto"])},I($.content),3),l("div",{class:ce(["text-[10px] text-tenue mt-0.5 tabular-nums",$.role==="user"?"pr-1":"pl-1"])},I(c($.CreatedAt)),3)],2))),128))])):(v(),xe(rt,{key:0,estado:"normal",titulo:"Elegí una conversación",detalle:"Vas a ver el intercambio completo: lo que escribió la persona y lo que contestó tu asistente. Si una respuesta no te gusta, corregí su información en «Lo que sabe»."}))])]))}},qf={class:"card divide-y divide-borde"},Hf={class:"text-sm text-texto font-mono"},Bf={class:"label mt-0.5"},Wf={class:"text-xs text-tenue mt-0.5"},Gf={key:0,class:"ml-1 text-green-600 dark:text-green-400"},Kf={key:1,class:"ml-1 text-gray-400"},zf={class:"flex gap-3 text-sm shrink-0"},Jf=["onClick"],Qf=["onClick"],Yf={class:"card p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},Zf={class:"font-semibold text-texto mb-4"},Xf={class:"border border-borde rounded-lg p-3 space-y-2"},ep=["onUpdate:modelValue"],tp=["onUpdate:modelValue"],np=["onUpdate:modelValue"],sp={class:"label flex items-center gap-1"},op=["onUpdate:modelValue"],rp=["onClick"],ip={key:0,class:"text-xs text-gray-400"},lp={class:"border border-borde rounded-lg p-3 space-y-2"},ap={class:"flex items-center gap-2 label"},up={class:"flex items-center gap-2 text-sm text-texto"},cp={class:"flex justify-end gap-2 pt-2"},dp={__name:"TabHerramientas",props:{agenteId:{type:Number,required:!0},tools:{type:Array,default:()=>[]}},emits:["recargar","error"],setup(e,{emit:t}){const n=e,s=t,o=q(!1),r=q(null),i=q(a());function a(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}function u(){r.value=null,i.value=a(),o.value=!0}function f($){r.value=$;let k=[];try{k=JSON.parse($.parametros_json||"[]")||[]}catch{k=[]}i.value={nombre:$.nombre,descripcion:$.descripcion,url:$.url,auth_header_nombre:$.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:k,activa:$.activa},o.value=!0}function c(){i.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function h($){i.value.parametros.splice($,1)}async function m(){const $={agente_id:n.agenteId,nombre:i.value.nombre.trim(),descripcion:i.value.descripcion,url:i.value.url.trim(),auth_header_nombre:i.value.auth_header_nombre,parametros:i.value.parametros,activa:i.value.activa};i.value.tocarAuth&&($.auth_header_valor=i.value.auth_header_valor);try{r.value?await se.put(te(`/umind/tools/${r.value.ID}`),$):await se.post(te("/umind/tools"),$),o.value=!1,s("recargar")}catch(k){s("error",k.message)}}async function b($){confirm(`¿Eliminar la herramienta "${$.nombre}"?`)&&(await se.del(te(`/umind/tools/${$.ID}`)),s("recargar"))}return($,k)=>(v(),w("div",null,[l("div",{class:"flex justify-between items-center mb-4"},[k[9]||(k[9]=l("p",{class:"label"},"Máximo 10 herramientas activas por agente.",-1)),l("button",{class:"btn-primary",onClick:u}," + Nueva herramienta ")]),l("div",qf,[e.tools.length===0?(v(),xe(rt,{key:0,titulo:"Sin herramientas conectadas",detalle:"Las herramientas le dejan consultar tus sistemas mientras conversa: stock, estado de un pedido, disponibilidad de turnos. Sin ninguna, responde solo con lo que tiene cargado."})):W("",!0),(v(!0),w(ne,null,we(e.tools,P=>(v(),w("div",{key:P.ID,class:"p-4 flex items-center justify-between"},[l("div",null,[l("div",Hf,I(P.nombre),1),l("div",Bf,I(P.descripcion),1),l("div",Wf,[re(I(P.url)+" ",1),P.auth_configurado?(v(),w("span",Gf,"· auth configurada")):W("",!0),P.activa?W("",!0):(v(),w("span",Kf,"· inactiva"))])]),l("div",zf,[l("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:M=>f(P)},"Editar",8,Jf),l("button",{class:"text-red-500 hover:text-red-700",onClick:M=>b(P)},"Eliminar",8,Qf)])]))),128))]),o.value?(v(),w("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:k[8]||(k[8]=Pe(P=>o.value=!1,["self"]))},[l("div",Yf,[l("h2",Zf,I(r.value?"Editar herramienta":"Nueva herramienta"),1),l("form",{class:"space-y-3",onSubmit:Pe(m,["prevent"])},[l("div",null,[k[10]||(k[10]=l("label",{class:"label"},"Nombre (identificador, ej: consultar_stock)",-1)),Q(l("input",{"onUpdate:modelValue":k[0]||(k[0]=P=>i.value.nombre=P),required:"",pattern:"[a-z][a-z0-9_]{2,63}",class:"input font-mono"},null,512),[[de,i.value.nombre]])]),l("div",null,[k[11]||(k[11]=l("label",{class:"label"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),Q(l("textarea",{"onUpdate:modelValue":k[1]||(k[1]=P=>i.value.descripcion=P),rows:"2",required:"",class:"input"},null,512),[[de,i.value.descripcion]])]),l("div",null,[k[12]||(k[12]=l("label",{class:"label"},"URL del webhook (https)",-1)),Q(l("input",{"onUpdate:modelValue":k[2]||(k[2]=P=>i.value.url=P),type:"url",required:"",placeholder:"https://...",class:"input"},null,512),[[de,i.value.url]])]),l("div",Xf,[l("div",{class:"flex items-center justify-between"},[k[13]||(k[13]=l("label",{class:"label"},"Parámetros que completa el modelo",-1)),l("button",{type:"button",class:"text-xs text-brand",onClick:c},"+ agregar")]),(v(!0),w(ne,null,we(i.value.parametros,(P,M)=>(v(),w("div",{key:M,class:"flex gap-2 items-center"},[Q(l("input",{"onUpdate:modelValue":E=>P.nombre=E,placeholder:"nombre",class:"flex-1 border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs font-mono"},null,8,ep),[[de,P.nombre]]),Q(l("select",{"onUpdate:modelValue":E=>P.tipo=E,class:"border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},[...k[14]||(k[14]=[l("option",{value:"string"},"string",-1),l("option",{value:"number"},"number",-1),l("option",{value:"boolean"},"boolean",-1)])],8,tp),[[un,P.tipo]]),Q(l("input",{"onUpdate:modelValue":E=>P.descripcion=E,placeholder:"descripción",class:"flex-1 border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},null,8,np),[[de,P.descripcion]]),l("label",sp,[Q(l("input",{"onUpdate:modelValue":E=>P.requerido=E,type:"checkbox"},null,8,op),[[yt,P.requerido]]),k[15]||(k[15]=re(" req. ",-1))]),l("button",{type:"button",class:"text-red-400 text-xs",onClick:E=>h(M)},[ee(Te,{nombre:"cerrar",tam:13})],8,rp)]))),128)),i.value.parametros.length===0?(v(),w("p",ip,"Sin parámetros.")):W("",!0)]),l("div",lp,[k[16]||(k[16]=l("label",{class:"label"},"Autenticación saliente (opcional)",-1)),Q(l("input",{"onUpdate:modelValue":k[3]||(k[3]=P=>i.value.auth_header_nombre=P),placeholder:"Nombre del header, ej: Authorization",class:"input"},null,512),[[de,i.value.auth_header_nombre]]),l("label",ap,[Q(l("input",{"onUpdate:modelValue":k[4]||(k[4]=P=>i.value.tocarAuth=P),type:"checkbox"},null,512),[[yt,i.value.tocarAuth]]),re(" "+I(r.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),i.value.tocarAuth?Q((v(),w("input",{key:0,"onUpdate:modelValue":k[5]||(k[5]=P=>i.value.auth_header_valor=P),type:"password",placeholder:"Valor del header (ej: Bearer xxxx)",class:"input"},null,512)),[[de,i.value.auth_header_valor]]):W("",!0)]),l("label",up,[Q(l("input",{"onUpdate:modelValue":k[6]||(k[6]=P=>i.value.activa=P),type:"checkbox"},null,512),[[yt,i.value.activa]]),k[17]||(k[17]=re(" Activa ",-1))]),l("div",cp,[l("button",{type:"button",class:"btn-ghost",onClick:k[7]||(k[7]=P=>o.value=!1)},"Cancelar"),k[18]||(k[18]=l("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):W("",!0)]))}},fp={class:"card p-4 mb-4"},pp={class:"flex items-center justify-between mb-2"},mp={class:"bg-elevado border border-borde rounded-lg p-2.5 text-xs text-texto overflow-x-auto"},hp={class:"card divide-y divide-borde"},vp={class:"flex items-center justify-between"},gp={class:"font-medium text-texto capitalize"},bp={class:"flex gap-3 text-sm"},xp=["onClick"],yp=["onClick"],_p={class:"flex gap-4 mt-2 text-xs"},wp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},kp=["checked","onChange"],Cp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},$p=["checked","onChange"],Ap={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Sp=["checked","onChange"],Ep={class:"label mt-1 break-all"},Ip={class:"bg-elevado px-1 rounded"},Rp={key:0,class:"text-xs text-tenue mt-1"},Pp={key:1,class:"text-xs text-red-600 dark:text-red-400 mt-1"},Tp={class:"card p-6 w-full max-w-md"},Op={key:0},Dp={class:"flex flex-col gap-2 pt-1"},Mp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Np={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},jp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Vp={class:"flex justify-end gap-2 pt-2"},Up={__name:"TabCanales",props:{agenteId:{type:Number,required:!0},siteKey:{type:String,default:""},canales:{type:Array,default:()=>[]}},emits:["recargar","error"],setup(e,{emit:t}){const n=e,s=t,o=q(!1),r=q(f()),i=q(!1),a=ie(()=>{const E=n.siteKey||"TU_SITE_KEY";return`<script src="${window.location.origin}/widget/umind.js" data-site="${E}" defer><\/script>`});async function u(){try{await navigator.clipboard.writeText(a.value),i.value=!0,setTimeout(()=>i.value=!1,2e3)}catch{error.value="No se pudo copiar automáticamente — seleccioná el texto y copialo a mano."}}function f(){return{tipo:"telegram",bot_token:"",phone_number_id:"",access_token:"",app_secret:"",verify_token:"",usar_whisper_audio:!1,usar_ocr_imagenes:!1,usar_archivos_docs:!1}}function c(){r.value=f(),o.value=!0}async function h(){const E=r.value.tipo==="telegram"?{bot_token:r.value.bot_token}:{phone_number_id:r.value.phone_number_id,access_token:r.value.access_token,app_secret:r.value.app_secret,verify_token:r.value.verify_token};try{await se.post(te("/umind/canales"),{agente_id:n.agenteId,tipo:r.value.tipo,credenciales:E,activo:!0,usar_whisper_audio:r.value.usar_whisper_audio,usar_ocr_imagenes:r.value.usar_ocr_imagenes,usar_archivos_docs:r.value.usar_archivos_docs}),o.value=!1,s("recargar")}catch(C){s("error",C.message)}}async function m(E,C){await se.put(te(`/umind/canales/${E.ID}`),{activo:E.activo,credenciales:{},usar_whisper_audio:E.usar_whisper_audio,usar_ocr_imagenes:E.usar_ocr_imagenes,usar_archivos_docs:E.usar_archivos_docs,...C}),s("recargar")}const b=E=>m(E,{activo:!E.activo}),$=E=>m(E,{usar_whisper_audio:!E.usar_whisper_audio}),k=E=>m(E,{usar_ocr_imagenes:!E.usar_ocr_imagenes}),P=E=>m(E,{usar_archivos_docs:!E.usar_archivos_docs});async function M(E){confirm(`¿Eliminar el canal ${E.tipo}?`)&&(await se.del(te(`/umind/canales/${E.ID}`)),s("recargar"))}return(E,C)=>(v(),w("div",null,[l("div",fp,[l("div",pp,[C[11]||(C[11]=l("div",null,[l("span",{class:"font-medium text-texto"},"Web (widget)"),l("span",{class:"ml-2 px-1.5 py-0.5 rounded text-xs badge-ok"}," siempre activo ")],-1)),l("button",{class:ce(["text-sm font-medium px-3 py-1.5 rounded-lg transition-colors",i.value?"bg-green-600 text-white":"bg-brand hover:bg-brand-dark text-white"]),onClick:u},[i.value?(v(),xe(Te,{key:0,nombre:"ok",tam:14})):W("",!0),re(" "+I(i.value?"Copiado":"Copiar código"),1)],2)]),C[12]||(C[12]=l("p",{class:"label mb-2"},[re(" Pegá esto antes de "),l("code",{class:"bg-elevado px-1 rounded"},"</body>"),re(" en las páginas de tu sitio. ")],-1)),l("pre",mp,[l("code",null,I(a.value),1)])]),l("div",{class:"flex justify-end mb-4"},[l("button",{class:"btn-primary",onClick:c}," + Nuevo canal ")]),l("div",hp,[e.canales.length===0?(v(),xe(rt,{key:0,titulo:"No está atendiendo en ningún lado",detalle:"Conectá WhatsApp o Telegram para que empiece a responderle a tus clientes. El widget de tu web funciona aparte, con la clave de sitio de arriba."})):W("",!0),(v(!0),w(ne,null,we(e.canales,_=>(v(),w("div",{key:_.ID,class:"p-4"},[l("div",vp,[l("div",null,[l("span",gp,I(_.tipo),1),l("span",{class:ce(["ml-2 px-1.5 py-0.5 rounded text-xs",_.activo?"badge-ok":"badge-neutro"])},I(_.activo?"activo":"inactivo"),3)]),l("div",bp,[l("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:y=>b(_)},I(_.activo?"Desactivar":"Activar"),9,xp),l("button",{class:"text-red-500 hover:text-red-700",onClick:y=>M(_)},"Eliminar",8,yp)])]),l("div",_p,[l("label",wp,[l("input",{type:"checkbox",checked:_.usar_whisper_audio,onChange:y=>$(_),class:"rounded border-borde text-brand focus:ring-brand"},null,40,kp),C[13]||(C[13]=re(" Transcribir audios (Whisper) ",-1))]),l("label",Cp,[l("input",{type:"checkbox",checked:_.usar_ocr_imagenes,onChange:y=>k(_),class:"rounded border-borde text-brand focus:ring-brand"},null,40,$p),C[14]||(C[14]=re(" Leer texto de imágenes (OCR) ",-1))]),l("label",Ap,[l("input",{type:"checkbox",checked:_.usar_archivos_docs,onChange:y=>P(_),class:"rounded border-borde text-brand focus:ring-brand"},null,40,Sp),C[15]||(C[15]=re(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),l("p",Ep,[C[16]||(C[16]=re(" Webhook: ",-1)),l("code",Ip,I(_.webhook_url),1)]),_.tipo==="whatsapp"?(v(),w("p",Rp,' Registrá esta URL como "Callback URL" en Meta for Developers → WhatsApp → Configuration, con el mismo verify_token que pusiste acá. ')):W("",!0),_.ultimo_error?(v(),w("p",Pp,I(_.ultimo_error),1)):W("",!0)]))),128))]),o.value?(v(),w("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:C[10]||(C[10]=Pe(_=>o.value=!1,["self"]))},[l("div",Tp,[C[28]||(C[28]=l("h2",{class:"font-semibold text-texto mb-4"},"Nuevo canal",-1)),l("form",{class:"space-y-3",onSubmit:Pe(h,["prevent"])},[l("div",null,[C[18]||(C[18]=l("label",{class:"label"},"Tipo",-1)),Q(l("select",{"onUpdate:modelValue":C[0]||(C[0]=_=>r.value.tipo=_),class:"input"},[...C[17]||(C[17]=[l("option",{value:"telegram"},"Telegram",-1),l("option",{value:"whatsapp"},"WhatsApp Business",-1)])],512),[[un,r.value.tipo]])]),r.value.tipo==="telegram"?(v(),w("div",Op,[C[19]||(C[19]=l("label",{class:"label"},"Bot token (de @BotFather)",-1)),Q(l("input",{"onUpdate:modelValue":C[1]||(C[1]=_=>r.value.bot_token=_),type:"password",required:"",class:"input"},null,512),[[de,r.value.bot_token]])])):(v(),w(ne,{key:1},[l("div",null,[C[20]||(C[20]=l("label",{class:"label"},"Phone Number ID",-1)),Q(l("input",{"onUpdate:modelValue":C[2]||(C[2]=_=>r.value.phone_number_id=_),required:"",class:"input"},null,512),[[de,r.value.phone_number_id]])]),l("div",null,[C[21]||(C[21]=l("label",{class:"label"},"Access Token",-1)),Q(l("input",{"onUpdate:modelValue":C[3]||(C[3]=_=>r.value.access_token=_),type:"password",required:"",class:"input"},null,512),[[de,r.value.access_token]])]),l("div",null,[C[22]||(C[22]=l("label",{class:"label"},"App Secret",-1)),Q(l("input",{"onUpdate:modelValue":C[4]||(C[4]=_=>r.value.app_secret=_),type:"password",required:"",class:"input"},null,512),[[de,r.value.app_secret]])]),l("div",null,[C[23]||(C[23]=l("label",{class:"label"},"Verify Token (lo inventás vos, lo vas a usar en Meta)",-1)),Q(l("input",{"onUpdate:modelValue":C[5]||(C[5]=_=>r.value.verify_token=_),required:"",class:"input"},null,512),[[de,r.value.verify_token]])])],64)),l("div",Dp,[l("label",Mp,[Q(l("input",{type:"checkbox","onUpdate:modelValue":C[6]||(C[6]=_=>r.value.usar_whisper_audio=_),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[yt,r.value.usar_whisper_audio]]),C[24]||(C[24]=re(" Transcribir audios con Whisper ",-1))]),l("label",Np,[Q(l("input",{type:"checkbox","onUpdate:modelValue":C[7]||(C[7]=_=>r.value.usar_ocr_imagenes=_),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[yt,r.value.usar_ocr_imagenes]]),C[25]||(C[25]=re(" Leer texto de imágenes con OCR ",-1))]),l("label",jp,[Q(l("input",{type:"checkbox","onUpdate:modelValue":C[8]||(C[8]=_=>r.value.usar_archivos_docs=_),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[yt,r.value.usar_archivos_docs]]),C[26]||(C[26]=re(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),l("div",Vp,[l("button",{type:"button",class:"btn-ghost",onClick:C[9]||(C[9]=_=>o.value=!1)},"Cancelar"),C[27]||(C[27]=l("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):W("",!0)]))}},Lp={class:"card p-1 mb-6 flex flex-wrap"},Fp=["onClick"],qp={class:"text-red-700 dark:text-red-400 font-medium"},Hp={__name:"EstadoAgente",props:{canales:{type:Array,default:()=>[]},documentos:{type:Array,default:()=>[]},sesiones:{type:Array,default:()=>[]},eventos:{type:Array,default:()=>[]}},emits:["ir"],setup(e,{emit:t}){const n=e,s=t,o=ie(()=>n.canales.filter(m=>m.activo)),r={whatsapp:"WhatsApp",telegram:"Telegram",web:"tu web"},i=m=>r[m]||m,a=ie(()=>n.documentos.filter(m=>m.estado==="listo")),u=ie(()=>a.value.filter(m=>m.procesado_at&&Date.now()-new Date(m.procesado_at)>60*864e5)),f=ie(()=>n.eventos.filter(m=>m.nivel==="error").length),c=ie(()=>n.sesiones.filter(m=>!String(m.session_id).startsWith("staff-preview"))),h=ie(()=>[{clave:"canales",icono:"mensaje",bien:o.value.length>0,texto:o.value.length?`Atendiendo en ${o.value.map(m=>i(m.tipo)).join(" y ")}`:"No está atendiendo en ningún lado",destino:"canales"},{clave:"conocimiento",icono:"escribir",bien:a.value.length>0&&u.value.length===0,texto:a.value.length?u.value.length?`${u.value.length} de ${a.value.length} fuentes están viejas`:`Sabe de ${a.value.length} ${a.value.length===1?"cosa":"cosas"}`:"Todavía no sabe nada de tu negocio",destino:"conocimiento"},{clave:"conversaciones",icono:"grafico",bien:!0,neutro:c.value.length===0,texto:c.value.length?`${c.value.length} ${c.value.length===1?"conversación":"conversaciones"}`:"Nadie escribió todavía",destino:"conversaciones"}]);return(m,b)=>(v(),w("div",Lp,[(v(!0),w(ne,null,we(h.value,$=>(v(),w("button",{key:$.clave,class:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm hover:bg-elevado transition-colors text-left",onClick:k=>s("ir",$.destino)},[ee(Te,{nombre:$.bien?$.icono:"alerta",tam:16,class:ce($.neutro?"text-tenue":$.bien?"text-brand":"text-amber-600 dark:text-amber-400")},null,8,["nombre","class"]),l("span",{class:ce($.neutro?"text-tenue":$.bien?"text-texto":"text-amber-700 dark:text-amber-400 font-medium")},I($.texto),3)],8,Fp))),128)),f.value?(v(),w("button",{key:0,class:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm hover:bg-elevado transition-colors ml-auto",onClick:b[0]||(b[0]=$=>s("ir","auditoria"))},[ee(Te,{nombre:"alerta",tam:16,class:"text-red-600 dark:text-red-400"}),l("span",qp,I(f.value)+" "+I(f.value===1?"problema":"problemas"),1)])):W("",!0)]))}},Bp={class:"card p-5 mb-6"},Wp={class:"flex items-start gap-4"},Gp={class:"min-w-0 flex-1"},Kp={class:"flex items-baseline justify-between gap-3"},zp={class:"text-xs text-tenue tabular-nums shrink-0"},Jp={class:"space-y-2.5"},Qp={class:"min-w-0 flex-1"},Yp={key:0,class:"text-xs text-tenue mt-0.5"},Zp=["onClick"],Xp={__name:"PrimerosPasos",props:{documentos:{type:Array,default:()=>[]},canales:{type:Array,default:()=>[]},sesiones:{type:Array,default:()=>[]}},emits:["ir"],setup(e,{emit:t}){const n=e,s=t,o=ie(()=>n.documentos.some(c=>c.estado==="listo")),r=ie(()=>n.sesiones.some(c=>String(c.session_id).startsWith("staff-preview"))),i=ie(()=>n.canales.some(c=>c.activo)),a=ie(()=>[{n:1,hecho:o.value,titulo:"Contale de tu negocio",detalle:"Escribí tus horarios, precios y lo que te preguntan siempre — o subí tu lista de precios, o dale tu sitio web.",accion:"Cargar información",destino:"conocimiento"},{n:2,hecho:r.value,titulo:"Hacele una pregunta",detalle:"Preguntale algo como lo haría un cliente. Si contesta mal, corregí su información y probá de nuevo.",accion:"Probarlo",destino:"conocimiento"},{n:3,hecho:i.value,titulo:"Ponelo a atender",detalle:"Conectá tu WhatsApp o Telegram, o pegá el widget en tu web. Desde ese momento responde solo.",accion:"Elegir dónde",destino:"canales"}]),u=ie(()=>a.value.filter(c=>c.hecho).length),f=ie(()=>{var c;return((c=a.value.find(h=>!h.hecho))==null?void 0:c.n)??null});return(c,h)=>(v(),w("div",Bp,[l("div",Wp,[ee(Nn,{estado:u.value===0?"durmiendo":"contenta",tam:52,class:"text-brand shrink-0 hidden sm:block"},null,8,["estado"]),l("div",Gp,[l("div",Kp,[h[0]||(h[0]=l("h2",{class:"font-semibold text-texto"},"Pongamos a andar tu asistente",-1)),l("span",zp,I(u.value)+" de "+I(a.value.length),1)]),h[1]||(h[1]=l("p",{class:"text-sm text-tenue mt-0.5 mb-4"}," Tres pasos y empieza a responderle a tus clientes. Diez minutos, sin nada técnico. ",-1)),l("ol",Jp,[(v(!0),w(ne,null,we(a.value,m=>(v(),w("li",{key:m.n,class:ce(["flex items-start gap-3 rounded-lg p-2.5 -m-0.5 transition-colors",m.n===f.value?"bg-brand/5 border border-brand/30":""])},[l("span",{class:ce(["w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold shrink-0 mt-0.5",m.hecho?"bg-brand text-white":m.n===f.value?"border-2 border-brand text-brand":"border border-borde text-tenue"])},[m.hecho?(v(),xe(Te,{key:0,nombre:"ok",tam:13})):(v(),w(ne,{key:1},[re(I(m.n),1)],64))],2),l("div",Qp,[l("p",{class:ce(["text-sm font-medium",m.hecho?"text-tenue line-through":"text-texto"])},I(m.titulo),3),m.hecho?W("",!0):(v(),w("p",Yp,I(m.detalle),1))]),!m.hecho&&m.n===f.value?(v(),w("button",{key:0,class:"btn-primary !py-1.5 !px-3 text-sm shrink-0",onClick:b=>s("ir",m.destino)},I(m.accion),9,Zp)):W("",!0)],2))),128))])])])]))}},em={key:0,class:"mb-4 mt-1 flex items-start justify-between gap-4"},tm={class:"text-xl font-semibold text-texto min-w-0 truncate"},nm=["href"],sm={key:3,class:"text-sm text-red-600 dark:text-red-400 mb-4"},om={class:"flex items-center gap-1.5 mb-6 flex-wrap"},rm=["onClick"],im={class:"text-[10px]"},lm={key:4,class:"flex gap-1.5 mb-6 flex-wrap"},am=["onClick"],um={key:5,class:"grid gap-4 lg:grid-cols-[1fr_21rem] items-start"},cm={class:"card p-4 mb-4"},dm={class:"flex gap-1 mb-3"},fm=["onClick"],pm={class:"flex items-center justify-between"},mm=["disabled"],hm={class:"flex items-center justify-between"},vm=["disabled"],gm={class:"flex gap-2"},bm={class:"flex items-center justify-between"},xm={class:"flex items-center gap-2 text-xs text-tenue cursor-pointer"},ym=["disabled"],_m={class:"card divide-y divide-borde"},wm={class:"text-sm text-texto"},km={class:"text-xs text-tenue mt-0.5"},Cm={key:0,class:"latido"},$m={key:0},Am={key:1},Sm={key:3},Em={key:4,class:"text-red-600 dark:text-red-400"},Im={class:"flex items-center gap-3 shrink-0"},Rm=["title","onClick"],Pm=["onClick"],Tm=["disabled","title","onClick"],Om=["onClick"],Dm={class:"lg:sticky lg:top-4"},Mm={class:"card w-full max-w-2xl p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},Nm={class:"flex justify-end gap-2 pt-1"},jm=["disabled"],Vm={__name:"AgenteDetail",props:{tenantId:{type:String,required:!0},agenteId:{type:String,required:!0}},setup(e){const t=e,n=ie(()=>Number(t.agenteId)),s=Wi(),o=q(null),r=q(""),i=q(typeof s.query.tab=="string"?s.query.tab:Je.esPortal?"conversaciones":"conocimiento"),a=q([]),u=q(""),f=q(30),c=q(!1);async function h(){const d=await se.get(te(`/umind/agentes?tenant_id=${t.tenantId}`));o.value=(d.items||[]).find(p=>String(p.ID)===t.agenteId)||null}async function m(){const d=await se.get(te(`/umind/documentos?agente_id=${t.agenteId}`));a.value=d.items||[]}const b=q("texto"),$=q(!0),k=q(""),P=q(""),M=q(null);async function E(){if(u.value.trim()){c.value=!0,r.value="";try{await se.post(te("/umind/documentos"),{agente_id:n.value,url:u.value.trim(),max_paginas:Number(f.value)||30,auto_actualizar:$.value}),u.value="",await m()}catch(d){r.value=d.message}finally{c.value=!1}}}async function C(){if(P.value.trim()){c.value=!0,r.value="";try{await se.post(te("/umind/documentos/texto"),{agente_id:n.value,titulo:k.value.trim(),contenido:P.value}),k.value="",P.value="",await m()}catch(d){r.value=d.message}finally{c.value=!1}}}async function _(){var p,g;const d=(g=(p=M.value)==null?void 0:p.files)==null?void 0:g[0];if(d){c.value=!0,r.value="";try{const S=new FormData;S.append("agente_id",String(n.value)),S.append("archivo",d);const x=await fetch(te("/umind/documentos/archivo"),{method:"POST",body:S}),A=await x.json();if(!x.ok)throw new Error(A.error||"No se pudo subir");M.value.value="",await m()}catch(S){r.value=S.message}finally{c.value=!1}}}const y=q(null),O=q({titulo:"",contenido:""}),j=q(!1);function V(d){y.value=d,O.value={titulo:d.origen,contenido:d.contenido||""}}async function ke(){if(y.value){j.value=!0,r.value="";try{await se.put(te(`/umind/documentos/${y.value.ID}`),{titulo:O.value.titulo,contenido:O.value.contenido}),y.value=null,await m()}catch(d){r.value=d.message}finally{j.value=!1}}}async function Z(d){r.value="";try{await se.post(te(`/umind/documentos/${d.ID}/reprocesar`),{}),await m()}catch(p){r.value=p.message}}async function U(d){try{await se.put(te(`/umind/documentos/${d.ID}`),{auto_actualizar:!d.auto_actualizar}),await m()}catch(p){r.value=p.message}}function Se(d){if(!d)return"sin procesar";const p=Math.floor((Date.now()-new Date(d))/864e5);if(p<=0)return"hoy";if(p===1)return"ayer";if(p<30)return`hace ${p} días`;const g=Math.floor(p/30);return g===1?"hace un mes":`hace ${g} meses`}function G(d){return d.procesado_at?Date.now()-new Date(d.procesado_at)>60*864e5:!1}async function Ke(d){confirm("¿Eliminar esta fuente y sus fragmentos indexados?")&&(await se.del(te(`/umind/documentos/${d}`)),await m())}const jt=ie(()=>d=>({listo:"badge-ok",procesando:"badge-alerta",pendiente:"badge-neutro",error:"badge-error"})[d]||"badge-neutro"),Ce=q([]);async function fe(){const d=await se.get(te(`/umind/sesiones?agente_id=${t.agenteId}`));Ce.value=d.items||[]}const ae=q([]);async function et(){const d=await se.get(te(`/umind/tools?agente_id=${t.agenteId}`));ae.value=d.items||[]}const qe=q([]);async function Qe(){const d=await se.get(te(`/umind/canales?agente_id=${t.agenteId}`));qe.value=d.items||[]}const je=ie(()=>{const d=new Date,p=new Date(d.getFullYear(),d.getMonth(),1).toISOString().slice(0,10),g=d.toISOString().slice(0,10);return te(`/umind/reporte.xlsx?agente_id=${t.agenteId}&desde=${p}&hasta=${g}`)}),ct=q([]);async function wt(){const d=await se.get(te(`/umind/conexiones?agente_id=${t.agenteId}`));ct.value=d.items||[]}const kt=[["conversaciones","Conversaciones"],["conocimiento","Lo que sabe"],["canales","Dónde atiende"]],Ve=[["herramientas","Herramientas"],["conexiones","Cuentas conectadas"],["auditoria","Problemas"]],R=ie(()=>!a.value.some(d=>d.estado==="listo")||!qe.value.some(d=>d.activo)),H=q(!1);Ve.some(([d])=>d===i.value)&&(H.value=!0);function F(d){i.value=d,Ve.some(([p])=>p===d)&&(H.value=!0)}const K=q([]);async function le(){const d=await se.get(te(`/umind/eventos?agente_id=${t.agenteId}`));K.value=d.items||[]}return Pt(()=>[t.tenantId,t.agenteId],async()=>{r.value="",o.value=null,a.value=[],Ce.value=[],ae.value=[],qe.value=[],ct.value=[],K.value=[];try{await Promise.all([h(),m(),fe(),et(),Qe(),wt(),le()])}catch(d){r.value=d.message}},{immediate:!0}),(d,p)=>{var S;const g=mn("router-link");return v(),w("div",null,[ee(g,{to:`/tenants/${e.tenantId}`,class:"label hover:text-brand"},{default:nt(()=>[...p[12]||(p[12]=[re("← Agentes",-1)])]),_:1},8,["to"]),o.value?(v(),w("div",em,[l("h1",tm,I(o.value.nombre),1),l("a",{href:je.value,class:"btn-ghost shrink-0",title:"Conversaciones y consumo del mes en Excel"},[ee(Te,{nombre:"descargar",tam:15}),p[13]||(p[13]=re(" Reporte del mes ",-1))],8,nm)])):W("",!0),o.value&&R.value?(v(),xe(Xp,{key:1,documentos:a.value,canales:qe.value,sesiones:Ce.value,onIr:F},null,8,["documentos","canales","sesiones"])):o.value?(v(),xe(Hp,{key:2,canales:qe.value,documentos:a.value,sesiones:Ce.value,eventos:K.value,onIr:F},null,8,["canales","documentos","sesiones","eventos"])):W("",!0),r.value?(v(),w("p",sm,I(r.value),1)):W("",!0),l("div",om,[(v(),w(ne,null,we(kt,([x,A])=>l("button",{key:x,class:ce(["px-3.5 py-1.5 rounded-full text-sm whitespace-nowrap transition-colors",i.value===x?"bg-brand text-white font-medium":"bg-white dark:bg-gray-900 text-gray-600 dark:text-gray-400 border border-borde hover:border-brand/50"]),onClick:L=>i.value=x},I(A),11,rm)),64)),l("button",{class:"ml-auto text-xs text-tenue hover:text-texto inline-flex items-center gap-1",onClick:p[0]||(p[0]=x=>H.value=!H.value)},[p[14]||(p[14]=re(" Avanzado ",-1)),l("span",im,I(H.value?"▲":"▼"),1)])]),H.value?(v(),w("div",lm,[(v(),w(ne,null,we(Ve,([x,A])=>l("button",{key:x,class:ce(["px-3 py-1 rounded-full text-xs whitespace-nowrap transition-colors",i.value===x?"bg-texto text-white dark:bg-gray-200 dark:text-gray-900 font-medium":"bg-white dark:bg-gray-900 text-tenue border border-borde hover:border-brand/50"]),onClick:L=>i.value=x},I(A),11,am)),64))])):W("",!0),i.value==="conocimiento"?(v(),w("div",um,[l("div",null,[l("div",cm,[l("div",dm,[(v(),w(ne,null,we([["texto","escribir","Escribir"],["archivo","archivo","Subir archivo"],["url","sitio","Sitio web"]],([x,A,L])=>l("button",{key:x,class:ce(["px-3 py-1.5 rounded-lg text-sm inline-flex items-center gap-1.5",b.value===x?"bg-brand text-white font-medium":"text-tenue hover:text-texto"]),onClick:N=>b.value=x},[ee(Te,{nombre:A,tam:15},null,8,["nombre"]),re(" "+I(L),1)],10,fm)),64))]),b.value==="texto"?(v(),w("form",{key:0,class:"space-y-2",onSubmit:Pe(C,["prevent"])},[Q(l("input",{"onUpdate:modelValue":p[1]||(p[1]=x=>k.value=x),placeholder:"Título (ej: Horarios y zonas de entrega)",class:"input"},null,512),[[de,k.value]]),Q(l("textarea",{"onUpdate:modelValue":p[2]||(p[2]=x=>P.value=x),rows:"5",required:"",placeholder:"Atendemos de lunes a viernes de 9 a 18. No hacemos envíos fuera de la ciudad. La garantía es de 6 meses y cubre…",class:"input font-normal"},null,512),[[de,P.value]]),l("div",pm,[p[15]||(p[15]=l("p",{class:"text-xs text-tenue"},"Lo que te preguntan todos los días y no está en tu web.",-1)),l("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},I(c.value?"Guardando…":"Guardar"),9,mm)])],32)):b.value==="archivo"?(v(),w("form",{key:1,class:"space-y-2",onSubmit:Pe(_,["prevent"])},[l("input",{ref_key:"archivoRef",ref:M,type:"file",accept:".pdf,.docx,.txt,.md,.csv,.html,image/*",class:"text-sm text-texto"},null,512),l("div",hm,[p[16]||(p[16]=l("p",{class:"text-xs text-tenue"},"PDF, Word, texto o una foto. Ej: tu lista de precios.",-1)),l("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},I(c.value?"Leyendo…":"Subir"),9,vm)])],32)):(v(),w("form",{key:2,class:"space-y-2",onSubmit:Pe(E,["prevent"])},[l("div",gm,[Q(l("input",{"onUpdate:modelValue":p[3]||(p[3]=x=>u.value=x),type:"url",placeholder:"https://ejemplo.com",required:"",class:"input flex-1"},null,512),[[de,u.value]]),Q(l("input",{"onUpdate:modelValue":p[4]||(p[4]=x=>f.value=x),type:"number",min:"1",max:"200",class:"input w-24",title:"Máximo de páginas a leer"},null,512),[[de,f.value]])]),l("div",bm,[l("label",xm,[Q(l("input",{"onUpdate:modelValue":p[5]||(p[5]=x=>$.value=x),type:"checkbox",class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[yt,$.value]]),p[17]||(p[17]=re(" Releer el sitio cada semana ",-1))]),l("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},I(c.value?"Leyendo…":"Leer sitio"),9,ym)])],32))]),l("div",_m,[a.value.length===0?(v(),xe(rt,{key:0,estado:"buscando",titulo:"Todavía no sabe nada de tu negocio",detalle:"Sin información cargada va a contestar que no sabe. Empezá por escribir tus horarios y lo que te preguntan todos los días — es lo más rápido y lo que más se nota."})):W("",!0),(v(!0),w(ne,null,we(a.value,x=>(v(),w("div",{key:x.ID,class:"p-4 flex items-center justify-between"},[l("div",null,[l("div",wm,I(x.origen),1),l("div",km,[l("span",{class:ce(["px-1.5 py-0.5 rounded inline-flex items-center gap-1",jt.value(x.estado)])},[x.estado==="procesando"?(v(),w("span",Cm)):W("",!0),re(" "+I(x.estado),1)],2),x.tipo?(v(),w("span",$m," · "+I({url:"sitio",archivo:"archivo",texto:"nota"}[x.tipo]||x.tipo),1)):W("",!0),x.total_chunks?(v(),w("span",Am," · "+I(x.total_chunks)+" fragmentos",1)):W("",!0),x.procesado_at?(v(),w("span",{key:2,class:ce(G(x)?"text-amber-600 dark:text-amber-400 font-medium":"")}," · leído "+I(Se(x.procesado_at)),3)):W("",!0),x.auto_actualizar?(v(),w("span",Sm," · se actualiza sola")):W("",!0),x.error?(v(),w("span",Em," · "+I(x.error),1)):W("",!0)])]),l("div",Im,[x.tipo==="url"?(v(),w("button",{key:0,class:"text-xs text-tenue hover:text-texto",title:x.auto_actualizar?"Dejar de releer sola":"Releer el sitio cada semana",onClick:A=>U(x)},[ee(Te,{nombre:x.auto_actualizar?"auto":"refrescar",tam:13,class:"mr-1"},null,8,["nombre"]),re(I(x.auto_actualizar?"auto":"manual"),1)],8,Rm)):W("",!0),x.tipo==="texto"||x.tipo==="archivo"?(v(),w("button",{key:1,class:"text-sm text-brand hover:underline",onClick:A=>V(x)},"Editar",8,Pm)):W("",!0),l("button",{class:"text-sm text-tenue hover:text-texto disabled:opacity-40",disabled:x.estado==="procesando",title:x.tipo==="url"?"Volver a leer el sitio":"Rehacer los fragmentos",onClick:A=>Z(x)},"Actualizar",8,Tm),l("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:A=>Ke(x.ID)},"Eliminar",8,Om)])]))),128))])]),l("div",Dm,[p[18]||(p[18]=l("p",{class:"label mb-2"},"Probalo",-1)),ee(br,{"agente-id":n.value},null,8,["agente-id"])]),y.value?(v(),w("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:p[9]||(p[9]=Pe(x=>y.value=null,["self"]))},[l("div",Mm,[p[22]||(p[22]=l("h2",{class:"font-semibold text-texto mb-1"},"Editar fuente",-1)),p[23]||(p[23]=l("p",{class:"text-xs text-tenue mb-4"}," Al guardar se vuelve a leer y el agente empieza a contestar con esto. ",-1)),l("form",{class:"space-y-3",onSubmit:Pe(ke,["prevent"])},[l("div",null,[p[19]||(p[19]=l("label",{class:"label"},"Título",-1)),Q(l("input",{"onUpdate:modelValue":p[6]||(p[6]=x=>O.value.titulo=x),required:"",class:"input"},null,512),[[de,O.value.titulo]])]),l("div",null,[p[20]||(p[20]=l("label",{class:"label"},"Contenido",-1)),Q(l("textarea",{"onUpdate:modelValue":p[7]||(p[7]=x=>O.value.contenido=x),rows:"16",required:"",class:"input font-normal leading-relaxed"},null,512),[[de,O.value.contenido]]),p[21]||(p[21]=l("p",{class:"text-xs text-tenue mt-1.5"}," Si viene de una plantilla, reemplazá lo que está [entre corchetes] por tus datos. Lo que quede sin reemplazar el agente lo va a leer tal cual. ",-1))]),l("div",Nm,[l("button",{type:"button",class:"btn-ghost",onClick:p[8]||(p[8]=x=>y.value=null)},"Cancelar"),l("button",{type:"submit",class:"btn-primary",disabled:j.value},I(j.value?"Guardando…":"Guardar y volver a leer"),9,jm)])],32)])])):W("",!0)])):i.value==="herramientas"?(v(),xe(dp,{key:6,"agente-id":n.value,tools:ae.value,onRecargar:et,onError:p[10]||(p[10]=x=>r.value=x)},null,8,["agente-id","tools"])):i.value==="canales"?(v(),xe(Up,{key:7,"agente-id":n.value,"site-key":((S=o.value)==null?void 0:S.site_key)||"",canales:qe.value,onRecargar:Qe,onError:p[11]||(p[11]=x=>r.value=x)},null,8,["agente-id","site-key","canales"])):i.value==="conexiones"?(v(),xe(Cf,{key:8,"agente-id":n.value,conexiones:ct.value,onRecargar:wt},null,8,["agente-id","conexiones"])):i.value==="chat"?(v(),xe(br,{key:9,"agente-id":n.value},null,8,["agente-id"])):i.value==="conversaciones"?(v(),xe(Ff,{key:10,"agente-id":n.value,sesiones:Ce.value},null,8,["agente-id","sesiones"])):(v(),xe(bf,{key:11,eventos:K.value},null,8,["eventos"]))])}}},Um={class:"flex items-start justify-between gap-4 mb-6"},Lm={class:"card p-4 mb-4"},Fm={class:"flex flex-wrap items-end gap-3"},qm={class:"flex gap-1 ml-auto"},Hm={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Bm={key:1,class:"text-sm text-tenue"},Wm={class:"grid gap-3 sm:grid-cols-3 mb-4"},Gm={class:"card p-4"},Km={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},zm={class:"card p-4"},Jm={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},Qm={class:"card p-4"},Ym={class:"text-lg font-semibold text-texto mt-1"},Zm={key:0,class:"text-[11px] text-tenue mt-0.5"},Xm={key:0,class:"card p-4 mb-4"},eh={class:"flex items-center justify-between text-sm mb-2"},th={class:"text-tenue tabular-nums"},nh={class:"h-2 rounded-full bg-elevado overflow-hidden"},sh={key:0,class:"text-xs text-amber-600 dark:text-amber-400 mt-2"},oh={class:"card divide-y divide-borde mb-4"},rh={class:"min-w-0 flex-1"},ih={class:"text-sm text-texto"},lh={class:"text-xs text-tenue tabular-nums"},ah={key:0,class:"text-sm font-medium text-texto tabular-nums"},uh={key:1,class:"text-xs text-tenue text-right leading-tight"},ch={key:1,class:"card p-4"},dh={class:"flex items-end gap-1 h-28"},fh=["title"],ph={class:"flex justify-between text-[11px] text-tenue mt-2"},mh={__name:"Uso",props:{id:{type:String,required:!0}},setup(e){const t=e,n=q(!0),s=q(""),o=q(null),r=new Date,i=q(new Date(r.getFullYear(),r.getMonth(),1).toISOString().slice(0,10)),a=q(r.toISOString().slice(0,10)),u={ia:{nombre:"Inteligencia artificial",icono:"cerebro",color:"#8eb02f"},ocr:{nombre:"Lectura de imágenes",icono:"imagen",color:"#2f7fb0"},whisper:{nombre:"Transcripción de audio",icono:"microfono",color:"#b0752f"}},f=_=>u[_]||{nombre:_,icono:"grafico",color:"#94a3b8"};async function c(){n.value=!0,s.value="";try{o.value=await se.get(te(`/umind/uso?tenant_id=${t.id}&desde=${i.value}&hasta=${a.value}`))}catch(_){s.value=_.message}finally{n.value=!1}}const h=ie(()=>{var _,y;return((y=(_=o.value)==null?void 0:_.plan)==null?void 0:y.moneda)||"COP"}),m=ie(()=>{var _;return((_=o.value)==null?void 0:_.resumen)||[]}),b=ie(()=>{var _;return((_=o.value)==null?void 0:_.total_periodo)||0}),$=ie(()=>{var _,y;return((y=(_=o.value)==null?void 0:_.plan)==null?void 0:y.tope_consumo_mensual)||0}),k=ie(()=>$.value?Math.min(100,b.value/$.value*100):0);function P(_){return`${h.value} ${Number(_||0).toLocaleString("es-CO",{maximumFractionDigits:2})}`}function M(_){return Number(_||0).toLocaleString("es-CO",{maximumFractionDigits:0})}const E=ie(()=>{var j;const _=new Map;for(const V of((j=o.value)==null?void 0:j.detalle)||[]){const ke=String(V.CreatedAt).slice(0,10);_.set(ke,(_.get(ke)||0)+(V.costo||0))}const y=[..._.entries()].sort((V,ke)=>V[0].localeCompare(ke[0])),O=Math.max(...y.map(V=>V[1]),0);return{dias:y,max:O}});function C(_){const y=new Date,O=new Date;O.setDate(O.getDate()-_),i.value=O.toISOString().slice(0,10),a.value=y.toISOString().slice(0,10),c()}return Pt(()=>t.id,c,{immediate:!0}),(_,y)=>{var j;const O=mn("router-link");return v(),w("div",null,[l("div",Um,[y[6]||(y[6]=l("div",null,[l("h1",{class:"text-xl font-semibold text-texto"},"Consumo"),l("p",{class:"text-sm text-tenue mt-0.5"},"Lo que usaron tus agentes y cuánto cuesta.")],-1)),ee(O,{to:`/tenants/${e.id}`,class:"btn-ghost inline-flex items-center gap-1.5"},{default:nt(()=>[ee(Te,{nombre:"atras",tam:15}),y[5]||(y[5]=re(" Agentes",-1))]),_:1},8,["to"])]),l("div",Lm,[l("div",Fm,[l("div",null,[y[7]||(y[7]=l("label",{class:"label"},"Desde",-1)),Q(l("input",{"onUpdate:modelValue":y[0]||(y[0]=V=>i.value=V),type:"date",class:"input !w-auto"},null,512),[[de,i.value]])]),l("div",null,[y[8]||(y[8]=l("label",{class:"label"},"Hasta",-1)),Q(l("input",{"onUpdate:modelValue":y[1]||(y[1]=V=>a.value=V),type:"date",class:"input !w-auto"},null,512),[[de,a.value]])]),l("button",{class:"btn-primary",onClick:c},"Aplicar"),l("div",qm,[l("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:y[2]||(y[2]=V=>C(6))},"7 días"),l("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:y[3]||(y[3]=V=>C(29))},"30 días"),l("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:y[4]||(y[4]=V=>C(89))},"90 días")])])]),s.value?(v(),w("p",Hm,I(s.value),1)):W("",!0),n.value?(v(),w("p",Bm,"Cargando…")):o.value?(v(),w(ne,{key:2},[l("div",Wm,[l("div",Gm,[y[9]||(y[9]=l("p",{class:"text-xs text-tenue"},"Consumo del período",-1)),l("p",Km,I(P(b.value)),1)]),l("div",zm,[y[10]||(y[10]=l("p",{class:"text-xs text-tenue"},"Pendiente de facturar",-1)),l("p",Jm,I(P(o.value.pendiente_facturar)),1),y[11]||(y[11]=l("p",{class:"text-[11px] text-tenue mt-0.5"},"Se suma a tu próxima factura.",-1))]),l("div",Qm,[y[12]||(y[12]=l("p",{class:"text-xs text-tenue"},"Plan",-1)),l("p",Ym,I(((j=o.value.plan)==null?void 0:j.nombre)||"Sin plan"),1),o.value.plan?(v(),w("p",Zm," Mensualidad "+I(P(o.value.plan.precio_mensual)),1)):W("",!0)])]),$.value?(v(),w("div",Xm,[l("div",eh,[y[13]||(y[13]=l("span",{class:"text-texto"},"Tope mensual",-1)),l("span",th,I(P(b.value))+" / "+I(P($.value)),1)]),l("div",nh,[l("div",{class:ce(["h-full rounded-full transition-all duration-500",k.value>=100?"bg-red-500":k.value>=80?"bg-amber-500":"bg-brand"]),style:Jt({width:k.value+"%"})},null,6)]),k.value>=100?(v(),w("p",sh," Superaste el tope de tu plan. El servicio sigue funcionando y el excedente se cobra en el próximo ciclo. ")):W("",!0)])):W("",!0),l("div",oh,[y[15]||(y[15]=l("div",{class:"px-4 py-3"},[l("h2",{class:"text-sm font-medium text-texto"},"Desglose")],-1)),m.value.length===0?(v(),xe(rt,{key:0,estado:"durmiendo",titulo:"Sin consumo en este período",detalle:"Cuando tus agentes respondan mensajes, lean imágenes o transcriban audios, vas a verlo acá."})):W("",!0),(v(!0),w(ne,null,we(m.value,V=>(v(),w("div",{key:V.tipo,class:"px-4 py-3 flex items-center gap-3"},[ee(Te,{nombre:f(V.tipo).icono,tam:18,class:"text-tenue"},null,8,["nombre"]),l("div",rh,[l("p",ih,I(f(V.tipo).nombre),1),l("p",lh,I(M(V.cantidad))+" "+I(V.unidad)+" · "+I(M(V.eventos))+" usos ",1)]),V.costo>0?(v(),w("span",ah,I(P(V.costo)),1)):(v(),w("span",uh,[...y[14]||(y[14]=[re(" va por tu",-1),l("br",null,null,-1),re("cuenta de IA ",-1)])]))]))),128))]),E.value.dias.length?(v(),w("div",ch,[y[16]||(y[16]=l("h2",{class:"text-sm font-medium text-texto mb-3"},"Por día",-1)),l("div",dh,[(v(!0),w(ne,null,we(E.value.dias,([V,ke])=>(v(),w("div",{key:V,class:"flex-1 min-w-[3px] bg-brand/70 hover:bg-brand rounded-t transition-colors",style:Jt({height:E.value.max?Math.max(2,ke/E.value.max*100)+"%":"2px"}),title:`${V}: ${P(ke)}`},null,12,fh))),128))]),l("div",ph,[l("span",null,I(E.value.dias[0][0]),1),l("span",null,I(E.value.dias[E.value.dias.length-1][0]),1)])])):W("",!0)],64)):W("",!0)])}}},hh={class:"flex items-start justify-between gap-4 mb-6"},vh={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},gh={key:1,class:"text-sm text-tenue"},bh={key:3,class:"card divide-y divide-borde"},xh={class:"flex items-start justify-between gap-4"},yh={class:"min-w-0"},_h={class:"text-sm text-texto font-medium"},wh={class:"text-xs text-tenue mt-0.5"},kh={class:"font-mono"},Ch={class:"flex items-center gap-3 shrink-0 text-sm"},$h=["disabled","onClick"],Ah=["onClick"],Sh=["onClick"],Eh={key:4,class:"text-xs text-tenue mt-3"},Ih={class:"card w-full max-w-lg p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},Rh={class:"font-semibold text-texto mb-4"},Ph=["value"],Th={key:0,class:"text-xs text-tenue mt-1"},Oh={class:"font-mono"},Dh=["placeholder"],Mh={key:0},Nh={class:"label"},jh={key:0,class:"text-tenue font-normal"},Vh=["required"],Uh={key:1},Lh={class:"flex justify-end gap-2 pt-2"},Fh=["disabled"],qh={__name:"AiPropia",props:{id:{type:String,required:!0}},setup(e){const t=e,n=q([]),s=q(!0),o=q(""),r=q(!1),i=q(null),a=q(!1),u=q(null),f=q({}),c=[{valor:"openai",nombre:"OpenAI",modelo:"gpt-4o-mini",donde:"platform.openai.com/api-keys"},{valor:"anthropic",nombre:"Anthropic (Claude)",modelo:"claude-sonnet-4-20250514",donde:"console.anthropic.com"},{valor:"gemini",nombre:"Google Gemini",modelo:"gemini-2.0-flash",donde:"aistudio.google.com/apikey"},{valor:"groq",nombre:"Groq",modelo:"llama-3.3-70b-versatile",donde:"console.groq.com/keys"},{valor:"deepseek",nombre:"DeepSeek",modelo:"deepseek-chat",donde:"platform.deepseek.com"},{valor:"qwen",nombre:"Qwen (Alibaba)",modelo:"qwen2.5-72b-instruct",donde:"dashscope.console.aliyun.com"},{valor:"ollama",nombre:"Ollama (tu servidor)",modelo:"llama3.1",donde:""}];function h(){return{nombre:"",provider:"openai",api_key:"",base_url:"",model_name:""}}const m=q(h());function b(_){return c.find(y=>y.valor===_)||c[0]}async function $(){s.value=!0,o.value="";try{const _=await se.get(te(`/umind/ai-propia?tenant_id=${t.id}`));n.value=_.items||[]}catch(_){o.value=_.message}finally{s.value=!1}}Pt(()=>t.id,$,{immediate:!0});function k(){i.value=null,m.value=h(),r.value=!0}function P(_){i.value=_,m.value={nombre:_.nombre,provider:_.provider,api_key:"",base_url:_.base_url||"",model_name:_.model_name||""},r.value=!0}async function M(){a.value=!0,o.value="";try{const _={tenant_id:Number(t.id),...m.value};i.value?await se.put(te(`/umind/ai-propia/${i.value.ID}`),_):await se.post(te("/umind/ai-propia"),_),r.value=!1,await $()}catch(_){o.value=_.message}finally{a.value=!1}}async function E(_){u.value=_.ID,f.value={...f.value,[_.ID]:null};try{const y=await se.post(te(`/umind/ai-propia/${_.ID}/probar`),{});f.value={...f.value,[_.ID]:{ok:!0,texto:y.respuesta}}}catch(y){f.value={...f.value,[_.ID]:{ok:!1,texto:y.message}}}finally{u.value=null}}async function C(_){if(confirm(`¿Eliminar "${_.nombre}"?`)){o.value="";try{await se.del(te(`/umind/ai-propia/${_.ID}`)),await $()}catch(y){o.value=y.message}}}return(_,y)=>{const O=mn("router-link");return v(),w("div",null,[l("div",hh,[l("div",null,[ee(O,{to:`/tenants/${e.id}`,class:"text-sm text-tenue hover:text-texto inline-flex items-center gap-1.5"},{default:nt(()=>[ee(Te,{nombre:"atras",tam:14}),y[7]||(y[7]=re(" Agentes",-1))]),_:1},8,["to"]),y[8]||(y[8]=l("h1",{class:"text-xl font-semibold text-texto mt-1"},"Tu cuenta de IA",-1)),y[9]||(y[9]=l("p",{class:"text-sm text-tenue mt-1 max-w-xl"}," Podés usar tu propia cuenta de OpenAI, Claude o Gemini en vez de la nuestra. El consumo se factura directo con el proveedor y no pasa por tu plan. ",-1))]),l("button",{class:"btn-primary shrink-0",onClick:k},"+ Conectar cuenta")]),o.value?(v(),w("p",vh,I(o.value),1)):W("",!0),s.value?(v(),w("div",gh,"Cargando…")):n.value.length===0?(v(),xe(rt,{key:2,class:"card",titulo:"Estás usando la IA de uMind",detalle:"Funciona sin que hagas nada. Conectá tu propia cuenta solo si querés facturar el consumo por tu lado o usar un modelo puntual."},{default:nt(()=>[l("button",{class:"btn-primary",onClick:k},"Conectar mi cuenta")]),_:1})):(v(),w("div",bh,[(v(!0),w(ne,null,we(n.value,j=>(v(),w("div",{key:j.ID,class:"p-4"},[l("div",xh,[l("div",yh,[l("div",_h,I(j.nombre),1),l("div",wh,[re(I(b(j.provider).nombre)+" · "+I(j.model_name)+" · ",1),l("span",kh,I(j.api_key_pista),1)]),f.value[j.ID]?(v(),w("p",{key:0,class:ce(["text-xs mt-1.5",f.value[j.ID].ok?"text-brand":"text-red-600 dark:text-red-400"])},I(f.value[j.ID].ok?`Responde bien — dijo "${f.value[j.ID].texto}"`:f.value[j.ID].texto),3)):W("",!0)]),l("div",Ch,[l("button",{class:"text-brand hover:underline disabled:opacity-40",disabled:u.value===j.ID,onClick:V=>E(j)},I(u.value===j.ID?"Probando…":"Probar"),9,$h),l("button",{class:"text-tenue hover:text-texto",onClick:V=>P(j)},"Editar",8,Ah),l("button",{class:"text-red-500 hover:text-red-700",onClick:V=>C(j)},"Eliminar",8,Sh)])])]))),128))])),n.value.length?(v(),w("p",Eh,[...y[10]||(y[10]=[re(" Para que un agente la use, elegila en su campo ",-1),l("strong",null,"Config de IA",-1),re(". ",-1)])])):W("",!0),r.value?(v(),w("div",{key:5,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:y[6]||(y[6]=Pe(j=>r.value=!1,["self"]))},[l("div",Ih,[l("h2",Rh,I(i.value?"Editar cuenta de IA":"Conectar tu cuenta de IA"),1),l("form",{class:"space-y-3",onSubmit:Pe(M,["prevent"])},[l("div",null,[y[11]||(y[11]=l("label",{class:"label"},"Nombre",-1)),Q(l("input",{"onUpdate:modelValue":y[0]||(y[0]=j=>m.value.nombre=j),required:"",placeholder:"ej: Mi cuenta de OpenAI",class:"input"},null,512),[[de,m.value.nombre]])]),l("div",null,[y[13]||(y[13]=l("label",{class:"label"},"Proveedor",-1)),Q(l("select",{"onUpdate:modelValue":y[1]||(y[1]=j=>m.value.provider=j),class:"input"},[(v(),w(ne,null,we(c,j=>l("option",{key:j.valor,value:j.valor},I(j.nombre),9,Ph)),64))],512),[[un,m.value.provider]]),b(m.value.provider).donde?(v(),w("p",Th,[y[12]||(y[12]=re(" La clave se saca de ",-1)),l("span",Oh,I(b(m.value.provider).donde),1)])):W("",!0)]),l("div",null,[y[14]||(y[14]=l("label",{class:"label"},"Modelo",-1)),Q(l("input",{"onUpdate:modelValue":y[2]||(y[2]=j=>m.value.model_name=j),required:"",placeholder:`ej: ${b(m.value.provider).modelo}`,class:"input font-mono"},null,8,Dh),[[de,m.value.model_name]])]),m.value.provider!=="ollama"?(v(),w("div",Mh,[l("label",Nh,[y[15]||(y[15]=re(" Clave de API ",-1)),i.value?(v(),w("span",jh,"— dejala vacía para no cambiarla")):W("",!0)]),Q(l("input",{"onUpdate:modelValue":y[3]||(y[3]=j=>m.value.api_key=j),type:"password",autocomplete:"new-password",required:!i.value,placeholder:"sk-...",class:"input font-mono"},null,8,Vh),[[de,m.value.api_key]]),y[16]||(y[16]=l("p",{class:"text-xs text-tenue mt-1"},"Se guarda cifrada y no se vuelve a mostrar.",-1))])):W("",!0),m.value.provider==="ollama"?(v(),w("div",Uh,[y[17]||(y[17]=l("label",{class:"label"},"URL de tu servidor",-1)),Q(l("input",{"onUpdate:modelValue":y[4]||(y[4]=j=>m.value.base_url=j),required:"",placeholder:"https://ollama.tudominio.com/v1",class:"input font-mono"},null,512),[[de,m.value.base_url]])])):W("",!0),l("div",Lh,[l("button",{type:"button",class:"btn-ghost",onClick:y[5]||(y[5]=j=>r.value=!1)},"Cancelar"),l("button",{type:"submit",class:"btn-primary",disabled:a.value},I(a.value?"Guardando…":"Guardar"),9,Fh)])],32)])])):W("",!0)])}}},Hh=yc({history:Zu(Je.baseRuta),routes:[{path:"/",name:"home",component:pd},{path:"/tenants/:id",name:"tenant-agentes",component:df,props:!0},{path:"/tenants/:id/uso",name:"uso",component:mh,props:!0},{path:"/tenants/:id/ia",name:"ai-propia",component:qh,props:!0},{path:"/tenants/:tenantId/agentes/:agenteId",name:"agente-detail",component:Vm,props:!0}]});du(Qc).use(Hh).mount("#app");
|