La pantalla estaba organizada por tabla de base de datos: siete pestañas que eran nuestras siete entidades —documentos, herramientas, canales, conexiones, eventos— y que se desbordaban a lo ancho. Un dueño de negocio nunca piensa "voy a Conexiones": piensa "¿por qué contestó mal?" o "quiero que sepa mis precios nuevos". Tres cambios. Un estado arriba que responde "¿está bien mi asistente?" sin un clic: "Atendiendo en WhatsApp · Sabe de 2 cosas · 1 conversación", y en ámbar cuando algo falta — "No está atendiendo en ningún lado", "Todavía no sabe nada de tu negocio". Antes eso había que deducirlo entrando pestaña por pestaña. Cada señal es un botón que lleva a donde se arregla, y si el destino está en Avanzado, lo despliega. Tres zonas en lugar de siete pestañas: Conversaciones, Lo que sabe, Dónde atiende. Herramientas, Cuentas conectadas y Problemas pasan a "Avanzado", plegado. No se sacan —hacen falta— pero dejan de competir todos los días con lo que se mira todos los días. Y el conocimiento con la prueba lado a lado. El bucle real es leer lo que sabe → probar → corregir → probar de nuevo; en dos pestañas separadas eso eran seis clics por corrección. Desde 1024px van en dos columnas, con el chat fijo al hacer scroll; abajo de eso se apilan, que es el orden en que igual se trabaja. El vocabulario deja de ser el nuestro: "Base de conocimiento" es "Lo que sabe", "Auditoría" es "Problemas", "Conexiones" es "Cuentas conectadas". Y la site_key sale del encabezado: se usa una vez, al instalar el widget, y vive donde se instala. No se tocó ni el color ni la tipografía ni Umi. Esto es estructura, no pintura: cambiando las dos cosas a la vez no se sabría cuál mejoró qué. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
27 lines
172 KiB
JavaScript
27 lines
172 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 be={},en=[],bt=()=>{},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,pe=(e,t)=>zi.call(e,t),Y=Array.isArray,tn=e=>Nn(e)==="[object Map]",pn=e=>Nn(e)==="[object Set]",_o=e=>Nn(e)==="[object Date]",oe=e=>typeof e=="function",Ae=e=>typeof e=="string",rt=e=>typeof e=="symbol",he=e=>e!==null&&typeof e=="object",yr=e=>(he(e)||oe(e))&&oe(e.then)&&oe(e.catch),_r=Object.prototype.toString,Nn=e=>_r.call(e),Ji=e=>Nn(e).slice(8,-1),wr=e=>Nn(e)==="[object Object]",Zs=e=>Ae(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)}`:""),gt=(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=Ae(s)?tl(s):Jt(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(Ae(e)||he(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 xe(e){let t="";if(Ae(e))t=e;else if(Y(e))for(let n=0;n<e.length;n++){const s=xe(e[n]);s&&(t+=s+" ")}else if(he(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=rt(e),s=rt(t),n||s)return e===t;if(n=Y(e),s=Y(t),n||s)return n&&s?ol(e,t):!1;if(n=he(e),s=he(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 l=e.hasOwnProperty(i),u=t.hasOwnProperty(i);if(l&&!u||!l&&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 Ar=e=>!!(e&&e.__v_isRef===!0),I=e=>Ae(e)?e:e==null?"":Y(e)||he(e)&&(e.toString===_r||!oe(e.toString))?Ar(e)?I(e.value):JSON.stringify(e,$r,2):String(e),$r=(e,t)=>Ar(t)?$r(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))}:rt(t)?ws(t):he(t)&&!Y(t)&&!wr(t)?String(t):t,ws=(e,t="")=>{var n;return rt(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 Oe;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&&Oe&&(Oe.active?(this.parent=Oe,this.index=(Oe.scopes||(Oe.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=Oe;try{return Oe=this,t()}finally{Oe=n}}}on(){++this._on===1&&(this.prevScope=Oe,Oe=this)}off(){if(this._on>0&&--this._on===0){if(Oe===this)Oe=this.prevScope;else{let t=Oe;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 Oe}let ye;const ks=new WeakSet;class Er{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,Oe&&(Oe.active?Oe.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=ye,n=st;ye=this,st=!0;try{return this.fn()}finally{Pr(this),ye=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 Sr=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(){Sr++}function to(){if(--Sr>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===Sn)||(e.globalVersion=Sn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ns(e))))return;e.flags|=2;const t=e.dep,n=ye,s=st;ye=e,st=!0;try{Rr(e);const o=e.fn(e._value);(t.version===0||gt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ye=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 Tt(){Or.push(st),st=!1}function Ot(){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=ye;ye=void 0;try{t()}finally{ye=n}}}let Sn=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(!ye||!st||ye===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ye)n=this.activeLink=new al(ye,this),ye.deps?(n.prevDep=ye.depsTail,ye.depsTail.nextDep=n,ye.depsTail=n):ye.deps=ye.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=ye.depsTail,n.nextDep=void 0,ye.depsTail.nextDep=n,ye.depsTail=n,ye.deps===n&&(ye.deps=s)}return n}trigger(t){this.version++,Sn++,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 Vs=new WeakMap,Wt=Symbol(""),js=Symbol(""),In=Symbol("");function Ue(e,t,n){if(st&&ye){let s=Vs.get(e);s||Vs.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 $t(e,t,n,s,o,r){const i=Vs.get(e);if(!i){Sn++;return}const l=u=>{u&&u.trigger()};if(eo(),t==="clear")i.forEach(l);else{const u=Y(e),f=u&&Zs(n);if(u&&n==="length"){const d=Number(s);i.forEach((p,h)=>{(h==="length"||h===In||!rt(h)&&h>=d)&&l(p)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),f&&l(i.get(In)),t){case"add":u?f&&l(i.get("length")):(l(i.get(Wt)),tn(e)&&l(i.get(js)));break;case"delete":u||(l(i.get(Wt)),tn(e)&&l(i.get(js)));break;case"set":tn(e)&&l(i.get(Wt));break}}to()}function Yt(e){const t=fe(e);return t===e?t:(Ue(t,"iterate",In),tt(e)?t:t.map(it))}function cs(e){return Ue(e=fe(e),"iterate",In),e}function ht(e,t){return Dt(e)?ln(zt(e)?it(t):t):it(t)}const ul={__proto__:null,[Symbol.iterator](){return Cs(this,Symbol.iterator,e=>ht(this,e))},concat(...e){return Yt(this).concat(...e.map(t=>Y(t)?Yt(t):t))},entries(){return Cs(this,"entries",e=>(e[1]=ht(this,e[1]),e))},every(e,t){return wt(this,"every",e,t,void 0,arguments)},filter(e,t){return wt(this,"filter",e,t,n=>n.map(s=>ht(this,s)),arguments)},find(e,t){return wt(this,"find",e,t,n=>ht(this,n),arguments)},findIndex(e,t){return wt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return wt(this,"findLast",e,t,n=>ht(this,n),arguments)},findLastIndex(e,t){return wt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return wt(this,"forEach",e,t,void 0,arguments)},includes(...e){return As(this,"includes",e)},indexOf(...e){return As(this,"indexOf",e)},join(e){return Yt(this).join(e)},lastIndexOf(...e){return As(this,"lastIndexOf",e)},map(e,t){return wt(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 wt(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=>ht(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 wt(e,t,n,s,o,r){const i=cs(e),l=i!==e&&!tt(e),u=i[t];if(u!==cl[t]){const p=u.apply(e,r);return l?it(p):p}let f=n;i!==e&&(l?f=function(p,h){return n.call(this,ht(e,p),h,e)}:n.length>2&&(f=function(p,h){return n.call(this,p,h,e)}));const d=u.call(i,f,s);return l&&o?o(d):d}function Co(e,t,n,s){const o=cs(e),r=o!==e&&!tt(e);let i=n,l=!1;o!==e&&(r?(l=s.length===0,i=function(f,d,p){return l&&(l=!1,f=ht(e,f)),n.call(this,f,ht(e,d),p,e)}):n.length>3&&(i=function(f,d,p){return n.call(this,f,d,p,e)}));const u=o[t](i,...s);return l?ht(e,u):u}function As(e,t,n){const s=fe(e);Ue(s,"iterate",In);const o=s[t](...n);return(o===-1||o===!1)&&io(n[0])?(n[0]=fe(n[0]),s[t](...n)):o}function vn(e,t,n=[]){Tt(),eo();const s=fe(e)[t].apply(e,n);return to(),Ot(),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(rt));function fl(e){rt(e)||(e=String(e));const t=fe(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:jr).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 l=Reflect.get(t,n,Fe(t)?t:s);if((rt(n)?Mr.has(n):dl(n))||(o||Ue(t,"get",n),r))return l;if(Fe(l)){const u=i&&Zs(n)?l:l.value;return o&&he(u)?Ls(u):u}return he(l)?o?Ls(l):ds(l):l}}class Vr 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=Dt(r);if(!tt(s)&&!Dt(s)&&(r=fe(r),s=fe(s)),!i&&Fe(r)&&!Fe(s))return f||(r.value=s),!0}const l=i?Number(n)<t.length:pe(t,n),u=Reflect.set(t,n,s,Fe(t)?t:o);return t===fe(o)&&u&&(l?gt(s,r)&&$t(t,"set",n,s):$t(t,"add",n,s)),u}deleteProperty(t,n){const s=pe(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&$t(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!rt(n)||!Mr.has(n))&&Ue(t,"has",n),s}ownKeys(t){return Ue(t,"iterate",Y(t)?"length":Wt),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 Vr,hl=new pl,vl=new Vr(!0);const Us=e=>e,Un=e=>Reflect.getPrototypeOf(e);function gl(e,t,n){return function(...s){const o=this.__v_raw,r=fe(o),i=tn(r),l=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,f=o[e](...s),d=n?Us:t?ln:it;return!t&&Ue(r,"iterate",u?js:Wt),Ne(Object.create(f),{next(){const{value:p,done:h}=f.next();return h?{value:p,done:h}:{value:l?[d(p[0]),d(p[1])]:d(p),done:h}}})}}function Ln(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=fe(r),l=fe(o);e||(gt(o,l)&&Ue(i,"get",o),Ue(i,"get",l));const{has:u}=Un(i),f=t?Us:e?ln:it;if(u.call(i,o))return f(r.get(o));if(u.call(i,l))return f(r.get(l));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&Ue(fe(o),"iterate",Wt),o.size},has(o){const r=this.__v_raw,i=fe(r),l=fe(o);return e||(gt(o,l)&&Ue(i,"has",o),Ue(i,"has",l)),o===l?r.has(o):r.has(o)||r.has(l)},forEach(o,r){const i=this,l=i.__v_raw,u=fe(l),f=t?Us:e?ln:it;return!e&&Ue(u,"iterate",Wt),l.forEach((d,p)=>o.call(r,f(d),f(p),i))}};return Ne(n,e?{add:Ln("add"),set:Ln("set"),delete:Ln("delete"),clear:Ln("clear")}:{add(o){const r=fe(this),i=Un(r),l=fe(o),u=!t&&!tt(o)&&!Dt(o)?l:o;return i.has.call(r,u)||gt(o,u)&&i.has.call(r,o)||gt(l,u)&&i.has.call(r,l)||(r.add(u),$t(r,"add",u,u)),this},set(o,r){!t&&!tt(r)&&!Dt(r)&&(r=fe(r));const i=fe(this),{has:l,get:u}=Un(i);let f=l.call(i,o);f||(o=fe(o),f=l.call(i,o));const d=u.call(i,o);return i.set(o,r),f?gt(r,d)&&$t(i,"set",o,r):$t(i,"add",o,r),this},delete(o){const r=fe(this),{has:i,get:l}=Un(r);let u=i.call(r,o);u||(o=fe(o),u=i.call(r,o)),l&&l.call(r,o);const f=r.delete(o);return u&&$t(r,"delete",o,void 0),f},clear(){const o=fe(this),r=o.size!==0,i=o.clear();return r&&$t(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(pe(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 jr=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 Dt(e)?e:ro(e,!1,ml,xl,jr)}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(!he(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 l=new Proxy(e,i===2?s:n);return o.set(e,l),l}function zt(e){return Dt(e)?zt(e.__v_raw):!!(e&&e.__v_isReactive)}function Dt(e){return!!(e&&e.__v_isReadonly)}function tt(e){return!!(e&&e.__v_isShallow)}function io(e){return e?!!e.__v_raw:!1}function fe(e){const t=e&&e.__v_raw;return t?fe(t):e}function Cl(e){return!pe(e,"__v_skip")&&Object.isExtensible(e)&&kr(e,"__v_skip",!0),e}const it=e=>he(e)?ds(e):e,ln=e=>he(e)?Ls(e):e;function Fe(e){return e?e.__v_isRef===!0:!1}function H(e){return qr(e,!1)}function Al(e){return qr(e,!0)}function qr(e,t){return Fe(e)?e:new $l(e,t)}class $l{constructor(t,n){this.dep=new so,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:fe(t),this._value=n?t:it(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)||Dt(t);t=s?t:fe(t),gt(t,n)&&(this._rawValue=t,this._value=s?t:it(t),this.dep.trigger())}}function Re(e){return Fe(e)?e.value:e}const El={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,El)}class Sl{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=Sn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ye!==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 Sl(s,o,n)}const Fn={},Jn=new WeakMap;let Gt;function Rl(e,t=!1,n=Gt){if(n){let s=Jn.get(n);s||Jn.set(n,s=[]),s.push(e)}}function Pl(e,t,n=be){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:l,call:u}=n,f=y=>o?y:tt(y)||o===!1||o===0?Et(y,1):Et(y);let d,p,h,b,R=!1,k=!1;if(Fe(e)?(p=()=>e.value,R=tt(e)):zt(e)?(p=()=>f(e),R=!0):Y(e)?(k=!0,R=e.some(y=>zt(y)||tt(y)),p=()=>e.map(y=>{if(Fe(y))return y.value;if(zt(y))return f(y);if(oe(y))return u?u(y,2):y()})):oe(e)?t?p=u?()=>u(e,2):e:p=()=>{if(h){Tt();try{h()}finally{Ot()}}const y=Gt;Gt=d;try{return u?u(e,3,[b]):e(b)}finally{Gt=y}}:p=bt,t&&o){const y=p,x=o===!0?1/0:o;p=()=>Et(y(),x)}const P=il(),N=()=>{d.stop(),P&&P.active&&Ys(P.effects,d)};if(r&&t){const y=t;t=(...x)=>{const O=y(...x);return N(),O}}let A=k?new Array(e.length).fill(Fn):Fn;const w=y=>{if(!(!(d.flags&1)||!d.dirty&&!y))if(t){const x=d.run();if(y||o||R||(k?x.some((O,V)=>gt(O,A[V])):gt(x,A))){h&&h();const O=Gt;Gt=d;try{const V=[x,A===Fn?void 0:k&&A[0]===Fn?[]:A,b];A=x,u?u(t,3,V):t(...V)}finally{Gt=O}}}else d.run()};return l&&l(w),d=new Er(p),d.scheduler=i?()=>i(w,!1):w,b=y=>Rl(y,!1,d),h=d.onStop=()=>{const y=Jn.get(d);if(y){if(u)u(y,4);else for(const x of y)x();Jn.delete(d)}},t?s?w(!0):A=d.run():i?i(w.bind(null,!0),!0):d.run(),N.pause=d.pause.bind(d),N.resume=d.resume.bind(d),N.stop=N,N}function Et(e,t=1/0,n){if(t<=0||!he(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Fe(e))Et(e.value,t,n);else if(Y(e))for(let s=0;s<e.length;s++)Et(e[s],t,n);else if(pn(e)||tn(e))e.forEach(s=>{Et(s,t,n)});else if(wr(e)){for(const s in e)Et(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Et(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 lt(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(lt(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||be;if(t){let l=t.parent;const u=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const d=l.ec;if(d){for(let p=0;p<d.length;p++)if(d[p](e,u,f)===!1)return}l=l.parent}if(r){Tt(),Vn(r,null,10,[e,u,f]),Ot();return}}Tl(e,n,o,s,i)}function Tl(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Be=[];let mt=-1;const nn=[];let Ut=null,Zt=0;const Br=Promise.resolve();let Qn=null;function lo(e){const t=Qn||Br;return e?t.then(this?e.bind(this):e):t}function Ol(e){let t=mt+1,n=Be.length;for(;t<n;){const s=t+n>>>1,o=Be[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=Be[Be.length-1];!n||!(e.flags&2)&&t>=Rn(n)?Be.push(e):Be.splice(Ol(t),0,e),e.flags|=1,Gr()}}function Gr(){Qn||(Qn=Br.then(Wr))}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]);Gr()}function Ao(e,t,n=mt+1){for(;n<Be.length;n++){const s=Be[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Be.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Kr(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 Wr(e){try{for(mt=0;mt<Be.length;mt++){const t=Be[mt];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(;mt<Be.length;mt++){const t=Be[mt];t&&(t.flags&=-2)}mt=-1,Be.length=0,Kr(),Qn=null,(Be.length||nn.length)&&Wr()}}let De=null,zr=null;function Yn(e){const t=De;return De=e,zr=e&&e.type.__scopeId||null,t}function nt(e,t=De,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&es(-1);const r=Yn(t),i=Rt.length;let l;try{l=e(...o)}finally{for(let u=Rt.length;u>i;u--)mo();Yn(r),s._d&&es(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function X(e,t){if(De===null)return e;const n=bs(De),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,i,l,u=be]=t[o];r&&(oe(r)&&(r={mounted:r,updated:r}),r.deep&&Et(i),s.push({dir:r,instance:n,value:i,oldValue:void 0,arg:l,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 l=o[i];r&&(l.oldValue=r[i].value);let u=l.dir[s];u&&(Tt(),lt(u,n,8,[e.el,l,e,t]),Ot())}}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 It(e,t,n){return Jr(e,t,n)}function Jr(e,t,n=be){const{immediate:s,deep:o,flush:r,once:i}=n,l=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=bt,b.resume=bt,b.pause=bt,b}}const d=Le;l.call=(b,R,k)=>lt(b,d,R,k);let p=!1;r==="post"?l.scheduler=b=>{We(b,d&&d.suspense)}:r!=="sync"&&(p=!0,l.scheduler=(b,R)=>{R?b():ao(b)}),l.augmentJob=b=>{t&&(b.flags|=4),p&&(b.flags|=2,d&&(b.id=d.uid,b.i=d))};const h=Pl(e,t,l);return Dn&&(f?f.push(h):u&&h()),h}function Vl(e,t,n){const s=this.proxy,o=Ae(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=jn(this),l=Jr(o,r.bind(s),n);return i(),l}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 jl=Symbol("_vte"),ps=e=>e.__isTeleport,$s=Symbol("_leaveCb");function Ul(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==xt){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 $o(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Zn=new WeakMap;function An(e,t,n,s,o=!1){if(Y(e)){e.forEach((k,P)=>An(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&&An(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?bs(s.component):s.el,i=o?null:r,{i:l,r:u}=e,f=t&&t.r,d=l.refs===be?l.refs={}:l.refs,p=l.setupState,h=fe(p),b=p===be?xr:k=>$o(d,k)?!1:pe(h,k),R=(k,P)=>!(P&&$o(d,P));if(f!=null&&f!==u){if(Eo(t),Ae(f))d[f]=null,b(f)&&(p[f]=null);else if(Fe(f)){const k=t;R(f,k.k)&&(f.value=null),k.k&&(d[k.k]=null)}}if(oe(u))Vn(u,l,12,[i,d]);else{const k=Ae(u),P=Fe(u);if(k||P){const N=()=>{if(e.f){const A=k?b(u)?p[u]:d[u]:R()||!e.k?u.value:d[e.k];if(o)Y(A)&&Ys(A,r);else if(Y(A))A.includes(r)||A.push(r);else if(k)d[u]=[r],b(u)&&(p[u]=d[u]);else{const w=[r];R(u,e.k)&&(u.value=w),e.k&&(d[e.k]=w)}}else k?(d[u]=i,b(u)&&(p[u]=i)):P&&(R(u,e.k)&&(u.value=i),e.k&&(d[e.k]=i))};if(i){const A=()=>{N(),Zn.delete(e)};A.id=-1,Zn.set(e,A),We(A,n)}else Eo(e),N()}}}function Eo(e){const t=Zn.get(e);t&&(t.flags|=8,Zn.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)=>{Tt();const l=jn(n),u=lt(t,n,e,i);return l(),Ot(),u});return s?o.unshift(r):o.push(r),r}}const Mt=e=>(t,n=Le)=>{(!Dn||e==="sp")&&ms(e,(...s)=>t(...s),n)},Hl=Mt("bm"),hs=Mt("m"),Bl=Mt("bu"),Gl=Mt("u"),ti=Mt("bum"),ni=Mt("um"),Kl=Mt("sp"),Wl=Mt("rtg"),zl=Mt("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 Ae(e)?ri(si,e,!1)||e:e||oi}function ri(e,t,n=!0,s=!1){const o=De||Le;if(o){const r=o.type;{const l=Da(r,!1);if(l&&(l===t||l===Ge(t)||l===ls(Ge(t))))return r}const i=So(o[e]||r[e],t)||So(o.appContext[e],t);return!i&&s?r:i}}function So(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||Ae(e)){const l=i&&zt(e);let u=!1,f=!1;l&&(u=!tt(e),f=Dt(e),e=cs(e)),o=new Array(e.length);for(let d=0,p=e.length;d<p;d++)o[d]=t(u?f?ln(it(e[d])):it(e[d]):e[d],d,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,r)}else if(he(e))if(e[Symbol.iterator])o=Array.from(e,(l,u)=>t(l,u,void 0,r));else{const l=Object.keys(e);o=new Array(l.length);for(let u=0,f=l.length;u<f;u++){const d=l[u];o[u]=t(e[d],d,u,r)}}else o=[];return o}function Yl(e,t,n,s,o,r){if(n==null&&(n={}),De.ce||De.parent&&sn(De.parent)&&De.parent.ce){const f=n,d=Object.keys(f).length>0;return _(),Ce(re,null,[ne("slot",f,s)],d?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=Rt.length;_();let u;try{const f=i&&ii(i(n)),d=n.key||r||f&&f.key;u=Ce(re,{key:(d&&!rt(d)?d:`_${t}`)+(!f&&s?"_fb":"")},f||(s?s():[]),f&&e._===1?64:-2)}catch(f){for(let d=Rt.length;d>l;d--)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===xt||t.type===re&&!ii(t.children)):!0)?e:null}const Fs=e=>e?Si(e)?bs(e):Fs(e.parent):null,$n=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=>Vl.bind(e)}),Es=(e,t)=>e!==be&&!e.__isScriptSetup&&pe(e,t),Zl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:l,appContext:u}=e;if(t[0]!=="$"){const h=i[t];if(h!==void 0)switch(h){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Es(s,t))return i[t]=1,s[t];if(o!==be&&pe(o,t))return i[t]=2,o[t];if(pe(r,t))return i[t]=3,r[t];if(n!==be&&pe(n,t))return i[t]=4,n[t];qs&&(i[t]=0)}}const f=$n[t];let d,p;if(f)return t==="$attrs"&&Ue(e.attrs,"get",""),f(e);if((d=l.__cssModules)&&(d=d[t]))return d;if(n!==be&&pe(n,t))return i[t]=4,n[t];if(p=u.config.globalProperties,pe(p,t))return p[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Es(o,t)?(o[t]=n,!0):s!==be&&pe(s,t)?(s[t]=n,!0):pe(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}},l){let u;return!!(n[l]||e!==be&&l[0]!=="$"&&pe(e,l)||Es(t,l)||pe(r,l)||pe(s,l)||pe($n,l)||pe(o.config.globalProperties,l)||(u=i.__cssModules)&&u[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:pe(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:l,provide:u,inject:f,created:d,beforeMount:p,mounted:h,beforeUpdate:b,updated:R,activated:k,deactivated:P,beforeDestroy:N,beforeUnmount:A,destroyed:w,unmounted:y,render:x,renderTracked:O,renderTriggered:V,errorCaptured:j,serverPrefetch:_e,expose:Z,inheritAttrs:L,components:Ee,directives:W,filters:Ke}=t;if(f&&ea(f,s,null),i)for(const ce in i){const le=i[ce];oe(le)&&(s[ce]=le.bind(n))}if(o){const ce=o.call(n,n);he(ce)&&(e.data=ds(ce))}if(qs=!0,r)for(const ce in r){const le=r[ce],et=oe(le)?le.bind(n,n):oe(le.get)?le.get.bind(n,n):bt,Je=!oe(le)&&oe(le.set)?le.set.bind(n):bt,Qe=me({get:et,set:Je});Object.defineProperty(s,ce,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:Ve=>Qe.value=Ve})}if(l)for(const ce in l)li(l[ce],s,n,ce);if(u){const ce=oe(u)?u.call(n):u;Reflect.ownKeys(ce).forEach(le=>{Kn(le,ce[le])})}d&&Ro(d,e,"c");function ke(ce,le){Y(le)?le.forEach(et=>ce(et.bind(n))):le&&ce(le.bind(n))}if(ke(Hl,p),ke(hs,h),ke(Bl,b),ke(Gl,R),ke(Ll,k),ke(Fl,P),ke(Jl,j),ke(zl,O),ke(Wl,V),ke(ti,A),ke(ni,y),ke(Kl,_e),Y(Z))if(Z.length){const ce=e.exposed||(e.exposed={});Z.forEach(le=>{Object.defineProperty(ce,le,{get:()=>n[le],set:et=>n[le]=et,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===bt&&(e.render=x),L!=null&&(e.inheritAttrs=L),Ee&&(e.components=Ee),W&&(e.directives=W),_e&&Xr(e)}function ea(e,t,n=bt){Y(e)&&(e=Hs(e));for(const s in e){const o=e[s];let r;he(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){lt(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(Ae(e)){const r=t[e];oe(r)&&It(o,r)}else if(oe(e))It(o,e.bind(n));else if(he(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)&&It(o,r,e)}}function ai(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,l=r.get(t);let u;return l?u=l:!o.length&&!n&&!s?u=t:(u={},o.length&&o.forEach(f=>Xn(u,f,i,!0)),Xn(u,t,i)),he(t)&&r.set(t,u),u}function Xn(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&Xn(e,r,n,!0),o&&o.forEach(i=>Xn(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=ta[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const ta={data:Po,props:To,emits:To,methods:xn,computed:xn,beforeCreate:qe,created:qe,beforeMount:qe,mounted:qe,beforeUpdate:qe,updated:qe,beforeDestroy:qe,beforeUnmount:qe,destroyed:qe,unmounted:qe,activated:qe,deactivated:qe,errorCaptured:qe,serverPrefetch:qe,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 qe(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]=qe(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&&!he(o)&&(o=null);const r=ui(),i=new WeakSet,l=[];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(d){},use(d,...p){return i.has(d)||(d&&oe(d.install)?(i.add(d),d.install(f,...p)):oe(d)&&(i.add(d),d(f,...p))),f},mixin(d){return r.mixins.includes(d)||r.mixins.push(d),f},component(d,p){return p?(r.components[d]=p,f):r.components[d]},directive(d,p){return p?(r.directives[d]=p,f):r.directives[d]},mount(d,p,h){if(!u){const b=f._ceVNode||ne(s,o);return b.appContext=r,h===!0?h="svg":h===!1&&(h=void 0),e(b,d,h),u=!0,f._container=d,d.__vue_app__=f,bs(b.component)}},onUnmount(d){l.push(d)},unmount(){u&&(lt(l,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(d,p){return r.provides[d]=p,f},runWithContext(d){const p=on;on=f;try{return d()}finally{on=p}}};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||be;let o=n;const r=t.startsWith("update:"),i=r&&ia(s,t.slice(7));i&&(i.trim&&(o=n.map(d=>Ae(d)?d.trim():d)),i.number&&(o=n.map(as)));let l,u=s[l=_s(t)]||s[l=_s(Ge(t))];!u&&r&&(u=s[l=_s(Qt(t))]),u&<(u,e,6,o);const f=s[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,lt(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={},l=!1;if(!oe(e)){const u=f=>{const d=ci(f,t,!0);d&&(l=!0,Ne(i,d))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!r&&!l?(he(e)&&s.set(e,null),null):(Y(r)?r.forEach(u=>i[u]=null):Ne(i,r),he(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$/,""),pe(e,t[0].toLowerCase()+t.slice(1))||pe(e,Qt(t))||pe(e,t))}function Oo(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:l,emit:u,render:f,renderCache:d,props:p,data:h,setupState:b,ctx:R,inheritAttrs:k}=e,P=Yn(e);let N,A;try{if(n.shapeFlag&4){const y=o||s,x=y;N=vt(f.call(x,y,d,p,b,h,R)),A=l}else{const y=t;N=vt(y.length>1?y(p,{attrs:l,slots:i,emit:u}):y(p,null)),A=t.props?l:ua(l)}}catch(y){Rt.length=0,fs(y,e,1),N=ne(xt)}let w=N;if(A&&k!==!1){const y=Object.keys(A),{shapeFlag:x}=w;y.length&&x&7&&(r&&y.some(rs)&&(A=ca(A,r)),w=an(w,A,!1,!0))}if(n.dirs&&(w=an(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition){const y=ps(w.type)&&Yr(w)||w;uo(y,n.transition)}return N=w,Yn(P),N}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:l,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 d=t.dynamicProps;for(let p=0;p<d.length;p++){const h=d[p];if(di(i,s,h)&&!vs(f,h))return!0}}}else return(o||l)&&(!l||!l.$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"&&he(s)&&he(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,l=fe(o),[u]=e.propsOptions;let f=!1;if((s||i>0)&&!(i&16)){if(i&8){const d=e.vnode.dynamicProps;for(let p=0;p<d.length;p++){let h=d[p];if(vs(e.emitsOptions,h))continue;const b=t[h];if(u)if(pe(r,h))b!==r[h]&&(r[h]=b,f=!0);else{const R=Ge(h);o[R]=Bs(u,l,R,b,e,!1)}else b!==r[h]&&(r[h]=b,f=!0)}}}else{hi(e,t,o,r)&&(f=!0);let d;for(const p in l)(!t||!pe(t,p)&&((d=Qt(p))===p||!pe(t,d)))&&(u?n&&(n[p]!==void 0||n[d]!==void 0)&&(o[p]=Bs(u,l,p,void 0,e,!0)):delete o[p]);if(r!==l)for(const p in r)(!t||!pe(t,p))&&(delete r[p],f=!0)}f&&$t(e.attrs,"set","")}function hi(e,t,n,s){const[o,r]=e.propsOptions;let i=!1,l;if(t)for(let u in t){if(wn(u))continue;const f=t[u];let d;o&&pe(o,d=Ge(u))?!r||!r.includes(d)?n[d]=f:(l||(l={}))[d]=f:vs(e.emitsOptions,u)||(!(u in s)||f!==s[u])&&(s[u]=f,i=!0)}if(r){const u=fe(n),f=l||be;for(let d=0;d<r.length;d++){const p=r[d];n[p]=Bs(o,u,p,f[p],e,!pe(f,p))}}return i}function Bs(e,t,n,s,o,r){const i=e[n];if(i!=null){const l=pe(i,"default");if(l&&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 d=jn(o);s=f[n]=u.call(null,t),d()}}else s=u;o.ce&&o.ce._setProp(n,s)}i[0]&&(r&&!l?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={},l=[];let u=!1;if(!oe(e)){const d=p=>{u=!0;const[h,b]=vi(p,t,!0);Ne(i,h),b&&l.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!r&&!u)return he(e)&&s.set(e,en),en;if(Y(r))for(let d=0;d<r.length;d++){const p=Ge(r[d]);Mo(p)&&(i[p]=be)}else if(r)for(const d in r){const p=Ge(d);if(Mo(p)){const h=r[d],b=i[p]=Y(h)||oe(h)?{type:h}:Ne({},h),R=b.type;let k=!1,P=!0;if(Y(R))for(let N=0;N<R.length;++N){const A=R[N],w=oe(A)&&A.name;if(w==="Boolean"){k=!0;break}else w==="String"&&(P=!1)}else k=oe(R)&&R.name==="Boolean";b[0]=k,b[1]=P,(k||pe(b,"default"))&&l.push(p)}}const f=[i,l];return he(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(vt):[vt(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=be;if(s.shapeFlag&32){const l=t._;l?n&&l===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 l in o)!fo(l)&&i[l]==null&&delete o[l]},We=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:l,createComment:u,setText:f,setElementText:d,parentNode:p,nextSibling:h,setScopeId:b=bt,insertStaticContent:R}=e,k=(c,m,g,v=null,S=null,$=null,q=void 0,U=null,M=!!m.dynamicChildren)=>{if(c===m)return;c&&!gn(c,m)&&(v=E(c),Ve(c,S,$,!0),c=null),m.patchFlag===-2&&(M=!1,m.dynamicChildren=null);const{type:T,ref:Q,shapeFlag:B}=m;switch(T){case gs:P(c,m,g,v);break;case xt:N(c,m,g,v);break;case Wn:c==null&&A(m,g,v,q);break;case re:Ee(c,m,g,v,S,$,q,U,M);break;default:B&1?x(c,m,g,v,S,$,q,U,M):B&6?W(c,m,g,v,S,$,q,U,M):(B&64||B&128)&&T.process(c,m,g,v,S,$,q,U,M,z)}Q!=null&&S?An(Q,c&&c.ref,$,m||c,!m):Q==null&&c&&c.ref!=null&&An(c.ref,null,$,c,!0)},P=(c,m,g,v)=>{if(c==null)s(m.el=l(m.children),g,v);else{const S=m.el=c.el;m.children!==c.children&&f(S,m.children)}},N=(c,m,g,v)=>{c==null?s(m.el=u(m.children||""),g,v):m.el=c.el},A=(c,m,g,v)=>{[c.el,c.anchor]=R(c.children,m,g,v,c.el,c.anchor)},w=({el:c,anchor:m},g,v)=>{let S;for(;c&&c!==m;)S=h(c),s(c,g,v),c=S;s(m,g,v)},y=({el:c,anchor:m})=>{let g;for(;c&&c!==m;)g=h(c),o(c),c=g;o(m)},x=(c,m,g,v,S,$,q,U,M)=>{if(m.type==="svg"?q="svg":m.type==="math"&&(q="mathml"),c==null)O(m,g,v,S,$,q,U,M);else{const T=c.el&&c.el._isVueCE?c.el:null;try{T&&T._beginPatch(),_e(c,m,S,$,q,U,M)}finally{T&&T._endPatch()}}},O=(c,m,g,v,S,$,q,U)=>{let M,T;const{props:Q,shapeFlag:B,transition:J,dirs:ee}=c;if(M=c.el=i(c.type,$,Q&&Q.is,Q),B&8?d(M,c.children):B&16&&j(c.children,M,null,v,S,Ss(c,$),q,U),ee&&Ht(c,null,v,"created"),V(M,c,c.scopeId,q,v),Q){for(const ge in Q)ge!=="value"&&!wn(ge)&&r(M,ge,null,Q[ge],$,v);"value"in Q&&r(M,"value",null,Q.value,$),(T=Q.onVnodeBeforeMount)&&pt(T,v,c)}ee&&Ht(c,null,v,"beforeMount");const ae=_a(S,J);ae&&J.beforeEnter(M),s(M,m,g),((T=Q&&Q.onVnodeMounted)||ae||ee)&&We(()=>{try{T&&pt(T,v,c),ae&&J.enter(M),ee&&Ht(c,null,v,"mounted")}finally{}},S)},V=(c,m,g,v,S)=>{if(g&&b(c,g),v)for(let $=0;$<v.length;$++)b(c,v[$]);if(S){let $=S.subTree;if(m===$||ki($.type)&&($.ssContent===m||$.ssFallback===m)){const q=S.vnode;V(c,q,q.scopeId,q.slotScopeIds,S.parent)}}},j=(c,m,g,v,S,$,q,U,M=0)=>{for(let T=M;T<c.length;T++){const Q=c[T]=U?At(c[T]):vt(c[T]);k(null,Q,m,g,v,S,$,q,U)}},_e=(c,m,g,v,S,$,q)=>{const U=m.el=c.el;let{patchFlag:M,dynamicChildren:T,dirs:Q}=m;M|=c.patchFlag&16;const B=c.props||be,J=m.props||be;let ee;if(g&&Bt(g,!1),(ee=J.onVnodeBeforeUpdate)&&pt(ee,g,m,c),Q&&Ht(m,c,g,"beforeUpdate"),g&&Bt(g,!0),T&&(!c.dynamicChildren||c.dynamicChildren.length!==T.length)&&(M=0,q=!1,T=null),(B.innerHTML&&J.innerHTML==null||B.textContent&&J.textContent==null)&&d(U,""),T?Z(c.dynamicChildren,T,U,g,v,Ss(m,S),$):q||le(c,m,U,null,g,v,Ss(m,S),$,!1),M>0){if(M&16)L(U,B,J,g,S);else if(M&2&&B.class!==J.class&&r(U,"class",null,J.class,S),M&4&&r(U,"style",B.style,J.style,S),M&8){const ae=m.dynamicProps;for(let ge=0;ge<ae.length;ge++){const ve=ae[ge],Se=B[ve],Te=J[ve];(Te!==Se||ve==="value")&&r(U,ve,Se,Te,S,g)}}M&1&&c.children!==m.children&&d(U,m.children)}else!q&&T==null&&L(U,B,J,g,S);((ee=J.onVnodeUpdated)||Q)&&We(()=>{ee&&pt(ee,g,m,c),Q&&Ht(m,c,g,"updated")},v)},Z=(c,m,g,v,S,$,q)=>{for(let U=0;U<m.length;U++){const M=c[U],T=m[U],Q=M.el&&(M.type===re||!gn(M,T)||M.shapeFlag&198)?p(M.el):g;k(M,T,Q,null,v,S,$,q,!0)}},L=(c,m,g,v,S)=>{if(m!==g){if(m!==be)for(const $ in m)!wn($)&&!($ in g)&&r(c,$,m[$],null,S,v);for(const $ in g){if(wn($))continue;const q=g[$],U=m[$];q!==U&&$!=="value"&&r(c,$,U,q,S,v)}"value"in g&&r(c,"value",m.value,g.value,S)}},Ee=(c,m,g,v,S,$,q,U,M)=>{const T=m.el=c?c.el:l(""),Q=m.anchor=c?c.anchor:l("");let{patchFlag:B,dynamicChildren:J,slotScopeIds:ee}=m;ee&&(U=U?U.concat(ee):ee),c==null?(s(T,g,v),s(Q,g,v),j(m.children||[],g,Q,S,$,q,U,M)):B>0&&B&64&&J&&c.dynamicChildren&&c.dynamicChildren.length===J.length?(Z(c.dynamicChildren,J,g,S,$,q,U),(m.key!=null||S&&m===S.subTree)&&yi(c,m,!0)):le(c,m,g,Q,S,$,q,U,M)},W=(c,m,g,v,S,$,q,U,M)=>{m.slotScopeIds=U,c==null?m.shapeFlag&512?S.ctx.activate(m,g,v,q,M):Ke(m,g,v,S,$,q,M):Vt(c,m,M)},Ke=(c,m,g,v,S,$,q)=>{const U=c.component=Sa(c,v,S);if(co(c)&&(U.ctx.renderer=z),Ra(U,!1,q),U.asyncDep){if(S&&S.registerDep(U,ke,q),!c.el){const M=U.subTree=ne(xt);N(null,M,m,g),c.placeholder=M.el}}else ke(U,c,m,g,S,$,q)},Vt=(c,m,g)=>{const v=m.component=c.component;if(da(c,m,g))if(v.asyncDep&&!v.asyncResolved){ce(v,m,g);return}else v.next=m,v.update();else m.el=c.el,v.vnode=m},ke=(c,m,g,v,S,$,q)=>{const U=()=>{if(c.isMounted){let{next:B,bu:J,u:ee,parent:ae,vnode:ge}=c;{const dt=_i(c);if(dt){B&&(B.el=ge.el,ce(c,B,q)),dt.asyncDep.then(()=>{We(()=>{c.isUnmounted||T()},S)});return}}let ve=B,Se;Bt(c,!1),B?(B.el=ge.el,ce(c,B,q)):B=ge,J&&Gn(J),(Se=B.props&&B.props.onVnodeBeforeUpdate)&&pt(Se,ae,B,ge),Bt(c,!0);const Te=Oo(c),ct=c.subTree;c.subTree=Te,k(ct,Te,p(ct.el),E(ct),c,S,$),B.el=Te.el,ve===null&&fa(c,Te.el),ee&&We(ee,S),(Se=B.props&&B.props.onVnodeUpdated)&&We(()=>pt(Se,ae,B,ge),S)}else{let B;const{el:J,props:ee}=m,{bm:ae,m:ge,parent:ve,root:Se,type:Te}=c,ct=sn(m);Bt(c,!1),ae&&Gn(ae),!ct&&(B=ee&&ee.onVnodeBeforeMount)&&pt(B,ve,m),Bt(c,!0);{Se.ce&&Se.ce._hasShadowRoot()&&Se.ce._injectChildStyle(Te,c.parent?c.parent.type:void 0);const dt=c.subTree=Oo(c);k(null,dt,g,v,c,S,$),m.el=dt.el}if(ge&&We(ge,S),!ct&&(B=ee&&ee.onVnodeMounted)){const dt=m;We(()=>pt(B,ve,dt),S)}(m.shapeFlag&256||ve&&sn(ve.vnode)&&ve.vnode.shapeFlag&256)&&c.a&&We(c.a,S),c.isMounted=!0,m=g=v=null}};c.scope.on();const M=c.effect=new Er(U);c.scope.off();const T=c.update=M.run.bind(M),Q=c.job=M.runIfDirty.bind(M);Q.i=c,Q.id=c.uid,M.scheduler=()=>ao(Q),Bt(c,!0),T()},ce=(c,m,g)=>{m.component=c;const v=c.vnode.props;c.vnode=m,c.next=null,ma(c,m.props,v,g),ba(c,m.children,g),Tt(),Ao(c),Ot()},le=(c,m,g,v,S,$,q,U,M=!1)=>{const T=c&&c.children,Q=c?c.shapeFlag:0,B=m.children,{patchFlag:J,shapeFlag:ee}=m;if(J>0){if(J&128){Je(T,B,g,v,S,$,q,U,M);return}else if(J&256){et(T,B,g,v,S,$,q,U,M);return}}ee&8?(Q&16&&je(T,S,$),B!==T&&d(g,B)):Q&16?ee&16?Je(T,B,g,v,S,$,q,U,M):je(T,S,$,!0):(Q&8&&d(g,""),ee&16&&j(B,g,v,S,$,q,U,M))},et=(c,m,g,v,S,$,q,U,M)=>{c=c||en,m=m||en;const T=c.length,Q=m.length,B=Math.min(T,Q);let J;for(J=0;J<B;J++){const ee=m[J]=M?At(m[J]):vt(m[J]);k(c[J],ee,g,null,S,$,q,U,M)}T>Q?je(c,S,$,!0,!1,B):j(m,g,v,S,$,q,U,M,B)},Je=(c,m,g,v,S,$,q,U,M)=>{let T=0;const Q=m.length;let B=c.length-1,J=Q-1;for(;T<=B&&T<=J;){const ee=c[T],ae=m[T]=M?At(m[T]):vt(m[T]);if(gn(ee,ae))k(ee,ae,g,null,S,$,q,U,M);else break;T++}for(;T<=B&&T<=J;){const ee=c[B],ae=m[J]=M?At(m[J]):vt(m[J]);if(gn(ee,ae))k(ee,ae,g,null,S,$,q,U,M);else break;B--,J--}if(T>B){if(T<=J){const ee=J+1,ae=ee<Q?m[ee].el:v;for(;T<=J;)k(null,m[T]=M?At(m[T]):vt(m[T]),g,ae,S,$,q,U,M),T++}}else if(T>J)for(;T<=B;)Ve(c[T],S,$,!0),T++;else{const ee=T,ae=T,ge=new Map;for(T=ae;T<=J;T++){const Ye=m[T]=M?At(m[T]):vt(m[T]);Ye.key!=null&&ge.set(Ye.key,T)}let ve,Se=0;const Te=J-ae+1;let ct=!1,dt=0;const hn=new Array(Te);for(T=0;T<Te;T++)hn[T]=0;for(T=ee;T<=B;T++){const Ye=c[T];if(Se>=Te){Ve(Ye,S,$,!0);continue}let ft;if(Ye.key!=null)ft=ge.get(Ye.key);else for(ve=ae;ve<=J;ve++)if(hn[ve-ae]===0&&gn(Ye,m[ve])){ft=ve;break}ft===void 0?Ve(Ye,S,$,!0):(hn[ft-ae]=T+1,ft>=dt?dt=ft:ct=!0,k(Ye,m[ft],g,null,S,$,q,U,M),Se++)}const bo=ct?wa(hn):en;for(ve=bo.length-1,T=Te-1;T>=0;T--){const Ye=ae+T,ft=m[Ye],xo=m[Ye+1],yo=Ye+1<Q?xo.el||wi(xo):v;hn[T]===0?k(null,ft,g,yo,S,$,q,U,M):ct&&(ve<0||T!==bo[ve]?Qe(ft,g,yo,2):ve--)}}},Qe=(c,m,g,v,S=null)=>{const{el:$,type:q,transition:U,children:M,shapeFlag:T}=c;if(T&6){Qe(c.component.subTree,m,g,v);return}if(T&128){c.suspense.move(m,g,v);return}if(T&64){q.move(c,m,g,z);return}if(q===re){s($,m,g);for(let B=0;B<M.length;B++)Qe(M[B],m,g,v);s(c.anchor,m,g);return}if(q===Wn){w(c,m,g);return}if(v!==2&&T&1&&U)if(v===0)U.persisted&&!$[$s]?s($,m,g):(U.beforeEnter($),s($,m,g),We(()=>U.enter($),S));else{const{leave:B,delayLeave:J,afterLeave:ee}=U,ae=()=>{c.ctx.isUnmounted?o($):s($,m,g)},ge=()=>{const ve=$._isLeaving||!!$[$s];$._isLeaving&&$[$s](!0),U.persisted&&!ve?ae():B($,()=>{ae(),ee&&ee()})};J?J($,ae,ge):ge()}else s($,m,g)},Ve=(c,m,g,v=!1,S=!1)=>{const{type:$,props:q,ref:U,children:M,dynamicChildren:T,shapeFlag:Q,patchFlag:B,dirs:J,cacheIndex:ee,memo:ae}=c;if(B===-2&&(S=!1),U!=null&&(Tt(),An(U,null,g,c,!0),Ot()),ee!=null&&(m.renderCache[ee]=void 0),Q&256){m.ctx.deactivate(c);return}const ge=Q&1&&J,ve=!sn(c);let Se;if(ve&&(Se=q&&q.onVnodeBeforeUnmount)&&pt(Se,m,c),Q&6)_t(c.component,g,v);else{if(Q&128){c.suspense.unmount(g,v);return}ge&&Ht(c,null,m,"beforeUnmount"),Q&64?c.type.remove(c,m,g,z,v):T&&!T.hasOnce&&($!==re||B>0&&B&64)?je(T,m,g,!1,!0):($===re&&B&384||!S&&Q&16)&&je(M,m,g),v&&ut(c)}const Te=ae!=null&&ee==null;(ve&&(Se=q&&q.onVnodeUnmounted)||ge||Te)&&We(()=>{Se&&pt(Se,m,c),ge&&Ht(c,null,m,"unmounted"),Te&&(c.el=null)},g)},ut=c=>{const{type:m,el:g,anchor:v,transition:S}=c;if(m===re){yt(g,v);return}if(m===Wn){y(c);return}const $=()=>{o(g),S&&!S.persisted&&S.afterLeave&&S.afterLeave()};if(c.shapeFlag&1&&S&&!S.persisted){const{leave:q,delayLeave:U}=S,M=()=>q(g,$);U?U(c.el,$,M):M()}else $()},yt=(c,m)=>{let g;for(;c!==m;)g=h(c),o(c),c=g;o(m)},_t=(c,m,g)=>{const{bum:v,scope:S,job:$,subTree:q,um:U,m:M,a:T}=c;No(M),No(T),v&&Gn(v),S.stop(),$&&($.flags|=8,Ve(q,c,m,g)),U&&We(U,m),We(()=>{c.isUnmounted=!0},m)},je=(c,m,g,v=!1,S=!1,$=0)=>{for(let q=$;q<c.length;q++)Ve(c[q],m,g,v,S)},E=c=>{if(c.shapeFlag&6)return E(c.component.subTree);if(c.shapeFlag&128)return c.suspense.next();const m=h(c.anchor||c.el),g=m&&m[jl];return g?h(g):m};let G=!1;const F=(c,m,g)=>{let v;c==null?m._vnode&&(Ve(m._vnode,null,null,!0),v=m._vnode.component):k(m._vnode||null,c,m,null,null,null,g),m._vnode=c,G||(G=!0,Ao(v),Kr(),G=!1)},z={p:k,um:Ve,m:Qe,r:ut,mt:Ke,mc:j,pc:le,pbc:Z,n:E,o:e};return{render:F,hydrate:void 0,createApp:ra(F)}}function Ss({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 l=o[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[r]=At(o[r]),l.el=i.el),!n&&l.patchFlag!==-2&&yi(i,l)),l.type===gs&&(l.patchFlag===-1&&(l=o[r]=At(l)),l.el=i.el),l.type===xt&&!l.el&&(l.el=i.el)}}function wa(e){const t=e.slice(),n=[0];let s,o,r,i,l;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;)l=r+i>>1,e[n[l]]<f?r=l+1:i=l;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 re=Symbol.for("v-fgt"),gs=Symbol.for("v-txt"),xt=Symbol.for("v-cmt"),Wn=Symbol.for("v-stc"),Rt=[];let Ze=null;function _(e=!1){Rt.push(Ze=e?null:[])}function mo(){Rt.pop(),Ze=Rt[Rt.length-1]||null}let Pn=1;function es(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 C(e,t,n,s,o,r){return Ci(a(e,t,n,s,o,r,!0))}function Ce(e,t,n,s,o){return Ci(ne(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 Ai=({key:e})=>e??null,zn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ae(e)||Fe(e)||oe(e)?{i:De,r:e,k:t,f:!!n}:e:null);function a(e,t=null,n=null,s=0,o=null,r=e===re?0:1,i=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ai(t),ref:t&&zn(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:De};return l?(ts(u,n),r&128&&e.normalize(u)):n&&(u.shapeFlag|=Ae(n)?8:16),Pn>0&&!i&&Ze&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&Ze.push(u),u}const ne=Ca;function Ca(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===oi)&&(e=xt),Tn(e)){const l=an(e,t,!0);return n&&ts(l,n),Pn>0&&!r&&Ze&&(l.shapeFlag&6?Ze[Ze.indexOf(e)]=l:Ze.push(l)),l.patchFlag=-2,l}if(Ma(e)&&(e=e.__vccOpts),t){t=Aa(t);let{class:l,style:u}=t;l&&!Ae(l)&&(t.class=xe(l)),he(u)&&(io(u)&&!Y(u)&&(u=Ne({},u)),t.style=Jt(u))}const i=Ae(e)?1:ki(e)?128:ps(e)?64:he(e)?4:oe(e)?2:0;return a(e,t,n,s,o,i,r,!0)}function Aa(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:l,transition:u}=e,f=t?Ei(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Ai(f),ref:t&&t.ref?n&&r?Y(r)?r.concat(zn(t)):[r,zn(t)]:zn(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==re?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(d,u.clone(d)),d}function ie(e=" ",t=0){return ne(gs,null,e,t)}function $i(e,t){const n=ne(Wn,null,e);return n.staticCount=t,n}function K(e="",t=!1){return t?(_(),Ce(xt,null,e)):ne(xt,null,e)}function vt(e){return e==null||typeof e=="boolean"?ne(xt):Y(e)?ne(re,null,e.slice()):Tn(e)?At(e):ne(gs,null,String(e))}function At(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:an(e)}function ts(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),ts(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!mi(t)?t._ctx=De:o===3&&De&&(De.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(oe(t)){if(s&65){ts(e,{default:t});return}t={default:t,_ctx:De},n=32}else t=String(t),s&64?(n=16,t=[ie(t)]):n=8;e.children=t,e.shapeFlag|=n}function Ei(...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=xe([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 pt(e,t,n,s=null){lt(e,t,7,[n,s])}const $a=ui();let Ea=0;function Sa(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||$a,r={uid:Ea++,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:be,inheritAttrs:s.inheritAttrs,ctx:be,data:be,props:be,attrs:be,slots:be,refs:be,setupState:be,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||De;let ns,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)}};ns=t("__VUE_INSTANCE_SETTERS__",n=>Le=n),On=t("__VUE_SSR_SETTERS__",n=>Dn=n)}const jn=e=>{const t=Le;return ns(e),e.scope.on(),()=>{e.scope.off(),ns(t)}},Vo=()=>{Le&&Le.scope.off(),ns(null)};function Si(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=Si(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){Tt();const o=e.setupContext=s.length>1?Oa(e):null,r=jn(e),i=Vn(s,e,0,[e.props,o]),l=yr(i);if(Ot(),r(),(l||e.sp)&&!sn(e)&&Xr(e),l){if(i.then(Vo,Vo),t)return i.then(u=>{On(!0);try{jo(e,u,t)}finally{On(!1)}}).catch(u=>{fs(u,e,0)});e.asyncDep=i}else jo(e,i)}else Ii(e)}function jo(e,t,n){oe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:he(t)&&(e.setupState=Hr(t)),Ii(e)}function Ii(e,t,n){const s=e.type;e.render||(e.render=s.render||bt);{const o=jn(e);Tt();try{Xl(e)}finally{Ot(),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 $n)return $n[n](e)},has(t,n){return n in t||n in $n}})):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 me=(e,t)=>Il(e,t,Dn);function Ri(e,t,n){try{es(-1);const s=arguments.length;return s===2?he(t)&&!Y(t)?Tn(t)?ne(e,null,[t]):ne(e,t):ne(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Tn(n)&&(n=[n]),ne(e,t,n))}finally{es(1)}}const Na="3.5.41";/**
|
|
* @vue/runtime-dom v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let Gs;const Uo=typeof window<"u"&&window.trustedTypes;if(Uo)try{Gs=Uo.createPolicy("vue",{createHTML:e=>e})}catch{}const Pi=Gs?e=>Gs.createHTML(e):e=>e,Va="http://www.w3.org/2000/svg",ja="http://www.w3.org/1998/Math/MathML",Ct=typeof document<"u"?document:null,Lo=Ct&&Ct.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"?Ct.createElementNS(Va,e):t==="mathml"?Ct.createElementNS(ja,e):n?Ct.createElement(e,{is:n}):Ct.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>Ct.createTextNode(e),createComment:e=>Ct.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ct.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 l=Lo.content;if(s==="svg"||s==="mathml"){const u=l.firstChild;for(;u.firstChild;)l.appendChild(u.firstChild);l.removeChild(u)}t.insertBefore(l,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 Ga(e,t,n){const s=e.style,o=Ae(n);let r=!1;if(n&&!o){if(t)if(Ae(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&yn(s,l,"")}else for(const i in t)n[i]==null&&yn(s,i,"");for(const i in n){i==="display"&&(r=!0);const l=n[i];l!=null?Wa(e,i,!Ae(t)&&t?t[i]:void 0,l)||yn(s,i,l):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=Ka(e,t);qo.test(n)?e.setProperty(Qt(s),n.replace(qo,""),"important"):e[s]=n}}const Ho=["Webkit","Moz","ms"],Is={};function Ka(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 Wa(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Ae(s)&&n===s}const Bo="http://www.w3.org/1999/xlink";function Go(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?"":rt(n)?String(n):n)}function Ko(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 l=r==="OPTION"?e.getAttribute("value")||"":e.value,u=n==null?e.type==="checkbox"?"on":"":String(n);(l!==u||!("_value"in e))&&(e.value=u),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Cr(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function St(e,t,n,s){e.addEventListener(t,n,s)}function za(e,t,n,s){e.removeEventListener(t,n,s)}const Wo=Symbol("_vei");function Ja(e,t,n,s,o=null){const r=e[Wo]||(e[Wo]={}),i=r[t];if(s&&i)i.value=s;else{const[l,u]=Za(t);if(s){const f=r[t]=tu(s,o);St(e,l,f,u)}else i&&(za(e,l,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(),l=[s];for(let u=0;u<i.length&&!s._stopped;u++){const f=i[u];f&<(f,t,5,l)}}else lt(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"?Ga(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))?(Ko(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Go(e,t,s,i,r,t!=="value")):e._isVueCE&&(ou(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ae(s)))?Ko(e,Ge(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Go(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)&&Ae(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"),qn=Symbol("_initialValue");function Ps(e,t,n){return t&&(e=e.trim()),n&&(e=as(e)),e}const ue={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[qn]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[qn]=e.defaultValue.replace(/\r\n?/g,`
|
|
`))),e[Xe]=qt(o);const r=s||o.props&&o.props.type==="number";St(e,t?"change":"input",i=>{i.target.composing||e[Xe](Ps(e.value,n,r))}),(n||r)&&St(e,"change",()=>{e.value=Ps(e.value,n,r)}),t||(St(e,"compositionstart",ru),St(e,"compositionend",Jo),St(e,"change",Jo))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",r=e[qn];delete e[qn],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 l=(r||e.type==="number")&&!/^0\d/.test(e.value)?as(e.value):e.value,u=t??"";if(l===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)}},Pt={deep:!0,created(e,t,n){e[Xe]=qt(n),St(e,"change",()=>{const s=e._modelValue,o=cn(e),r=e.checked,i=e[Xe];if(Y(s)){const l=Xs(s,o),u=l!==-1;if(r&&!u)i(s.concat(o));else if(!r&&u){const f=[...s];f.splice(l,1),i(f)}}else if(pn(s)){const l=new Set(s);r?l.add(o):l.delete(o),i(l)}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),St(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,St(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],l=cn(i);if(n)if(s){const u=typeof l;u==="string"||u==="number"?i.selected=t.some(f=>String(f)===String(l)):i.selected=Xs(t,l)>-1}else i.selected=t.has(l);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 l=au[t[i]];if(l&&l(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 Ae(e)?document.querySelector(e):e}const mu=["width","height"],Me={__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)=>(_(),C("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"},[(_(!0),C(re,null,we(t[e.nombre]||[],(o,r)=>(_(),Ce(Ql(o[0]),Ei({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 de=Object.assign;function Ts(e,t){const n={};for(const s in t){const o=t[s];n[s]=at(o)?o.map(e):e(o)}return n}const En=()=>{},at=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,Vi=/%7B/g,ku=/%7C/g,ji=/%7D/g,Cu=/%20/g;function ho(e){return e==null?"":encodeURI(""+e).replace(ku,"|").replace(yu,"[").replace(_u,"]")}function Au(e){return ho(e).replace(Vi,"{").replace(ji,"}").replace(Ni,"^")}function Ks(e){return ho(e).replace(Mi,"%2B").replace(Cu,"+").replace(Di,"%23").replace(vu,"%26").replace(wu,"`").replace(Vi,"{").replace(ji,"}").replace(Ni,"^")}function $u(e){return Ks(e).replace(bu,"%3D")}function Eu(e){return ho(e).replace(Di,"%23").replace(xu,"%3F")}function Su(e){return Eu(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 l=t.indexOf("#");let u=t.indexOf("?");return u=l>=0&&u>l?-1:u,u>=0&&(s=t.slice(0,u),r=t.slice(u,l>0?l:t.length),o=e(r.slice(1))),l>=0&&(s=s||t.slice(0,l),i=t.slice(l,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 at(e)?tr(e,t):at(t)?tr(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function tr(e,t){return at(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,l;for(i=0;i<s.length;i++)if(l=s[i],l!==".")if(l==="..")r>1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i).join("/")}const jt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ws=(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 Vu(e,t){return e.replace(Nu,"#")+t}function ju(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=ju(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 $e=(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("");$e.MATCHER_NOT_FOUND+"",$e.NAVIGATION_GUARD_REDIRECT+"",$e.NAVIGATION_ABORTED+"",$e.NAVIGATION_CANCELLED+"",$e.NAVIGATION_DUPLICATED+"";function fn(e,t){return de(new Error,{type:e,[Fi]:!0},t)}function kt(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 Gu(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)),l=r<0?null:Mn(o.slice(r+1));if(i in t){let u=t[i];at(u)||(u=t[i]=[u]),u.push(l)}else t[i]=l}return t}function sr(e){let t="";for(let n in e){const s=e[n];if(n=$u(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(at(s)?s.map(o=>o&&Ks(o)):[s&&Ks(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function Ku(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=at(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const Wu=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((l,u)=>{const f=h=>{h===!1?u(fn($e.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?u(h):qu(h)?u(fn($e.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(i&&s.enterCallbacks[o]===i&&typeof h=="function"&&i.push(h),l())},d=r(()=>e.call(s&&s.instances[o],t,n,f));let p=Promise.resolve(d);e.length<3&&(p=p.then(f)),p.catch(h=>u(h))})}function Ms(e,t,n,s,o=r=>r()){const r=[];for(const i of e)for(const l in i.components){let u=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(Oi(u)){const f=(u.__vccOpts||u)[t];f&&r.push(Lt(f,n,s,i,l,o))}else{let f=u();r.push(()=>f.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const p=hu(d)?d.default:d;i.mods[l]=d,i.components[l]=p;const h=(p.__vccOpts||p)[t];return h&&Lt(h,n,s,i,l,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 l=t.matched[i];l&&(e.matched.find(f=>dn(f,l))?s.push(l):n.push(l));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,l=o.slice(i);return l[0]!=="/"&&(l="/"+l),er(l,"")}return er(n,e)+s+o}function Qu(e,t,n,s){let o=[],r=[],i=null;const l=({state:h})=>{const b=qi(e,location),R=n.value,k=t.value;let P=0;if(h){if(n.value=b,t.value=h,i&&i===R){i=null;return}P=k?h.position-k.position:0}else s(b);o.forEach(N=>{N(n.value,R,{delta:P,type:Ws.pop,direction:P?P>0?Ds.forward:Ds.back:Ds.unknown})})};function u(){i=n.value}function f(h){o.push(h);const b=()=>{const R=o.indexOf(h);R>-1&&o.splice(R,1)};return r.push(b),b}function d(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(de({},h.state,{scroll:xs()}),"")}}function p(){for(const h of r)h();r=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:u,listen:f,destroy:p}}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,d){const p=e.indexOf("#"),h=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+u:Ju()+e+u;try{t[d?"replaceState":"pushState"](f,"",h),o.value=f}catch(b){console.error(b),n[d?"replace":"assign"](h)}}function i(u,f){r(u,de({},t.state,rr(o.value.back,u,o.value.forward,!0),f,{position:o.value.position}),!0),s.value=u}function l(u,f){const d=de({},o.value,t.state,{forward:u,scroll:xs()});r(d.current,d,!0),r(u,de({},rr(s.value,u,null),{position:d.position+1},f),!1),s.value=u}return{location:s,state:o,push:l,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=de({location:"",base:e,go:s,createHref:Vu.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 Kt=(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:Kt.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 l=0,u,f="",d="";function p(){f&&(n===Ie.Static?r.push({type:Kt.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:Kt.Param,value:f,regexp:d,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),f="")}function h(){f+=u}for(;l<e.length;){if(u=e[l++],u==="\\"&&n!==Ie.ParamRegExp){s=n,n=Ie.EscapeNext;continue}switch(n){case Ie.Static:u==="/"?(f&&p(),i()):u===":"?(p(),n=Ie.Param):h();break;case Ie.EscapeNext:h(),n=s;break;case Ie.Param:u==="("?n=Ie.ParamRegExp:ec.test(u)?h():(p(),n=Ie.Static,u!=="*"&&u!=="?"&&u!=="+"&&l--);break;case Ie.ParamRegExp:u===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+u:n=Ie.ParamRegExpEnd:d+=u;break;case Ie.ParamRegExpEnd:p(),n=Ie.Static,u!=="*"&&u!=="?"&&u!=="+"&&l--,d="";break;default:t("Unknown state");break}}return n===Ie.ParamRegExp&&t(`Unfinished custom RegExp for param "${f}"`),p(),i(),o}const ir="[^/]+?",nc={sensitive:!1,strict:!1,start:!0,end:!0};var He=(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})(He||{});const sc=/[.+*?^${}()[\]/\\]/g;function oc(e,t){const n=de({},nc,t),s=[];let o=n.start?"^":"";const r=[];for(const f of e){const d=f.length?[]:[He.Root];n.strict&&!f.length&&(o+="/");for(let p=0;p<f.length;p++){const h=f[p];let b=He.Segment+(n.sensitive?He.BonusCaseSensitive:0);if(h.type===Kt.Static)p||(o+="/"),o+=h.value.replace(sc,"\\$&"),b+=He.Static;else if(h.type===Kt.Param){const{value:R,repeatable:k,optional:P,regexp:N}=h;r.push({name:R,repeatable:k,optional:P});const A=N||ir;if(A!==ir){b+=He.BonusCustomRegExp;try{`${A}`}catch(y){throw new Error(`Invalid custom RegExp for param "${R}" (${A}): `+y.message)}}let w=k?`((?:${A})(?:/(?:${A}))*)`:`(${A})`;p||(w=P&&f.length<2?`(?:/${w})`:"/"+w),P&&(w+="?"),o+=w,b+=He.Dynamic,P&&(b+=He.BonusOptional),k&&(b+=He.BonusRepeatable),A===".*"&&(b+=He.BonusWildcard)}d.push(b)}s.push(d)}if(n.strict&&n.end){const f=s.length-1;s[f][s[f].length-1]+=He.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function l(f){const d=f.match(i),p={};if(!d)return null;for(let h=1;h<d.length;h++){const b=d[h]||"",R=r[h-1];p[R.name]=b&&R.repeatable?b.split("/"):b}return p}function u(f){let d="",p=!1;for(const h of e){(!p||!d.endsWith("/"))&&(d+="/"),p=!1;for(const b of h)if(b.type===Kt.Static)d+=b.value;else if(b.type===Kt.Param){const{value:R,repeatable:k,optional:P}=b,N=R in f?f[R]:"";if(at(N)&&!k)throw new Error(`Provided param "${R}" is an array but it is not repeatable (* or + modifiers)`);const A=at(N)?N.join("/"):N;if(!A)if(P)h.length<2&&(d.endsWith("/")?d=d.slice(0,-1):p=!0);else throw new Error(`Missing required param "${R}"`);d+=A}}return d||"/"}return{re:i,score:s,keys:r,parse:l,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]===He.Static+He.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===He.Static+He.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=de(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(p){return s.get(p)}function r(p,h,b){const R=!b,k=ur(p);k.aliasOf=b&&b.record;const P=Xo(t,p),N=[k];if("alias"in p){const y=typeof p.alias=="string"?[p.alias]:p.alias;for(const x of y)N.push(ur(de({},k,{components:b?b.record.components:k.components,path:x,aliasOf:b?b.record:k})))}let A,w;for(const y of N){const{path:x}=y;if(h&&x[0]!=="/"){const O=h.record.path,V=O[O.length-1]==="/"?"":"/";y.path=h.record.path+(x&&V+x)}if(A=lc(y,h,P),b?b.alias.push(A):(w=w||A,w!==A&&w.alias.push(A),R&&p.name&&!cr(A)&&i(p.name)),Bi(A)&&u(A),k.children){const O=k.children;for(let V=0;V<O.length;V++)r(O[V],A,b&&b.children[V])}b=b||A}return w?()=>{i(w)}:En}function i(p){if(Li(p)){const h=s.get(p);h&&(s.delete(p),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(p);h>-1&&(n.splice(h,1),p.record.name&&s.delete(p.record.name),p.children.forEach(i),p.alias.forEach(i))}}function l(){return n}function u(p){const h=dc(p,n);n.splice(h,0,p),p.record.name&&!cr(p)&&s.set(p.record.name,p)}function f(p,h){let b,R={},k,P;if("name"in p&&p.name){if(b=s.get(p.name),!b)throw fn($e.MATCHER_NOT_FOUND,{location:p});P=b.record.name,R=de(ar(h.params,b.keys.filter(w=>!w.optional).concat(b.parent?b.parent.keys.filter(w=>w.optional):[]).map(w=>w.name)),p.params&&ar(p.params,b.keys.map(w=>w.name))),k=b.stringify(R)}else if(p.path!=null)k=p.path,b=n.find(w=>w.re.test(k)),b&&(R=b.parse(k),P=b.record.name);else{if(b=h.name?s.get(h.name):n.find(w=>w.re.test(h.path)),!b)throw fn($e.MATCHER_NOT_FOUND,{location:p,currentLocation:h});P=b.record.name,R=de({},h.params,p.params),k=b.stringify(R)}const N=[];let A=b;for(;A;)N.unshift(A.record),A=A.parent;return{name:P,path:k,params:R,matched:N,meta:cc(N)}}e.forEach(p=>r(p));function d(){n.length=0,s.clear()}return{addRoute:r,resolve:f,removeRoute:i,clearRoutes:d,getRoutes:l,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)=>de(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=me(()=>{const u=Re(e.to);return t.resolve(u)}),o=me(()=>{const{matched:u}=s.value,{length:f}=u,d=u[f-1],p=n.matched;if(!d||!p.length)return-1;const h=p.findIndex(dn.bind(null,d));if(h>-1)return h;const b=fr(u[f-2]);return f>1&&fr(d)===b&&p[p.length-1].path!==b?p.findIndex(dn.bind(null,u[f-2])):h}),r=me(()=>o.value>-1&&gc(n.params,s.value.params)),i=me(()=>o.value>-1&&o.value===n.matched.length-1&&Ui(n.params,s.value.params));function l(u={}){if(vc(u)){const f=t[Re(e.replace)?"replace":"push"](Re(e.to)).catch(En);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:s,href:me(()=>s.value.href),isActive:r,isExactActive:i,navigate:l}}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=me(()=>({[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(!at(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=me(()=>e.route||s.value),r=ot(or,0),i=me(()=>{let f=Re(r);const{matched:d}=o.value;let p;for(;(p=d[f])&&!p.components;)f++;return f}),l=me(()=>o.value.matched[i.value]);Kn(or,me(()=>i.value+1)),Kn(Wu,l),Kn(Js,o);const u=H();return It(()=>[u.value,l.value,e.name],([f,d,p],[h,b,R])=>{d&&(d.instances[p]=f,b&&b!==d&&f&&f===h&&(d.leaveGuards.size||(d.leaveGuards=b.leaveGuards),d.updateGuards.size||(d.updateGuards=b.updateGuards))),f&&d&&(!b||!dn(d,b)||!h)&&(d.enterCallbacks[p]||[]).forEach(k=>k(f))},{flush:"post"}),()=>{const f=o.value,d=e.name,p=l.value,h=p&&p.components[d];if(!h)return mr(n.default,{Component:h,route:f});const b=p.props[d],R=b?b===!0?f.params:typeof b=="function"?b(f):b:null,P=Ri(h,de({},R,t,{onVnodeUnmounted:N=>{N.component.isUnmounted&&(p.instances[d]=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||Gu,s=e.stringifyQuery||sr,o=e.history,r=bn(),i=bn(),l=bn(),u=Al(jt);let f=jt;Xt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Ts.bind(null,E=>""+E),p=Ts.bind(null,Su),h=Ts.bind(null,Mn);function b(E,G){let F,z;return Li(E)?(F=t.getRecordMatcher(E),z=G):z=E,t.addRoute(z,F)}function R(E){const G=t.getRecordMatcher(E);G&&t.removeRoute(G)}function k(){return t.getRoutes().map(E=>E.record)}function P(E){return!!t.getRecordMatcher(E)}function N(E,G){if(G=de({},G||u.value),typeof E=="string"){const g=Os(n,E,G.path),v=t.resolve({path:g.path},G),S=o.createHref(g.fullPath);return de(g,v,{params:h(v.params),hash:Mn(g.hash),redirectedFrom:void 0,href:S})}let F;if(E.path!=null)F=de({},E,{path:Os(n,E.path,G.path).path});else{const g=de({},E.params);for(const v in g)g[v]==null&&delete g[v];F=de({},E,{params:p(g)}),G.params=p(G.params)}const z=t.resolve(F,G),D=E.hash||"";z.params=d(h(z.params));const c=Pu(s,de({},E,{hash:Au(D),path:z.path})),m=o.createHref(c);return de({fullPath:c,hash:D,query:s===sr?Ku(E.query):E.query||{}},z,{redirectedFrom:void 0,href:m})}function A(E){return typeof E=="string"?Os(n,E,u.value.path):de({},E)}function w(E,G){if(f!==E)return fn($e.NAVIGATION_CANCELLED,{from:G,to:E})}function y(E){return V(E)}function x(E){return y(de(A(E),{replace:!0}))}function O(E,G){const F=E.matched[E.matched.length-1];if(F&&F.redirect){const{redirect:z}=F;let D=typeof z=="function"?z(E,G):z;return typeof D=="string"&&(D=D.includes("?")||D.includes("#")?D=A(D):{path:D},D.params={}),de({query:E.query,hash:E.hash,params:D.path!=null?{}:E.params},D)}}function V(E,G){const F=f=N(E),z=u.value,D=E.state,c=E.force,m=E.replace===!0,g=O(F,z);if(g)return V(de(A(g),{state:typeof g=="object"?de({},D,g.state):D,force:c,replace:m}),G||F);const v=F;v.redirectedFrom=G;let S;return!c&&Tu(s,z,F)&&(S=fn($e.NAVIGATION_DUPLICATED,{to:v,from:z}),Qe(z,z,!0,!1)),(S?Promise.resolve(S):Z(v,z)).catch($=>kt($)?kt($,$e.NAVIGATION_GUARD_REDIRECT)?$:Je($):le($,v,z)).then($=>{if($){if(kt($,$e.NAVIGATION_GUARD_REDIRECT))return V(de({replace:m},A($.to),{state:typeof $.to=="object"?de({},D,$.to.state):D,force:c}),G||v)}else $=Ee(v,z,!0,m,D);return L(v,z,$),$})}function j(E,G){const F=w(E,G);return F?Promise.reject(F):Promise.resolve()}function _e(E){const G=yt.values().next().value;return G&&typeof G.runWithContext=="function"?G.runWithContext(E):E()}function Z(E,G){let F;const[z,D,c]=zu(E,G);F=Ms(z.reverse(),"beforeRouteLeave",E,G);for(const g of z)g.leaveGuards.forEach(v=>{F.push(Lt(v,E,G))});const m=j.bind(null,E,G);return F.push(m),je(F).then(()=>{F=[];for(const g of r.list())F.push(Lt(g,E,G));return F.push(m),je(F)}).then(()=>{F=Ms(D,"beforeRouteUpdate",E,G);for(const g of D)g.updateGuards.forEach(v=>{F.push(Lt(v,E,G))});return F.push(m),je(F)}).then(()=>{F=[];for(const g of c)if(g.beforeEnter)if(at(g.beforeEnter))for(const v of g.beforeEnter)F.push(Lt(v,E,G));else F.push(Lt(g.beforeEnter,E,G));return F.push(m),je(F)}).then(()=>(E.matched.forEach(g=>g.enterCallbacks={}),F=Ms(c,"beforeRouteEnter",E,G,_e),F.push(m),je(F))).then(()=>{F=[];for(const g of i.list())F.push(Lt(g,E,G));return F.push(m),je(F)}).catch(g=>kt(g,$e.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function L(E,G,F){l.list().forEach(z=>_e(()=>z(E,G,F)))}function Ee(E,G,F,z,D){const c=w(E,G);if(c)return c;const m=G===jt,g=Xt?history.state:{};F&&(z||m?o.replace(E.fullPath,de({scroll:m&&g&&g.scroll},D)):o.push(E.fullPath,D)),u.value=E,Qe(E,G,F,m),Je()}let W;function Ke(){W||(W=o.listen((E,G,F)=>{if(!_t.listening)return;const z=N(E),D=O(z,_t.currentRoute.value);if(D){V(de(D,{replace:!0,force:!0}),z).catch(En);return}f=z;const c=u.value;Xt&&Lu(nr(c.fullPath,F.delta),xs()),Z(z,c).catch(m=>kt(m,$e.NAVIGATION_ABORTED|$e.NAVIGATION_CANCELLED)?m:kt(m,$e.NAVIGATION_GUARD_REDIRECT)?(V(de(A(m.to),{force:!0}),z).then(g=>{kt(g,$e.NAVIGATION_ABORTED|$e.NAVIGATION_DUPLICATED)&&!F.delta&&F.type===Ws.pop&&o.go(-1,!1)}).catch(En),Promise.reject()):(F.delta&&o.go(-F.delta,!1),le(m,z,c))).then(m=>{m=m||Ee(z,c,!1),m&&(F.delta&&!kt(m,$e.NAVIGATION_CANCELLED)?o.go(-F.delta,!1):F.type===Ws.pop&&kt(m,$e.NAVIGATION_ABORTED|$e.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),L(z,c,m)}).catch(En)}))}let Vt=bn(),ke=bn(),ce;function le(E,G,F){Je(E);const z=ke.list();return z.length?z.forEach(D=>D(E,G,F)):console.error(E),Promise.reject(E)}function et(){return ce&&u.value!==jt?Promise.resolve():new Promise((E,G)=>{Vt.add([E,G])})}function Je(E){return ce||(ce=!E,Ke(),Vt.list().forEach(([G,F])=>E?F(E):G()),Vt.reset()),E}function Qe(E,G,F,z){const{scrollBehavior:D}=e;if(!Xt||!D)return Promise.resolve();const c=!F&&Fu(nr(E.fullPath,0))||(z||!F)&&history.state&&history.state.scroll||null;return lo().then(()=>D(E,G,c)).then(m=>m&&Uu(m)).catch(m=>le(m,E,G))}const Ve=E=>o.go(E);let ut;const yt=new Set,_t={currentRoute:u,listening:!0,addRoute:b,removeRoute:R,clearRoutes:t.clearRoutes,hasRoute:P,getRoutes:k,resolve:N,options:e,push:y,replace:x,go:Ve,back:()=>Ve(-1),forward:()=>Ve(1),beforeEach:r.add,beforeResolve:i.add,afterEach:l.add,onError:ke.add,isReady:et,install(E){E.component("RouterLink",hc),E.component("RouterView",xc),E.config.globalProperties.$router=_t,Object.defineProperty(E.config.globalProperties,"$route",{enumerable:!0,get:()=>Re(u)}),Xt&&!ut&&u.value===jt&&(ut=!0,y(o.location).catch(z=>{}));const G={};for(const z in jt)Object.defineProperty(G,z,{get:()=>u.value[z],enumerable:!0});E.provide(ys,_t),E.provide(vo,Fr(G)),E.provide(Js,u);const F=E.unmount;yt.add(E),E.unmount=function(){yt.delete(E),yt.size<1&&(f=jt,W&&W(),W=null,u.value=jt,ut=!1,ce=!1),F()}}};function je(E){return E.reduce((G,F)=>G.then(()=>_e(F)),Promise.resolve())}return _t}function go(){return ot(ys)}function Gi(e){return ot(vo)}const Hn=window.location.pathname.startsWith("/portal/"),ze={esPortal:Hn,baseRuta:Hn?"/portal/studio/":"/studio/",apiBase:Hn?"/portal":"/app",urlLogin:Hn?"/portal/login":"/login"};function te(e){return ze.apiBase+e}async function Bn(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=ze.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=>Bn(e),post:(e,t)=>Bn(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Bn(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>Bn(e,{method:"DELETE"})},_n=H(!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"},Ac={key:0,class:"px-2 text-xs text-tenue"},$c={key:1,class:"px-2 text-xs text-tenue"},Ec={class:"truncate"},Sc={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"],Vc={class:"text-[11px] text-tenue mt-1"},jc=["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=Gi(),s=go(),o=H([]),r=H([]),i=H([]),l=H(!0),u=H(""),f=H(!1),d=H(null),p=H(b()),h=me(()=>n.params.tenantId||n.params.id);It(()=>n.fullPath,()=>{_n.value=!1});function b(){return{nombre:"",dominios_permitidos:"",activo:!0,cliente_id:null,plan_id:null}}async function R(){l.value=!0,u.value="";try{const x=await se.get(te("/umind/tenants"));o.value=x.items||[]}catch(x){u.value=x.message}finally{l.value=!1}}function k(x){return Array.isArray(x)?x:(x==null?void 0:x.items)||(x==null?void 0:x.registros)||[]}async function P(){if(ze.esPortal)return;const[x,O]=await Promise.allSettled([se.get("/app/api/clientes/select"),se.get("/app/umind-planes/list")]);r.value=x.status==="fulfilled"?k(x.value):[],i.value=O.status==="fulfilled"?k(O.value):[];const V=[];x.status==="rejected"&&V.push("clientes"),O.status==="rejected"&&V.push("planes"),V.length&&(u.value=`No se pudo cargar la lista de ${V.join(" ni ")}.`)}function N(){d.value=null,p.value=b(),f.value=!0}function A(x){d.value=x,p.value={nombre:x.nombre,dominios_permitidos:x.dominios_permitidos,activo:x.activo,cliente_id:x.cliente_id??null,plan_id:x.plan_id??null},f.value=!0}async function w(){const x={...p.value,dominios_permitidos:p.value.dominios_permitidos.split(",").map(O=>O.trim()).filter(Boolean)};try{if(d.value)await se.put(te(`/umind/tenants/${d.value.ID}`),x),f.value=!1,await R();else{const O=await se.post(te("/umind/tenants"),x);f.value=!1,await R(),s.push(`/tenants/${O.id}`)}}catch(O){u.value=O.message}}async function y(x){confirm(`¿Eliminar el espacio "${x.nombre}"? Esto borra también sus agentes. No se puede deshacer.`)&&(await se.del(te(`/umind/tenants/${x.ID}`)),h.value===String(x.ID)&&s.push("/"),await R())}return t({recargar:R}),hs(()=>{R(),P()}),(x,O)=>{const V=mn("router-link");return _(),C(re,null,[Re(_n)?(_(),C("div",{key:0,class:"fixed inset-0 bg-black/50 z-30 md:hidden",onClick:O[0]||(O[0]=j=>_n.value=!1)})):K("",!0),a("aside",{class:xe(["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"])},[a("div",_c,[ne(V,{to:"/",class:"flex items-center gap-2 text-base font-semibold text-texto"},{default:nt(()=>[...O[8]||(O[8]=[a("svg",{viewBox:"0 0 96 96",class:"w-6 h-6 shrink-0","aria-hidden":"true"},[a("rect",{width:"96",height:"96",rx:"22",fill:"#8eb02f"}),a("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"}),a("path",{d:"M60,58 V64",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round"}),a("circle",{cx:"60",cy:"28",r:"7",fill:"#fff"})],-1),a("span",null,[ie("uMind "),a("span",{class:"text-brand"},"Studio")],-1)])]),_:1})]),Re(ze).esPortal?K("",!0):(_(),C("div",wc,[a("button",{class:"btn-primary w-full",onClick:N}," + Nuevo espacio ")])),u.value?(_(),C("p",kc,I(u.value),1)):K("",!0),a("nav",Cc,[l.value?(_(),C("p",Ac,"Cargando...")):o.value.length===0?(_(),C("p",$c,I(Re(ze).esPortal?"Todavía no tenés ningún espacio asignado. Escribinos y lo activamos.":"Sin espacios todavía."),1)):K("",!0),(_(!0),C(re,null,we(o.value,j=>(_(),C("div",{key:j.ID,class:xe(["group flex items-center rounded-lg transition-colors",h.value===String(j.ID)?"bg-brand/10":"hover:bg-elevado"])},[ne(V,{to:`/tenants/${j.ID}`,class:xe(["flex-1 min-w-0 px-2.5 py-2 text-sm",h.value===String(j.ID)?"text-brand font-medium":"text-texto"])},{default:nt(()=>[a("div",Ec,I(j.nombre),1),a("div",Sc,[a("span",{class:xe(["w-1.5 h-1.5 rounded-full",j.activo?"bg-green-500":"bg-tenue/40"])},null,2),a("span",Ic,I(j.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),Re(ze).esPortal?K("",!0):(_(),C("div",Rc,[a("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:_e=>A(j)},[ne(Me,{nombre:"lapiz",tam:14})],8,Pc),a("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:_e=>y(j)},[ne(Me,{nombre:"cerrar",tam:14})],8,Tc)]))],2))),128))])],2),f.value?(_(),C("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(j=>f.value=!1,["self"]))},[a("div",Oc,[a("h2",Dc,I(d.value?"Editar espacio":"Nuevo espacio"),1),O[17]||(O[17]=a("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)),a("form",{class:"space-y-3",onSubmit:Pe(w,["prevent"])},[a("div",null,[O[9]||(O[9]=a("label",{class:"label"},"Nombre",-1)),X(a("input",{"onUpdate:modelValue":O[1]||(O[1]=j=>p.value.nombre=j),required:"",class:"input"},null,512),[[ue,p.value.nombre]])]),a("div",null,[O[10]||(O[10]=a("label",{class:"label"},"Dominios permitidos (separados por coma)",-1)),X(a("input",{"onUpdate:modelValue":O[2]||(O[2]=j=>p.value.dominios_permitidos=j),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"input"},null,512),[[ue,p.value.dominios_permitidos]])]),Re(ze).esPortal?K("",!0):(_(),C("div",Mc,[a("div",null,[O[12]||(O[12]=a("label",{class:"label"},"Cliente",-1)),X(a("select",{"onUpdate:modelValue":O[3]||(O[3]=j=>p.value.cliente_id=j),class:"input"},[O[11]||(O[11]=a("option",{value:null},"— sin asignar —",-1)),(_(!0),C(re,null,we(r.value,j=>(_(),C("option",{key:j.ID,value:j.ID},I(j.nombre),9,Nc))),128))],512),[[un,p.value.cliente_id]]),a("p",Vc,I(r.value.length?"Define quién ve este espacio desde el portal.":"No hay clientes activos — creá uno en Clientes."),1)]),a("div",null,[O[14]||(O[14]=a("label",{class:"label"},"Plan",-1)),X(a("select",{"onUpdate:modelValue":O[4]||(O[4]=j=>p.value.plan_id=j),class:"input"},[O[13]||(O[13]=a("option",{value:null},"— sin plan —",-1)),(_(!0),C(re,null,we(i.value,j=>(_(),C("option",{key:j.ID,value:j.ID},I(j.nombre)+" ("+I(j.max_agentes===0?"∞":j.max_agentes)+" agentes) ",9,jc))),128))],512),[[un,p.value.plan_id]]),a("p",Uc,I(i.value.length?"Límite de agentes y precios de consumo.":"No hay planes — creá uno en uMind Planes."),1)])])),a("label",Lc,[X(a("input",{"onUpdate:modelValue":O[5]||(O[5]=j=>p.value.activo=j),type:"checkbox"},null,512),[[Pt,p.value.activo]]),O[15]||(O[15]=ie(" Activo ",-1))]),a("div",Fc,[a("button",{type:"button",class:"btn-ghost",onClick:O[6]||(O[6]=j=>f.value=!1)}," Cancelar "),O[16]||(O[16]=a("button",{type:"submit",class:"btn-primary"}," Guardar ",-1))])],32)])])):K("",!0)],64)}}},Ki="umind-tema";function Hc(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"oscuro":"claro"}const rn=H(localStorage.getItem(Ki)||Hc());function Wi(){document.documentElement.classList.toggle("dark",rn.value==="oscuro")}function hr(){rn.value=rn.value==="oscuro"?"claro":"oscuro",localStorage.setItem(Ki,rn.value),Wi()}Wi();const vr="umind_despertar_visto",gr=1250,Bc={__name:"DespertarUmind",setup(e){const t=H(null),n=H(!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 l=i.getContext("2d"),u=Math.min(window.devicePixelRatio||1,2),f=window.innerWidth,d=window.innerHeight;i.width=Math.round(f*u),i.height=Math.round(d*u),l.setTransform(u,0,0,u,0,0);const p=f<640?22:46,h=Array.from({length:p},()=>({x:Math.random()*f,y:Math.random()*d,r:1+Math.random()*1.6,demora:Math.random()*.45})),b=performance.now(),R=k=>{const P=Math.min(1,(k-b)/gr);l.clearRect(0,0,f,d);const N=P<.75?1:1-(P-.75)/.25;for(let A=0;A<h.length;A++){const w=h[A],y=Math.max(0,Math.min(1,(P-w.demora)/.4));if(!(y<=0)){for(let x=A+1;x<h.length;x++){const O=h[x],V=w.x-O.x,j=w.y-O.y,_e=Math.sqrt(V*V+j*j);_e>170||(l.strokeStyle=`rgba(142, 176, 47, ${.16*(1-_e/170)*y*N})`,l.lineWidth=1,l.beginPath(),l.moveTo(w.x,w.y),l.lineTo(O.x,O.y),l.stroke())}l.beginPath(),l.arc(w.x,w.y,w.r*y,0,Math.PI*2),l.fillStyle=`rgba(142, 176, 47, ${.5*y*N})`,l.fill()}}P<1&&(s=requestAnimationFrame(R))};s=requestAnimationFrame(R)}))}),ti(()=>{s&&cancelAnimationFrame(s),o&&clearTimeout(o)}),(i,l)=>n.value?(_(),C("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)):K("",!0)}},Gc={class:"min-h-screen flex"},Kc={class:"flex-1 min-w-0 flex flex-col"},Wc={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 _(),C("div",Gc,[ne(Bc),ne(qc),a("main",Kc,[a("header",Wc,[a("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]=[a("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),n[3]||(n[3]=a("span",{class:"flex-1"},null,-1)),a("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))},[ne(Me,{nombre:Re(rn)==="oscuro"?"sol":"luna",tam:17},null,8,["nombre"])],8,zc)]),a("div",Jc,[ne(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)=>(_(),C("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})`},[a("circle",{cx:"60",cy:"26",r:"6",fill:e.estado==="alerta"?"#dc2626":"currentColor",class:xe(e.estado==="pensando"?"umi-late":"")},null,10,Xc),a("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]=a("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"?(_(),C(re,{key:0},[a("circle",{cx:"47",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,td),a("circle",{cx:"73",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,nd),a("circle",{cx:"48",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,sd),a("circle",{cx:"74",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,od)],64)):e.estado==="durmiendo"?(_(),C("path",rd)):e.estado==="pensando"?(_(),C(re,{key:2},[n[0]||(n[0]=a("circle",{cx:"45",cy:"66",r:"4.5",class:"umi-ojo umi-p1"},null,-1)),n[1]||(n[1]=a("circle",{cx:"60",cy:"66",r:"4.5",class:"umi-ojo umi-p2"},null,-1)),n[2]||(n[2]=a("circle",{cx:"75",cy:"66",r:"4.5",class:"umi-ojo umi-p3"},null,-1))],64)):e.estado==="buscando"?(_(),C(re,{key:3},[n[3]||(n[3]=a("circle",{cx:"47",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[4]||(n[4]=a("circle",{cx:"73",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[5]||(n[5]=a("circle",{cx:"50",cy:"66",r:"3",class:"umi-pupila"},null,-1)),n[6]||(n[6]=a("circle",{cx:"76",cy:"66",r:"3",class:"umi-pupila"},null,-1))],64)):K("",!0),e.estado==="contenta"?(_(),C("path",id)):K("",!0)],8,Zc))}},ss=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=H(ze.esPortal),s=H(!1);async function o(){if(ze.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 l=i[0].ID,f=(await se.get(te(`/umind/agentes?tenant_id=${l}`))).items||[];if(f.length===1){t.replace(`/tenants/${l}/agentes/${f[0].ID}`);return}t.replace(`/tenants/${l}`)}catch{}finally{n.value=!1}}return hs(o),(r,i)=>n.value?(_(),C("div",ad," Abriendo tu asistente… ")):s.value?(_(),C("div",ud,[ne(ss,{estado:"durmiendo",tam:80,class:"mx-auto mb-4 text-brand"}),i[0]||(i[0]=$i('<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))])):(_(),C("div",cd,[ne(ss,{estado:"normal",tam:64,class:"mx-auto mb-4 text-brand"}),a("h1",dd,I(Re(ze).esPortal?"Elegí tu espacio de la izquierda":"Elegí un espacio de la izquierda"),1),a("p",fd,I(Re(ze).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"},Nt={__name:"UiEmptyState",props:{estado:{type:String,default:"durmiendo"},titulo:String,detalle:String,icono:{type:String,default:""}},setup(e){return(t,n)=>(_(),C("div",md,[e.icono?(_(),C("div",hd,I(e.icono),1)):(_(),Ce(ss,{key:1,estado:e.estado,tam:64,class:"mb-3 text-brand"},null,8,["estado"])),a("p",vd,I(e.titulo),1),e.detalle?(_(),C("p",gd,I(e.detalle),1)):K("",!0),t.$slots.default?(_(),C("div",bd,[Yl(t.$slots,"default")])):K("",!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"},Ad={class:"flex items-center gap-2"},$d={key:0,class:"badge-alerta"},Ed={key:1,class:"badge-neutro"},Sd=["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"},Vd={class:"font-medium text-texto truncate"},jd={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"},Gd={class:"text-texto font-medium"},Kd={class:"tabular-nums"},Wd={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=me(()=>Number(t.id)),s=go(),o=H(null),r=H([]),i=H([]),l=H(""),u=H(!1),f=H(null),d=H(A()),p=H(null),h=H({}),b=H(!0);function R(Z){const L=h.value[Z.ID]||{};return Z.activo?L.documentos>0?{tipo:"ok",texto:"listo"}:{tipo:"alerta",texto:"sin conocimiento"}:{tipo:"neutro",texto:"inactivo"}}function k(Z){const L=h.value[Z.ID]||{};return{documentos:L.documentos||0,canales:L.canales||0,conversaciones:L.conversaciones_7d||0}}function P(Z){return String(Z||"?").trim().split(/\s+/).slice(0,2).map(L=>L[0]).join("").toUpperCase()}const N=me(()=>{if(!p.value)return{sinPlan:!0};const Z=p.value.max_agentes||0;return{sinPlan:!1,nombre:p.value.nombre,ilimitado:Z<=0,max:Z,usados:r.value.length,lleno:Z>0&&r.value.length>=Z}});function A(){return{nombre:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",color:"#8eb02f",activo:!0,plantilla_rubro:""}}const w=H([]);async function y(){l.value="",b.value=!0;try{const[Z,L,Ee,W]=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=L.items||[],p.value=L.plan||null,h.value=L.resumen||{},i.value=Ee.items||[],w.value=W.items||[]}catch(Z){l.value=Z.message}finally{b.value=!1}}async function x(Z){const L=prompt(`Nombre de la copia de "${Z.nombre}":`,`${Z.nombre} (copia)`);if(L!==null){l.value="";try{const Ee=await se.post(te(`/umind/agentes/${Z.ID}/duplicar`),{tenant_id:Number(n.value),nombre:L.trim()});await y(),Ee.aviso&&alert(Ee.aviso)}catch(Ee){l.value=Ee.message}}}function O(){f.value=null,d.value=A(),u.value=!0}function V(Z){f.value=Z,d.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 j(){try{if(f.value)await se.put(te(`/umind/agentes/${f.value.ID}`),{tenant_id:n.value,...d.value}),u.value=!1,await y();else{const Z=await se.post(te("/umind/agentes"),{tenant_id:n.value,...d.value});u.value=!1,s.push(`/tenants/${n.value}/agentes/${Z.id}`)}}catch(Z){l.value=Z.message}}async function _e(Z){confirm(`¿Eliminar el agente "${Z.nombre}"? Esto no se puede deshacer.`)&&(await se.del(te(`/umind/agentes/${Z.ID}`)),await y())}return It(()=>t.id,y,{immediate:!0}),(Z,L)=>{const Ee=mn("router-link");return _(),C("div",null,[o.value?(_(),C("div",xd,[a("div",yd,[a("div",null,[a("h1",_d,I(o.value.nombre),1),a("p",wd,I(o.value.dominios_permitidos||"sin dominios configurados"),1)]),ne(Ee,{to:`/tenants/${n.value??e.id}/ia`,class:"btn-ghost"},{default:nt(()=>[...L[10]||(L[10]=[ie("Tu IA",-1)])]),_:1},8,["to"]),ne(Ee,{to:`/tenants/${n.value??e.id}/uso`,class:"btn-ghost inline-flex items-center gap-1.5"},{default:nt(()=>[ne(Me,{nombre:"grafico"}),L[11]||(L[11]=ie(" Consumo",-1))]),_:1},8,["to"])])])):K("",!0),l.value?(_(),C("p",kd,I(l.value),1)):K("",!0),a("div",Cd,[a("div",Ad,[L[12]||(L[12]=a("h2",{class:"text-sm font-medium text-tenue"},"Agentes",-1)),N.value.sinPlan?(_(),C("span",$d,"sin plan · sin límite")):N.value.ilimitado?(_(),C("span",Ed,I(N.value.nombre)+" · ilimitado",1)):(_(),C("span",{key:2,class:xe(N.value.lleno?"badge-alerta":"badge-neutro")},I(N.value.nombre)+" · "+I(N.value.usados)+" de "+I(N.value.max),3))]),a("button",{class:"btn-primary",disabled:N.value.lleno,onClick:O},"+ Nuevo agente",8,Sd)]),N.value.sinPlan&&!Re(ze).esPortal?(_(),C("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. ")):N.value.lleno?(_(),C("p",Rd," Alcanzaste el máximo de agentes de tu plan. ")):K("",!0),b.value?(_(),C("div",Pd,[(_(),C(re,null,we(2,W=>a("div",{key:W,class:"card p-4 animate-pulse"},[...L[13]||(L[13]=[$i('<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?(_(),Ce(Nt,{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(()=>[a("button",{class:"btn-primary",disabled:N.value.lleno,onClick:O},"+ Crear el primer agente",8,Td)]),_:1})):(_(),C("div",Od,[(_(!0),C(re,null,we(r.value,W=>(_(),Ce(Ee,{key:W.ID,to:`/tenants/${n.value}/agentes/${W.ID}`,class:"card p-4 relative group hover:shadow-lg hover:-translate-y-0.5 transition-all overflow-hidden"},{default:nt(()=>[a("span",{class:"absolute inset-x-0 top-0 h-1",style:Jt({background:W.color||"#8eb02f"})},null,4),a("div",Dd,[a("span",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-semibold shrink-0",style:Jt({background:W.color||"#8eb02f",opacity:W.activo?1:.4})},I(P(W.nombre)),5),a("div",Md,[a("div",Nd,[a("span",Vd,I(W.nombre),1),a("span",{class:xe(`badge-${R(W).tipo}`)},I(R(W).texto),3)]),a("p",jd,I(W.tono||"sin tono definido"),1)]),a("div",Ud,[a("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Pe(Ke=>V(W),["prevent","stop"])},[ne(Me,{nombre:"lapiz",tam:14})],8,Ld),a("button",{class:"p-1 text-tenue hover:text-texto",title:"Duplicar: copia el conocimiento y las herramientas a un agente nuevo",onClick:Pe(Ke=>x(W),["prevent","stop"])},[ne(Me,{nombre:"copiar",tam:14})],8,Fd),a("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Pe(Ke=>_e(W),["prevent","stop"])},[ne(Me,{nombre:"cerrar",tam:14})],8,qd)])]),a("div",Hd,[a("span",Bd,[a("b",Gd,I(k(W).conversaciones),1),L[14]||(L[14]=ie(" conversaciones · 7d",-1))]),a("span",Kd,[a("b",Wd,I(k(W).documentos),1),L[15]||(L[15]=ie(" fuentes",-1))]),a("span",zd,[a("b",Jd,I(k(W).canales),1),L[16]||(L[16]=ie(" canales",-1))])])]),_:2},1032,["to"]))),128))])),u.value?(_(),C("div",{key:7,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:L[9]||(L[9]=Pe(W=>u.value=!1,["self"]))},[a("div",Qd,[a("h2",Yd,I(f.value?"Editar agente":"Nuevo agente"),1),a("form",{class:"space-y-3",onSubmit:Pe(j,["prevent"])},[a("div",null,[L[17]||(L[17]=a("label",{class:"label"},"Nombre",-1)),X(a("input",{"onUpdate:modelValue":L[0]||(L[0]=W=>d.value.nombre=W),required:"",placeholder:"ej: Ventas, Soporte",class:"input"},null,512),[[ue,d.value.nombre]])]),!f.value&&w.value.length?(_(),C("div",Zd,[L[18]||(L[18]=a("label",{class:"label"},"Arrancar con",-1)),a("div",Xd,[(_(!0),C(re,null,we([{clave:"",nombre:"Agente en blanco",descripcion:"Sin conocimiento cargado. Lo escribís vos desde cero."},...w.value],W=>(_(),C("label",{key:W.clave,class:xe(["flex gap-2.5 p-2.5 rounded-lg border cursor-pointer transition-colors",d.value.plantilla_rubro===W.clave?"border-brand bg-brand/5":"border-borde hover:border-brand/40"])},[X(a("input",{"onUpdate:modelValue":L[1]||(L[1]=Ke=>d.value.plantilla_rubro=Ke),type:"radio",value:W.clave,class:"mt-1 text-brand focus:ring-brand"},null,8,ef),[[iu,d.value.plantilla_rubro]]),a("span",tf,[a("span",nf,I(W.nombre),1),a("span",sf,I(W.descripcion),1),W.notas?(_(),C("span",of,I(W.notas)+" notas listas para editar · "+I(W.resumen),1)):K("",!0)])],2))),128))]),L[19]||(L[19]=a("p",{class:"text-xs text-tenue mt-1.5"}," Las notas vienen con ejemplos entre corchetes — abrilas y reemplazalas por tus datos reales. ",-1))])):K("",!0),a("div",null,[L[21]||(L[21]=a("label",{class:"label"},"Config de IA",-1)),X(a("select",{"onUpdate:modelValue":L[2]||(L[2]=W=>d.value.ai_config_id=W),class:"input"},[L[20]||(L[20]=a("option",{value:null},"— sin asignar —",-1)),(_(!0),C(re,null,we(i.value,W=>(_(),C("option",{key:W.ID,value:W.ID},I(W.nombre)+" ("+I(W.provider)+")",9,rf))),128))],512),[[un,d.value.ai_config_id]])]),a("div",null,[L[22]||(L[22]=a("label",{class:"label"},"Tono / personalidad",-1)),X(a("textarea",{"onUpdate:modelValue":L[3]||(L[3]=W=>d.value.tono=W),rows:"2",class:"input"},null,512),[[ue,d.value.tono]])]),a("div",null,[L[23]||(L[23]=a("label",{class:"label"},"Mensaje de bienvenida",-1)),X(a("input",{"onUpdate:modelValue":L[4]||(L[4]=W=>d.value.mensaje_bienvenida=W),class:"input"},null,512),[[ue,d.value.mensaje_bienvenida]])]),a("div",null,[L[24]||(L[24]=a("label",{class:"label"},"Color del widget",-1)),a("div",lf,[X(a("input",{"onUpdate:modelValue":L[5]||(L[5]=W=>d.value.color=W),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),[[ue,d.value.color]]),X(a("input",{"onUpdate:modelValue":L[6]||(L[6]=W=>d.value.color=W),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),[[ue,d.value.color]])])]),a("label",af,[X(a("input",{"onUpdate:modelValue":L[7]||(L[7]=W=>d.value.activo=W),type:"checkbox"},null,512),[[Pt,d.value.activo]]),L[25]||(L[25]=ie(" Activo ",-1))]),a("div",uf,[a("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:L[8]||(L[8]=W=>u.value=!1)},"Cancelar"),a("button",cf,I(f.value?"Guardar":"Crear"),1)])],32)])])):K("",!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=me(()=>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)=>(_(),C("div",null,[o[0]||(o[0]=a("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)),a("div",ff,[e.eventos.length===0?(_(),Ce(Nt,{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."})):K("",!0),(_(!0),C(re,null,we(e.eventos,r=>(_(),C("details",{key:r.ID,class:"p-3"},[a("summary",pf,[a("span",{class:xe(["px-1.5 py-0.5 rounded text-xs shrink-0",t.value(r.nivel)])},I(r.nivel),3),a("span",mf,I(r.origen),1),a("span",hf,I(r.mensaje),1),a("span",vf,I(n(r.CreatedAt)),1)]),r.detalle?(_(),C("pre",gf,I(r.detalle),1)):K("",!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,l)=>(_(),C("div",null,[l[2]||(l[2]=a("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)),a("div",xf,[a("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:l[0]||(l[0]=u=>o("google"))}," Conectar Google "),a("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:l[1]||(l[1]=u=>o("microsoft"))}," Conectar Outlook ")]),a("div",yf,[e.conexiones.length===0?(_(),Ce(Nt,{key:0,titulo:"Sin cuentas conectadas",detalle:"Conectando una cuenta de correo, el agente puede leer y responder mensajes con tu dirección."})):K("",!0),(_(!0),C(re,null,we(e.conexiones,u=>(_(),C("div",{key:u.ID,class:"p-4 flex items-center justify-between"},[a("div",null,[a("span",_f,I(u.proveedor),1),a("span",wf,I(u.email),1),a("span",{class:xe(["ml-2 px-1.5 py-0.5 rounded text-xs",u.activo?"badge-ok":"badge-neutro"])},I(u.activo?"activa":"inactiva"),3)]),a("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:f=>r(u)},"Desconectar",8,kf)]))),128))])]))}},Af={class:"card p-4 flex flex-col h-[28rem]"},$f={class:"flex-1 overflow-y-auto space-y-2 mb-3"},Ef={key:0,class:"text-sm text-tenue"},Sf={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=H([]),o=H(""),r=H(!1);async function i(){const l=o.value.trim();if(!(!l||r.value)){o.value="",s.value.push({role:"user",content:l}),r.value=!0;try{const u=await se.post(te("/umind/chat"),{agente_id:t.agenteId,session_id:n,mensaje:l});s.value.push({role:"assistant",content:u.respuesta})}catch(u){s.value.push({role:"assistant",content:`⚠ ${u.message}`})}finally{r.value=!1}}}return(l,u)=>(_(),C("div",Af,[a("div",$f,[s.value.length===0?(_(),C("p",Ef," 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. ")):K("",!0),(_(!0),C(re,null,we(s.value,(f,d)=>(_(),C("div",{key:d,class:xe(["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?(_(),C("div",Sf,[ne(ss,{estado:"pensando",tam:30,class:"text-brand"}),u[1]||(u[1]=a("span",{class:"text-xs text-tenue"},"Pensando…",-1))])):K("",!0)]),a("form",{class:"flex gap-2",onSubmit:Pe(i,["prevent"])},[X(a("input",{"onUpdate:modelValue":u[0]||(u[0]=f=>o.value=f),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 input"},null,512),[[ue,o.value]]),a("button",{type:"submit",disabled:r.value,class:"btn-primary disabled:opacity-50 transition-colors"}," Enviar ",8,If)],32)]))}},Rf={class:"grid grid-cols-3 gap-4"},Pf={class:"col-span-1 card divide-y divide-borde max-h-[28rem] overflow-y-auto"},Tf=["onClick"],Of={class:"text-texto truncate"},Df={class:"text-xs text-tenue mt-0.5"},Mf={class:"col-span-2 card p-4 max-h-[28rem] overflow-y-auto space-y-2"},Nf={key:0,class:"text-sm text-tenue"},Vf={__name:"TabConversaciones",props:{agenteId:{type:Number,required:!0},sesiones:{type:Array,default:()=>[]}},setup(e){const t=e,n=H([]),s=H(null);async function o(r){s.value=r;const i=await se.get(te(`/umind/historial?agente_id=${t.agenteId}&session_id=${r}`));n.value=i.items||[]}return(r,i)=>(_(),C("div",Rf,[a("div",Pf,[e.sesiones.length===0?(_(),Ce(Nt,{key:0,titulo:"Nadie escribió todavía",detalle:"Acá vas a ver todo lo que le preguntan y qué contestó."})):K("",!0),(_(!0),C(re,null,we(e.sesiones,l=>(_(),C("button",{key:l.session_id,class:xe(["w-full text-left p-3 hover:bg-elevado text-sm",s.value===l.session_id?"bg-gray-50 dark:bg-gray-800":""]),onClick:u=>o(l.session_id)},[a("div",Of,I(l.content),1),a("div",Df,I(l.session_id),1)],10,Tf))),128))]),a("div",Mf,[s.value?K("",!0):(_(),C("p",Nf,"Elegí una conversación de la izquierda.")),(_(!0),C(re,null,we(n.value,l=>(_(),C("div",{key:l.ID,class:xe(["max-w-[80%] px-3 py-2 rounded-lg text-sm",l.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},I(l.content),3))),128))])]))}},jf={class:"card divide-y divide-borde"},Uf={class:"text-sm text-texto font-mono"},Lf={class:"label mt-0.5"},Ff={class:"text-xs text-tenue mt-0.5"},qf={key:0,class:"ml-1 text-green-600 dark:text-green-400"},Hf={key:1,class:"ml-1 text-gray-400"},Bf={class:"flex gap-3 text-sm shrink-0"},Gf=["onClick"],Kf=["onClick"],Wf={class:"card p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},zf={class:"font-semibold text-texto mb-4"},Jf={class:"border border-borde rounded-lg p-3 space-y-2"},Qf=["onUpdate:modelValue"],Yf=["onUpdate:modelValue"],Zf=["onUpdate:modelValue"],Xf={class:"label flex items-center gap-1"},ep=["onUpdate:modelValue"],tp=["onClick"],np={key:0,class:"text-xs text-gray-400"},sp={class:"border border-borde rounded-lg p-3 space-y-2"},op={class:"flex items-center gap-2 label"},rp={class:"flex items-center gap-2 text-sm text-texto"},ip={class:"flex justify-end gap-2 pt-2"},lp={__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=H(!1),r=H(null),i=H(l());function l(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}function u(){r.value=null,i.value=l(),o.value=!0}function f(R){r.value=R;let k=[];try{k=JSON.parse(R.parametros_json||"[]")||[]}catch{k=[]}i.value={nombre:R.nombre,descripcion:R.descripcion,url:R.url,auth_header_nombre:R.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:k,activa:R.activa},o.value=!0}function d(){i.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function p(R){i.value.parametros.splice(R,1)}async function h(){const R={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&&(R.auth_header_valor=i.value.auth_header_valor);try{r.value?await se.put(te(`/umind/tools/${r.value.ID}`),R):await se.post(te("/umind/tools"),R),o.value=!1,s("recargar")}catch(k){s("error",k.message)}}async function b(R){confirm(`¿Eliminar la herramienta "${R.nombre}"?`)&&(await se.del(te(`/umind/tools/${R.ID}`)),s("recargar"))}return(R,k)=>(_(),C("div",null,[a("div",{class:"flex justify-between items-center mb-4"},[k[9]||(k[9]=a("p",{class:"label"},"Máximo 10 herramientas activas por agente.",-1)),a("button",{class:"btn-primary",onClick:u}," + Nueva herramienta ")]),a("div",jf,[e.tools.length===0?(_(),Ce(Nt,{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."})):K("",!0),(_(!0),C(re,null,we(e.tools,P=>(_(),C("div",{key:P.ID,class:"p-4 flex items-center justify-between"},[a("div",null,[a("div",Uf,I(P.nombre),1),a("div",Lf,I(P.descripcion),1),a("div",Ff,[ie(I(P.url)+" ",1),P.auth_configurado?(_(),C("span",qf,"· auth configurada")):K("",!0),P.activa?K("",!0):(_(),C("span",Hf,"· inactiva"))])]),a("div",Bf,[a("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:N=>f(P)},"Editar",8,Gf),a("button",{class:"text-red-500 hover:text-red-700",onClick:N=>b(P)},"Eliminar",8,Kf)])]))),128))]),o.value?(_(),C("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"]))},[a("div",Wf,[a("h2",zf,I(r.value?"Editar herramienta":"Nueva herramienta"),1),a("form",{class:"space-y-3",onSubmit:Pe(h,["prevent"])},[a("div",null,[k[10]||(k[10]=a("label",{class:"label"},"Nombre (identificador, ej: consultar_stock)",-1)),X(a("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),[[ue,i.value.nombre]])]),a("div",null,[k[11]||(k[11]=a("label",{class:"label"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),X(a("textarea",{"onUpdate:modelValue":k[1]||(k[1]=P=>i.value.descripcion=P),rows:"2",required:"",class:"input"},null,512),[[ue,i.value.descripcion]])]),a("div",null,[k[12]||(k[12]=a("label",{class:"label"},"URL del webhook (https)",-1)),X(a("input",{"onUpdate:modelValue":k[2]||(k[2]=P=>i.value.url=P),type:"url",required:"",placeholder:"https://...",class:"input"},null,512),[[ue,i.value.url]])]),a("div",Jf,[a("div",{class:"flex items-center justify-between"},[k[13]||(k[13]=a("label",{class:"label"},"Parámetros que completa el modelo",-1)),a("button",{type:"button",class:"text-xs text-brand",onClick:d},"+ agregar")]),(_(!0),C(re,null,we(i.value.parametros,(P,N)=>(_(),C("div",{key:N,class:"flex gap-2 items-center"},[X(a("input",{"onUpdate:modelValue":A=>P.nombre=A,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,Qf),[[ue,P.nombre]]),X(a("select",{"onUpdate:modelValue":A=>P.tipo=A,class:"border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},[...k[14]||(k[14]=[a("option",{value:"string"},"string",-1),a("option",{value:"number"},"number",-1),a("option",{value:"boolean"},"boolean",-1)])],8,Yf),[[un,P.tipo]]),X(a("input",{"onUpdate:modelValue":A=>P.descripcion=A,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,Zf),[[ue,P.descripcion]]),a("label",Xf,[X(a("input",{"onUpdate:modelValue":A=>P.requerido=A,type:"checkbox"},null,8,ep),[[Pt,P.requerido]]),k[15]||(k[15]=ie(" req. ",-1))]),a("button",{type:"button",class:"text-red-400 text-xs",onClick:A=>p(N)},[ne(Me,{nombre:"cerrar",tam:13})],8,tp)]))),128)),i.value.parametros.length===0?(_(),C("p",np,"Sin parámetros.")):K("",!0)]),a("div",sp,[k[16]||(k[16]=a("label",{class:"label"},"Autenticación saliente (opcional)",-1)),X(a("input",{"onUpdate:modelValue":k[3]||(k[3]=P=>i.value.auth_header_nombre=P),placeholder:"Nombre del header, ej: Authorization",class:"input"},null,512),[[ue,i.value.auth_header_nombre]]),a("label",op,[X(a("input",{"onUpdate:modelValue":k[4]||(k[4]=P=>i.value.tocarAuth=P),type:"checkbox"},null,512),[[Pt,i.value.tocarAuth]]),ie(" "+I(r.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),i.value.tocarAuth?X((_(),C("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)),[[ue,i.value.auth_header_valor]]):K("",!0)]),a("label",rp,[X(a("input",{"onUpdate:modelValue":k[6]||(k[6]=P=>i.value.activa=P),type:"checkbox"},null,512),[[Pt,i.value.activa]]),k[17]||(k[17]=ie(" Activa ",-1))]),a("div",ip,[a("button",{type:"button",class:"btn-ghost",onClick:k[7]||(k[7]=P=>o.value=!1)},"Cancelar"),k[18]||(k[18]=a("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):K("",!0)]))}},ap={class:"card p-4 mb-4"},up={class:"flex items-center justify-between mb-2"},cp={class:"bg-elevado border border-borde rounded-lg p-2.5 text-xs text-texto overflow-x-auto"},dp={class:"card divide-y divide-borde"},fp={class:"flex items-center justify-between"},pp={class:"font-medium text-texto capitalize"},mp={class:"flex gap-3 text-sm"},hp=["onClick"],vp=["onClick"],gp={class:"flex gap-4 mt-2 text-xs"},bp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},xp=["checked","onChange"],yp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},_p=["checked","onChange"],wp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},kp=["checked","onChange"],Cp={class:"label mt-1 break-all"},Ap={class:"bg-elevado px-1 rounded"},$p={key:0,class:"text-xs text-tenue mt-1"},Ep={key:1,class:"text-xs text-red-600 dark:text-red-400 mt-1"},Sp={class:"card p-6 w-full max-w-md"},Ip={key:0},Rp={class:"flex flex-col gap-2 pt-1"},Pp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Tp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Op={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Dp={class:"flex justify-end gap-2 pt-2"},Mp={__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=H(!1),r=H(f()),i=H(!1),l=me(()=>{const A=n.siteKey||"TU_SITE_KEY";return`<script src="${window.location.origin}/widget/umind.js" data-site="${A}" defer><\/script>`});async function u(){try{await navigator.clipboard.writeText(l.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 d(){r.value=f(),o.value=!0}async function p(){const A=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:A,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(w){s("error",w.message)}}async function h(A,w){await se.put(te(`/umind/canales/${A.ID}`),{activo:A.activo,credenciales:{},usar_whisper_audio:A.usar_whisper_audio,usar_ocr_imagenes:A.usar_ocr_imagenes,usar_archivos_docs:A.usar_archivos_docs,...w}),s("recargar")}const b=A=>h(A,{activo:!A.activo}),R=A=>h(A,{usar_whisper_audio:!A.usar_whisper_audio}),k=A=>h(A,{usar_ocr_imagenes:!A.usar_ocr_imagenes}),P=A=>h(A,{usar_archivos_docs:!A.usar_archivos_docs});async function N(A){confirm(`¿Eliminar el canal ${A.tipo}?`)&&(await se.del(te(`/umind/canales/${A.ID}`)),s("recargar"))}return(A,w)=>(_(),C("div",null,[a("div",ap,[a("div",up,[w[11]||(w[11]=a("div",null,[a("span",{class:"font-medium text-texto"},"Web (widget)"),a("span",{class:"ml-2 px-1.5 py-0.5 rounded text-xs badge-ok"}," siempre activo ")],-1)),a("button",{class:xe(["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?(_(),Ce(Me,{key:0,nombre:"ok",tam:14})):K("",!0),ie(" "+I(i.value?"Copiado":"Copiar código"),1)],2)]),w[12]||(w[12]=a("p",{class:"label mb-2"},[ie(" Pegá esto antes de "),a("code",{class:"bg-elevado px-1 rounded"},"</body>"),ie(" en las páginas de tu sitio. ")],-1)),a("pre",cp,[a("code",null,I(l.value),1)])]),a("div",{class:"flex justify-end mb-4"},[a("button",{class:"btn-primary",onClick:d}," + Nuevo canal ")]),a("div",dp,[e.canales.length===0?(_(),Ce(Nt,{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."})):K("",!0),(_(!0),C(re,null,we(e.canales,y=>(_(),C("div",{key:y.ID,class:"p-4"},[a("div",fp,[a("div",null,[a("span",pp,I(y.tipo),1),a("span",{class:xe(["ml-2 px-1.5 py-0.5 rounded text-xs",y.activo?"badge-ok":"badge-neutro"])},I(y.activo?"activo":"inactivo"),3)]),a("div",mp,[a("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:x=>b(y)},I(y.activo?"Desactivar":"Activar"),9,hp),a("button",{class:"text-red-500 hover:text-red-700",onClick:x=>N(y)},"Eliminar",8,vp)])]),a("div",gp,[a("label",bp,[a("input",{type:"checkbox",checked:y.usar_whisper_audio,onChange:x=>R(y),class:"rounded border-borde text-brand focus:ring-brand"},null,40,xp),w[13]||(w[13]=ie(" Transcribir audios (Whisper) ",-1))]),a("label",yp,[a("input",{type:"checkbox",checked:y.usar_ocr_imagenes,onChange:x=>k(y),class:"rounded border-borde text-brand focus:ring-brand"},null,40,_p),w[14]||(w[14]=ie(" Leer texto de imágenes (OCR) ",-1))]),a("label",wp,[a("input",{type:"checkbox",checked:y.usar_archivos_docs,onChange:x=>P(y),class:"rounded border-borde text-brand focus:ring-brand"},null,40,kp),w[15]||(w[15]=ie(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),a("p",Cp,[w[16]||(w[16]=ie(" Webhook: ",-1)),a("code",Ap,I(y.webhook_url),1)]),y.tipo==="whatsapp"?(_(),C("p",$p,' Registrá esta URL como "Callback URL" en Meta for Developers → WhatsApp → Configuration, con el mismo verify_token que pusiste acá. ')):K("",!0),y.ultimo_error?(_(),C("p",Ep,I(y.ultimo_error),1)):K("",!0)]))),128))]),o.value?(_(),C("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:w[10]||(w[10]=Pe(y=>o.value=!1,["self"]))},[a("div",Sp,[w[28]||(w[28]=a("h2",{class:"font-semibold text-texto mb-4"},"Nuevo canal",-1)),a("form",{class:"space-y-3",onSubmit:Pe(p,["prevent"])},[a("div",null,[w[18]||(w[18]=a("label",{class:"label"},"Tipo",-1)),X(a("select",{"onUpdate:modelValue":w[0]||(w[0]=y=>r.value.tipo=y),class:"input"},[...w[17]||(w[17]=[a("option",{value:"telegram"},"Telegram",-1),a("option",{value:"whatsapp"},"WhatsApp Business",-1)])],512),[[un,r.value.tipo]])]),r.value.tipo==="telegram"?(_(),C("div",Ip,[w[19]||(w[19]=a("label",{class:"label"},"Bot token (de @BotFather)",-1)),X(a("input",{"onUpdate:modelValue":w[1]||(w[1]=y=>r.value.bot_token=y),type:"password",required:"",class:"input"},null,512),[[ue,r.value.bot_token]])])):(_(),C(re,{key:1},[a("div",null,[w[20]||(w[20]=a("label",{class:"label"},"Phone Number ID",-1)),X(a("input",{"onUpdate:modelValue":w[2]||(w[2]=y=>r.value.phone_number_id=y),required:"",class:"input"},null,512),[[ue,r.value.phone_number_id]])]),a("div",null,[w[21]||(w[21]=a("label",{class:"label"},"Access Token",-1)),X(a("input",{"onUpdate:modelValue":w[3]||(w[3]=y=>r.value.access_token=y),type:"password",required:"",class:"input"},null,512),[[ue,r.value.access_token]])]),a("div",null,[w[22]||(w[22]=a("label",{class:"label"},"App Secret",-1)),X(a("input",{"onUpdate:modelValue":w[4]||(w[4]=y=>r.value.app_secret=y),type:"password",required:"",class:"input"},null,512),[[ue,r.value.app_secret]])]),a("div",null,[w[23]||(w[23]=a("label",{class:"label"},"Verify Token (lo inventás vos, lo vas a usar en Meta)",-1)),X(a("input",{"onUpdate:modelValue":w[5]||(w[5]=y=>r.value.verify_token=y),required:"",class:"input"},null,512),[[ue,r.value.verify_token]])])],64)),a("div",Rp,[a("label",Pp,[X(a("input",{type:"checkbox","onUpdate:modelValue":w[6]||(w[6]=y=>r.value.usar_whisper_audio=y),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Pt,r.value.usar_whisper_audio]]),w[24]||(w[24]=ie(" Transcribir audios con Whisper ",-1))]),a("label",Tp,[X(a("input",{type:"checkbox","onUpdate:modelValue":w[7]||(w[7]=y=>r.value.usar_ocr_imagenes=y),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Pt,r.value.usar_ocr_imagenes]]),w[25]||(w[25]=ie(" Leer texto de imágenes con OCR ",-1))]),a("label",Op,[X(a("input",{type:"checkbox","onUpdate:modelValue":w[8]||(w[8]=y=>r.value.usar_archivos_docs=y),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Pt,r.value.usar_archivos_docs]]),w[26]||(w[26]=ie(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),a("div",Dp,[a("button",{type:"button",class:"btn-ghost",onClick:w[9]||(w[9]=y=>o.value=!1)},"Cancelar"),w[27]||(w[27]=a("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):K("",!0)]))}},Np={class:"card p-1 mb-6 flex flex-wrap"},Vp=["onClick"],jp={class:"text-red-700 dark:text-red-400 font-medium"},Up={__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=me(()=>n.canales.filter(p=>p.activo)),r={whatsapp:"WhatsApp",telegram:"Telegram",web:"tu web"},i=p=>r[p]||p,l=me(()=>n.documentos.filter(p=>p.estado==="listo")),u=me(()=>l.value.filter(p=>p.procesado_at&&Date.now()-new Date(p.procesado_at)>60*864e5)),f=me(()=>n.eventos.filter(p=>p.nivel==="error").length),d=me(()=>[{clave:"canales",icono:"mensaje",bien:o.value.length>0,texto:o.value.length?`Atendiendo en ${o.value.map(p=>i(p.tipo)).join(" y ")}`:"No está atendiendo en ningún lado",destino:"canales"},{clave:"conocimiento",icono:"escribir",bien:l.value.length>0&&u.value.length===0,texto:l.value.length?u.value.length?`${u.value.length} de ${l.value.length} fuentes están viejas`:`Sabe de ${l.value.length} ${l.value.length===1?"cosa":"cosas"}`:"Todavía no sabe nada de tu negocio",destino:"conocimiento"},{clave:"conversaciones",icono:"grafico",bien:!0,neutro:n.sesiones.length===0,texto:n.sesiones.length?`${n.sesiones.length} ${n.sesiones.length===1?"conversación":"conversaciones"}`:"Nadie escribió todavía",destino:"conversaciones"}]);return(p,h)=>(_(),C("div",Np,[(_(!0),C(re,null,we(d.value,b=>(_(),C("button",{key:b.clave,class:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm hover:bg-elevado transition-colors text-left",onClick:R=>s("ir",b.destino)},[ne(Me,{nombre:b.bien?b.icono:"alerta",tam:16,class:xe(b.neutro?"text-tenue":b.bien?"text-brand":"text-amber-600 dark:text-amber-400")},null,8,["nombre","class"]),a("span",{class:xe(b.neutro?"text-tenue":b.bien?"text-texto":"text-amber-700 dark:text-amber-400 font-medium")},I(b.texto),3)],8,Vp))),128)),f.value?(_(),C("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:h[0]||(h[0]=b=>s("ir","auditoria"))},[ne(Me,{nombre:"alerta",tam:16,class:"text-red-600 dark:text-red-400"}),a("span",jp,I(f.value)+" "+I(f.value===1?"problema":"problemas"),1)])):K("",!0)]))}},Lp={key:0,class:"mb-4 mt-1 flex items-start justify-between gap-4"},Fp={class:"text-xl font-semibold text-texto min-w-0 truncate"},qp=["href"],Hp={key:2,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Bp={class:"flex items-center gap-1.5 mb-6 flex-wrap"},Gp=["onClick"],Kp={class:"text-[10px]"},Wp={key:3,class:"flex gap-1.5 mb-6 flex-wrap"},zp=["onClick"],Jp={key:4,class:"grid gap-4 lg:grid-cols-[1fr_21rem] items-start"},Qp={class:"card p-4 mb-4"},Yp={class:"flex gap-1 mb-3"},Zp=["onClick"],Xp={class:"flex items-center justify-between"},em=["disabled"],tm={class:"flex items-center justify-between"},nm=["disabled"],sm={class:"flex gap-2"},om={class:"flex items-center justify-between"},rm={class:"flex items-center gap-2 text-xs text-tenue cursor-pointer"},im=["disabled"],lm={class:"card divide-y divide-borde"},am={class:"text-sm text-texto"},um={class:"text-xs text-tenue mt-0.5"},cm={key:0,class:"latido"},dm={key:0},fm={key:1},pm={key:3},mm={key:4,class:"text-red-600 dark:text-red-400"},hm={class:"flex items-center gap-3 shrink-0"},vm=["title","onClick"],gm=["onClick"],bm=["disabled","title","onClick"],xm=["onClick"],ym={class:"lg:sticky lg:top-4"},_m={class:"card w-full max-w-2xl p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},wm={class:"flex justify-end gap-2 pt-1"},km=["disabled"],Cm={__name:"AgenteDetail",props:{tenantId:{type:String,required:!0},agenteId:{type:String,required:!0}},setup(e){const t=e,n=me(()=>Number(t.agenteId)),s=Gi(),o=H(null),r=H(""),i=H(typeof s.query.tab=="string"?s.query.tab:ze.esPortal?"conversaciones":"conocimiento"),l=H([]),u=H(""),f=H(30),d=H(!1);async function p(){const D=await se.get(te(`/umind/agentes?tenant_id=${t.tenantId}`));o.value=(D.items||[]).find(c=>String(c.ID)===t.agenteId)||null}async function h(){const D=await se.get(te(`/umind/documentos?agente_id=${t.agenteId}`));l.value=D.items||[]}const b=H("texto"),R=H(!0),k=H(""),P=H(""),N=H(null);async function A(){if(u.value.trim()){d.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:R.value}),u.value="",await h()}catch(D){r.value=D.message}finally{d.value=!1}}}async function w(){if(P.value.trim()){d.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 h()}catch(D){r.value=D.message}finally{d.value=!1}}}async function y(){var c,m;const D=(m=(c=N.value)==null?void 0:c.files)==null?void 0:m[0];if(D){d.value=!0,r.value="";try{const g=new FormData;g.append("agente_id",String(n.value)),g.append("archivo",D);const v=await fetch(te("/umind/documentos/archivo"),{method:"POST",body:g}),S=await v.json();if(!v.ok)throw new Error(S.error||"No se pudo subir");N.value.value="",await h()}catch(g){r.value=g.message}finally{d.value=!1}}}const x=H(null),O=H({titulo:"",contenido:""}),V=H(!1);function j(D){x.value=D,O.value={titulo:D.origen,contenido:D.contenido||""}}async function _e(){if(x.value){V.value=!0,r.value="";try{await se.put(te(`/umind/documentos/${x.value.ID}`),{titulo:O.value.titulo,contenido:O.value.contenido}),x.value=null,await h()}catch(D){r.value=D.message}finally{V.value=!1}}}async function Z(D){r.value="";try{await se.post(te(`/umind/documentos/${D.ID}/reprocesar`),{}),await h()}catch(c){r.value=c.message}}async function L(D){try{await se.put(te(`/umind/documentos/${D.ID}`),{auto_actualizar:!D.auto_actualizar}),await h()}catch(c){r.value=c.message}}function Ee(D){if(!D)return"sin procesar";const c=Math.floor((Date.now()-new Date(D))/864e5);if(c<=0)return"hoy";if(c===1)return"ayer";if(c<30)return`hace ${c} días`;const m=Math.floor(c/30);return m===1?"hace un mes":`hace ${m} meses`}function W(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 h())}const Vt=me(()=>D=>({listo:"badge-ok",procesando:"badge-alerta",pendiente:"badge-neutro",error:"badge-error"})[D]||"badge-neutro"),ke=H([]);async function ce(){const D=await se.get(te(`/umind/sesiones?agente_id=${t.agenteId}`));ke.value=D.items||[]}const le=H([]);async function et(){const D=await se.get(te(`/umind/tools?agente_id=${t.agenteId}`));le.value=D.items||[]}const Je=H([]);async function Qe(){const D=await se.get(te(`/umind/canales?agente_id=${t.agenteId}`));Je.value=D.items||[]}const Ve=me(()=>{const D=new Date,c=new Date(D.getFullYear(),D.getMonth(),1).toISOString().slice(0,10),m=D.toISOString().slice(0,10);return te(`/umind/reporte.xlsx?agente_id=${t.agenteId}&desde=${c}&hasta=${m}`)}),ut=H([]);async function yt(){const D=await se.get(te(`/umind/conexiones?agente_id=${t.agenteId}`));ut.value=D.items||[]}const _t=[["conversaciones","Conversaciones"],["conocimiento","Lo que sabe"],["canales","Dónde atiende"]],je=[["herramientas","Herramientas"],["conexiones","Cuentas conectadas"],["auditoria","Problemas"]],E=H(!1);je.some(([D])=>D===i.value)&&(E.value=!0);function G(D){i.value=D,je.some(([c])=>c===D)&&(E.value=!0)}const F=H([]);async function z(){const D=await se.get(te(`/umind/eventos?agente_id=${t.agenteId}`));F.value=D.items||[]}return It(()=>[t.tenantId,t.agenteId],async()=>{r.value="",o.value=null,l.value=[],ke.value=[],le.value=[],Je.value=[],ut.value=[],F.value=[];try{await Promise.all([p(),h(),ce(),et(),Qe(),yt(),z()])}catch(D){r.value=D.message}},{immediate:!0}),(D,c)=>{var g;const m=mn("router-link");return _(),C("div",null,[ne(m,{to:`/tenants/${e.tenantId}`,class:"label hover:text-brand"},{default:nt(()=>[...c[12]||(c[12]=[ie("← Agentes",-1)])]),_:1},8,["to"]),o.value?(_(),C("div",Lp,[a("h1",Fp,I(o.value.nombre),1),a("a",{href:Ve.value,class:"btn-ghost shrink-0",title:"Conversaciones y consumo del mes en Excel"},[ne(Me,{nombre:"descargar",tam:15}),c[13]||(c[13]=ie(" Reporte del mes ",-1))],8,qp)])):K("",!0),o.value?(_(),Ce(Up,{key:1,canales:Je.value,documentos:l.value,sesiones:ke.value,eventos:F.value,onIr:G},null,8,["canales","documentos","sesiones","eventos"])):K("",!0),r.value?(_(),C("p",Hp,I(r.value),1)):K("",!0),a("div",Bp,[(_(),C(re,null,we(_t,([v,S])=>a("button",{key:v,class:xe(["px-3.5 py-1.5 rounded-full text-sm whitespace-nowrap transition-colors",i.value===v?"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:$=>i.value=v},I(S),11,Gp)),64)),a("button",{class:"ml-auto text-xs text-tenue hover:text-texto inline-flex items-center gap-1",onClick:c[0]||(c[0]=v=>E.value=!E.value)},[c[14]||(c[14]=ie(" Avanzado ",-1)),a("span",Kp,I(E.value?"▲":"▼"),1)])]),E.value?(_(),C("div",Wp,[(_(),C(re,null,we(je,([v,S])=>a("button",{key:v,class:xe(["px-3 py-1 rounded-full text-xs whitespace-nowrap transition-colors",i.value===v?"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:$=>i.value=v},I(S),11,zp)),64))])):K("",!0),i.value==="conocimiento"?(_(),C("div",Jp,[a("div",null,[a("div",Qp,[a("div",Yp,[(_(),C(re,null,we([["texto","escribir","Escribir"],["archivo","archivo","Subir archivo"],["url","sitio","Sitio web"]],([v,S,$])=>a("button",{key:v,class:xe(["px-3 py-1.5 rounded-lg text-sm inline-flex items-center gap-1.5",b.value===v?"bg-brand text-white font-medium":"text-tenue hover:text-texto"]),onClick:q=>b.value=v},[ne(Me,{nombre:S,tam:15},null,8,["nombre"]),ie(" "+I($),1)],10,Zp)),64))]),b.value==="texto"?(_(),C("form",{key:0,class:"space-y-2",onSubmit:Pe(w,["prevent"])},[X(a("input",{"onUpdate:modelValue":c[1]||(c[1]=v=>k.value=v),placeholder:"Título (ej: Horarios y zonas de entrega)",class:"input"},null,512),[[ue,k.value]]),X(a("textarea",{"onUpdate:modelValue":c[2]||(c[2]=v=>P.value=v),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),[[ue,P.value]]),a("div",Xp,[c[15]||(c[15]=a("p",{class:"text-xs text-tenue"},"Lo que te preguntan todos los días y no está en tu web.",-1)),a("button",{type:"submit",disabled:d.value,class:"btn-primary disabled:opacity-50"},I(d.value?"Guardando…":"Guardar"),9,em)])],32)):b.value==="archivo"?(_(),C("form",{key:1,class:"space-y-2",onSubmit:Pe(y,["prevent"])},[a("input",{ref_key:"archivoRef",ref:N,type:"file",accept:".pdf,.docx,.txt,.md,.csv,.html,image/*",class:"text-sm text-texto"},null,512),a("div",tm,[c[16]||(c[16]=a("p",{class:"text-xs text-tenue"},"PDF, Word, texto o una foto. Ej: tu lista de precios.",-1)),a("button",{type:"submit",disabled:d.value,class:"btn-primary disabled:opacity-50"},I(d.value?"Leyendo…":"Subir"),9,nm)])],32)):(_(),C("form",{key:2,class:"space-y-2",onSubmit:Pe(A,["prevent"])},[a("div",sm,[X(a("input",{"onUpdate:modelValue":c[3]||(c[3]=v=>u.value=v),type:"url",placeholder:"https://ejemplo.com",required:"",class:"input flex-1"},null,512),[[ue,u.value]]),X(a("input",{"onUpdate:modelValue":c[4]||(c[4]=v=>f.value=v),type:"number",min:"1",max:"200",class:"input w-24",title:"Máximo de páginas a leer"},null,512),[[ue,f.value]])]),a("div",om,[a("label",rm,[X(a("input",{"onUpdate:modelValue":c[5]||(c[5]=v=>R.value=v),type:"checkbox",class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Pt,R.value]]),c[17]||(c[17]=ie(" Releer el sitio cada semana ",-1))]),a("button",{type:"submit",disabled:d.value,class:"btn-primary disabled:opacity-50"},I(d.value?"Leyendo…":"Leer sitio"),9,im)])],32))]),a("div",lm,[l.value.length===0?(_(),Ce(Nt,{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."})):K("",!0),(_(!0),C(re,null,we(l.value,v=>(_(),C("div",{key:v.ID,class:"p-4 flex items-center justify-between"},[a("div",null,[a("div",am,I(v.origen),1),a("div",um,[a("span",{class:xe(["px-1.5 py-0.5 rounded inline-flex items-center gap-1",Vt.value(v.estado)])},[v.estado==="procesando"?(_(),C("span",cm)):K("",!0),ie(" "+I(v.estado),1)],2),v.tipo?(_(),C("span",dm," · "+I({url:"sitio",archivo:"archivo",texto:"nota"}[v.tipo]||v.tipo),1)):K("",!0),v.total_chunks?(_(),C("span",fm," · "+I(v.total_chunks)+" fragmentos",1)):K("",!0),v.procesado_at?(_(),C("span",{key:2,class:xe(W(v)?"text-amber-600 dark:text-amber-400 font-medium":"")}," · leído "+I(Ee(v.procesado_at)),3)):K("",!0),v.auto_actualizar?(_(),C("span",pm," · se actualiza sola")):K("",!0),v.error?(_(),C("span",mm," · "+I(v.error),1)):K("",!0)])]),a("div",hm,[v.tipo==="url"?(_(),C("button",{key:0,class:"text-xs text-tenue hover:text-texto",title:v.auto_actualizar?"Dejar de releer sola":"Releer el sitio cada semana",onClick:S=>L(v)},[ne(Me,{nombre:v.auto_actualizar?"auto":"refrescar",tam:13,class:"mr-1"},null,8,["nombre"]),ie(I(v.auto_actualizar?"auto":"manual"),1)],8,vm)):K("",!0),v.tipo==="texto"||v.tipo==="archivo"?(_(),C("button",{key:1,class:"text-sm text-brand hover:underline",onClick:S=>j(v)},"Editar",8,gm)):K("",!0),a("button",{class:"text-sm text-tenue hover:text-texto disabled:opacity-40",disabled:v.estado==="procesando",title:v.tipo==="url"?"Volver a leer el sitio":"Rehacer los fragmentos",onClick:S=>Z(v)},"Actualizar",8,bm),a("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:S=>Ke(v.ID)},"Eliminar",8,xm)])]))),128))])]),a("div",ym,[c[18]||(c[18]=a("p",{class:"label mb-2"},"Probalo",-1)),ne(br,{"agente-id":n.value},null,8,["agente-id"])]),x.value?(_(),C("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:c[9]||(c[9]=Pe(v=>x.value=null,["self"]))},[a("div",_m,[c[22]||(c[22]=a("h2",{class:"font-semibold text-texto mb-1"},"Editar fuente",-1)),c[23]||(c[23]=a("p",{class:"text-xs text-tenue mb-4"}," Al guardar se vuelve a leer y el agente empieza a contestar con esto. ",-1)),a("form",{class:"space-y-3",onSubmit:Pe(_e,["prevent"])},[a("div",null,[c[19]||(c[19]=a("label",{class:"label"},"Título",-1)),X(a("input",{"onUpdate:modelValue":c[6]||(c[6]=v=>O.value.titulo=v),required:"",class:"input"},null,512),[[ue,O.value.titulo]])]),a("div",null,[c[20]||(c[20]=a("label",{class:"label"},"Contenido",-1)),X(a("textarea",{"onUpdate:modelValue":c[7]||(c[7]=v=>O.value.contenido=v),rows:"16",required:"",class:"input font-normal leading-relaxed"},null,512),[[ue,O.value.contenido]]),c[21]||(c[21]=a("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))]),a("div",wm,[a("button",{type:"button",class:"btn-ghost",onClick:c[8]||(c[8]=v=>x.value=null)},"Cancelar"),a("button",{type:"submit",class:"btn-primary",disabled:V.value},I(V.value?"Guardando…":"Guardar y volver a leer"),9,km)])],32)])])):K("",!0)])):i.value==="herramientas"?(_(),Ce(lp,{key:5,"agente-id":n.value,tools:le.value,onRecargar:et,onError:c[10]||(c[10]=v=>r.value=v)},null,8,["agente-id","tools"])):i.value==="canales"?(_(),Ce(Mp,{key:6,"agente-id":n.value,"site-key":((g=o.value)==null?void 0:g.site_key)||"",canales:Je.value,onRecargar:Qe,onError:c[11]||(c[11]=v=>r.value=v)},null,8,["agente-id","site-key","canales"])):i.value==="conexiones"?(_(),Ce(Cf,{key:7,"agente-id":n.value,conexiones:ut.value,onRecargar:yt},null,8,["agente-id","conexiones"])):i.value==="chat"?(_(),Ce(br,{key:8,"agente-id":n.value},null,8,["agente-id"])):i.value==="conversaciones"?(_(),Ce(Vf,{key:9,"agente-id":n.value,sesiones:ke.value},null,8,["agente-id","sesiones"])):(_(),Ce(bf,{key:10,eventos:F.value},null,8,["eventos"]))])}}},Am={class:"flex items-start justify-between gap-4 mb-6"},$m={class:"card p-4 mb-4"},Em={class:"flex flex-wrap items-end gap-3"},Sm={class:"flex gap-1 ml-auto"},Im={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Rm={key:1,class:"text-sm text-tenue"},Pm={class:"grid gap-3 sm:grid-cols-3 mb-4"},Tm={class:"card p-4"},Om={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},Dm={class:"card p-4"},Mm={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},Nm={class:"card p-4"},Vm={class:"text-lg font-semibold text-texto mt-1"},jm={key:0,class:"text-[11px] text-tenue mt-0.5"},Um={key:0,class:"card p-4 mb-4"},Lm={class:"flex items-center justify-between text-sm mb-2"},Fm={class:"text-tenue tabular-nums"},qm={class:"h-2 rounded-full bg-elevado overflow-hidden"},Hm={key:0,class:"text-xs text-amber-600 dark:text-amber-400 mt-2"},Bm={class:"card divide-y divide-borde mb-4"},Gm={class:"min-w-0 flex-1"},Km={class:"text-sm text-texto"},Wm={class:"text-xs text-tenue tabular-nums"},zm={key:0,class:"text-sm font-medium text-texto tabular-nums"},Jm={key:1,class:"text-xs text-tenue text-right leading-tight"},Qm={key:1,class:"card p-4"},Ym={class:"flex items-end gap-1 h-28"},Zm=["title"],Xm={class:"flex justify-between text-[11px] text-tenue mt-2"},eh={__name:"Uso",props:{id:{type:String,required:!0}},setup(e){const t=e,n=H(!0),s=H(""),o=H(null),r=new Date,i=H(new Date(r.getFullYear(),r.getMonth(),1).toISOString().slice(0,10)),l=H(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=y=>u[y]||{nombre:y,icono:"grafico",color:"#94a3b8"};async function d(){n.value=!0,s.value="";try{o.value=await se.get(te(`/umind/uso?tenant_id=${t.id}&desde=${i.value}&hasta=${l.value}`))}catch(y){s.value=y.message}finally{n.value=!1}}const p=me(()=>{var y,x;return((x=(y=o.value)==null?void 0:y.plan)==null?void 0:x.moneda)||"COP"}),h=me(()=>{var y;return((y=o.value)==null?void 0:y.resumen)||[]}),b=me(()=>{var y;return((y=o.value)==null?void 0:y.total_periodo)||0}),R=me(()=>{var y,x;return((x=(y=o.value)==null?void 0:y.plan)==null?void 0:x.tope_consumo_mensual)||0}),k=me(()=>R.value?Math.min(100,b.value/R.value*100):0);function P(y){return`${p.value} ${Number(y||0).toLocaleString("es-CO",{maximumFractionDigits:2})}`}function N(y){return Number(y||0).toLocaleString("es-CO",{maximumFractionDigits:0})}const A=me(()=>{var V;const y=new Map;for(const j of((V=o.value)==null?void 0:V.detalle)||[]){const _e=String(j.CreatedAt).slice(0,10);y.set(_e,(y.get(_e)||0)+(j.costo||0))}const x=[...y.entries()].sort((j,_e)=>j[0].localeCompare(_e[0])),O=Math.max(...x.map(j=>j[1]),0);return{dias:x,max:O}});function w(y){const x=new Date,O=new Date;O.setDate(O.getDate()-y),i.value=O.toISOString().slice(0,10),l.value=x.toISOString().slice(0,10),d()}return It(()=>t.id,d,{immediate:!0}),(y,x)=>{var V;const O=mn("router-link");return _(),C("div",null,[a("div",Am,[x[6]||(x[6]=a("div",null,[a("h1",{class:"text-xl font-semibold text-texto"},"Consumo"),a("p",{class:"text-sm text-tenue mt-0.5"},"Lo que usaron tus agentes y cuánto cuesta.")],-1)),ne(O,{to:`/tenants/${e.id}`,class:"btn-ghost inline-flex items-center gap-1.5"},{default:nt(()=>[ne(Me,{nombre:"atras",tam:15}),x[5]||(x[5]=ie(" Agentes",-1))]),_:1},8,["to"])]),a("div",$m,[a("div",Em,[a("div",null,[x[7]||(x[7]=a("label",{class:"label"},"Desde",-1)),X(a("input",{"onUpdate:modelValue":x[0]||(x[0]=j=>i.value=j),type:"date",class:"input !w-auto"},null,512),[[ue,i.value]])]),a("div",null,[x[8]||(x[8]=a("label",{class:"label"},"Hasta",-1)),X(a("input",{"onUpdate:modelValue":x[1]||(x[1]=j=>l.value=j),type:"date",class:"input !w-auto"},null,512),[[ue,l.value]])]),a("button",{class:"btn-primary",onClick:d},"Aplicar"),a("div",Sm,[a("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:x[2]||(x[2]=j=>w(6))},"7 días"),a("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:x[3]||(x[3]=j=>w(29))},"30 días"),a("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:x[4]||(x[4]=j=>w(89))},"90 días")])])]),s.value?(_(),C("p",Im,I(s.value),1)):K("",!0),n.value?(_(),C("p",Rm,"Cargando…")):o.value?(_(),C(re,{key:2},[a("div",Pm,[a("div",Tm,[x[9]||(x[9]=a("p",{class:"text-xs text-tenue"},"Consumo del período",-1)),a("p",Om,I(P(b.value)),1)]),a("div",Dm,[x[10]||(x[10]=a("p",{class:"text-xs text-tenue"},"Pendiente de facturar",-1)),a("p",Mm,I(P(o.value.pendiente_facturar)),1),x[11]||(x[11]=a("p",{class:"text-[11px] text-tenue mt-0.5"},"Se suma a tu próxima factura.",-1))]),a("div",Nm,[x[12]||(x[12]=a("p",{class:"text-xs text-tenue"},"Plan",-1)),a("p",Vm,I(((V=o.value.plan)==null?void 0:V.nombre)||"Sin plan"),1),o.value.plan?(_(),C("p",jm," Mensualidad "+I(P(o.value.plan.precio_mensual)),1)):K("",!0)])]),R.value?(_(),C("div",Um,[a("div",Lm,[x[13]||(x[13]=a("span",{class:"text-texto"},"Tope mensual",-1)),a("span",Fm,I(P(b.value))+" / "+I(P(R.value)),1)]),a("div",qm,[a("div",{class:xe(["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?(_(),C("p",Hm," Superaste el tope de tu plan. El servicio sigue funcionando y el excedente se cobra en el próximo ciclo. ")):K("",!0)])):K("",!0),a("div",Bm,[x[15]||(x[15]=a("div",{class:"px-4 py-3"},[a("h2",{class:"text-sm font-medium text-texto"},"Desglose")],-1)),h.value.length===0?(_(),Ce(Nt,{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á."})):K("",!0),(_(!0),C(re,null,we(h.value,j=>(_(),C("div",{key:j.tipo,class:"px-4 py-3 flex items-center gap-3"},[ne(Me,{nombre:f(j.tipo).icono,tam:18,class:"text-tenue"},null,8,["nombre"]),a("div",Gm,[a("p",Km,I(f(j.tipo).nombre),1),a("p",Wm,I(N(j.cantidad))+" "+I(j.unidad)+" · "+I(N(j.eventos))+" usos ",1)]),j.costo>0?(_(),C("span",zm,I(P(j.costo)),1)):(_(),C("span",Jm,[...x[14]||(x[14]=[ie(" va por tu",-1),a("br",null,null,-1),ie("cuenta de IA ",-1)])]))]))),128))]),A.value.dias.length?(_(),C("div",Qm,[x[16]||(x[16]=a("h2",{class:"text-sm font-medium text-texto mb-3"},"Por día",-1)),a("div",Ym,[(_(!0),C(re,null,we(A.value.dias,([j,_e])=>(_(),C("div",{key:j,class:"flex-1 min-w-[3px] bg-brand/70 hover:bg-brand rounded-t transition-colors",style:Jt({height:A.value.max?Math.max(2,_e/A.value.max*100)+"%":"2px"}),title:`${j}: ${P(_e)}`},null,12,Zm))),128))]),a("div",Xm,[a("span",null,I(A.value.dias[0][0]),1),a("span",null,I(A.value.dias[A.value.dias.length-1][0]),1)])])):K("",!0)],64)):K("",!0)])}}},th={class:"flex items-start justify-between gap-4 mb-6"},nh={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},sh={key:1,class:"text-sm text-tenue"},oh={key:3,class:"card divide-y divide-borde"},rh={class:"flex items-start justify-between gap-4"},ih={class:"min-w-0"},lh={class:"text-sm text-texto font-medium"},ah={class:"text-xs text-tenue mt-0.5"},uh={class:"font-mono"},ch={class:"flex items-center gap-3 shrink-0 text-sm"},dh=["disabled","onClick"],fh=["onClick"],ph=["onClick"],mh={key:4,class:"text-xs text-tenue mt-3"},hh={class:"card w-full max-w-lg p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},vh={class:"font-semibold text-texto mb-4"},gh=["value"],bh={key:0,class:"text-xs text-tenue mt-1"},xh={class:"font-mono"},yh=["placeholder"],_h={key:0},wh={class:"label"},kh={key:0,class:"text-tenue font-normal"},Ch=["required"],Ah={key:1},$h={class:"flex justify-end gap-2 pt-2"},Eh=["disabled"],Sh={__name:"AiPropia",props:{id:{type:String,required:!0}},setup(e){const t=e,n=H([]),s=H(!0),o=H(""),r=H(!1),i=H(null),l=H(!1),u=H(null),f=H({}),d=[{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 p(){return{nombre:"",provider:"openai",api_key:"",base_url:"",model_name:""}}const h=H(p());function b(y){return d.find(x=>x.valor===y)||d[0]}async function R(){s.value=!0,o.value="";try{const y=await se.get(te(`/umind/ai-propia?tenant_id=${t.id}`));n.value=y.items||[]}catch(y){o.value=y.message}finally{s.value=!1}}It(()=>t.id,R,{immediate:!0});function k(){i.value=null,h.value=p(),r.value=!0}function P(y){i.value=y,h.value={nombre:y.nombre,provider:y.provider,api_key:"",base_url:y.base_url||"",model_name:y.model_name||""},r.value=!0}async function N(){l.value=!0,o.value="";try{const y={tenant_id:Number(t.id),...h.value};i.value?await se.put(te(`/umind/ai-propia/${i.value.ID}`),y):await se.post(te("/umind/ai-propia"),y),r.value=!1,await R()}catch(y){o.value=y.message}finally{l.value=!1}}async function A(y){u.value=y.ID,f.value={...f.value,[y.ID]:null};try{const x=await se.post(te(`/umind/ai-propia/${y.ID}/probar`),{});f.value={...f.value,[y.ID]:{ok:!0,texto:x.respuesta}}}catch(x){f.value={...f.value,[y.ID]:{ok:!1,texto:x.message}}}finally{u.value=null}}async function w(y){if(confirm(`¿Eliminar "${y.nombre}"?`)){o.value="";try{await se.del(te(`/umind/ai-propia/${y.ID}`)),await R()}catch(x){o.value=x.message}}}return(y,x)=>{const O=mn("router-link");return _(),C("div",null,[a("div",th,[a("div",null,[ne(O,{to:`/tenants/${e.id}`,class:"text-sm text-tenue hover:text-texto inline-flex items-center gap-1.5"},{default:nt(()=>[ne(Me,{nombre:"atras",tam:14}),x[7]||(x[7]=ie(" Agentes",-1))]),_:1},8,["to"]),x[8]||(x[8]=a("h1",{class:"text-xl font-semibold text-texto mt-1"},"Tu cuenta de IA",-1)),x[9]||(x[9]=a("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))]),a("button",{class:"btn-primary shrink-0",onClick:k},"+ Conectar cuenta")]),o.value?(_(),C("p",nh,I(o.value),1)):K("",!0),s.value?(_(),C("div",sh,"Cargando…")):n.value.length===0?(_(),Ce(Nt,{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(()=>[a("button",{class:"btn-primary",onClick:k},"Conectar mi cuenta")]),_:1})):(_(),C("div",oh,[(_(!0),C(re,null,we(n.value,V=>(_(),C("div",{key:V.ID,class:"p-4"},[a("div",rh,[a("div",ih,[a("div",lh,I(V.nombre),1),a("div",ah,[ie(I(b(V.provider).nombre)+" · "+I(V.model_name)+" · ",1),a("span",uh,I(V.api_key_pista),1)]),f.value[V.ID]?(_(),C("p",{key:0,class:xe(["text-xs mt-1.5",f.value[V.ID].ok?"text-brand":"text-red-600 dark:text-red-400"])},I(f.value[V.ID].ok?`Responde bien — dijo "${f.value[V.ID].texto}"`:f.value[V.ID].texto),3)):K("",!0)]),a("div",ch,[a("button",{class:"text-brand hover:underline disabled:opacity-40",disabled:u.value===V.ID,onClick:j=>A(V)},I(u.value===V.ID?"Probando…":"Probar"),9,dh),a("button",{class:"text-tenue hover:text-texto",onClick:j=>P(V)},"Editar",8,fh),a("button",{class:"text-red-500 hover:text-red-700",onClick:j=>w(V)},"Eliminar",8,ph)])])]))),128))])),n.value.length?(_(),C("p",mh,[...x[10]||(x[10]=[ie(" Para que un agente la use, elegila en su campo ",-1),a("strong",null,"Config de IA",-1),ie(". ",-1)])])):K("",!0),r.value?(_(),C("div",{key:5,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:x[6]||(x[6]=Pe(V=>r.value=!1,["self"]))},[a("div",hh,[a("h2",vh,I(i.value?"Editar cuenta de IA":"Conectar tu cuenta de IA"),1),a("form",{class:"space-y-3",onSubmit:Pe(N,["prevent"])},[a("div",null,[x[11]||(x[11]=a("label",{class:"label"},"Nombre",-1)),X(a("input",{"onUpdate:modelValue":x[0]||(x[0]=V=>h.value.nombre=V),required:"",placeholder:"ej: Mi cuenta de OpenAI",class:"input"},null,512),[[ue,h.value.nombre]])]),a("div",null,[x[13]||(x[13]=a("label",{class:"label"},"Proveedor",-1)),X(a("select",{"onUpdate:modelValue":x[1]||(x[1]=V=>h.value.provider=V),class:"input"},[(_(),C(re,null,we(d,V=>a("option",{key:V.valor,value:V.valor},I(V.nombre),9,gh)),64))],512),[[un,h.value.provider]]),b(h.value.provider).donde?(_(),C("p",bh,[x[12]||(x[12]=ie(" La clave se saca de ",-1)),a("span",xh,I(b(h.value.provider).donde),1)])):K("",!0)]),a("div",null,[x[14]||(x[14]=a("label",{class:"label"},"Modelo",-1)),X(a("input",{"onUpdate:modelValue":x[2]||(x[2]=V=>h.value.model_name=V),required:"",placeholder:`ej: ${b(h.value.provider).modelo}`,class:"input font-mono"},null,8,yh),[[ue,h.value.model_name]])]),h.value.provider!=="ollama"?(_(),C("div",_h,[a("label",wh,[x[15]||(x[15]=ie(" Clave de API ",-1)),i.value?(_(),C("span",kh,"— dejala vacía para no cambiarla")):K("",!0)]),X(a("input",{"onUpdate:modelValue":x[3]||(x[3]=V=>h.value.api_key=V),type:"password",autocomplete:"new-password",required:!i.value,placeholder:"sk-...",class:"input font-mono"},null,8,Ch),[[ue,h.value.api_key]]),x[16]||(x[16]=a("p",{class:"text-xs text-tenue mt-1"},"Se guarda cifrada y no se vuelve a mostrar.",-1))])):K("",!0),h.value.provider==="ollama"?(_(),C("div",Ah,[x[17]||(x[17]=a("label",{class:"label"},"URL de tu servidor",-1)),X(a("input",{"onUpdate:modelValue":x[4]||(x[4]=V=>h.value.base_url=V),required:"",placeholder:"https://ollama.tudominio.com/v1",class:"input font-mono"},null,512),[[ue,h.value.base_url]])])):K("",!0),a("div",$h,[a("button",{type:"button",class:"btn-ghost",onClick:x[5]||(x[5]=V=>r.value=!1)},"Cancelar"),a("button",{type:"submit",class:"btn-primary",disabled:l.value},I(l.value?"Guardando…":"Guardar"),9,Eh)])],32)])])):K("",!0)])}}},Ih=yc({history:Zu(ze.baseRuta),routes:[{path:"/",name:"home",component:pd},{path:"/tenants/:id",name:"tenant-agentes",component:df,props:!0},{path:"/tenants/:id/uso",name:"uso",component:eh,props:!0},{path:"/tenants/:id/ia",name:"ai-propia",component:Sh,props:!0},{path:"/tenants/:tenantId/agentes/:agenteId",name:"agente-detail",component:Cm,props:!0}]});du(Qc).use(Ih).mount("#app");
|