Files
soft_usite/public/orchestrator/assets/index-kEapBzai.js
T
Lizandro GuarnizoandClaude Opus 5 ffa24a068f feat(umind): ver qué se leyó de cada fuente, fragmento por fragmento
Una fuente crawleada decía "9 fragmentos" y nada más. Las notas y archivos al
menos tienen Editar, que muestra su texto; un sitio no tiene nada — era una
caja negra, sin forma de saber si el crawler leyó los precios o el pie de
página. Y cuando el agente contesta mal, la primera pregunta es justamente
qué tiene cargado de verdad.

Cada fuente gana un "Ver" que abre sus fragmentos tal como quedaron indexados,
numerados y en orden, con la advertencia que importa: esto es exactamente lo
que el asistente puede consultar — si acá falta algo, eso mismo le va a faltar
en las respuestas.

El botón se apaga cuando la fuente no tiene fragmentos todavía (procesando o
con error): abrir un visor vacío no informa nada.

El endpoint pasa por accesoDocumento como todos los sub-recursos, y devuelve
solo el contenido — el embedding no viaja: son miles de números que no le
sirven a nadie en pantalla.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 19:42:18 -05:00

27 lines
179 KiB
JavaScript

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