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