Al navegar de /tenants/2 a /tenants/3, vue-router reusa la misma instancia del componente porque es la misma ruta con otro parámetro. onMounted no vuelve a dispararse, así que la vista seguía mostrando los agentes del tenant anterior. Las tres vistas tenían el mismo problema: TenantAgentes, AgenteDetail y Uso. Ahora reaccionan al parámetro (watch con immediate) en vez de al montaje. En AgenteDetail se limpia el estado antes de pedir los datos nuevos: si no, durante la carga se ven los documentos, canales y conversaciones del agente anterior bajo el nombre del nuevo, que es peor que una pantalla vacía. Verificado navegando de verdad entre dos tenants con agentes distintos: la lista pasa de "Ventas T2" a "Soporte T3 / Cobros T3". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
27 lines
141 KiB
JavaScript
27 lines
141 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 Gs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ge={},Jt=[],ht=()=>{},cr=()=>!1,es=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ts=e=>e.startsWith("onUpdate:"),Ne=Object.assign,qs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Mi=Object.prototype.hasOwnProperty,he=(e,t)=>Mi.call(e,t),Y=Array.isArray,Yt=e=>Tn(e)==="[object Map]",an=e=>Tn(e)==="[object Set]",mo=e=>Tn(e)==="[object Date]",ee=e=>typeof e=="function",Ce=e=>typeof e=="string",nt=e=>typeof e=="symbol",me=e=>e!==null&&typeof e=="object",fr=e=>(me(e)||ee(e))&&ee(e.then)&&ee(e.catch),dr=Object.prototype.toString,Tn=e=>dr.call(e),Vi=e=>Tn(e).slice(8,-1),pr=e=>Tn(e)==="[object Object]",Ws=e=>Ce(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,gn=Gs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ns=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ji=/-\w/g,Fe=ns(e=>e.replace(ji,t=>t.slice(1).toUpperCase())),Ui=/\B([A-Z])/g,Gt=ns(e=>e.replace(Ui,"-$1").toLowerCase()),ss=ns(e=>e.charAt(0).toUpperCase()+e.slice(1)),gs=ns(e=>e?`on${ss(e)}`:""),dt=(e,t)=>!Object.is(e,t),Hn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},hr=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},os=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let go;const rs=()=>go||(go=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Kt(e){if(Y(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Ce(s)?Bi(s):Kt(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(Ce(e)||me(e))return e}const Li=/;(?![^(]*\))/g,Fi=/:([^]+)/,Hi=/\/\*[^]*?\*\//g;function Bi(e){const t={};return e.replace(Hi,"").split(Li).forEach(n=>{if(n){const s=n.split(Fi);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ie(e){let t="";if(Ce(e))t=e;else if(Y(e))for(let n=0;n<e.length;n++){const s=Ie(e[n]);s&&(t+=s+" ")}else if(me(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ki="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Gi=Gs(Ki);function mr(e){return!!e||e===""}function qi(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=un(e[s],t[s]);return n}function un(e,t){if(e===t)return!0;let n=mo(e),s=mo(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=nt(e),s=nt(t),n||s)return e===t;if(n=Y(e),s=Y(t),n||s)return n&&s?qi(e,t):!1;if(n=me(e),s=me(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const i in e){const l=e.hasOwnProperty(i),a=t.hasOwnProperty(i);if(l&&!a||!l&&a||!un(e[i],t[i]))return!1}}return String(e)===String(t)}function zs(e,t){return e.findIndex(n=>un(n,t))}const gr=e=>!!(e&&e.__v_isRef===!0),D=e=>Ce(e)?e:e==null?"":Y(e)||me(e)&&(e.toString===dr||!ee(e.toString))?gr(e)?D(e.value):JSON.stringify(e,vr,2):String(e),vr=(e,t)=>gr(t)?vr(e,t.value):Yt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[vs(s,r)+" =>"]=o,n),{})}:an(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>vs(n))}:nt(t)?vs(t):me(t)&&!Y(t)&&!pr(t)?String(t):t,vs=(e,t="")=>{var n;return nt(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 Pe;class Wi{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&&Pe&&(Pe.active?(this.parent=Pe,this.index=(Pe.scopes||(Pe.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=Pe;try{return Pe=this,t()}finally{Pe=n}}}on(){++this._on===1&&(this.prevScope=Pe,Pe=this)}off(){if(this._on>0&&--this._on===0){if(Pe===this)Pe=this.prevScope;else{let t=Pe;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 zi(){return Pe}let ve;const bs=new WeakSet;class br{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,Pe&&(Pe.active?Pe.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,bs.has(this)&&(bs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||xr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vo(this),yr(this);const t=ve,n=et;ve=this,et=!0;try{return this.fn()}finally{wr(this),ve=t,et=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Qs(t);this.deps=this.depsTail=void 0,vo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?bs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ps(this)&&this.run()}get dirty(){return Ps(this)}}let _r=0,vn,bn;function xr(e,t=!1){if(e.flags|=8,t){e.next=bn,bn=e;return}e.next=vn,vn=e}function Js(){_r++}function Ys(){if(--_r>0)return;if(bn){let t=bn;for(bn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;vn;){let t=vn;for(vn=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 yr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function wr(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Qs(s),Ji(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Ps(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Cr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Cr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===wn)||(e.globalVersion=wn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ps(e))))return;e.flags|=2;const t=e.dep,n=ve,s=et;ve=e,et=!0;try{yr(e);const o=e.fn(e._value);(t.version===0||dt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ve=n,et=s,wr(e),e.flags&=-3}}function Qs(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)Qs(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ji(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let et=!0;const Er=[];function Et(){Er.push(et),et=!1}function St(){const e=Er.pop();et=e===void 0?!0:e}function vo(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ve;ve=void 0;try{t()}finally{ve=n}}}let wn=0;class Yi{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 Xs{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(!ve||!et||ve===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ve)n=this.activeLink=new Yi(ve,this),ve.deps?(n.prevDep=ve.depsTail,ve.depsTail.nextDep=n,ve.depsTail=n):ve.deps=ve.depsTail=n,Sr(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=ve.depsTail,n.nextDep=void 0,ve.depsTail.nextDep=n,ve.depsTail=n,ve.deps===n&&(ve.deps=s)}return n}trigger(t){this.version++,wn++,this.notify(t)}notify(t){Js();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ys()}}}function Sr(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)Sr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ts=new WeakMap,Ft=Symbol(""),$s=Symbol(""),Cn=Symbol("");function De(e,t,n){if(et&&ve){let s=Ts.get(e);s||Ts.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Xs),o.map=s,o.key=n),o.track()}}function yt(e,t,n,s,o,r){const i=Ts.get(e);if(!i){wn++;return}const l=a=>{a&&a.trigger()};if(Js(),t==="clear")i.forEach(l);else{const a=Y(e),d=a&&Ws(n);if(a&&n==="length"){const c=Number(s);i.forEach((h,g)=>{(g==="length"||g===Cn||!nt(g)&&g>=c)&&l(h)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(Cn)),t){case"add":a?d&&l(i.get("length")):(l(i.get(Ft)),Yt(e)&&l(i.get($s)));break;case"delete":a||(l(i.get(Ft)),Yt(e)&&l(i.get($s)));break;case"set":Yt(e)&&l(i.get(Ft));break}}Ys()}function qt(e){const t=pe(e);return t===e?t:(De(t,"iterate",Cn),Qe(e)?t:t.map(st))}function is(e){return De(e=pe(e),"iterate",Cn),e}function ct(e,t){return At(e)?tn(Ht(e)?st(t):t):st(t)}const Qi={__proto__:null,[Symbol.iterator](){return _s(this,Symbol.iterator,e=>ct(this,e))},concat(...e){return qt(this).concat(...e.map(t=>Y(t)?qt(t):t))},entries(){return _s(this,"entries",e=>(e[1]=ct(this,e[1]),e))},every(e,t){return vt(this,"every",e,t,void 0,arguments)},filter(e,t){return vt(this,"filter",e,t,n=>n.map(s=>ct(this,s)),arguments)},find(e,t){return vt(this,"find",e,t,n=>ct(this,n),arguments)},findIndex(e,t){return vt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return vt(this,"findLast",e,t,n=>ct(this,n),arguments)},findLastIndex(e,t){return vt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return vt(this,"forEach",e,t,void 0,arguments)},includes(...e){return xs(this,"includes",e)},indexOf(...e){return xs(this,"indexOf",e)},join(e){return qt(this).join(e)},lastIndexOf(...e){return xs(this,"lastIndexOf",e)},map(e,t){return vt(this,"map",e,t,void 0,arguments)},pop(){return fn(this,"pop")},push(...e){return fn(this,"push",e)},reduce(e,...t){return bo(this,"reduce",e,t)},reduceRight(e,...t){return bo(this,"reduceRight",e,t)},shift(){return fn(this,"shift")},some(e,t){return vt(this,"some",e,t,void 0,arguments)},splice(...e){return fn(this,"splice",e)},toReversed(){return qt(this).toReversed()},toSorted(e){return qt(this).toSorted(e)},toSpliced(...e){return qt(this).toSpliced(...e)},unshift(...e){return fn(this,"unshift",e)},values(){return _s(this,"values",e=>ct(this,e))}};function _s(e,t,n){const s=is(e),o=s[t]();return s!==e&&!Qe(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const Xi=Array.prototype;function vt(e,t,n,s,o,r){const i=is(e),l=i!==e&&!Qe(e),a=i[t];if(a!==Xi[t]){const h=a.apply(e,r);return l?st(h):h}let d=n;i!==e&&(l?d=function(h,g){return n.call(this,ct(e,h),g,e)}:n.length>2&&(d=function(h,g){return n.call(this,h,g,e)}));const c=a.call(i,d,s);return l&&o?o(c):c}function bo(e,t,n,s){const o=is(e),r=o!==e&&!Qe(e);let i=n,l=!1;o!==e&&(r?(l=s.length===0,i=function(d,c,h){return l&&(l=!1,d=ct(e,d)),n.call(this,d,ct(e,c),h,e)}):n.length>3&&(i=function(d,c,h){return n.call(this,d,c,h,e)}));const a=o[t](i,...s);return l?ct(e,a):a}function xs(e,t,n){const s=pe(e);De(s,"iterate",Cn);const o=s[t](...n);return(o===-1||o===!1)&&to(n[0])?(n[0]=pe(n[0]),s[t](...n)):o}function fn(e,t,n=[]){Et(),Js();const s=pe(e)[t].apply(e,n);return Ys(),St(),s}const Zi=Gs("__proto__,__v_isRef,__isVue"),Ar=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(nt));function el(e){nt(e)||(e=String(e));const t=pe(this);return De(t,"has",e),t.hasOwnProperty(e)}class Rr{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?cl:Pr:r?Or:Ir).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=Y(t);if(!o){let a;if(i&&(a=Qi[n]))return a;if(n==="hasOwnProperty")return el}const l=Reflect.get(t,n,Ve(t)?t:s);if((nt(n)?Ar.has(n):Zi(n))||(o||De(t,"get",n),r))return l;if(Ve(l)){const a=i&&Ws(n)?l:l.value;return o&&me(a)?Ds(a):a}return me(l)?o?Ds(l):ls(l):l}}class kr extends Rr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const i=Y(t)&&Ws(n);if(!this._isShallow){const d=At(r);if(!Qe(s)&&!At(s)&&(r=pe(r),s=pe(s)),!i&&Ve(r)&&!Ve(s))return d||(r.value=s),!0}const l=i?Number(n)<t.length:he(t,n),a=Reflect.set(t,n,s,Ve(t)?t:o);return t===pe(o)&&a&&(l?dt(s,r)&&yt(t,"set",n,s):yt(t,"add",n,s)),a}deleteProperty(t,n){const s=he(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&yt(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!nt(n)||!Ar.has(n))&&De(t,"has",n),s}ownKeys(t){return De(t,"iterate",Y(t)?"length":Ft),Reflect.ownKeys(t)}}class tl extends Rr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const nl=new kr,sl=new tl,ol=new kr(!0);const Ns=e=>e,Mn=e=>Reflect.getPrototypeOf(e);function rl(e,t,n){return function(...s){const o=this.__v_raw,r=pe(o),i=Yt(r),l=e==="entries"||e===Symbol.iterator&&i,a=e==="keys"&&i,d=o[e](...s),c=n?Ns:t?tn:st;return!t&&De(r,"iterate",a?$s:Ft),Ne(Object.create(d),{next(){const{value:h,done:g}=d.next();return g?{value:h,done:g}:{value:l?[c(h[0]),c(h[1])]:c(h),done:g}}})}}function Vn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function il(e,t){const n={get(o){const r=this.__v_raw,i=pe(r),l=pe(o);e||(dt(o,l)&&De(i,"get",o),De(i,"get",l));const{has:a}=Mn(i),d=t?Ns:e?tn:st;if(a.call(i,o))return d(r.get(o));if(a.call(i,l))return d(r.get(l));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&De(pe(o),"iterate",Ft),o.size},has(o){const r=this.__v_raw,i=pe(r),l=pe(o);return e||(dt(o,l)&&De(i,"has",o),De(i,"has",l)),o===l?r.has(o):r.has(o)||r.has(l)},forEach(o,r){const i=this,l=i.__v_raw,a=pe(l),d=t?Ns:e?tn:st;return!e&&De(a,"iterate",Ft),l.forEach((c,h)=>o.call(r,d(c),d(h),i))}};return Ne(n,e?{add:Vn("add"),set:Vn("set"),delete:Vn("delete"),clear:Vn("clear")}:{add(o){const r=pe(this),i=Mn(r),l=pe(o),a=!t&&!Qe(o)&&!At(o)?l:o;return i.has.call(r,a)||dt(o,a)&&i.has.call(r,o)||dt(l,a)&&i.has.call(r,l)||(r.add(a),yt(r,"add",a,a)),this},set(o,r){!t&&!Qe(r)&&!At(r)&&(r=pe(r));const i=pe(this),{has:l,get:a}=Mn(i);let d=l.call(i,o);d||(o=pe(o),d=l.call(i,o));const c=a.call(i,o);return i.set(o,r),d?dt(r,c)&&yt(i,"set",o,r):yt(i,"add",o,r),this},delete(o){const r=pe(this),{has:i,get:l}=Mn(r);let a=i.call(r,o);a||(o=pe(o),a=i.call(r,o)),l&&l.call(r,o);const d=r.delete(o);return a&&yt(r,"delete",o,void 0),d},clear(){const o=pe(this),r=o.size!==0,i=o.clear();return r&&yt(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=rl(o,e,t)}),n}function Zs(e,t){const n=il(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(he(n,o)&&o in s?n:s,o,r)}const ll={get:Zs(!1,!1)},al={get:Zs(!1,!0)},ul={get:Zs(!0,!1)};const Ir=new WeakMap,Or=new WeakMap,Pr=new WeakMap,cl=new WeakMap;function fl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ls(e){return At(e)?e:eo(e,!1,nl,ll,Ir)}function Tr(e){return eo(e,!1,ol,al,Or)}function Ds(e){return eo(e,!0,sl,ul,Pr)}function eo(e,t,n,s,o){if(!me(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=fl(Vi(e));if(i===0)return e;const l=new Proxy(e,i===2?s:n);return o.set(e,l),l}function Ht(e){return At(e)?Ht(e.__v_raw):!!(e&&e.__v_isReactive)}function At(e){return!!(e&&e.__v_isReadonly)}function Qe(e){return!!(e&&e.__v_isShallow)}function to(e){return e?!!e.__v_raw:!1}function pe(e){const t=e&&e.__v_raw;return t?pe(t):e}function dl(e){return!he(e,"__v_skip")&&Object.isExtensible(e)&&hr(e,"__v_skip",!0),e}const st=e=>me(e)?ls(e):e,tn=e=>me(e)?Ds(e):e;function Ve(e){return e?e.__v_isRef===!0:!1}function X(e){return $r(e,!1)}function pl(e){return $r(e,!0)}function $r(e,t){return Ve(e)?e:new hl(e,t)}class hl{constructor(t,n){this.dep=new Xs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:pe(t),this._value=n?t:st(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Qe(t)||At(t);t=s?t:pe(t),dt(t,n)&&(this._rawValue=t,this._value=s?t:st(t),this.dep.trigger())}}function Te(e){return Ve(e)?e.value:e}const ml={get:(e,t,n)=>t==="__v_raw"?e:Te(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Ve(o)&&!Ve(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Nr(e){return Ht(e)?e:new Proxy(e,ml)}class gl{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Xs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=wn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ve!==this)return xr(this,!0),!0}get value(){const t=this.dep.track();return Cr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function vl(e,t,n=!1){let s,o;return ee(e)?s=e:(s=e.get,o=e.set),new gl(s,o,n)}const jn={},qn=new WeakMap;let jt;function bl(e,t=!1,n=jt){if(n){let s=qn.get(n);s||qn.set(n,s=[]),s.push(e)}}function _l(e,t,n=ge){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:l,call:a}=n,d=O=>o?O:Qe(O)||o===!1||o===0?wt(O,1):wt(O);let c,h,g,b,U=!1,P=!1;if(Ve(e)?(h=()=>e.value,U=Qe(e)):Ht(e)?(h=()=>d(e),U=!0):Y(e)?(P=!0,U=e.some(O=>Ht(O)||Qe(O)),h=()=>e.map(O=>{if(Ve(O))return O.value;if(Ht(O))return d(O);if(ee(O))return a?a(O,2):O()})):ee(e)?t?h=a?()=>a(e,2):e:h=()=>{if(g){Et();try{g()}finally{St()}}const O=jt;jt=c;try{return a?a(e,3,[b]):e(b)}finally{jt=O}}:h=ht,t&&o){const O=h,S=o===!0?1/0:o;h=()=>wt(O(),S)}const G=zi(),H=()=>{c.stop(),G&&G.active&&qs(G.effects,c)};if(r&&t){const O=t;t=(...S)=>{const M=O(...S);return H(),M}}let N=P?new Array(e.length).fill(jn):jn;const B=O=>{if(!(!(c.flags&1)||!c.dirty&&!O))if(t){const S=c.run();if(O||o||U||(P?S.some((M,Z)=>dt(M,N[Z])):dt(S,N))){g&&g();const M=jt;jt=c;try{const Z=[S,N===jn?void 0:P&&N[0]===jn?[]:N,b];N=S,a?a(t,3,Z):t(...Z)}finally{jt=M}}}else c.run()};return l&&l(B),c=new br(h),c.scheduler=i?()=>i(B,!1):B,b=O=>bl(O,!1,c),g=c.onStop=()=>{const O=qn.get(c);if(O){if(a)a(O,4);else for(const S of O)S();qn.delete(c)}},t?s?B(!0):N=c.run():i?i(B.bind(null,!0),!0):c.run(),H.pause=c.pause.bind(c),H.resume=c.resume.bind(c),H.stop=H,H}function wt(e,t=1/0,n){if(t<=0||!me(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ve(e))wt(e.value,t,n);else if(Y(e))for(let s=0;s<e.length;s++)wt(e[s],t,n);else if(an(e)||Yt(e))e.forEach(s=>{wt(s,t,n)});else if(pr(e)){for(const s in e)wt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&wt(e[s],t,n)}return e}/**
|
|
* @vue/runtime-core v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/function $n(e,t,n,s){try{return s?e(...s):e()}catch(o){as(o,t,n)}}function ot(e,t,n,s){if(ee(e)){const o=$n(e,t,n,s);return o&&fr(o)&&o.catch(r=>{as(r,t,n)}),o}if(Y(e)){const o=[];for(let r=0;r<e.length;r++)o.push(ot(e[r],t,n,s));return o}}function as(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ge;if(t){let l=t.parent;const a=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let h=0;h<c.length;h++)if(c[h](e,a,d)===!1)return}l=l.parent}if(r){Et(),$n(r,null,10,[e,a,d]),St();return}}xl(e,n,o,s,i)}function xl(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Le=[];let ut=-1;const Qt=[];let Pt=null,Wt=0;const Dr=Promise.resolve();let Wn=null;function no(e){const t=Wn||Dr;return e?t.then(this?e.bind(this):e):t}function yl(e){let t=ut+1,n=Le.length;for(;t<n;){const s=t+n>>>1,o=Le[s],r=En(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function so(e){if(!(e.flags&1)){const t=En(e),n=Le[Le.length-1];!n||!(e.flags&2)&&t>=En(n)?Le.push(e):Le.splice(yl(t),0,e),e.flags|=1,Mr()}}function Mr(){Wn||(Wn=Dr.then(jr))}function wl(e){if(!Y(e))Pt&&e.id===-1?Pt.splice(Wt+1,0,e):e.flags&1||(Qt.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Qt.push(e[t]);Mr()}function _o(e,t,n=ut+1){for(;n<Le.length;n++){const s=Le[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Le.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Vr(e){if(Qt.length){const t=[...new Set(Qt)].sort((n,s)=>En(n)-En(s));if(Qt.length=0,Pt){for(let n=0;n<t.length;n++)Pt.push(t[n]);return}for(Pt=t,Wt=0;Wt<Pt.length;Wt++){const n=Pt[Wt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Pt=null,Wt=0}}const En=e=>e.id==null?e.flags&2?-1:1/0:e.id;function jr(e){try{for(ut=0;ut<Le.length;ut++){const t=Le[ut];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),$n(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ut<Le.length;ut++){const t=Le[ut];t&&(t.flags&=-2)}ut=-1,Le.length=0,Vr(),Wn=null,(Le.length||Qt.length)&&jr()}}let $e=null,Ur=null;function zn(e){const t=$e;return $e=e,Ur=e&&e.type.__scopeId||null,t}function Nt(e,t=$e,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Qn(-1);const r=zn(t),i=Ct.length;let l;try{l=e(...o)}finally{for(let a=Ct.length;a>i;a--)ao();zn(r),s._d&&Qn(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function re(e,t){if($e===null)return e;const n=ps($e),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,i,l,a=ge]=t[o];r&&(ee(r)&&(r={mounted:r,updated:r}),r.deep&&wt(i),s.push({dir:r,instance:n,value:i,oldValue:void 0,arg:l,modifiers:a}))}return e}function Mt(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let i=0;i<o.length;i++){const l=o[i];r&&(l.oldValue=r[i].value);let a=l.dir[s];a&&(Et(),ot(a,n,8,[e.el,l,e,t]),St())}}function Bn(e,t){if(Me){let n=Me.provides;const s=Me.parent&&Me.parent.provides;s===n&&(n=Me.provides=Object.create(s)),n[e]=t}}function tt(e,t,n=!1){const s=wa();if(s||Zt){let o=Zt?Zt._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&&ee(t)?t.call(s&&s.proxy):t}}const Cl=Symbol.for("v-scx"),El=()=>tt(Cl);function Bt(e,t,n){return Lr(e,t,n)}function Lr(e,t,n=ge){const{immediate:s,deep:o,flush:r,once:i}=n,l=Ne({},n),a=t&&s||!t&&r!=="post";let d;if(kn){if(r==="sync"){const b=El();d=b.__watcherHandles||(b.__watcherHandles=[])}else if(!a){const b=()=>{};return b.stop=ht,b.resume=ht,b.pause=ht,b}}const c=Me;l.call=(b,U,P)=>ot(b,c,U,P);let h=!1;r==="post"?l.scheduler=b=>{Ke(b,c&&c.suspense)}:r!=="sync"&&(h=!0,l.scheduler=(b,U)=>{U?b():so(b)}),l.augmentJob=b=>{t&&(b.flags|=4),h&&(b.flags|=2,c&&(b.id=c.uid,b.i=c))};const g=_l(e,t,l);return kn&&(d?d.push(g):a&&g()),g}function Sl(e,t,n){const s=this.proxy,o=Ce(e)?e.includes(".")?Fr(s,e):()=>s[e]:e.bind(s,s);let r;ee(t)?r=t:(r=t.handler,n=t);const i=Dn(this),l=Lr(o,r.bind(s),n);return i(),l}function Fr(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 Al=Symbol("_vte"),us=e=>e.__isTeleport,ys=Symbol("_leaveCb");function Rl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==mt){t=n;break}}return t}function Hr(e){if(!ro(e))return us(e.type)&&e.children?Rl(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&&ee(n.default))return n.default()}}function oo(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;oo(us(n.type)&&Hr(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 Br(e,t){return ee(e)?Ne({name:e.name},t,{setup:e}):e}function Kr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function xo(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Jn=new WeakMap;function _n(e,t,n,s,o=!1){if(Y(e)){e.forEach((P,G)=>_n(P,t&&(Y(t)?t[G]:t),n,s,o));return}if(Xt(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&_n(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?ps(s.component):s.el,i=o?null:r,{i:l,r:a}=e,d=t&&t.r,c=l.refs===ge?l.refs={}:l.refs,h=l.setupState,g=pe(h),b=h===ge?cr:P=>xo(c,P)?!1:he(g,P),U=(P,G)=>!(G&&xo(c,G));if(d!=null&&d!==a){if(yo(t),Ce(d))c[d]=null,b(d)&&(h[d]=null);else if(Ve(d)){const P=t;U(d,P.k)&&(d.value=null),P.k&&(c[P.k]=null)}}if(ee(a))$n(a,l,12,[i,c]);else{const P=Ce(a),G=Ve(a);if(P||G){const H=()=>{if(e.f){const N=P?b(a)?h[a]:c[a]:U()||!e.k?a.value:c[e.k];if(o)Y(N)&&qs(N,r);else if(Y(N))N.includes(r)||N.push(r);else if(P)c[a]=[r],b(a)&&(h[a]=c[a]);else{const B=[r];U(a,e.k)&&(a.value=B),e.k&&(c[e.k]=B)}}else P?(c[a]=i,b(a)&&(h[a]=i)):G&&(U(a,e.k)&&(a.value=i),e.k&&(c[e.k]=i))};if(i){const N=()=>{H(),Jn.delete(e)};N.id=-1,Jn.set(e,N),Ke(N,n)}else yo(e),H()}}}function yo(e){const t=Jn.get(e);t&&(t.flags|=8,Jn.delete(e))}rs().requestIdleCallback;rs().cancelIdleCallback;const Xt=e=>!!e.type.__asyncLoader,ro=e=>e.type.__isKeepAlive;function kl(e,t){Gr(e,"a",t)}function Il(e,t){Gr(e,"da",t)}function Gr(e,t,n=Me){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(cs(t,s,n),n){let o=n.parent;for(;o&&o.parent;)ro(o.parent.vnode)&&Ol(s,t,n,o),o=o.parent}}function Ol(e,t,n,s){const o=cs(t,e,s,!0);Wr(()=>{qs(s[t],o)},n)}function cs(e,t,n=Me,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{Et();const l=Dn(n),a=ot(t,n,e,i);return l(),St(),a});return s?o.unshift(r):o.push(r),r}}const Rt=e=>(t,n=Me)=>{(!kn||e==="sp")&&cs(e,(...s)=>t(...s),n)},Pl=Rt("bm"),qr=Rt("m"),Tl=Rt("bu"),$l=Rt("u"),Nl=Rt("bum"),Wr=Rt("um"),Dl=Rt("sp"),Ml=Rt("rtg"),Vl=Rt("rtc");function jl(e,t=Me){cs("ec",e,t)}const Ul="components";function Nn(e,t){return Fl(Ul,e,!0,t)||e}const Ll=Symbol.for("v-ndc");function Fl(e,t,n=!0,s=!1){const o=$e||Me;if(o){const r=o.type;{const l=Ra(r,!1);if(l&&(l===t||l===Fe(t)||l===ss(Fe(t))))return r}const i=wo(o[e]||r[e],t)||wo(o.appContext[e],t);return!i&&s?r:i}}function wo(e,t){return e&&(e[t]||e[Fe(t)]||e[ss(Fe(t))])}function ke(e,t,n,s){let o;const r=n,i=Y(e);if(i||Ce(e)){const l=i&&Ht(e);let a=!1,d=!1;l&&(a=!Qe(e),d=At(e),e=is(e)),o=new Array(e.length);for(let c=0,h=e.length;c<h;c++)o[c]=t(a?d?tn(st(e[c])):st(e[c]):e[c],c,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,r)}else if(me(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,r));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,d=l.length;a<d;a++){const c=l[a];o[a]=t(e[c],c,a,r)}}else o=[];return o}function Hl(e,t,n,s,o,r){if(n==null&&(n={}),$e.ce||$e.parent&&Xt($e.parent)&&$e.parent.ce){const d=n,c=Object.keys(d).length>0;return k(),nn(ce,null,[we("slot",d,s)],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=Ct.length;k();let a;try{const d=i&&zr(i(n)),c=n.key||r||d&&d.key;a=nn(ce,{key:(c&&!nt(c)?c:`_${t}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&e._===1?64:-2)}catch(d){for(let c=Ct.length;c>l;c--)ao();throw d}finally{i&&i._c&&(i._d=!0)}return a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),a}function zr(e){return e.some(t=>An(t)?!(t.type===mt||t.type===ce&&!zr(t.children)):!0)?e:null}const Ms=e=>e?hi(e)?ps(e):Ms(e.parent):null,xn=Ne(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ms(e.parent),$root:e=>Ms(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Yr(e),$forceUpdate:e=>e.f||(e.f=()=>{so(e.update)}),$nextTick:e=>e.n||(e.n=no.bind(e.proxy)),$watch:e=>Sl.bind(e)}),ws=(e,t)=>e!==ge&&!e.__isScriptSetup&&he(e,t),Bl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:l,appContext:a}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(ws(s,t))return i[t]=1,s[t];if(o!==ge&&he(o,t))return i[t]=2,o[t];if(he(r,t))return i[t]=3,r[t];if(n!==ge&&he(n,t))return i[t]=4,n[t];Vs&&(i[t]=0)}}const d=xn[t];let c,h;if(d)return t==="$attrs"&&De(e.attrs,"get",""),d(e);if((c=l.__cssModules)&&(c=c[t]))return c;if(n!==ge&&he(n,t))return i[t]=4,n[t];if(h=a.config.globalProperties,he(h,t))return h[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return ws(o,t)?(o[t]=n,!0):s!==ge&&he(s,t)?(s[t]=n,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:i}},l){let a;return!!(n[l]||e!==ge&&l[0]!=="$"&&he(e,l)||ws(t,l)||he(r,l)||he(s,l)||he(xn,l)||he(o.config.globalProperties,l)||(a=i.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:he(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Co(e){return Y(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Vs=!0;function Kl(e){const t=Yr(e),n=e.proxy,s=e.ctx;Vs=!1,t.beforeCreate&&Eo(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:i,watch:l,provide:a,inject:d,created:c,beforeMount:h,mounted:g,beforeUpdate:b,updated:U,activated:P,deactivated:G,beforeDestroy:H,beforeUnmount:N,destroyed:B,unmounted:O,render:S,renderTracked:M,renderTriggered:Z,errorCaptured:x,serverPrefetch:j,expose:Ae,inheritAttrs:J,components:Xe,directives:ze,filters:Dt}=t;if(d&&Gl(d,s,null),i)for(const ie in i){const se=i[ie];ee(se)&&(s[ie]=se.bind(n))}if(o){const ie=o.call(n,n);me(ie)&&(e.data=ls(ie))}if(Vs=!0,r)for(const ie in r){const se=r[ie],ne=ee(se)?se.bind(n,n):ee(se.get)?se.get.bind(n,n):ht,Ge=!ee(se)&&ee(se.set)?se.set.bind(n):ht,Je=be({get:ne,set:Ge});Object.defineProperty(s,ie,{enumerable:!0,configurable:!0,get:()=>Je.value,set:Oe=>Je.value=Oe})}if(l)for(const ie in l)Jr(l[ie],s,n,ie);if(a){const ie=ee(a)?a.call(n):a;Reflect.ownKeys(ie).forEach(se=>{Bn(se,ie[se])})}c&&Eo(c,e,"c");function Ee(ie,se){Y(se)?se.forEach(ne=>ie(ne.bind(n))):se&&ie(se.bind(n))}if(Ee(Pl,h),Ee(qr,g),Ee(Tl,b),Ee($l,U),Ee(kl,P),Ee(Il,G),Ee(jl,x),Ee(Vl,M),Ee(Ml,Z),Ee(Nl,N),Ee(Wr,O),Ee(Dl,j),Y(Ae))if(Ae.length){const ie=e.exposed||(e.exposed={});Ae.forEach(se=>{Object.defineProperty(ie,se,{get:()=>n[se],set:ne=>n[se]=ne,enumerable:!0})})}else e.exposed||(e.exposed={});S&&e.render===ht&&(e.render=S),J!=null&&(e.inheritAttrs=J),Xe&&(e.components=Xe),ze&&(e.directives=ze),j&&Kr(e)}function Gl(e,t,n=ht){Y(e)&&(e=js(e));for(const s in e){const o=e[s];let r;me(o)?"default"in o?r=tt(o.from||s,o.default,!0):r=tt(o.from||s):r=tt(o),Ve(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[s]=r}}function Eo(e,t,n){ot(Y(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Jr(e,t,n,s){let o=s.includes(".")?Fr(n,s):()=>n[s];if(Ce(e)){const r=t[e];ee(r)&&Bt(o,r)}else if(ee(e))Bt(o,e.bind(n));else if(me(e))if(Y(e))e.forEach(r=>Jr(r,t,n,s));else{const r=ee(e.handler)?e.handler.bind(n):t[e.handler];ee(r)&&Bt(o,r,e)}}function Yr(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,l=r.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(d=>Yn(a,d,i,!0)),Yn(a,t,i)),me(t)&&r.set(t,a),a}function Yn(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&Yn(e,r,n,!0),o&&o.forEach(i=>Yn(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=ql[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const ql={data:So,props:Ao,emits:Ao,methods:hn,computed:hn,beforeCreate:je,created:je,beforeMount:je,mounted:je,beforeUpdate:je,updated:je,beforeDestroy:je,beforeUnmount:je,destroyed:je,unmounted:je,activated:je,deactivated:je,errorCaptured:je,serverPrefetch:je,components:hn,directives:hn,watch:zl,provide:So,inject:Wl};function So(e,t){return t?e?function(){return Ne(ee(e)?e.call(this,this):e,ee(t)?t.call(this,this):t)}:t:e}function Wl(e,t){return hn(js(e),js(t))}function js(e){if(Y(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function je(e,t){return e?[...new Set([].concat(e,t))]:t}function hn(e,t){return e?Ne(Object.create(null),e,t):t}function Ao(e,t){return e?Y(e)&&Y(t)?[...new Set([...e,...t])]:Ne(Object.create(null),Co(e),Co(t??{})):t}function zl(e,t){if(!e)return t;if(!t)return e;const n=Ne(Object.create(null),e);for(const s in t)n[s]=je(e[s],t[s]);return n}function Qr(){return{app:null,config:{isNativeTag:cr,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 Jl=0;function Yl(e,t){return function(s,o=null){ee(s)||(s=Ne({},s)),o!=null&&!me(o)&&(o=null);const r=Qr(),i=new WeakSet,l=[];let a=!1;const d=r.app={_uid:Jl++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:Ia,get config(){return r.config},set config(c){},use(c,...h){return i.has(c)||(c&&ee(c.install)?(i.add(c),c.install(d,...h)):ee(c)&&(i.add(c),c(d,...h))),d},mixin(c){return r.mixins.includes(c)||r.mixins.push(c),d},component(c,h){return h?(r.components[c]=h,d):r.components[c]},directive(c,h){return h?(r.directives[c]=h,d):r.directives[c]},mount(c,h,g){if(!a){const b=d._ceVNode||we(s,o);return b.appContext=r,g===!0?g="svg":g===!1&&(g=void 0),e(b,c,g),a=!0,d._container=c,c.__vue_app__=d,ps(b.component)}},onUnmount(c){l.push(c)},unmount(){a&&(ot(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,h){return r.provides[c]=h,d},runWithContext(c){const h=Zt;Zt=d;try{return c()}finally{Zt=h}}};return d}}let Zt=null;const Ql=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Fe(t)}Modifiers`]||e[`${Gt(t)}Modifiers`];function Xl(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ge;let o=n;const r=t.startsWith("update:"),i=r&&Ql(s,t.slice(7));i&&(i.trim&&(o=n.map(c=>Ce(c)?c.trim():c)),i.number&&(o=n.map(os)));let l,a=s[l=gs(t)]||s[l=gs(Fe(t))];!a&&r&&(a=s[l=gs(Gt(t))]),a&&ot(a,e,6,o);const d=s[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ot(d,e,6,o)}}const Zl=new WeakMap;function Xr(e,t,n=!1){const s=n?Zl:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let i={},l=!1;if(!ee(e)){const a=d=>{const c=Xr(d,t,!0);c&&(l=!0,Ne(i,c))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!l?(me(e)&&s.set(e,null),null):(Y(r)?r.forEach(a=>i[a]=null):Ne(i,r),me(e)&&s.set(e,i),i)}function fs(e,t){return!e||!es(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,Gt(t))||he(e,t))}function Ro(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:l,emit:a,render:d,renderCache:c,props:h,data:g,setupState:b,ctx:U,inheritAttrs:P}=e,G=zn(e);let H,N;try{if(n.shapeFlag&4){const O=o||s,S=O;H=ft(d.call(S,O,c,h,b,g,U)),N=l}else{const O=t;H=ft(O.length>1?O(h,{attrs:l,slots:i,emit:a}):O(h,null)),N=t.props?l:ea(l)}}catch(O){Ct.length=0,as(O,e,1),H=we(mt)}let B=H;if(N&&P!==!1){const O=Object.keys(N),{shapeFlag:S}=B;O.length&&S&7&&(r&&O.some(ts)&&(N=ta(N,r)),B=sn(B,N,!1,!0))}if(n.dirs&&(B=sn(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(n.dirs):n.dirs),n.transition){const O=us(B.type)&&Hr(B)||B;oo(O,n.transition)}return H=B,zn(G),H}const ea=e=>{let t;for(const n in e)(n==="class"||n==="style"||es(n))&&((t||(t={}))[n]=e[n]);return t},ta=(e,t)=>{const n={};for(const s in e)(!ts(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function na(e,t,n){const{props:s,children:o,component:r}=e,{props:i,children:l,patchFlag:a}=t,d=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?ko(s,i,d):!!i;if(a&8){const c=t.dynamicProps;for(let h=0;h<c.length;h++){const g=c[h];if(Zr(i,s,g)&&!fs(d,g))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===i?!1:s?i?ko(s,i,d):!0:!!i;return!1}function ko(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(Zr(t,e,r)&&!fs(n,r))return!0}return!1}function Zr(e,t,n){const s=e[n],o=t[n];return n==="style"&&me(s)&&me(o)?!un(s,o):s!==o}function sa({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 ei={},ti=()=>Object.create(ei),ni=e=>Object.getPrototypeOf(e)===ei;function oa(e,t,n,s=!1){const o={},r=ti();e.propsDefaults=Object.create(null),si(e,t,o,r);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:Tr(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function ra(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:i}}=e,l=pe(o),[a]=e.propsOptions;let d=!1;if((s||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let h=0;h<c.length;h++){let g=c[h];if(fs(e.emitsOptions,g))continue;const b=t[g];if(a)if(he(r,g))b!==r[g]&&(r[g]=b,d=!0);else{const U=Fe(g);o[U]=Us(a,l,U,b,e,!1)}else b!==r[g]&&(r[g]=b,d=!0)}}}else{si(e,t,o,r)&&(d=!0);let c;for(const h in l)(!t||!he(t,h)&&((c=Gt(h))===h||!he(t,c)))&&(a?n&&(n[h]!==void 0||n[c]!==void 0)&&(o[h]=Us(a,l,h,void 0,e,!0)):delete o[h]);if(r!==l)for(const h in r)(!t||!he(t,h))&&(delete r[h],d=!0)}d&&yt(e.attrs,"set","")}function si(e,t,n,s){const[o,r]=e.propsOptions;let i=!1,l;if(t)for(let a in t){if(gn(a))continue;const d=t[a];let c;o&&he(o,c=Fe(a))?!r||!r.includes(c)?n[c]=d:(l||(l={}))[c]=d:fs(e.emitsOptions,a)||(!(a in s)||d!==s[a])&&(s[a]=d,i=!0)}if(r){const a=pe(n),d=l||ge;for(let c=0;c<r.length;c++){const h=r[c];n[h]=Us(o,a,h,d[h],e,!he(d,h))}}return i}function Us(e,t,n,s,o,r){const i=e[n];if(i!=null){const l=he(i,"default");if(l&&s===void 0){const a=i.default;if(i.type!==Function&&!i.skipFactory&&ee(a)){const{propsDefaults:d}=o;if(n in d)s=d[n];else{const c=Dn(o);s=d[n]=a.call(null,t),c()}}else s=a;o.ce&&o.ce._setProp(n,s)}i[0]&&(r&&!l?s=!1:i[1]&&(s===""||s===Gt(n))&&(s=!0))}return s}const ia=new WeakMap;function oi(e,t,n=!1){const s=n?ia:t.propsCache,o=s.get(e);if(o)return o;const r=e.props,i={},l=[];let a=!1;if(!ee(e)){const c=h=>{a=!0;const[g,b]=oi(h,t,!0);Ne(i,g),b&&l.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!a)return me(e)&&s.set(e,Jt),Jt;if(Y(r))for(let c=0;c<r.length;c++){const h=Fe(r[c]);Io(h)&&(i[h]=ge)}else if(r)for(const c in r){const h=Fe(c);if(Io(h)){const g=r[c],b=i[h]=Y(g)||ee(g)?{type:g}:Ne({},g),U=b.type;let P=!1,G=!0;if(Y(U))for(let H=0;H<U.length;++H){const N=U[H],B=ee(N)&&N.name;if(B==="Boolean"){P=!0;break}else B==="String"&&(G=!1)}else P=ee(U)&&U.name==="Boolean";b[0]=P,b[1]=G,(P||he(b,"default"))&&l.push(h)}}const d=[i,l];return me(e)&&s.set(e,d),d}function Io(e){return e[0]!=="$"&&!gn(e)}const io=e=>e==="_"||e==="_ctx"||e==="$stable",lo=e=>Y(e)?e.map(ft):[ft(e)],la=(e,t,n)=>{if(t._n)return t;const s=Nt((...o)=>lo(t(...o)),n);return s._c=!1,s},ri=(e,t,n)=>{const s=e._ctx;for(const o in e){if(io(o))continue;const r=e[o];if(ee(r))t[o]=la(o,r,s);else if(r!=null){const i=lo(r);t[o]=()=>i}}},ii=(e,t)=>{const n=lo(t);e.slots.default=()=>n},li=(e,t,n)=>{for(const s in t)(n||!io(s))&&(e[s]=t[s])},aa=(e,t,n)=>{const s=e.slots=ti();if(e.vnode.shapeFlag&32){const o=t._;o?(li(s,t,n),n&&hr(s,"_",o,!0)):ri(t,s)}else t&&ii(e,t)},ua=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,i=ge;if(s.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:li(o,t,n):(r=!t.$stable,ri(t,o)),i=t}else t&&(ii(e,t),i={default:1});if(r)for(const l in o)!io(l)&&i[l]==null&&delete o[l]},Ke=ha;function ca(e){return fa(e)}function fa(e,t){const n=rs();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:i,createText:l,createComment:a,setText:d,setElementText:c,parentNode:h,nextSibling:g,setScopeId:b=ht,insertStaticContent:U}=e,P=(f,p,m,w=null,A=null,y=null,V=void 0,T=null,$=!!p.dynamicChildren)=>{if(f===p)return;f&&!dn(f,p)&&(w=E(f),Oe(f,A,y,!0),f=null),p.patchFlag===-2&&($=!1,p.dynamicChildren=null);const{type:R,ref:W,shapeFlag:F}=p;switch(R){case ds:G(f,p,m,w);break;case mt:H(f,p,m,w);break;case Kn:f==null&&N(p,m,w,V);break;case ce:Xe(f,p,m,w,A,y,V,T,$);break;default:F&1?S(f,p,m,w,A,y,V,T,$):F&6?ze(f,p,m,w,A,y,V,T,$):(F&64||F&128)&&R.process(f,p,m,w,A,y,V,T,$,q)}W!=null&&A?_n(W,f&&f.ref,y,p||f,!p):W==null&&f&&f.ref!=null&&_n(f.ref,null,y,f,!0)},G=(f,p,m,w)=>{if(f==null)s(p.el=l(p.children),m,w);else{const A=p.el=f.el;p.children!==f.children&&d(A,p.children)}},H=(f,p,m,w)=>{f==null?s(p.el=a(p.children||""),m,w):p.el=f.el},N=(f,p,m,w)=>{[f.el,f.anchor]=U(f.children,p,m,w,f.el,f.anchor)},B=({el:f,anchor:p},m,w)=>{let A;for(;f&&f!==p;)A=g(f),s(f,m,w),f=A;s(p,m,w)},O=({el:f,anchor:p})=>{let m;for(;f&&f!==p;)m=g(f),o(f),f=m;o(p)},S=(f,p,m,w,A,y,V,T,$)=>{if(p.type==="svg"?V="svg":p.type==="math"&&(V="mathml"),f==null)M(p,m,w,A,y,V,T,$);else{const R=f.el&&f.el._isVueCE?f.el:null;try{R&&R._beginPatch(),j(f,p,A,y,V,T,$)}finally{R&&R._endPatch()}}},M=(f,p,m,w,A,y,V,T)=>{let $,R;const{props:W,shapeFlag:F,transition:z,dirs:Q}=f;if($=f.el=i(f.type,y,W&&W.is,W),F&8?c($,f.children):F&16&&x(f.children,$,null,w,A,Cs(f,y),V,T),Q&&Mt(f,null,w,"created"),Z($,f,f.scopeId,V,w),W){for(const v in W)v!=="value"&&!gn(v)&&r($,v,null,W[v],y,w);"value"in W&&r($,"value",null,W.value,y),(R=W.onVnodeBeforeMount)&&at(R,w,f)}Q&&Mt(f,null,w,"beforeMount");const C=da(A,z);C&&z.beforeEnter($),s($,p,m),((R=W&&W.onVnodeMounted)||C||Q)&&Ke(()=>{try{R&&at(R,w,f),C&&z.enter($),Q&&Mt(f,null,w,"mounted")}finally{}},A)},Z=(f,p,m,w,A)=>{if(m&&b(f,m),w)for(let y=0;y<w.length;y++)b(f,w[y]);if(A){let y=A.subTree;if(p===y||fi(y.type)&&(y.ssContent===p||y.ssFallback===p)){const V=A.vnode;Z(f,V,V.scopeId,V.slotScopeIds,A.parent)}}},x=(f,p,m,w,A,y,V,T,$=0)=>{for(let R=$;R<f.length;R++){const W=f[R]=T?xt(f[R]):ft(f[R]);P(null,W,p,m,w,A,y,V,T)}},j=(f,p,m,w,A,y,V)=>{const T=p.el=f.el;let{patchFlag:$,dynamicChildren:R,dirs:W}=p;$|=f.patchFlag&16;const F=f.props||ge,z=p.props||ge;let Q;if(m&&Vt(m,!1),(Q=z.onVnodeBeforeUpdate)&&at(Q,m,p,f),W&&Mt(p,f,m,"beforeUpdate"),m&&Vt(m,!0),R&&(!f.dynamicChildren||f.dynamicChildren.length!==R.length)&&($=0,V=!1,R=null),(F.innerHTML&&z.innerHTML==null||F.textContent&&z.textContent==null)&&c(T,""),R?Ae(f.dynamicChildren,R,T,m,w,Cs(p,A),y):V||se(f,p,T,null,m,w,Cs(p,A),y,!1),$>0){if($&16)J(T,F,z,m,A);else if($&2&&F.class!==z.class&&r(T,"class",null,z.class,A),$&4&&r(T,"style",F.style,z.style,A),$&8){const C=p.dynamicProps;for(let v=0;v<C.length;v++){const fe=C[v],_=F[fe],le=z[fe];(le!==_||fe==="value")&&r(T,fe,_,le,A,m)}}$&1&&f.children!==p.children&&c(T,p.children)}else!V&&R==null&&J(T,F,z,m,A);((Q=z.onVnodeUpdated)||W)&&Ke(()=>{Q&&at(Q,m,p,f),W&&Mt(p,f,m,"updated")},w)},Ae=(f,p,m,w,A,y,V)=>{for(let T=0;T<p.length;T++){const $=f[T],R=p[T],W=$.el&&($.type===ce||!dn($,R)||$.shapeFlag&198)?h($.el):m;P($,R,W,null,w,A,y,V,!0)}},J=(f,p,m,w,A)=>{if(p!==m){if(p!==ge)for(const y in p)!gn(y)&&!(y in m)&&r(f,y,p[y],null,A,w);for(const y in m){if(gn(y))continue;const V=m[y],T=p[y];V!==T&&y!=="value"&&r(f,y,T,V,A,w)}"value"in m&&r(f,"value",p.value,m.value,A)}},Xe=(f,p,m,w,A,y,V,T,$)=>{const R=p.el=f?f.el:l(""),W=p.anchor=f?f.anchor:l("");let{patchFlag:F,dynamicChildren:z,slotScopeIds:Q}=p;Q&&(T=T?T.concat(Q):Q),f==null?(s(R,m,w),s(W,m,w),x(p.children||[],m,W,A,y,V,T,$)):F>0&&F&64&&z&&f.dynamicChildren&&f.dynamicChildren.length===z.length?(Ae(f.dynamicChildren,z,m,A,y,V,T),(p.key!=null||A&&p===A.subTree)&&ai(f,p,!0)):se(f,p,m,W,A,y,V,T,$)},ze=(f,p,m,w,A,y,V,T,$)=>{p.slotScopeIds=T,f==null?p.shapeFlag&512?A.ctx.activate(p,m,w,V,$):Dt(p,m,w,A,y,V,$):kt(f,p,$)},Dt=(f,p,m,w,A,y,V)=>{const T=f.component=ya(f,w,A);if(ro(f)&&(T.ctx.renderer=q),Ca(T,!1,V),T.asyncDep){if(A&&A.registerDep(T,Ee,V),!f.el){const $=T.subTree=we(mt);H(null,$,p,m),f.placeholder=$.el}}else Ee(T,f,p,m,A,y,V)},kt=(f,p,m)=>{const w=p.component=f.component;if(na(f,p,m))if(w.asyncDep&&!w.asyncResolved){ie(w,p,m);return}else w.next=p,w.update();else p.el=f.el,w.vnode=p},Ee=(f,p,m,w,A,y,V)=>{const T=()=>{if(f.isMounted){let{next:F,bu:z,u:Q,parent:C,vnode:v}=f;{const it=ui(f);if(it){F&&(F.el=v.el,ie(f,F,V)),it.asyncDep.then(()=>{Ke(()=>{f.isUnmounted||R()},A)});return}}let fe=F,_;Vt(f,!1),F?(F.el=v.el,ie(f,F,V)):F=v,z&&Hn(z),(_=F.props&&F.props.onVnodeBeforeUpdate)&&at(_,C,F,v),Vt(f,!0);const le=Ro(f),Se=f.subTree;f.subTree=le,P(Se,le,h(Se.el),E(Se),f,A,y),F.el=le.el,fe===null&&sa(f,le.el),Q&&Ke(Q,A),(_=F.props&&F.props.onVnodeUpdated)&&Ke(()=>at(_,C,F,v),A)}else{let F;const{el:z,props:Q}=p,{bm:C,m:v,parent:fe,root:_,type:le}=f,Se=Xt(p);Vt(f,!1),C&&Hn(C),!Se&&(F=Q&&Q.onVnodeBeforeMount)&&at(F,fe,p),Vt(f,!0);{_.ce&&_.ce._hasShadowRoot()&&_.ce._injectChildStyle(le,f.parent?f.parent.type:void 0);const it=f.subTree=Ro(f);P(null,it,m,w,f,A,y),p.el=it.el}if(v&&Ke(v,A),!Se&&(F=Q&&Q.onVnodeMounted)){const it=p;Ke(()=>at(F,fe,it),A)}(p.shapeFlag&256||fe&&Xt(fe.vnode)&&fe.vnode.shapeFlag&256)&&f.a&&Ke(f.a,A),f.isMounted=!0,p=m=w=null}};f.scope.on();const $=f.effect=new br(T);f.scope.off();const R=f.update=$.run.bind($),W=f.job=$.runIfDirty.bind($);W.i=f,W.id=f.uid,$.scheduler=()=>so(W),Vt(f,!0),R()},ie=(f,p,m)=>{p.component=f;const w=f.vnode.props;f.vnode=p,f.next=null,ra(f,p.props,w,m),ua(f,p.children,m),Et(),_o(f),St()},se=(f,p,m,w,A,y,V,T,$=!1)=>{const R=f&&f.children,W=f?f.shapeFlag:0,F=p.children,{patchFlag:z,shapeFlag:Q}=p;if(z>0){if(z&128){Ge(R,F,m,w,A,y,V,T,$);return}else if(z&256){ne(R,F,m,w,A,y,V,T,$);return}}Q&8?(W&16&&Be(R,A,y),F!==R&&c(m,F)):W&16?Q&16?Ge(R,F,m,w,A,y,V,T,$):Be(R,A,y,!0):(W&8&&c(m,""),Q&16&&x(F,m,w,A,y,V,T,$))},ne=(f,p,m,w,A,y,V,T,$)=>{f=f||Jt,p=p||Jt;const R=f.length,W=p.length,F=Math.min(R,W);let z;for(z=0;z<F;z++){const Q=p[z]=$?xt(p[z]):ft(p[z]);P(f[z],Q,m,null,A,y,V,T,$)}R>W?Be(f,A,y,!0,!1,F):x(p,m,w,A,y,V,T,$,F)},Ge=(f,p,m,w,A,y,V,T,$)=>{let R=0;const W=p.length;let F=f.length-1,z=W-1;for(;R<=F&&R<=z;){const Q=f[R],C=p[R]=$?xt(p[R]):ft(p[R]);if(dn(Q,C))P(Q,C,m,null,A,y,V,T,$);else break;R++}for(;R<=F&&R<=z;){const Q=f[F],C=p[z]=$?xt(p[z]):ft(p[z]);if(dn(Q,C))P(Q,C,m,null,A,y,V,T,$);else break;F--,z--}if(R>F){if(R<=z){const Q=z+1,C=Q<W?p[Q].el:w;for(;R<=z;)P(null,p[R]=$?xt(p[R]):ft(p[R]),m,C,A,y,V,T,$),R++}}else if(R>z)for(;R<=F;)Oe(f[R],A,y,!0),R++;else{const Q=R,C=R,v=new Map;for(R=C;R<=z;R++){const qe=p[R]=$?xt(p[R]):ft(p[R]);qe.key!=null&&v.set(qe.key,R)}let fe,_=0;const le=z-C+1;let Se=!1,it=0;const cn=new Array(le);for(R=0;R<le;R++)cn[R]=0;for(R=Q;R<=F;R++){const qe=f[R];if(_>=le){Oe(qe,A,y,!0);continue}let lt;if(qe.key!=null)lt=v.get(qe.key);else for(fe=C;fe<=z;fe++)if(cn[fe-C]===0&&dn(qe,p[fe])){lt=fe;break}lt===void 0?Oe(qe,A,y,!0):(cn[lt-C]=R+1,lt>=it?it=lt:Se=!0,P(qe,p[lt],m,null,A,y,V,T,$),_++)}const fo=Se?pa(cn):Jt;for(fe=fo.length-1,R=le-1;R>=0;R--){const qe=C+R,lt=p[qe],po=p[qe+1],ho=qe+1<W?po.el||ci(po):w;cn[R]===0?P(null,lt,m,ho,A,y,V,T,$):Se&&(fe<0||R!==fo[fe]?Je(lt,m,ho,2):fe--)}}},Je=(f,p,m,w,A=null)=>{const{el:y,type:V,transition:T,children:$,shapeFlag:R}=f;if(R&6){Je(f.component.subTree,p,m,w);return}if(R&128){f.suspense.move(p,m,w);return}if(R&64){V.move(f,p,m,q);return}if(V===ce){s(y,p,m);for(let F=0;F<$.length;F++)Je($[F],p,m,w);s(f.anchor,p,m);return}if(V===Kn){B(f,p,m);return}if(w!==2&&R&1&&T)if(w===0)T.persisted&&!y[ys]?s(y,p,m):(T.beforeEnter(y),s(y,p,m),Ke(()=>T.enter(y),A));else{const{leave:F,delayLeave:z,afterLeave:Q}=T,C=()=>{f.ctx.isUnmounted?o(y):s(y,p,m)},v=()=>{const fe=y._isLeaving||!!y[ys];y._isLeaving&&y[ys](!0),T.persisted&&!fe?C():F(y,()=>{C(),Q&&Q()})};z?z(y,C,v):v()}else s(y,p,m)},Oe=(f,p,m,w=!1,A=!1)=>{const{type:y,props:V,ref:T,children:$,dynamicChildren:R,shapeFlag:W,patchFlag:F,dirs:z,cacheIndex:Q,memo:C}=f;if(F===-2&&(A=!1),T!=null&&(Et(),_n(T,null,m,f,!0),St()),Q!=null&&(p.renderCache[Q]=void 0),W&256){p.ctx.deactivate(f);return}const v=W&1&&z,fe=!Xt(f);let _;if(fe&&(_=V&&V.onVnodeBeforeUnmount)&&at(_,p,f),W&6)He(f.component,m,w);else{if(W&128){f.suspense.unmount(m,w);return}v&&Mt(f,null,p,"beforeUnmount"),W&64?f.type.remove(f,p,m,q,w):R&&!R.hasOnce&&(y!==ce||F>0&&F&64)?Be(R,p,m,!1,!0):(y===ce&&F&384||!A&&W&16)&&Be($,p,m),w&&It(f)}const le=C!=null&&Q==null;(fe&&(_=V&&V.onVnodeUnmounted)||v||le)&&Ke(()=>{_&&at(_,p,f),v&&Mt(f,null,p,"unmounted"),le&&(f.el=null)},m)},It=f=>{const{type:p,el:m,anchor:w,transition:A}=f;if(p===ce){gt(m,w);return}if(p===Kn){O(f);return}const y=()=>{o(m),A&&!A.persisted&&A.afterLeave&&A.afterLeave()};if(f.shapeFlag&1&&A&&!A.persisted){const{leave:V,delayLeave:T}=A,$=()=>V(m,y);T?T(f.el,y,$):$()}else y()},gt=(f,p)=>{let m;for(;f!==p;)m=g(f),o(f),f=m;o(p)},He=(f,p,m)=>{const{bum:w,scope:A,job:y,subTree:V,um:T,m:$,a:R}=f;Oo($),Oo(R),w&&Hn(w),A.stop(),y&&(y.flags|=8,Oe(V,f,p,m)),T&&Ke(T,p),Ke(()=>{f.isUnmounted=!0},p)},Be=(f,p,m,w=!1,A=!1,y=0)=>{for(let V=y;V<f.length;V++)Oe(f[V],p,m,w,A)},E=f=>{if(f.shapeFlag&6)return E(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const p=g(f.anchor||f.el),m=p&&p[Al];return m?g(m):p};let K=!1;const L=(f,p,m)=>{let w;f==null?p._vnode&&(Oe(p._vnode,null,null,!0),w=p._vnode.component):P(p._vnode||null,f,p,null,null,null,m),p._vnode=f,K||(K=!0,_o(w),Vr(),K=!1)},q={p:P,um:Oe,m:Je,r:It,mt:Dt,mc:x,pc:se,pbc:Ae,n:E,o:e};return{render:L,hydrate:void 0,createApp:Yl(L)}}function Cs({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 Vt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function da(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ai(e,t,n=!1){const s=e.children,o=t.children;if(Y(s)&&Y(o))for(let r=0;r<s.length;r++){const i=s[r];let l=o[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[r]=xt(o[r]),l.el=i.el),!n&&l.patchFlag!==-2&&ai(i,l)),l.type===ds&&(l.patchFlag===-1&&(l=o[r]=xt(l)),l.el=i.el),l.type===mt&&!l.el&&(l.el=i.el)}}function pa(e){const t=e.slice(),n=[0];let s,o,r,i,l;const a=e.length;for(s=0;s<a;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;)l=r+i>>1,e[n[l]]<d?r=l+1:i=l;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 ui(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ui(t)}function Oo(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ci(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?ci(t.subTree):null}const fi=e=>e.__isSuspense;function ha(e,t){t&&t.pendingBranch?Y(e)?t.effects.push(...e):t.effects.push(e):wl(e)}const ce=Symbol.for("v-fgt"),ds=Symbol.for("v-txt"),mt=Symbol.for("v-cmt"),Kn=Symbol.for("v-stc"),Ct=[];let We=null;function k(e=!1){Ct.push(We=e?null:[])}function ao(){Ct.pop(),We=Ct[Ct.length-1]||null}let Sn=1;function Qn(e,t=!1){Sn+=e,e<0&&We&&t&&(We.hasOnce=!0)}function di(e){return e.dynamicChildren=Sn>0?We||Jt:null,ao(),Sn>0&&We&&We.push(e),e}function I(e,t,n,s,o,r){return di(u(e,t,n,s,o,r,!0))}function nn(e,t,n,s,o){return di(we(e,t,n,s,o,!0))}function An(e){return e?e.__v_isVNode===!0:!1}function dn(e,t){return e.type===t.type&&e.key===t.key}const pi=({key:e})=>e??null,Gn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ce(e)||Ve(e)||ee(e)?{i:$e,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,r=e===ce?0:1,i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&pi(t),ref:t&&Gn(t),scopeId:Ur,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:$e};return l?(Xn(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=Ce(n)?8:16),Sn>0&&!i&&We&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&We.push(a),a}const we=ma;function ma(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===Ll)&&(e=mt),An(e)){const l=sn(e,t,!0);return n&&Xn(l,n),Sn>0&&!r&&We&&(l.shapeFlag&6?We[We.indexOf(e)]=l:We.push(l)),l.patchFlag=-2,l}if(ka(e)&&(e=e.__vccOpts),t){t=ga(t);let{class:l,style:a}=t;l&&!Ce(l)&&(t.class=Ie(l)),me(a)&&(to(a)&&!Y(a)&&(a=Ne({},a)),t.style=Kt(a))}const i=Ce(e)?1:fi(e)?128:us(e)?64:me(e)?4:ee(e)?2:0;return u(e,t,n,s,o,i,r,!0)}function ga(e){return e?to(e)||ni(e)?Ne({},e):e:null}function sn(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:i,children:l,transition:a}=e,d=t?ba(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&pi(d),ref:t&&t.ref?n&&r?Y(r)?r.concat(Gn(t)):[r,Gn(t)]:Gn(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ce?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&sn(e.ssContent),ssFallback:e.ssFallback&&sn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&oo(c,a.clone(c)),c}function xe(e=" ",t=0){return we(ds,null,e,t)}function va(e,t){const n=we(Kn,null,e);return n.staticCount=t,n}function te(e="",t=!1){return t?(k(),nn(mt,null,e)):we(mt,null,e)}function ft(e){return e==null||typeof e=="boolean"?we(mt):Y(e)?we(ce,null,e.slice()):An(e)?xt(e):we(ds,null,String(e))}function xt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:sn(e)}function Xn(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Y(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Xn(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ni(t)?t._ctx=$e:o===3&&$e&&($e.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(ee(t)){if(s&65){Xn(e,{default:t});return}t={default:t,_ctx:$e},n=32}else t=String(t),s&64?(n=16,t=[xe(t)]):n=8;e.children=t,e.shapeFlag|=n}function ba(...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=Ie([t.class,s.class]));else if(o==="style")t.style=Kt([t.style,s.style]);else if(es(o)){const r=t[o],i=s[o];i&&r!==i&&!(Y(r)&&r.includes(i))?t[o]=r?[].concat(r,i):i:i==null&&r==null&&!ts(o)&&(t[o]=i)}else o!==""&&(t[o]=s[o])}return t}function at(e,t,n,s=null){ot(e,t,7,[n,s])}const _a=Qr();let xa=0;function ya(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||_a,r={uid:xa++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Wi(!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:oi(s,o),emitsOptions:Xr(s,o),emit:null,emitted:null,propsDefaults:ge,inheritAttrs:s.inheritAttrs,ctx:ge,data:ge,props:ge,attrs:ge,slots:ge,refs:ge,setupState:ge,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=Xl.bind(null,r),e.ce&&e.ce(r),r}let Me=null;const wa=()=>Me||$e;let Zn,Rn;{const e=rs(),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)}};Zn=t("__VUE_INSTANCE_SETTERS__",n=>Me=n),Rn=t("__VUE_SSR_SETTERS__",n=>kn=n)}const Dn=e=>{const t=Me;return Zn(e),e.scope.on(),()=>{e.scope.off(),Zn(t)}},Po=()=>{Me&&Me.scope.off(),Zn(null)};function hi(e){return e.vnode.shapeFlag&4}let kn=!1;function Ca(e,t=!1,n=!1){t&&Rn(t);const{props:s,children:o}=e.vnode,r=hi(e);oa(e,s,r,t),aa(e,o,n||t);const i=r?Ea(e,t):void 0;return t&&Rn(!1),i}function Ea(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Bl);const{setup:s}=n;if(s){Et();const o=e.setupContext=s.length>1?Aa(e):null,r=Dn(e),i=$n(s,e,0,[e.props,o]),l=fr(i);if(St(),r(),(l||e.sp)&&!Xt(e)&&Kr(e),l){if(i.then(Po,Po),t)return i.then(a=>{Rn(!0);try{To(e,a,t)}finally{Rn(!1)}}).catch(a=>{as(a,e,0)});e.asyncDep=i}else To(e,i)}else mi(e)}function To(e,t,n){ee(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:me(t)&&(e.setupState=Nr(t)),mi(e)}function mi(e,t,n){const s=e.type;e.render||(e.render=s.render||ht);{const o=Dn(e);Et();try{Kl(e)}finally{St(),o()}}}const Sa={get(e,t){return De(e,"get",""),e[t]}};function Aa(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Sa),slots:e.slots,emit:e.emit,expose:t}}function ps(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Nr(dl(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in xn)return xn[n](e)},has(t,n){return n in t||n in xn}})):e.proxy}function Ra(e,t=!0){return ee(e)?e.displayName||e.name:e.name||t&&e.__name}function ka(e){return ee(e)&&"__vccOpts"in e}const be=(e,t)=>vl(e,t,kn);function gi(e,t,n){try{Qn(-1);const s=arguments.length;return s===2?me(t)&&!Y(t)?An(t)?we(e,null,[t]):we(e,t):we(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&An(n)&&(n=[n]),we(e,t,n))}finally{Qn(1)}}const Ia="3.5.41";/**
|
|
* @vue/runtime-dom v3.5.41
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let Ls;const $o=typeof window<"u"&&window.trustedTypes;if($o)try{Ls=$o.createPolicy("vue",{createHTML:e=>e})}catch{}const vi=Ls?e=>Ls.createHTML(e):e=>e,Oa="http://www.w3.org/2000/svg",Pa="http://www.w3.org/1998/Math/MathML",_t=typeof document<"u"?document:null,No=_t&&_t.createElement("template"),Ta={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(Oa,e):t==="mathml"?_t.createElementNS(Pa,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{No.innerHTML=vi(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=No.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},$a=Symbol("_vtc");function Na(e,t,n){const s=e[$a];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Do=Symbol("_vod"),Da=Symbol("_vsh"),Ma=Symbol(""),Va=/(?:^|;)\s*display\s*:/;function ja(e,t,n){const s=e.style,o=Ce(n);let r=!1;if(n&&!o){if(t)if(Ce(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&mn(s,l,"")}else for(const i in t)n[i]==null&&mn(s,i,"");for(const i in n){i==="display"&&(r=!0);const l=n[i];l!=null?La(e,i,!Ce(t)&&t?t[i]:void 0,l)||mn(s,i,l):mn(s,i,"")}}else if(o){if(t!==n){const i=s[Ma];i&&(n+=";"+i),s.cssText=n,r=Va.test(n)}}else t&&e.removeAttribute("style");Do in e&&(e[Do]=r?s.display:"",e[Da]&&(s.display="none"))}const Mo=/\s*!important$/;function mn(e,t,n){if(Y(n))n.forEach(s=>mn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ua(e,t);Mo.test(n)?e.setProperty(Gt(s),n.replace(Mo,""),"important"):e[s]=n}}const Vo=["Webkit","Moz","ms"],Es={};function Ua(e,t){const n=Es[t];if(n)return n;let s=Fe(t);if(s!=="filter"&&s in e)return Es[t]=s;s=ss(s);for(let o=0;o<Vo.length;o++){const r=Vo[o]+s;if(r in e)return Es[t]=r}return t}function La(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Ce(s)&&n===s}const jo="http://www.w3.org/1999/xlink";function Uo(e,t,n,s,o,r=Gi(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(jo,t.slice(6,t.length)):e.setAttributeNS(jo,t,n):n==null||r&&!mr(n)?e.removeAttribute(t):e.setAttribute(t,r?"":nt(n)?String(n):n)}function Lo(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?vi(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=mr(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function $t(e,t,n,s){e.addEventListener(t,n,s)}function Fa(e,t,n,s){e.removeEventListener(t,n,s)}const Fo=Symbol("_vei");function Ha(e,t,n,s,o=null){const r=e[Fo]||(e[Fo]={}),i=r[t];if(s&&i)i.value=s;else{const[l,a]=Ga(t);if(s){const d=r[t]=za(s,o);$t(e,l,d,a)}else i&&(Fa(e,l,i,a),r[t]=void 0)}}const Ba=/(Once|Passive|Capture)$/,Ka=/^on:?(?:Once|Passive|Capture)$/;function Ga(e){let t,n;for(;(n=e.match(Ba))&&!Ka.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Gt(e.slice(2)),t]}let Ss=0;const qa=Promise.resolve(),Wa=()=>Ss||(qa.then(()=>Ss=0),Ss=Date.now());function za(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Y(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const i=o.slice(),l=[s];for(let a=0;a<i.length&&!s._stopped;a++){const d=i[a];d&&ot(d,t,5,l)}}else ot(o,t,5,[s])};return n.value=e,n.attached=Wa(),n}const Ho=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ja=(e,t,n,s,o,r)=>{const i=o==="svg";t==="class"?Na(e,s,i):t==="style"?ja(e,n,s):es(t)?ts(t)||Ha(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Ya(e,t,s,i))?(Lo(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Uo(e,t,s,i,r,t!=="value")):e._isVueCE&&(Qa(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ce(s)))?Lo(e,Fe(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Uo(e,t,s,i))};function Ya(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ho(t)&&ee(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 Ho(t)&&Ce(n)?!1:t in e}function Qa(e,t){const n=e._def.props;if(!n)return!1;const s=Fe(t);return Array.isArray(n)?n.some(o=>Fe(o)===s):Object.keys(n).some(o=>Fe(o)===s)}const on=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Y(t)?n=>Hn(t,n):t};function Xa(e){e.target.composing=!0}function Bo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const pt=Symbol("_assign"),Un=Symbol("_initialValue");function As(e,t,n){return t&&(e=e.trim()),n&&(e=os(e)),e}const _e={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Un]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Un]=e.defaultValue.replace(/\r\n?/g,`
|
|
`))),e[pt]=on(o);const r=s||o.props&&o.props.type==="number";$t(e,t?"change":"input",i=>{i.target.composing||e[pt](As(e.value,n,r))}),(n||r)&&$t(e,"change",()=>{e.value=As(e.value,n,r)}),t||($t(e,"compositionstart",Xa),$t(e,"compositionend",Bo),$t(e,"change",Bo))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",r=e[Un];delete e[Un],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[pt](As(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},i){if(e[pt]=on(i),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?os(e.value):e.value,a=t??"";if(l===a)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},Ut={deep:!0,created(e,t,n){e[pt]=on(n),$t(e,"change",()=>{const s=e._modelValue,o=On(e),r=e.checked,i=e[pt];if(Y(s)){const l=zs(s,o),a=l!==-1;if(r&&!a)i(s.concat(o));else if(!r&&a){const d=[...s];d.splice(l,1),i(d)}}else if(an(s)){const l=new Set(s);r?l.add(o):l.delete(o),i(l)}else i(bi(e,r))})},mounted:Ko,beforeUpdate(e,t,n){e[pt]=on(n),Ko(e,t,n)}};function Ko(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(Y(t))o=zs(t,s.props.value)>-1;else if(an(t))o=t.has(s.props.value);else{if(t===n)return;o=un(t,bi(e,!0))}e.checked!==o&&(e.checked=o)}const In={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,$t(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?os(On(r)):On(r));e[pt](e.multiple?an(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,no(()=>{e._assigning=!1})}),e[pt]=on(s)},mounted(e,{value:t}){Go(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[pt]=on(n)},updated(e,{value:t}){e._assigning||Go(e,t)}};function Go(e,t){const n=e.multiple,s=Y(t);if(!(n&&!s&&!an(t))){for(let o=0,r=e.options.length;o<r;o++){const i=e.options[o],l=On(i);if(n)if(s){const a=typeof l;a==="string"||a==="number"?i.selected=t.some(d=>String(d)===String(l)):i.selected=zs(t,l)>-1}else i.selected=t.has(l);else if(un(On(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function On(e){return"_value"in e?e._value:e.value}function bi(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Za=["ctrl","shift","alt","meta"],eu={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)=>Za.some(n=>e[`${n}Key`]&&!t.includes(n))},Ye=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let i=0;i<t.length;i++){const l=eu[t[i]];if(l&&l(o,t))return}return e(o,...r)}))},tu=Ne({patchProp:Ja},Ta);let qo;function nu(){return qo||(qo=ca(tu))}const su=((...e)=>{const t=nu().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=ru(s);if(!o)return;const r=t._component;!ee(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,ou(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function ou(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ru(e){return Ce(e)?document.querySelector(e):e}/*!
|
|
* vue-router v4.6.4
|
|
* (c) 2025 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/const zt=typeof document<"u";function _i(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function iu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&_i(e.default)}const de=Object.assign;function Rs(e,t){const n={};for(const s in t){const o=t[s];n[s]=rt(o)?o.map(e):e(o)}return n}const yn=()=>{},rt=Array.isArray;function Wo(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const xi=/#/g,lu=/&/g,au=/\//g,uu=/=/g,cu=/\?/g,yi=/\+/g,fu=/%5B/g,du=/%5D/g,wi=/%5E/g,pu=/%60/g,Ci=/%7B/g,hu=/%7C/g,Ei=/%7D/g,mu=/%20/g;function uo(e){return e==null?"":encodeURI(""+e).replace(hu,"|").replace(fu,"[").replace(du,"]")}function gu(e){return uo(e).replace(Ci,"{").replace(Ei,"}").replace(wi,"^")}function Fs(e){return uo(e).replace(yi,"%2B").replace(mu,"+").replace(xi,"%23").replace(lu,"%26").replace(pu,"`").replace(Ci,"{").replace(Ei,"}").replace(wi,"^")}function vu(e){return Fs(e).replace(uu,"%3D")}function bu(e){return uo(e).replace(xi,"%23").replace(cu,"%3F")}function _u(e){return bu(e).replace(au,"%2F")}function Pn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const xu=/\/$/,yu=e=>e.replace(xu,"");function ks(e,t,n="/"){let s,o={},r="",i="";const l=t.indexOf("#");let a=t.indexOf("?");return a=l>=0&&a>l?-1:a,a>=0&&(s=t.slice(0,a),r=t.slice(a,l>0?l:t.length),o=e(r.slice(1))),l>=0&&(s=s||t.slice(0,l),i=t.slice(l,t.length)),s=Su(s??t,n),{fullPath:s+r+i,path:s,query:o,hash:Pn(i)}}function wu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function zo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Cu(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&rn(t.matched[s],n.matched[o])&&Si(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function rn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Si(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Eu(e[n],t[n]))return!1;return!0}function Eu(e,t){return rt(e)?Jo(e,t):rt(t)?Jo(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Jo(e,t){return rt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Su(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),o=s[s.length-1];(o===".."||o===".")&&s.push("");let r=n.length-1,i,l;for(i=0;i<s.length;i++)if(l=s[i],l!==".")if(l==="..")r>1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i).join("/")}const Ot={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Hs=(function(e){return e.pop="pop",e.push="push",e})({}),Is=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Au(e){if(!e)if(zt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),yu(e)}const Ru=/^[^#]+#/;function ku(e,t){return e.replace(Ru,"#")+t}function Iu(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 hs=()=>({left:window.scrollX,top:window.scrollY});function Ou(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=Iu(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 Yo(e,t){return(history.state?history.state.position-t:-1)+e}const Bs=new Map;function Pu(e,t){Bs.set(e,t)}function Tu(e){const t=Bs.get(e);return Bs.delete(e),t}function $u(e){return typeof e=="string"||e&&typeof e=="object"}function Ai(e){return typeof e=="string"||typeof e=="symbol"}let ye=(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 Ri=Symbol("");ye.MATCHER_NOT_FOUND+"",ye.NAVIGATION_GUARD_REDIRECT+"",ye.NAVIGATION_ABORTED+"",ye.NAVIGATION_CANCELLED+"",ye.NAVIGATION_DUPLICATED+"";function ln(e,t){return de(new Error,{type:e,[Ri]:!0},t)}function bt(e,t){return e instanceof Error&&Ri in e&&(t==null||!!(e.type&t))}const Nu=["params","query","hash"];function Du(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Nu)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Mu(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(yi," "),r=o.indexOf("="),i=Pn(r<0?o:o.slice(0,r)),l=r<0?null:Pn(o.slice(r+1));if(i in t){let a=t[i];rt(a)||(a=t[i]=[a]),a.push(l)}else t[i]=l}return t}function Qo(e){let t="";for(let n in e){const s=e[n];if(n=vu(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(rt(s)?s.map(o=>o&&Fs(o)):[s&&Fs(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function Vu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=rt(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const ju=Symbol(""),Xo=Symbol(""),ms=Symbol(""),co=Symbol(""),Ks=Symbol("");function pn(){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 Tt(e,t,n,s,o,r=i=>i()){const i=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((l,a)=>{const d=g=>{g===!1?a(ln(ye.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?a(g):$u(g)?a(ln(ye.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&s.enterCallbacks[o]===i&&typeof g=="function"&&i.push(g),l())},c=r(()=>e.call(s&&s.instances[o],t,n,d));let h=Promise.resolve(c);e.length<3&&(h=h.then(d)),h.catch(g=>a(g))})}function Os(e,t,n,s,o=r=>r()){const r=[];for(const i of e)for(const l in i.components){let a=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(_i(a)){const d=(a.__vccOpts||a)[t];d&&r.push(Tt(d,n,s,i,l,o))}else{let d=a();r.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const h=iu(c)?c.default:c;i.mods[l]=c,i.components[l]=h;const g=(h.__vccOpts||h)[t];return g&&Tt(g,n,s,i,l,o)()}))}}return r}function Uu(e,t){const n=[],s=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let i=0;i<r;i++){const l=t.matched[i];l&&(e.matched.find(d=>rn(d,l))?s.push(l):n.push(l));const a=e.matched[i];a&&(t.matched.find(d=>rn(d,a))||o.push(a))}return[n,s,o]}/*!
|
|
* vue-router v4.6.4
|
|
* (c) 2025 Eduardo San Martin Morote
|
|
* @license MIT
|
|
*/let Lu=()=>location.protocol+"//"+location.host;function ki(e,t){const{pathname:n,search:s,hash:o}=t,r=e.indexOf("#");if(r>-1){let i=o.includes(e.slice(r))?e.slice(r).length:1,l=o.slice(i);return l[0]!=="/"&&(l="/"+l),zo(l,"")}return zo(n,e)+s+o}function Fu(e,t,n,s){let o=[],r=[],i=null;const l=({state:g})=>{const b=ki(e,location),U=n.value,P=t.value;let G=0;if(g){if(n.value=b,t.value=g,i&&i===U){i=null;return}G=P?g.position-P.position:0}else s(b);o.forEach(H=>{H(n.value,U,{delta:G,type:Hs.pop,direction:G?G>0?Is.forward:Is.back:Is.unknown})})};function a(){i=n.value}function d(g){o.push(g);const b=()=>{const U=o.indexOf(g);U>-1&&o.splice(U,1)};return r.push(b),b}function c(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(de({},g.state,{scroll:hs()}),"")}}function h(){for(const g of r)g();r=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:a,listen:d,destroy:h}}function Zo(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?hs():null}}function Hu(e){const{history:t,location:n}=window,s={value:ki(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(a,d,c){const h=e.indexOf("#"),g=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+a:Lu()+e+a;try{t[c?"replaceState":"pushState"](d,"",g),o.value=d}catch(b){console.error(b),n[c?"replace":"assign"](g)}}function i(a,d){r(a,de({},t.state,Zo(o.value.back,a,o.value.forward,!0),d,{position:o.value.position}),!0),s.value=a}function l(a,d){const c=de({},o.value,t.state,{forward:a,scroll:hs()});r(c.current,c,!0),r(a,de({},Zo(s.value,a,null),{position:c.position+1},d),!1),s.value=a}return{location:s,state:o,push:l,replace:i}}function Bu(e){e=Au(e);const t=Hu(e),n=Fu(e,t.state,t.location,t.replace);function s(r,i=!0){i||n.pauseListeners(),history.go(r)}const o=de({location:"",base:e,go:s,createHref:ku.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 Lt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Re=(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})(Re||{});const Ku={type:Lt.Static,value:""},Gu=/[a-zA-Z0-9_]/;function qu(e){if(!e)return[[]];if(e==="/")return[[Ku]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${d}": ${b}`)}let n=Re.Static,s=n;const o=[];let r;function i(){r&&o.push(r),r=[]}let l=0,a,d="",c="";function h(){d&&(n===Re.Static?r.push({type:Lt.Static,value:d}):n===Re.Param||n===Re.ParamRegExp||n===Re.ParamRegExpEnd?(r.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),r.push({type:Lt.Param,value:d,regexp:c,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),d="")}function g(){d+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&n!==Re.ParamRegExp){s=n,n=Re.EscapeNext;continue}switch(n){case Re.Static:a==="/"?(d&&h(),i()):a===":"?(h(),n=Re.Param):g();break;case Re.EscapeNext:g(),n=s;break;case Re.Param:a==="("?n=Re.ParamRegExp:Gu.test(a)?g():(h(),n=Re.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case Re.ParamRegExp:a===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+a:n=Re.ParamRegExpEnd:c+=a;break;case Re.ParamRegExpEnd:h(),n=Re.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,c="";break;default:t("Unknown state");break}}return n===Re.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),h(),i(),o}const er="[^/]+?",Wu={sensitive:!1,strict:!1,start:!0,end:!0};var Ue=(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})(Ue||{});const zu=/[.+*?^${}()[\]/\\]/g;function Ju(e,t){const n=de({},Wu,t),s=[];let o=n.start?"^":"";const r=[];for(const d of e){const c=d.length?[]:[Ue.Root];n.strict&&!d.length&&(o+="/");for(let h=0;h<d.length;h++){const g=d[h];let b=Ue.Segment+(n.sensitive?Ue.BonusCaseSensitive:0);if(g.type===Lt.Static)h||(o+="/"),o+=g.value.replace(zu,"\\$&"),b+=Ue.Static;else if(g.type===Lt.Param){const{value:U,repeatable:P,optional:G,regexp:H}=g;r.push({name:U,repeatable:P,optional:G});const N=H||er;if(N!==er){b+=Ue.BonusCustomRegExp;try{`${N}`}catch(O){throw new Error(`Invalid custom RegExp for param "${U}" (${N}): `+O.message)}}let B=P?`((?:${N})(?:/(?:${N}))*)`:`(${N})`;h||(B=G&&d.length<2?`(?:/${B})`:"/"+B),G&&(B+="?"),o+=B,b+=Ue.Dynamic,G&&(b+=Ue.BonusOptional),P&&(b+=Ue.BonusRepeatable),N===".*"&&(b+=Ue.BonusWildcard)}c.push(b)}s.push(c)}if(n.strict&&n.end){const d=s.length-1;s[d][s[d].length-1]+=Ue.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function l(d){const c=d.match(i),h={};if(!c)return null;for(let g=1;g<c.length;g++){const b=c[g]||"",U=r[g-1];h[U.name]=b&&U.repeatable?b.split("/"):b}return h}function a(d){let c="",h=!1;for(const g of e){(!h||!c.endsWith("/"))&&(c+="/"),h=!1;for(const b of g)if(b.type===Lt.Static)c+=b.value;else if(b.type===Lt.Param){const{value:U,repeatable:P,optional:G}=b,H=U in d?d[U]:"";if(rt(H)&&!P)throw new Error(`Provided param "${U}" is an array but it is not repeatable (* or + modifiers)`);const N=rt(H)?H.join("/"):H;if(!N)if(G)g.length<2&&(c.endsWith("/")?c=c.slice(0,-1):h=!0);else throw new Error(`Missing required param "${U}"`);c+=N}}return c||"/"}return{re:i,score:s,keys:r,parse:l,stringify:a}}function Yu(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]===Ue.Static+Ue.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ue.Static+Ue.Segment?1:-1:0}function Ii(e,t){let n=0;const s=e.score,o=t.score;for(;n<s.length&&n<o.length;){const r=Yu(s[n],o[n]);if(r)return r;n++}if(Math.abs(o.length-s.length)===1){if(tr(s))return 1;if(tr(o))return-1}return o.length-s.length}function tr(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Qu={strict:!1,end:!0,sensitive:!1};function Xu(e,t,n){const s=Ju(qu(e.path),n),o=de(s,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function Zu(e,t){const n=[],s=new Map;t=Wo(Qu,t);function o(h){return s.get(h)}function r(h,g,b){const U=!b,P=sr(h);P.aliasOf=b&&b.record;const G=Wo(t,h),H=[P];if("alias"in h){const O=typeof h.alias=="string"?[h.alias]:h.alias;for(const S of O)H.push(sr(de({},P,{components:b?b.record.components:P.components,path:S,aliasOf:b?b.record:P})))}let N,B;for(const O of H){const{path:S}=O;if(g&&S[0]!=="/"){const M=g.record.path,Z=M[M.length-1]==="/"?"":"/";O.path=g.record.path+(S&&Z+S)}if(N=Xu(O,g,G),b?b.alias.push(N):(B=B||N,B!==N&&B.alias.push(N),U&&h.name&&!or(N)&&i(h.name)),Oi(N)&&a(N),P.children){const M=P.children;for(let Z=0;Z<M.length;Z++)r(M[Z],N,b&&b.children[Z])}b=b||N}return B?()=>{i(B)}:yn}function i(h){if(Ai(h)){const g=s.get(h);g&&(s.delete(h),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(h);g>-1&&(n.splice(g,1),h.record.name&&s.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function l(){return n}function a(h){const g=nc(h,n);n.splice(g,0,h),h.record.name&&!or(h)&&s.set(h.record.name,h)}function d(h,g){let b,U={},P,G;if("name"in h&&h.name){if(b=s.get(h.name),!b)throw ln(ye.MATCHER_NOT_FOUND,{location:h});G=b.record.name,U=de(nr(g.params,b.keys.filter(B=>!B.optional).concat(b.parent?b.parent.keys.filter(B=>B.optional):[]).map(B=>B.name)),h.params&&nr(h.params,b.keys.map(B=>B.name))),P=b.stringify(U)}else if(h.path!=null)P=h.path,b=n.find(B=>B.re.test(P)),b&&(U=b.parse(P),G=b.record.name);else{if(b=g.name?s.get(g.name):n.find(B=>B.re.test(g.path)),!b)throw ln(ye.MATCHER_NOT_FOUND,{location:h,currentLocation:g});G=b.record.name,U=de({},g.params,h.params),P=b.stringify(U)}const H=[];let N=b;for(;N;)H.unshift(N.record),N=N.parent;return{name:G,path:P,params:U,matched:H,meta:tc(H)}}e.forEach(h=>r(h));function c(){n.length=0,s.clear()}return{addRoute:r,resolve:d,removeRoute:i,clearRoutes:c,getRoutes:l,getRecordMatcher:o}}function nr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function sr(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:ec(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 ec(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 or(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function tc(e){return e.reduce((t,n)=>de(t,n.meta),{})}function nc(e,t){let n=0,s=t.length;for(;n!==s;){const r=n+s>>1;Ii(e,t[r])<0?s=r:n=r+1}const o=sc(e);return o&&(s=t.lastIndexOf(o,s-1)),s}function sc(e){let t=e;for(;t=t.parent;)if(Oi(t)&&Ii(e,t)===0)return t}function Oi({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function rr(e){const t=tt(ms),n=tt(co),s=be(()=>{const a=Te(e.to);return t.resolve(a)}),o=be(()=>{const{matched:a}=s.value,{length:d}=a,c=a[d-1],h=n.matched;if(!c||!h.length)return-1;const g=h.findIndex(rn.bind(null,c));if(g>-1)return g;const b=ir(a[d-2]);return d>1&&ir(c)===b&&h[h.length-1].path!==b?h.findIndex(rn.bind(null,a[d-2])):g}),r=be(()=>o.value>-1&&ac(n.params,s.value.params)),i=be(()=>o.value>-1&&o.value===n.matched.length-1&&Si(n.params,s.value.params));function l(a={}){if(lc(a)){const d=t[Te(e.replace)?"replace":"push"](Te(e.to)).catch(yn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:be(()=>s.value.href),isActive:r,isExactActive:i,navigate:l}}function oc(e){return e.length===1?e[0]:e}const rc=Br({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:rr,setup(e,{slots:t}){const n=ls(rr(e)),{options:s}=tt(ms),o=be(()=>({[lr(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[lr(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=t.default&&oc(t.default(n));return e.custom?r:gi("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},r)}}}),ic=rc;function lc(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 ac(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(!rt(o)||o.length!==s.length||s.some((r,i)=>r.valueOf()!==o[i].valueOf()))return!1}return!0}function ir(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const lr=(e,t,n)=>e??t??n,uc=Br({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=tt(Ks),o=be(()=>e.route||s.value),r=tt(Xo,0),i=be(()=>{let d=Te(r);const{matched:c}=o.value;let h;for(;(h=c[d])&&!h.components;)d++;return d}),l=be(()=>o.value.matched[i.value]);Bn(Xo,be(()=>i.value+1)),Bn(ju,l),Bn(Ks,o);const a=X();return Bt(()=>[a.value,l.value,e.name],([d,c,h],[g,b,U])=>{c&&(c.instances[h]=d,b&&b!==c&&d&&d===g&&(c.leaveGuards.size||(c.leaveGuards=b.leaveGuards),c.updateGuards.size||(c.updateGuards=b.updateGuards))),d&&c&&(!b||!rn(c,b)||!g)&&(c.enterCallbacks[h]||[]).forEach(P=>P(d))},{flush:"post"}),()=>{const d=o.value,c=e.name,h=l.value,g=h&&h.components[c];if(!g)return ar(n.default,{Component:g,route:d});const b=h.props[c],U=b?b===!0?d.params:typeof b=="function"?b(d):b:null,G=gi(g,de({},U,t,{onVnodeUnmounted:H=>{H.component.isUnmounted&&(h.instances[c]=null)},ref:a}));return ar(n.default,{Component:G,route:d})||G}}});function ar(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const cc=uc;function fc(e){const t=Zu(e.routes,e),n=e.parseQuery||Mu,s=e.stringifyQuery||Qo,o=e.history,r=pn(),i=pn(),l=pn(),a=pl(Ot);let d=Ot;zt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Rs.bind(null,E=>""+E),h=Rs.bind(null,_u),g=Rs.bind(null,Pn);function b(E,K){let L,q;return Ai(E)?(L=t.getRecordMatcher(E),q=K):q=E,t.addRoute(q,L)}function U(E){const K=t.getRecordMatcher(E);K&&t.removeRoute(K)}function P(){return t.getRoutes().map(E=>E.record)}function G(E){return!!t.getRecordMatcher(E)}function H(E,K){if(K=de({},K||a.value),typeof E=="string"){const m=ks(n,E,K.path),w=t.resolve({path:m.path},K),A=o.createHref(m.fullPath);return de(m,w,{params:g(w.params),hash:Pn(m.hash),redirectedFrom:void 0,href:A})}let L;if(E.path!=null)L=de({},E,{path:ks(n,E.path,K.path).path});else{const m=de({},E.params);for(const w in m)m[w]==null&&delete m[w];L=de({},E,{params:h(m)}),K.params=h(K.params)}const q=t.resolve(L,K),oe=E.hash||"";q.params=c(g(q.params));const f=wu(s,de({},E,{hash:gu(oe),path:q.path})),p=o.createHref(f);return de({fullPath:f,hash:oe,query:s===Qo?Vu(E.query):E.query||{}},q,{redirectedFrom:void 0,href:p})}function N(E){return typeof E=="string"?ks(n,E,a.value.path):de({},E)}function B(E,K){if(d!==E)return ln(ye.NAVIGATION_CANCELLED,{from:K,to:E})}function O(E){return Z(E)}function S(E){return O(de(N(E),{replace:!0}))}function M(E,K){const L=E.matched[E.matched.length-1];if(L&&L.redirect){const{redirect:q}=L;let oe=typeof q=="function"?q(E,K):q;return typeof oe=="string"&&(oe=oe.includes("?")||oe.includes("#")?oe=N(oe):{path:oe},oe.params={}),de({query:E.query,hash:E.hash,params:oe.path!=null?{}:E.params},oe)}}function Z(E,K){const L=d=H(E),q=a.value,oe=E.state,f=E.force,p=E.replace===!0,m=M(L,q);if(m)return Z(de(N(m),{state:typeof m=="object"?de({},oe,m.state):oe,force:f,replace:p}),K||L);const w=L;w.redirectedFrom=K;let A;return!f&&Cu(s,q,L)&&(A=ln(ye.NAVIGATION_DUPLICATED,{to:w,from:q}),Je(q,q,!0,!1)),(A?Promise.resolve(A):Ae(w,q)).catch(y=>bt(y)?bt(y,ye.NAVIGATION_GUARD_REDIRECT)?y:Ge(y):se(y,w,q)).then(y=>{if(y){if(bt(y,ye.NAVIGATION_GUARD_REDIRECT))return Z(de({replace:p},N(y.to),{state:typeof y.to=="object"?de({},oe,y.to.state):oe,force:f}),K||w)}else y=Xe(w,q,!0,p,oe);return J(w,q,y),y})}function x(E,K){const L=B(E,K);return L?Promise.reject(L):Promise.resolve()}function j(E){const K=gt.values().next().value;return K&&typeof K.runWithContext=="function"?K.runWithContext(E):E()}function Ae(E,K){let L;const[q,oe,f]=Uu(E,K);L=Os(q.reverse(),"beforeRouteLeave",E,K);for(const m of q)m.leaveGuards.forEach(w=>{L.push(Tt(w,E,K))});const p=x.bind(null,E,K);return L.push(p),Be(L).then(()=>{L=[];for(const m of r.list())L.push(Tt(m,E,K));return L.push(p),Be(L)}).then(()=>{L=Os(oe,"beforeRouteUpdate",E,K);for(const m of oe)m.updateGuards.forEach(w=>{L.push(Tt(w,E,K))});return L.push(p),Be(L)}).then(()=>{L=[];for(const m of f)if(m.beforeEnter)if(rt(m.beforeEnter))for(const w of m.beforeEnter)L.push(Tt(w,E,K));else L.push(Tt(m.beforeEnter,E,K));return L.push(p),Be(L)}).then(()=>(E.matched.forEach(m=>m.enterCallbacks={}),L=Os(f,"beforeRouteEnter",E,K,j),L.push(p),Be(L))).then(()=>{L=[];for(const m of i.list())L.push(Tt(m,E,K));return L.push(p),Be(L)}).catch(m=>bt(m,ye.NAVIGATION_CANCELLED)?m:Promise.reject(m))}function J(E,K,L){l.list().forEach(q=>j(()=>q(E,K,L)))}function Xe(E,K,L,q,oe){const f=B(E,K);if(f)return f;const p=K===Ot,m=zt?history.state:{};L&&(q||p?o.replace(E.fullPath,de({scroll:p&&m&&m.scroll},oe)):o.push(E.fullPath,oe)),a.value=E,Je(E,K,L,p),Ge()}let ze;function Dt(){ze||(ze=o.listen((E,K,L)=>{if(!He.listening)return;const q=H(E),oe=M(q,He.currentRoute.value);if(oe){Z(de(oe,{replace:!0,force:!0}),q).catch(yn);return}d=q;const f=a.value;zt&&Pu(Yo(f.fullPath,L.delta),hs()),Ae(q,f).catch(p=>bt(p,ye.NAVIGATION_ABORTED|ye.NAVIGATION_CANCELLED)?p:bt(p,ye.NAVIGATION_GUARD_REDIRECT)?(Z(de(N(p.to),{force:!0}),q).then(m=>{bt(m,ye.NAVIGATION_ABORTED|ye.NAVIGATION_DUPLICATED)&&!L.delta&&L.type===Hs.pop&&o.go(-1,!1)}).catch(yn),Promise.reject()):(L.delta&&o.go(-L.delta,!1),se(p,q,f))).then(p=>{p=p||Xe(q,f,!1),p&&(L.delta&&!bt(p,ye.NAVIGATION_CANCELLED)?o.go(-L.delta,!1):L.type===Hs.pop&&bt(p,ye.NAVIGATION_ABORTED|ye.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),J(q,f,p)}).catch(yn)}))}let kt=pn(),Ee=pn(),ie;function se(E,K,L){Ge(E);const q=Ee.list();return q.length?q.forEach(oe=>oe(E,K,L)):console.error(E),Promise.reject(E)}function ne(){return ie&&a.value!==Ot?Promise.resolve():new Promise((E,K)=>{kt.add([E,K])})}function Ge(E){return ie||(ie=!E,Dt(),kt.list().forEach(([K,L])=>E?L(E):K()),kt.reset()),E}function Je(E,K,L,q){const{scrollBehavior:oe}=e;if(!zt||!oe)return Promise.resolve();const f=!L&&Tu(Yo(E.fullPath,0))||(q||!L)&&history.state&&history.state.scroll||null;return no().then(()=>oe(E,K,f)).then(p=>p&&Ou(p)).catch(p=>se(p,E,K))}const Oe=E=>o.go(E);let It;const gt=new Set,He={currentRoute:a,listening:!0,addRoute:b,removeRoute:U,clearRoutes:t.clearRoutes,hasRoute:G,getRoutes:P,resolve:H,options:e,push:O,replace:S,go:Oe,back:()=>Oe(-1),forward:()=>Oe(1),beforeEach:r.add,beforeResolve:i.add,afterEach:l.add,onError:Ee.add,isReady:ne,install(E){E.component("RouterLink",ic),E.component("RouterView",cc),E.config.globalProperties.$router=He,Object.defineProperty(E.config.globalProperties,"$route",{enumerable:!0,get:()=>Te(a)}),zt&&!It&&a.value===Ot&&(It=!0,O(o.location).catch(q=>{}));const K={};for(const q in Ot)Object.defineProperty(K,q,{get:()=>a.value[q],enumerable:!0});E.provide(ms,He),E.provide(co,Tr(K)),E.provide(Ks,a);const L=E.unmount;gt.add(E),E.unmount=function(){gt.delete(E),gt.size<1&&(d=Ot,ze&&ze(),ze=null,a.value=Ot,It=!1,ie=!1),L()}}};function Be(E){return E.reduce((K,L)=>K.then(()=>j(L)),Promise.resolve())}return He}function Pi(){return tt(ms)}function Ti(e){return tt(co)}const Ln=window.location.pathname.startsWith("/portal/"),Ze={esPortal:Ln,baseRuta:Ln?"/portal/studio/":"/studio/",apiBase:Ln?"/portal":"/app",urlLogin:Ln?"/portal/login":"/login"};function ae(e){return Ze.apiBase+e}async function Fn(e,t={}){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t.headers}}),s=n.headers.get("content-type")||"";if(n.redirected||!s.includes("application/json"))throw window.location.href=Ze.urlLogin,new Error("Sesión expirada");const o=await n.json();if(!n.ok){const r=typeof(o==null?void 0:o.error)=="string"?o.error:o==null?void 0:o.message;throw new Error(r||"Error de servidor")}return o}const ue={get:e=>Fn(e),post:(e,t)=>Fn(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Fn(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>Fn(e,{method:"DELETE"})},dc={class:"w-64 shrink-0 h-screen sticky top-0 flex flex-col border-r border-borde bg-superficie"},pc={class:"h-14 px-4 flex items-center border-b border-borde"},hc={key:0,class:"px-3 pt-3"},mc={key:1,class:"px-3 pt-2 text-xs text-red-600 dark:text-red-400"},gc={class:"flex-1 overflow-y-auto px-2 py-3 space-y-0.5"},vc={key:0,class:"px-2 text-xs text-tenue"},bc={key:1,class:"px-2 text-xs text-tenue"},_c={class:"truncate"},xc={class:"flex items-center gap-1 mt-0.5"},yc={class:"text-[11px] text-tenue"},wc={key:0,class:"flex opacity-0 group-hover:opacity-100 transition-opacity pr-1.5 gap-0.5"},Cc=["onClick"],Ec=["onClick"],Sc={class:"card w-full max-w-lg p-6 animate-escalar shadow-2xl"},Ac={class:"font-semibold text-texto mb-4"},Rc={key:0,class:"grid grid-cols-2 gap-3"},kc=["value"],Ic={class:"text-[11px] text-tenue mt-1"},Oc=["value"],Pc={class:"text-[11px] text-tenue mt-1"},Tc={class:"flex items-center gap-2 text-sm text-texto"},$c={class:"flex justify-end gap-2 pt-2"},Nc={__name:"Sidebar",setup(e,{expose:t}){const n=Ti(),s=Pi(),o=X([]),r=X([]),i=X([]),l=X(!0),a=X(""),d=X(!1),c=X(null),h=X(b()),g=be(()=>n.params.tenantId||n.params.id);function b(){return{nombre:"",dominios_permitidos:"",activo:!0,cliente_id:null,plan_id:null}}async function U(){l.value=!0,a.value="";try{const S=await ue.get(ae("/umind/tenants"));o.value=S.items||[]}catch(S){a.value=S.message}finally{l.value=!1}}function P(S){return Array.isArray(S)?S:(S==null?void 0:S.items)||(S==null?void 0:S.registros)||[]}async function G(){if(Ze.esPortal)return;const[S,M]=await Promise.allSettled([ue.get("/app/api/clientes/select"),ue.get("/app/umind-planes/list")]);r.value=S.status==="fulfilled"?P(S.value):[],i.value=M.status==="fulfilled"?P(M.value):[];const Z=[];S.status==="rejected"&&Z.push("clientes"),M.status==="rejected"&&Z.push("planes"),Z.length&&(a.value=`No se pudo cargar la lista de ${Z.join(" ni ")}.`)}function H(){c.value=null,h.value=b(),d.value=!0}function N(S){c.value=S,h.value={nombre:S.nombre,dominios_permitidos:S.dominios_permitidos,activo:S.activo,cliente_id:S.cliente_id??null,plan_id:S.plan_id??null},d.value=!0}async function B(){const S={...h.value,dominios_permitidos:h.value.dominios_permitidos.split(",").map(M=>M.trim()).filter(Boolean)};try{if(c.value)await ue.put(ae(`/umind/tenants/${c.value.ID}`),S),d.value=!1,await U();else{const M=await ue.post(ae("/umind/tenants"),S);d.value=!1,await U(),s.push(`/tenants/${M.id}`)}}catch(M){a.value=M.message}}async function O(S){confirm(`¿Eliminar el tenant "${S.nombre}"? Esto borra también sus agentes. No se puede deshacer.`)&&(await ue.del(ae(`/umind/tenants/${S.ID}`)),g.value===String(S.ID)&&s.push("/"),await U())}return t({recargar:U}),qr(()=>{U(),G()}),(S,M)=>{const Z=Nn("router-link");return k(),I(ce,null,[u("aside",dc,[u("div",pc,[we(Z,{to:"/",class:"text-base font-semibold text-texto"},{default:Nt(()=>[...M[7]||(M[7]=[xe(" uMind ",-1),u("span",{class:"text-brand"},"Studio",-1)])]),_:1})]),Te(Ze).esPortal?te("",!0):(k(),I("div",hc,[u("button",{class:"btn-primary w-full",onClick:H}," + Nuevo tenant ")])),a.value?(k(),I("p",mc,D(a.value),1)):te("",!0),u("nav",gc,[l.value?(k(),I("p",vc,"Cargando...")):o.value.length===0?(k(),I("p",bc,D(Te(Ze).esPortal?"Todavía no tenés ningún espacio asignado. Escribinos y lo activamos.":"Sin tenants todavía."),1)):te("",!0),(k(!0),I(ce,null,ke(o.value,x=>(k(),I("div",{key:x.ID,class:Ie(["group flex items-center rounded-lg transition-colors",g.value===String(x.ID)?"bg-brand/10":"hover:bg-elevado"])},[we(Z,{to:`/tenants/${x.ID}`,class:Ie(["flex-1 min-w-0 px-2.5 py-2 text-sm",g.value===String(x.ID)?"text-brand font-medium":"text-texto"])},{default:Nt(()=>[u("div",_c,D(x.nombre),1),u("div",xc,[u("span",{class:Ie(["w-1.5 h-1.5 rounded-full",x.activo?"bg-green-500":"bg-tenue/40"])},null,2),u("span",yc,D(x.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),Te(Ze).esPortal?te("",!0):(k(),I("div",wc,[u("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:j=>N(x)}," ✎ ",8,Cc),u("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:j=>O(x)}," ✕ ",8,Ec)]))],2))),128))])]),d.value?(k(),I("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:M[6]||(M[6]=Ye(x=>d.value=!1,["self"]))},[u("div",Sc,[u("h2",Ac,D(c.value?"Editar tenant":"Nuevo tenant"),1),M[16]||(M[16]=u("p",{class:"text-xs text-tenue mb-3"}," Un tenant es el negocio/sitio dueño de los dominios permitidos. La config de IA, tono y demás se configuran por agente, dentro del tenant. ",-1)),u("form",{class:"space-y-3",onSubmit:Ye(B,["prevent"])},[u("div",null,[M[8]||(M[8]=u("label",{class:"label"},"Nombre",-1)),re(u("input",{"onUpdate:modelValue":M[0]||(M[0]=x=>h.value.nombre=x),required:"",class:"input"},null,512),[[_e,h.value.nombre]])]),u("div",null,[M[9]||(M[9]=u("label",{class:"label"},"Dominios permitidos (separados por coma)",-1)),re(u("input",{"onUpdate:modelValue":M[1]||(M[1]=x=>h.value.dominios_permitidos=x),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"input"},null,512),[[_e,h.value.dominios_permitidos]])]),Te(Ze).esPortal?te("",!0):(k(),I("div",Rc,[u("div",null,[M[11]||(M[11]=u("label",{class:"label"},"Cliente",-1)),re(u("select",{"onUpdate:modelValue":M[2]||(M[2]=x=>h.value.cliente_id=x),class:"input"},[M[10]||(M[10]=u("option",{value:null},"— sin asignar —",-1)),(k(!0),I(ce,null,ke(r.value,x=>(k(),I("option",{key:x.ID,value:x.ID},D(x.nombre),9,kc))),128))],512),[[In,h.value.cliente_id]]),u("p",Ic,D(r.value.length?"Define quién ve este tenant desde el portal.":"No hay clientes activos — creá uno en Clientes."),1)]),u("div",null,[M[13]||(M[13]=u("label",{class:"label"},"Plan",-1)),re(u("select",{"onUpdate:modelValue":M[3]||(M[3]=x=>h.value.plan_id=x),class:"input"},[M[12]||(M[12]=u("option",{value:null},"— sin plan —",-1)),(k(!0),I(ce,null,ke(i.value,x=>(k(),I("option",{key:x.ID,value:x.ID},D(x.nombre)+" ("+D(x.max_agentes===0?"∞":x.max_agentes)+" agentes) ",9,Oc))),128))],512),[[In,h.value.plan_id]]),u("p",Pc,D(i.value.length?"Límite de agentes y precios de consumo.":"No hay planes — creá uno en uMind Planes."),1)])])),u("label",Tc,[re(u("input",{"onUpdate:modelValue":M[4]||(M[4]=x=>h.value.activo=x),type:"checkbox"},null,512),[[Ut,h.value.activo]]),M[14]||(M[14]=xe(" Activo ",-1))]),u("div",$c,[u("button",{type:"button",class:"btn-ghost",onClick:M[5]||(M[5]=x=>d.value=!1)}," Cancelar "),M[15]||(M[15]=u("button",{type:"submit",class:"btn-primary"}," Guardar ",-1))])],32)])])):te("",!0)],64)}}},$i="umind-tema";function Dc(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"oscuro":"claro"}const en=X(localStorage.getItem($i)||Dc());function Ni(){document.documentElement.classList.toggle("dark",en.value==="oscuro")}function ur(){en.value=en.value==="oscuro"?"claro":"oscuro",localStorage.setItem($i,en.value),Ni()}Ni();const Mc={class:"min-h-screen flex"},Vc={class:"flex-1 min-w-0 flex flex-col"},jc={class:"h-14 shrink-0 flex items-center justify-end gap-1 px-6 border-b border-borde"},Uc=["title"],Lc={class:"text-base leading-none"},Fc={class:"flex-1 max-w-5xl w-full mx-auto px-8 py-8 animate-aparecer"},Hc={__name:"App",setup(e){return(t,n)=>{const s=Nn("router-view");return k(),I("div",Mc,[we(Nc),u("main",Vc,[u("header",jc,[u("button",{class:"btn-ghost !px-2.5 !py-1.5",title:Te(en)==="oscuro"?"Cambiar a claro":"Cambiar a oscuro",onClick:n[0]||(n[0]=(...o)=>Te(ur)&&Te(ur)(...o))},[u("span",Lc,D(Te(en)==="oscuro"?"☀️":"🌙"),1)],8,Uc)]),u("div",Fc,[we(s)])])])}}},Bc={class:"flex flex-col items-center justify-center text-center py-24"},Kc={class:"text-lg font-medium text-gray-700 dark:text-gray-200"},Gc={class:"text-sm text-gray-400 dark:text-gray-500 mt-1"},qc={__name:"Home",setup(e){return(t,n)=>(k(),I("div",Bc,[n[0]||(n[0]=u("div",{class:"text-4xl mb-4"},"💬",-1)),u("h1",Kc,D(Te(Ze).esPortal?"Elegí tu espacio de la izquierda":"Elegí un tenant de la izquierda"),1),u("p",Gc,D(Te(Ze).esPortal?"Adentro vas a poder crear y configurar tus agentes.":"o creá uno nuevo para empezar a configurar su agente."),1)]))}},Wc={class:"flex flex-col items-center justify-center text-center py-12 px-6"},zc={key:0,class:"text-3xl mb-3 opacity-70"},Jc={class:"text-sm font-medium text-texto"},Yc={key:1,class:"text-xs text-tenue mt-1 max-w-sm"},Qc={class:"mt-4"},Di={__name:"UiEmptyState",props:{icono:{type:String,default:""},titulo:String,detalle:String},setup(e){return(t,n)=>(k(),I("div",Wc,[e.icono?(k(),I("div",zc,D(e.icono),1)):te("",!0),u("p",Jc,D(e.titulo),1),e.detalle?(k(),I("p",Yc,D(e.detalle),1)):te("",!0),u("div",Qc,[Hl(t.$slots,"default")])]))}},Xc={key:0,class:"mb-6"},Zc={class:"flex items-start justify-between gap-4"},ef={class:"text-xl font-semibold text-texto"},tf={class:"text-xs text-tenue mt-1"},nf={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},sf={class:"flex items-center justify-between mb-4"},of={class:"flex items-center gap-2"},rf={key:0,class:"badge-alerta"},lf={key:1,class:"badge-neutro"},af=["disabled"],uf={key:2,class:"text-xs text-tenue -mt-2 mb-4"},cf={key:3,class:"text-xs text-tenue -mt-2 mb-4"},ff={key:4,class:"grid gap-3 sm:grid-cols-2"},df=["disabled"],pf={key:6,class:"grid gap-3 sm:grid-cols-2"},hf={class:"flex items-start gap-3"},mf={class:"min-w-0 flex-1"},gf={class:"flex items-center gap-2"},vf={class:"font-medium text-texto truncate"},bf={class:"text-xs text-tenue mt-0.5 truncate"},_f={class:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"},xf=["onClick"],yf=["onClick"],wf={class:"flex items-center gap-4 mt-3.5 pt-3 border-t border-borde text-xs text-tenue"},Cf={class:"tabular-nums"},Ef={class:"text-texto font-medium"},Sf={class:"tabular-nums"},Af={class:"text-texto font-medium"},Rf={class:"tabular-nums"},kf={class:"text-texto font-medium"},If={class:"bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 w-full max-w-lg"},Of={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},Pf=["value"],Tf={class:"flex items-center gap-2"},$f={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},Nf={class:"flex justify-end gap-2 pt-2"},Df={type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},Mf={__name:"TenantAgentes",props:{id:{type:String,required:!0}},setup(e){const t=e,n=be(()=>Number(t.id)),s=Pi(),o=X(null),r=X([]),i=X([]),l=X(""),a=X(!1),d=X(null),c=X(N()),h=X(null),g=X({}),b=X(!0);function U(x){const j=g.value[x.ID]||{};return x.activo?j.documentos>0?{tipo:"ok",texto:"listo"}:{tipo:"alerta",texto:"sin conocimiento"}:{tipo:"neutro",texto:"inactivo"}}function P(x){const j=g.value[x.ID]||{};return{documentos:j.documentos||0,canales:j.canales||0,conversaciones:j.conversaciones_7d||0}}function G(x){return String(x||"?").trim().split(/\s+/).slice(0,2).map(j=>j[0]).join("").toUpperCase()}const H=be(()=>{if(!h.value)return{sinPlan:!0};const x=h.value.max_agentes||0;return{sinPlan:!1,nombre:h.value.nombre,ilimitado:x<=0,max:x,usados:r.value.length,lleno:x>0&&r.value.length>=x}});function N(){return{nombre:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",color:"#8eb02f",activo:!0}}async function B(){l.value="",b.value=!0;try{const[x,j,Ae]=await Promise.all([ue.get(ae("/umind/tenants")),ue.get(ae(`/umind/agentes?tenant_id=${t.id}`)),ue.get(ae("/umind/ai-configs"))]);o.value=(x.items||[]).find(J=>String(J.ID)===t.id)||null,r.value=j.items||[],h.value=j.plan||null,g.value=j.resumen||{},i.value=Ae.items||[]}catch(x){l.value=x.message}finally{b.value=!1}}function O(){d.value=null,c.value=N(),a.value=!0}function S(x){d.value=x,c.value={nombre:x.nombre,ai_config_id:x.ai_config_id,tono:x.tono,mensaje_bienvenida:x.mensaje_bienvenida,color:x.color||"#8eb02f",activo:x.activo},a.value=!0}async function M(){try{if(d.value)await ue.put(ae(`/umind/agentes/${d.value.ID}`),{tenant_id:n.value,...c.value}),a.value=!1,await B();else{const x=await ue.post(ae("/umind/agentes"),{tenant_id:n.value,...c.value});a.value=!1,s.push(`/tenants/${n.value}/agentes/${x.id}`)}}catch(x){l.value=x.message}}async function Z(x){confirm(`¿Eliminar el agente "${x.nombre}"? Esto no se puede deshacer.`)&&(await ue.del(ae(`/umind/agentes/${x.ID}`)),await B())}return Bt(()=>t.id,B,{immediate:!0}),(x,j)=>{const Ae=Nn("router-link");return k(),I("div",null,[o.value?(k(),I("div",Xc,[u("div",Zc,[u("div",null,[u("h1",ef,D(o.value.nombre),1),u("p",tf,D(o.value.dominios_permitidos||"sin dominios configurados"),1)]),we(Ae,{to:`/tenants/${n.value??e.id}/uso`,class:"btn-ghost"},{default:Nt(()=>[...j[9]||(j[9]=[xe("📊 Consumo",-1)])]),_:1},8,["to"])])])):te("",!0),l.value?(k(),I("p",nf,D(l.value),1)):te("",!0),u("div",sf,[u("div",of,[j[10]||(j[10]=u("h2",{class:"text-sm font-medium text-tenue"},"Agentes",-1)),H.value.sinPlan?(k(),I("span",rf,"sin plan · sin límite")):H.value.ilimitado?(k(),I("span",lf,D(H.value.nombre)+" · ilimitado",1)):(k(),I("span",{key:2,class:Ie(H.value.lleno?"badge-alerta":"badge-neutro")},D(H.value.nombre)+" · "+D(H.value.usados)+" de "+D(H.value.max),3))]),u("button",{class:"btn-primary",disabled:H.value.lleno,onClick:O},"+ Nuevo agente",8,af)]),H.value.sinPlan&&!Te(Ze).esPortal?(k(),I("p",uf," Este tenant no tiene plan asignado, así que no se le aplica ningún límite de agentes. Asignale uno desde el lápiz del tenant en la barra izquierda. ")):H.value.lleno?(k(),I("p",cf," Alcanzaste el máximo de agentes de tu plan. ")):te("",!0),b.value?(k(),I("div",ff,[(k(),I(ce,null,ke(2,J=>u("div",{key:J,class:"card p-4 animate-pulse"},[...j[11]||(j[11]=[va('<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?(k(),nn(Di,{key:5,class:"card",icono:"🤖",titulo:"Todavía no hay agentes",detalle:"Creá el primero y cargale su base de conocimiento para que empiece a responder."},{default:Nt(()=>[u("button",{class:"btn-primary",disabled:H.value.lleno,onClick:O},"+ Crear el primer agente",8,df)]),_:1})):(k(),I("div",pf,[(k(!0),I(ce,null,ke(r.value,J=>(k(),nn(Ae,{key:J.ID,to:`/tenants/${n.value}/agentes/${J.ID}`,class:"card p-4 relative group hover:shadow-lg hover:-translate-y-0.5 transition-all overflow-hidden"},{default:Nt(()=>[u("span",{class:"absolute inset-x-0 top-0 h-1",style:Kt({background:J.color||"#8eb02f"})},null,4),u("div",hf,[u("span",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-semibold shrink-0",style:Kt({background:J.color||"#8eb02f",opacity:J.activo?1:.4})},D(G(J.nombre)),5),u("div",mf,[u("div",gf,[u("span",vf,D(J.nombre),1),u("span",{class:Ie(`badge-${U(J).tipo}`)},D(U(J).texto),3)]),u("p",bf,D(J.tono||"sin tono definido"),1)]),u("div",_f,[u("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Ye(Xe=>S(J),["prevent","stop"])},"✎",8,xf),u("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Ye(Xe=>Z(J),["prevent","stop"])},"✕",8,yf)])]),u("div",wf,[u("span",Cf,[u("b",Ef,D(P(J).conversaciones),1),j[12]||(j[12]=xe(" conversaciones · 7d",-1))]),u("span",Sf,[u("b",Af,D(P(J).documentos),1),j[13]||(j[13]=xe(" fuentes",-1))]),u("span",Rf,[u("b",kf,D(P(J).canales),1),j[14]||(j[14]=xe(" canales",-1))])])]),_:2},1032,["to"]))),128))])),a.value?(k(),I("div",{key:7,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:j[8]||(j[8]=Ye(J=>a.value=!1,["self"]))},[u("div",If,[u("h2",Of,D(d.value?"Editar agente":"Nuevo agente"),1),u("form",{class:"space-y-3",onSubmit:Ye(M,["prevent"])},[u("div",null,[j[15]||(j[15]=u("label",{class:"label"},"Nombre",-1)),re(u("input",{"onUpdate:modelValue":j[0]||(j[0]=J=>c.value.nombre=J),required:"",placeholder:"ej: Ventas, Soporte",class:"input"},null,512),[[_e,c.value.nombre]])]),u("div",null,[j[17]||(j[17]=u("label",{class:"label"},"Config de IA",-1)),re(u("select",{"onUpdate:modelValue":j[1]||(j[1]=J=>c.value.ai_config_id=J),class:"input"},[j[16]||(j[16]=u("option",{value:null},"— sin asignar —",-1)),(k(!0),I(ce,null,ke(i.value,J=>(k(),I("option",{key:J.ID,value:J.ID},D(J.nombre)+" ("+D(J.provider)+")",9,Pf))),128))],512),[[In,c.value.ai_config_id]])]),u("div",null,[j[18]||(j[18]=u("label",{class:"label"},"Tono / personalidad",-1)),re(u("textarea",{"onUpdate:modelValue":j[2]||(j[2]=J=>c.value.tono=J),rows:"2",class:"input"},null,512),[[_e,c.value.tono]])]),u("div",null,[j[19]||(j[19]=u("label",{class:"label"},"Mensaje de bienvenida",-1)),re(u("input",{"onUpdate:modelValue":j[3]||(j[3]=J=>c.value.mensaje_bienvenida=J),class:"input"},null,512),[[_e,c.value.mensaje_bienvenida]])]),u("div",null,[j[20]||(j[20]=u("label",{class:"label"},"Color del widget",-1)),u("div",Tf,[re(u("input",{"onUpdate:modelValue":j[4]||(j[4]=J=>c.value.color=J),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),[[_e,c.value.color]]),re(u("input",{"onUpdate:modelValue":j[5]||(j[5]=J=>c.value.color=J),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),[[_e,c.value.color]])])]),u("label",$f,[re(u("input",{"onUpdate:modelValue":j[6]||(j[6]=J=>c.value.activo=J),type:"checkbox"},null,512),[[Ut,c.value.activo]]),j[21]||(j[21]=xe(" Activo ",-1))]),u("div",Nf,[u("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:j[7]||(j[7]=J=>a.value=!1)},"Cancelar"),u("button",Df,D(d.value?"Guardar":"Crear"),1)])],32)])])):te("",!0)])}}},Vf={key:0,class:"mb-6 mt-1 flex items-start justify-between gap-4"},jf={class:"min-w-0"},Uf={class:"text-xl font-semibold text-texto"},Lf={class:"text-xs text-tenue mt-1"},Ff={class:"bg-elevado px-1.5 py-0.5 rounded"},Hf=["href"],Bf={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Kf={class:"flex gap-1.5 mb-6 overflow-x-auto pb-1"},Gf=["onClick"],qf={key:2},Wf=["disabled"],zf={class:"card divide-y divide-borde"},Jf={key:0,class:"p-6 text-sm text-tenue"},Yf={class:"text-sm text-texto"},Qf={class:"text-xs text-tenue mt-0.5"},Xf={key:0},Zf={key:1,class:"text-red-600 dark:text-red-400"},ed=["onClick"],td={key:3},nd={class:"card divide-y divide-borde"},sd={key:0,class:"p-6 text-sm text-tenue"},od={class:"text-sm text-texto font-mono"},rd={class:"label mt-0.5"},id={class:"text-xs text-tenue mt-0.5"},ld={key:0,class:"ml-1 text-green-600 dark:text-green-400"},ad={key:1,class:"ml-1 text-gray-400"},ud={class:"flex gap-3 text-sm shrink-0"},cd=["onClick"],fd=["onClick"],dd={class:"card p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},pd={class:"font-semibold text-texto mb-4"},hd={class:"border border-borde rounded-lg p-3 space-y-2"},md=["onUpdate:modelValue"],gd=["onUpdate:modelValue"],vd=["onUpdate:modelValue"],bd={class:"label flex items-center gap-1"},_d=["onUpdate:modelValue"],xd=["onClick"],yd={key:0,class:"text-xs text-gray-400"},wd={class:"border border-borde rounded-lg p-3 space-y-2"},Cd={class:"flex items-center gap-2 label"},Ed={class:"flex items-center gap-2 text-sm text-texto"},Sd={class:"flex justify-end gap-2 pt-2"},Ad={key:4},Rd={class:"card p-4 mb-4"},kd={class:"flex items-center justify-between mb-2"},Id={class:"bg-elevado border border-borde rounded-lg p-2.5 text-xs text-texto overflow-x-auto"},Od={class:"card divide-y divide-borde"},Pd={key:0,class:"p-6 text-sm text-tenue"},Td={class:"flex items-center justify-between"},$d={class:"font-medium text-texto capitalize"},Nd={class:"flex gap-3 text-sm"},Dd=["onClick"],Md=["onClick"],Vd={class:"flex gap-4 mt-2 text-xs"},jd={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Ud=["checked","onChange"],Ld={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Fd=["checked","onChange"],Hd={class:"label mt-1 break-all"},Bd={class:"bg-elevado px-1 rounded"},Kd={key:0,class:"text-xs text-tenue mt-1"},Gd={key:1,class:"text-xs text-red-600 dark:text-red-400 mt-1"},qd={class:"card p-6 w-full max-w-md"},Wd={key:0},zd={class:"flex flex-col gap-2 pt-1"},Jd={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Yd={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Qd={class:"flex justify-end gap-2 pt-2"},Xd={key:5},Zd={class:"flex gap-2 mb-4"},ep={class:"card divide-y divide-borde"},tp={key:0,class:"p-6 text-sm text-tenue"},np={class:"font-medium text-texto capitalize"},sp={class:"ml-2 text-sm text-tenue"},op=["onClick"],rp={key:6,class:"card p-4 flex flex-col h-[28rem]"},ip={class:"flex-1 overflow-y-auto space-y-2 mb-3"},lp={key:0,class:"text-sm text-tenue"},ap={key:1,class:"text-xs text-tenue"},up=["disabled"],cp={key:7,class:"grid grid-cols-3 gap-4"},fp={class:"col-span-1 card divide-y divide-borde max-h-[28rem] overflow-y-auto"},dp={key:0,class:"p-4 text-sm text-tenue"},pp=["onClick"],hp={class:"text-texto truncate"},mp={class:"text-xs text-tenue mt-0.5"},gp={class:"col-span-2 card p-4 max-h-[28rem] overflow-y-auto space-y-2"},vp={key:0,class:"text-sm text-tenue"},bp={key:8},_p={class:"card divide-y divide-borde max-h-[32rem] overflow-y-auto"},xp={key:0,class:"p-6 text-sm text-tenue"},yp={class:"cursor-pointer flex items-center gap-2 text-sm"},wp={class:"text-tenue text-xs shrink-0"},Cp={class:"text-texto truncate"},Ep={class:"text-tenue text-xs ml-auto shrink-0"},Sp={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"},Ap={__name:"AgenteDetail",props:{tenantId:{type:String,required:!0},agenteId:{type:String,required:!0}},setup(e){const t=e,n=be(()=>Number(t.agenteId)),s=Ti(),o=X(null),r=X(""),i=X(typeof s.query.tab=="string"?s.query.tab:"conocimiento"),l=X([]),a=X(""),d=X(30),c=X(!1);async function h(){const C=await ue.get(ae(`/umind/agentes?tenant_id=${t.tenantId}`));o.value=(C.items||[]).find(v=>String(v.ID)===t.agenteId)||null}async function g(){const C=await ue.get(ae(`/umind/documentos?agente_id=${t.agenteId}`));l.value=C.items||[]}async function b(){if(a.value.trim()){c.value=!0,r.value="";try{await ue.post(ae("/umind/documentos"),{agente_id:n.value,url:a.value.trim(),max_paginas:Number(d.value)||30}),a.value="",await g()}catch(C){r.value=C.message}finally{c.value=!1}}}async function U(C){confirm("¿Eliminar esta fuente y sus fragmentos indexados?")&&(await ue.del(ae(`/umind/documentos/${C}`)),await g())}const P=be(()=>C=>({listo:"badge-ok",procesando:"badge-alerta",pendiente:"badge-neutro",error:"badge-error"})[C]||"badge-neutro"),G=X([]),H=X([]),N=X(null);async function B(){const C=await ue.get(ae(`/umind/sesiones?agente_id=${t.agenteId}`));G.value=C.items||[]}async function O(C){N.value=C;const v=await ue.get(ae(`/umind/historial?agente_id=${t.agenteId}&session_id=${C}`));H.value=v.items||[]}const S=X([]),M=X(!1),Z=X(null),x=X(j());function j(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}async function Ae(){const C=await ue.get(ae(`/umind/tools?agente_id=${t.agenteId}`));S.value=C.items||[]}function J(){Z.value=null,x.value=j(),M.value=!0}function Xe(C){Z.value=C;let v=[];try{v=JSON.parse(C.parametros_json||"[]")||[]}catch{v=[]}x.value={nombre:C.nombre,descripcion:C.descripcion,url:C.url,auth_header_nombre:C.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:v,activa:C.activa},M.value=!0}function ze(){x.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function Dt(C){x.value.parametros.splice(C,1)}async function kt(){const C={agente_id:n.value,nombre:x.value.nombre.trim(),descripcion:x.value.descripcion,url:x.value.url.trim(),auth_header_nombre:x.value.auth_header_nombre,parametros:x.value.parametros,activa:x.value.activa};x.value.tocarAuth&&(C.auth_header_valor=x.value.auth_header_valor);try{Z.value?await ue.put(ae(`/umind/tools/${Z.value.ID}`),C):await ue.post(ae("/umind/tools"),C),M.value=!1,await Ae()}catch(v){r.value=v.message}}async function Ee(C){confirm(`¿Eliminar la tool "${C.nombre}"?`)&&(await ue.del(ae(`/umind/tools/${C.ID}`)),await Ae())}const ie=X([]),se=X(!1),ne=X(gt()),Ge=X(!1),Je=be(()=>{const C=new Date,v=new Date(C.getFullYear(),C.getMonth(),1).toISOString().slice(0,10),fe=C.toISOString().slice(0,10);return ae(`/umind/reporte.xlsx?agente_id=${t.agenteId}&desde=${v}&hasta=${fe}`)}),Oe=be(()=>{var v;const C=((v=o.value)==null?void 0:v.site_key)||"TU_SITE_KEY";return`<script src="${window.location.origin}/widget/umind.js" data-site="${C}" defer><\/script>`});async function It(){try{await navigator.clipboard.writeText(Oe.value),Ge.value=!0,setTimeout(()=>Ge.value=!1,2e3)}catch{r.value="No se pudo copiar automáticamente — seleccioná el texto y copialo a mano."}}function gt(){return{tipo:"telegram",bot_token:"",phone_number_id:"",access_token:"",app_secret:"",verify_token:"",usar_whisper_audio:!1,usar_ocr_imagenes:!1}}async function He(){const C=await ue.get(ae(`/umind/canales?agente_id=${t.agenteId}`));ie.value=C.items||[]}function Be(){ne.value=gt(),se.value=!0}async function E(){const C=ne.value.tipo==="telegram"?{bot_token:ne.value.bot_token}:{phone_number_id:ne.value.phone_number_id,access_token:ne.value.access_token,app_secret:ne.value.app_secret,verify_token:ne.value.verify_token};try{await ue.post(ae("/umind/canales"),{agente_id:n.value,tipo:ne.value.tipo,credenciales:C,activo:!0,usar_whisper_audio:ne.value.usar_whisper_audio,usar_ocr_imagenes:ne.value.usar_ocr_imagenes}),se.value=!1,await He()}catch(v){r.value=v.message}}async function K(C){await ue.put(ae(`/umind/canales/${C.ID}`),{activo:!C.activo,credenciales:{},usar_whisper_audio:C.usar_whisper_audio,usar_ocr_imagenes:C.usar_ocr_imagenes}),await He()}async function L(C){await ue.put(ae(`/umind/canales/${C.ID}`),{activo:C.activo,credenciales:{},usar_whisper_audio:!C.usar_whisper_audio,usar_ocr_imagenes:C.usar_ocr_imagenes}),await He()}async function q(C){await ue.put(ae(`/umind/canales/${C.ID}`),{activo:C.activo,credenciales:{},usar_whisper_audio:C.usar_whisper_audio,usar_ocr_imagenes:!C.usar_ocr_imagenes}),await He()}async function oe(C){confirm(`¿Eliminar el canal ${C.tipo}?`)&&(await ue.del(ae(`/umind/canales/${C.ID}`)),await He())}const f=X([]);async function p(){const C=await ue.get(ae(`/umind/conexiones?agente_id=${t.agenteId}`));f.value=C.items||[]}function m(C){window.location.href=ae(`/umind/conexiones/conectar?agente_id=${n.value}&proveedor=${C}`)}async function w(C){confirm(`¿Desconectar la cuenta ${C.email||C.proveedor}?`)&&(await ue.del(ae(`/umind/conexiones/${C.ID}`)),await p())}const A=`staff-preview-${Math.random().toString(36).slice(2)}`,y=X([]),V=X(""),T=X(!1);async function $(){const C=V.value.trim();if(!(!C||T.value)){V.value="",y.value.push({role:"user",content:C}),T.value=!0;try{const v=await ue.post(ae("/umind/chat"),{agente_id:n.value,session_id:A,mensaje:C});y.value.push({role:"assistant",content:v.respuesta})}catch(v){y.value.push({role:"assistant",content:`⚠️ ${v.message}`})}finally{T.value=!1}}}const R=[["conocimiento","Base de conocimiento"],["herramientas","Herramientas"],["canales","Canales"],["conexiones","Conexiones"],["chat","Chat de prueba"],["conversaciones","Conversaciones"],["auditoria","Auditoría"]],W=X([]);async function F(){const C=await ue.get(ae(`/umind/eventos?agente_id=${t.agenteId}`));W.value=C.items||[]}const z=be(()=>C=>({error:"badge-error",warn:"badge-alerta"})[C]||"badge-neutro");function Q(C){try{return new Date(C).toLocaleString()}catch{return C}}return Bt(()=>[t.tenantId,t.agenteId],async()=>{r.value="",o.value=null,l.value=[],G.value=[],H.value=[],N.value=null,S.value=[],ie.value=[],f.value=[],W.value=[];try{await Promise.all([h(),g(),B(),Ae(),He(),p(),F()])}catch(C){r.value=C.message}},{immediate:!0}),(C,v)=>{const fe=Nn("router-link");return k(),I("div",null,[we(fe,{to:`/tenants/${e.tenantId}`,class:"label hover:text-brand"},{default:Nt(()=>[...v[24]||(v[24]=[xe("← Agentes",-1)])]),_:1},8,["to"]),o.value?(k(),I("div",Vf,[u("div",jf,[u("h1",Uf,D(o.value.nombre),1),u("p",Lf,[v[25]||(v[25]=xe(" site_key: ",-1)),u("code",Ff,D(o.value.site_key),1)])]),u("a",{href:Je.value,class:"btn-ghost shrink-0",title:"Conversaciones y consumo del mes en Excel"}," ⬇ Reporte del mes ",8,Hf)])):te("",!0),r.value?(k(),I("p",Bf,D(r.value),1)):te("",!0),u("div",Kf,[(k(),I(ce,null,ke(R,([_,le])=>u("button",{key:_,class:Ie(["px-3 py-1.5 rounded-full text-sm whitespace-nowrap transition-colors",i.value===_?"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:Se=>i.value=_},D(le),11,Gf)),64))]),i.value==="conocimiento"?(k(),I("div",qf,[u("form",{class:"flex gap-2 mb-4",onSubmit:Ye(b,["prevent"])},[re(u("input",{"onUpdate:modelValue":v[0]||(v[0]=_=>a.value=_),type:"url",placeholder:"https://ejemplo.com",required:"",class:"flex-1 border border-borde bg-white dark:bg-gray-900 text-texto rounded-lg px-3 py-2 text-sm"},null,512),[[_e,a.value]]),re(u("input",{"onUpdate:modelValue":v[1]||(v[1]=_=>d.value=_),type:"number",min:"1",max:"200",class:"w-24 border border-borde bg-white dark:bg-gray-900 text-texto rounded-lg px-3 py-2 text-sm",title:"Máximo de páginas a crawlear"},null,512),[[_e,d.value]]),u("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50 transition-colors"},D(c.value?"Agregando...":"Crawlear sitio"),9,Wf)],32),u("div",zf,[l.value.length===0?(k(),I("div",Jf,"Sin fuentes todavía.")):te("",!0),(k(!0),I(ce,null,ke(l.value,_=>(k(),I("div",{key:_.ID,class:"p-4 flex items-center justify-between"},[u("div",null,[u("div",Yf,D(_.origen),1),u("div",Qf,[u("span",{class:Ie(["px-1.5 py-0.5 rounded",P.value(_.estado)])},D(_.estado),3),_.total_chunks?(k(),I("span",Xf," · "+D(_.total_chunks)+" fragmentos",1)):te("",!0),_.error?(k(),I("span",Zf," · "+D(_.error),1)):te("",!0)])]),u("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:le=>U(_.ID)},"Eliminar",8,ed)]))),128))])])):i.value==="herramientas"?(k(),I("div",td,[u("div",{class:"flex justify-between items-center mb-4"},[v[26]||(v[26]=u("p",{class:"label"},"Máximo 10 tools activas por agente.",-1)),u("button",{class:"btn-primary",onClick:J}," + Nueva tool ")]),u("div",nd,[S.value.length===0?(k(),I("div",sd,"Sin tools custom todavía.")):te("",!0),(k(!0),I(ce,null,ke(S.value,_=>(k(),I("div",{key:_.ID,class:"p-4 flex items-center justify-between"},[u("div",null,[u("div",od,D(_.nombre),1),u("div",rd,D(_.descripcion),1),u("div",id,[xe(D(_.url)+" ",1),_.auth_configurado?(k(),I("span",ld,"· auth configurada")):te("",!0),_.activa?te("",!0):(k(),I("span",ad,"· inactiva"))])]),u("div",ud,[u("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:le=>Xe(_)},"Editar",8,cd),u("button",{class:"text-red-500 hover:text-red-700",onClick:le=>Ee(_)},"Eliminar",8,fd)])]))),128))]),M.value?(k(),I("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:v[10]||(v[10]=Ye(_=>M.value=!1,["self"]))},[u("div",dd,[u("h2",pd,D(Z.value?"Editar tool":"Nueva tool"),1),u("form",{class:"space-y-3",onSubmit:Ye(kt,["prevent"])},[u("div",null,[v[27]||(v[27]=u("label",{class:"label"},"Nombre (identificador, ej: consultar_stock)",-1)),re(u("input",{"onUpdate:modelValue":v[2]||(v[2]=_=>x.value.nombre=_),required:"",pattern:"[a-z][a-z0-9_]{2,63}",class:"input font-mono"},null,512),[[_e,x.value.nombre]])]),u("div",null,[v[28]||(v[28]=u("label",{class:"label"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),re(u("textarea",{"onUpdate:modelValue":v[3]||(v[3]=_=>x.value.descripcion=_),rows:"2",required:"",class:"input"},null,512),[[_e,x.value.descripcion]])]),u("div",null,[v[29]||(v[29]=u("label",{class:"label"},"URL del webhook (https)",-1)),re(u("input",{"onUpdate:modelValue":v[4]||(v[4]=_=>x.value.url=_),type:"url",required:"",placeholder:"https://...",class:"input"},null,512),[[_e,x.value.url]])]),u("div",hd,[u("div",{class:"flex items-center justify-between"},[v[30]||(v[30]=u("label",{class:"label"},"Parámetros que completa el modelo",-1)),u("button",{type:"button",class:"text-xs text-brand",onClick:ze},"+ agregar")]),(k(!0),I(ce,null,ke(x.value.parametros,(_,le)=>(k(),I("div",{key:le,class:"flex gap-2 items-center"},[re(u("input",{"onUpdate:modelValue":Se=>_.nombre=Se,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,md),[[_e,_.nombre]]),re(u("select",{"onUpdate:modelValue":Se=>_.tipo=Se,class:"border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},[...v[31]||(v[31]=[u("option",{value:"string"},"string",-1),u("option",{value:"number"},"number",-1),u("option",{value:"boolean"},"boolean",-1)])],8,gd),[[In,_.tipo]]),re(u("input",{"onUpdate:modelValue":Se=>_.descripcion=Se,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,vd),[[_e,_.descripcion]]),u("label",bd,[re(u("input",{"onUpdate:modelValue":Se=>_.requerido=Se,type:"checkbox"},null,8,_d),[[Ut,_.requerido]]),v[32]||(v[32]=xe(" req. ",-1))]),u("button",{type:"button",class:"text-red-400 text-xs",onClick:Se=>Dt(le)},"✕",8,xd)]))),128)),x.value.parametros.length===0?(k(),I("p",yd,"Sin parámetros.")):te("",!0)]),u("div",wd,[v[33]||(v[33]=u("label",{class:"label"},"Autenticación saliente (opcional)",-1)),re(u("input",{"onUpdate:modelValue":v[5]||(v[5]=_=>x.value.auth_header_nombre=_),placeholder:"Nombre del header, ej: Authorization",class:"input"},null,512),[[_e,x.value.auth_header_nombre]]),u("label",Cd,[re(u("input",{"onUpdate:modelValue":v[6]||(v[6]=_=>x.value.tocarAuth=_),type:"checkbox"},null,512),[[Ut,x.value.tocarAuth]]),xe(" "+D(Z.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),x.value.tocarAuth?re((k(),I("input",{key:0,"onUpdate:modelValue":v[7]||(v[7]=_=>x.value.auth_header_valor=_),type:"password",placeholder:"Valor del header (ej: Bearer xxxx)",class:"input"},null,512)),[[_e,x.value.auth_header_valor]]):te("",!0)]),u("label",Ed,[re(u("input",{"onUpdate:modelValue":v[8]||(v[8]=_=>x.value.activa=_),type:"checkbox"},null,512),[[Ut,x.value.activa]]),v[34]||(v[34]=xe(" Activa ",-1))]),u("div",Sd,[u("button",{type:"button",class:"btn-ghost",onClick:v[9]||(v[9]=_=>M.value=!1)},"Cancelar"),v[35]||(v[35]=u("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):te("",!0)])):i.value==="canales"?(k(),I("div",Ad,[u("div",Rd,[u("div",kd,[v[36]||(v[36]=u("div",null,[u("span",{class:"font-medium text-texto"},"Web (widget)"),u("span",{class:"ml-2 px-1.5 py-0.5 rounded text-xs badge-ok"}," siempre activo ")],-1)),u("button",{class:Ie(["text-sm font-medium px-3 py-1.5 rounded-lg transition-colors",Ge.value?"bg-green-600 text-white":"bg-brand hover:bg-brand-dark text-white"]),onClick:It},D(Ge.value?"✓ Copiado":"Copiar código"),3)]),v[37]||(v[37]=u("p",{class:"label mb-2"},[xe(" Pegá esto antes de "),u("code",{class:"bg-elevado px-1 rounded"},"</body>"),xe(" en las páginas de tu sitio. ")],-1)),u("pre",Id,[u("code",null,D(Oe.value),1)])]),u("div",{class:"flex justify-end mb-4"},[u("button",{class:"btn-primary",onClick:Be}," + Nuevo canal ")]),u("div",Od,[ie.value.length===0?(k(),I("div",Pd,"Sin canales configurados.")):te("",!0),(k(!0),I(ce,null,ke(ie.value,_=>(k(),I("div",{key:_.ID,class:"p-4"},[u("div",Td,[u("div",null,[u("span",$d,D(_.tipo),1),u("span",{class:Ie(["ml-2 px-1.5 py-0.5 rounded text-xs",_.activo?"badge-ok":"badge-neutro"])},D(_.activo?"activo":"inactivo"),3)]),u("div",Nd,[u("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:le=>K(_)},D(_.activo?"Desactivar":"Activar"),9,Dd),u("button",{class:"text-red-500 hover:text-red-700",onClick:le=>oe(_)},"Eliminar",8,Md)])]),u("div",Vd,[u("label",jd,[u("input",{type:"checkbox",checked:_.usar_whisper_audio,onChange:le=>L(_),class:"rounded border-borde text-brand focus:ring-brand"},null,40,Ud),v[38]||(v[38]=xe(" Transcribir audios (Whisper) ",-1))]),u("label",Ld,[u("input",{type:"checkbox",checked:_.usar_ocr_imagenes,onChange:le=>q(_),class:"rounded border-borde text-brand focus:ring-brand"},null,40,Fd),v[39]||(v[39]=xe(" Leer texto de imágenes (OCR) ",-1))])]),u("p",Hd,[v[40]||(v[40]=xe(" Webhook: ",-1)),u("code",Bd,D(_.webhook_url),1)]),_.tipo==="whatsapp"?(k(),I("p",Kd,' Registrá esta URL como "Callback URL" en Meta for Developers → WhatsApp → Configuration, con el mismo verify_token que pusiste acá. ')):te("",!0),_.ultimo_error?(k(),I("p",Gd,D(_.ultimo_error),1)):te("",!0)]))),128))]),se.value?(k(),I("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:v[20]||(v[20]=Ye(_=>se.value=!1,["self"]))},[u("div",qd,[v[51]||(v[51]=u("h2",{class:"font-semibold text-texto mb-4"},"Nuevo canal",-1)),u("form",{class:"space-y-3",onSubmit:Ye(E,["prevent"])},[u("div",null,[v[42]||(v[42]=u("label",{class:"label"},"Tipo",-1)),re(u("select",{"onUpdate:modelValue":v[11]||(v[11]=_=>ne.value.tipo=_),class:"input"},[...v[41]||(v[41]=[u("option",{value:"telegram"},"Telegram",-1),u("option",{value:"whatsapp"},"WhatsApp Business",-1)])],512),[[In,ne.value.tipo]])]),ne.value.tipo==="telegram"?(k(),I("div",Wd,[v[43]||(v[43]=u("label",{class:"label"},"Bot token (de @BotFather)",-1)),re(u("input",{"onUpdate:modelValue":v[12]||(v[12]=_=>ne.value.bot_token=_),type:"password",required:"",class:"input"},null,512),[[_e,ne.value.bot_token]])])):(k(),I(ce,{key:1},[u("div",null,[v[44]||(v[44]=u("label",{class:"label"},"Phone Number ID",-1)),re(u("input",{"onUpdate:modelValue":v[13]||(v[13]=_=>ne.value.phone_number_id=_),required:"",class:"input"},null,512),[[_e,ne.value.phone_number_id]])]),u("div",null,[v[45]||(v[45]=u("label",{class:"label"},"Access Token",-1)),re(u("input",{"onUpdate:modelValue":v[14]||(v[14]=_=>ne.value.access_token=_),type:"password",required:"",class:"input"},null,512),[[_e,ne.value.access_token]])]),u("div",null,[v[46]||(v[46]=u("label",{class:"label"},"App Secret",-1)),re(u("input",{"onUpdate:modelValue":v[15]||(v[15]=_=>ne.value.app_secret=_),type:"password",required:"",class:"input"},null,512),[[_e,ne.value.app_secret]])]),u("div",null,[v[47]||(v[47]=u("label",{class:"label"},"Verify Token (lo inventás vos, lo vas a usar en Meta)",-1)),re(u("input",{"onUpdate:modelValue":v[16]||(v[16]=_=>ne.value.verify_token=_),required:"",class:"input"},null,512),[[_e,ne.value.verify_token]])])],64)),u("div",zd,[u("label",Jd,[re(u("input",{type:"checkbox","onUpdate:modelValue":v[17]||(v[17]=_=>ne.value.usar_whisper_audio=_),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Ut,ne.value.usar_whisper_audio]]),v[48]||(v[48]=xe(" Transcribir audios con Whisper ",-1))]),u("label",Yd,[re(u("input",{type:"checkbox","onUpdate:modelValue":v[18]||(v[18]=_=>ne.value.usar_ocr_imagenes=_),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Ut,ne.value.usar_ocr_imagenes]]),v[49]||(v[49]=xe(" Leer texto de imágenes con OCR ",-1))])]),u("div",Qd,[u("button",{type:"button",class:"btn-ghost",onClick:v[19]||(v[19]=_=>se.value=!1)},"Cancelar"),v[50]||(v[50]=u("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):te("",!0)])):i.value==="conexiones"?(k(),I("div",Xd,[v[52]||(v[52]=u("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)),u("div",Zd,[u("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[21]||(v[21]=_=>m("google"))}," Conectar Google "),u("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[22]||(v[22]=_=>m("microsoft"))}," Conectar Outlook ")]),u("div",ep,[f.value.length===0?(k(),I("div",tp,"Sin cuentas conectadas.")):te("",!0),(k(!0),I(ce,null,ke(f.value,_=>(k(),I("div",{key:_.ID,class:"p-4 flex items-center justify-between"},[u("div",null,[u("span",np,D(_.proveedor),1),u("span",sp,D(_.email),1),u("span",{class:Ie(["ml-2 px-1.5 py-0.5 rounded text-xs",_.activo?"badge-ok":"badge-neutro"])},D(_.activo?"activa":"inactiva"),3)]),u("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:le=>w(_)},"Desconectar",8,op)]))),128))])])):i.value==="chat"?(k(),I("div",rp,[u("div",ip,[y.value.length===0?(k(),I("p",lp," Probá este agente tal cual lo va a ver un visitante — usa la misma config de IA y las mismas tools/base de conocimiento. ")):te("",!0),(k(!0),I(ce,null,ke(y.value,(_,le)=>(k(),I("div",{key:le,class:Ie(["max-w-[80%] px-3 py-2 rounded-lg text-sm whitespace-pre-wrap",_.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},D(_.content),3))),128)),T.value?(k(),I("p",ap,"Pensando...")):te("",!0)]),u("form",{class:"flex gap-2",onSubmit:Ye($,["prevent"])},[re(u("input",{"onUpdate:modelValue":v[23]||(v[23]=_=>V.value=_),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 input"},null,512),[[_e,V.value]]),u("button",{type:"submit",disabled:T.value,class:"btn-primary disabled:opacity-50 transition-colors"}," Enviar ",8,up)],32)])):i.value==="conversaciones"?(k(),I("div",cp,[u("div",fp,[G.value.length===0?(k(),I("div",dp,"Sin conversaciones.")):te("",!0),(k(!0),I(ce,null,ke(G.value,_=>(k(),I("button",{key:_.session_id,class:Ie(["w-full text-left p-3 hover:bg-elevado text-sm",N.value===_.session_id?"bg-gray-50 dark:bg-gray-800":""]),onClick:le=>O(_.session_id)},[u("div",hp,D(_.content),1),u("div",mp,D(_.session_id),1)],10,pp))),128))]),u("div",gp,[N.value?te("",!0):(k(),I("p",vp,"Elegí una conversación de la izquierda.")),(k(!0),I(ce,null,ke(H.value,_=>(k(),I("div",{key:_.ID,class:Ie(["max-w-[80%] px-3 py-2 rounded-lg text-sm",_.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},D(_.content),3))),128))])])):(k(),I("div",bp,[v[53]||(v[53]=u("p",{class:"label mb-4"}," Errores y eventos técnicos de este agente — fallos al llamar al AI, a tools, a correo o a los canales. Últimos 100. ",-1)),u("div",_p,[W.value.length===0?(k(),I("div",xp,"Sin eventos registrados — buena señal.")):te("",!0),(k(!0),I(ce,null,ke(W.value,_=>(k(),I("details",{key:_.ID,class:"p-3"},[u("summary",yp,[u("span",{class:Ie(["px-1.5 py-0.5 rounded text-xs shrink-0",z.value(_.nivel)])},D(_.nivel),3),u("span",wp,D(_.origen),1),u("span",Cp,D(_.mensaje),1),u("span",Ep,D(Q(_.CreatedAt)),1)]),_.detalle?(k(),I("pre",Sp,D(_.detalle),1)):te("",!0)]))),128))])]))])}}},Rp={class:"flex items-start justify-between gap-4 mb-6"},kp={class:"card p-4 mb-4"},Ip={class:"flex flex-wrap items-end gap-3"},Op={class:"flex gap-1 ml-auto"},Pp={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Tp={key:1,class:"text-sm text-tenue"},$p={class:"grid gap-3 sm:grid-cols-3 mb-4"},Np={class:"card p-4"},Dp={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},Mp={class:"card p-4"},Vp={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},jp={class:"card p-4"},Up={class:"text-lg font-semibold text-texto mt-1"},Lp={key:0,class:"text-[11px] text-tenue mt-0.5"},Fp={key:0,class:"card p-4 mb-4"},Hp={class:"flex items-center justify-between text-sm mb-2"},Bp={class:"text-tenue tabular-nums"},Kp={class:"h-2 rounded-full bg-elevado overflow-hidden"},Gp={key:0,class:"text-xs text-amber-600 dark:text-amber-400 mt-2"},qp={class:"card divide-y divide-borde mb-4"},Wp={class:"text-lg"},zp={class:"min-w-0 flex-1"},Jp={class:"text-sm text-texto"},Yp={class:"text-xs text-tenue tabular-nums"},Qp={class:"text-sm font-medium text-texto tabular-nums"},Xp={key:1,class:"card p-4"},Zp={class:"flex items-end gap-1 h-28"},eh=["title"],th={class:"flex justify-between text-[11px] text-tenue mt-2"},nh={__name:"Uso",props:{id:{type:String,required:!0}},setup(e){const t=e,n=X(!0),s=X(""),o=X(null),r=new Date,i=X(new Date(r.getFullYear(),r.getMonth(),1).toISOString().slice(0,10)),l=X(r.toISOString().slice(0,10)),a={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=O=>a[O]||{nombre:O,icono:"•",color:"#94a3b8"};async function c(){n.value=!0,s.value="";try{o.value=await ue.get(ae(`/umind/uso?tenant_id=${t.id}&desde=${i.value}&hasta=${l.value}`))}catch(O){s.value=O.message}finally{n.value=!1}}const h=be(()=>{var O,S;return((S=(O=o.value)==null?void 0:O.plan)==null?void 0:S.moneda)||"COP"}),g=be(()=>{var O;return((O=o.value)==null?void 0:O.resumen)||[]}),b=be(()=>{var O;return((O=o.value)==null?void 0:O.total_periodo)||0}),U=be(()=>{var O,S;return((S=(O=o.value)==null?void 0:O.plan)==null?void 0:S.tope_consumo_mensual)||0}),P=be(()=>U.value?Math.min(100,b.value/U.value*100):0);function G(O){return`${h.value} ${Number(O||0).toLocaleString("es-CO",{maximumFractionDigits:2})}`}function H(O){return Number(O||0).toLocaleString("es-CO",{maximumFractionDigits:0})}const N=be(()=>{var Z;const O=new Map;for(const x of((Z=o.value)==null?void 0:Z.detalle)||[]){const j=String(x.CreatedAt).slice(0,10);O.set(j,(O.get(j)||0)+(x.costo||0))}const S=[...O.entries()].sort((x,j)=>x[0].localeCompare(j[0])),M=Math.max(...S.map(x=>x[1]),0);return{dias:S,max:M}});function B(O){const S=new Date,M=new Date;M.setDate(M.getDate()-O),i.value=M.toISOString().slice(0,10),l.value=S.toISOString().slice(0,10),c()}return Bt(()=>t.id,c,{immediate:!0}),(O,S)=>{var Z;const M=Nn("router-link");return k(),I("div",null,[u("div",Rp,[S[6]||(S[6]=u("div",null,[u("h1",{class:"text-xl font-semibold text-texto"},"Consumo"),u("p",{class:"text-sm text-tenue mt-0.5"},"Lo que usaron tus agentes y cuánto cuesta.")],-1)),we(M,{to:`/tenants/${e.id}`,class:"btn-ghost"},{default:Nt(()=>[...S[5]||(S[5]=[xe("← Agentes",-1)])]),_:1},8,["to"])]),u("div",kp,[u("div",Ip,[u("div",null,[S[7]||(S[7]=u("label",{class:"label"},"Desde",-1)),re(u("input",{"onUpdate:modelValue":S[0]||(S[0]=x=>i.value=x),type:"date",class:"input !w-auto"},null,512),[[_e,i.value]])]),u("div",null,[S[8]||(S[8]=u("label",{class:"label"},"Hasta",-1)),re(u("input",{"onUpdate:modelValue":S[1]||(S[1]=x=>l.value=x),type:"date",class:"input !w-auto"},null,512),[[_e,l.value]])]),u("button",{class:"btn-primary",onClick:c},"Aplicar"),u("div",Op,[u("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:S[2]||(S[2]=x=>B(6))},"7 días"),u("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:S[3]||(S[3]=x=>B(29))},"30 días"),u("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:S[4]||(S[4]=x=>B(89))},"90 días")])])]),s.value?(k(),I("p",Pp,D(s.value),1)):te("",!0),n.value?(k(),I("p",Tp,"Cargando…")):o.value?(k(),I(ce,{key:2},[u("div",$p,[u("div",Np,[S[9]||(S[9]=u("p",{class:"text-xs text-tenue"},"Consumo del período",-1)),u("p",Dp,D(G(b.value)),1)]),u("div",Mp,[S[10]||(S[10]=u("p",{class:"text-xs text-tenue"},"Pendiente de facturar",-1)),u("p",Vp,D(G(o.value.pendiente_facturar)),1),S[11]||(S[11]=u("p",{class:"text-[11px] text-tenue mt-0.5"},"Se suma a tu próxima factura.",-1))]),u("div",jp,[S[12]||(S[12]=u("p",{class:"text-xs text-tenue"},"Plan",-1)),u("p",Up,D(((Z=o.value.plan)==null?void 0:Z.nombre)||"Sin plan"),1),o.value.plan?(k(),I("p",Lp," Mensualidad "+D(G(o.value.plan.precio_mensual)),1)):te("",!0)])]),U.value?(k(),I("div",Fp,[u("div",Hp,[S[13]||(S[13]=u("span",{class:"text-texto"},"Tope mensual",-1)),u("span",Bp,D(G(b.value))+" / "+D(G(U.value)),1)]),u("div",Kp,[u("div",{class:Ie(["h-full rounded-full transition-all duration-500",P.value>=100?"bg-red-500":P.value>=80?"bg-amber-500":"bg-brand"]),style:Kt({width:P.value+"%"})},null,6)]),P.value>=100?(k(),I("p",Gp," Superaste el tope de tu plan. El servicio sigue funcionando y el excedente se cobra en el próximo ciclo. ")):te("",!0)])):te("",!0),u("div",qp,[S[14]||(S[14]=u("div",{class:"px-4 py-3"},[u("h2",{class:"text-sm font-medium text-texto"},"Desglose")],-1)),g.value.length===0?(k(),nn(Di,{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á."})):te("",!0),(k(!0),I(ce,null,ke(g.value,x=>(k(),I("div",{key:x.tipo,class:"px-4 py-3 flex items-center gap-3"},[u("span",Wp,D(d(x.tipo).icono),1),u("div",zp,[u("p",Jp,D(d(x.tipo).nombre),1),u("p",Yp,D(H(x.cantidad))+" "+D(x.unidad)+" · "+D(H(x.eventos))+" usos ",1)]),u("span",Qp,D(G(x.costo)),1)]))),128))]),N.value.dias.length?(k(),I("div",Xp,[S[15]||(S[15]=u("h2",{class:"text-sm font-medium text-texto mb-3"},"Por día",-1)),u("div",Zp,[(k(!0),I(ce,null,ke(N.value.dias,([x,j])=>(k(),I("div",{key:x,class:"flex-1 min-w-[3px] bg-brand/70 hover:bg-brand rounded-t transition-colors",style:Kt({height:N.value.max?Math.max(2,j/N.value.max*100)+"%":"2px"}),title:`${x}: ${G(j)}`},null,12,eh))),128))]),u("div",th,[u("span",null,D(N.value.dias[0][0]),1),u("span",null,D(N.value.dias[N.value.dias.length-1][0]),1)])])):te("",!0)],64)):te("",!0)])}}},sh=fc({history:Bu(Ze.baseRuta),routes:[{path:"/",name:"home",component:qc},{path:"/tenants/:id",name:"tenant-agentes",component:Mf,props:!0},{path:"/tenants/:id/uso",name:"uso",component:nh,props:!0},{path:"/tenants/:tenantId/agentes/:agenteId",name:"agente-detail",component:Ap,props:!0}]});su(Hc).use(sh).mount("#app");
|