heyio 0.17.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,86 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/**
2
+ * @vue/shared v3.5.34
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function lo(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ie={},Zn=[],Ut=()=>{},Nl=()=>!1,Dr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ur=e=>e.startsWith("onUpdate:"),Je=Object.assign,co=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},fd=Object.prototype.hasOwnProperty,Oe=(e,t)=>fd.call(e,t),pe=Array.isArray,Yn=e=>zs(e)==="[object Map]",Br=e=>zs(e)==="[object Set]",Uo=e=>zs(e)==="[object Date]",Ee=e=>typeof e=="function",Ue=e=>typeof e=="string",yt=e=>typeof e=="symbol",Ne=e=>e!==null&&typeof e=="object",$l=e=>(Ne(e)||Ee(e))&&Ee(e.then)&&Ee(e.catch),Il=Object.prototype.toString,zs=e=>Il.call(e),pd=e=>zs(e).slice(8,-1),Pl=e=>zs(e)==="[object Object]",Hr=e=>Ue(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bs=lo(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Fr=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},gd=/-\w/g,it=Fr(e=>e.replace(gd,t=>t.slice(1).toUpperCase())),md=/\B([A-Z])/g,In=Fr(e=>e.replace(md,"-$1").toLowerCase()),Vr=Fr(e=>e.charAt(0).toUpperCase()+e.slice(1)),ci=Fr(e=>e?`on${Vr(e)}`:""),Dt=(e,t)=>!Object.is(e,t),gr=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Ll=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},uo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},bd=e=>{const t=Ue(e)?Number(e):NaN;return isNaN(t)?e:t};let Bo;const qr=()=>Bo||(Bo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ho(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=Ue(s)?wd(s):ho(s);if(r)for(const i in r)t[i]=r[i]}return t}else if(Ue(e)||Ne(e))return e}const vd=/;(?![^(]*\))/g,yd=/:([^]+)/,_d=/\/\*[^]*?\*\//g;function wd(e){const t={};return e.replace(_d,"").split(vd).forEach(n=>{if(n){const s=n.split(yd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function _e(e){let t="";if(Ue(e))t=e;else if(pe(e))for(let n=0;n<e.length;n++){const s=_e(e[n]);s&&(t+=s+" ")}else if(Ne(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const xd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ed=lo(xd);function jl(e){return!!e||e===""}function kd(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Gs(e[s],t[s]);return n}function Gs(e,t){if(e===t)return!0;let n=Uo(e),s=Uo(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=yt(e),s=yt(t),n||s)return e===t;if(n=pe(e),s=pe(t),n||s)return n&&s?kd(e,t):!1;if(n=Ne(e),s=Ne(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,i=Object.keys(t).length;if(r!==i)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!Gs(e[o],t[o]))return!1}}return String(e)===String(t)}function Ml(e,t){return e.findIndex(n=>Gs(n,t))}const Dl=e=>!!(e&&e.__v_isRef===!0),C=e=>Ue(e)?e:e==null?"":pe(e)||Ne(e)&&(e.toString===Il||!Ee(e.toString))?Dl(e)?C(e.value):JSON.stringify(e,Ul,2):String(e),Ul=(e,t)=>Dl(t)?Ul(e,t.value):Yn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[ui(s,i)+" =>"]=r,n),{})}:Br(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ui(n))}:yt(t)?ui(t):Ne(t)&&!pe(t)&&!Pl(t)?String(t):t,ui=(e,t="")=>{var n;return yt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
+ * @vue/reactivity v3.5.34
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let ze;class Bl{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&&ze&&(ze.active?(this.parent=ze,this.index=(ze.scopes||(ze.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)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[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)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=ze;try{return ze=this,t()}finally{ze=n}}}on(){++this._on===1&&(this.prevScope=ze,ze=this)}off(){if(this._on>0&&--this._on===0){if(ze===this)ze=this.prevScope;else{let t=ze;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){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Hl(e){return new Bl(e)}function Fl(){return ze}function Sd(e,t=!1){ze&&ze.cleanups.push(e)}let Le;const di=new WeakSet;class Vl{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,ze&&(ze.active?ze.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,di.has(this)&&(di.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Kl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ho(this),Wl(this);const t=Le,n=kt;Le=this,kt=!0;try{return this.fn()}finally{zl(this),Le=t,kt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)go(t);this.deps=this.depsTail=void 0,Ho(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?di.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ni(this)&&this.run()}get dirty(){return Ni(this)}}let ql=0,vs,ys;function Kl(e,t=!1){if(e.flags|=8,t){e.next=ys,ys=e;return}e.next=vs,vs=e}function fo(){ql++}function po(){if(--ql>0)return;if(ys){let t=ys;for(ys=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;vs;){let t=vs;for(vs=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 Wl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function zl(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),go(s),Td(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Ni(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Gl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Gl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Cs)||(e.globalVersion=Cs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ni(e))))return;e.flags|=2;const t=e.dep,n=Le,s=kt;Le=e,kt=!0;try{Wl(e);const r=e.fn(e._value);(t.version===0||Dt(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{Le=n,kt=s,zl(e),e.flags&=-3}}function go(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)go(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Td(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let kt=!0;const Jl=[];function Qt(){Jl.push(kt),kt=!1}function en(){const e=Jl.pop();kt=e===void 0?!0:e}function Ho(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Le;Le=void 0;try{t()}finally{Le=n}}}let Cs=0;class Ad{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 mo{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(!Le||!kt||Le===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Le)n=this.activeLink=new Ad(Le,this),Le.deps?(n.prevDep=Le.depsTail,Le.depsTail.nextDep=n,Le.depsTail=n):Le.deps=Le.depsTail=n,Zl(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=Le.depsTail,n.nextDep=void 0,Le.depsTail.nextDep=n,Le.depsTail=n,Le.deps===n&&(Le.deps=s)}return n}trigger(t){this.version++,Cs++,this.notify(t)}notify(t){fo();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{po()}}}function Zl(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)Zl(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const _r=new WeakMap,On=Symbol(""),$i=Symbol(""),Ns=Symbol("");function Qe(e,t,n){if(kt&&Le){let s=_r.get(e);s||_r.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new mo),r.map=s,r.key=n),r.track()}}function Gt(e,t,n,s,r,i){const o=_r.get(e);if(!o){Cs++;return}const a=l=>{l&&l.trigger()};if(fo(),t==="clear")o.forEach(a);else{const l=pe(e),c=l&&Hr(n);if(l&&n==="length"){const u=Number(s);o.forEach((d,h)=>{(h==="length"||h===Ns||!yt(h)&&h>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(Ns)),t){case"add":l?c&&a(o.get("length")):(a(o.get(On)),Yn(e)&&a(o.get($i)));break;case"delete":l||(a(o.get(On)),Yn(e)&&a(o.get($i)));break;case"set":Yn(e)&&a(o.get(On));break}}po()}function Rd(e,t){const n=_r.get(e);return n&&n.get(t)}function Ln(e){const t=Ae(e);return t===e?t:(Qe(t,"iterate",Ns),ft(e)?t:t.map(St))}function Kr(e){return Qe(e=Ae(e),"iterate",Ns),e}function Lt(e,t){return tn(e)?ts(Yt(e)?St(t):t):St(t)}const Od={__proto__:null,[Symbol.iterator](){return hi(this,Symbol.iterator,e=>Lt(this,e))},concat(...e){return Ln(this).concat(...e.map(t=>pe(t)?Ln(t):t))},entries(){return hi(this,"entries",e=>(e[1]=Lt(this,e[1]),e))},every(e,t){return Bt(this,"every",e,t,void 0,arguments)},filter(e,t){return Bt(this,"filter",e,t,n=>n.map(s=>Lt(this,s)),arguments)},find(e,t){return Bt(this,"find",e,t,n=>Lt(this,n),arguments)},findIndex(e,t){return Bt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Bt(this,"findLast",e,t,n=>Lt(this,n),arguments)},findLastIndex(e,t){return Bt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Bt(this,"forEach",e,t,void 0,arguments)},includes(...e){return fi(this,"includes",e)},indexOf(...e){return fi(this,"indexOf",e)},join(e){return Ln(this).join(e)},lastIndexOf(...e){return fi(this,"lastIndexOf",e)},map(e,t){return Bt(this,"map",e,t,void 0,arguments)},pop(){return ls(this,"pop")},push(...e){return ls(this,"push",e)},reduce(e,...t){return Fo(this,"reduce",e,t)},reduceRight(e,...t){return Fo(this,"reduceRight",e,t)},shift(){return ls(this,"shift")},some(e,t){return Bt(this,"some",e,t,void 0,arguments)},splice(...e){return ls(this,"splice",e)},toReversed(){return Ln(this).toReversed()},toSorted(e){return Ln(this).toSorted(e)},toSpliced(...e){return Ln(this).toSpliced(...e)},unshift(...e){return ls(this,"unshift",e)},values(){return hi(this,"values",e=>Lt(this,e))}};function hi(e,t,n){const s=Kr(e),r=s[t]();return s!==e&&!ft(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Cd=Array.prototype;function Bt(e,t,n,s,r,i){const o=Kr(e),a=o!==e&&!ft(e),l=o[t];if(l!==Cd[t]){const d=l.apply(e,i);return a?St(d):d}let c=n;o!==e&&(a?c=function(d,h){return n.call(this,Lt(e,d),h,e)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,e)}));const u=l.call(o,c,s);return a&&r?r(u):u}function Fo(e,t,n,s){const r=Kr(e),i=r!==e&&!ft(e);let o=n,a=!1;r!==e&&(i?(a=s.length===0,o=function(c,u,d){return a&&(a=!1,c=Lt(e,c)),n.call(this,c,Lt(e,u),d,e)}):n.length>3&&(o=function(c,u,d){return n.call(this,c,u,d,e)}));const l=r[t](o,...s);return a?Lt(e,l):l}function fi(e,t,n){const s=Ae(e);Qe(s,"iterate",Ns);const r=s[t](...n);return(r===-1||r===!1)&&Wr(n[0])?(n[0]=Ae(n[0]),s[t](...n)):r}function ls(e,t,n=[]){Qt(),fo();const s=Ae(e)[t].apply(e,n);return po(),en(),s}const Nd=lo("__proto__,__v_isRef,__isVue"),Yl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(yt));function $d(e){yt(e)||(e=String(e));const t=Ae(this);return Qe(t,"has",e),t.hasOwnProperty(e)}class Xl{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Fd:nc:i?tc:ec).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=pe(t);if(!r){let l;if(o&&(l=Od[n]))return l;if(n==="hasOwnProperty")return $d}const a=Reflect.get(t,n,Fe(t)?t:s);if((yt(n)?Yl.has(n):Nd(n))||(r||Qe(t,"get",n),i))return a;if(Fe(a)){const l=o&&Hr(n)?a:a.value;return r&&Ne(l)?Pi(l):l}return Ne(a)?r?Pi(a):Zt(a):a}}class Ql extends Xl{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=pe(t)&&Hr(n);if(!this._isShallow){const c=tn(i);if(!ft(s)&&!tn(s)&&(i=Ae(i),s=Ae(s)),!o&&Fe(i)&&!Fe(s))return c||(i.value=s),!0}const a=o?Number(n)<t.length:Oe(t,n),l=Reflect.set(t,n,s,Fe(t)?t:r);return t===Ae(r)&&(a?Dt(s,i)&&Gt(t,"set",n,s):Gt(t,"add",n,s)),l}deleteProperty(t,n){const s=Oe(t,n);t[n];const r=Reflect.deleteProperty(t,n);return r&&s&&Gt(t,"delete",n,void 0),r}has(t,n){const s=Reflect.has(t,n);return(!yt(n)||!Yl.has(n))&&Qe(t,"has",n),s}ownKeys(t){return Qe(t,"iterate",pe(t)?"length":On),Reflect.ownKeys(t)}}class Id extends Xl{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Pd=new Ql,Ld=new Id,jd=new Ql(!0);const Ii=e=>e,tr=e=>Reflect.getPrototypeOf(e);function Md(e,t,n){return function(...s){const r=this.__v_raw,i=Ae(r),o=Yn(i),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=r[e](...s),u=n?Ii:t?ts:St;return!t&&Qe(i,"iterate",l?$i:On),Je(Object.create(c),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:a?[u(d[0]),u(d[1])]:u(d),done:h}}})}}function nr(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Dd(e,t){const n={get(r){const i=this.__v_raw,o=Ae(i),a=Ae(r);e||(Dt(r,a)&&Qe(o,"get",r),Qe(o,"get",a));const{has:l}=tr(o),c=t?Ii:e?ts:St;if(l.call(o,r))return c(i.get(r));if(l.call(o,a))return c(i.get(a));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&Qe(Ae(r),"iterate",On),r.size},has(r){const i=this.__v_raw,o=Ae(i),a=Ae(r);return e||(Dt(r,a)&&Qe(o,"has",r),Qe(o,"has",a)),r===a?i.has(r):i.has(r)||i.has(a)},forEach(r,i){const o=this,a=o.__v_raw,l=Ae(a),c=t?Ii:e?ts:St;return!e&&Qe(l,"iterate",On),a.forEach((u,d)=>r.call(i,c(u),c(d),o))}};return Je(n,e?{add:nr("add"),set:nr("set"),delete:nr("delete"),clear:nr("clear")}:{add(r){const i=Ae(this),o=tr(i),a=Ae(r),l=!t&&!ft(r)&&!tn(r)?a:r;return o.has.call(i,l)||Dt(r,l)&&o.has.call(i,r)||Dt(a,l)&&o.has.call(i,a)||(i.add(l),Gt(i,"add",l,l)),this},set(r,i){!t&&!ft(i)&&!tn(i)&&(i=Ae(i));const o=Ae(this),{has:a,get:l}=tr(o);let c=a.call(o,r);c||(r=Ae(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,i),c?Dt(i,u)&&Gt(o,"set",r,i):Gt(o,"add",r,i),this},delete(r){const i=Ae(this),{has:o,get:a}=tr(i);let l=o.call(i,r);l||(r=Ae(r),l=o.call(i,r)),a&&a.call(i,r);const c=i.delete(r);return l&&Gt(i,"delete",r,void 0),c},clear(){const r=Ae(this),i=r.size!==0,o=r.clear();return i&&Gt(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Md(r,e,t)}),n}function bo(e,t){const n=Dd(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Oe(n,r)&&r in s?n:s,r,i)}const Ud={get:bo(!1,!1)},Bd={get:bo(!1,!0)},Hd={get:bo(!0,!1)};const ec=new WeakMap,tc=new WeakMap,nc=new WeakMap,Fd=new WeakMap;function Vd(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qd(e){return e.__v_skip||!Object.isExtensible(e)?0:Vd(pd(e))}function Zt(e){return tn(e)?e:vo(e,!1,Pd,Ud,ec)}function sc(e){return vo(e,!1,jd,Bd,tc)}function Pi(e){return vo(e,!0,Ld,Hd,nc)}function vo(e,t,n,s,r){if(!Ne(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=qd(e);if(i===0)return e;const o=r.get(e);if(o)return o;const a=new Proxy(e,i===2?s:n);return r.set(e,a),a}function Yt(e){return tn(e)?Yt(e.__v_raw):!!(e&&e.__v_isReactive)}function tn(e){return!!(e&&e.__v_isReadonly)}function ft(e){return!!(e&&e.__v_isShallow)}function Wr(e){return e?!!e.__v_raw:!1}function Ae(e){const t=e&&e.__v_raw;return t?Ae(t):e}function yo(e){return!Oe(e,"__v_skip")&&Object.isExtensible(e)&&Ll(e,"__v_skip",!0),e}const St=e=>Ne(e)?Zt(e):e,ts=e=>Ne(e)?Pi(e):e;function Fe(e){return e?e.__v_isRef===!0:!1}function X(e){return rc(e,!1)}function Kd(e){return rc(e,!0)}function rc(e,t){return Fe(e)?e:new Wd(e,t)}class Wd{constructor(t,n){this.dep=new mo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ae(t),this._value=n?t:St(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||ft(t)||tn(t);t=s?t:Ae(t),Dt(t,n)&&(this._rawValue=t,this._value=s?t:St(t),this.dep.trigger())}}function $e(e){return Fe(e)?e.value:e}const zd={get:(e,t,n)=>t==="__v_raw"?e:$e(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return Fe(r)&&!Fe(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function ic(e){return Yt(e)?e:new Proxy(e,zd)}function Gd(e){const t=pe(e)?new Array(e.length):{};for(const n in e)t[n]=Zd(e,n);return t}class Jd{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=yt(n)?n:String(n),this._raw=Ae(t);let r=!0,i=t;if(!pe(t)||yt(this._key)||!Hr(this._key))do r=!Wr(i)||ft(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=$e(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Fe(this._raw[this._key])){const n=this._object[this._key];if(Fe(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Rd(this._raw,this._key)}}function Zd(e,t,n){return new Jd(e,t,n)}class Yd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new mo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Cs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Le!==this)return Kl(this,!0),!0}get value(){const t=this.dep.track();return Gl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Xd(e,t,n=!1){let s,r;return Ee(e)?s=e:(s=e.get,r=e.set),new Yd(s,r,n)}const sr={},wr=new WeakMap;let En;function Qd(e,t=!1,n=En){if(n){let s=wr.get(n);s||wr.set(n,s=[]),s.push(e)}}function eh(e,t,n=Ie){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:a,call:l}=n,c=$=>r?$:ft($)||r===!1||r===0?Jt($,1):Jt($);let u,d,h,f,g=!1,b=!1;if(Fe(e)?(d=()=>e.value,g=ft(e)):Yt(e)?(d=()=>c(e),g=!0):pe(e)?(b=!0,g=e.some($=>Yt($)||ft($)),d=()=>e.map($=>{if(Fe($))return $.value;if(Yt($))return c($);if(Ee($))return l?l($,2):$()})):Ee(e)?t?d=l?()=>l(e,2):e:d=()=>{if(h){Qt();try{h()}finally{en()}}const $=En;En=u;try{return l?l(e,3,[f]):e(f)}finally{En=$}}:d=Ut,t&&r){const $=d,O=r===!0?1/0:r;d=()=>Jt($(),O)}const k=Fl(),x=()=>{u.stop(),k&&k.active&&co(k.effects,u)};if(i&&t){const $=t;t=(...O)=>{$(...O),x()}}let y=b?new Array(e.length).fill(sr):sr;const E=$=>{if(!(!(u.flags&1)||!u.dirty&&!$))if(t){const O=u.run();if(r||g||(b?O.some((P,T)=>Dt(P,y[T])):Dt(O,y))){h&&h();const P=En;En=u;try{const T=[O,y===sr?void 0:b&&y[0]===sr?[]:y,f];y=O,l?l(t,3,T):t(...T)}finally{En=P}}}else u.run()};return a&&a(E),u=new Vl(d),u.scheduler=o?()=>o(E,!1):E,f=$=>Qd($,!1,u),h=u.onStop=()=>{const $=wr.get(u);if($){if(l)l($,4);else for(const O of $)O();wr.delete(u)}},t?s?E(!0):y=u.run():o?o(E.bind(null,!0),!0):u.run(),x.pause=u.pause.bind(u),x.resume=u.resume.bind(u),x.stop=x,x}function Jt(e,t=1/0,n){if(t<=0||!Ne(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Fe(e))Jt(e.value,t,n);else if(pe(e))for(let s=0;s<e.length;s++)Jt(e[s],t,n);else if(Br(e)||Yn(e))e.forEach(s=>{Jt(s,t,n)});else if(Pl(e)){for(const s in e)Jt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Jt(e[s],t,n)}return e}/**
10
+ * @vue/runtime-core v3.5.34
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function Js(e,t,n,s){try{return s?e(...s):e()}catch(r){zr(r,t,n)}}function Tt(e,t,n,s){if(Ee(e)){const r=Js(e,t,n,s);return r&&$l(r)&&r.catch(i=>{zr(i,t,n)}),r}if(pe(e)){const r=[];for(let i=0;i<e.length;i++)r.push(Tt(e[i],t,n,s));return r}}function zr(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||Ie;if(t){let a=t.parent;const l=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,l,c)===!1)return}a=a.parent}if(i){Qt(),Js(i,null,10,[e,l,c]),en();return}}th(e,n,r,s,o)}function th(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}const st=[];let Nt=-1;const Xn=[];let cn=null,Vn=0;const oc=Promise.resolve();let xr=null;function Cn(e){const t=xr||oc;return e?t.then(this?e.bind(this):e):t}function nh(e){let t=Nt+1,n=st.length;for(;t<n;){const s=t+n>>>1,r=st[s],i=$s(r);i<e||i===e&&r.flags&2?t=s+1:n=s}return t}function _o(e){if(!(e.flags&1)){const t=$s(e),n=st[st.length-1];!n||!(e.flags&2)&&t>=$s(n)?st.push(e):st.splice(nh(t),0,e),e.flags|=1,ac()}}function ac(){xr||(xr=oc.then(cc))}function sh(e){pe(e)?Xn.push(...e):cn&&e.id===-1?cn.splice(Vn+1,0,e):e.flags&1||(Xn.push(e),e.flags|=1),ac()}function Vo(e,t,n=Nt+1){for(;n<st.length;n++){const s=st[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;st.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function lc(e){if(Xn.length){const t=[...new Set(Xn)].sort((n,s)=>$s(n)-$s(s));if(Xn.length=0,cn){cn.push(...t);return}for(cn=t,Vn=0;Vn<cn.length;Vn++){const n=cn[Vn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}cn=null,Vn=0}}const $s=e=>e.id==null?e.flags&2?-1:1/0:e.id;function cc(e){try{for(Nt=0;Nt<st.length;Nt++){const t=st[Nt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Js(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Nt<st.length;Nt++){const t=st[Nt];t&&(t.flags&=-2)}Nt=-1,st.length=0,lc(),xr=null,(st.length||Xn.length)&&cc()}}let ut=null,uc=null;function Er(e){const t=ut;return ut=e,uc=e&&e.type.__scopeId||null,t}function ns(e,t=ut,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Tr(-1);const i=Er(t);let o;try{o=e(...r)}finally{Er(i),s._d&&Tr(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function dt(e,t){if(ut===null)return e;const n=Qr(ut),s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[i,o,a,l=Ie]=t[r];i&&(Ee(i)&&(i={mounted:i,updated:i}),i.deep&&Jt(o),s.push({dir:i,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function bn(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;o<r.length;o++){const a=r[o];i&&(a.oldValue=i[o].value);let l=a.dir[s];l&&(Qt(),Tt(l,n,8,[e.el,a,e,t]),en())}}function mr(e,t){if(et){let n=et.provides;const s=et.parent&&et.parent.provides;s===n&&(n=et.provides=Object.create(s)),n[e]=t}}function vt(e,t,n=!1){const s=So();if(s||Nn){let r=Nn?Nn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&Ee(t)?t.call(s&&s.proxy):t}}function rh(){return!!(So()||Nn)}const ih=Symbol.for("v-scx"),oh=()=>vt(ih);function pn(e,t,n){return dc(e,t,n)}function dc(e,t,n=Ie){const{immediate:s,deep:r,flush:i,once:o}=n,a=Je({},n),l=t&&s||!t&&i!=="post";let c;if(Ls){if(i==="sync"){const f=oh();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=Ut,f.resume=Ut,f.pause=Ut,f}}const u=et;a.call=(f,g,b)=>Tt(f,u,g,b);let d=!1;i==="post"?a.scheduler=f=>{at(f,u&&u.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(f,g)=>{g?f():_o(f)}),a.augmentJob=f=>{t&&(f.flags|=4),d&&(f.flags|=2,u&&(f.id=u.uid,f.i=u))};const h=eh(e,t,a);return Ls&&(c?c.push(h):l&&h()),h}function ah(e,t,n){const s=this.proxy,r=Ue(e)?e.includes(".")?hc(s,e):()=>s[e]:e.bind(s,s);let i;Ee(t)?i=t:(i=t.handler,n=t);const o=Ys(this),a=dc(r,i.bind(s),n);return o(),a}function hc(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r<n.length&&s;r++)s=s[n[r]];return s}}const lh=Symbol("_vte"),fc=e=>e.__isTeleport,$t=Symbol("_leaveCb"),cs=Symbol("_enterCb");function ch(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return sn(()=>{e.isMounted=!0}),wo(()=>{e.isUnmounting=!0}),e}const mt=[Function,Array],pc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:mt,onEnter:mt,onAfterEnter:mt,onEnterCancelled:mt,onBeforeLeave:mt,onLeave:mt,onAfterLeave:mt,onLeaveCancelled:mt,onBeforeAppear:mt,onAppear:mt,onAfterAppear:mt,onAppearCancelled:mt},gc=e=>{const t=e.subTree;return t.component?gc(t.component):t},uh={name:"BaseTransition",props:pc,setup(e,{slots:t}){const n=So(),s=ch();return()=>{const r=t.default&&vc(t.default(),!0),i=r&&r.length?mc(r):n.subTree?te():void 0;if(!i)return;const o=Ae(e),{mode:a}=o;if(s.isLeaving)return pi(i);const l=qo(i);if(!l)return pi(i);let c=Li(l,o,s,n,d=>c=d);l.type!==rt&&Is(l,c);let u=n.subTree&&qo(n.subTree);if(u&&u.type!==rt&&!Sn(u,l)&&gc(n).type!==rt){let d=Li(u,o,s,n);if(Is(u,d),a==="out-in"&&l.type!==rt)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},pi(i);a==="in-out"&&l.type!==rt?d.delayLeave=(h,f,g)=>{const b=bc(s,u);b[String(u.key)]=u,h[$t]=()=>{f(),h[$t]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{g(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function mc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==rt){t=n;break}}return t}const dh=uh;function bc(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Li(e,t,n,s,r){const{appear:i,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:f,onAfterLeave:g,onLeaveCancelled:b,onBeforeAppear:k,onAppear:x,onAfterAppear:y,onAppearCancelled:E}=t,$=String(e.key),O=bc(n,e),P=(q,ae)=>{q&&Tt(q,s,9,ae)},T=(q,ae)=>{const ge=ae[1];P(q,ae),pe(q)?q.every(J=>J.length<=1)&&ge():q.length<=1&&ge()},B={mode:o,persisted:a,beforeEnter(q){let ae=l;if(!n.isMounted)if(i)ae=k||l;else return;q[$t]&&q[$t](!0);const ge=O[$];ge&&Sn(e,ge)&&ge.el[$t]&&ge.el[$t](),P(ae,[q])},enter(q){if(O[$]===e)return;let ae=c,ge=u,J=d;if(!n.isMounted)if(i)ae=x||c,ge=y||u,J=E||d;else return;let Z=!1;q[cs]=fe=>{Z||(Z=!0,fe?P(J,[q]):P(ge,[q]),B.delayedLeave&&B.delayedLeave(),q[cs]=void 0)};const N=q[cs].bind(null,!1);ae?T(ae,[q,N]):N()},leave(q,ae){const ge=String(e.key);if(q[cs]&&q[cs](!0),n.isUnmounting)return ae();P(h,[q]);let J=!1;q[$t]=N=>{J||(J=!0,ae(),N?P(b,[q]):P(g,[q]),q[$t]=void 0,O[ge]===e&&delete O[ge])};const Z=q[$t].bind(null,!1);O[ge]=e,f?T(f,[q,Z]):Z()},clone(q){const ae=Li(q,t,n,s,r);return r&&r(ae),ae}};return B}function pi(e){if(Gr(e))return e=gn(e),e.children=null,e}function qo(e){if(!Gr(e))return fc(e.type)&&e.children?mc(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ee(n.default))return n.default()}}function Is(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Is(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function vc(e,t=!1,n){let s=[],r=0;for(let i=0;i<e.length;i++){let o=e[i];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:i);o.type===Se?(o.patchFlag&128&&r++,s=s.concat(vc(o.children,t,a))):(t||o.type!==rt)&&s.push(a!=null?gn(o,{key:a}):o)}if(r>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function pt(e,t){return Ee(e)?Je({name:e.name},t,{setup:e}):e}function yc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ko(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const kr=new WeakMap;function _s(e,t,n,s,r=!1){if(pe(e)){e.forEach((b,k)=>_s(b,t&&(pe(t)?t[k]:t),n,s,r));return}if(ws(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&_s(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Qr(s.component):s.el,o=r?null:i,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Ie?a.refs={}:a.refs,d=a.setupState,h=Ae(d),f=d===Ie?Nl:b=>Ko(u,b)?!1:Oe(h,b),g=(b,k)=>!(k&&Ko(u,k));if(c!=null&&c!==l){if(Wo(t),Ue(c))u[c]=null,f(c)&&(d[c]=null);else if(Fe(c)){const b=t;g(c,b.k)&&(c.value=null),b.k&&(u[b.k]=null)}}if(Ee(l))Js(l,a,12,[o,u]);else{const b=Ue(l),k=Fe(l);if(b||k){const x=()=>{if(e.f){const y=b?f(l)?d[l]:u[l]:g()||!e.k?l.value:u[e.k];if(r)pe(y)&&co(y,i);else if(pe(y))y.includes(i)||y.push(i);else if(b)u[l]=[i],f(l)&&(d[l]=u[l]);else{const E=[i];g(l,e.k)&&(l.value=E),e.k&&(u[e.k]=E)}}else b?(u[l]=o,f(l)&&(d[l]=o)):k&&(g(l,e.k)&&(l.value=o),e.k&&(u[e.k]=o))};if(o){const y=()=>{x(),kr.delete(e)};y.id=-1,kr.set(e,y),at(y,n)}else Wo(e),x()}}}function Wo(e){const t=kr.get(e);t&&(t.flags|=8,kr.delete(e))}qr().requestIdleCallback;qr().cancelIdleCallback;const ws=e=>!!e.type.__asyncLoader,Gr=e=>e.type.__isKeepAlive;function hh(e,t){_c(e,"a",t)}function fh(e,t){_c(e,"da",t)}function _c(e,t,n=et){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Jr(t,s,n),n){let r=n.parent;for(;r&&r.parent;)Gr(r.parent.vnode)&&ph(s,t,n,r),r=r.parent}}function ph(e,t,n,s){const r=Jr(t,e,s,!0);Zr(()=>{co(s[t],r)},n)}function Jr(e,t,n=et,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Qt();const a=Ys(n),l=Tt(t,n,e,o);return a(),en(),l});return s?r.unshift(i):r.push(i),i}}const nn=e=>(t,n=et)=>{(!Ls||e==="sp")&&Jr(e,(...s)=>t(...s),n)},gh=nn("bm"),sn=nn("m"),mh=nn("bu"),bh=nn("u"),wo=nn("bum"),Zr=nn("um"),vh=nn("sp"),yh=nn("rtg"),_h=nn("rtc");function wh(e,t=et){Jr("ec",e,t)}const xh="components",wc=Symbol.for("v-ndc");function Eh(e){return Ue(e)?kh(xh,e,!1)||e:e||wc}function kh(e,t,n=!0,s=!1){const r=ut||et;if(r){const i=r.type;{const a=cf(i,!1);if(a&&(a===t||a===it(t)||a===Vr(it(t))))return i}const o=zo(r[e]||i[e],t)||zo(r.appContext[e],t);return!o&&s?i:o}}function zo(e,t){return e&&(e[t]||e[it(t)]||e[Vr(it(t))])}function Ge(e,t,n,s){let r;const i=n,o=pe(e);if(o||Ue(e)){const a=o&&Yt(e);let l=!1,c=!1;a&&(l=!ft(e),c=tn(e),e=Kr(e)),r=new Array(e.length);for(let u=0,d=e.length;u<d;u++)r[u]=t(l?c?ts(St(e[u])):St(e[u]):e[u],u,void 0,i)}else if(typeof e=="number"){r=new Array(e);for(let a=0;a<e;a++)r[a]=t(a+1,a,void 0,i)}else if(Ne(e))if(e[Symbol.iterator])r=Array.from(e,(a,l)=>t(a,l,void 0,i));else{const a=Object.keys(e);r=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];r[l]=t(e[u],u,l,i)}}else r=[];return r}const ji=e=>e?Fc(e)?Qr(e):ji(e.parent):null,xs=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=>ji(e.parent),$root:e=>ji(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ec(e),$forceUpdate:e=>e.f||(e.f=()=>{_o(e.update)}),$nextTick:e=>e.n||(e.n=Cn.bind(e.proxy)),$watch:e=>ah.bind(e)}),gi=(e,t)=>e!==Ie&&!e.__isScriptSetup&&Oe(e,t),Sh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const h=o[t];if(h!==void 0)switch(h){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(gi(s,t))return o[t]=1,s[t];if(r!==Ie&&Oe(r,t))return o[t]=2,r[t];if(Oe(i,t))return o[t]=3,i[t];if(n!==Ie&&Oe(n,t))return o[t]=4,n[t];Mi&&(o[t]=0)}}const c=xs[t];let u,d;if(c)return t==="$attrs"&&Qe(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==Ie&&Oe(n,t))return o[t]=4,n[t];if(d=l.config.globalProperties,Oe(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return gi(r,t)?(r[t]=n,!0):s!==Ie&&Oe(s,t)?(s[t]=n,!0):Oe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,props:i,type:o}},a){let l;return!!(n[a]||e!==Ie&&a[0]!=="$"&&Oe(e,a)||gi(t,a)||Oe(i,a)||Oe(s,a)||Oe(xs,a)||Oe(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Oe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Go(e){return pe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Mi=!0;function Th(e){const t=Ec(e),n=e.proxy,s=e.ctx;Mi=!1,t.beforeCreate&&Jo(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:f,updated:g,activated:b,deactivated:k,beforeDestroy:x,beforeUnmount:y,destroyed:E,unmounted:$,render:O,renderTracked:P,renderTriggered:T,errorCaptured:B,serverPrefetch:q,expose:ae,inheritAttrs:ge,components:J,directives:Z,filters:N}=t;if(c&&Ah(c,s,null),o)for(const F in o){const z=o[F];Ee(z)&&(s[F]=z.bind(n))}if(r){const F=r.call(n,n);Ne(F)&&(e.data=Zt(F))}if(Mi=!0,i)for(const F in i){const z=i[F],ce=Ee(z)?z.bind(n,n):Ee(z.get)?z.get.bind(n,n):Ut,ye=!Ee(z)&&Ee(z.set)?z.set.bind(n):Ut,H=De({get:ce,set:ye});Object.defineProperty(s,F,{enumerable:!0,configurable:!0,get:()=>H.value,set:S=>H.value=S})}if(a)for(const F in a)xc(a[F],s,n,F);if(l){const F=Ee(l)?l.call(n):l;Reflect.ownKeys(F).forEach(z=>{mr(z,F[z])})}u&&Jo(u,e,"c");function I(F,z){pe(z)?z.forEach(ce=>F(ce.bind(n))):z&&F(z.bind(n))}if(I(gh,d),I(sn,h),I(mh,f),I(bh,g),I(hh,b),I(fh,k),I(wh,B),I(_h,P),I(yh,T),I(wo,y),I(Zr,$),I(vh,q),pe(ae))if(ae.length){const F=e.exposed||(e.exposed={});ae.forEach(z=>{Object.defineProperty(F,z,{get:()=>n[z],set:ce=>n[z]=ce,enumerable:!0})})}else e.exposed||(e.exposed={});O&&e.render===Ut&&(e.render=O),ge!=null&&(e.inheritAttrs=ge),J&&(e.components=J),Z&&(e.directives=Z),q&&yc(e)}function Ah(e,t,n=Ut){pe(e)&&(e=Di(e));for(const s in e){const r=e[s];let i;Ne(r)?"default"in r?i=vt(r.from||s,r.default,!0):i=vt(r.from||s):i=vt(r),Fe(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function Jo(e,t,n){Tt(pe(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function xc(e,t,n,s){let r=s.includes(".")?hc(n,s):()=>n[s];if(Ue(e)){const i=t[e];Ee(i)&&pn(r,i)}else if(Ee(e))pn(r,e.bind(n));else if(Ne(e))if(pe(e))e.forEach(i=>xc(i,t,n,s));else{const i=Ee(e.handler)?e.handler.bind(n):t[e.handler];Ee(i)&&pn(r,i,e)}}function Ec(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,a=i.get(t);let l;return a?l=a:!r.length&&!n&&!s?l=t:(l={},r.length&&r.forEach(c=>Sr(l,c,o,!0)),Sr(l,t,o)),Ne(t)&&i.set(t,l),l}function Sr(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&Sr(e,i,n,!0),r&&r.forEach(o=>Sr(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const a=Rh[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Rh={data:Zo,props:Yo,emits:Yo,methods:fs,computed:fs,beforeCreate:tt,created:tt,beforeMount:tt,mounted:tt,beforeUpdate:tt,updated:tt,beforeDestroy:tt,beforeUnmount:tt,destroyed:tt,unmounted:tt,activated:tt,deactivated:tt,errorCaptured:tt,serverPrefetch:tt,components:fs,directives:fs,watch:Ch,provide:Zo,inject:Oh};function Zo(e,t){return t?e?function(){return Je(Ee(e)?e.call(this,this):e,Ee(t)?t.call(this,this):t)}:t:e}function Oh(e,t){return fs(Di(e),Di(t))}function Di(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function tt(e,t){return e?[...new Set([].concat(e,t))]:t}function fs(e,t){return e?Je(Object.create(null),e,t):t}function Yo(e,t){return e?pe(e)&&pe(t)?[...new Set([...e,...t])]:Je(Object.create(null),Go(e),Go(t??{})):t}function Ch(e,t){if(!e)return t;if(!t)return e;const n=Je(Object.create(null),e);for(const s in t)n[s]=tt(e[s],t[s]);return n}function kc(){return{app:null,config:{isNativeTag:Nl,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 Nh=0;function $h(e,t){return function(s,r=null){Ee(s)||(s=Je({},s)),r!=null&&!Ne(r)&&(r=null);const i=kc(),o=new WeakSet,a=[];let l=!1;const c=i.app={_uid:Nh++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:df,get config(){return i.config},set config(u){},use(u,...d){return o.has(u)||(u&&Ee(u.install)?(o.add(u),u.install(c,...d)):Ee(u)&&(o.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,h){if(!l){const f=c._ceVNode||xe(s,r);return f.appContext=i,h===!0?h="svg":h===!1&&(h=void 0),e(f,u,h),l=!0,c._container=u,u.__vue_app__=c,Qr(f.component)}},onUnmount(u){a.push(u)},unmount(){l&&(Tt(a,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=Nn;Nn=c;try{return u()}finally{Nn=d}}};return c}}let Nn=null;const Ih=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${it(t)}Modifiers`]||e[`${In(t)}Modifiers`];function Ph(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Ie;let r=n;const i=t.startsWith("update:"),o=i&&Ih(s,t.slice(7));o&&(o.trim&&(r=n.map(u=>Ue(u)?u.trim():u)),o.number&&(r=n.map(uo)));let a,l=s[a=ci(t)]||s[a=ci(it(t))];!l&&i&&(l=s[a=ci(In(t))]),l&&Tt(l,e,6,r);const c=s[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Tt(c,e,6,r)}}const Lh=new WeakMap;function Sc(e,t,n=!1){const s=n?Lh:t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},a=!1;if(!Ee(e)){const l=c=>{const u=Sc(c,t,!0);u&&(a=!0,Je(o,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!i&&!a?(Ne(e)&&s.set(e,null),null):(pe(i)?i.forEach(l=>o[l]=null):Je(o,i),Ne(e)&&s.set(e,o),o)}function Yr(e,t){return!e||!Dr(t)?!1:(t=t.slice(2).replace(/Once$/,""),Oe(e,t[0].toLowerCase()+t.slice(1))||Oe(e,In(t))||Oe(e,t))}function Xo(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:h,setupState:f,ctx:g,inheritAttrs:b}=e,k=Er(e);let x,y;try{if(n.shapeFlag&4){const $=r||s,O=$;x=jt(c.call(O,$,u,d,f,h,g)),y=a}else{const $=t;x=jt($.length>1?$(d,{attrs:a,slots:o,emit:l}):$(d,null)),y=t.props?a:jh(a)}}catch($){Es.length=0,zr($,e,1),x=xe(rt)}let E=x;if(y&&b!==!1){const $=Object.keys(y),{shapeFlag:O}=E;$.length&&O&7&&(i&&$.some(Ur)&&(y=Mh(y,i)),E=gn(E,y,!1,!0))}return n.dirs&&(E=gn(E,null,!1,!0),E.dirs=E.dirs?E.dirs.concat(n.dirs):n.dirs),n.transition&&Is(E,n.transition),x=E,Er(k),x}const jh=e=>{let t;for(const n in e)(n==="class"||n==="style"||Dr(n))&&((t||(t={}))[n]=e[n]);return t},Mh=(e,t)=>{const n={};for(const s in e)(!Ur(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Dh(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:a,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?Qo(s,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(Tc(o,s,h)&&!Yr(c,h))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:s===o?!1:s?o?Qo(s,o,c):!0:!!o;return!1}function Qo(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const i=s[r];if(Tc(t,e,i)&&!Yr(n,i))return!0}return!1}function Tc(e,t,n){const s=e[n],r=t[n];return n==="style"&&Ne(s)&&Ne(r)?!Gs(s,r):s!==r}function Uh({vnode:e,parent:t,suspense:n},s){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.suspense.vnode.el=r.el=s,e=r),r===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Ac={},Rc=()=>Object.create(Ac),Oc=e=>Object.getPrototypeOf(e)===Ac;function Bh(e,t,n,s=!1){const r={},i=Rc();e.propsDefaults=Object.create(null),Cc(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:sc(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function Hh(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,a=Ae(r),[l]=e.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(Yr(e.emitsOptions,h))continue;const f=t[h];if(l)if(Oe(i,h))f!==i[h]&&(i[h]=f,c=!0);else{const g=it(h);r[g]=Ui(l,a,g,f,e,!1)}else f!==i[h]&&(i[h]=f,c=!0)}}}else{Cc(e,t,r,i)&&(c=!0);let u;for(const d in a)(!t||!Oe(t,d)&&((u=In(d))===d||!Oe(t,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(r[d]=Ui(l,a,d,void 0,e,!0)):delete r[d]);if(i!==a)for(const d in i)(!t||!Oe(t,d))&&(delete i[d],c=!0)}c&&Gt(e.attrs,"set","")}function Cc(e,t,n,s){const[r,i]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(bs(l))continue;const c=t[l];let u;r&&Oe(r,u=it(l))?!i||!i.includes(u)?n[u]=c:(a||(a={}))[u]=c:Yr(e.emitsOptions,l)||(!(l in s)||c!==s[l])&&(s[l]=c,o=!0)}if(i){const l=Ae(n),c=a||Ie;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Ui(r,l,d,c[d],e,!Oe(c,d))}}return o}function Ui(e,t,n,s,r,i){const o=e[n];if(o!=null){const a=Oe(o,"default");if(a&&s===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&Ee(l)){const{propsDefaults:c}=r;if(n in c)s=c[n];else{const u=Ys(r);s=c[n]=l.call(null,t),u()}}else s=l;r.ce&&r.ce._setProp(n,s)}o[0]&&(i&&!a?s=!1:o[1]&&(s===""||s===In(n))&&(s=!0))}return s}const Fh=new WeakMap;function Nc(e,t,n=!1){const s=n?Fh:t.propsCache,r=s.get(e);if(r)return r;const i=e.props,o={},a=[];let l=!1;if(!Ee(e)){const u=d=>{l=!0;const[h,f]=Nc(d,t,!0);Je(o,h),f&&a.push(...f)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!l)return Ne(e)&&s.set(e,Zn),Zn;if(pe(i))for(let u=0;u<i.length;u++){const d=it(i[u]);ea(d)&&(o[d]=Ie)}else if(i)for(const u in i){const d=it(u);if(ea(d)){const h=i[u],f=o[d]=pe(h)||Ee(h)?{type:h}:Je({},h),g=f.type;let b=!1,k=!0;if(pe(g))for(let x=0;x<g.length;++x){const y=g[x],E=Ee(y)&&y.name;if(E==="Boolean"){b=!0;break}else E==="String"&&(k=!1)}else b=Ee(g)&&g.name==="Boolean";f[0]=b,f[1]=k,(b||Oe(f,"default"))&&a.push(d)}}const c=[o,a];return Ne(e)&&s.set(e,c),c}function ea(e){return e[0]!=="$"&&!bs(e)}const xo=e=>e==="_"||e==="_ctx"||e==="$stable",Eo=e=>pe(e)?e.map(jt):[jt(e)],Vh=(e,t,n)=>{if(t._n)return t;const s=ns((...r)=>Eo(t(...r)),n);return s._c=!1,s},$c=(e,t,n)=>{const s=e._ctx;for(const r in e){if(xo(r))continue;const i=e[r];if(Ee(i))t[r]=Vh(r,i,s);else if(i!=null){const o=Eo(i);t[r]=()=>o}}},Ic=(e,t)=>{const n=Eo(t);e.slots.default=()=>n},Pc=(e,t,n)=>{for(const s in t)(n||!xo(s))&&(e[s]=t[s])},qh=(e,t,n)=>{const s=e.slots=Rc();if(e.vnode.shapeFlag&32){const r=t._;r?(Pc(s,t,n),n&&Ll(s,"_",r,!0)):$c(t,s)}else t&&Ic(e,t)},Kh=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=Ie;if(s.shapeFlag&32){const a=t._;a?n&&a===1?i=!1:Pc(r,t,n):(i=!t.$stable,$c(t,r)),o=t}else t&&(Ic(e,t),o={default:1});if(i)for(const a in r)!xo(a)&&o[a]==null&&delete r[a]},at=Zh;function Wh(e){return zh(e)}function zh(e,t){const n=qr();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:f=Ut,insertStaticContent:g}=e,b=(m,v,A,L=null,V=null,M=null,D=void 0,Q=null,W=!!v.dynamicChildren)=>{if(m===v)return;m&&!Sn(m,v)&&(L=U(m),S(m,V,M,!0),m=null),v.patchFlag===-2&&(W=!1,v.dynamicChildren=null);const{type:j,ref:he,shapeFlag:ee}=v;switch(j){case Xr:k(m,v,A,L);break;case rt:x(m,v,A,L);break;case br:m==null&&y(v,A,L,D);break;case Se:J(m,v,A,L,V,M,D,Q,W);break;default:ee&1?O(m,v,A,L,V,M,D,Q,W):ee&6?Z(m,v,A,L,V,M,D,Q,W):(ee&64||ee&128)&&j.process(m,v,A,L,V,M,D,Q,W,de)}he!=null&&V?_s(he,m&&m.ref,M,v||m,!v):he==null&&m&&m.ref!=null&&_s(m.ref,null,M,m,!0)},k=(m,v,A,L)=>{if(m==null)s(v.el=a(v.children),A,L);else{const V=v.el=m.el;v.children!==m.children&&c(V,v.children)}},x=(m,v,A,L)=>{m==null?s(v.el=l(v.children||""),A,L):v.el=m.el},y=(m,v,A,L)=>{[m.el,m.anchor]=g(m.children,v,A,L,m.el,m.anchor)},E=({el:m,anchor:v},A,L)=>{let V;for(;m&&m!==v;)V=h(m),s(m,A,L),m=V;s(v,A,L)},$=({el:m,anchor:v})=>{let A;for(;m&&m!==v;)A=h(m),r(m),m=A;r(v)},O=(m,v,A,L,V,M,D,Q,W)=>{if(v.type==="svg"?D="svg":v.type==="math"&&(D="mathml"),m==null)P(v,A,L,V,M,D,Q,W);else{const j=m.el&&m.el._isVueCE?m.el:null;try{j&&j._beginPatch(),q(m,v,V,M,D,Q,W)}finally{j&&j._endPatch()}}},P=(m,v,A,L,V,M,D,Q)=>{let W,j;const{props:he,shapeFlag:ee,transition:ue,dirs:me}=m;if(W=m.el=o(m.type,M,he&&he.is,he),ee&8?u(W,m.children):ee&16&&B(m.children,W,null,L,V,mi(m,M),D,Q),me&&bn(m,null,L,"created"),T(W,m,m.scopeId,D,L),he){for(const Y in he)Y!=="value"&&!bs(Y)&&i(W,Y,null,he[Y],M,L);"value"in he&&i(W,"value",null,he.value,M),(j=he.onVnodeBeforeMount)&&Ot(j,L,m)}me&&bn(m,null,L,"beforeMount");const K=Gh(V,ue);K&&ue.beforeEnter(W),s(W,v,A),((j=he&&he.onVnodeMounted)||K||me)&&at(()=>{try{j&&Ot(j,L,m),K&&ue.enter(W),me&&bn(m,null,L,"mounted")}finally{}},V)},T=(m,v,A,L,V)=>{if(A&&f(m,A),L)for(let M=0;M<L.length;M++)f(m,L[M]);if(V){let M=V.subTree;if(v===M||Dc(M.type)&&(M.ssContent===v||M.ssFallback===v)){const D=V.vnode;T(m,D,D.scopeId,D.slotScopeIds,V.parent)}}},B=(m,v,A,L,V,M,D,Q,W=0)=>{for(let j=W;j<m.length;j++){const he=m[j]=Q?zt(m[j]):jt(m[j]);b(null,he,v,A,L,V,M,D,Q)}},q=(m,v,A,L,V,M,D)=>{const Q=v.el=m.el;let{patchFlag:W,dynamicChildren:j,dirs:he}=v;W|=m.patchFlag&16;const ee=m.props||Ie,ue=v.props||Ie;let me;if(A&&vn(A,!1),(me=ue.onVnodeBeforeUpdate)&&Ot(me,A,v,m),he&&bn(v,m,A,"beforeUpdate"),A&&vn(A,!0),(ee.innerHTML&&ue.innerHTML==null||ee.textContent&&ue.textContent==null)&&u(Q,""),j?ae(m.dynamicChildren,j,Q,A,L,mi(v,V),M):D||z(m,v,Q,null,A,L,mi(v,V),M,!1),W>0){if(W&16)ge(Q,ee,ue,A,V);else if(W&2&&ee.class!==ue.class&&i(Q,"class",null,ue.class,V),W&4&&i(Q,"style",ee.style,ue.style,V),W&8){const K=v.dynamicProps;for(let Y=0;Y<K.length;Y++){const ie=K[Y],be=ee[ie],Te=ue[ie];(Te!==be||ie==="value")&&i(Q,ie,be,Te,V,A)}}W&1&&m.children!==v.children&&u(Q,v.children)}else!D&&j==null&&ge(Q,ee,ue,A,V);((me=ue.onVnodeUpdated)||he)&&at(()=>{me&&Ot(me,A,v,m),he&&bn(v,m,A,"updated")},L)},ae=(m,v,A,L,V,M,D)=>{for(let Q=0;Q<v.length;Q++){const W=m[Q],j=v[Q],he=W.el&&(W.type===Se||!Sn(W,j)||W.shapeFlag&198)?d(W.el):A;b(W,j,he,null,L,V,M,D,!0)}},ge=(m,v,A,L,V)=>{if(v!==A){if(v!==Ie)for(const M in v)!bs(M)&&!(M in A)&&i(m,M,v[M],null,V,L);for(const M in A){if(bs(M))continue;const D=A[M],Q=v[M];D!==Q&&M!=="value"&&i(m,M,Q,D,V,L)}"value"in A&&i(m,"value",v.value,A.value,V)}},J=(m,v,A,L,V,M,D,Q,W)=>{const j=v.el=m?m.el:a(""),he=v.anchor=m?m.anchor:a("");let{patchFlag:ee,dynamicChildren:ue,slotScopeIds:me}=v;me&&(Q=Q?Q.concat(me):me),m==null?(s(j,A,L),s(he,A,L),B(v.children||[],A,he,V,M,D,Q,W)):ee>0&&ee&64&&ue&&m.dynamicChildren&&m.dynamicChildren.length===ue.length?(ae(m.dynamicChildren,ue,A,V,M,D,Q),(v.key!=null||V&&v===V.subTree)&&Lc(m,v,!0)):z(m,v,A,he,V,M,D,Q,W)},Z=(m,v,A,L,V,M,D,Q,W)=>{v.slotScopeIds=Q,m==null?v.shapeFlag&512?V.ctx.activate(v,A,L,D,W):N(v,A,L,V,M,D,W):fe(m,v,W)},N=(m,v,A,L,V,M,D)=>{const Q=m.component=sf(m,L,V);if(Gr(m)&&(Q.ctx.renderer=de),rf(Q,!1,D),Q.asyncDep){if(V&&V.registerDep(Q,I,D),!m.el){const W=Q.subTree=xe(rt);x(null,W,v,A),m.placeholder=W.el}}else I(Q,m,v,A,V,M,D)},fe=(m,v,A)=>{const L=v.component=m.component;if(Dh(m,v,A))if(L.asyncDep&&!L.asyncResolved){F(L,v,A);return}else L.next=v,L.update();else v.el=m.el,L.vnode=v},I=(m,v,A,L,V,M,D)=>{const Q=()=>{if(m.isMounted){let{next:ee,bu:ue,u:me,parent:K,vnode:Y}=m;{const gt=jc(m);if(gt){ee&&(ee.el=Y.el,F(m,ee,D)),gt.asyncDep.then(()=>{at(()=>{m.isUnmounted||j()},V)});return}}let ie=ee,be;vn(m,!1),ee?(ee.el=Y.el,F(m,ee,D)):ee=Y,ue&&gr(ue),(be=ee.props&&ee.props.onVnodeBeforeUpdate)&&Ot(be,K,ee,Y),vn(m,!0);const Te=Xo(m),Ve=m.subTree;m.subTree=Te,b(Ve,Te,d(Ve.el),U(Ve),m,V,M),ee.el=Te.el,ie===null&&Uh(m,Te.el),me&&at(me,V),(be=ee.props&&ee.props.onVnodeUpdated)&&at(()=>Ot(be,K,ee,Y),V)}else{let ee;const{el:ue,props:me}=v,{bm:K,m:Y,parent:ie,root:be,type:Te}=m,Ve=ws(v);vn(m,!1),K&&gr(K),!Ve&&(ee=me&&me.onVnodeBeforeMount)&&Ot(ee,ie,v),vn(m,!0);{be.ce&&be.ce._hasShadowRoot()&&be.ce._injectChildStyle(Te,m.parent?m.parent.type:void 0);const gt=m.subTree=Xo(m);b(null,gt,A,L,m,V,M),v.el=gt.el}if(Y&&at(Y,V),!Ve&&(ee=me&&me.onVnodeMounted)){const gt=v;at(()=>Ot(ee,ie,gt),V)}(v.shapeFlag&256||ie&&ws(ie.vnode)&&ie.vnode.shapeFlag&256)&&m.a&&at(m.a,V),m.isMounted=!0,v=A=L=null}};m.scope.on();const W=m.effect=new Vl(Q);m.scope.off();const j=m.update=W.run.bind(W),he=m.job=W.runIfDirty.bind(W);he.i=m,he.id=m.uid,W.scheduler=()=>_o(he),vn(m,!0),j()},F=(m,v,A)=>{v.component=m;const L=m.vnode.props;m.vnode=v,m.next=null,Hh(m,v.props,L,A),Kh(m,v.children,A),Qt(),Vo(m),en()},z=(m,v,A,L,V,M,D,Q,W=!1)=>{const j=m&&m.children,he=m?m.shapeFlag:0,ee=v.children,{patchFlag:ue,shapeFlag:me}=v;if(ue>0){if(ue&128){ye(j,ee,A,L,V,M,D,Q,W);return}else if(ue&256){ce(j,ee,A,L,V,M,D,Q,W);return}}me&8?(he&16&&Me(j,V,M),ee!==j&&u(A,ee)):he&16?me&16?ye(j,ee,A,L,V,M,D,Q,W):Me(j,V,M,!0):(he&8&&u(A,""),me&16&&B(ee,A,L,V,M,D,Q,W))},ce=(m,v,A,L,V,M,D,Q,W)=>{m=m||Zn,v=v||Zn;const j=m.length,he=v.length,ee=Math.min(j,he);let ue;for(ue=0;ue<ee;ue++){const me=v[ue]=W?zt(v[ue]):jt(v[ue]);b(m[ue],me,A,null,V,M,D,Q,W)}j>he?Me(m,V,M,!0,!1,ee):B(v,A,L,V,M,D,Q,W,ee)},ye=(m,v,A,L,V,M,D,Q,W)=>{let j=0;const he=v.length;let ee=m.length-1,ue=he-1;for(;j<=ee&&j<=ue;){const me=m[j],K=v[j]=W?zt(v[j]):jt(v[j]);if(Sn(me,K))b(me,K,A,null,V,M,D,Q,W);else break;j++}for(;j<=ee&&j<=ue;){const me=m[ee],K=v[ue]=W?zt(v[ue]):jt(v[ue]);if(Sn(me,K))b(me,K,A,null,V,M,D,Q,W);else break;ee--,ue--}if(j>ee){if(j<=ue){const me=ue+1,K=me<he?v[me].el:L;for(;j<=ue;)b(null,v[j]=W?zt(v[j]):jt(v[j]),A,K,V,M,D,Q,W),j++}}else if(j>ue)for(;j<=ee;)S(m[j],V,M,!0),j++;else{const me=j,K=j,Y=new Map;for(j=K;j<=ue;j++){const lt=v[j]=W?zt(v[j]):jt(v[j]);lt.key!=null&&Y.set(lt.key,j)}let ie,be=0;const Te=ue-K+1;let Ve=!1,gt=0;const mn=new Array(Te);for(j=0;j<Te;j++)mn[j]=0;for(j=me;j<=ee;j++){const lt=m[j];if(be>=Te){S(lt,V,M,!0);continue}let Rt;if(lt.key!=null)Rt=Y.get(lt.key);else for(ie=K;ie<=ue;ie++)if(mn[ie-K]===0&&Sn(lt,v[ie])){Rt=ie;break}Rt===void 0?S(lt,V,M,!0):(mn[Rt-K]=j+1,Rt>=gt?gt=Rt:Ve=!0,b(lt,v[Rt],A,null,V,M,D,Q,W),be++)}const jo=Ve?Jh(mn):Zn;for(ie=jo.length-1,j=Te-1;j>=0;j--){const lt=K+j,Rt=v[lt],Mo=v[lt+1],Do=lt+1<he?Mo.el||Mc(Mo):L;mn[j]===0?b(null,Rt,A,Do,V,M,D,Q,W):Ve&&(ie<0||j!==jo[ie]?H(Rt,A,Do,2):ie--)}}},H=(m,v,A,L,V=null)=>{const{el:M,type:D,transition:Q,children:W,shapeFlag:j}=m;if(j&6){H(m.component.subTree,v,A,L);return}if(j&128){m.suspense.move(v,A,L);return}if(j&64){D.move(m,v,A,de);return}if(D===Se){s(M,v,A);for(let ee=0;ee<W.length;ee++)H(W[ee],v,A,L);s(m.anchor,v,A);return}if(D===br){E(m,v,A);return}if(L!==2&&j&1&&Q)if(L===0)Q.beforeEnter(M),s(M,v,A),at(()=>Q.enter(M),V);else{const{leave:ee,delayLeave:ue,afterLeave:me}=Q,K=()=>{m.ctx.isUnmounted?r(M):s(M,v,A)},Y=()=>{M._isLeaving&&M[$t](!0),ee(M,()=>{K(),me&&me()})};ue?ue(M,K,Y):Y()}else s(M,v,A)},S=(m,v,A,L=!1,V=!1)=>{const{type:M,props:D,ref:Q,children:W,dynamicChildren:j,shapeFlag:he,patchFlag:ee,dirs:ue,cacheIndex:me,memo:K}=m;if(ee===-2&&(V=!1),Q!=null&&(Qt(),_s(Q,null,A,m,!0),en()),me!=null&&(v.renderCache[me]=void 0),he&256){v.ctx.deactivate(m);return}const Y=he&1&&ue,ie=!ws(m);let be;if(ie&&(be=D&&D.onVnodeBeforeUnmount)&&Ot(be,v,m),he&6)le(m.component,A,L);else{if(he&128){m.suspense.unmount(A,L);return}Y&&bn(m,null,v,"beforeUnmount"),he&64?m.type.remove(m,v,A,de,L):j&&!j.hasOnce&&(M!==Se||ee>0&&ee&64)?Me(j,v,A,!1,!0):(M===Se&&ee&384||!V&&he&16)&&Me(W,v,A),L&&R(m)}const Te=K!=null&&me==null;(ie&&(be=D&&D.onVnodeUnmounted)||Y||Te)&&at(()=>{be&&Ot(be,v,m),Y&&bn(m,null,v,"unmounted"),Te&&(m.el=null)},A)},R=m=>{const{type:v,el:A,anchor:L,transition:V}=m;if(v===Se){G(A,L);return}if(v===br){$(m);return}const M=()=>{r(A),V&&!V.persisted&&V.afterLeave&&V.afterLeave()};if(m.shapeFlag&1&&V&&!V.persisted){const{leave:D,delayLeave:Q}=V,W=()=>D(A,M);Q?Q(m.el,M,W):W()}else M()},G=(m,v)=>{let A;for(;m!==v;)A=h(m),r(m),m=A;r(v)},le=(m,v,A)=>{const{bum:L,scope:V,job:M,subTree:D,um:Q,m:W,a:j}=m;ta(W),ta(j),L&&gr(L),V.stop(),M&&(M.flags|=8,S(D,m,v,A)),Q&&at(Q,v),at(()=>{m.isUnmounted=!0},v)},Me=(m,v,A,L=!1,V=!1,M=0)=>{for(let D=M;D<m.length;D++)S(m[D],v,A,L,V)},U=m=>{if(m.shapeFlag&6)return U(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const v=h(m.anchor||m.el),A=v&&v[lh];return A?h(A):v};let re=!1;const se=(m,v,A)=>{let L;m==null?v._vnode&&(S(v._vnode,null,null,!0),L=v._vnode.component):b(v._vnode||null,m,v,null,null,null,A),v._vnode=m,re||(re=!0,Vo(L),lc(),re=!1)},de={p:b,um:S,m:H,r:R,mt:N,mc:B,pc:z,pbc:ae,n:U,o:e};return{render:se,hydrate:void 0,createApp:$h(se)}}function mi({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 vn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Gh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Lc(e,t,n=!1){const s=e.children,r=t.children;if(pe(s)&&pe(r))for(let i=0;i<s.length;i++){const o=s[i];let a=r[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[i]=zt(r[i]),a.el=o.el),!n&&a.patchFlag!==-2&&Lc(o,a)),a.type===Xr&&(a.patchFlag===-1&&(a=r[i]=zt(a)),a.el=o.el),a.type===rt&&!a.el&&(a.el=o.el)}}function Jh(e){const t=e.slice(),n=[0];let s,r,i,o,a;const l=e.length;for(s=0;s<l;s++){const c=e[s];if(c!==0){if(r=n[n.length-1],e[r]<c){t[s]=r,n.push(s);continue}for(i=0,o=n.length-1;i<o;)a=i+o>>1,e[n[a]]<c?i=a+1:o=a;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function jc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:jc(t)}function ta(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Mc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Mc(t.subTree):null}const Dc=e=>e.__isSuspense;function Zh(e,t){t&&t.pendingBranch?pe(e)?t.effects.push(...e):t.effects.push(e):sh(e)}const Se=Symbol.for("v-fgt"),Xr=Symbol.for("v-txt"),rt=Symbol.for("v-cmt"),br=Symbol.for("v-stc"),Es=[];let ht=null;function _(e=!1){Es.push(ht=e?null:[])}function Yh(){Es.pop(),ht=Es[Es.length-1]||null}let Ps=1;function Tr(e,t=!1){Ps+=e,e<0&&ht&&t&&(ht.hasOnce=!0)}function Uc(e){return e.dynamicChildren=Ps>0?ht||Zn:null,Yh(),Ps>0&&ht&&ht.push(e),e}function w(e,t,n,s,r,i){return Uc(p(e,t,n,s,r,i,!0))}function Bc(e,t,n,s,r){return Uc(xe(e,t,n,s,r,!0))}function Ar(e){return e?e.__v_isVNode===!0:!1}function Sn(e,t){return e.type===t.type&&e.key===t.key}const Hc=({key:e})=>e??null,vr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ue(e)||Fe(e)||Ee(e)?{i:ut,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,s=0,r=null,i=e===Se?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Hc(t),ref:t&&vr(t),scopeId:uc,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:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ut};return a?(ko(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=Ue(n)?8:16),Ps>0&&!o&&ht&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&ht.push(l),l}const xe=Xh;function Xh(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===wc)&&(e=rt),Ar(e)){const a=gn(e,t,!0);return n&&ko(a,n),Ps>0&&!i&&ht&&(a.shapeFlag&6?ht[ht.indexOf(e)]=a:ht.push(a)),a.patchFlag=-2,a}if(uf(e)&&(e=e.__vccOpts),t){t=Qh(t);let{class:a,style:l}=t;a&&!Ue(a)&&(t.class=_e(a)),Ne(l)&&(Wr(l)&&!pe(l)&&(l=Je({},l)),t.style=ho(l))}const o=Ue(e)?1:Dc(e)?128:fc(e)?64:Ne(e)?4:Ee(e)?2:0;return p(e,t,n,s,r,o,i,!0)}function Qh(e){return e?Wr(e)||Oc(e)?Je({},e):e:null}function gn(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:a,transition:l}=e,c=t?ef(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Hc(c),ref:t&&t.ref?n&&i?pe(i)?i.concat(vr(t)):[i,vr(t)]:vr(t):i,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!==Se?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&gn(e.ssContent),ssFallback:e.ssFallback&&gn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&Is(u,l.clone(u)),u}function we(e=" ",t=0){return xe(Xr,null,e,t)}function Zs(e,t){const n=xe(br,null,e);return n.staticCount=t,n}function te(e="",t=!1){return t?(_(),Bc(rt,null,e)):xe(rt,null,e)}function jt(e){return e==null||typeof e=="boolean"?xe(rt):pe(e)?xe(Se,null,e.slice()):Ar(e)?zt(e):xe(Xr,null,String(e))}function zt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:gn(e)}function ko(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(pe(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),ko(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Oc(t)?t._ctx=ut:r===3&&ut&&(ut.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ee(t)?(t={default:t,_ctx:ut},n=32):(t=String(t),s&64?(n=16,t=[we(t)]):n=8);e.children=t,e.shapeFlag|=n}function ef(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=_e([t.class,s.class]));else if(r==="style")t.style=ho([t.style,s.style]);else if(Dr(r)){const i=t[r],o=s[r];o&&i!==o&&!(pe(i)&&i.includes(o))?t[r]=i?[].concat(i,o):o:o==null&&i==null&&!Ur(r)&&(t[r]=o)}else r!==""&&(t[r]=s[r])}return t}function Ot(e,t,n,s=null){Tt(e,t,7,[n,s])}const tf=kc();let nf=0;function sf(e,t,n){const s=e.type,r=(t?t.appContext:e.appContext)||tf,i={uid:nf++,vnode:e,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Bl(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Nc(s,r),emitsOptions:Sc(s,r),emit:null,emitted:null,propsDefaults:Ie,inheritAttrs:s.inheritAttrs,ctx:Ie,data:Ie,props:Ie,attrs:Ie,slots:Ie,refs:Ie,setupState:Ie,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 i.ctx={_:i},i.root=t?t.root:i,i.emit=Ph.bind(null,i),e.ce&&e.ce(i),i}let et=null;const So=()=>et||ut;let Rr,Bi;{const e=qr(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};Rr=t("__VUE_INSTANCE_SETTERS__",n=>et=n),Bi=t("__VUE_SSR_SETTERS__",n=>Ls=n)}const Ys=e=>{const t=et;return Rr(e),e.scope.on(),()=>{e.scope.off(),Rr(t)}},na=()=>{et&&et.scope.off(),Rr(null)};function Fc(e){return e.vnode.shapeFlag&4}let Ls=!1;function rf(e,t=!1,n=!1){t&&Bi(t);const{props:s,children:r}=e.vnode,i=Fc(e);Bh(e,s,i,t),qh(e,r,n||t);const o=i?of(e,t):void 0;return t&&Bi(!1),o}function of(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Sh);const{setup:s}=n;if(s){Qt();const r=e.setupContext=s.length>1?lf(e):null,i=Ys(e),o=Js(s,e,0,[e.props,r]),a=$l(o);if(en(),i(),(a||e.sp)&&!ws(e)&&yc(e),a){if(o.then(na,na),t)return o.then(l=>{sa(e,l)}).catch(l=>{zr(l,e,0)});e.asyncDep=o}else sa(e,o)}else Vc(e)}function sa(e,t,n){Ee(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ne(t)&&(e.setupState=ic(t)),Vc(e)}function Vc(e,t,n){const s=e.type;e.render||(e.render=s.render||Ut);{const r=Ys(e);Qt();try{Th(e)}finally{en(),r()}}}const af={get(e,t){return Qe(e,"get",""),e[t]}};function lf(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,af),slots:e.slots,emit:e.emit,expose:t}}function Qr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ic(yo(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in xs)return xs[n](e)},has(t,n){return n in t||n in xs}})):e.proxy}function cf(e,t=!0){return Ee(e)?e.displayName||e.name:e.name||t&&e.__name}function uf(e){return Ee(e)&&"__vccOpts"in e}const De=(e,t)=>Xd(e,t,Ls);function To(e,t,n){try{Tr(-1);const s=arguments.length;return s===2?Ne(t)&&!pe(t)?Ar(t)?xe(e,null,[t]):xe(e,t):xe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Ar(n)&&(n=[n]),xe(e,t,n))}finally{Tr(1)}}const df="3.5.34";/**
14
+ * @vue/runtime-dom v3.5.34
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let Hi;const ra=typeof window<"u"&&window.trustedTypes;if(ra)try{Hi=ra.createPolicy("vue",{createHTML:e=>e})}catch{}const qc=Hi?e=>Hi.createHTML(e):e=>e,hf="http://www.w3.org/2000/svg",ff="http://www.w3.org/1998/Math/MathML",qt=typeof document<"u"?document:null,ia=qt&&qt.createElement("template"),pf={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 r=t==="svg"?qt.createElementNS(hf,e):t==="mathml"?qt.createElementNS(ff,e):n?qt.createElement(e,{is:n}):qt.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>qt.createTextNode(e),createComment:e=>qt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>qt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{ia.innerHTML=qc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const a=ia.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},on="transition",us="animation",js=Symbol("_vtc"),Kc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},gf=Je({},pc,Kc),mf=e=>(e.displayName="Transition",e.props=gf,e),Wc=mf((e,{slots:t})=>To(dh,bf(e),t)),yn=(e,t=[])=>{pe(e)?e.forEach(n=>n(...t)):e&&e(...t)},oa=e=>e?pe(e)?e.some(t=>t.length>1):e.length>1:!1;function bf(e){const t={};for(const J in e)J in Kc||(t[J]=e[J]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=e,g=vf(r),b=g&&g[0],k=g&&g[1],{onBeforeEnter:x,onEnter:y,onEnterCancelled:E,onLeave:$,onLeaveCancelled:O,onBeforeAppear:P=x,onAppear:T=y,onAppearCancelled:B=E}=t,q=(J,Z,N,fe)=>{J._enterCancelled=fe,_n(J,Z?u:a),_n(J,Z?c:o),N&&N()},ae=(J,Z)=>{J._isLeaving=!1,_n(J,d),_n(J,f),_n(J,h),Z&&Z()},ge=J=>(Z,N)=>{const fe=J?T:y,I=()=>q(Z,J,N);yn(fe,[Z,I]),aa(()=>{_n(Z,J?l:i),Ht(Z,J?u:a),oa(fe)||la(Z,s,b,I)})};return Je(t,{onBeforeEnter(J){yn(x,[J]),Ht(J,i),Ht(J,o)},onBeforeAppear(J){yn(P,[J]),Ht(J,l),Ht(J,c)},onEnter:ge(!1),onAppear:ge(!0),onLeave(J,Z){J._isLeaving=!0;const N=()=>ae(J,Z);Ht(J,d),J._enterCancelled?(Ht(J,h),da(J)):(da(J),Ht(J,h)),aa(()=>{J._isLeaving&&(_n(J,d),Ht(J,f),oa($)||la(J,s,k,N))}),yn($,[J,N])},onEnterCancelled(J){q(J,!1,void 0,!0),yn(E,[J])},onAppearCancelled(J){q(J,!0,void 0,!0),yn(B,[J])},onLeaveCancelled(J){ae(J),yn(O,[J])}})}function vf(e){if(e==null)return null;if(Ne(e))return[bi(e.enter),bi(e.leave)];{const t=bi(e);return[t,t]}}function bi(e){return bd(e)}function Ht(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[js]||(e[js]=new Set)).add(t)}function _n(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[js];n&&(n.delete(t),n.size||(e[js]=void 0))}function aa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let yf=0;function la(e,t,n,s){const r=e._endId=++yf,i=()=>{r===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=_f(e,t);if(!o)return s();const c=o+"end";let u=0;const d=()=>{e.removeEventListener(c,h),i()},h=f=>{f.target===e&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),e.addEventListener(c,h)}function _f(e,t){const n=window.getComputedStyle(e),s=g=>(n[g]||"").split(", "),r=s(`${on}Delay`),i=s(`${on}Duration`),o=ca(r,i),a=s(`${us}Delay`),l=s(`${us}Duration`),c=ca(a,l);let u=null,d=0,h=0;t===on?o>0&&(u=on,d=o,h=i.length):t===us?c>0&&(u=us,d=c,h=l.length):(d=Math.max(o,c),u=d>0?o>c?on:us:null,h=u?u===on?i.length:l.length:0);const f=u===on&&/\b(?:transform|all)(?:,|$)/.test(s(`${on}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:f}}function ca(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>ua(n)+ua(e[s])))}function ua(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function da(e){return(e?e.ownerDocument:document).body.offsetHeight}function wf(e,t,n){const s=e[js];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ha=Symbol("_vod"),xf=Symbol("_vsh"),Ef=Symbol(""),kf=/(?:^|;)\s*display\s*:/;function Sf(e,t,n){const s=e.style,r=Ue(n);let i=!1;if(n&&!r){if(t)if(Ue(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&ps(s,a,"")}else for(const o in t)n[o]==null&&ps(s,o,"");for(const o in n){o==="display"&&(i=!0);const a=n[o];a!=null?Af(e,o,!Ue(t)&&t?t[o]:void 0,a)||ps(s,o,a):ps(s,o,"")}}else if(r){if(t!==n){const o=s[Ef];o&&(n+=";"+o),s.cssText=n,i=kf.test(n)}}else t&&e.removeAttribute("style");ha in e&&(e[ha]=i?s.display:"",e[xf]&&(s.display="none"))}const fa=/\s*!important$/;function ps(e,t,n){if(pe(n))n.forEach(s=>ps(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Tf(e,t);fa.test(n)?e.setProperty(In(s),n.replace(fa,""),"important"):e[s]=n}}const pa=["Webkit","Moz","ms"],vi={};function Tf(e,t){const n=vi[t];if(n)return n;let s=it(t);if(s!=="filter"&&s in e)return vi[t]=s;s=Vr(s);for(let r=0;r<pa.length;r++){const i=pa[r]+s;if(i in e)return vi[t]=i}return t}function Af(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Ue(s)&&n===s}const ga="http://www.w3.org/1999/xlink";function ma(e,t,n,s,r,i=Ed(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ga,t.slice(6,t.length)):e.setAttributeNS(ga,t,n):n==null||i&&!jl(n)?e.removeAttribute(t):e.setAttribute(t,i?"":yt(n)?String(n):n)}function ba(e,t,n,s,r){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?qc(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=jl(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(r||t)}function Tn(e,t,n,s){e.addEventListener(t,n,s)}function Rf(e,t,n,s){e.removeEventListener(t,n,s)}const va=Symbol("_vei");function Of(e,t,n,s,r=null){const i=e[va]||(e[va]={}),o=i[t];if(s&&o)o.value=s;else{const[a,l]=Cf(t);if(s){const c=i[t]=If(s,r);Tn(e,a,c,l)}else o&&(Rf(e,a,o,l),i[t]=void 0)}}const ya=/(?:Once|Passive|Capture)$/;function Cf(e){let t;if(ya.test(e)){t={};let s;for(;s=e.match(ya);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):In(e.slice(2)),t]}let yi=0;const Nf=Promise.resolve(),$f=()=>yi||(Nf.then(()=>yi=0),yi=Date.now());function If(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Tt(Pf(s,n.value),t,5,[s])};return n.value=e,n.attached=$f(),n}function Pf(e,t){if(pe(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const _a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Lf=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?wf(e,s,o):t==="style"?Sf(e,n,s):Dr(t)?Ur(t)||Of(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):jf(e,t,s,o))?(ba(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ma(e,t,s,o,i,t!=="value")):e._isVueCE&&(Mf(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ue(s)))?ba(e,it(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),ma(e,t,s,o))};function jf(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&_a(t)&&Ee(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return _a(t)&&Ue(n)?!1:t in e}function Mf(e,t){const n=e._def.props;if(!n)return!1;const s=it(t);return Array.isArray(n)?n.some(r=>it(r)===s):Object.keys(n).some(r=>it(r)===s)}const Or=e=>{const t=e.props["onUpdate:modelValue"]||!1;return pe(t)?n=>gr(t,n):t};function Df(e){e.target.composing=!0}function wa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Qn=Symbol("_assign");function xa(e,t,n){return t&&(e=e.trim()),n&&(e=uo(e)),e}const Et={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[Qn]=Or(r);const i=s||r.props&&r.props.type==="number";Tn(e,t?"change":"input",o=>{o.target.composing||e[Qn](xa(e.value,n,i))}),(n||i)&&Tn(e,"change",()=>{e.value=xa(e.value,n,i)}),t||(Tn(e,"compositionstart",Df),Tn(e,"compositionend",wa),Tn(e,"change",wa))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[Qn]=Or(o),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?uo(e.value):e.value,l=t??"";if(a===l)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===l)||(e.value=l)}},zc={deep:!0,created(e,t,n){e[Qn]=Or(n),Tn(e,"change",()=>{const s=e._modelValue,r=Uf(e),i=e.checked,o=e[Qn];if(pe(s)){const a=Ml(s,r),l=a!==-1;if(i&&!l)o(s.concat(r));else if(!i&&l){const c=[...s];c.splice(a,1),o(c)}}else if(Br(s)){const a=new Set(s);i?a.add(r):a.delete(r),o(a)}else o(Gc(e,i))})},mounted:Ea,beforeUpdate(e,t,n){e[Qn]=Or(n),Ea(e,t,n)}};function Ea(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(pe(t))r=Ml(t,s.props.value)>-1;else if(Br(t))r=t.has(s.props.value);else{if(t===n)return;r=Gs(t,Gc(e,!0))}e.checked!==r&&(e.checked=r)}function Uf(e){return"_value"in e?e._value:e.value}function Gc(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Bf=["ctrl","shift","alt","meta"],Hf={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)=>Bf.some(n=>e[`${n}Key`]&&!t.includes(n))},Xt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o<t.length;o++){const a=Hf[t[o]];if(a&&a(r,t))return}return e(r,...i)})},Ff=Je({patchProp:Lf},pf);let ka;function Vf(){return ka||(ka=Wh(Ff))}const qf=(...e)=>{const t=Vf().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Wf(s);if(!r)return;const i=t._component;!Ee(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,Kf(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t};function Kf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Wf(e){return Ue(e)?document.querySelector(e):e}/*!
18
+ * pinia v2.3.1
19
+ * (c) 2025 Eduardo San Martin Morote
20
+ * @license MIT
21
+ */let Jc;const ei=e=>Jc=e,Zc=Symbol();function Fi(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var ks;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(ks||(ks={}));function zf(){const e=Hl(!0),t=e.run(()=>X({}));let n=[],s=[];const r=yo({install(i){ei(r),r._a=i,i.provide(Zc,r),i.config.globalProperties.$pinia=r,s.forEach(o=>n.push(o)),s=[]},use(i){return this._a?n.push(i):s.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}const Yc=()=>{};function Sa(e,t,n,s=Yc){e.push(t);const r=()=>{const i=e.indexOf(t);i>-1&&(e.splice(i,1),s())};return!n&&Fl()&&Sd(r),r}function jn(e,...t){e.slice().forEach(n=>{n(...t)})}const Gf=e=>e(),Ta=Symbol(),_i=Symbol();function Vi(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],r=e[n];Fi(r)&&Fi(s)&&e.hasOwnProperty(n)&&!Fe(s)&&!Yt(s)?e[n]=Vi(r,s):e[n]=s}return e}const Jf=Symbol();function Zf(e){return!Fi(e)||!e.hasOwnProperty(Jf)}const{assign:ln}=Object;function Yf(e){return!!(Fe(e)&&e.effect)}function Xf(e,t,n,s){const{state:r,actions:i,getters:o}=t,a=n.state.value[e];let l;function c(){a||(n.state.value[e]=r?r():{});const u=Gd(n.state.value[e]);return ln(u,i,Object.keys(o||{}).reduce((d,h)=>(d[h]=yo(De(()=>{ei(n);const f=n._s.get(e);return o[h].call(f,f)})),d),{}))}return l=Xc(e,c,t,n,s,!0),l}function Xc(e,t,n={},s,r,i){let o;const a=ln({actions:{}},n),l={deep:!0};let c,u,d=[],h=[],f;const g=s.state.value[e];!i&&!g&&(s.state.value[e]={});let b;function k(B){let q;c=u=!1,typeof B=="function"?(B(s.state.value[e]),q={type:ks.patchFunction,storeId:e,events:f}):(Vi(s.state.value[e],B),q={type:ks.patchObject,payload:B,storeId:e,events:f});const ae=b=Symbol();Cn().then(()=>{b===ae&&(c=!0)}),u=!0,jn(d,q,s.state.value[e])}const x=i?function(){const{state:q}=n,ae=q?q():{};this.$patch(ge=>{ln(ge,ae)})}:Yc;function y(){o.stop(),d=[],h=[],s._s.delete(e)}const E=(B,q="")=>{if(Ta in B)return B[_i]=q,B;const ae=function(){ei(s);const ge=Array.from(arguments),J=[],Z=[];function N(F){J.push(F)}function fe(F){Z.push(F)}jn(h,{args:ge,name:ae[_i],store:O,after:N,onError:fe});let I;try{I=B.apply(this&&this.$id===e?this:O,ge)}catch(F){throw jn(Z,F),F}return I instanceof Promise?I.then(F=>(jn(J,F),F)).catch(F=>(jn(Z,F),Promise.reject(F))):(jn(J,I),I)};return ae[Ta]=!0,ae[_i]=q,ae},$={_p:s,$id:e,$onAction:Sa.bind(null,h),$patch:k,$reset:x,$subscribe(B,q={}){const ae=Sa(d,B,q.detached,()=>ge()),ge=o.run(()=>pn(()=>s.state.value[e],J=>{(q.flush==="sync"?u:c)&&B({storeId:e,type:ks.direct,events:f},J)},ln({},l,q)));return ae},$dispose:y},O=Zt($);s._s.set(e,O);const T=(s._a&&s._a.runWithContext||Gf)(()=>s._e.run(()=>(o=Hl()).run(()=>t({action:E}))));for(const B in T){const q=T[B];if(Fe(q)&&!Yf(q)||Yt(q))i||(g&&Zf(q)&&(Fe(q)?q.value=g[B]:Vi(q,g[B])),s.state.value[e][B]=q);else if(typeof q=="function"){const ae=E(q,B);T[B]=ae,a.actions[B]=q}}return ln(O,T),ln(Ae(O),T),Object.defineProperty(O,"$state",{get:()=>s.state.value[e],set:B=>{k(q=>{ln(q,B)})}}),s._p.forEach(B=>{ln(O,o.run(()=>B({store:O,app:s._a,pinia:s,options:a})))}),g&&i&&n.hydrate&&n.hydrate(O.$state,g),c=!0,u=!0,O}/*! #__NO_SIDE_EFFECTS__ */function Qc(e,t,n){let s,r;const i=typeof t=="function";typeof e=="string"?(s=e,r=i?n:t):(r=e,s=e.id);function o(a,l){const c=rh();return a=a||(c?vt(Zc,null):null),a&&ei(a),a=Jc,a._s.has(s)||(i?Xc(s,t,r,a):Xf(s,r,a)),a._s.get(s)}return o.$id=s,o}/*!
22
+ * vue-router v4.6.4
23
+ * (c) 2025 Eduardo San Martin Morote
24
+ * @license MIT
25
+ */const qn=typeof document<"u";function eu(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Qf(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&eu(e.default)}const Re=Object.assign;function wi(e,t){const n={};for(const s in t){const r=t[s];n[s]=At(r)?r.map(e):e(r)}return n}const Ss=()=>{},At=Array.isArray;function Aa(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const tu=/#/g,ep=/&/g,tp=/\//g,np=/=/g,sp=/\?/g,nu=/\+/g,rp=/%5B/g,ip=/%5D/g,su=/%5E/g,op=/%60/g,ru=/%7B/g,ap=/%7C/g,iu=/%7D/g,lp=/%20/g;function Ao(e){return e==null?"":encodeURI(""+e).replace(ap,"|").replace(rp,"[").replace(ip,"]")}function cp(e){return Ao(e).replace(ru,"{").replace(iu,"}").replace(su,"^")}function qi(e){return Ao(e).replace(nu,"%2B").replace(lp,"+").replace(tu,"%23").replace(ep,"%26").replace(op,"`").replace(ru,"{").replace(iu,"}").replace(su,"^")}function up(e){return qi(e).replace(np,"%3D")}function dp(e){return Ao(e).replace(tu,"%23").replace(sp,"%3F")}function hp(e){return dp(e).replace(tp,"%2F")}function Ms(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const fp=/\/$/,pp=e=>e.replace(fp,"");function xi(e,t,n="/"){let s,r={},i="",o="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(s=t.slice(0,l),i=t.slice(l,a>0?a:t.length),r=e(i.slice(1))),a>=0&&(s=s||t.slice(0,a),o=t.slice(a,t.length)),s=vp(s??t,n),{fullPath:s+i+o,path:s,query:r,hash:Ms(o)}}function gp(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Ra(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function mp(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&ss(t.matched[s],n.matched[r])&&ou(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ss(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ou(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!bp(e[n],t[n]))return!1;return!0}function bp(e,t){return At(e)?Oa(e,t):At(t)?Oa(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Oa(e,t){return At(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function vp(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let i=n.length-1,o,a;for(o=0;o<s.length;o++)if(a=s[o],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+s.slice(o).join("/")}const an={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ki=function(e){return e.pop="pop",e.push="push",e}({}),Ei=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function yp(e){if(!e)if(qn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),pp(e)}const _p=/^[^#]+#/;function wp(e,t){return e.replace(_p,"#")+t}function xp(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 ti=()=>({left:window.scrollX,top:window.scrollY});function Ep(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=xp(r,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 Ca(e,t){return(history.state?history.state.position-t:-1)+e}const Wi=new Map;function kp(e,t){Wi.set(e,t)}function Sp(e){const t=Wi.get(e);return Wi.delete(e),t}function Tp(e){return typeof e=="string"||e&&typeof e=="object"}function au(e){return typeof e=="string"||typeof e=="symbol"}let Be=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 lu=Symbol("");Be.MATCHER_NOT_FOUND+"",Be.NAVIGATION_GUARD_REDIRECT+"",Be.NAVIGATION_ABORTED+"",Be.NAVIGATION_CANCELLED+"",Be.NAVIGATION_DUPLICATED+"";function rs(e,t){return Re(new Error,{type:e,[lu]:!0},t)}function Ft(e,t){return e instanceof Error&&lu in e&&(t==null||!!(e.type&t))}const Ap=["params","query","hash"];function Rp(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Ap)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Op(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 r=n[s].replace(nu," "),i=r.indexOf("="),o=Ms(i<0?r:r.slice(0,i)),a=i<0?null:Ms(r.slice(i+1));if(o in t){let l=t[o];At(l)||(l=t[o]=[l]),l.push(a)}else t[o]=a}return t}function Na(e){let t="";for(let n in e){const s=e[n];if(n=up(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(At(s)?s.map(r=>r&&qi(r)):[s&&qi(s)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function Cp(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=At(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const Np=Symbol(""),$a=Symbol(""),ni=Symbol(""),Ro=Symbol(""),zi=Symbol("");function ds(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function un(e,t,n,s,r,i=o=>o()){const o=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(rs(Be.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?l(h):Tp(h)?l(rs(Be.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(o&&s.enterCallbacks[r]===o&&typeof h=="function"&&o.push(h),a())},u=i(()=>e.call(s&&s.instances[r],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(h=>l(h))})}function ki(e,t,n,s,r=i=>i()){const i=[];for(const o of e)for(const a in o.components){let l=o.components[a];if(!(t!=="beforeRouteEnter"&&!o.instances[a]))if(eu(l)){const c=(l.__vccOpts||l)[t];c&&i.push(un(c,n,s,o,a,r))}else{let c=l();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const d=Qf(u)?u.default:u;o.mods[a]=u,o.components[a]=d;const h=(d.__vccOpts||d)[t];return h&&un(h,n,s,o,a,r)()}))}}return i}function $p(e,t){const n=[],s=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;o<i;o++){const a=t.matched[o];a&&(e.matched.find(c=>ss(c,a))?s.push(a):n.push(a));const l=e.matched[o];l&&(t.matched.find(c=>ss(c,l))||r.push(l))}return[n,s,r]}/*!
26
+ * vue-router v4.6.4
27
+ * (c) 2025 Eduardo San Martin Morote
28
+ * @license MIT
29
+ */let Ip=()=>location.protocol+"//"+location.host;function cu(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let o=r.includes(e.slice(i))?e.slice(i).length:1,a=r.slice(o);return a[0]!=="/"&&(a="/"+a),Ra(a,"")}return Ra(n,e)+s+r}function Pp(e,t,n,s){let r=[],i=[],o=null;const a=({state:h})=>{const f=cu(e,location),g=n.value,b=t.value;let k=0;if(h){if(n.value=f,t.value=h,o&&o===g){o=null;return}k=b?h.position-b.position:0}else s(f);r.forEach(x=>{x(n.value,g,{delta:k,type:Ki.pop,direction:k?k>0?Ei.forward:Ei.back:Ei.unknown})})};function l(){o=n.value}function c(h){r.push(h);const f=()=>{const g=r.indexOf(h);g>-1&&r.splice(g,1)};return i.push(f),f}function u(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(Re({},h.state,{scroll:ti()}),"")}}function d(){for(const h of i)h();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:d}}function Ia(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?ti():null}}function Lp(e){const{history:t,location:n}=window,s={value:cu(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,c,u){const d=e.indexOf("#"),h=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+l:Ip()+e+l;try{t[u?"replaceState":"pushState"](c,"",h),r.value=c}catch(f){console.error(f),n[u?"replace":"assign"](h)}}function o(l,c){i(l,Re({},t.state,Ia(r.value.back,l,r.value.forward,!0),c,{position:r.value.position}),!0),s.value=l}function a(l,c){const u=Re({},r.value,t.state,{forward:l,scroll:ti()});i(u.current,u,!0),i(l,Re({},Ia(s.value,l,null),{position:u.position+1},c),!1),s.value=l}return{location:s,state:r,push:a,replace:o}}function jp(e){e=yp(e);const t=Lp(e),n=Pp(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=Re({location:"",base:e,go:s,createHref:wp.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let An=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var We=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}(We||{});const Mp={type:An.Static,value:""},Dp=/[a-zA-Z0-9_]/;function Up(e){if(!e)return[[]];if(e==="/")return[[Mp]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(f){throw new Error(`ERR (${n})/"${c}": ${f}`)}let n=We.Static,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let a=0,l,c="",u="";function d(){c&&(n===We.Static?i.push({type:An.Static,value:c}):n===We.Param||n===We.ParamRegExp||n===We.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:An.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function h(){c+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==We.ParamRegExp){s=n,n=We.EscapeNext;continue}switch(n){case We.Static:l==="/"?(c&&d(),o()):l===":"?(d(),n=We.Param):h();break;case We.EscapeNext:h(),n=s;break;case We.Param:l==="("?n=We.ParamRegExp:Dp.test(l)?h():(d(),n=We.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case We.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=We.ParamRegExpEnd:u+=l;break;case We.ParamRegExpEnd:d(),n=We.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===We.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),d(),o(),r}const Pa="[^/]+?",Bp={sensitive:!1,strict:!1,start:!0,end:!0};var nt=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}(nt||{});const Hp=/[.+*?^${}()[\]/\\]/g;function Fp(e,t){const n=Re({},Bp,t),s=[];let r=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[nt.Root];n.strict&&!c.length&&(r+="/");for(let d=0;d<c.length;d++){const h=c[d];let f=nt.Segment+(n.sensitive?nt.BonusCaseSensitive:0);if(h.type===An.Static)d||(r+="/"),r+=h.value.replace(Hp,"\\$&"),f+=nt.Static;else if(h.type===An.Param){const{value:g,repeatable:b,optional:k,regexp:x}=h;i.push({name:g,repeatable:b,optional:k});const y=x||Pa;if(y!==Pa){f+=nt.BonusCustomRegExp;try{`${y}`}catch($){throw new Error(`Invalid custom RegExp for param "${g}" (${y}): `+$.message)}}let E=b?`((?:${y})(?:/(?:${y}))*)`:`(${y})`;d||(E=k&&c.length<2?`(?:/${E})`:"/"+E),k&&(E+="?"),r+=E,f+=nt.Dynamic,k&&(f+=nt.BonusOptional),b&&(f+=nt.BonusRepeatable),y===".*"&&(f+=nt.BonusWildcard)}u.push(f)}s.push(u)}if(n.strict&&n.end){const c=s.length-1;s[c][s[c].length-1]+=nt.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const o=new RegExp(r,n.sensitive?"":"i");function a(c){const u=c.match(o),d={};if(!u)return null;for(let h=1;h<u.length;h++){const f=u[h]||"",g=i[h-1];d[g.name]=f&&g.repeatable?f.split("/"):f}return d}function l(c){let u="",d=!1;for(const h of e){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const f of h)if(f.type===An.Static)u+=f.value;else if(f.type===An.Param){const{value:g,repeatable:b,optional:k}=f,x=g in c?c[g]:"";if(At(x)&&!b)throw new Error(`Provided param "${g}" is an array but it is not repeatable (* or + modifiers)`);const y=At(x)?x.join("/"):x;if(!y)if(k)h.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${g}"`);u+=y}}return u||"/"}return{re:o,score:s,keys:i,parse:a,stringify:l}}function Vp(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]===nt.Static+nt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===nt.Static+nt.Segment?1:-1:0}function uu(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const i=Vp(s[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-s.length)===1){if(La(s))return 1;if(La(r))return-1}return r.length-s.length}function La(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const qp={strict:!1,end:!0,sensitive:!1};function Kp(e,t,n){const s=Fp(Up(e.path),n),r=Re(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Wp(e,t){const n=[],s=new Map;t=Aa(qp,t);function r(d){return s.get(d)}function i(d,h,f){const g=!f,b=Ma(d);b.aliasOf=f&&f.record;const k=Aa(t,d),x=[b];if("alias"in d){const $=typeof d.alias=="string"?[d.alias]:d.alias;for(const O of $)x.push(Ma(Re({},b,{components:f?f.record.components:b.components,path:O,aliasOf:f?f.record:b})))}let y,E;for(const $ of x){const{path:O}=$;if(h&&O[0]!=="/"){const P=h.record.path,T=P[P.length-1]==="/"?"":"/";$.path=h.record.path+(O&&T+O)}if(y=Kp($,h,k),f?f.alias.push(y):(E=E||y,E!==y&&E.alias.push(y),g&&d.name&&!Da(y)&&o(d.name)),du(y)&&l(y),b.children){const P=b.children;for(let T=0;T<P.length;T++)i(P[T],y,f&&f.children[T])}f=f||y}return E?()=>{o(E)}:Ss}function o(d){if(au(d)){const h=s.get(d);h&&(s.delete(d),n.splice(n.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=n.indexOf(d);h>-1&&(n.splice(h,1),d.record.name&&s.delete(d.record.name),d.children.forEach(o),d.alias.forEach(o))}}function a(){return n}function l(d){const h=Jp(d,n);n.splice(h,0,d),d.record.name&&!Da(d)&&s.set(d.record.name,d)}function c(d,h){let f,g={},b,k;if("name"in d&&d.name){if(f=s.get(d.name),!f)throw rs(Be.MATCHER_NOT_FOUND,{location:d});k=f.record.name,g=Re(ja(h.params,f.keys.filter(E=>!E.optional).concat(f.parent?f.parent.keys.filter(E=>E.optional):[]).map(E=>E.name)),d.params&&ja(d.params,f.keys.map(E=>E.name))),b=f.stringify(g)}else if(d.path!=null)b=d.path,f=n.find(E=>E.re.test(b)),f&&(g=f.parse(b),k=f.record.name);else{if(f=h.name?s.get(h.name):n.find(E=>E.re.test(h.path)),!f)throw rs(Be.MATCHER_NOT_FOUND,{location:d,currentLocation:h});k=f.record.name,g=Re({},h.params,d.params),b=f.stringify(g)}const x=[];let y=f;for(;y;)x.unshift(y.record),y=y.parent;return{name:k,path:b,params:g,matched:x,meta:Gp(x)}}e.forEach(d=>i(d));function u(){n.length=0,s.clear()}return{addRoute:i,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function ja(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Ma(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:zp(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 zp(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 Da(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Gp(e){return e.reduce((t,n)=>Re(t,n.meta),{})}function Jp(e,t){let n=0,s=t.length;for(;n!==s;){const i=n+s>>1;uu(e,t[i])<0?s=i:n=i+1}const r=Zp(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function Zp(e){let t=e;for(;t=t.parent;)if(du(t)&&uu(e,t)===0)return t}function du({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ua(e){const t=vt(ni),n=vt(Ro),s=De(()=>{const l=$e(e.to);return t.resolve(l)}),r=De(()=>{const{matched:l}=s.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const h=d.findIndex(ss.bind(null,u));if(h>-1)return h;const f=Ba(l[c-2]);return c>1&&Ba(u)===f&&d[d.length-1].path!==f?d.findIndex(ss.bind(null,l[c-2])):h}),i=De(()=>r.value>-1&&eg(n.params,s.value.params)),o=De(()=>r.value>-1&&r.value===n.matched.length-1&&ou(n.params,s.value.params));function a(l={}){if(Qp(l)){const c=t[$e(e.replace)?"replace":"push"]($e(e.to)).catch(Ss);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:s,href:De(()=>s.value.href),isActive:i,isExactActive:o,navigate:a}}function Yp(e){return e.length===1?e[0]:e}const Xp=pt({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:Ua,setup(e,{slots:t}){const n=Zt(Ua(e)),{options:s}=vt(ni),r=De(()=>({[Ha(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Ha(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Yp(t.default(n));return e.custom?i:To("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Gi=Xp;function Qp(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 eg(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!At(r)||r.length!==s.length||s.some((i,o)=>i.valueOf()!==r[o].valueOf()))return!1}return!0}function Ba(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ha=(e,t,n)=>e??t??n,tg=pt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=vt(zi),r=De(()=>e.route||s.value),i=vt($a,0),o=De(()=>{let c=$e(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=De(()=>r.value.matched[o.value]);mr($a,De(()=>o.value+1)),mr(Np,a),mr(zi,r);const l=X();return pn(()=>[l.value,a.value,e.name],([c,u,d],[h,f,g])=>{u&&(u.instances[d]=c,f&&f!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=f.leaveGuards),u.updateGuards.size||(u.updateGuards=f.updateGuards))),c&&u&&(!f||!ss(u,f)||!h)&&(u.enterCallbacks[d]||[]).forEach(b=>b(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,d=a.value,h=d&&d.components[u];if(!h)return Fa(n.default,{Component:h,route:c});const f=d.props[u],g=f?f===!0?c.params:typeof f=="function"?f(c):f:null,k=To(h,Re({},g,t,{onVnodeUnmounted:x=>{x.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return Fa(n.default,{Component:k,route:c})||k}}});function Fa(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const hu=tg;function ng(e){const t=Wp(e.routes,e),n=e.parseQuery||Op,s=e.stringifyQuery||Na,r=e.history,i=ds(),o=ds(),a=ds(),l=Kd(an);let c=an;qn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=wi.bind(null,U=>""+U),d=wi.bind(null,hp),h=wi.bind(null,Ms);function f(U,re){let se,de;return au(U)?(se=t.getRecordMatcher(U),de=re):de=U,t.addRoute(de,se)}function g(U){const re=t.getRecordMatcher(U);re&&t.removeRoute(re)}function b(){return t.getRoutes().map(U=>U.record)}function k(U){return!!t.getRecordMatcher(U)}function x(U,re){if(re=Re({},re||l.value),typeof U=="string"){const A=xi(n,U,re.path),L=t.resolve({path:A.path},re),V=r.createHref(A.fullPath);return Re(A,L,{params:h(L.params),hash:Ms(A.hash),redirectedFrom:void 0,href:V})}let se;if(U.path!=null)se=Re({},U,{path:xi(n,U.path,re.path).path});else{const A=Re({},U.params);for(const L in A)A[L]==null&&delete A[L];se=Re({},U,{params:d(A)}),re.params=d(re.params)}const de=t.resolve(se,re),ke=U.hash||"";de.params=u(h(de.params));const m=gp(s,Re({},U,{hash:cp(ke),path:de.path})),v=r.createHref(m);return Re({fullPath:m,hash:ke,query:s===Na?Cp(U.query):U.query||{}},de,{redirectedFrom:void 0,href:v})}function y(U){return typeof U=="string"?xi(n,U,l.value.path):Re({},U)}function E(U,re){if(c!==U)return rs(Be.NAVIGATION_CANCELLED,{from:re,to:U})}function $(U){return T(U)}function O(U){return $(Re(y(U),{replace:!0}))}function P(U,re){const se=U.matched[U.matched.length-1];if(se&&se.redirect){const{redirect:de}=se;let ke=typeof de=="function"?de(U,re):de;return typeof ke=="string"&&(ke=ke.includes("?")||ke.includes("#")?ke=y(ke):{path:ke},ke.params={}),Re({query:U.query,hash:U.hash,params:ke.path!=null?{}:U.params},ke)}}function T(U,re){const se=c=x(U),de=l.value,ke=U.state,m=U.force,v=U.replace===!0,A=P(se,de);if(A)return T(Re(y(A),{state:typeof A=="object"?Re({},ke,A.state):ke,force:m,replace:v}),re||se);const L=se;L.redirectedFrom=re;let V;return!m&&mp(s,de,se)&&(V=rs(Be.NAVIGATION_DUPLICATED,{to:L,from:de}),H(de,de,!0,!1)),(V?Promise.resolve(V):ae(L,de)).catch(M=>Ft(M)?Ft(M,Be.NAVIGATION_GUARD_REDIRECT)?M:ye(M):z(M,L,de)).then(M=>{if(M){if(Ft(M,Be.NAVIGATION_GUARD_REDIRECT))return T(Re({replace:v},y(M.to),{state:typeof M.to=="object"?Re({},ke,M.to.state):ke,force:m}),re||L)}else M=J(L,de,!0,v,ke);return ge(L,de,M),M})}function B(U,re){const se=E(U,re);return se?Promise.reject(se):Promise.resolve()}function q(U){const re=G.values().next().value;return re&&typeof re.runWithContext=="function"?re.runWithContext(U):U()}function ae(U,re){let se;const[de,ke,m]=$p(U,re);se=ki(de.reverse(),"beforeRouteLeave",U,re);for(const A of de)A.leaveGuards.forEach(L=>{se.push(un(L,U,re))});const v=B.bind(null,U,re);return se.push(v),Me(se).then(()=>{se=[];for(const A of i.list())se.push(un(A,U,re));return se.push(v),Me(se)}).then(()=>{se=ki(ke,"beforeRouteUpdate",U,re);for(const A of ke)A.updateGuards.forEach(L=>{se.push(un(L,U,re))});return se.push(v),Me(se)}).then(()=>{se=[];for(const A of m)if(A.beforeEnter)if(At(A.beforeEnter))for(const L of A.beforeEnter)se.push(un(L,U,re));else se.push(un(A.beforeEnter,U,re));return se.push(v),Me(se)}).then(()=>(U.matched.forEach(A=>A.enterCallbacks={}),se=ki(m,"beforeRouteEnter",U,re,q),se.push(v),Me(se))).then(()=>{se=[];for(const A of o.list())se.push(un(A,U,re));return se.push(v),Me(se)}).catch(A=>Ft(A,Be.NAVIGATION_CANCELLED)?A:Promise.reject(A))}function ge(U,re,se){a.list().forEach(de=>q(()=>de(U,re,se)))}function J(U,re,se,de,ke){const m=E(U,re);if(m)return m;const v=re===an,A=qn?history.state:{};se&&(de||v?r.replace(U.fullPath,Re({scroll:v&&A&&A.scroll},ke)):r.push(U.fullPath,ke)),l.value=U,H(U,re,se,v),ye()}let Z;function N(){Z||(Z=r.listen((U,re,se)=>{if(!le.listening)return;const de=x(U),ke=P(de,le.currentRoute.value);if(ke){T(Re(ke,{replace:!0,force:!0}),de).catch(Ss);return}c=de;const m=l.value;qn&&kp(Ca(m.fullPath,se.delta),ti()),ae(de,m).catch(v=>Ft(v,Be.NAVIGATION_ABORTED|Be.NAVIGATION_CANCELLED)?v:Ft(v,Be.NAVIGATION_GUARD_REDIRECT)?(T(Re(y(v.to),{force:!0}),de).then(A=>{Ft(A,Be.NAVIGATION_ABORTED|Be.NAVIGATION_DUPLICATED)&&!se.delta&&se.type===Ki.pop&&r.go(-1,!1)}).catch(Ss),Promise.reject()):(se.delta&&r.go(-se.delta,!1),z(v,de,m))).then(v=>{v=v||J(de,m,!1),v&&(se.delta&&!Ft(v,Be.NAVIGATION_CANCELLED)?r.go(-se.delta,!1):se.type===Ki.pop&&Ft(v,Be.NAVIGATION_ABORTED|Be.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),ge(de,m,v)}).catch(Ss)}))}let fe=ds(),I=ds(),F;function z(U,re,se){ye(U);const de=I.list();return de.length?de.forEach(ke=>ke(U,re,se)):console.error(U),Promise.reject(U)}function ce(){return F&&l.value!==an?Promise.resolve():new Promise((U,re)=>{fe.add([U,re])})}function ye(U){return F||(F=!U,N(),fe.list().forEach(([re,se])=>U?se(U):re()),fe.reset()),U}function H(U,re,se,de){const{scrollBehavior:ke}=e;if(!qn||!ke)return Promise.resolve();const m=!se&&Sp(Ca(U.fullPath,0))||(de||!se)&&history.state&&history.state.scroll||null;return Cn().then(()=>ke(U,re,m)).then(v=>v&&Ep(v)).catch(v=>z(v,U,re))}const S=U=>r.go(U);let R;const G=new Set,le={currentRoute:l,listening:!0,addRoute:f,removeRoute:g,clearRoutes:t.clearRoutes,hasRoute:k,getRoutes:b,resolve:x,options:e,push:$,replace:O,go:S,back:()=>S(-1),forward:()=>S(1),beforeEach:i.add,beforeResolve:o.add,afterEach:a.add,onError:I.add,isReady:ce,install(U){U.component("RouterLink",Gi),U.component("RouterView",hu),U.config.globalProperties.$router=le,Object.defineProperty(U.config.globalProperties,"$route",{enumerable:!0,get:()=>$e(l)}),qn&&!R&&l.value===an&&(R=!0,$(r.location).catch(de=>{}));const re={};for(const de in an)Object.defineProperty(re,de,{get:()=>l.value[de],enumerable:!0});U.provide(ni,le),U.provide(Ro,sc(re)),U.provide(zi,l);const se=U.unmount;G.add(U),U.unmount=function(){G.delete(U),G.size<1&&(c=an,Z&&Z(),Z=null,l.value=an,R=!1,F=!1),se()}}};function Me(U){return U.reduce((re,se)=>re.then(()=>q(se)),Promise.resolve())}return le}function fu(){return vt(ni)}function sg(e){return vt(Ro)}const rg=["width","height","viewBox","innerHTML"],je=pt({__name:"FluentIcon",props:{paths:{},size:{default:20},viewBox:{default:20}},setup(e){return(t,n)=>(_(),w("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size,viewBox:`0 0 ${e.viewBox} ${e.viewBox}`,fill:"currentColor","aria-hidden":"true",innerHTML:e.paths},null,8,rg))}});function si(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]]);return n}function ig(e,t,n,s){function r(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(s.next(u))}catch(d){o(d)}}function l(u){try{c(s.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):r(u.value).then(a,l)}c((s=s.apply(e,t||[])).next())})}const og=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Oo extends Error{constructor(t,n="FunctionsError",s){super(t),this.name=n,this.context=s}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class ag extends Oo{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Va extends Oo{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class qa extends Oo{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Ji;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Ji||(Ji={}));class lg{constructor(t,{headers:n={},customFetch:s,region:r=Ji.Any}={}){this.url=t,this.headers=n,this.region=r,this.fetch=og(s)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return ig(this,arguments,void 0,function*(n,s={}){var r;let i,o;try{const{headers:a,method:l,body:c,signal:u,timeout:d}=s;let h={},{region:f}=s;f||(f=this.region);const g=new URL(`${this.url}/${n}`);f&&f!=="any"&&(h["x-region"]=f,g.searchParams.set("forceFunctionRegion",f));let b;c&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",b=c):typeof c=="string"?(h["Content-Type"]="text/plain",b=c):typeof FormData<"u"&&c instanceof FormData?b=c:(h["Content-Type"]="application/json",b=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?b=JSON.stringify(c):b=c;let k=u;d&&(o=new AbortController,i=setTimeout(()=>o.abort(),d),u?(k=o.signal,u.addEventListener("abort",()=>o.abort())):k=o.signal);const x=yield this.fetch(g.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:b,signal:k}).catch(O=>{throw new ag(O)}),y=x.headers.get("x-relay-error");if(y&&y==="true")throw new Va(x);if(!x.ok)throw new qa(x);let E=((r=x.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),$;return E==="application/json"?$=yield x.json():E==="application/octet-stream"||E==="application/pdf"?$=yield x.blob():E==="text/event-stream"?$=x:E==="multipart/form-data"?$=yield x.formData():$=yield x.text(),{data:$,error:null,response:x}}catch(a){return{data:null,error:a,response:a instanceof qa||a instanceof Va?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const pu=3,Ka=e=>Math.min(1e3*2**e,3e4),cg=[520,503],gu=["GET","HEAD","OPTIONS"];var ug=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Wa(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const s=setTimeout(()=>{t==null||t.removeEventListener("abort",r),n()},e);function r(){clearTimeout(s),n()}t==null||t.addEventListener("abort",r)})}function dg(e,t,n,s){return!(!s||n>=pu||!gu.includes(e)||!cg.includes(t))}var hg=class{constructor(e){var t,n,s,r,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(s=e.shouldStripNulls)!==null&&s!==void 0?s:!1,this.urlLengthLimit=(r=e.urlLengthLimit)!==null&&r!==void 0?r:8e3,this.retryEnabled=(i=e.retry)!==null&&i!==void 0?i:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const s=this.fetch;let i=(async()=>{let o=0;for(;;){const c=new Headers(n.headers);o>0&&c.set("X-Retry-Count",String(o));let u;try{u=await s(n.url.toString(),{method:n.method,headers:c,body:JSON.stringify(n.body,(d,h)=>typeof h=="bigint"?h.toString():h),signal:n.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!gu.includes(n.method))throw d;if(n.retryEnabled&&o<pu){const h=Ka(o);o++,await Wa(h,n.signal);continue}throw d}if(dg(n.method,u.status,o,n.retryEnabled)){var a,l;const d=(a=(l=u.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,h=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:Ka(o);await u.text(),o++,await Wa(h,n.signal);continue}return await n.processResponse(u)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var a;let l="",c="",u="";const d=o==null?void 0:o.cause;if(d){var h,f,g,b;const y=(h=d==null?void 0:d.message)!==null&&h!==void 0?h:"",E=(f=d==null?void 0:d.code)!==null&&f!==void 0?f:"";l=`${(g=o==null?void 0:o.name)!==null&&g!==void 0?g:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
30
+
31
+ Caused by: ${(b=d==null?void 0:d.name)!==null&&b!==void 0?b:"Error"}: ${y}`,E&&(l+=` (${E})`),d!=null&&d.stack&&(l+=`
32
+ ${d.stack}`)}else{var k;l=(k=o==null?void 0:o.stack)!==null&&k!==void 0?k:""}const x=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",x>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${x} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",x>this.urlLengthLimit&&(c+=`. Your request URL is ${x} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,s=null,r=null,i=e.status,o=e.statusText;if(e.ok){var a,l;if(t.method!=="HEAD"){var c;const h=await e.text();h===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((c=t.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?s=h:s=JSON.parse(h))}const u=(a=t.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),d=(l=e.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");u&&d&&d.length>1&&(r=parseInt(d[1])),t.isMaybeSingle&&Array.isArray(s)&&(s.length>1?(n={code:"PGRST116",details:`Results contain ${s.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},s=null,r=null,i=406,o="Not Acceptable"):s.length===1?s=s[0]:s=null)}else{const u=await e.text();try{n=JSON.parse(u),Array.isArray(n)&&e.status===404&&(s=[],n=null,i=200,o="OK")}catch{e.status===404&&u===""?(i=204,o="No Content"):n={message:u}}if(n&&t.shouldThrowOnError)throw new ug(n)}return{success:n===null,error:n,data:s,count:r,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},fg=class extends hg{select(e){let t=!1;const n=(e??"*").split("").map(s=>/\s/.test(s)&&!t?"":(s==='"'&&(t=!t),s)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:s,referencedTable:r=s}={}){const i=r?`${r}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const s=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:s=n}={}){const r=typeof s>"u"?"offset":`${s}.offset`,i=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(r,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:s=!1,wal:r=!1,format:i="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,n?"settings":null,s?"buffers":null,r?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const za=new RegExp("[,()]");var Kn=class extends fg{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(s=>typeof s=="string"&&za.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(s=>typeof s=="string"&&za.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:s}={}){let r="";s==="plain"?r="pl":s==="phrase"?r="ph":s==="websearch"&&(r="w");const i=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${r}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>n!==void 0).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const s=n?`${n}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},pg=class{constructor(e,{headers:t={},schema:n,fetch:s,urlLengthLimit:r=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=s,this.urlLengthLimit=r,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:s}=t??{},r=n?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(c=>/\s/.test(c)&&!i?"":(c==='"'&&(i=!i),c)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),s&&l.append("Prefer",`count=${s}`),new Kn({method:r,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var s;const r="POST",{url:i,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),n||o.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(a.length>0){const l=[...new Set(a)].map(c=>`"${c}"`);i.searchParams.set("columns",l.join(","))}}return new Kn({method:r,url:i,headers:o,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:s,defaultToNull:r=!0}={}){var i;const o="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&a.searchParams.set("on_conflict",t),s&&l.append("Prefer",`count=${s}`),r||l.append("Prefer","missing=default"),Array.isArray(e)){const c=e.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(c.length>0){const u=[...new Set(c)].map(d=>`"${d}"`);a.searchParams.set("columns",u.join(","))}}return new Kn({method:o,url:a,headers:l,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const s="PATCH",{url:r,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new Kn({method:s,url:r,headers:i,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const n="DELETE",{url:s,headers:r}=this.cloneRequestState();return e&&r.append("Prefer",`count=${e}`),new Kn({method:n,url:s,headers:r,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Ds(e){"@babel/helpers - typeof";return Ds=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ds(e)}function gg(e,t){if(Ds(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(Ds(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mg(e){var t=gg(e,"string");return Ds(t)=="symbol"?t:t+""}function bg(e,t,n){return(t=mg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ga(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ga(Object(n),!0).forEach(function(s){bg(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ga(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var vg=class mu{constructor(t,{headers:n={},schema:s,fetch:r,timeout:i,urlLengthLimit:o=8e3,retry:a}={}){this.url=t,this.headers=new Headers(n),this.schemaName=s,this.urlLengthLimit=o;const l=r??globalThis.fetch;i!==void 0&&i>0?this.fetch=(c,u)=>{const d=new AbortController,h=setTimeout(()=>d.abort(),i),f=u==null?void 0:u.signal;if(f){if(f.aborted)return clearTimeout(h),l(c,u);const g=()=>{clearTimeout(h),d.abort()};return f.addEventListener("abort",g,{once:!0}),l(c,rr(rr({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(h),f.removeEventListener("abort",g)})}return l(c,rr(rr({},u),{},{signal:d.signal})).finally(()=>clearTimeout(h))}:this.fetch=l,this.retry=a}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new pg(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new mu(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:s=!1,get:r=!1,count:i}={}){var o;let a;const l=new URL(`${this.url}/rpc/${t}`);let c;const u=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(u)),d=s&&Object.values(n).some(u);d?(a="POST",c=n):s||r?(a=s?"HEAD":"GET",Object.entries(n).filter(([f,g])=>g!==void 0).map(([f,g])=>[f,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([f,g])=>{l.searchParams.append(f,g)})):(a="POST",c=n);const h=new Headers(this.headers);return d?h.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&h.set("Prefer",`count=${i}`),new Kn({method:a,url:l,headers:h,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class yg{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const n=globalThis;if(typeof globalThis<"u"&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};const s=typeof global<"u"?global:void 0;if(s&&typeof s.WebSocket<"u")return{type:"native",wsConstructor:s.WebSocket};if(typeof globalThis<"u"&&typeof n.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&n.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const i=r.versions;if(i&&i.node){const o=i.node,a=parseInt(o.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
33
+ import ws from "ws"
34
+ new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
35
+
36
+ Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const _g="2.105.4",wg=`realtime-js/${_g}`,xg="1.0.0",bu="2.0.0",Eg=bu,kg=1e4,Sg=100,dn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},vu={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Zi={connecting:"connecting",closing:"closing",closed:"closed"};class Tg{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let s=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(s))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,s;const r=(s=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&s!==void 0?s:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,r)}_encodeJsonUserBroadcastPush(t){var n,s;const r=(s=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&s!==void 0?s:{},o=new TextEncoder().encode(JSON.stringify(r)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,s){var r,i;const o=t.topic,a=(r=t.ref)!==null&&r!==void 0?r:"",l=(i=t.join_ref)!==null&&i!==void 0?i:"",c=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},d=Object.keys(u).length===0?"":JSON.stringify(u);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+c.length+d.length,f=new ArrayBuffer(this.HEADER_LENGTH+h);let g=new DataView(f),b=0;g.setUint8(b++,this.KINDS.userBroadcastPush),g.setUint8(b++,l.length),g.setUint8(b++,a.length),g.setUint8(b++,o.length),g.setUint8(b++,c.length),g.setUint8(b++,d.length),g.setUint8(b++,n),Array.from(l,x=>g.setUint8(b++,x.charCodeAt(0))),Array.from(a,x=>g.setUint8(b++,x.charCodeAt(0))),Array.from(o,x=>g.setUint8(b++,x.charCodeAt(0))),Array.from(c,x=>g.setUint8(b++,x.charCodeAt(0))),Array.from(d,x=>g.setUint8(b++,x.charCodeAt(0)));var k=new Uint8Array(f.byteLength+s.byteLength);return k.set(new Uint8Array(f),0),k.set(new Uint8Array(s),f.byteLength),k.buffer}decode(t,n){if(this._isArrayBuffer(t)){let s=this._binaryDecode(t);return n(s)}if(typeof t=="string"){const s=JSON.parse(t),[r,i,o,a,l]=s;return n({join_ref:r,ref:i,topic:o,event:a,payload:l})}return n({})}_binaryDecode(t){const n=new DataView(t),s=n.getUint8(0),r=new TextDecoder;switch(s){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,r)}}_decodeUserBroadcast(t,n,s){const r=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),a=n.getUint8(4);let l=this.HEADER_LENGTH+4;const c=s.decode(t.slice(l,l+r));l=l+r;const u=s.decode(t.slice(l,l+i));l=l+i;const d=s.decode(t.slice(l,l+o));l=l+o;const h=t.slice(l,t.byteLength),f=a===this.JSON_ENCODING?JSON.parse(s.decode(h)):h,g={type:this.BROADCAST_EVENT,event:u,payload:f};return o>0&&(g.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([s])=>n.includes(s)))}}var Pe;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Pe||(Pe={}));const Ja=(e,t,n={})=>{var s;const r=(s=n.skipTypes)!==null&&s!==void 0?s:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=Ag(o,e,t,r),i),{}):{}},Ag=(e,t,n,s)=>{const r=t.find(a=>a.name===e),i=r==null?void 0:r.type,o=n[e];return i&&!s.includes(i)?yu(i,o):Yi(o)},yu=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return Ng(t,n)}switch(e){case Pe.bool:return Rg(t);case Pe.float4:case Pe.float8:case Pe.int2:case Pe.int4:case Pe.int8:case Pe.numeric:case Pe.oid:return Og(t);case Pe.json:case Pe.jsonb:return Cg(t);case Pe.timestamp:return $g(t);case Pe.abstime:case Pe.date:case Pe.daterange:case Pe.int4range:case Pe.int8range:case Pe.money:case Pe.reltime:case Pe.text:case Pe.time:case Pe.timestamptz:case Pe.timetz:case Pe.tsrange:case Pe.tstzrange:return Yi(t);default:return Yi(t)}},Yi=e=>e,Rg=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Og=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Cg=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},Ng=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,s=e[n];if(e[0]==="{"&&s==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>yu(t,a))}return e},$g=e=>typeof e=="string"?e.replace(" ","T"):e,_u=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var Ts=e=>typeof e=="function"?e:function(){return e},Ig=typeof self<"u"?self:null,Wn=typeof window<"u"?window:null,It=Ig||Wn||globalThis,Pg="2.0.0",Lg=1e4,jg=1e3,Mt={connecting:0,open:1,closing:2,closed:3},ot={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Kt={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Xi={longpoll:"longpoll",websocket:"websocket"},Mg={complete:4},Qi="base64url.bearer.phx.",ir=class{constructor(e,t,n,s){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=s,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},wu=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},Dg=class{constructor(e,t,n){this.state=ot.closed,this.topic=e,this.params=Ts(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ir(this,Kt.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new wu(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=ot.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this.joinPush.receive("error",s=>{this.state=ot.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=ot.closed,this.socket.remove(this)}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=ot.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new ir(this,Kt.leave,Ts({}),this.timeout).send(),this.state=ot.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Kt.reply,(s,r)=>{this.trigger(this.replyEventName(r),s)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=ot.closed,this.bindings=[]}onClose(e){this.on(Kt.close,e)}onError(e){return this.on(Kt.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new ir(this,e,function(){return t},n);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=ot.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Kt.close,"leave")},n=new ir(this,Kt.leave,Ts({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,s){return this.topic!==e?!1:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:s}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=ot.joining,this.joinPush.resend(e))}trigger(e,t,n,s){let r=this.onMessage(e,t,n,s);if(t&&!r)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,n));for(let o=0;o<i.length;o++)i[o].callback(r,n,s||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===ot.closed}isErrored(){return this.state===ot.errored}isJoined(){return this.state===ot.joined}isJoining(){return this.state===ot.joining}isLeaving(){return this.state===ot.leaving}},Cr=class{static request(e,t,n,s,r,i,o){if(It.XDomainRequest){let a=new It.XDomainRequest;return this.xdomainRequest(a,e,t,s,r,i,o)}else if(It.XMLHttpRequest){let a=new It.XMLHttpRequest;return this.xhrRequest(a,e,t,n,s,r,i,o)}else{if(It.fetch&&It.AbortController)return this.fetchRequest(e,t,n,s,r,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,s,r,i,o){let a={method:e,headers:n,body:s},l=null;return r&&(l=new AbortController,setTimeout(()=>l.abort(),r),a.signal=l.signal),It.fetch(t,a).then(c=>c.text()).then(c=>this.parseJSON(c)).then(c=>o&&o(c)).catch(c=>{c.name==="AbortError"&&i?i():o&&o(null)}),l}static xdomainRequest(e,t,n,s,r,i,o){return e.timeout=r,e.open(t,n),e.onload=()=>{let a=this.parseJSON(e.responseText);o&&o(a)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(s),e}static xhrRequest(e,t,n,s,r,i,o,a){e.open(t,n,!0),e.timeout=i;for(let[l,c]of Object.entries(s))e.setRequestHeader(l,c);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===Mg.complete&&a){let l=this.parseJSON(e.responseText);a(l)}},o&&(e.ontimeout=o),e.send(r),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let r=t?`${t}[${s}]`:s,i=e[s];typeof i=="object"?n.push(this.serialize(i,r)):n.push(encodeURIComponent(r)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},Ug=e=>{let t="",n=new Uint8Array(e),s=n.byteLength;for(let r=0;r<s;r++)t+=String.fromCharCode(n[r]);return btoa(t)},Mn=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Qi)&&(this.authToken=atob(t[1].slice(Qi.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Mt.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Xi.websocket),"$1/"+Xi.longpoll)}endpointURL(){return Cr.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=Mt.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Mt.open||this.readyState===Mt.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:s,messages:r}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=s}else n=0;switch(n){case 200:r.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Mt.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(e){typeof e!="string"&&(e=Ug(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
37
+ `),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let r of this.reqs)r.abort();this.readyState=Mt.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s)}ajax(e,t,n,s,r){let i,o=()=>{this.reqs.delete(i),s()};i=Cr.request(e,this.endpointURL(),t,n,this.timeout,o,a=>{this.reqs.delete(i),this.isActive()&&r(a)}),this.reqs.add(i)}},Bg=class gs{constructor(t,n={}){let s=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(s.state,r=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=gs.syncState(this.state,r,i,o),this.pendingDiffs.forEach(l=>{this.state=gs.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel.on(s.diff,r=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(r):(this.state=gs.syncDiff(this.state,r,i,o),a())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return gs.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,s,r){let i=this.clone(t),o={},a={};return this.map(i,(l,c)=>{n[l]||(a[l]=c)}),this.map(n,(l,c)=>{let u=i[l];if(u){let d=c.metas.map(b=>b.phx_ref),h=u.metas.map(b=>b.phx_ref),f=c.metas.filter(b=>h.indexOf(b.phx_ref)<0),g=u.metas.filter(b=>d.indexOf(b.phx_ref)<0);f.length>0&&(o[l]=c,o[l].metas=f),g.length>0&&(a[l]=this.clone(u),a[l].metas=g)}else o[l]=c}),this.syncDiff(i,{joins:o,leaves:a},s,r)}static syncDiff(t,n,s,r){let{joins:i,leaves:o}=this.clone(n);return s||(s=function(){}),r||(r=function(){}),this.map(i,(a,l)=>{let c=t[a];if(t[a]=this.clone(l),c){let u=t[a].metas.map(h=>h.phx_ref),d=c.metas.filter(h=>u.indexOf(h.phx_ref)<0);t[a].metas.unshift(...d)}s(a,c,l)}),this.map(o,(a,l)=>{let c=t[a];if(!c)return;let u=l.metas.map(d=>d.phx_ref);c.metas=c.metas.filter(d=>u.indexOf(d.phx_ref)<0),r(a,c,l),c.metas.length===0&&delete t[a]}),t}static list(t,n){return n||(n=function(s,r){return r}),this.map(t,(s,r)=>n(s,r))}static map(t,n){return Object.getOwnPropertyNames(t).map(s=>n(s,t[s]))}static clone(t){return JSON.parse(JSON.stringify(t))}},or={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,s,r,i,o]=JSON.parse(e);return t({join_ref:n,ref:s,topic:r,event:i,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:s,topic:r,payload:i}=e,o=this.META_LENGTH+t.length+n.length+r.length+s.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,t.length),l.setUint8(c++,n.length),l.setUint8(c++,r.length),l.setUint8(c++,s.length),Array.from(t,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(n,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(r,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(s,d=>l.setUint8(c++,d.charCodeAt(0)));var u=new Uint8Array(a.byteLength+i.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(i),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,n){let s=t.getUint8(1),r=t.getUint8(2),i=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(o,o+s));o=o+s;let l=n.decode(e.slice(o,o+r));o=o+r;let c=n.decode(e.slice(o,o+i));o=o+i;let u=e.slice(o,e.byteLength);return{join_ref:a,ref:null,topic:l,event:c,payload:u}},decodeReply(e,t,n){let s=t.getUint8(1),r=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(e.slice(a,a+s));a=a+s;let c=n.decode(e.slice(a,a+r));a=a+r;let u=n.decode(e.slice(a,a+i));a=a+i;let d=n.decode(e.slice(a,a+o));a=a+o;let h=e.slice(a,e.byteLength),f={status:d,response:h};return{join_ref:l,ref:c,topic:u,event:Kt.reply,payload:f}},decodeBroadcast(e,t,n){let s=t.getUint8(1),r=t.getUint8(2),i=this.HEADER_LENGTH+2,o=n.decode(e.slice(i,i+s));i=i+s;let a=n.decode(e.slice(i,i+r));i=i+r;let l=e.slice(i,e.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:l}}},Hg=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||Lg,this.transport=t.transport||It.WebSocket||Mn,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=It&&It.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=or.encode.bind(or),this.defaultDecoder=or.decode.bind(or),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Mn?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let s=null;Wn&&Wn.addEventListener&&(Wn.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),s=this.connectClock)}),Wn.addEventListener("pageshow",r=>{s===this.connectClock&&(s=null,this.connect())}),Wn.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=r=>t.rejoinAfterMs?t.rejoinAfterMs(r):[1e3,2e3,5e3][r-1]||1e4,this.reconnectAfterMs=r=>t.reconnectAfterMs?t.reconnectAfterMs(r):[10,50,100,150,200,250,500,1e3,2e3][r-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(r,i,o)=>{console.log(`${r}: ${i}`,o)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Ts(t.params||{}),this.endPoint=`${e}/${Xi.websocket}`,this.vsn=t.vsn||Pg,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new wu(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Mn}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Cr.appendParams(Cr.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Ts(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Mn?this.connectWithFallback(Mn,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let s=this.onMessage(r=>{r.ref===t&&(this.off([s]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Mn:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Qi}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,s=!0,r,i,o=this.transportName(e),a=l=>{this.log("transport",`falling back to ${o}...`,l),this.off([r,i]),s=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),i=this.onError(l=>{this.log("transport","error",l),s&&!n&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!s){let l=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),jg,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const s=this.conn;this.waitForBufferDone(s,()=>{t?s.close(t,n||""):s.close(),this.waitForSocketClosed(s,()=>{this.conn===s&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===Mt.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Kt.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Mt.connecting:return"connecting";case Mt.open:return"open";case Mt.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new Dg(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:s,ref:r,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${r})`,s)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:n,event:s,payload:r,ref:i,join_ref:o}=t;if(i&&i===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status==="ok"?"ok":"error",a)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${r.status||""} ${n} ${s} ${i&&"("+i+")"||""}`.trim(),r);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(n,s,r,o)&&l.trigger(s,r,i,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,s])=>{try{s(...t)}catch(r){this.log("error",`error in ${e} callback`,r)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class As{constructor(t,n){const s=Vg(n);this.presence=new Bg(t.getChannel(),s),this.presence.onJoin((r,i,o)=>{const a=As.onJoinPayload(r,i,o);t.getChannel().trigger("presence",a)}),this.presence.onLeave((r,i,o)=>{const a=As.onLeavePayload(r,i,o);t.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return As.transformState(this.presence.state)}static transformState(t){return t=Fg(t),Object.getOwnPropertyNames(t).reduce((n,s)=>{const r=t[s];return n[s]=yr(r),n},{})}static onJoinPayload(t,n,s){const r=Za(n),i=yr(s);return{event:"join",key:t,currentPresences:r,newPresences:i}}static onLeavePayload(t,n,s){const r=Za(n),i=yr(s);return{event:"leave",key:t,currentPresences:r,leftPresences:i}}}function yr(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function Fg(e){return JSON.parse(JSON.stringify(e))}function Vg(e){return(e==null?void 0:e.events)&&{events:e.events}}function Za(e){return e!=null&&e.metas?yr(e):[]}var Ya;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Ya||(Ya={}));class qg{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new As(this.channel.channelAdapter,n)}}function Kg(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const n=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${n}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class Wg{constructor(t,n,s){const r=zg(s);this.channel=t.getSocket().channel(n,r),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,n){return this.channel.on(t,n)}off(t,n){this.channel.off(t,n)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,n,s){let r;try{r=this.channel.push(t,n,s)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>Sg){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return r}updateJoinPayload(t){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),t)}canPush(){return this.socket.isConnected()&&this.state===dn.joined}isJoined(){return this.state===dn.joined}isJoining(){return this.state===dn.joining}isClosed(){return this.state===dn.closed}isLeaving(){return this.state===dn.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function zg(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var Xa;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Xa||(Xa={}));var Jn;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Jn||(Jn={}));var Wt;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Wt||(Wt={}));class Rs{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,n={config:{}},s){var r,i;if(this.topic=t,this.params=n,this.socket=s,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new Wg(this.socket.socketAdapter,t,this.params),this.presence=new qg(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=_u(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(r=this.params.config)===null||r===void 0?void 0:r.broadcast)===null||i===void 0)&&i.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,n=this.timeout){var s,r,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:a,private:l}}=this.params,c=(r=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(f=>f.filter))!==null&&r!==void 0?r:[],u=!!this.bindings[Jn.PRESENCE]&&this.bindings[Jn.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,d={},h={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(f=>{t==null||t(Wt.CHANNEL_ERROR,Kg(f))}),this._onClose(()=>t==null?void 0:t(Wt.CLOSED)),this.updateJoinPayload(Object.assign({config:h},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:f})=>{if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){t==null||t(Wt.SUBSCRIBED);return}this._updatePostgresBindings(f,t)}).receive("error",f=>{this.state=dn.errored;const g=Object.values(f).join(", ")||"error";t==null||t(Wt.CHANNEL_ERROR,new Error(g,{cause:f}))}).receive("timeout",()=>{t==null||t(Wt.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var s;const r=this.bindings.postgres_changes,i=(s=r==null?void 0:r.length)!==null&&s!==void 0?s:0,o=[];for(let a=0;a<i;a++){const l=r[a],{filter:{event:c,schema:u,table:d,filter:h}}=l,f=t&&t[a];if(f&&f.event===c&&Rs.isFilterValueEqual(f.schema,u)&&Rs.isFilterValueEqual(f.table,d)&&Rs.isFilterValueEqual(f.filter,h))o.push(Object.assign(Object.assign({},l),{id:f.id}));else{this.unsubscribe(),this.state=dn.errored,n==null||n(Wt.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=dn.errored&&n&&n(Wt.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,s){const r=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=t===Jn.PRESENCE||t===Jn.POSTGRES_CHANGES;if(r&&i)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,n,s)}async httpSend(t,n,s={}){var r;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(r=s.timeout)!==null&&r!==void 0?r:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;try{const c=await a.json();l=c.error||c.message||l}catch{}return Promise.reject(new Error(l))}async send(t,n={}){var s,r;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=t,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);return await((r=c.body)===null||r===void 0?void 0:r.cancel()),c.ok?"ok":"error"}catch(c){return c instanceof Error&&c.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const c=this.channelAdapter.push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),c.receive("ok",()=>i("ok")),c.receive("error",()=>i("error")),c.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,n,s){const r=new AbortController,i=setTimeout(()=>r.abort(),s),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:r.signal}));return clearTimeout(i),o}_on(t,n,s){const r=t.toLocaleLowerCase(),i=this.channelAdapter.on(t,s),o={type:r,filter:n,callback:s,ref:i};return this.bindings[r]?this.bindings[r].push(o):this.bindings[r]=[o],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,s)=>{var r,i,o,a,l,c,u;const d=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,s))return!1;const h=(r=this.bindings[d])===null||r===void 0?void 0:r.find(f=>f.ref===t.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in h){const f=h.id,g=(i=h.filter)===null||i===void 0?void 0:i.event;return f&&((o=n.ids)===null||o===void 0?void 0:o.includes(f))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((a=n.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const f=(c=(l=h==null?void 0:h.filter)===null||l===void 0?void 0:l.event)===null||c===void 0?void 0:c.toLocaleLowerCase();return f==="*"||f===((u=n==null?void 0:n.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===d})}_notThisChannelEvent(t,n){const{close:s,error:r,leave:i,join:o}=vu;return n&&[s,r,i,o].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,s)=>{if(typeof n=="object"&&"ids"in n){const r=n.data,{schema:i,table:o,commit_timestamp:a,type:l,errors:c}=r;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:a,eventType:l,new:{},old:{},errors:c}),this._getPayloadRecords(r))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const s of t.bindings[n])this._on(s.type,s.filter,s.callback)}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=Ja(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=Ja(t.columns,t.old_record)),n}}class Gg{constructor(t,n){this.socket=new Hg(t,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,n,s,r=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),r),this.socket.disconnect(()=>{t(),i("ok")},n,s)})}push(t){this.socket.push(t)}log(t,n,s){this.socket.log(t,n,s)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Zi.connecting}isDisconnecting(){return this.socket.connectionState()==Zi.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Qa={HEARTBEAT_INTERVAL:25e3},Jg=[1e3,2e3,5e3,1e4],Zg=1e4;function Yg(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var n;return(n=Array.from(e.keys())[t])!==null&&n!==void 0?n:null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function Xg(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return Yg()}const Qg=`
38
+ addEventListener("message", (e) => {
39
+ if (e.data.event === "start") {
40
+ setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
41
+ }
42
+ });`;class em{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,n){var s;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new Tg,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((s=n==null?void 0:n.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const r=this._initializeOptions(n);this.socketAdapter=new Gg(t,r),this.httpEndpoint=_u(t),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const n=t.message;throw n.includes("Node.js")?new Error(`${n}
43
+
44
+ To use Realtime in Node.js, you need to provide a WebSocket implementation:
45
+
46
+ Option 1: Use Node.js 22+ which has native WebSocket support
47
+ Option 2: Install and provide the "ws" package:
48
+
49
+ npm install ws
50
+
51
+ import ws from "ws"
52
+ const client = new RealtimeClient(url, {
53
+ ...options,
54
+ transport: ws
55
+ })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,n)}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return n==="ok"&&t.teardown(),n}async removeAllChannels(){const t=this.channels.map(async s=>{const r=await s.unsubscribe();return s.teardown(),r}),n=await Promise.all(t);return await this.disconnect(),n}log(t,n,s){this.socketAdapter.log(t,n,s)}connectionState(){return this.socketAdapter.connectionState()||Zi.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const s=`realtime:${t}`,r=this.getChannels().find(i=>i.topic===s);if(r)return r;{const i=new Rs(`realtime:${t}`,n,this);return this._cancelPendingDisconnect(),this.channels.push(i),i}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let n,s=!1;if(t)n=t,s=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(r){this.log("error","Error fetching access token from callback",r),n=this.accessTokenValue}else n=this.accessTokenValue;s?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const i={access_token:n,version:wg};n&&r.updateJoinPayload(i),r.joinedOnce&&r.channelAdapter.isJoined()&&r.channelAdapter.push(vu.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(n,s)=>{n=="sent"&&this._setAuthSafely(),t&&t(n,s)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let n;if(t)n=t;else{const s=new Blob([Qg],{type:"application/javascript"});n=URL.createObjectURL(s)}return n}_initializeOptions(t){var n,s,r,i,o,a,l,c,u,d,h,f;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(s=t==null?void 0:t.accessToken)!==null&&s!==void 0?s:null;const g={};g.timeout=(r=t==null?void 0:t.timeout)!==null&&r!==void 0?r:kg,g.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:Qa.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:Qa.HEARTBEAT_INTERVAL),g.transport=(l=t==null?void 0:t.transport)!==null&&l!==void 0?l:yg.getWebSocketConstructor(),g.params=t==null?void 0:t.params,g.logger=t==null?void 0:t.logger,g.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),g.sessionStorage=(c=t==null?void 0:t.sessionStorage)!==null&&c!==void 0?c:Xg(),g.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:y=>Jg[y-1]||Zg;let b,k;const x=(d=t==null?void 0:t.vsn)!==null&&d!==void 0?d:Eg;switch(x){case xg:b=(y,E)=>E(JSON.stringify(y)),k=(y,E)=>E(JSON.parse(y));break;case bu:b=this.serializer.encode.bind(this.serializer),k=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${g.vsn}`)}if(g.vsn=x,g.encode=(h=t==null?void 0:t.encode)!==null&&h!==void 0?h:b,g.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:k,g.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,g.params=Object.assign(Object.assign({},g.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,g.autoSendHeartbeat=!this.worker}return g}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Us=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function tm(e,t,n){const s=new URL(t,e);if(n)for(const[r,i]of Object.entries(n))i!==void 0&&s.searchParams.set(r,i);return s.toString()}async function nm(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function sm(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:s,query:r,body:i,headers:o}){const a=tm(e.baseUrl,s,r),l=await nm(e.auth),c=await t(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):void 0}),u=await c.text(),d=(c.headers.get("content-type")||"").includes("application/json"),h=d&&u?JSON.parse(u):u;if(!c.ok){const f=d?h:void 0,g=f==null?void 0:f.error;throw new Us((g==null?void 0:g.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:f})}return{status:c.status,headers:c.headers,data:h}}}}function ar(e){return e.join("")}var rm=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:ar(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(s=>({namespace:s}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ar(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ar(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ar(e.namespace)}`}),!0}catch(t){if(t instanceof Us&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Us&&n.status===409)return;throw n}}};function Dn(e){return e.join("")}var im=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Dn(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Dn(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Dn(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Dn(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Dn(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Dn(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Us&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Us&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},om=class{constructor(e){var s;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=sm({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(s=e.accessDelegation)==null?void 0:s.join(","),this.namespaceOps=new rm(this.client,t),this.tableOps=new im(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function Bs(e){"@babel/helpers - typeof";return Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs(e)}function am(e,t){if(Bs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(Bs(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lm(e){var t=am(e,"string");return Bs(t)=="symbol"?t:t+""}function cm(e,t,n){return(t=lm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function el(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?el(Object(n),!0).forEach(function(s){cm(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):el(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var ri=class extends Error{constructor(e,t="storage",n,s){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=s}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function ii(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var eo=class extends ri{constructor(e,t,n,s="storage"){super(e,s,t,n),this.name=s==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return ve({},super.toJSON())}},xu=class extends ri{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function Nr(e,t,n){const s=ve({},e),r=t.toLowerCase();for(const i of Object.keys(s))i.toLowerCase()===r&&delete s[i];return s[r]=n,s}function um(e){const t={};for(const[n,s]of Object.entries(e))t[n.toLowerCase()]=s;return t}const dm=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),hm=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},to=e=>{if(Array.isArray(e))return e.map(n=>to(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,s])=>{const r=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[r]=to(s)}),t},fm=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),tl=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const n=t.error;if(typeof n.message=="string")return n.message}}return JSON.stringify(e)},pm=async(e,t,n,s)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const r=e;let i=parseInt(String(r.status),10);Number.isFinite(i)||(i=500),r.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";t(new eo(tl(o),i,a,s))}).catch(()=>{const o=i+"";t(new eo(r.statusText||`HTTP ${i} error`,i,o,s))})}else t(new xu(tl(e),e,s))},gm=(e,t,n,s)=>{const r={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!s)return ve(ve({},r),n);if(hm(s)){var i;const o=(t==null?void 0:t.headers)||{};let a;for(const[l,c]of Object.entries(o))l.toLowerCase()==="content-type"&&(a=c);r.headers=Nr(o,"Content-Type",(i=a)!==null&&i!==void 0?i:"application/json"),r.body=JSON.stringify(s)}else r.body=s;return t!=null&&t.duplex&&(r.duplex=t.duplex),ve(ve({},r),n)};async function hs(e,t,n,s,r,i,o){return new Promise((a,l)=>{e(n,gm(t,s,r,i)).then(c=>{if(!c.ok)throw c;if(s!=null&&s.noResolveJson)return c;if(o==="vectors"){const u=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!u||!u.includes("application/json"))return{}}return c.json()}).then(c=>a(c)).catch(c=>pm(c,l,s,o))})}function Eu(e="storage"){return{get:async(t,n,s,r)=>hs(t,"GET",n,s,r,void 0,e),post:async(t,n,s,r,i)=>hs(t,"POST",n,r,i,s,e),put:async(t,n,s,r,i)=>hs(t,"PUT",n,r,i,s,e),head:async(t,n,s,r)=>hs(t,"HEAD",n,ve(ve({},s),{},{noResolveJson:!0}),r,void 0,e),remove:async(t,n,s,r,i)=>hs(t,"DELETE",n,r,i,s,e)}}const mm=Eu("storage"),{get:Hs,post:wt,put:no,head:bm,remove:Co}=mm,ct=Eu("vectors");var as=class{constructor(e,t={},n,s="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=um(t),this.fetch=dm(n),this.namespace=s}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Nr(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(ii(n))return{data:null,error:n};throw n}}},vm=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(ii(t))return{data:null,error:t};throw t}}};let ku;ku=Symbol.toStringTag;var ym=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[ku]="BlobDownloadBuilder",this.promise=null}asStream(){return new vm(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(ii(t))return{data:null,error:t};throw t}}};const _m={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nl={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var wm=class extends as{constructor(e,t={},n,s){super(e,t,s,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,s){var r=this;return r.handleOperation(async()=>{let i;const o=ve(ve({},nl),s);let a=ve(ve({},r.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;if(typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",r.encodeMetadata(l)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",r.encodeMetadata(l))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=r.toBase64(r.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),s!=null&&s.headers)for(const[h,f]of Object.entries(s.headers))a=Nr(a,h,f);const c=r._removeEmptyFolders(t),u=r._getFinalPath(c),d=await(e=="PUT"?no:wt)(r.fetch,`${r.url}/object/${u}`,i,ve({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:c,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,s){var r=this;const i=r._removeEmptyFolders(e),o=r._getFinalPath(i),a=new URL(r.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",t),r.handleOperation(async()=>{let l;const c=ve(ve({},nl),s);let u=ve(ve({},r.headers),{"x-upsert":String(c.upsert)});const d=c.metadata;if(typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),d&&l.append("metadata",r.encodeMetadata(d)),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.has("cacheControl")||l.append("cacheControl",c.cacheControl),d&&!l.has("metadata")&&l.append("metadata",r.encodeMetadata(d))):(l=n,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType,d&&(u["x-metadata"]=r.toBase64(r.encodeMetadata(d))),(typeof ReadableStream<"u"&&l instanceof ReadableStream||l&&typeof l=="object"&&"pipe"in l&&typeof l.pipe=="function")&&!c.duplex&&(c.duplex="half")),s!=null&&s.headers)for(const[h,f]of Object.entries(s.headers))u=Nr(u,h,f);return{path:i,fullPath:(await no(r.fetch,a.toString(),l,ve({headers:u},c!=null&&c.duplex?{duplex:c.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e);const r=ve({},n.headers);t!=null&&t.upsert&&(r["x-upsert"]="true");const i=await wt(n.fetch,`${n.url}/object/upload/sign/${s}`,{},{headers:r}),o=new URL(n.url+i.url),a=o.searchParams.get("token");if(!a)throw new ri("No token returned by API");return{signedUrl:o.toString(),path:e,token:a}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var s=this;return s.handleOperation(async()=>await wt(s.fetch,`${s.url}/object/move`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:s.headers}))}async copy(e,t,n){var s=this;return s.handleOperation(async()=>({path:(await wt(s.fetch,`${s.url}/object/copy`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:s.headers})).Key}))}async createSignedUrl(e,t,n){var s=this;return s.handleOperation(async()=>{let r=s._getFinalPath(e);const i=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let o=await wt(s.fetch,`${s.url}/object/sign/${r}`,ve({expiresIn:t},i?{transform:n.transform}:{}),{headers:s.headers});const a=new URLSearchParams;n!=null&&n.download&&a.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&a.set("cacheNonce",String(n.cacheNonce));const l=a.toString();return{signedUrl:encodeURI(`${s.url}${o.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,n){var s=this;return s.handleOperation(async()=>{const r=await wt(s.fetch,`${s.url}/object/sign/${s.bucketId}`,{expiresIn:t,paths:e},{headers:s.headers}),i=new URLSearchParams;n!=null&&n.download&&i.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&i.set("cacheNonce",String(n.cacheNonce));const o=i.toString();return r.map(a=>ve(ve({},a),{},{signedUrl:a.signedURL?encodeURI(`${s.url}${a.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,n){const s=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",r=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(r,t.transform),(t==null?void 0:t.cacheNonce)!=null&&r.set("cacheNonce",String(t.cacheNonce));const i=r.toString(),o=this._getFinalPath(e),a=()=>Hs(this.fetch,`${this.url}/${s}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new ym(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>to(await Hs(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await bm(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(ii(r)){var s;const i=r instanceof eo?r.status:r instanceof xu?(s=r.originalError)===null||s===void 0?void 0:s.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:r}}throw r}}getPublicUrl(e,t){const n=this._getFinalPath(e),s=new URLSearchParams;t!=null&&t.download&&s.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const r=s.toString(),i=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}`)+(r?`?${r}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await Co(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var s=this;return s.handleOperation(async()=>{const r=ve(ve(ve({},_m),t),{},{prefix:e||""});return await wt(s.fetch,`${s.url}/object/list/${s.bucketId}`,r,{headers:s.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const s=ve({},e);return await wt(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,s,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const xm="2.105.4",Xs={"X-Client-Info":`storage-js/${xm}`};var Em=class extends as{constructor(e,t={},n,s){const r=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(r.hostname)&&!r.hostname.includes("storage.supabase.")&&(r.hostname=r.hostname.replace("supabase.","storage.supabase."));const i=r.href.replace(/\/$/,""),o=ve(ve({},Xs),t);super(i,o,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await Hs(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Hs(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await wt(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await no(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await wt(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Co(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},km=class extends as{constructor(e,t={},n){const s=e.replace(/\/$/,""),r=ve(ve({},Xs),t);super(s,r,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await wt(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const s=n.toString(),r=s?`${t.url}/bucket?${s}`:`${t.url}/bucket`;return await Hs(t.fetch,r,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Co(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!fm(e))throw new ri("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new om({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),s=this.shouldThrowOnError;return new Proxy(n,{get(r,i){const o=r[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(r,a),error:null}}catch(l){if(s)throw l;return{data:null,error:l}}}}})}},Sm=class extends as{constructor(e,t={},n){const s=e.replace(/\/$/,""),r=ve(ve({},Xs),{},{"Content-Type":"application/json"},t);super(s,r,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await ct.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await ct.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},Tm=class extends as{constructor(e,t={},n){const s=e.replace(/\/$/,""),r=ve(ve({},Xs),{},{"Content-Type":"application/json"},t);super(s,r,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Am=class extends as{constructor(e,t={},n){const s=e.replace(/\/$/,""),r=ve(ve({},Xs),{},{"Content-Type":"application/json"},t);super(s,r,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await ct.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Rm=class extends Am{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Om(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},Om=class extends Sm{constructor(e,t,n,s){super(e,t,s),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,ve(ve({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,ve(ve({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new Cm(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},Cm=class extends Tm{constructor(e,t,n,s,r){super(e,t,r),this.vectorBucketName=n,this.indexName=s}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,ve(ve({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,ve(ve({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,ve(ve({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,ve(ve({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,ve(ve({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Nm=class extends Em{constructor(e,t={},n,s){super(e,t,n,s)}from(e){return new wm(this.url,this.headers,e,this.fetch)}get vectors(){return new Rm(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new km(this.url+"/iceberg",this.headers,this.fetch)}};const Su="2.105.4",zn=30*1e3,so=3,Si=so*zn,$m="http://localhost:9999",Im="supabase.auth.token",Pm={"X-Client-Info":`gotrue-js/${Su}`},ro="X-Supabase-Api-Version",Tu={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Lm=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,jm=10*60*1e3;class Fs extends Error{constructor(t,n,s){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=s}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function ne(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class Mm extends Fs{constructor(t,n,s){super(t,n,s),this.name="AuthApiError",this.status=n,this.code=s}}function Dm(e){return ne(e)&&e.name==="AuthApiError"}class xt extends Fs{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class rn extends Fs{constructor(t,n,s,r){super(t,s,r),this.name=n,this.status=s}}class Ze extends rn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function lr(e){return ne(e)&&e.name==="AuthSessionMissingError"}class Un extends rn{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class cr extends rn{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class ur extends rn{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Um(e){return ne(e)&&e.name==="AuthImplicitGrantRedirectError"}class sl extends rn{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class Bm extends rn{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class io extends rn{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Ti(e){return ne(e)&&e.name==="AuthRetryableFetchError"}class rl extends rn{constructor(t,n,s){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class oo extends rn{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const $r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),il=`
56
+ \r=`.split(""),Hm=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<il.length;t+=1)e[il[t].charCodeAt(0)]=-2;for(let t=0;t<$r.length;t+=1)e[$r[t].charCodeAt(0)]=t;return e})();function ol(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;n($r[s]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;n($r[s]),t.queuedBits-=6}}function Au(e,t,n){const s=Hm[e];if(s>-1)for(t.queue=t.queue<<6|s,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function al(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},s={utf8seq:0,codepoint:0},r={queue:0,queuedBits:0},i=o=>{qm(o,s,n)};for(let o=0;o<e.length;o+=1)Au(e.charCodeAt(o),r,i);return t.join("")}function Fm(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Vm(e,t){for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);if(s>55295&&s<=56319){const r=(s-55296)*1024&65535;s=(e.charCodeAt(n+1)-56320&65535|r)+65536,n+=1}Fm(s,t)}}function qm(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let s=1;s<6;s+=1)if(!(e>>7-s&1)){t.utf8seq=s;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function es(e){const t=[],n={queue:0,queuedBits:0},s=r=>{t.push(r)};for(let r=0;r<e.length;r+=1)Au(e.charCodeAt(r),n,s);return new Uint8Array(t)}function Km(e){const t=[];return Vm(e,n=>t.push(n)),new Uint8Array(t)}function Rn(e){const t=[],n={queue:0,queuedBits:0},s=r=>{t.push(r)};return e.forEach(r=>ol(r,n,s)),ol(null,n,s),t.join("")}function Wm(e){return Math.round(Date.now()/1e3)+e}function zm(){return Symbol("auth-callback")}const Xe=()=>typeof window<"u"&&typeof document<"u",wn={tested:!1,writable:!1},Ru=()=>{if(!Xe())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(wn.tested)return wn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),wn.tested=!0,wn.writable=!0}catch{wn.tested=!0,wn.writable=!1}return wn.writable};function Gm(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((r,i)=>{t[i]=r})}catch{}return n.searchParams.forEach((s,r)=>{t[r]=s}),t}const Ou=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Jm=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Gn=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},xn=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},Ye=async(e,t)=>{await e.removeItem(t)};class oi{constructor(){this.promise=new oi.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}oi.promiseConstructor=Promise;function dr(e){const t=e.split(".");if(t.length!==3)throw new oo("Invalid JWT structure");for(let s=0;s<t.length;s++)if(!Lm.test(t[s]))throw new oo("JWT not in base64url format");return{header:JSON.parse(al(t[0])),payload:JSON.parse(al(t[1])),signature:es(t[2]),raw:{header:t[0],payload:t[1]}}}async function Zm(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function Ym(e,t){return new Promise((s,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){s(o);return}}catch(o){if(!t(i,o)){r(o);return}}})()})}function Xm(e){return("0"+e.toString(16)).substr(-2)}function Qm(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=n.length;let r="";for(let i=0;i<56;i++)r+=n.charAt(Math.floor(Math.random()*s));return r}return crypto.getRandomValues(t),Array.from(t,Xm).join("")}async function e0(e){const n=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",n),r=new Uint8Array(s);return Array.from(r).map(i=>String.fromCharCode(i)).join("")}async function t0(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await e0(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Bn(e,t,n=!1){const s=Qm();let r=s;n&&(r+="/recovery"),await Gn(e,`${t}-code-verifier`,r);const i=await t0(s);return[i,s===i?"plain":"s256"]}const n0=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function s0(e){const t=e.headers.get(ro);if(!t||!t.match(n0))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function r0(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function i0(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const o0=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Vt(e){if(!o0.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function _t(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Ai(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const s=n.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function a0(e,t){return new Proxy(e,{get:(n,s,r)=>{if(s==="__isInsecureUserWarningProxy")return!0;if(typeof s=="symbol"){const i=s.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,s,r)}return!t.value&&typeof s=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,s,r)}})}function ll(e){return JSON.parse(JSON.stringify(e))}const kn=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},l0=[502,503,504,520,521,522,523,524,530];async function cl(e){var t;if(!Jm(e))throw new io(kn(e),0);if(l0.includes(e.status))throw new io(kn(e),e.status);let n;try{n=await e.json()}catch(i){throw new xt(kn(i),i)}let s;const r=s0(e);if(r&&r.getTime()>=Tu["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?s=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(s=n.error_code),s){if(s==="weak_password")throw new rl(kn(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(s==="session_not_found")throw new Ze}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new rl(kn(n),e.status,n.weak_password.reasons);throw new Mm(kn(n),e.status||500,s)}const c0=(e,t,n,s)=>{const r={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),r.body=JSON.stringify(s),Object.assign(Object.assign({},r),n))};async function oe(e,t,n,s){var r;const i=Object.assign({},s==null?void 0:s.headers);i[ro]||(i[ro]=Tu["2024-01-01"].name),s!=null&&s.jwt&&(i.Authorization=`Bearer ${s.jwt}`);const o=(r=s==null?void 0:s.query)!==null&&r!==void 0?r:{};s!=null&&s.redirectTo&&(o.redirect_to=s.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await u0(e,t,n+a,{headers:i,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(l):{data:Object.assign({},l),error:null}}async function u0(e,t,n,s,r,i){const o=c0(t,s,r,i);let a;try{a=await e(n,Object.assign({},o))}catch(l){throw console.error(l),new io(kn(l),0)}if(a.ok||await cl(a),s!=null&&s.noResolveJson)return a;try{return await a.json()}catch(l){await cl(l)}}function bt(e){var t;let n=null;f0(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=Wm(e.expires_in)));const s=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:s},error:null}}function ul(e){const t=bt(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0)&&(t.data.weak_password=e.weak_password),t}function hn(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function d0(e){return{data:e,error:null}}function h0(e){const{action_link:t,email_otp:n,hashed_token:s,redirect_to:r,verification_type:i}=e,o=si(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:n,hashed_token:s,redirect_to:r,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function dl(e){return e}function f0(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const Ri=["global","local","others"];class p0{constructor({url:t="",headers:n={},fetch:s,experimental:r}){this.url=t,this.headers=n,this.fetch=Ou(s),this.experimental=r??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,n=Ri[0]){if(Ri.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ri.join(", ")}`);try{return await oe(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(s){if(ne(s))return{data:null,error:s};throw s}}async inviteUserByEmail(t,n={}){try{return await oe(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:hn})}catch(s){if(ne(s))return{data:{user:null},error:s};throw s}}async generateLink(t){try{const{options:n}=t,s=si(t,["options"]),r=Object.assign(Object.assign({},s),n);return"newEmail"in s&&(r.new_email=s==null?void 0:s.newEmail,delete r.newEmail),await oe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:h0,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ne(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await oe(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:hn})}catch(n){if(ne(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,s,r,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await oe(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:"",per_page:(i=(r=t==null?void 0:t.perPage)===null||r===void 0?void 0:r.toString())!==null&&i!==void 0?i:""},xform:dl});if(u.error)throw u.error;const d=await u.json(),h=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,f=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return f.length>0&&(f.forEach(g=>{const b=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(g.split(";")[1].split("=")[1]);c[`${k}Page`]=b}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(ne(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){Vt(t);try{return await oe(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:hn})}catch(n){if(ne(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Vt(t);try{return await oe(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:hn})}catch(s){if(ne(s))return{data:{user:null},error:s};throw s}}async deleteUser(t,n=!1){Vt(t);try{return await oe(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:hn})}catch(s){if(ne(s))return{data:{user:null},error:s};throw s}}async _listFactors(t){Vt(t.userId);try{const{data:n,error:s}=await oe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:r=>({data:{factors:r},error:null})});return{data:n,error:s}}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Vt(t.userId),Vt(t.id);try{return{data:await oe(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,s,r,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await oe(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:"",per_page:(i=(r=t==null?void 0:t.perPage)===null||r===void 0?void 0:r.toString())!==null&&i!==void 0?i:""},xform:dl});if(u.error)throw u.error;const d=await u.json(),h=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,f=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return f.length>0&&(f.forEach(g=>{const b=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(g.split(";")[1].split("=")[1]);c[`${k}Page`]=b}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(ne(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(t){try{return await oe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await oe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await oe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(ne(s))return{data:null,error:s};throw s}}async _deleteOAuthClient(t){try{return await oe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await oe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await oe(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:s=>{var r;return{data:{providers:(r=s==null?void 0:s.providers)!==null&&r!==void 0?r:[]},error:null}}})}catch(n){if(ne(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await oe(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await oe(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await oe(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(ne(s))return{data:null,error:s};throw s}}async _deleteCustomProvider(t){try{return await oe(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _adminListPasskeys(t){_t(this.experimental),Vt(t.userId);try{return await oe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ne(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(t){_t(this.experimental),Vt(t.userId),Vt(t.passkeyId);try{return await oe(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ne(n))return{data:null,error:n};throw n}}}function hl(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const Ct={debug:!!(globalThis&&Ru()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Cu extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class fl extends Cu{}async function g0(e,t,n){Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const s=new globalThis.AbortController;let r;t>0&&(r=setTimeout(()=>{s.abort(),Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async i=>{if(i){clearTimeout(r),Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new fl(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Ct.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(r),await n()}})}catch(i){if(t>0&&clearTimeout(r),i!==null&&typeof i=="object"&&"name"in i&&i.name==="AbortError"&&t>0){if(s.signal.aborted)return Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async o=>{if(o){Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await n()}finally{Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw Ct.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new fl(`Lock "${e}" was released because another request stole it`)}throw i}}function m0(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Nu(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function b0(e){return parseInt(e,16)}function v0(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,s=>s.toString(16).padStart(2,"0")).join("")}function y0(e){var t;const{chainId:n,domain:s,expirationTime:r,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:c,scheme:u,uri:d,version:h}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!s)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
57
+ `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const f=Nu(e.address),g=u?`${u}://${s}`:s,b=e.statement?`${e.statement}
58
+ `:"",k=`${g} wants you to sign in with your Ethereum account:
59
+ ${f}
60
+
61
+ ${b}`;let x=`URI: ${d}
62
+ Version: ${h}
63
+ Chain ID: ${n}${o?`
64
+ Nonce: ${o}`:""}
65
+ Issued At: ${i.toISOString()}`;if(r&&(x+=`
66
+ Expiration Time: ${r.toISOString()}`),a&&(x+=`
67
+ Not Before: ${a.toISOString()}`),l&&(x+=`
68
+ Request ID: ${l}`),c){let y=`
69
+ Resources:`;for(const E of c){if(!E||typeof E!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${E}`);y+=`
70
+ - ${E}`}x+=y}return`${k}
71
+ ${x}`}class qe extends Error{constructor({message:t,code:n,cause:s,name:r}){var i;super(t,{cause:s}),this.__isWebAuthnError=!0,this.name=(i=r??(s instanceof Error?s.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Ir extends qe{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function _0({error:e,options:t}){var n,s,r;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new qe({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new qe({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new qe({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new qe({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new qe({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new qe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new qe({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new qe({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if($u(o)){if(i.rp.id!==o)return new qe({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new qe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new qe({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new qe({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new qe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function w0({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new qe({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new qe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if($u(s)){if(n.rpId!==s)return new qe({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new qe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new qe({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new qe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class x0{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const ao=new x0;function pl(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:s}=e,r=si(e,["challenge","user","excludeCredentials"]),i=es(t).buffer,o=Object.assign(Object.assign({},n),{id:es(n.id).buffer}),a=Object.assign(Object.assign({},r),{challenge:i,user:o});if(s&&s.length>0){a.excludeCredentials=new Array(s.length);for(let l=0;l<s.length;l++){const c=s[l];a.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:es(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function gl(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,s=si(e,["challenge","allowCredentials"]),r=es(t).buffer,i=Object.assign(Object.assign({},s),{challenge:r});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const a=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},a),{id:es(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function ml(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:Rn(new Uint8Array(e.response.attestationObject)),clientDataJSON:Rn(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function bl(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,s=e.getClientExtensionResults(),r=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Rn(new Uint8Array(r.authenticatorData)),clientDataJSON:Rn(new Uint8Array(r.clientDataJSON)),signature:Rn(new Uint8Array(r.signature)),userHandle:r.userHandle?Rn(new Uint8Array(r.userHandle)):void 0},type:"public-key",clientExtensionResults:s,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function $u(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Pr(){var e,t;return!!(Xe()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Iu(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ir("Browser returned unexpected credential type",t)}:{data:null,error:new Ir("Empty credential response",t)}}catch(t){return{data:null,error:_0({error:t,options:e})}}}async function Pu(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ir("Browser returned unexpected credential type",t)}:{data:null,error:new Ir("Empty credential response",t)}}catch(t){return{data:null,error:w0({error:t,options:e})}}}const E0={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},k0={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Lr(...e){const t=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),n=r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),s={};for(const r of e)if(r)for(const i in r){const o=r[i];if(o!==void 0)if(Array.isArray(o))s[i]=o;else if(n(o))s[i]=o;else if(t(o)){const a=s[i];t(a)?s[i]=Lr(a,o):s[i]=Lr(o)}else s[i]=o}return s}function S0(e,t){return Lr(E0,e,t||{})}function T0(e,t){return Lr(k0,e,t||{})}class A0{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:s,signal:r},i){var o;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!a)return{data:null,error:l};const c=r??ao.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;if(!u.name){const d=s;if(d)u.name=`${u.id}:${d}`;else{const f=(await this.client.getUser()).data.user,g=((o=f==null?void 0:f.user_metadata)===null||o===void 0?void 0:o.name)||(f==null?void 0:f.email)||(f==null?void 0:f.id)||"User";u.name=`${u.id}:${g}`}}u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{const u=S0(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:h}=await Iu({publicKey:u,signal:c});return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const u=T0(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:h}=await Pu(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(a){return ne(a)?{data:null,error:a}:{data:null,error:new xt("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:n,webauthn:s}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:s})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:r}={}},i){if(!n)return{data:null,error:new Fs("rpId is required for WebAuthn authentication")};try{if(!Pr())return{data:null,error:new xt("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:s},signal:r},{request:i});if(!o)return{data:null,error:a};const{webauthn:l}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:s,credential_response:l.credential_response}})}catch(o){return ne(o)?{data:null,error:o}:{data:null,error:new xt("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:r}={}},i){if(!n)return{data:null,error:new Fs("rpId is required for WebAuthn registration")};try{if(!Pr())return{data:null,error:new xt("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(u=>{var d;return(d=u.data)===null||d===void 0?void 0:d.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:a};const{data:l,error:c}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:s},signal:r},{create:i});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:s,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(o){return ne(o)?{data:null,error:o}:{data:null,error:new xt("Unexpected error in register",o)}}}}m0();const R0={url:$m,storageKey:Im,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Pm,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function vl(e,t,n){return await n()}const Hn={};class Vs{get jwks(){var t,n;return(n=(t=Hn[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Hn[this.storageKey]=Object.assign(Object.assign({},Hn[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Hn[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Hn[this.storageKey]=Object.assign(Object.assign({},Hn[this.storageKey]),{cachedAt:t})}constructor(t){var n,s,r,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},R0),t);if(this.storageKey=o.storageKey,this.instanceID=(n=Vs.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Vs.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&Xe()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(s=o.experimental)!==null&&s!==void 0?s:{},this.admin=new p0({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=Ou(o.fetch),this.lock=o.lock||vl,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&Xe()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=g0:this.lock=vl,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new A0(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:Ru()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=hl(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=hl(this.memoryStorage)),Xe()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}o.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Su}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},s="none";if(Xe()&&(n=Gm(window.location.href),this._isImplicitGrantCallback(n)?s="implicit":await this._isPKCECallback(n)&&(s="pkce")),Xe()&&this.detectSessionInUrl&&s!=="none"){const{data:r,error:i}=await this._getSessionFromURL(n,s);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),Um(i)){const l=(t=i.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:a}=r;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ne(n)?this._returnResult({error:n}):this._returnResult({error:new xt("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,s,r;try{const i=await oe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}},xform:bt}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(ne(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var n,s,r;try{let i;if("email"in t){const{email:u,password:d,options:h}=t;let f=null,g=null;this.flowType==="pkce"&&([f,g]=await Bn(this.storage,this.storageKey)),i=await oe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:u,password:d,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:f,code_challenge_method:g},xform:bt})}else if("phone"in t){const{phone:u,password:d,options:h}=t;i=await oe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(s=h==null?void 0:h.data)!==null&&s!==void 0?s:{},channel:(r=h==null?void 0:h.channel)!==null&&r!==void 0?r:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:bt})}else throw new cr("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await Ye(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(await Ye(this.storage,`${this.storageKey}-code-verifier`),ne(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:o,options:a}=t;n=await oe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:ul})}else if("phone"in t){const{phone:i,password:o,options:a}=t;n=await oe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:ul})}else throw new cr("You must provide either an email or phone number and a password");const{data:s,error:r}=n;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!s||!s.session||!s.user){const i=new Un;return this._returnResult({data:{user:null,session:null},error:i})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:r})}catch(n){if(ne(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,s,r,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(r=t.options)===null||r===void 0?void 0:r.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,s,r,i,o,a,l,c,u,d,h;let f,g;if("message"in t)f=t.message,g=t.signature;else{const{chain:b,wallet:k,statement:x,options:y}=t;let E;if(Xe())if(typeof k=="object")E=k;else{const q=window;if("ethereum"in q&&typeof q.ethereum=="object"&&"request"in q.ethereum&&typeof q.ethereum.request=="function")E=q.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");E=k}const $=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href),O=await E.request({method:"eth_requestAccounts"}).then(q=>q).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!O||O.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const P=Nu(O[0]);let T=(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.chainId;if(!T){const q=await E.request({method:"eth_chainId"});T=b0(q)}const B={domain:$.host,address:P,statement:x,uri:$.href,version:"1",chainId:T,nonce:(r=y==null?void 0:y.signInWithEthereum)===null||r===void 0?void 0:r.nonce,issuedAt:(o=(i=y==null?void 0:y.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=y==null?void 0:y.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.resources};f=y0(B),g=await E.request({method:"personal_sign",params:[v0(f),P]})}try{const{data:b,error:k}=await oe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:g},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:bt});if(k)throw k;if(!b||!b.session||!b.user){const x=new Un;return this._returnResult({data:{user:null,session:null},error:x})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:k})}catch(b){if(ne(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async signInWithSolana(t){var n,s,r,i,o,a,l,c,u,d,h,f;let g,b;if("message"in t)g=t.message,b=t.signature;else{const{chain:k,wallet:x,statement:y,options:E}=t;let $;if(Xe())if(typeof x=="object")$=x;else{const P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))$=P.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(E!=null&&E.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");$=x}const O=new URL((n=E==null?void 0:E.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in $&&$.signIn){const P=await $.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},E==null?void 0:E.signInWithSolana),{version:"1",domain:O.host,uri:O.href}),y?{statement:y}:null));let T;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")T=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)T=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)g=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),b=T.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in $)||typeof $.signMessage!="function"||!("publicKey"in $)||typeof $!="object"||!$.publicKey||!("toBase58"in $.publicKey)||typeof $.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${O.host} wants you to sign in with your Solana account:`,$.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${O.href}`,`Issued At: ${(r=(s=E==null?void 0:E.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&r!==void 0?r:new Date().toISOString()}`,...!((i=E==null?void 0:E.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${E.signInWithSolana.notBefore}`]:[],...!((o=E==null?void 0:E.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${E.signInWithSolana.expirationTime}`]:[],...!((a=E==null?void 0:E.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${E.signInWithSolana.chainId}`]:[],...!((l=E==null?void 0:E.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${E.signInWithSolana.nonce}`]:[],...!((c=E==null?void 0:E.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${E.signInWithSolana.requestId}`]:[],...!((d=(u=E==null?void 0:E.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||d===void 0)&&d.length?["Resources",...E.signInWithSolana.resources.map(T=>`- ${T}`)]:[]].join(`
72
+ `);const P=await $.signMessage(new TextEncoder().encode(g),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");b=P}}try{const{data:k,error:x}=await oe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:Rn(b)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:bt});if(x)throw x;if(!k||!k.session||!k.user){const y=new Un;return this._returnResult({data:{user:null,session:null},error:y})}return k.session&&(await this._saveSession(k.session),await this._notifyAllSubscribers("SIGNED_IN",k.session)),this._returnResult({data:Object.assign({},k),error:x})}catch(k){if(ne(k))return this._returnResult({data:{user:null,session:null},error:k});throw k}}async _exchangeCodeForSession(t){const n=await xn(this.storage,`${this.storageKey}-code-verifier`),[s,r]=(n??"").split("/");try{if(!s&&this.flowType==="pkce")throw new Bm;const{data:i,error:o}=await oe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:s},xform:bt});if(await Ye(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new Un;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers(r==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:r??null}),error:o})}catch(i){if(await Ye(this.storage,`${this.storageKey}-code-verifier`),ne(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:n,provider:s,token:r,access_token:i,nonce:o}=t,a=await oe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:bt}),{data:l,error:c}=a;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const u=new Un;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(n){if(ne(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,s,r,i,o;try{if("email"in t){const{email:a,options:l}=t;let c=null,u=null;this.flowType==="pkce"&&([c,u]=await Bn(this.storage,this.storageKey));const{error:d}=await oe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){const{phone:a,options:l}=t,{data:c,error:u}=await oe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:u})}throw new cr("You must provide either an email or phone number.")}catch(a){if(await Ye(this.storage,`${this.storageKey}-code-verifier`),ne(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(t){var n,s;try{let r,i;"options"in t&&(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(s=t.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:a}=await oe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:bt});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,c=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(r){if(ne(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithSSO(t){var n,s,r,i,o;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Bn(this.storage,this.storageKey));const c=await oe(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&s!==void 0?s:void 0}),!((r=t==null?void 0:t.options)===null||r===void 0)&&r.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:l}),headers:this.headers,xform:d0});return!((i=c.data)===null||i===void 0)&&i.url&&Xe()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(a){if(await Ye(this.storage,`${this.storageKey}-code-verifier`),ne(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;if(s)throw s;if(!n)throw new Ze;const{error:r}=await oe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(t){if(ne(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:s,type:r,options:i}=t,{error:o}=await oe(this.fetch,"POST",n,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:s,type:r,options:i}=t,{data:o,error:a}=await oe(this.fetch,"POST",n,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a})}throw new cr("You must provide either an email or phone number and a type")}catch(n){if(ne(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await s,await n()))();return this.pendingInLock.push((async()=>{try{await r}catch{}})()),r}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=n();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const r=[...this.pendingInLock];await Promise.all(r),this.pendingInLock.splice(0,r.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await xn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const s=t.expires_at?t.expires_at*1e3-Date.now()<Si:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",t.expires_at),!s){if(this.userStorage){const o=await xn(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Ai()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=a0(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:r,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:r},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await oe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:hn}):await this._useSession(async n=>{var s,r,i;const{data:o,error:a}=n;if(a)throw a;return!(!((s=o.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ze}:await oe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0,xform:hn})})}catch(n){if(ne(n))return lr(n)&&(await this._removeSession(),await Ye(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async s=>{const{data:r,error:i}=s;if(i)throw i;if(!r.session)throw new Ze;const o=r.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await Bn(this.storage,this.storageKey));const{data:c,error:u}=await oe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:hn});if(u)throw u;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(s){if(await Ye(this.storage,`${this.storageKey}-code-verifier`),ne(s))return this._returnResult({data:{user:null},error:s});throw s}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ze;const n=Date.now()/1e3;let s=n,r=!0,i=null;const{payload:o}=dr(t.access_token);if(o.exp&&(s=o.exp,r=s<=n),r){const{data:a,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(t.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});i={access_token:t.access_token,refresh_token:t.refresh_token,user:a.user,token_type:"bearer",expires_in:s-n,expires_at:s},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(ne(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var s;if(!t){const{data:o,error:a}=n;if(a)throw a;t=(s=o.session)!==null&&s!==void 0?s:void 0}if(!(t!=null&&t.refresh_token))throw new Ze;const{data:r,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):r?this._returnResult({data:{user:r.user,session:r},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(ne(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){var s;try{if(!Xe())throw new ur("No browser detected.");if(t.error||t.error_description||t.error_code)throw new ur(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new sl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ur("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new sl("No code detected.");const{data:E,error:$}=await this._exchangeCodeForSession(t.code);if($)throw $;const O=new URL(window.location.href);return O.searchParams.delete("code"),window.history.replaceState(window.history.state,"",O.toString()),{data:{session:E.session,redirectType:(s=E.redirectType)!==null&&s!==void 0?s:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:o,refresh_token:a,expires_in:l,expires_at:c,token_type:u}=t;if(!o||!l||!a||!u)throw new ur("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(l);let f=d+h;c&&(f=parseInt(c));const g=f-d;g*1e3<=zn&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${h}s`);const b=f-h;d-b>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",b,f,d):d-b<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",b,f,d);const{data:k,error:x}=await this._getUser(o);if(x)throw x;const y={provider_token:r,provider_refresh_token:i,access_token:o,expires_in:h,expires_at:f,refresh_token:a,token_type:u,user:k.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(r){if(ne(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await xn(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var s;const{data:r,error:i}=n;if(i&&!lr(i))return this._returnResult({error:i});const o=(s=r.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:a}=await this.admin.signOut(o,t);if(a&&!(Dm(a)&&(a.status===404||a.status===401||a.status===403)||lr(a)))return this._returnResult({error:a})}return t!=="others"&&(await this._removeSession(),await Ye(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=zm(),s={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,s),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:s}}}async _emitInitialSession(t){return await this._useSession(async n=>{var s,r;try{const{data:{session:i},error:o}=n;if(o)throw o;await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),lr(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(t,n={}){let s=null,r=null;this.flowType==="pkce"&&([s,r]=await Bn(this.storage,this.storageKey,!0));try{return await oe(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:s,code_challenge_method:r,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await Ye(this.storage,`${this.storageKey}-code-verifier`),ne(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:n,error:s}=await this.getUser();if(s)throw s;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:s,error:r}=await this._useSession(async i=>{var o,a,l,c,u;const{data:d,error:h}=i;if(h)throw h;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await oe(this.fetch,"GET",f,{headers:this.headers,jwt:(u=(c=d.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(r)throw r;return Xe()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),this._returnResult({data:{provider:t.provider,url:s==null?void 0:s.url},error:null})}catch(s){if(ne(s))return this._returnResult({data:{provider:t.provider,url:null},error:s});throw s}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var s;try{const{error:r,data:{session:i}}=n;if(r)throw r;const{options:o,provider:a,token:l,access_token:c,nonce:u}=t,d=await oe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(s=i==null?void 0:i.access_token)!==null&&s!==void 0?s:void 0,body:{provider:a,id_token:l,access_token:c,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:bt}),{data:h,error:f}=d;return f?this._returnResult({data:{user:null,session:null},error:f}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new Un}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:f}))}catch(r){if(await Ye(this.storage,`${this.storageKey}-code-verifier`),ne(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var s,r;const{data:i,error:o}=n;if(o)throw o;return await oe(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(r=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&r!==void 0?r:void 0})})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const s=Date.now();return await Ym(async r=>(r>0&&await Zm(200*Math.pow(2,r-1)),this._debug(n,"refreshing attempt",r),await oe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:bt})),(r,i)=>{const o=200*Math.pow(2,r);return i&&Ti(i)&&Date.now()+o-s<zn})}catch(s){if(this._debug(n,"error",s),ne(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const s=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",s),Xe()&&!n.skipBrowserRedirect&&window.location.assign(s),{data:{provider:t,url:s},error:null}}async _recoverAndRefresh(){var t,n;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const r=await xn(this.storage,this.storageKey);if(r&&this.userStorage){let o=await xn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:r.user},await Gn(this.userStorage,this.storageKey+"-user",o)),r.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Ai()}else if(r&&!r.user&&!r.user){const o=await xn(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(r.user=o.user,await Ye(this.storage,this.storageKey+"-user"),await Gn(this.storage,this.storageKey,r)):r.user=Ai()}if(this._debug(s,"session from storage",r),!this._isValidSession(r)){this._debug(s,"session is not valid"),r!==null&&await this._removeSession();return}const i=((n=r.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Si;if(this._debug(s,`session has${i?"":" not"} expired with margin of ${Si}s`),i){if(this.autoRefreshToken&&r.refresh_token){const{error:o}=await this._callRefreshToken(r.refresh_token);o&&(console.error(o),Ti(o)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(r.user&&r.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(r.access_token);!a&&(o!=null&&o.user)?(r.user=o.user,await this._saveSession(r),await this._notifyAllSubscribers("SIGNED_IN",r)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(s,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(r){this._debug(s,"error",r),console.error(r);return}finally{this._debug(s,"end")}}async _callRefreshToken(t){var n,s;if(!t)throw new Ze;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const r=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{this.refreshingDeferred=new oi;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new Ze;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={data:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(r,"error",i),ne(i)){const o={data:null,error:i};return Ti(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(i),i}finally{this.refreshingDeferred=null,this._debug(r,"end")}}async _notifyAllSubscribers(t,n,s=!0){const r=`#_notifyAllSubscribers(${t})`;this._debug(r,"begin",n,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(t,n)}catch(l){i.push(l)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(r,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Ye(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),s=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&n.user&&await Gn(this.userStorage,this.storageKey+"-user",{user:n.user});const r=Object.assign({},n);delete r.user;const i=ll(r);await Gn(this.storage,this.storageKey,i)}else{const r=ll(n);await Gn(this.storage,this.storageKey,r)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Ye(this.storage,this.storageKey),await Ye(this.storage,this.storageKey+"-code-verifier"),await Ye(this.storage,this.storageKey+"-user"),this.userStorage&&await Ye(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Xe()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),zn);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:s}}=n;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const r=Math.floor((s.expires_at*1e3-t)/zn);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts ${zn}ms, refresh threshold is ${so} ticks`),r<=so&&await this._callRefreshToken(s.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof Cu)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Xe()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,s){const r=[`provider=${encodeURIComponent(n)}`];if(s!=null&&s.redirectTo&&r.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s!=null&&s.scopes&&r.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[i,o]=await Bn(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});r.push(a.toString())}if(s!=null&&s.queryParams){const i=new URLSearchParams(s.queryParams);r.push(i.toString())}return s!=null&&s.skipBrowserRedirect&&r.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${t}?${r.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var s;const{data:r,error:i}=n;return i?this._returnResult({data:null,error:i}):await oe(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token})})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var s,r;const{data:i,error:o}=n;if(o)return this._returnResult({data:null,error:o});const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:c}=await oe(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});return c?this._returnResult({data:null,error:c}):(t.factorType==="totp"&&l.type==="totp"&&(!((r=l==null?void 0:l.totp)===null||r===void 0)&&r.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var s;const{data:r,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?ml(t.webauthn.credential_response):bl(t.webauthn.credential_response)})}:{code:t.code}),{data:a,error:l}=await oe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var s;const{data:r,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await oe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:pl(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:gl(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:s}=await this._challenge({factorId:t.factorId});return s?this._returnResult({data:null,error:s}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:s}=await this.getUser();if(s)return{data:null,error:s};const r={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])r.all.push(i),i.status==="verified"&&r[i.factor_type].push(i);return{data:r,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,s,r,i;if(t)try{const{payload:f}=dr(t);let g=null;f.aal&&(g=f.aal);let b=g;const{data:{user:k},error:x}=await this.getUser(t);if(x)return this._returnResult({data:null,error:x});((s=(n=k==null?void 0:k.factors)===null||n===void 0?void 0:n.filter($=>$.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(b="aal2");const E=f.amr||[];return{data:{currentLevel:g,nextLevel:b,currentAuthenticationMethods:E},error:null}}catch(f){if(ne(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:o},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=dr(o.access_token);let c=null;l.aal&&(c=l.aal);let u=c;((i=(r=o.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(u="aal2");const h=l.amr||[];return{data:{currentLevel:c,nextLevel:u,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:s},error:r}=n;return r?this._returnResult({data:null,error:r}):s?await oe(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:s.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Ze})})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async s=>{const{data:{session:r},error:i}=s;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new Ze});const o=await oe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&Xe()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(s){if(ne(s))return this._returnResult({data:null,error:s});throw s}}async _denyAuthorization(t,n){try{return await this._useSession(async s=>{const{data:{session:r},error:i}=s;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new Ze});const o=await oe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&Xe()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(s){if(ne(s))return this._returnResult({data:null,error:s});throw s}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;return s?this._returnResult({data:null,error:s}):n?await oe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:r=>({data:r,error:null})}):this._returnResult({data:null,error:new Ze})})}catch(t){if(ne(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:s},error:r}=n;return r?this._returnResult({data:null,error:r}):s?(await oe(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ze})})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let s=n.keys.find(a=>a.kid===t);if(s)return s;const r=Date.now();if(s=this.jwks.keys.find(a=>a.kid===t),s&&this.jwks_cached_at+jm>r)return s;const{data:i,error:o}=await oe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,s=i.keys.find(a=>a.kid===t),!s)?null:s}async getClaims(t,n={}){try{let s=t;if(!s){const{data:f,error:g}=await this.getSession();if(g||!f.session)return this._returnResult({data:null,error:g});s=f.session.access_token}const{header:r,payload:i,signature:o,raw:{header:a,payload:l}}=dr(s);n!=null&&n.allowExpired||r0(i.exp);const c=!r.alg||r.alg.startsWith("HS")||!r.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(r.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!c){const{error:f}=await this.getUser(s);if(f)throw f;return{data:{claims:i,header:r,signature:o},error:null}}const u=i0(r.alg),d=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,o,Km(`${a}.${l}`)))throw new oo("Invalid JWT signature");return{data:{claims:i,header:r,signature:o},error:null}}catch(s){if(ne(s))return this._returnResult({data:null,error:s});throw s}}async signInWithPasskey(t){var n,s,r;_t(this.experimental);try{if(!Pr())return this._returnResult({data:null,error:new xt("Browser does not support WebAuthn",null)});const{data:i,error:o}=await this._startPasskeyAuthentication({options:{captchaToken:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}});if(o||!i)return this._returnResult({data:null,error:o});const a=gl(i.options),l=(r=(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.signal)!==null&&r!==void 0?r:ao.createNewAbortSignal(),{data:c,error:u}=await Pu({publicKey:a,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new xt("WebAuthn ceremony failed",null)});const d=bl(c);return this._verifyPasskeyAuthentication({challengeId:i.challenge_id,credential:d})}catch(i){if(ne(i))return this._returnResult({data:null,error:i});throw i}}async registerPasskey(t){var n,s;_t(this.experimental);try{if(!Pr())return this._returnResult({data:null,error:new xt("Browser does not support WebAuthn",null)});const{data:r,error:i}=await this._startPasskeyRegistration();if(i||!r)return this._returnResult({data:null,error:i});const o=pl(r.options),a=(s=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:ao.createNewAbortSignal(),{data:l,error:c}=await Iu({publicKey:o,signal:a});if(c||!l)return this._returnResult({data:null,error:c??new xt("WebAuthn ceremony failed",null)});const u=ml(l);return this._verifyPasskeyRegistration({challengeId:r.challenge_id,credential:u})}catch(r){if(ne(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyRegistration(){_t(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Ze});const{data:r,error:i}=await oe(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:n.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(t){if(ne(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){_t(this.experimental);try{return await this._useSession(async n=>{const{data:{session:s},error:r}=n;if(r)return this._returnResult({data:null,error:r});if(!s)return this._returnResult({data:null,error:new Ze});const{data:i,error:o}=await oe(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:s.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(t){var n;_t(this.experimental);try{const{data:s,error:r}=await oe(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}}});return r?this._returnResult({data:null,error:r}):this._returnResult({data:s,error:null})}catch(s){if(ne(s))return this._returnResult({data:null,error:s});throw s}}async _verifyPasskeyAuthentication(t){_t(this.experimental);try{const{data:n,error:s}=await oe(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:bt});return s?this._returnResult({data:null,error:s}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){_t(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Ze});const{data:r,error:i}=await oe(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(t){if(ne(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){_t(this.experimental);try{return await this._useSession(async n=>{const{data:{session:s},error:r}=n;if(r)return this._returnResult({data:null,error:r});if(!s)return this._returnResult({data:null,error:new Ze});const{data:i,error:o}=await oe(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:s.access_token,body:{friendly_name:t.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(t){_t(this.experimental);try{return await this._useSession(async n=>{const{data:{session:s},error:r}=n;if(r)return this._returnResult({data:null,error:r});if(!s)return this._returnResult({data:null,error:new Ze});const{error:i}=await oe(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:s.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(n){if(ne(n))return this._returnResult({data:null,error:n});throw n}}}Vs.nextInstanceID={};const O0=Vs,C0="2.105.4";let ms="";typeof Deno<"u"?ms="deno":typeof document<"u"?ms="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ms="react-native":ms="node";const N0={"X-Client-Info":`supabase-js-${ms}/${C0}`},$0={headers:N0},I0={schema:"public"},P0={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},L0={};function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function j0(e,t){if(qs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(qs(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function M0(e){var t=j0(e,"string");return qs(t)=="symbol"?t:t+""}function D0(e,t,n){return(t=M0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yl(Object(n),!0).forEach(function(s){D0(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yl(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}const U0=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),B0=()=>Headers,H0=(e,t,n)=>{const s=U0(n),r=B0();return async(i,o)=>{var a;const l=(a=await t())!==null&&a!==void 0?a:e;let c=new r(o==null?void 0:o.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),s(i,He(He({},o),{},{headers:c}))}};function F0(e){return e.endsWith("/")?e:e+"/"}function V0(e,t){var n,s;const{db:r,auth:i,realtime:o,global:a}=e,{db:l,auth:c,realtime:u,global:d}=t,h={db:He(He({},l),r),auth:He(He({},c),i),realtime:He(He({},u),o),storage:{},global:He(He(He({},d),a),{},{headers:He(He({},(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{}),(s=a==null?void 0:a.headers)!==null&&s!==void 0?s:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function q0(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(F0(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var K0=class extends O0{constructor(e){super(e)}},W0=class{constructor(e,t,n){var s,r;this.supabaseUrl=e,this.supabaseKey=t;const i=q0(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:I0,realtime:L0,auth:He(He({},P0),{},{storageKey:o}),global:$0},l=V0(n??{},a);if(this.storageKey=(s=l.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(r=l.global.headers)!==null&&r!==void 0?r:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=l.auth)!==null&&c!==void 0?c:{},this.headers,l.global.fetch)}this.fetch=H0(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(He({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new vg(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new Nm(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new lg(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:s}=await e.auth.getSession();return(t=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:s,userStorage:r,storageKey:i,flowType:o,lock:a,debug:l,throwOnError:c,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:h},f,g){const b={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new K0({url:this.authUrl.href,headers:He(He({},b),f),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:s,userStorage:r,flowType:o,lock:a,debug:l,throwOnError:c,experimental:u,fetch:g,lockAcquireTimeout:d,skipAutoInitialize:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(k=>k.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new em(this.realtimeUrl.href,He(He({},e),{},{params:He(He({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const z0=(e,t,n)=>new W0(e,t,n);function G0(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}G0()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");let hr=null,fr=null;async function Lu(){if(fr)return fr;try{const e=await fetch("/api/auth/config");if(!e.ok)throw new Error(`HTTP ${e.status}`);return fr=await e.json(),fr}catch{return{authEnabled:!1,supabaseUrl:null,supabaseAnonKey:null}}}async function Os(){if(hr)return hr;const e=await Lu();return!e.authEnabled||!e.supabaseUrl||!e.supabaseAnonKey?null:(hr=z0(e.supabaseUrl,e.supabaseAnonKey,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0}}),hr)}const Qs=Qc("auth",()=>{const e=X(null),t=X(null),n=X(!1),s=X(!1),r=X(!1);let i=null;async function o(){const d=await Lu();if(r.value=d.authEnabled,!d.authEnabled){s.value=!0;return}const h=await Os();if(!h){s.value=!0;return}await new Promise(f=>{h.auth.onAuthStateChange((g,b)=>{t.value=b,e.value=(b==null?void 0:b.user)??null,g==="INITIAL_SESSION"&&f()})}),s.value=!0}async function a(){if(!s.value)return i||(i=o().catch(()=>{i=null})),i}async function l(d,h){const f=await Os();if(!f)return"Auth not configured";n.value=!0;try{const{error:g}=await f.auth.signInWithPassword({email:d,password:h});return g?g.message:null}finally{n.value=!1}}async function c(){const d=await Os();d&&await d.auth.signOut(),e.value=null,t.value=null}function u(){var d;return((d=t.value)==null?void 0:d.access_token)??null}return{user:e,session:t,loading:n,initialized:s,authEnabled:r,init:a,signIn:l,signOut:c,getAccessToken:u}});async function Ce(e,t){const n=Qs(),s=n.getAccessToken(),r=new Headers(t==null?void 0:t.headers);s&&r.set("Authorization",`Bearer ${s}`);const i=await fetch(e,{...t,headers:r});if(i.status===401&&n.authEnabled){const o=await Os();if(o){const{data:a}=await o.auth.refreshSession();if(a.session){const l=new Headers(t==null?void 0:t.headers);return l.set("Authorization",`Bearer ${a.session.access_token}`),fetch(e,{...t,headers:l})}}await n.signOut()}return i}function ai(e){const n=Qs().getAccessToken();if(!n)return e;const s=e.includes("?")?"&":"?";return`${e}${s}token=${encodeURIComponent(n)}`}const J0={key:0,class:"flex items-center gap-2.5 min-w-0"},Z0={key:1,class:"w-8 h-8 rounded-lg bg-accent/10 border border-accent/20 flex items-center justify-center"},Y0={class:"flex-1 py-3 overflow-y-auto overflow-x-hidden"},X0={key:1,class:"text-[13px] font-medium truncate"},Q0={class:"shrink-0"},eb={class:"p-2.5"},tb={class:"flex items-center gap-2 px-2 py-1.5 rounded-lg bg-surface-2/50 mb-1.5"},nb={class:"w-6 h-6 rounded-full bg-accent/10 border border-accent/20 flex items-center justify-center shrink-0"},sb={class:"text-[10px] text-accent font-semibold"},rb={class:"min-w-0 flex-1"},ib={class:"text-xs text-txt-primary truncate leading-tight"},ob={class:"flex items-center justify-between px-2"},ab={class:"flex items-center gap-1.5"},lb={key:0,class:"text-[10px] text-txt-muted font-mono"},cb={key:1,class:"flex items-center gap-1.5 px-2"},ub={key:0,class:"text-[10px] text-txt-muted font-mono"},db={key:1,class:"flex flex-col items-center gap-1.5"},hb={key:1,class:"md:hidden fixed bottom-0 inset-x-0 z-50 flex items-stretch border-t border-edge",style:{background:"linear-gradient(180deg, rgba(8,13,22,0.93) 0%, rgba(5,8,15,0.98) 100%)","backdrop-filter":"blur(12px)","padding-bottom":"env(safe-area-inset-bottom)"},"aria-label":"Mobile navigation"},fb={key:0,class:"absolute top-0 left-1/2 -translate-x-1/2 w-6 h-[2px] bg-accent rounded-b-full"},pb={class:"relative"},gb={key:0,class:"absolute -top-1 -right-1.5 min-w-[14px] h-[14px] flex items-center justify-center bg-red-500 text-white text-[7px] font-bold rounded-full px-0.5 ring-1 ring-surface-0"},mb={key:1,class:"absolute -top-1 -right-1.5 min-w-[14px] h-[14px] flex items-center justify-center bg-accent text-surface-0 text-[7px] font-bold rounded-full px-0.5 ring-1 ring-surface-0"},bb={class:"text-[9px] leading-tight font-medium truncate max-w-full px-0.5"},_l="io-nav-collapsed",vb=pt({__name:"AppNav",setup(e){const t=sg(),n=fu(),s=Qs(),r=X(""),i=X(0),o=X(0),a=X(!1);let l=null;const c=[{to:"/chat",name:"chat",icon:'<path d="M10 2a8 8 0 1 1-3.61 15.14l-.12-.07-3.65.92a.5.5 0 0 1-.62-.45v-.08l.01-.08.92-3.64-.07-.12a7.95 7.95 0 0 1-.83-2.9l-.02-.37L2 10a8 8 0 0 1 8-8Zm0 1a7 7 0 0 0-6.1 10.42.5.5 0 0 1 .06.28l-.02.1-.75 3.01 3.02-.75a.5.5 0 0 1 .19-.01l.09.02.09.04A7 7 0 1 0 10 3Zm.5 8a.5.5 0 0 1 .09 1H7.5a.5.5 0 0 1-.09-1h3.09Zm2-3a.5.5 0 0 1 .09 1H7.5a.5.5 0 0 1-.09-1h5.09Z"/>',label:"Chat"},{to:"/inbox",name:"inbox",icon:'<path d="M6 3a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3H6Zm10 7h-3.5a.5.5 0 0 0-.5.5v.01a1.75 1.75 0 0 1-.03.3c-.04.2-.1.46-.23.72-.13.25-.3.49-.57.66-.26.18-.63.31-1.17.31-.54 0-.9-.13-1.17-.3a1.7 1.7 0 0 1-.57-.67A2.57 2.57 0 0 1 8 10.5v-.01a.5.5 0 0 0-.5-.5H4V6c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2v4ZM4 11h3.05c.05.26.14.62.32.97.18.38.47.76.9 1.06.45.29 1.02.47 1.73.47s1.28-.18 1.72-.47c.44-.3.73-.68.91-1.06.18-.35.27-.7.32-.97H16v3a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3Z"/>',label:"Inbox"},{to:"/skills",name:"skills",icon:'<path d="M9 6.5a4.5 4.5 0 0 1 6.35-4.1.5.5 0 0 1 .15.8l-2.3 2.3 1.3 1.3 2.3-2.3a.5.5 0 0 1 .8.15A4.49 4.49 0 0 1 13.5 11a4.5 4.5 0 0 1-1.1-.14l-6.37 6.45a2.36 2.36 0 0 1-3.37-3.3l6.42-6.65A4.52 4.52 0 0 1 9 6.5ZM13.5 3a3.5 3.5 0 0 0-3.39 4.39.5.5 0 0 1-.12.47L3.38 14.7a1.36 1.36 0 0 0 1.94 1.9l6.57-6.66a.5.5 0 0 1 .51-.12 3.5 3.5 0 0 0 4.53-4.05l-2.08 2.07a.5.5 0 0 1-.7 0l-2-2a.5.5 0 0 1 0-.7l2.07-2.08A3.52 3.52 0 0 0 13.5 3Z"/>',label:"Skills"},{to:"/squads",name:"squads",icon:'<path d="M10 3a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM7.5 4.5a2.5 2.5 0 1 1 5 0 2.5 2.5 0 0 1-5 0Zm8-.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm-10 0a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm1-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm.6 12H5a2 2 0 0 1-2-2V9.25c0-.14.11-.25.25-.25h1.76c.04-.37.17-.7.37-1H3.25C2.56 8 2 8.56 2 9.25V13a3 3 0 0 0 3.4 2.97 4.96 4.96 0 0 1-.3-.97Zm9.5.97A3 3 0 0 0 18 13V9.25C18 8.56 17.44 8 16.75 8h-2.13c.2.3.33.63.37 1h1.76c.14 0 .25.11.25.25V13a2 2 0 0 1-2.1 2c-.07.34-.17.66-.3.97ZM7.25 8C6.56 8 6 8.56 6 9.25V14a4 4 0 0 0 8 0V9.25C14 8.56 13.44 8 12.75 8h-5.5ZM7 9.25c0-.14.11-.25.25-.25h5.5c.14 0 .25.11.25.25V14a3 3 0 1 1-6 0V9.25Z"/>',label:"Squads"},{to:"/wiki",name:"wiki",icon:'<path d="M10 16c-.46.6-1.18 1-2 1H3.5A1.5 1.5 0 0 1 2 15.5v-11C2 3.67 2.67 3 3.5 3H8c.82 0 1.54.4 2 1 .46-.6 1.18-1 2-1h4.5c.83 0 1.5.67 1.5 1.5v11c0 .83-.67 1.5-1.5 1.5H12a2.5 2.5 0 0 1-2-1ZM3 4.5v11c0 .28.22.5.5.5H8c.83 0 1.5-.67 1.5-1.5v-9C9.5 4.67 8.83 4 8 4H3.5a.5.5 0 0 0-.5.5Zm7.5 10c0 .83.67 1.5 1.5 1.5h4.5a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5H12c-.83 0-1.5.67-1.5 1.5v9Z"/>',label:"Wiki"},{to:"/schedules",name:"schedules",icon:'<path d="M7 11a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm1 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm1 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm4-5.5A2.5 2.5 0 0 0 14.5 3h-9A2.5 2.5 0 0 0 3 5.5v9A2.5 2.5 0 0 0 5.5 17h9a2.5 2.5 0 0 0 2.5-2.5v-9ZM4 7h12v7.5c0 .83-.67 1.5-1.5 1.5h-9A1.5 1.5 0 0 1 4 14.5V7Zm1.5-3h9c.83 0 1.5.67 1.5 1.5V6H4v-.5C4 4.67 4.67 4 5.5 4Z"/>',label:"Schedules"},{to:"/notifications",name:"notifications",icon:'<path d="M10 2a5.92 5.92 0 0 1 5.98 5.36l.02.22V11.4l.92 2.22a1 1 0 0 1 .06.17l.01.08.01.13a1 1 0 0 1-.75.97l-.11.02L16 15h-3.5v.17a2.5 2.5 0 0 1-5 0V15H4a1 1 0 0 1-.26-.03l-.13-.04a1 1 0 0 1-.6-1.05l.02-.13.05-.13L4 11.4V7.57A5.9 5.9 0 0 1 10 2Zm1.5 13h-3v.15a1.5 1.5 0 0 0 1.36 1.34l.14.01c.78 0 1.42-.6 1.5-1.36V15ZM10 3a4.9 4.9 0 0 0-4.98 4.38L5 7.6V11.5l-.04.2L4 14h12l-.96-2.3-.04-.2V7.61A4.9 4.9 0 0 0 10 3Z"/>',label:"Notifications"},{to:"/activity",name:"activity",icon:'<path d="M16.52 9c.26 0 .48-.2.48-.46V8.5A6.5 6.5 0 0 0 10.5 2h-.04a.47.47 0 0 0-.46.48V8.5c0 .28.22.5.5.5h6.02ZM11 3.02A5.5 5.5 0 0 1 15.98 8H11V3.02ZM8 9V5.1A5 5 0 0 0 9 15v1a6 6 0 0 1-.5-11.98c.28-.02.5.2.5.48V9a1 1 0 0 0 1 1h4.5c.28 0 .5.22.48.5a6 6 0 0 1-.06.5H10a2 2 0 0 1-2-2Zm9 1a1 1 0 0 0-1 1v7a1 1 0 1 0 2 0v-7a1 1 0 0 0-1-1Zm-3 2a1 1 0 0 0-1 1v5a1 1 0 1 0 2 0v-5a1 1 0 0 0-1-1Zm-4 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0v-3Z"/>',label:"Activity"}],u=De(()=>{var y;return(((y=s.user)==null?void 0:y.email)??"").charAt(0).toUpperCase()});function d(x){return t.name===x}function h(){a.value=!a.value;try{localStorage.setItem(_l,String(a.value))}catch{}}async function f(){await s.signOut(),n.push("/login")}function g(){i.value=0}function b(){o.value=0}sn(async()=>{try{const x=localStorage.getItem(_l);x!==null&&(a.value=x==="true")}catch{}try{const x=await Ce("/api/status");if(x.ok){const y=await x.json();r.value=y.version??""}}catch{}try{const x=await Ce("/api/notifications?unread=true&limit=1");if(x.ok){const y=await x.json();i.value=y.unreadCount??0}}catch{}try{const x=await Ce("/api/inbox/count");if(x.ok){const y=await x.json();o.value=y.count??0}}catch{}k()});function k(x=0){l==null||l.close(),l=null;const y=new EventSource(ai("/api/events"));l=y,y.onmessage=E=>{try{JSON.parse(E.data).type==="notification"&&t.name!=="notifications"&&i.value++}catch{}},y.onerror=async()=>{if(y.close(),l===y&&(l=null),!(x>=3)){try{const E=await Os();E&&await E.auth.refreshSession()}catch{}setTimeout(()=>k(x+1),2e3*(x+1))}}}return Zr(()=>{l==null||l.close(),l=null}),(x,y)=>(_(),w(Se,null,[$e(t).name!=="login"?(_(),w("nav",{key:0,class:_e(["relative z-10 hidden md:flex flex-col shrink-0 nav-sidebar border-r border-edge backdrop-blur-md",a.value?"nav-collapsed":"nav-expanded"]),style:{background:"linear-gradient(180deg, rgba(10,17,32,0.85) 0%, rgba(12,18,32,0.78) 50%, rgba(8,13,25,0.88) 100%)"}},[p("div",{class:_e(["flex items-center h-14 px-3 shrink-0",a.value?"justify-center":"justify-between"])},[a.value?(_(),w("div",Z0,[...y[1]||(y[1]=[p("span",{class:"text-accent font-bold text-xs font-mono tracking-tight"},"IO",-1)])])):(_(),w("div",J0,[...y[0]||(y[0]=[Zs('<div class="w-8 h-8 rounded-lg bg-accent/10 border border-accent/20 flex items-center justify-center shrink-0" data-v-00012ce6><span class="text-accent font-bold text-sm font-mono tracking-tight" data-v-00012ce6>IO</span></div><div class="min-w-0" data-v-00012ce6><p class="text-sm font-semibold text-txt-primary leading-tight tracking-tight" data-v-00012ce6>IO Assistant</p><p class="text-[10px] text-txt-muted leading-tight" data-v-00012ce6>Terminal · Dashboard</p></div>',2)])])),a.value?(_(),w("button",{key:3,onClick:h,class:"absolute -right-3 top-4 w-6 h-6 rounded-full bg-surface-2 border border-edge-bright shadow-card flex items-center justify-center text-txt-muted hover:text-accent hover:border-accent/30 transition-all duration-150 z-20",title:"Expand sidebar"},[xe(je,{paths:'<path d="M7.65 4.15c.2-.2.5-.2.7 0l5.49 5.46c.21.22.21.57 0 .78l-5.49 5.46a.5.5 0 0 1-.7-.7L12.8 10 7.65 4.85a.5.5 0 0 1 0-.7Z"/>',size:12})])):(_(),w("button",{key:2,onClick:h,class:"p-1.5 rounded-md text-txt-muted hover:text-txt-secondary hover:bg-surface-3/50 transition-all duration-150 shrink-0 ml-1",title:"Collapse sidebar"},[xe(je,{paths:'<path d="M12.35 15.85a.5.5 0 0 1-.7 0L6.16 10.4a.55.55 0 0 1 0-.78l5.49-5.46a.5.5 0 1 1 .7.7L7.2 10l5.16 5.15c.2.2.2.5 0 .7Z"/>',size:14})]))],2),y[8]||(y[8]=p("div",{class:"mx-3 h-px bg-gradient-to-r from-transparent via-accent/[0.12] to-transparent"},null,-1)),p("div",Y0,[p("ul",{class:_e(["space-y-0.5",a.value?"px-1.5":"px-2"])},[(_(),w(Se,null,Ge(c,E=>p("li",{key:E.to},[xe($e(Gi),{to:E.to,class:_e(["group flex items-center rounded-lg transition-all duration-150 relative",[a.value?"justify-center p-2":"px-2.5 py-2 gap-2.5",d(E.name)?"bg-accent/10 text-accent":"text-txt-secondary hover:text-txt-primary hover:bg-surface-3/40"]]),title:a.value?E.label:void 0,onClick:$=>E.name==="notifications"?g():E.name==="inbox"?b():void 0},{default:ns(()=>[d(E.name)?(_(),w("span",{key:0,class:_e(["absolute left-0 top-1/2 -translate-y-1/2 w-[3px] rounded-r-full bg-accent shadow-glow-sm",a.value?"h-4":"h-5"])},null,2)):te("",!0),xe(je,{paths:E.icon,size:18,class:_e(["shrink-0 transition-transform duration-150 group-hover:scale-105",a.value?"":"ml-0.5"])},null,8,["paths","class"]),a.value?te("",!0):(_(),w("span",X0,C(E.label),1)),E.name==="notifications"&&i.value>0?(_(),w("span",{key:2,class:_e(["absolute flex items-center justify-center bg-red-500 text-white text-[9px] font-bold rounded-full min-w-[16px] h-[16px] px-0.5 ring-2 ring-surface-1",a.value?"top-0 right-0":"top-0.5 right-1"])},C(i.value>99?"99+":i.value),3)):te("",!0),E.name==="inbox"&&o.value>0?(_(),w("span",{key:3,class:_e(["absolute flex items-center justify-center bg-accent text-surface-0 text-[9px] font-bold rounded-full min-w-[16px] h-[16px] px-0.5 ring-2 ring-surface-1",a.value?"top-0 right-0":"top-0.5 right-1"])},C(o.value>99?"99+":o.value),3)):te("",!0)]),_:2},1032,["to","class","title","onClick"])])),64))],2)]),p("div",Q0,[y[7]||(y[7]=p("div",{class:"mx-3 h-px bg-gradient-to-r from-transparent via-accent/[0.08] to-transparent"},null,-1)),p("div",eb,[a.value?(_(),w("div",db,[y[6]||(y[6]=p("a",{href:"https://github.com/michaeljolley/io",target:"_blank",rel:"noopener",class:"p-1.5 rounded-md text-txt-muted hover:text-accent hover:bg-surface-3/50 transition-all duration-150",title:"GitHub"},[p("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"currentColor"},[p("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.868-.013-1.703-2.782.604-3.369-1.342-3.369-1.342-.454-1.154-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836a9.59 9.59 0 012.504.337c1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.741 0 .267.18.578.688.48C19.138 20.163 22 16.418 22 12c0-5.523-4.477-10-10-10z"})])],-1)),$e(s).authEnabled&&$e(s).user?(_(),w("button",{key:0,onClick:f,class:"p-1.5 rounded-md text-txt-muted hover:text-red-400 hover:bg-surface-3/50 transition-all duration-150",title:"Sign out"},[xe(je,{paths:'<path d="M9.16 16.87a.5.5 0 1 0 .67-.74L3.67 10.5H17.5a.5.5 0 0 0 0-1H3.67l6.16-5.63a.5.5 0 0 0-.67-.74L2.24 9.44a.75.75 0 0 0 0 1.11l6.92 6.32Z"/>',size:14})])):te("",!0)])):(_(),w(Se,{key:0},[$e(s).authEnabled&&$e(s).user?(_(),w(Se,{key:0},[p("div",tb,[p("div",nb,[p("span",sb,C(u.value),1)]),p("div",rb,[p("p",ib,C($e(s).user.email),1)])]),p("div",ob,[p("span",ab,[r.value?(_(),w("span",lb,"v"+C(r.value),1)):te("",!0),y[2]||(y[2]=p("span",{class:"text-[10px] text-txt-muted"},"·",-1)),y[3]||(y[3]=p("a",{href:"https://github.com/michaeljolley/io",target:"_blank",rel:"noopener",class:"text-[10px] text-txt-muted hover:text-accent transition-colors"},[p("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3 w-3",viewBox:"0 0 24 24",fill:"currentColor"},[p("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.868-.013-1.703-2.782.604-3.369-1.342-3.369-1.342-.454-1.154-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836a9.59 9.59 0 012.504.337c1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.741 0 .267.18.578.688.48C19.138 20.163 22 16.418 22 12c0-5.523-4.477-10-10-10z"})])],-1))]),p("button",{onClick:f,class:"text-[11px] text-txt-muted hover:text-red-400 transition-colors px-1.5 py-0.5 rounded hover:bg-surface-3/50"}," Sign out ")])],64)):(_(),w("div",cb,[r.value?(_(),w("span",ub,"v"+C(r.value),1)):te("",!0),y[4]||(y[4]=p("span",{class:"text-[10px] text-txt-muted"},"·",-1)),y[5]||(y[5]=p("a",{href:"https://github.com/michaeljolley/io",target:"_blank",rel:"noopener",class:"text-[10px] text-txt-muted hover:text-accent transition-colors"},[p("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3 w-3",viewBox:"0 0 24 24",fill:"currentColor"},[p("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.868-.013-1.703-2.782.604-3.369-1.342-3.369-1.342-.454-1.154-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836a9.59 9.59 0 012.504.337c1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.741 0 .267.18.578.688.48C19.138 20.163 22 16.418 22 12c0-5.523-4.477-10-10-10z"})])],-1))]))],64))])])],2)):te("",!0),$e(t).name!=="login"?(_(),w("nav",hb,[(_(),w(Se,null,Ge(c,E=>xe($e(Gi),{key:E.to,to:E.to,class:_e(["relative flex-1 flex flex-col items-center justify-center gap-0.5 py-2 px-1 min-w-0 transition-colors duration-150 touch-manipulation select-none",d(E.name)?"text-accent":"text-txt-muted"]),onClick:$=>E.name==="notifications"?g():E.name==="inbox"?b():void 0,"aria-label":E.label},{default:ns(()=>[d(E.name)?(_(),w("span",fb)):te("",!0),p("span",pb,[xe(je,{paths:E.icon,size:20},null,8,["paths"]),E.name==="notifications"&&i.value>0?(_(),w("span",gb,C(i.value>9?"9+":i.value),1)):te("",!0),E.name==="inbox"&&o.value>0?(_(),w("span",mb,C(o.value>9?"9+":o.value),1)):te("",!0)]),p("span",bb,C(E.label),1)]),_:2},1032,["to","class","onClick","aria-label"])),64))])):te("",!0)],64))}}),er=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},yb=er(vb,[["__scopeId","data-v-00012ce6"]]),_b={class:"flex h-screen bg-surface-0 relative overflow-hidden"},wb={class:"flex-1 overflow-auto relative z-0 pb-16 md:pb-0"},xb=pt({__name:"App",setup(e){return(t,n)=>(_(),w("div",_b,[n[1]||(n[1]=Zs('<div class="pointer-events-none absolute inset-0 overflow-hidden" aria-hidden="true" data-v-e49ca296><div class="absolute -top-[30%] -right-[15%] w-[65%] h-[70%] rounded-full bg-accent/[0.03] blur-[160px]" data-v-e49ca296></div><div class="absolute -bottom-[25%] -left-[15%] w-[55%] h-[55%] rounded-full bg-blue-900/[0.06] blur-[140px]" data-v-e49ca296></div><div class="absolute top-[15%] left-[25%] w-[45%] h-[50%] rounded-full bg-indigo-950/[0.08] blur-[180px]" data-v-e49ca296></div><div class="absolute top-0 inset-x-0 h-px bg-gradient-to-r from-transparent via-accent/[0.18] to-transparent" data-v-e49ca296></div><div class="absolute inset-0" style="background:radial-gradient(ellipse 85% 75% at 50% 40%, transparent 45%, rgba(3, 5, 10, 0.35) 100%);" data-v-e49ca296></div></div>',1)),xe(yb),p("main",wb,[n[0]||(n[0]=p("div",{class:"pointer-events-none absolute top-0 inset-x-0 h-[2px] bg-gradient-to-r from-transparent via-accent/[0.1] to-transparent z-10","aria-hidden":"true"},null,-1)),xe($e(hu),null,{default:ns(({Component:s})=>[xe(Wc,{name:"view",mode:"out-in"},{default:ns(()=>[(_(),Bc(Eh(s)))]),_:2},1024)]),_:1})])]))}}),Eb=er(xb,[["__scopeId","data-v-e49ca296"]]),kb="modulepreload",Sb=function(e){return"/"+e},wl={},Tb=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(l=>{if(l=Sb(l),l in wl)return;wl[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":kb,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},Ab=Qc("chat",()=>{const e=X([]),t=X(!1);function n(i){e.value.push(i)}function s(i){const o=e.value[e.value.length-1];o&&o.role==="assistant"&&(o.content+=i)}function r(i){const o=e.value[e.value.length-1];o&&o.role==="assistant"&&(o.streaming=i)}return{messages:e,isLoading:t,addMessage:n,appendToLast:s,setLastStreaming:r}});function Rb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ju(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],s=typeof n;(s==="object"||s==="function")&&!Object.isFrozen(n)&&ju(n)}),e}class xl{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Mu(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function fn(e,...t){const n=Object.create(null);for(const s in e)n[s]=e[s];return t.forEach(function(s){for(const r in s)n[r]=s[r]}),n}const Ob="</span>",El=e=>!!e.scope,Cb=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((s,r)=>`${s}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class Nb{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Mu(t)}openNode(t){if(!El(t))return;const n=Cb(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){El(t)&&(this.buffer+=Ob)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const kl=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class No{constructor(){this.rootNode=kl(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=kl({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(s=>this._walk(t,s)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{No._collapse(n)}))}}class $b extends No{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const s=t.root;n&&(s.scope=`language:${n}`),this.add(s)}toHTML(){return new Nb(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ks(e){return e?typeof e=="string"?e:e.source:null}function Du(e){return Pn("(?=",e,")")}function Ib(e){return Pn("(?:",e,")*")}function Pb(e){return Pn("(?:",e,")?")}function Pn(...e){return e.map(n=>Ks(n)).join("")}function Lb(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function $o(...e){return"("+(Lb(e).capture?"":"?:")+e.map(s=>Ks(s)).join("|")+")"}function Uu(e){return new RegExp(e.toString()+"|").exec("").length-1}function jb(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Mb=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Io(e,{joinWith:t}){let n=0;return e.map(s=>{n+=1;const r=n;let i=Ks(s),o="";for(;i.length>0;){const a=Mb.exec(i);if(!a){o+=i;break}o+=i.substring(0,a.index),i=i.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+r):(o+=a[0],a[0]==="("&&n++)}return o}).map(s=>`(${s})`).join(t)}const Db=/\b\B/,Bu="[a-zA-Z]\\w*",Po="[a-zA-Z_]\\w*",Hu="\\b\\d+(\\.\\d+)?",Fu="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Vu="\\b(0b[01]+)",Ub="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Bb=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Pn(t,/.*\b/,e.binary,/\b.*/)),fn({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,s)=>{n.index!==0&&s.ignoreMatch()}},e)},Ws={begin:"\\\\[\\s\\S]",relevance:0},Hb={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ws]},Fb={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ws]},Vb={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},li=function(e,t,n={}){const s=fn({scope:"comment",begin:e,end:t,contains:[]},n);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=$o("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:Pn(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},qb=li("//","$"),Kb=li("/\\*","\\*/"),Wb=li("#","$"),zb={scope:"number",begin:Hu,relevance:0},Gb={scope:"number",begin:Fu,relevance:0},Jb={scope:"number",begin:Vu,relevance:0},Zb={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ws,{begin:/\[/,end:/\]/,relevance:0,contains:[Ws]}]},Yb={scope:"title",begin:Bu,relevance:0},Xb={scope:"title",begin:Po,relevance:0},Qb={begin:"\\.\\s*"+Po,relevance:0},ev=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var pr=Object.freeze({__proto__:null,APOS_STRING_MODE:Hb,BACKSLASH_ESCAPE:Ws,BINARY_NUMBER_MODE:Jb,BINARY_NUMBER_RE:Vu,COMMENT:li,C_BLOCK_COMMENT_MODE:Kb,C_LINE_COMMENT_MODE:qb,C_NUMBER_MODE:Gb,C_NUMBER_RE:Fu,END_SAME_AS_BEGIN:ev,HASH_COMMENT_MODE:Wb,IDENT_RE:Bu,MATCH_NOTHING_RE:Db,METHOD_GUARD:Qb,NUMBER_MODE:zb,NUMBER_RE:Hu,PHRASAL_WORDS_MODE:Vb,QUOTE_STRING_MODE:Fb,REGEXP_MODE:Zb,RE_STARTERS_RE:Ub,SHEBANG:Bb,TITLE_MODE:Yb,UNDERSCORE_IDENT_RE:Po,UNDERSCORE_TITLE_MODE:Xb});function tv(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function nv(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function sv(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=tv,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function rv(e,t){Array.isArray(e.illegal)&&(e.illegal=$o(...e.illegal))}function iv(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function ov(e,t){e.relevance===void 0&&(e.relevance=1)}const av=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(s=>{delete e[s]}),e.keywords=n.keywords,e.begin=Pn(n.beforeMatch,Du(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},lv=["of","and","for","in","not","or","if","then","parent","list","value"],cv="keyword";function qu(e,t,n=cv){const s=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(i){Object.assign(s,qu(e[i],t,i))}),s;function r(i,o){t&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){const l=a.split("|");s[l[0]]=[i,uv(l[0],l[1])]})}}function uv(e,t){return t?Number(t):dv(e)?0:1}function dv(e){return lv.includes(e.toLowerCase())}const Sl={},$n=e=>{console.error(e)},Tl=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Fn=(e,t)=>{Sl[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Sl[`${e}/${t}`]=!0)},jr=new Error;function Ku(e,t,{key:n}){let s=0;const r=e[n],i={},o={};for(let a=1;a<=t.length;a++)o[a+s]=r[a],i[a+s]=!0,s+=Uu(t[a-1]);e[n]=o,e[n]._emit=i,e[n]._multi=!0}function hv(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw $n("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),jr;if(typeof e.beginScope!="object"||e.beginScope===null)throw $n("beginScope must be object"),jr;Ku(e,e.begin,{key:"beginScope"}),e.begin=Io(e.begin,{joinWith:""})}}function fv(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw $n("skip, excludeEnd, returnEnd not compatible with endScope: {}"),jr;if(typeof e.endScope!="object"||e.endScope===null)throw $n("endScope must be object"),jr;Ku(e,e.end,{key:"endScope"}),e.end=Io(e.end,{joinWith:""})}}function pv(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function gv(e){pv(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),hv(e),fv(e)}function mv(e){function t(o,a){return new RegExp(Ks(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=Uu(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=t(Io(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const c=l.findIndex((d,h)=>h>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new n;return this.rules.slice(a).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function r(o){const a=new s;return o.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function i(o,a){const l=o;if(o.isCompiled)return l;[nv,iv,gv,av].forEach(u=>u(o,a)),e.compilerExtensions.forEach(u=>u(o,a)),o.__beforeBegin=null,[sv,rv,ov].forEach(u=>u(o,a)),o.isCompiled=!0;let c=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),c=o.keywords.$pattern,delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=qu(o.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),a&&(o.begin||(o.begin=/\B|\b/),l.beginRe=t(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=t(l.end)),l.terminatorEnd=Ks(l.end)||"",o.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(l.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(u){return bv(u==="self"?o:u)})),o.contains.forEach(function(u){i(u,l)}),o.starts&&i(o.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=fn(e.classNameAliases||{}),i(e)}function Wu(e){return e?e.endsWithParent||Wu(e.starts):!1}function bv(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return fn(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Wu(e)?fn(e,{starts:e.starts?fn(e.starts):null}):Object.isFrozen(e)?fn(e):e}var vv="11.11.1";class yv extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Oi=Mu,Al=fn,Rl=Symbol("nomatch"),_v=7,zu=function(e){const t=Object.create(null),n=Object.create(null),s=[];let r=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:$b};function l(I){return a.noHighlightRe.test(I)}function c(I){let F=I.className+" ";F+=I.parentNode?I.parentNode.className:"";const z=a.languageDetectRe.exec(F);if(z){const ce=B(z[1]);return ce||(Tl(i.replace("{}",z[1])),Tl("Falling back to no-highlight mode for this block.",I)),ce?z[1]:"no-highlight"}return F.split(/\s+/).find(ce=>l(ce)||B(ce))}function u(I,F,z){let ce="",ye="";typeof F=="object"?(ce=I,z=F.ignoreIllegals,ye=F.language):(Fn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Fn("10.7.0",`Please use highlight(code, options) instead.
73
+ https://github.com/highlightjs/highlight.js/issues/2277`),ye=I,ce=F),z===void 0&&(z=!0);const H={code:ce,language:ye};N("before:highlight",H);const S=H.result?H.result:d(H.language,H.code,z);return S.code=H.code,N("after:highlight",S),S}function d(I,F,z,ce){const ye=Object.create(null);function H(K,Y){return K.keywords[Y]}function S(){if(!D.keywords){W.addText(j);return}let K=0;D.keywordPatternRe.lastIndex=0;let Y=D.keywordPatternRe.exec(j),ie="";for(;Y;){ie+=j.substring(K,Y.index);const be=L.case_insensitive?Y[0].toLowerCase():Y[0],Te=H(D,be);if(Te){const[Ve,gt]=Te;if(W.addText(ie),ie="",ye[be]=(ye[be]||0)+1,ye[be]<=_v&&(he+=gt),Ve.startsWith("_"))ie+=Y[0];else{const mn=L.classNameAliases[Ve]||Ve;le(Y[0],mn)}}else ie+=Y[0];K=D.keywordPatternRe.lastIndex,Y=D.keywordPatternRe.exec(j)}ie+=j.substring(K),W.addText(ie)}function R(){if(j==="")return;let K=null;if(typeof D.subLanguage=="string"){if(!t[D.subLanguage]){W.addText(j);return}K=d(D.subLanguage,j,!0,Q[D.subLanguage]),Q[D.subLanguage]=K._top}else K=f(j,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&(he+=K.relevance),W.__addSublanguage(K._emitter,K.language)}function G(){D.subLanguage!=null?R():S(),j=""}function le(K,Y){K!==""&&(W.startScope(Y),W.addText(K),W.endScope())}function Me(K,Y){let ie=1;const be=Y.length-1;for(;ie<=be;){if(!K._emit[ie]){ie++;continue}const Te=L.classNameAliases[K[ie]]||K[ie],Ve=Y[ie];Te?le(Ve,Te):(j=Ve,S(),j=""),ie++}}function U(K,Y){return K.scope&&typeof K.scope=="string"&&W.openNode(L.classNameAliases[K.scope]||K.scope),K.beginScope&&(K.beginScope._wrap?(le(j,L.classNameAliases[K.beginScope._wrap]||K.beginScope._wrap),j=""):K.beginScope._multi&&(Me(K.beginScope,Y),j="")),D=Object.create(K,{parent:{value:D}}),D}function re(K,Y,ie){let be=jb(K.endRe,ie);if(be){if(K["on:end"]){const Te=new xl(K);K["on:end"](Y,Te),Te.isMatchIgnored&&(be=!1)}if(be){for(;K.endsParent&&K.parent;)K=K.parent;return K}}if(K.endsWithParent)return re(K.parent,Y,ie)}function se(K){return D.matcher.regexIndex===0?(j+=K[0],1):(me=!0,0)}function de(K){const Y=K[0],ie=K.rule,be=new xl(ie),Te=[ie.__beforeBegin,ie["on:begin"]];for(const Ve of Te)if(Ve&&(Ve(K,be),be.isMatchIgnored))return se(Y);return ie.skip?j+=Y:(ie.excludeBegin&&(j+=Y),G(),!ie.returnBegin&&!ie.excludeBegin&&(j=Y)),U(ie,K),ie.returnBegin?0:Y.length}function ke(K){const Y=K[0],ie=F.substring(K.index),be=re(D,K,ie);if(!be)return Rl;const Te=D;D.endScope&&D.endScope._wrap?(G(),le(Y,D.endScope._wrap)):D.endScope&&D.endScope._multi?(G(),Me(D.endScope,K)):Te.skip?j+=Y:(Te.returnEnd||Te.excludeEnd||(j+=Y),G(),Te.excludeEnd&&(j=Y));do D.scope&&W.closeNode(),!D.skip&&!D.subLanguage&&(he+=D.relevance),D=D.parent;while(D!==be.parent);return be.starts&&U(be.starts,K),Te.returnEnd?0:Y.length}function m(){const K=[];for(let Y=D;Y!==L;Y=Y.parent)Y.scope&&K.unshift(Y.scope);K.forEach(Y=>W.openNode(Y))}let v={};function A(K,Y){const ie=Y&&Y[0];if(j+=K,ie==null)return G(),0;if(v.type==="begin"&&Y.type==="end"&&v.index===Y.index&&ie===""){if(j+=F.slice(Y.index,Y.index+1),!r){const be=new Error(`0 width match regex (${I})`);throw be.languageName=I,be.badRule=v.rule,be}return 1}if(v=Y,Y.type==="begin")return de(Y);if(Y.type==="illegal"&&!z){const be=new Error('Illegal lexeme "'+ie+'" for mode "'+(D.scope||"<unnamed>")+'"');throw be.mode=D,be}else if(Y.type==="end"){const be=ke(Y);if(be!==Rl)return be}if(Y.type==="illegal"&&ie==="")return j+=`
74
+ `,1;if(ue>1e5&&ue>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return j+=ie,ie.length}const L=B(I);if(!L)throw $n(i.replace("{}",I)),new Error('Unknown language: "'+I+'"');const V=mv(L);let M="",D=ce||V;const Q={},W=new a.__emitter(a);m();let j="",he=0,ee=0,ue=0,me=!1;try{if(L.__emitTokens)L.__emitTokens(F,W);else{for(D.matcher.considerAll();;){ue++,me?me=!1:D.matcher.considerAll(),D.matcher.lastIndex=ee;const K=D.matcher.exec(F);if(!K)break;const Y=F.substring(ee,K.index),ie=A(Y,K);ee=K.index+ie}A(F.substring(ee))}return W.finalize(),M=W.toHTML(),{language:I,value:M,relevance:he,illegal:!1,_emitter:W,_top:D}}catch(K){if(K.message&&K.message.includes("Illegal"))return{language:I,value:Oi(F),illegal:!0,relevance:0,_illegalBy:{message:K.message,index:ee,context:F.slice(ee-100,ee+100),mode:K.mode,resultSoFar:M},_emitter:W};if(r)return{language:I,value:Oi(F),illegal:!1,relevance:0,errorRaised:K,_emitter:W,_top:D};throw K}}function h(I){const F={value:Oi(I),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return F._emitter.addText(I),F}function f(I,F){F=F||a.languages||Object.keys(t);const z=h(I),ce=F.filter(B).filter(ae).map(G=>d(G,I,!1));ce.unshift(z);const ye=ce.sort((G,le)=>{if(G.relevance!==le.relevance)return le.relevance-G.relevance;if(G.language&&le.language){if(B(G.language).supersetOf===le.language)return 1;if(B(le.language).supersetOf===G.language)return-1}return 0}),[H,S]=ye,R=H;return R.secondBest=S,R}function g(I,F,z){const ce=F&&n[F]||z;I.classList.add("hljs"),I.classList.add(`language-${ce}`)}function b(I){let F=null;const z=c(I);if(l(z))return;if(N("before:highlightElement",{el:I,language:z}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(I)),a.throwUnescapedHTML))throw new yv("One of your code blocks includes unescaped HTML.",I.innerHTML);F=I;const ce=F.textContent,ye=z?u(ce,{language:z,ignoreIllegals:!0}):f(ce);I.innerHTML=ye.value,I.dataset.highlighted="yes",g(I,z,ye.language),I.result={language:ye.language,re:ye.relevance,relevance:ye.relevance},ye.secondBest&&(I.secondBest={language:ye.secondBest.language,relevance:ye.secondBest.relevance}),N("after:highlightElement",{el:I,result:ye,text:ce})}function k(I){a=Al(a,I)}const x=()=>{$(),Fn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){$(),Fn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function $(){function I(){$()}if(document.readyState==="loading"){E||window.addEventListener("DOMContentLoaded",I,!1),E=!0;return}document.querySelectorAll(a.cssSelector).forEach(b)}function O(I,F){let z=null;try{z=F(e)}catch(ce){if($n("Language definition for '{}' could not be registered.".replace("{}",I)),r)$n(ce);else throw ce;z=o}z.name||(z.name=I),t[I]=z,z.rawDefinition=F.bind(null,e),z.aliases&&q(z.aliases,{languageName:I})}function P(I){delete t[I];for(const F of Object.keys(n))n[F]===I&&delete n[F]}function T(){return Object.keys(t)}function B(I){return I=(I||"").toLowerCase(),t[I]||t[n[I]]}function q(I,{languageName:F}){typeof I=="string"&&(I=[I]),I.forEach(z=>{n[z.toLowerCase()]=F})}function ae(I){const F=B(I);return F&&!F.disableAutodetect}function ge(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=F=>{I["before:highlightBlock"](Object.assign({block:F.el},F))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=F=>{I["after:highlightBlock"](Object.assign({block:F.el},F))})}function J(I){ge(I),s.push(I)}function Z(I){const F=s.indexOf(I);F!==-1&&s.splice(F,1)}function N(I,F){const z=I;s.forEach(function(ce){ce[z]&&ce[z](F)})}function fe(I){return Fn("10.7.0","highlightBlock will be removed entirely in v12.0"),Fn("10.7.0","Please use highlightElement now."),b(I)}Object.assign(e,{highlight:u,highlightAuto:f,highlightAll:$,highlightElement:b,highlightBlock:fe,configure:k,initHighlighting:x,initHighlightingOnLoad:y,registerLanguage:O,unregisterLanguage:P,listLanguages:T,getLanguage:B,registerAliases:q,autoDetection:ae,inherit:Al,addPlugin:J,removePlugin:Z}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=vv,e.regex={concat:Pn,lookahead:Du,either:$o,optional:Pb,anyNumberOfTimes:Ib};for(const I in pr)typeof pr[I]=="object"&&ju(pr[I]);return Object.assign(e,pr),e},is=zu({});is.newInstance=()=>zu({});var wv=is;is.HighlightJS=is;is.default=is;const Ke=Rb(wv),Mr="[A-Za-z$_][0-9A-Za-z$_]*",Gu=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ju=["true","false","null","undefined","NaN","Infinity"],Zu=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Yu=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xu=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Qu=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ed=[].concat(Xu,Zu,Yu);function xv(e){const t=e.regex,n=(z,{after:ce})=>{const ye="</"+z[0].slice(1);return z.input.indexOf(ye,ce)!==-1},s=Mr,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(z,ce)=>{const ye=z[0].length+z.index,H=z.input[ye];if(H==="<"||H===","){ce.ignoreMatch();return}H===">"&&(n(z,{after:ye})||ce.ignoreMatch());let S;const R=z.input.substring(ye);if(S=R.match(/^\s*=/)){ce.ignoreMatch();return}if((S=R.match(/^\s+extends\s+/))&&S.index===0){ce.ignoreMatch();return}}},a={$pattern:Mr,keyword:Gu,literal:Ju,built_in:ed,"variable.language":Qu},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,g,b,k,{match:/\$\d+/},d];h.contains=E.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(E)});const $=[].concat(y,h.contains),O=$.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat($)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:O},T={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},B={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Zu,...Yu]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},ge={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(z){return t.concat("(?!",z.join("|"),")")}const Z={match:t.concat(/\b/,J([...Xu,"super","import"].map(z=>`${z}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},N={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:B},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,g,b,k,y,{match:/\$\d+/},d,B,{scope:"attr",match:s+t.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},N,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},Z,ge,T,fe,{match:/\$[(.]/}]}}function td(e){const t=e.regex,n=xv(e),s=Mr,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Mr,keyword:Gu.concat(l),literal:Ju,built_in:ed.concat(r),"variable.language":Qu},u={className:"meta",begin:"@"+s},d=(b,k,x)=>{const y=b.contains.findIndex(E=>E.label===k);if(y===-1)throw new Error("can not find mode to replace");b.contains.splice(y,1,x)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const h=n.contains.find(b=>b.scope==="attr"),f=Object.assign({},h,{match:t.concat(s,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,f]),n.contains=n.contains.concat([u,i,o,f]),d(n,"shebang",e.SHEBANG()),d(n,"use_strict",a);const g=n.contains.find(b=>b.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}const Ol="[A-Za-z$_][0-9A-Za-z$_]*",Ev=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],kv=["true","false","null","undefined","NaN","Infinity"],nd=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],sd=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rd=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Sv=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Tv=[].concat(rd,nd,sd);function id(e){const t=e.regex,n=(z,{after:ce})=>{const ye="</"+z[0].slice(1);return z.input.indexOf(ye,ce)!==-1},s=Ol,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(z,ce)=>{const ye=z[0].length+z.index,H=z.input[ye];if(H==="<"||H===","){ce.ignoreMatch();return}H===">"&&(n(z,{after:ye})||ce.ignoreMatch());let S;const R=z.input.substring(ye);if(S=R.match(/^\s*=/)){ce.ignoreMatch();return}if((S=R.match(/^\s+extends\s+/))&&S.index===0){ce.ignoreMatch();return}}},a={$pattern:Ol,keyword:Ev,literal:kv,built_in:Tv,"variable.language":Sv},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,g,b,k,{match:/\$\d+/},d];h.contains=E.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(E)});const $=[].concat(y,h.contains),O=$.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat($)}]),P={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:O},T={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},B={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...nd,...sd]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[P],illegal:/%/},ge={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(z){return t.concat("(?!",z.join("|"),")")}const Z={match:t.concat(/\b/,J([...rd,"super","import"].map(z=>`${z}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},N={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},P]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[P]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:B},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,g,b,k,y,{match:/\$\d+/},d,B,{scope:"attr",match:s+t.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[P,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},N,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[P]},Z,ge,T,fe,{match:/\$[(.]/}]}}function od(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",f=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${s.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${f}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]},k={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,b,d,e.HASH_COMMENT_MODE]}]};return c.contains=[d,b,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,k,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,x,d]}]}}function ad(e){const t=e.regex,n={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(a);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],k=["true","false"],x={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],E=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],$=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],O=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:k,built_in:[...y,...E,"set","shopt",...$,...O]},contains:[f,e.SHEBANG(),g,d,i,o,x,a,l,c,u,n]}}function Av(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],r={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const Rv=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ov=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Cv=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Nv=[...Ov,...Cv],$v=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Iv=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Pv=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Lv=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function jv(e){const t=e.regex,n=Rv(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",i=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,s,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Iv.join("|")+")"},{begin:":(:)?("+Pv.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Lv.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:$v.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Nv.join("|")+")\\b"}]}}function ld(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Mv(e){const t=e.regex,n=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=u,g=[...c,...l].filter(O=>!u.includes(O)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},k={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function y(O){return t.concat(/\b/,t.either(...O.map(P=>P.replace(/\s+/,"\\s+"))),/\b/)}const E={scope:"keyword",match:y(h),relevance:0};function $(O,{exceptions:P,when:T}={}){const B=T;return P=P||[],O.map(q=>q.match(/\|\d+$/)||P.includes(q)?q:B(q)?`${q}|0`:q)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:$(g,{when:O=>O.length<3}),literal:i,type:a,built_in:d},contains:[{scope:"type",match:y(o)},E,x,b,s,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,k]}}function cd(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},a=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},k=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,b,i,o],x=[...k];return x.pop(),x.push(a),f.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:k}}function ud(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),h=e.inherit(u,{contains:[]});c.contains.push(h),u.contains.push(d);let f=[n,l];return[c,u,d,h].forEach(x=>{x.contains=x.contains.concat(f)}),f=f.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,i,c,u,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},r,s,l,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}Ke.registerLanguage("typescript",td);Ke.registerLanguage("ts",td);Ke.registerLanguage("javascript",id);Ke.registerLanguage("js",id);Ke.registerLanguage("python",od);Ke.registerLanguage("py",od);Ke.registerLanguage("bash",ad);Ke.registerLanguage("sh",ad);Ke.registerLanguage("json",Av);Ke.registerLanguage("css",jv);Ke.registerLanguage("html",ld);Ke.registerLanguage("xml",ld);Ke.registerLanguage("sql",Mv);Ke.registerLanguage("yaml",cd);Ke.registerLanguage("yml",cd);Ke.registerLanguage("markdown",ud);Ke.registerLanguage("md",ud);function Pt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\*\*\*(.*?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-gray-800 px-1 rounded text-blue-300 font-mono text-xs">$1</code>').replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,n,s)=>`<a href="${/^https?:\/\//i.test(s)||s.startsWith("/")||s.startsWith("#")?s:"#"}" target="_blank" rel="noopener" class="text-blue-400 hover:underline">${n}</a>`)}function dd(e){const t=e.trim();return t.startsWith("|")&&t.endsWith("|")&&t.length>2}function Cl(e){return dd(e)&&/^\|[\s|:\-]+\|$/.test(e.trim())}function Ci(e){return e.trim().slice(1,-1).split("|").map(t=>t.trim())}function Dv(e){const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"text-center":t.endsWith(":")?"text-right":"text-left"}function Uv(e){if(e.length<2)return e.map(a=>`<p class="my-1">${Pt(a)}</p>`).join(`
75
+ `);const t=Ci(e[0]),n=e[1],s=Cl(n)?Ci(n).map(Dv):t.map(()=>"text-left"),r=Cl(n)?e.slice(2):e.slice(1),i=t.map((a,l)=>`<th class="px-3 py-1.5 font-medium text-gray-300 ${s[l]??"text-left"}">${Pt(a)}</th>`).join(""),o=r.map(a=>{const l=Ci(a);return`<tr class="border-b border-gray-800">${t.map((u,d)=>`<td class="px-3 py-1.5 text-gray-400 ${s[d]??"text-left"}">${Pt(l[d]??"")}</td>`).join("")}</tr>`}).join("");return`<div class="overflow-x-auto my-2"><table class="border-collapse w-full text-sm"><thead><tr class="border-b border-gray-700">${i}</tr></thead><tbody>${o}</tbody></table></div>`}function Bv(e){if(!e.startsWith(`---
76
+ `)&&e!=="---")return{frontmatter:null,body:e};const t=e.indexOf(`
77
+ ---
78
+ `,3),n=e.indexOf(`
79
+ ---`,3),s=t!==-1?t:n!==-1&&e.slice(n).trimEnd()==="---"?n:-1;if(s===-1)return{frontmatter:null,body:e};const r=e.slice(4,s),i=t!==-1?e.slice(t+5):"",o={};for(const a of r.split(`
80
+ `)){const l=a.match(/^([^:]+):\s*(.*)$/);if(!l)continue;const c=l[1].trim();let u=l[2].trim();(u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"))&&(u=u.slice(1,-1)),o[c]=u}return{frontmatter:Object.keys(o).length>0?o:null,body:i}}function os(e){if(!e)return"";const t=e.split(`
81
+ `),n=[];let s=!1,r=!1,i=!1,o=[],a="",l=[];function c(){r&&(n.push("</ul>"),r=!1)}function u(){i&&(n.push(Uv(l)),l=[],i=!1)}for(const d of t){if(d.startsWith("```")){if(c(),u(),!s)s=!0,a=d.slice(3).trim().split(/\s+/)[0].toLowerCase(),o=[];else{const y=o.join(`
82
+ `);let E;try{E=a&&Ke.getLanguage(a)?Ke.highlight(y,{language:a,ignoreIllegals:!0}).value:Ke.highlightAuto(y).value}catch{E=y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const $=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),O=$?`<span class="text-[10px] text-txt-muted font-mono absolute top-2 right-3 select-none">${$}</span>`:"";n.push(`<div class="relative my-2"><pre class="bg-surface-1 border border-edge rounded-xl p-3 overflow-x-auto"><code class="hljs font-mono text-xs">${E}</code></pre>${O}</div>`),s=!1,a="",o=[]}continue}if(s){o.push(d);continue}if(dd(d)){c(),i=!0,l.push(d);continue}i&&u();const h=d.match(/^####\s+(.+)/),f=d.match(/^###\s+(.+)/),g=d.match(/^##\s+(.+)/),b=d.match(/^#\s+(.+)/);if(h){c(),n.push(`<h4 class="text-sm font-semibold text-gray-200 mt-4 mb-1">${Pt(h[1])}</h4>`);continue}if(f){c(),n.push(`<h3 class="text-base font-semibold text-gray-100 mt-5 mb-2">${Pt(f[1])}</h3>`);continue}if(g){c(),n.push(`<h2 class="text-lg font-bold text-gray-100 mt-6 mb-2 pb-1 border-b border-gray-800">${Pt(g[1])}</h2>`);continue}if(b){c(),n.push(`<h1 class="text-xl font-bold text-gray-100 mt-6 mb-3">${Pt(b[1])}</h1>`);continue}if(/^---+$/.test(d.trim())){c(),n.push('<hr class="border-gray-800 my-4" />');continue}const k=d.match(/^[-*+]\s+(.+)/);if(k){r||(n.push('<ul class="list-disc list-inside my-2 space-y-1 pl-2">'),r=!0),n.push(`<li>${Pt(k[1])}</li>`);continue}const x=d.match(/^\d+\.\s+(.+)/);if(x){r||(n.push('<ol class="list-decimal list-inside my-2 space-y-1 pl-2">'),r=!0),n.push(`<li>${Pt(x[1])}</li>`);continue}if(d.trim()===""){c(),n.push('<div class="my-2"></div>');continue}c(),n.push(`<p class="my-1">${Pt(d)}</p>`)}if(s&&o.length){const d=o.join(`
83
+ `).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");n.push(`<pre class="bg-gray-900 border border-gray-800 rounded p-3 my-2 overflow-x-auto"><code class="font-mono text-xs text-green-300">${d}</code></pre>`)}return u(),c(),n.join(`
84
+ `)}const Hv={class:"flex flex-col h-full relative bg-surface-0"},Fv={key:0,class:"flex flex-col items-center justify-center h-full select-none animate-fade-in"},Vv={class:"flex flex-wrap justify-center gap-2 mt-8 max-w-md"},qv=["onClick"],Kv={key:1,class:"max-w-3xl mx-auto space-y-5"},Wv={key:0,class:"max-w-[80%] px-4 py-2.5 rounded-2xl rounded-br-md text-sm whitespace-pre-wrap bg-gradient-to-br from-accent/[0.14] to-accent/[0.08] text-txt-primary border border-accent/20 shadow-glow-sm"},zv={key:1,class:"max-w-[85%] flex gap-2.5 items-start"},Gv=["innerHTML"],Jv={key:0,class:"flex justify-start animate-fade-in"},Zv={class:"shrink-0 border-t border-edge/50 backdrop-blur-md p-3 sm:p-4",style:{background:"linear-gradient(180deg, rgba(12,18,32,0.75) 0%, rgba(8,13,22,0.88) 100%)"}},Yv={class:"flex-1 relative group"},Xv=["disabled"],Qv=["disabled"],ey={class:"hidden sm:inline"},ty=["disabled"],ny='<span class="stream-cursor"></span>',sy=pt({__name:"ChatView",setup(e){const t=Ab(),n=X(""),s=X(!1),r=X(null),i=X(!1),o=X(null),a=["Check squad status","Run my schedules","Summarize recent activity","What skills are installed?"];function l(k){n.value=k,Cn(()=>b())}async function c(){if(!s.value){s.value=!0;try{await Ce("/api/orchestrator/abort",{method:"POST"})}catch{}finally{s.value=!1}}}const u=De(()=>t.messages.some(k=>k.streaming));function d(){const k=r.value;k&&(i.value=k.scrollTop+k.clientHeight<k.scrollHeight-100)}function h(){Cn(()=>{r.value&&(r.value.scrollTop=r.value.scrollHeight)})}pn(()=>t.messages.length,()=>{i.value||h()});function f(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),b())}function g(){const k=o.value;k&&(k.style.height="auto",k.style.height=Math.min(k.scrollHeight,200)+"px")}async function b(){const k=n.value.trim();if(!k||t.isLoading)return;n.value="",Cn(()=>{o.value&&(o.value.style.height="auto")}),t.isLoading=!0,t.addMessage({id:crypto.randomUUID(),role:"user",content:k}),t.addMessage({id:crypto.randomUUID(),role:"assistant",content:"",streaming:!0}),h();const x=new EventSource(ai("/api/events"));x.onmessage=y=>{try{const E=JSON.parse(y.data);E.type==="delta"?(t.appendToLast(E.text),h()):E.type==="done"&&(t.setLastStreaming(!1),t.isLoading=!1,x.close(),h())}catch{}},x.onerror=()=>{t.setLastStreaming(!1),t.isLoading=!1,x.close()};try{await Ce("/api/message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:k})})}catch{t.appendToLast(`
85
+
86
+ [Error: failed to reach IO]`),t.setLastStreaming(!1),t.isLoading=!1,x.close()}}return(k,x)=>(_(),w("div",Hv,[p("div",{ref_key:"messagesEl",ref:r,class:"flex-1 overflow-y-auto px-3 py-4 sm:px-4 sm:py-6",onScroll:d},[$e(t).messages.length===0?(_(),w("div",Fv,[x[1]||(x[1]=p("div",{class:"w-16 h-16 rounded-2xl bg-accent/10 border border-accent/20 flex items-center justify-center mb-5 shadow-glow"},[p("span",{class:"text-accent font-bold text-2xl font-mono tracking-tighter"},"IO")],-1)),x[2]||(x[2]=p("p",{class:"text-txt-secondary text-sm font-medium mb-1"},"What can I help you build?",-1)),x[3]||(x[3]=p("p",{class:"text-txt-muted text-xs"},"Send a message to start a conversation",-1)),p("div",Vv,[(_(),w(Se,null,Ge(a,y=>p("button",{key:y,onClick:E=>l(y),class:"px-3 py-1.5 text-xs text-txt-secondary bg-surface-2/60 border border-edge rounded-full hover:border-accent/30 hover:text-accent hover:bg-accent/5 transition-all duration-200"},C(y),9,qv)),64))])])):(_(),w("div",Kv,[(_(!0),w(Se,null,Ge($e(t).messages,y=>(_(),w("div",{key:y.id,class:_e(["flex animate-fade-in",y.role==="user"?"justify-end":"justify-start"])},[y.role==="user"?(_(),w("div",Wv,C(y.content),1)):(_(),w("div",zv,[x[4]||(x[4]=p("div",{class:"shrink-0 w-6 h-6 rounded-lg bg-surface-3/60 border border-edge flex items-center justify-center mt-0.5"},[p("span",{class:"text-accent text-[10px] font-bold font-mono"},"IO")],-1)),p("div",{class:"chat-md min-w-0 px-4 py-2.5 rounded-2xl rounded-tl-md text-sm bg-surface-2/70 text-txt-primary border border-edge",innerHTML:$e(os)(y.content)+(y.streaming?ny:"")},null,8,Gv)]))],2))),128)),$e(t).isLoading&&!u.value?(_(),w("div",Jv,[...x[5]||(x[5]=[Zs('<div class="flex gap-2.5 items-start" data-v-3e973d6e><div class="shrink-0 w-6 h-6 rounded-lg bg-surface-3/60 border border-edge flex items-center justify-center" data-v-3e973d6e><span class="text-accent text-[10px] font-bold font-mono" data-v-3e973d6e>IO</span></div><div class="px-4 py-3 rounded-2xl rounded-tl-md bg-surface-2/70 border border-edge flex items-center gap-1" data-v-3e973d6e><span class="thinking-dot" style="animation-delay:0s;" data-v-3e973d6e></span><span class="thinking-dot" style="animation-delay:0.15s;" data-v-3e973d6e></span><span class="thinking-dot" style="animation-delay:0.3s;" data-v-3e973d6e></span></div></div>',1)])])):te("",!0)]))],544),xe(Wc,{name:"scroll-btn"},{default:ns(()=>[i.value?(_(),w("button",{key:0,onClick:h,class:"absolute bottom-24 left-1/2 -translate-x-1/2 z-10 w-8 h-8 rounded-full bg-surface-2/90 backdrop-blur-sm border border-edge-bright text-txt-secondary hover:text-accent hover:border-accent/40 hover:shadow-glow-sm flex items-center justify-center transition-all duration-200",title:"Scroll to bottom"},[xe(je,{paths:'<path d="M15.85 7.65c.2.2.2.5 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16c.2-.2.5-.2.7 0Z"/>',size:16})])):te("",!0)]),_:1}),p("div",Zv,[p("form",{onSubmit:Xt(b,["prevent"]),class:"max-w-3xl mx-auto flex gap-2 items-end"},[p("div",Yv,[dt(p("textarea",{ref_key:"inputEl",ref:o,"onUpdate:modelValue":x[0]||(x[0]=y=>n.value=y),placeholder:"Message IO…",disabled:$e(t).isLoading,rows:"1",class:"w-full bg-surface-2/60 border border-edge rounded-xl px-4 py-2.5 pr-3 text-sm text-txt-primary placeholder-txt-muted/60 resize-none overflow-hidden focus:outline-none focus:border-accent/40 focus:shadow-glow-sm disabled:opacity-40 transition-all duration-200",onKeydown:f,onInput:g},null,40,Xv),[[Et,n.value]])]),$e(t).isLoading?(_(),w("button",{key:0,type:"button",onClick:c,disabled:s.value,class:"shrink-0 h-10 px-3.5 rounded-xl text-sm font-medium bg-red-500/15 text-red-400 border border-red-500/25 hover:bg-red-500/25 hover:border-red-500/40 disabled:opacity-40 disabled:cursor-not-allowed transition-all duration-150 flex items-center gap-1.5",title:"Stop"},[x[6]||(x[6]=p("span",{class:"w-2.5 h-2.5 rounded-[3px] bg-red-400"},null,-1)),p("span",ey,C(s.value?"Stopping…":"Stop"),1)],8,Qv)):(_(),w("button",{key:1,type:"submit",disabled:!n.value.trim(),class:"shrink-0 w-10 h-10 rounded-xl flex items-center justify-center bg-accent/15 text-accent border border-accent/25 hover:bg-accent/25 hover:border-accent/40 hover:shadow-glow-sm disabled:opacity-25 disabled:cursor-not-allowed disabled:hover:shadow-none transition-all duration-150",title:"Send"},[xe(je,{paths:'<path d="M2.18 2.11a.5.5 0 0 1 .54-.06l15 7.5a.5.5 0 0 1 0 .9l-15 7.5a.5.5 0 0 1-.7-.58L3.98 10 2.02 2.63a.5.5 0 0 1 .16-.52Zm2.7 8.39-1.61 6.06L16.38 10 3.27 3.44 4.88 9.5h6.62a.5.5 0 1 1 0 1H4.88Z"/>',size:16})],8,ty))],32)])]))}}),ry=er(sy,[["__scopeId","data-v-3e973d6e"]]),iy={class:"flex flex-col h-full bg-surface-0"},oy={key:0,class:"flex flex-col h-full overflow-hidden animate-fade-in"},ay={class:"flex items-center gap-3 px-3 sm:px-6 py-3.5 border-b border-edge/70 shrink-0 backdrop-blur-sm",style:{background:"linear-gradient(180deg, rgba(19,27,46,0.9) 0%, rgba(12,18,32,0.85) 100%)"}},ly={class:"text-base font-semibold text-txt-primary truncate"},cy={class:"text-[11px] text-txt-muted font-mono shrink-0 bg-surface-2/60 px-1.5 py-0.5 rounded"},uy={key:0,class:"flex-1 flex items-center justify-center"},dy={key:1,class:"flex-1 p-6"},hy={class:"inline-flex items-center gap-2 text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2"},fy={key:2,class:"flex-1 overflow-y-auto p-6 skill-content text-sm text-txt-secondary leading-relaxed"},py={key:0,class:"mb-6 bg-surface-2/60 border border-edge rounded-xl p-5"},gy={key:0,class:"mb-3"},my={class:"text-base font-semibold text-txt-primary"},by={key:1,class:"mb-3"},vy={class:"text-sm text-txt-secondary"},yy={class:"flex flex-wrap gap-6 mt-1"},_y={key:0},wy={class:"text-sm text-accent font-mono"},xy={key:1},Ey={class:"text-sm text-txt-secondary"},ky={key:2,class:"mt-3 pt-3 border-t border-edge grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 items-baseline"},Sy={class:"text-[10px] text-txt-muted uppercase tracking-wider whitespace-nowrap"},Ty={class:"text-xs text-txt-secondary font-mono"},Ay=["innerHTML"],Ry={key:1,class:"flex-1 overflow-y-auto p-3 sm:p-6"},Oy={class:"max-w-3xl"},Cy={class:"mb-6 bg-surface-2/40 border border-edge rounded-xl p-4"},Ny={class:"flex gap-1 mb-3"},$y={class:"flex gap-2"},Iy=["disabled"],Py=["disabled"],Ly={class:"flex flex-col gap-2"},jy=["disabled"],My=["disabled"],Dy=["disabled"],Uy={key:0,class:"flex items-center gap-2 bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 p-3 rounded-lg mb-4 text-sm animate-fade-in"},By={key:1,class:"flex items-center gap-2 bg-red-500/10 text-red-400 border border-red-500/20 p-3 rounded-lg mb-4 text-sm animate-fade-in"},Hy={key:2,class:"mb-4"},Fy={key:3,class:"flex items-center justify-center py-16"},Vy={key:4,class:"flex items-center gap-2 bg-red-500/10 text-red-400 border border-red-500/20 p-3 rounded-lg mb-4 text-sm"},qy={key:5,class:"text-txt-muted text-sm text-center py-16"},Ky={key:6,class:"text-txt-muted text-sm text-center py-12"},Wy={key:7,class:"grid gap-3"},zy=["onClick"],Gy={class:"flex justify-between items-start mb-1.5"},Jy={class:"min-w-0"},Zy={class:"font-semibold text-txt-primary text-sm group-hover:text-accent transition-colors duration-150"},Yy={class:"text-[11px] text-txt-muted font-mono mt-0.5"},Xy=["onClick"],Qy={class:"text-xs text-txt-secondary mb-2 line-clamp-2"},e_={class:"text-[10px] text-txt-muted font-mono truncate"},t_=pt({__name:"SkillsView",setup(e){const t=X([]),n=X(!0),s=X(null),r=X(""),i=X(!1),o=X(null),a=X(null),l=X("url"),c=X(""),u=X(""),d=X(!1),h=X(null),f=X(""),g=X(!1),b=X(null),k=De(()=>Bv(f.value)),x=De(()=>k.value.frontmatter),y=De(()=>os(k.value.body)),E=["name","description","version","author"],$=De(()=>x.value?Object.entries(x.value).filter(([Z])=>!E.includes(Z)):[]),O=X(""),P=De(()=>{const Z=O.value.toLowerCase().trim();return Z?t.value.filter(N=>N.name.toLowerCase().includes(Z)||N.slug.toLowerCase().includes(Z)||(N.description??"").toLowerCase().includes(Z)):t.value});async function T(Z){h.value=Z,f.value="",b.value=null,g.value=!0;try{const N=await Ce(`/api/skills/${encodeURIComponent(Z.slug)}`);if(N.status===404)b.value="Skill not found";else if(!N.ok)b.value=`Failed to load skill (HTTP ${N.status})`;else{const fe=await N.json();f.value=fe.content??""}}catch(N){b.value=N instanceof Error?N.message:"Failed to load skill"}finally{g.value=!1}}function B(){h.value=null,f.value="",b.value=null}async function q(){try{const Z=await Ce("/api/skills");if(!Z.ok)throw new Error(`HTTP error! status: ${Z.status}`);const N=await Z.json();t.value=N.skills}catch(Z){s.value=Z instanceof Error?Z.message:"Failed to load skills"}finally{n.value=!1}}async function ae(){if(!(i.value||r.value.trim()==="")){i.value=!0,o.value=null,a.value=null;try{const Z=await Ce("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoUrl:r.value.trim()})});if(Z.ok){const N=await Z.json();t.value=[N.skill,...t.value],r.value="",a.value=`✓ Installed: ${N.skill.name}`,setTimeout(()=>{a.value=null},4e3),q()}else{let N="Install failed";try{N=(await Z.json()).error??Z.statusText??N}catch{N=Z.statusText||N}o.value=N}}catch(Z){o.value=Z instanceof Error?Z.message:"Install failed"}finally{i.value=!1}}}async function ge(){if(!(d.value||c.value.trim()===""||u.value.trim()==="")){d.value=!0,o.value=null,a.value=null;try{const Z=await Ce("/api/skills/paste",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:u.value.trim(),slug:c.value.trim()})});if(Z.ok){const N=await Z.json();t.value=[N.skill,...t.value],c.value="",u.value="",a.value=`✓ Installed: ${N.skill.name}`,setTimeout(()=>{a.value=null},4e3),q()}else{let N="Install failed";try{N=(await Z.json()).error??Z.statusText??N}catch{N=Z.statusText||N}o.value=N}}catch(Z){o.value=Z instanceof Error?Z.message:"Install failed"}finally{d.value=!1}}}async function J(Z){if(confirm(`Delete skill "${Z.name}"? This cannot be undone.`))try{const N=await Ce(`/api/skills/${encodeURIComponent(Z.slug)}`,{method:"DELETE"});if(N.ok)t.value=t.value.filter(fe=>fe.slug!==Z.slug),a.value=`✓ Deleted: ${Z.name}`,setTimeout(()=>{a.value=null},3e3);else{const fe=await N.json().catch(()=>({}));o.value=fe.error??(N.status===404?"Skill not found":`Delete failed (HTTP ${N.status})`)}}catch(N){o.value=N instanceof Error?N.message:"Delete failed"}}return sn(q),(Z,N)=>(_(),w("div",iy,[h.value?(_(),w("div",oy,[p("div",ay,[p("button",{onClick:B,class:"text-txt-muted hover:text-accent transition-colors flex items-center gap-1.5 text-sm group"},[xe(je,{paths:'<path d="M12.35 15.85a.5.5 0 0 1-.7 0L6.16 10.4a.55.55 0 0 1 0-.78l5.49-5.46a.5.5 0 1 1 .7.7L7.2 10l5.16 5.15c.2.2.2.5 0 .7Z"/>',size:14,class:"transition-transform group-hover:-translate-x-0.5"}),N[6]||(N[6]=we(" Back ",-1))]),N[7]||(N[7]=p("div",{class:"w-px h-5 bg-edge"},null,-1)),p("h2",ly,C(h.value.name),1),p("span",cy,C(h.value.slug),1)]),g.value?(_(),w("div",uy,[...N[8]||(N[8]=[p("div",{class:"flex items-center gap-2 text-txt-muted text-sm"},[p("span",{class:"w-4 h-4 border-2 border-edge border-t-accent rounded-full animate-spin"}),we(" Loading… ")],-1)])])):b.value?(_(),w("div",dy,[p("div",hy,[N[9]||(N[9]=p("span",null,"⚠",-1)),we(" "+C(b.value),1)])])):(_(),w("div",fy,[x.value?(_(),w("div",py,[x.value.name?(_(),w("div",gy,[N[10]||(N[10]=p("p",{class:"text-[10px] text-txt-muted uppercase tracking-widest mb-0.5"},"Name",-1)),p("p",my,C(x.value.name),1)])):te("",!0),x.value.description?(_(),w("div",by,[N[11]||(N[11]=p("p",{class:"text-[10px] text-txt-muted uppercase tracking-widest mb-0.5"},"Description",-1)),p("p",vy,C(x.value.description),1)])):te("",!0),p("div",yy,[x.value.version?(_(),w("div",_y,[N[12]||(N[12]=p("p",{class:"text-[10px] text-txt-muted uppercase tracking-widest mb-0.5"},"Version",-1)),p("p",wy,C(x.value.version),1)])):te("",!0),x.value.author?(_(),w("div",xy,[N[13]||(N[13]=p("p",{class:"text-[10px] text-txt-muted uppercase tracking-widest mb-0.5"},"Author",-1)),p("p",Ey,C(x.value.author),1)])):te("",!0)]),$.value.length>0?(_(),w("dl",ky,[(_(!0),w(Se,null,Ge($.value,([fe,I])=>(_(),w(Se,{key:fe},[p("dt",Sy,C(fe),1),p("dd",Ty,C(I),1)],64))),128))])):te("",!0)])):te("",!0),p("div",{innerHTML:y.value},null,8,Ay)]))])):(_(),w("div",Ry,[p("div",Oy,[N[19]||(N[19]=Zs('<div class="flex items-end justify-between mb-6" data-v-20b3d95d><div data-v-20b3d95d><h2 class="text-xl font-bold text-txt-primary tracking-tight" data-v-20b3d95d>Skills</h2><p class="text-xs text-txt-muted mt-0.5" data-v-20b3d95d>Manage installed Copilot skills</p></div><div class="flex items-center gap-2" data-v-20b3d95d><a href="https://github.com/github/awesome-copilot" target="_blank" rel="noopener noreferrer" class="flex items-center gap-1.5 text-xs text-txt-muted bg-surface-2/50 border border-edge px-2.5 py-1 rounded-full hover:border-accent/30 hover:text-accent transition-all duration-200" data-v-20b3d95d><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="w-3 h-3 fill-current" aria-hidden="true" data-v-20b3d95d><path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z" data-v-20b3d95d></path></svg> awesome-copilot </a><a href="https://skills.sh" target="_blank" rel="noopener noreferrer" class="flex items-center gap-1.5 text-xs text-txt-muted bg-surface-2/50 border border-edge px-2.5 py-1 rounded-full hover:border-accent/30 hover:text-accent transition-all duration-200" data-v-20b3d95d><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="w-3 h-3 fill-current" aria-hidden="true" data-v-20b3d95d><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8c0 .93.16 1.82.46 2.65L5 8.5V7H3.5l-.07.01A6.492 6.492 0 0 0 1.5 8Zm6.5 6.5c.93 0 1.82-.17 2.65-.47L8.5 11H7v2.5c.17.01.33.01.5.01Zm-5.3-1.7c.56.4 1.19.7 1.87.88L5 11H3.5c.34.66.79 1.25 1.2 1.8ZM8.5 1.5V4H10l2.5 2.5c.02-.16.03-.33.03-.5A6.5 6.5 0 0 0 8.5 1.5Zm-1 0A6.5 6.5 0 0 0 1.97 6H3.5L6 3.5V1.53c-.51.1-1 .26-1.5.46V1.5ZM11 8.5l-2.5 2.5H10l1.88-1.88A6.47 6.47 0 0 0 11 8.5ZM6 6v4h4V6H6Z" data-v-20b3d95d></path></svg> skills.sh </a></div></div>',1)),p("div",Cy,[p("div",Ny,[p("button",{type:"button",onClick:N[0]||(N[0]=fe=>l.value="url"),class:_e(["px-3 py-1.5 text-xs font-medium rounded-lg transition-all duration-150",l.value==="url"?"bg-accent/10 text-accent border border-accent/20":"text-txt-muted hover:text-txt-secondary hover:bg-surface-3/40 border border-transparent"])}," From URL ",2),p("button",{type:"button",onClick:N[1]||(N[1]=fe=>l.value="paste"),class:_e(["px-3 py-1.5 text-xs font-medium rounded-lg transition-all duration-150",l.value==="paste"?"bg-accent/10 text-accent border border-accent/20":"text-txt-muted hover:text-txt-secondary hover:bg-surface-3/40 border border-transparent"])}," Paste SKILL.md ",2)]),l.value==="url"?(_(),w("form",{key:0,onSubmit:Xt(ae,["prevent"])},[p("div",$y,[dt(p("input",{"onUpdate:modelValue":N[2]||(N[2]=fe=>r.value=fe),type:"url",placeholder:"https://github.com/owner/repo.git","aria-label":"Git repository URL",disabled:i.value,class:"flex-1 bg-surface-1/80 border border-edge rounded-lg px-3 py-2 text-sm text-txt-primary placeholder-txt-muted/50 focus:outline-none focus:border-accent/40 focus:shadow-glow-sm disabled:opacity-40 transition-all duration-200"},null,8,Iy),[[Et,r.value]]),p("button",{type:"submit",disabled:i.value||r.value.trim()==="",class:"bg-accent/15 text-accent border border-accent/25 px-4 py-2 rounded-lg text-sm font-medium hover:bg-accent/25 hover:border-accent/40 disabled:opacity-30 disabled:cursor-not-allowed transition-all duration-150 whitespace-nowrap"},C(i.value?"Installing…":"Install"),9,Py)])],32)):(_(),w("form",{key:1,onSubmit:Xt(ge,["prevent"])},[p("div",Ly,[p("div",null,[dt(p("input",{"onUpdate:modelValue":N[3]||(N[3]=fe=>c.value=fe),type:"text",placeholder:"my-skill","aria-label":"Skill slug",disabled:d.value,class:"w-full bg-surface-1/80 border border-edge rounded-lg px-3 py-2 text-sm text-txt-primary placeholder-txt-muted/50 focus:outline-none focus:border-accent/40 focus:shadow-glow-sm disabled:opacity-40 transition-all duration-200"},null,8,jy),[[Et,c.value]]),N[14]||(N[14]=p("p",{class:"text-[10px] text-txt-muted mt-1 ml-1"},"Unique identifier (lowercase, hyphens ok)",-1))]),dt(p("textarea",{"onUpdate:modelValue":N[4]||(N[4]=fe=>u.value=fe),placeholder:"Paste SKILL.md content here…","aria-label":"SKILL.md content",disabled:d.value,rows:"6",class:"w-full bg-surface-1/80 border border-edge rounded-lg px-3 py-2 text-sm text-txt-primary font-mono placeholder-txt-muted/50 focus:outline-none focus:border-accent/40 focus:shadow-glow-sm disabled:opacity-40 resize-y transition-all duration-200"},null,8,My),[[Et,u.value]]),p("button",{type:"submit",disabled:d.value||c.value.trim()===""||u.value.trim()==="",class:"self-end bg-accent/15 text-accent border border-accent/25 px-4 py-2 rounded-lg text-sm font-medium hover:bg-accent/25 hover:border-accent/40 disabled:opacity-30 disabled:cursor-not-allowed transition-all duration-150"},C(d.value?"Installing…":"Install"),9,Dy)])],32))]),a.value?(_(),w("div",Uy,[N[15]||(N[15]=p("span",null,"✓",-1)),we(" "+C(a.value),1)])):te("",!0),o.value?(_(),w("div",By,[N[16]||(N[16]=p("span",null,"⚠",-1)),we(" "+C(o.value),1)])):te("",!0),!n.value&&!s.value&&t.value.length>0?(_(),w("div",Hy,[dt(p("input",{"onUpdate:modelValue":N[5]||(N[5]=fe=>O.value=fe),type:"search",placeholder:"Search skills…","aria-label":"Search skills",class:"w-full bg-surface-2/50 border border-edge rounded-lg px-3 py-2 text-sm text-txt-primary placeholder-txt-muted/50 focus:outline-none focus:border-accent/40 focus:shadow-glow-sm transition-all duration-200"},null,512),[[Et,O.value]])])):te("",!0),n.value?(_(),w("div",Fy,[...N[17]||(N[17]=[p("div",{class:"flex items-center gap-2 text-txt-muted text-sm"},[p("span",{class:"w-4 h-4 border-2 border-edge border-t-accent rounded-full animate-spin"}),we(" Loading skills… ")],-1)])])):s.value?(_(),w("div",Vy,[N[18]||(N[18]=p("span",null,"⚠",-1)),we(" "+C(s.value),1)])):t.value.length===0?(_(),w("div",qy," No skills installed yet ")):P.value.length===0?(_(),w("div",Ky," No matching skills ")):(_(),w("div",Wy,[(_(!0),w(Se,null,Ge(P.value,fe=>(_(),w("div",{key:fe.slug,onClick:I=>T(fe),class:"group bg-surface-2/40 border border-edge rounded-xl p-4 hover:border-edge-bright hover:shadow-card-hover hover:bg-surface-2/70 transition-all duration-200 cursor-pointer"},[p("div",Gy,[p("div",Jy,[p("h3",Zy,C(fe.name),1),p("p",Yy,C(fe.slug),1)]),p("button",{onClick:Xt(I=>J(fe),["stop"]),class:"shrink-0 ml-2 p-1.5 rounded-lg text-txt-muted/0 group-hover:text-txt-muted hover:!text-red-400 hover:bg-red-500/10 transition-all duration-150",title:"Delete skill"},[xe(je,{paths:'<path d="M8.5 4h3a1.5 1.5 0 0 0-3 0Zm-1 0a2.5 2.5 0 0 1 5 0h5a.5.5 0 0 1 0 1h-1.05l-1.2 10.34A3 3 0 0 1 12.27 18H7.73a3 3 0 0 1-2.98-2.66L3.55 5H2.5a.5.5 0 0 1 0-1h5ZM5.74 15.23A2 2 0 0 0 7.73 17h4.54a2 2 0 0 0 1.99-1.77L15.44 5H4.56l1.18 10.23ZM8.5 7.5c.28 0 .5.22.5.5v6a.5.5 0 0 1-1 0V8c0-.28.22-.5.5-.5ZM12 8a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V8Z"/>',size:14})],8,Xy)]),p("p",Qy,C(fe.description),1),p("p",e_,C(fe.path),1)],8,zy))),128))]))])]))]))}}),n_=er(t_,[["__scopeId","data-v-20b3d95d"]]),s_={class:"flex flex-col h-full bg-surface-0"},r_={class:"flex-1 overflow-y-auto p-3 sm:p-6"},i_={class:"max-w-4xl"},o_={class:"flex justify-between items-end mb-6"},a_={class:"space-y-3"},l_=["disabled"],c_={key:0,class:"mt-3 flex items-center gap-2 text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2"},u_={key:1,class:"flex items-center justify-center py-16"},d_={key:2,class:"flex items-center gap-2 bg-red-500/10 text-red-400 border border-red-500/20 p-3 rounded-lg mb-4 text-sm"},h_={key:3,class:"text-txt-muted text-sm text-center py-16"},f_={key:4,class:"grid gap-3"},p_=["onClick","aria-expanded"],g_={class:"flex justify-between items-start mb-2"},m_={class:"flex-1 flex items-center gap-2.5"},b_={class:"min-w-0"},v_={class:"font-semibold text-txt-primary text-sm"},y_={class:"text-[11px] text-txt-muted font-mono"},__={class:"flex items-center gap-2 shrink-0"},w_={key:0,class:"px-2 py-0.5 rounded-md text-[10px] font-medium bg-purple-500/10 text-purple-300 border border-purple-500/20"},x_={class:"text-xs text-txt-muted font-mono ml-6"},E_={key:0,class:"border-t border-edge px-4 pb-4 pt-3 animate-fade-in"},k_={class:"flex justify-between items-center text-[10px] text-txt-muted mb-3"},S_={key:0,class:"font-mono"},T_={key:0,class:"flex items-center gap-2 text-txt-muted text-xs py-3"},A_={key:1,class:"text-red-400 text-xs py-2"},R_={key:2,class:"text-txt-muted text-xs italic py-2"},O_={key:3,class:"space-y-1.5"},C_={class:"flex-1 min-w-0"},N_={class:"flex items-center gap-1.5"},$_={class:"text-sm font-medium text-txt-primary truncate"},I_={key:0,title:"Team Lead",class:"text-xs"},P_={key:1,title:"QA / Veto Power",class:"text-xs"},L_={class:"text-[10px] text-txt-muted"},j_={class:"flex items-center gap-1 shrink-0"},M_=["onClick"],D_=["onClick","disabled"],U_={class:"bg-surface-1 border border-edge rounded-xl w-full max-w-2xl max-h-[85vh] flex flex-col shadow-2xl animate-fade-in"},B_={class:"flex justify-between items-center px-5 py-3.5 border-b border-edge"},H_={class:"text-sm font-semibold text-txt-primary flex items-center gap-2"},F_={class:"text-xs font-normal text-txt-muted"},V_={class:"text-[10px] text-txt-muted mt-0.5 flex items-center gap-1.5"},q_={class:"flex items-center gap-3"},K_={class:"flex items-center gap-1.5 text-[10px] text-txt-muted cursor-pointer select-none"},W_={key:0,class:"bg-red-500/10 text-red-400 border border-red-500/20 p-3 rounded-lg text-sm"},z_={key:1,class:"text-txt-muted italic text-center py-8"},G_={class:"shrink-0"},J_={class:"flex-1 min-w-0"},Z_={class:"text-txt-secondary break-words"},Y_={class:"text-txt-muted text-[10px] ml-2"},X_={key:0,class:"text-txt-muted italic text-center py-4"},Q_={class:"flex justify-between items-center mb-1"},ew={class:"text-accent"},tw={class:"text-txt-muted text-[10px]"},nw={class:"text-txt-secondary whitespace-pre-wrap break-words"},sw=pt({__name:"SquadsView",setup(e){const t=new Set(["system"]),n={"a-team":"The A-Team",transformers:"Transformers",thundercats:"ThunderCats","gi-joe":"G.I. Joe",aliens:"Aliens",ghostbusters:"Ghostbusters"},s=X([]),r=X(!0),i=X(null),o=X(!1),a=X(!1),l=X(null),c=Zt({}),u=Zt({});function d(S){return[...S].sort((R,G)=>{const le=Me=>Me.is_lead?0:Me.is_qa?1:2;return le(R)-le(G)})}const h=Zt({}),f=Zt({}),g=X(new Set),b=X(null),k=X([]),x=X(null),y=X(!1),E=X(!0),$=X(null);let O=null;const P=De(()=>x.value?"Disconnected":y.value?"Live":"Connecting…"),T=De(()=>k.value.filter(S=>!(!S.summary||t.has(S.summary.kind)||S.type==="assistant.message_delta"))),B=S=>{try{return new Date(S).toLocaleTimeString()}catch{return""}},q=S=>{const R=S.data;if(!R||typeof R!="object")return"";if(typeof R.deltaContent=="string")return R.deltaContent;if(typeof R.content=="string")return R.content;if(typeof R.text=="string")return R.text;try{return JSON.stringify(R,null,2)}catch{return String(R)}},ae=()=>{Cn(()=>{const S=$.value;S&&(S.scrollTop=S.scrollHeight)})},ge=S=>{if(!S.currentTaskId)return;J(),b.value=S,k.value=[],x.value=null,y.value=!1,E.value=!0;const R=ai(`/api/tasks/${encodeURIComponent(S.currentTaskId)}/events`),G=new EventSource(R);O=G,G.onopen=()=>{y.value=!0},G.onmessage=le=>{try{const Me=JSON.parse(le.data);k.value.push(Me),ae()}catch{}},G.onerror=()=>{y.value=!1,k.value.length===0&&(x.value="Connection error. Retrying…")}},J=()=>{if(O){try{O.close()}catch{}O=null}b.value=null,k.value=[],x.value=null,y.value=!1};wo(()=>{J()});const Z=async(S,R)=>{if(!g.value.has(R)){g.value=new Set(g.value).add(R);try{await Ce(`/api/tasks/${encodeURIComponent(R)}/cancel`,{method:"POST"}),await ce(S,!0)}catch(G){f[S]=G instanceof Error?G.message:"Failed to stop task"}finally{const G=new Set(g.value);G.delete(R),g.value=G}}},N=X({slug:"",name:"",projectPath:""}),fe=S=>S?n[S]??S:"",I=S=>new Date(S).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),F=S=>!!c[S],z=async S=>{c[S]=!c[S],c[S]&&!u[S]&&!h[S]&&await ce(S)},ce=async(S,R=!1)=>{if(!(!R&&h[S])){h[S]=!0,f[S]=null;try{const G=await Ce(`/api/squads/${encodeURIComponent(S)}/agents`);if(!G.ok)throw new Error(`HTTP error! status: ${G.status}`);const le=await G.json();u[S]=le.agents}catch(G){f[S]=G instanceof Error?G.message:"Failed to load agents"}finally{h[S]=!1}}},ye=async()=>{try{const S=await Ce("/api/squads");if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`);const R=await S.json();s.value=R.squads}catch(S){i.value=S instanceof Error?S.message:"Failed to load squads"}finally{r.value=!1}},H=async()=>{if(!N.value.slug||!N.value.name||!N.value.projectPath){l.value="All fields are required";return}a.value=!0,l.value=null;try{const S=await Ce("/api/squads",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:N.value.slug,name:N.value.name,projectPath:N.value.projectPath})});if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`);N.value={slug:"",name:"",projectPath:""},o.value=!1,await ye()}catch(S){l.value=S instanceof Error?S.message:"Failed to create squad"}finally{a.value=!1}};return sn(()=>{ye()}),(S,R)=>(_(),w("div",s_,[p("div",r_,[p("div",i_,[p("div",o_,[R[5]||(R[5]=p("div",null,[p("h2",{class:"text-xl font-bold text-txt-primary tracking-tight"},"Squads"),p("p",{class:"text-xs text-txt-muted mt-0.5"},"Manage teams and monitor agents")],-1)),p("button",{onClick:R[0]||(R[0]=G=>o.value=!o.value),class:_e(["px-3.5 py-2 rounded-lg text-sm font-medium transition-all duration-150",o.value?"bg-surface-3/50 text-txt-secondary border border-edge hover:bg-surface-3/70":"bg-accent/15 text-accent border border-accent/25 hover:bg-accent/25 hover:border-accent/40"])},C(o.value?"Cancel":"New Squad"),3)]),o.value?(_(),w("form",{key:0,onSubmit:Xt(H,["prevent"]),class:"bg-surface-2/40 border border-edge rounded-xl p-5 mb-6 animate-fade-in"},[R[7]||(R[7]=p("h3",{class:"font-semibold text-txt-primary text-sm mb-4"},"Create New Squad",-1)),p("div",a_,[dt(p("input",{"onUpdate:modelValue":R[1]||(R[1]=G=>N.value.slug=G),type:"text",placeholder:"Squad slug (e.g., frontend-team)",class:"w-full bg-surface-1/80 border border-edge rounded-lg px-3 py-2 text-sm text-txt-primary placeholder-txt-muted/50 focus:outline-none focus:border-accent/40 focus:shadow-glow-sm transition-all duration-200"},null,512),[[Et,N.value.slug]]),dt(p("input",{"onUpdate:modelValue":R[2]||(R[2]=G=>N.value.name=G),type:"text",placeholder:"Squad name (e.g., Frontend Team)",class:"w-full bg-surface-1/80 border border-edge rounded-lg px-3 py-2 text-sm text-txt-primary placeholder-txt-muted/50 focus:outline-none focus:border-accent/40 focus:shadow-glow-sm transition-all duration-200"},null,512),[[Et,N.value.name]]),dt(p("input",{"onUpdate:modelValue":R[3]||(R[3]=G=>N.value.projectPath=G),type:"text",placeholder:"Project path (e.g., /path/to/project)",class:"w-full bg-surface-1/80 border border-edge rounded-lg px-3 py-2 text-sm text-txt-primary placeholder-txt-muted/50 focus:outline-none focus:border-accent/40 focus:shadow-glow-sm transition-all duration-200"},null,512),[[Et,N.value.projectPath]]),p("button",{type:"submit",disabled:a.value||!N.value.slug||!N.value.name||!N.value.projectPath,class:"w-full bg-accent/15 text-accent border border-accent/25 px-4 py-2 rounded-lg text-sm font-medium hover:bg-accent/25 hover:border-accent/40 disabled:opacity-30 disabled:cursor-not-allowed transition-all duration-150"},C(a.value?"Creating…":"Create Squad"),9,l_)]),l.value?(_(),w("div",c_,[R[6]||(R[6]=p("span",null,"⚠",-1)),we(" "+C(l.value),1)])):te("",!0)],32)):te("",!0),r.value?(_(),w("div",u_,[...R[8]||(R[8]=[p("div",{class:"flex items-center gap-2 text-txt-muted text-sm"},[p("span",{class:"w-4 h-4 border-2 border-edge border-t-accent rounded-full animate-spin"}),we(" Loading squads… ")],-1)])])):i.value?(_(),w("div",d_,[R[9]||(R[9]=p("span",null,"⚠",-1)),we(" "+C(i.value),1)])):s.value.length===0?(_(),w("div",h_," No squads created yet ")):(_(),w("div",f_,[(_(!0),w(Se,null,Ge(s.value,G=>(_(),w("div",{key:G.id,class:"bg-surface-2/40 border border-edge rounded-xl overflow-hidden hover:border-edge-bright transition-all duration-200"},[p("button",{type:"button",onClick:le=>z(G.slug),class:"w-full text-left p-4 focus:outline-none","aria-expanded":F(G.slug)},[p("div",g_,[p("div",m_,[xe(je,{paths:'<path d="M7.65 4.15c.2-.2.5-.2.7 0l5.49 5.46c.21.22.21.57 0 .78l-5.49 5.46a.5.5 0 0 1-.7-.7L12.8 10 7.65 4.85a.5.5 0 0 1 0-.7Z"/>',size:14,class:_e(["text-txt-muted transition-transform duration-200 shrink-0",F(G.slug)?"rotate-90":""])},null,8,["class"]),p("div",b_,[p("h3",v_,C(G.name),1),p("p",y_,C(G.slug),1)])]),p("div",__,[G.universe?(_(),w("span",w_," 🎬 "+C(fe(G.universe)),1)):te("",!0),p("span",{class:_e(["flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium",G.status==="working"?"bg-accent/10 text-accent border border-accent/20":G.status==="error"?"bg-red-500/10 text-red-400 border border-red-500/20":"bg-surface-3/60 text-txt-muted border border-edge"])},[p("span",{class:_e(["w-1.5 h-1.5 rounded-full",G.status==="working"?"bg-accent animate-pulse":G.status==="error"?"bg-red-400":"bg-txt-muted/50"])},null,2),we(" "+C(G.status),1)],2)])]),p("p",x_,"📁 "+C(G.project_path),1)],8,p_),F(G.slug)?(_(),w("div",E_,[p("div",k_,[G.model?(_(),w("span",S_,"Model: "+C(G.model),1)):te("",!0),p("span",null,C(I(G.created_at)),1)]),R[13]||(R[13]=p("h4",{class:"text-xs font-semibold text-txt-secondary uppercase tracking-wider mb-2"},"Team Roster",-1)),h[G.slug]?(_(),w("div",T_,[...R[10]||(R[10]=[p("span",{class:"w-3 h-3 border-2 border-edge border-t-accent rounded-full animate-spin"},null,-1),we(" Loading agents… ",-1)])])):f[G.slug]?(_(),w("div",A_,C(f[G.slug]),1)):!u[G.slug]||u[G.slug].length===0?(_(),w("div",R_," No agents assigned yet ")):(_(),w("ul",O_,[(_(!0),w(Se,null,Ge(d(u[G.slug]??[]),le=>(_(),w("li",{key:le.id??le.character_name,class:_e(["flex items-center gap-3 rounded-lg px-3 py-2 transition-all duration-150",le.status==="working"?"bg-accent/[0.06] border border-accent/15":"bg-surface-1/50 border border-edge"])},[p("div",{class:_e(["w-7 h-7 rounded-full flex items-center justify-center shrink-0 text-[10px] font-bold",le.status==="working"?"bg-accent/15 text-accent border border-accent/25":le.status==="error"?"bg-red-500/15 text-red-400 border border-red-500/25":"bg-surface-3/60 text-txt-muted border border-edge"])},C((le.character_name??"?").charAt(0).toUpperCase()),3),p("div",C_,[p("div",N_,[p("span",$_,C(le.character_name),1),le.is_lead?(_(),w("span",I_,"👑")):te("",!0),le.is_qa?(_(),w("span",P_,"🛡️")):te("",!0)]),p("span",L_,C(le.role_title),1)]),p("span",{class:_e(["flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium shrink-0",le.status==="working"?"bg-accent/10 text-accent":le.status==="error"?"bg-red-500/10 text-red-400":"bg-surface-3/40 text-txt-muted"])},[p("span",{class:_e(["w-1.5 h-1.5 rounded-full",le.status==="working"?"bg-accent animate-pulse":le.status==="error"?"bg-red-400":"bg-emerald-400"])},null,2),we(" "+C(le.status),1)],2),p("div",j_,[le.status==="working"&&le.currentTaskId?(_(),w("button",{key:0,type:"button",onClick:Me=>ge(le),class:"text-[10px] font-medium px-2 py-1 rounded-md bg-accent/10 text-accent border border-accent/20 hover:bg-accent/20 transition-all duration-150 flex items-center gap-1",title:"Preview live work"},[...R[11]||(R[11]=[p("span",{"aria-hidden":"true"},"👁",-1),we(" Preview ",-1)])],8,M_)):te("",!0),le.status==="working"&&le.currentTaskId?(_(),w("button",{key:1,type:"button",onClick:Me=>Z(G.slug,le.currentTaskId),disabled:g.value.has(le.currentTaskId),class:"text-[10px] font-medium px-2 py-1 rounded-md bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 disabled:opacity-40 transition-all duration-150 flex items-center gap-1",title:"Stop task"},[R[12]||(R[12]=p("span",{class:"w-2 h-2 rounded-[2px] bg-red-400"},null,-1)),we(" "+C(g.value.has(le.currentTaskId)?"Stopping…":"Stop"),1)],8,D_)):te("",!0)])],2))),128))]))])):te("",!0)]))),128))]))])]),b.value?(_(),w("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:Xt(J,["self"])},[p("div",U_,[p("div",B_,[p("div",null,[p("h3",H_,[we(C(b.value.character_name)+" ",1),p("span",F_,"— "+C(b.value.role_title),1)]),p("p",V_,[p("span",{class:_e(["inline-block w-1.5 h-1.5 rounded-full",y.value?"bg-emerald-400 animate-pulse":"bg-txt-muted/50"])},null,2),we(" "+C(P.value),1)])]),p("div",q_,[p("label",K_,[dt(p("input",{type:"checkbox","onUpdate:modelValue":R[4]||(R[4]=G=>E.value=G),class:"rounded bg-surface-3 border-edge accent-accent"},null,512),[[zc,E.value]]),R[14]||(R[14]=we(" Summary ",-1))]),p("button",{type:"button",onClick:J,class:"text-txt-muted hover:text-txt-primary text-lg leading-none transition-colors p-1","aria-label":"Close"},"×")])]),p("div",{ref_key:"previewScrollEl",ref:$,class:"overflow-y-auto p-4 space-y-2 flex-1 font-mono text-xs"},[x.value?(_(),w("div",W_,C(x.value),1)):k.value.length===0?(_(),w("div",z_," Waiting for activity… ")):E.value?(_(),w(Se,{key:2},[(_(!0),w(Se,null,Ge(T.value,(G,le)=>(_(),w("div",{key:le,class:"flex items-start gap-2 py-1.5 px-1"},[p("span",G_,C(G.summary.icon),1),p("div",J_,[p("span",Z_,C(G.summary.summary),1),p("span",Y_,C(B(G.ts)),1)])]))),128)),T.value.length===0?(_(),w("div",X_," Processing… ")):te("",!0)],64)):(_(!0),w(Se,{key:3},Ge(k.value,(G,le)=>(_(),w("div",{key:le,class:"border border-edge rounded-lg p-2.5 bg-surface-0"},[p("div",Q_,[p("span",ew,C(G.type),1),p("span",tw,C(B(G.ts)),1)]),p("pre",nw,C(q(G)),1)]))),128))],512),p("div",{class:"px-4 py-3 border-t border-edge flex justify-end"},[p("button",{type:"button",onClick:J,class:"bg-surface-3/50 hover:bg-surface-3/70 text-txt-secondary text-sm px-4 py-1.5 rounded-lg border border-edge transition-all duration-150"}," Close ")])])])):te("",!0)]))}}),rw={class:"flex flex-col h-full bg-surface-0"},iw={class:"flex-1 overflow-y-auto p-3 sm:p-6"},ow={class:"max-w-4xl"},aw={class:"flex justify-between items-end mb-6"},lw=["disabled"],cw={key:0,class:"flex items-center gap-2 bg-red-500/10 text-red-400 border border-red-500/20 p-3 rounded-lg mb-6 text-sm"},uw={class:"mb-8"},dw={key:0,class:"flex items-center justify-center py-10"},hw={key:1,class:"text-txt-muted text-sm text-center py-10"},fw={key:2,class:"grid gap-3"},pw={class:"flex justify-between items-start mb-2.5"},gw={class:"flex items-center gap-3 min-w-0"},mw={class:"min-w-0"},bw={class:"font-semibold text-txt-primary text-sm"},vw={class:"flex items-center gap-1.5 mt-0.5 flex-wrap"},yw={class:"text-[10px] text-txt-muted font-mono"},_w={key:0,class:"text-[10px] text-txt-secondary bg-surface-3/50 px-1.5 py-0.5 rounded border border-edge"},ww={key:1,class:"text-[10px] text-purple-300 bg-purple-500/10 px-1.5 py-0.5 rounded border border-purple-500/20"},xw=["title"],Ew={key:0,class:"bg-surface-0/60 border border-edge rounded-lg p-3 mb-2.5 ml-12"},kw={class:"text-sm text-txt-primary break-words"},Sw={class:"flex justify-between items-center ml-12"},Tw={class:"text-[10px] text-txt-muted"},Aw=["onClick","disabled"],Rw={key:0,class:"flex items-center justify-center py-10"},Ow={key:1,class:"text-txt-muted text-sm text-center py-10"},Cw={key:2,class:"relative"},Nw={class:"space-y-1"},$w=["onClick"],Iw={class:"flex justify-between items-start gap-3"},Pw={class:"min-w-0 flex-1"},Lw={class:"flex items-center gap-2 mb-0.5"},jw={class:"text-sm font-medium text-txt-primary truncate group-hover:text-accent transition-colors"},Mw={key:0,class:"text-[10px] text-txt-muted bg-surface-3/40 px-1.5 py-0.5 rounded border border-edge"},Dw={class:"text-xs text-txt-secondary truncate"},Uw={class:"text-[10px] text-txt-muted mt-1"},Bw={key:0},Hw={key:0,class:"w-1.5 h-1.5 rounded-full bg-accent animate-pulse"},Fw={class:"bg-surface-1 border border-edge rounded-xl w-full max-w-2xl max-h-[85vh] flex flex-col shadow-2xl animate-fade-in"},Vw={class:"overflow-y-auto p-5 space-y-4"},qw={key:0,class:"flex items-center justify-center py-10"},Kw={key:1,class:"bg-red-500/10 text-red-400 border border-red-500/20 p-3 rounded-lg text-sm"},Ww={class:"flex justify-between items-start gap-3"},zw={class:"text-sm text-txt-primary font-medium"},Gw={key:0,class:"w-1.5 h-1.5 rounded-full bg-accent animate-pulse"},Jw={class:"text-[11px] text-txt-muted font-mono break-all bg-surface-0/60 px-2 py-1 rounded border border-edge"},Zw={key:0},Yw={class:"text-sm text-txt-secondary"},Xw={class:"grid grid-cols-2 gap-4"},Qw={class:"text-sm text-txt-secondary"},e1={class:"text-sm text-txt-secondary"},t1={key:1},n1={class:"text-sm text-accent font-mono"},s1=["innerHTML"],r1={class:"flex justify-between items-center mb-2"},i1={class:"flex items-center gap-1.5 text-[10px] text-txt-muted cursor-pointer select-none"},o1={key:0,class:"text-sm text-txt-muted italic"},a1={key:1,class:"text-sm text-txt-muted italic"},l1={key:2,class:"bg-surface-0/60 border border-edge rounded-lg divide-y divide-edge max-h-96 overflow-y-auto"},c1=["onClick"],u1={class:"shrink-0"},d1={class:"flex-1 break-words"},h1={class:"text-[10px] text-txt-muted shrink-0"},f1={key:0,class:"mt-2 pl-6 space-y-1"},p1={key:0,class:"text-xs text-txt-secondary bg-surface-1 border border-edge rounded-lg p-2 whitespace-pre-wrap break-words font-mono"},g1={class:"text-[11px] text-txt-muted bg-surface-1 border border-edge rounded-lg p-2 whitespace-pre-wrap break-words font-mono max-h-48 overflow-y-auto"},m1={class:"text-[10px] text-txt-muted font-mono"},b1=["innerHTML"],v1={key:1,class:"text-sm text-txt-muted italic"},y1={class:"px-5 py-3 border-t border-edge flex justify-between items-center"},_1=["disabled"],w1={key:1},x1=pt({__name:"AgentActivityView",setup(e){const t=X([]),n=X([]),s=X(!0),r=X(null),i=X(new Set),o=X(null),a=X(null),l=X(!1),c=X(null),u=X([]),d=X(!1),h=X(!1),f=X(new Set);let g=null,b=null,k=null;const x=H=>H.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),y=H=>{if(!H)return"";const S=H.includes("T")?H:H.replace(" ","T")+"Z",R=new Date(S);return Number.isNaN(R.getTime())?H:R.toLocaleString()},E=H=>{switch(H){case"running":return"bg-accent/10 text-accent border border-accent/20";case"done":return"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20";case"failed":return"bg-red-500/10 text-red-400 border border-red-500/20";case"cancelled":return"bg-amber-500/10 text-amber-400 border border-amber-500/20";default:return"bg-surface-3/50 text-txt-muted border border-edge"}},$=De(()=>{if(!a.value)return null;const H=a.value.started_at,S=a.value.completed_at;if(!H||!S)return null;const R=new Date(H.includes("T")?H:H.replace(" ","T")+"Z").getTime(),G=new Date(S.includes("T")?S:S.replace(" ","T")+"Z").getTime();if(Number.isNaN(R)||Number.isNaN(G))return null;const le=Math.max(0,Math.round((G-R)/1e3));if(le<60)return`${le}s`;const Me=Math.floor(le/60),U=le%60;return`${Me}m ${U}s`}),O=async H=>{if(!i.value.has(H)){i.value=new Set(i.value).add(H);try{await Ce(`/api/tasks/${encodeURIComponent(H)}/cancel`,{method:"POST"}),await B(),o.value===H&&await q(H)}catch(S){r.value=S instanceof Error?S.message:"Failed to stop task"}finally{const S=new Set(i.value);S.delete(H),i.value=S}}},P=async()=>{try{const H=await Ce("/api/agents");if(!H.ok)throw new Error(`HTTP error! status: ${H.status}`);const S=await H.json();t.value=S.agents}catch(H){r.value=H instanceof Error?H.message:"Failed to load agents"}},T=async()=>{try{const H=await Ce("/api/tasks?limit=50");if(!H.ok)throw new Error(`HTTP error! status: ${H.status}`);const S=await H.json();n.value=S.tasks}catch(H){r.value=H instanceof Error?H.message:"Failed to load tasks"}},B=async()=>{s.value=!0,r.value=null;try{await Promise.all([P(),T()])}finally{s.value=!1}},q=async H=>{l.value=!0,c.value=null;try{const S=await Ce(`/api/tasks/${encodeURIComponent(H)}`);if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`);const R=await S.json();a.value=R.task}catch(S){c.value=S instanceof Error?S.message:"Failed to load task",a.value=null}finally{l.value=!1}},ae=H=>{if(!H)return"";const S=new Date(H);return Number.isNaN(S.getTime())?"":S.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})},ge=H=>{try{return JSON.stringify(H,null,2)}catch{return String(H)}},J=H=>{if(H.status==="success")return"text-emerald-300";if(H.status==="error")return"text-red-300";if(H.status==="pending")return"text-accent";switch(H.kind){case"message":return"text-txt-primary";case"reasoning":return"text-purple-300";case"tool":return"text-blue-300";case"outcome":return"text-amber-300";default:return"text-txt-secondary"}},Z=H=>{if(h.value)return;const S=new Set(f.value);S.has(H)?S.delete(H):S.add(H),f.value=S},N=async(H,S={})=>{S.initial&&(d.value=!0);try{const R=await Ce(`/api/tasks/${encodeURIComponent(H)}/activity`);if(!R.ok)return;const G=await R.json();u.value=G.activity??[]}catch{}finally{S.initial&&(d.value=!1)}},fe=H=>{b||(b=setTimeout(()=>{b=null,o.value===H&&N(H)},250))},I=H=>{F(),N(H,{initial:!0});try{g=new EventSource(ai(`/api/tasks/${encodeURIComponent(H)}/events`)),g.onmessage=()=>{fe(H)},g.onerror=()=>{}}catch{g=null}},F=()=>{g&&(g.close(),g=null),b&&(clearTimeout(b),b=null)},z=H=>{o.value=H,a.value=null,u.value=[],f.value=new Set,q(H),I(H)},ce=()=>{o.value=null,a.value=null,c.value=null,u.value=[],f.value=new Set,F()},ye=H=>{H.key==="Escape"&&o.value&&ce()};return pn(o,H=>{H?document.addEventListener("keydown",ye):document.removeEventListener("keydown",ye)}),sn(()=>{B(),k=setInterval(B,5e3)}),pn(()=>{var H;return(H=a.value)==null?void 0:H.status},H=>{H&&H!=="running"&&(o.value&&N(o.value),F())}),Zr(()=>{k&&clearInterval(k),document.removeEventListener("keydown",ye),F()}),(H,S)=>(_(),w("div",rw,[p("div",iw,[p("div",ow,[p("div",aw,[S[2]||(S[2]=p("div",null,[p("h2",{class:"text-xl font-bold text-txt-primary tracking-tight"},"Activity"),p("p",{class:"text-xs text-txt-muted mt-0.5"},"Monitor agents and recent tasks")],-1)),p("button",{onClick:B,disabled:s.value,class:"px-3.5 py-2 rounded-lg text-sm font-medium transition-all duration-150 bg-accent/15 text-accent border border-accent/25 hover:bg-accent/25 hover:border-accent/40 disabled:opacity-30 disabled:cursor-not-allowed"},C(s.value?"Refreshing…":"Refresh"),9,lw)]),r.value?(_(),w("div",cw,[S[3]||(S[3]=p("span",null,"⚠",-1)),we(" "+C(r.value),1)])):te("",!0),p("section",uw,[S[7]||(S[7]=p("h3",{class:"text-xs font-semibold text-txt-secondary uppercase tracking-wider mb-3"},"Active Agents",-1)),s.value&&t.value.length===0?(_(),w("div",dw,[...S[4]||(S[4]=[p("div",{class:"flex items-center gap-2 text-txt-muted text-sm"},[p("span",{class:"w-4 h-4 border-2 border-edge border-t-accent rounded-full animate-spin"}),we(" Loading agents… ")],-1)])])):t.value.length===0?(_(),w("div",hw," No active agents ")):(_(),w("div",fw,[(_(!0),w(Se,null,Ge(t.value,R=>(_(),w("div",{key:R.slug+(R.characterName||""),class:_e(["group bg-surface-2/40 border rounded-xl p-4 transition-all duration-200",R.status==="working"?"border-accent/20 hover:border-accent/35":"border-edge hover:border-edge-bright"])},[p("div",pw,[p("div",gw,[p("div",{class:_e(["w-9 h-9 rounded-xl flex items-center justify-center shrink-0 text-xs font-bold",R.status==="working"?"bg-accent/15 text-accent border border-accent/25":R.status==="error"?"bg-red-500/15 text-red-400 border border-red-500/25":"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20"])},C((R.name??"?").charAt(0).toUpperCase()),3),p("div",mw,[p("h3",bw,C(R.name),1),p("div",vw,[p("span",yw,C(R.slug),1),R.roleTitle?(_(),w("span",_w,C(R.roleTitle),1)):te("",!0),R.universe?(_(),w("span",ww," 🎬 "+C(R.universe),1)):te("",!0),R.model&&R.status==="working"?(_(),w("span",{key:2,class:"text-[10px] text-emerald-300 bg-emerald-500/10 px-1.5 py-0.5 rounded border border-emerald-500/20",title:`Model: ${R.model}`}," 🧠 "+C(R.model),9,xw)):te("",!0)])])]),p("span",{class:_e(["flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium shrink-0",R.status==="working"?"bg-accent/10 text-accent border border-accent/20":R.status==="error"?"bg-red-500/10 text-red-400 border border-red-500/20":"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20"])},[p("span",{class:_e(["w-1.5 h-1.5 rounded-full",R.status==="working"?"bg-accent animate-pulse":R.status==="error"?"bg-red-400":"bg-emerald-400"])},null,2),we(" "+C(R.status==="working"?"Working":R.status==="error"?"Error":"Idle"),1)],2)]),R.currentTask?(_(),w("div",Ew,[S[5]||(S[5]=p("p",{class:"text-[10px] text-txt-muted uppercase tracking-wider mb-1"},"Current Task",-1)),p("p",kw,C(R.currentTask),1)])):te("",!0),p("div",Sw,[p("div",Tw," Last updated: "+C(x(new Date)),1),R.status==="working"&&R.currentTaskId?(_(),w("button",{key:0,type:"button",onClick:G=>O(R.currentTaskId),disabled:i.value.has(R.currentTaskId),class:"text-[10px] font-medium px-2.5 py-1 rounded-md bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 disabled:opacity-40 transition-all duration-150 flex items-center gap-1",title:"Stop task"},[S[6]||(S[6]=p("span",{class:"w-2 h-2 rounded-[2px] bg-red-400"},null,-1)),we(" "+C(i.value.has(R.currentTaskId)?"Stopping…":"Stop"),1)],8,Aw)):te("",!0)])],2))),128))]))]),p("section",null,[S[10]||(S[10]=p("h3",{class:"text-xs font-semibold text-txt-secondary uppercase tracking-wider mb-3"},"Recent Activity",-1)),s.value&&n.value.length===0?(_(),w("div",Rw,[...S[8]||(S[8]=[p("div",{class:"flex items-center gap-2 text-txt-muted text-sm"},[p("span",{class:"w-4 h-4 border-2 border-edge border-t-accent rounded-full animate-spin"}),we(" Loading activity… ")],-1)])])):n.value.length===0?(_(),w("div",Ow," No recent activity yet ")):(_(),w("div",Cw,[S[9]||(S[9]=p("div",{class:"absolute left-[15px] top-0 bottom-0 w-px bg-gradient-to-b from-accent/30 via-edge to-transparent"},null,-1)),p("div",Nw,[(_(!0),w(Se,null,Ge(n.value,R=>(_(),w("button",{key:R.task_id,type:"button",onClick:G=>z(R.task_id),class:"w-full text-left relative pl-10 pr-4 py-3 rounded-lg hover:bg-surface-2/40 transition-all duration-150 group"},[p("div",{class:_e(["absolute left-[11px] top-4 w-[9px] h-[9px] rounded-full border-2 z-10",R.status==="running"?"bg-accent border-accent shadow-glow-sm":R.status==="done"?"bg-emerald-400 border-emerald-400":R.status==="failed"?"bg-red-400 border-red-400":R.status==="cancelled"?"bg-amber-400 border-amber-400":"bg-surface-3 border-edge"])},null,2),p("div",Iw,[p("div",Pw,[p("div",Lw,[p("span",jw,C(R.agent_slug),1),R.origin_channel?(_(),w("span",Mw,"via "+C(R.origin_channel),1)):te("",!0)]),p("p",Dw,C(R.description),1),p("p",Uw,[we(C(y(R.started_at))+" ",1),R.completed_at?(_(),w("span",Bw," · "+C(y(R.completed_at)),1)):te("",!0)])]),p("span",{class:_e(["flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium shrink-0",E(R.status)])},[R.status==="running"?(_(),w("span",Hw)):te("",!0),we(" "+C(R.status),1)],2)])],8,$w))),128))])]))])])]),o.value?(_(),w("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:Xt(ce,["self"])},[p("div",Fw,[p("div",{class:"flex justify-between items-center px-5 py-3.5 border-b border-edge"},[S[11]||(S[11]=p("h3",{class:"text-sm font-semibold text-txt-primary"},"Task Details",-1)),p("button",{type:"button",onClick:ce,class:"text-txt-muted hover:text-txt-primary text-lg leading-none transition-colors p-1","aria-label":"Close"},"×")]),p("div",Vw,[l.value?(_(),w("div",qw,[...S[12]||(S[12]=[p("div",{class:"flex items-center gap-2 text-txt-muted text-sm"},[p("span",{class:"w-4 h-4 border-2 border-edge border-t-accent rounded-full animate-spin"}),we(" Loading task… ")],-1)])])):c.value?(_(),w("div",Kw,C(c.value),1)):a.value?(_(),w(Se,{key:2},[p("div",Ww,[p("div",null,[S[13]||(S[13]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted mb-0.5"},"Agent",-1)),p("p",zw,C(a.value.agent_slug),1)]),p("span",{class:_e(["flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium",E(a.value.status)])},[a.value.status==="running"?(_(),w("span",Gw)):te("",!0),we(" "+C(a.value.status),1)],2)]),p("div",null,[S[14]||(S[14]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted mb-0.5"},"Task ID",-1)),p("p",Jw,C(a.value.task_id),1)]),a.value.origin_channel?(_(),w("div",Zw,[S[15]||(S[15]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted mb-0.5"},"Origin",-1)),p("p",Yw,C(a.value.origin_channel),1)])):te("",!0),p("div",Xw,[p("div",null,[S[16]||(S[16]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted mb-0.5"},"Started",-1)),p("p",Qw,C(y(a.value.started_at)),1)]),p("div",null,[S[17]||(S[17]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted mb-0.5"},"Completed",-1)),p("p",e1,C(a.value.completed_at?y(a.value.completed_at):"—"),1)])]),$.value?(_(),w("div",t1,[S[18]||(S[18]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted mb-0.5"},"Duration",-1)),p("p",n1,C($.value),1)])):te("",!0),p("div",null,[S[19]||(S[19]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted mb-0.5"},"Description",-1)),p("div",{class:"text-sm text-txt-primary bg-surface-0/60 border border-edge rounded-lg p-3 wiki-content",innerHTML:$e(os)(a.value.description)},null,8,s1)]),p("div",null,[p("div",r1,[S[21]||(S[21]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted"},"Activity",-1)),p("label",i1,[dt(p("input",{type:"checkbox","onUpdate:modelValue":S[0]||(S[0]=R=>h.value=R),class:"rounded bg-surface-3 border-edge accent-accent"},null,512),[[zc,h.value]]),S[20]||(S[20]=we(" Show details ",-1))])]),d.value&&u.value.length===0?(_(),w("div",o1,"Loading activity…")):u.value.length===0?(_(),w("div",a1,"No activity yet")):(_(),w("ul",l1,[(_(!0),w(Se,null,Ge(u.value,(R,G)=>(_(),w("li",{key:`${R.ts}-${G}-${R.rawType}`,class:"px-3 py-2 text-sm hover:bg-surface-2/40 cursor-pointer transition-colors",onClick:le=>Z(G)},[p("div",{class:_e(["flex items-start gap-2",J(R)])},[p("span",u1,C(R.icon),1),p("span",d1,C(R.summary),1),p("span",h1,C(ae(R.ts)),1)],2),h.value||f.value.has(G)?(_(),w("div",f1,[R.detail?(_(),w("pre",p1,C(R.detail),1)):te("",!0),p("pre",g1,C(ge(R.raw)),1),p("p",m1,C(R.rawType),1)])):te("",!0)],8,c1))),128))]))]),p("div",null,[S[22]||(S[22]=p("p",{class:"text-[10px] uppercase tracking-widest text-txt-muted mb-0.5"},"Result",-1)),a.value.result?(_(),w("div",{key:0,class:"text-sm text-txt-primary bg-surface-0/60 border border-edge rounded-lg p-3 wiki-content max-h-96 overflow-y-auto",innerHTML:$e(os)(a.value.result)},null,8,b1)):(_(),w("p",v1,"No result yet"))])],64)):te("",!0)]),p("div",y1,[a.value&&a.value.status==="running"?(_(),w("button",{key:0,type:"button",onClick:S[1]||(S[1]=R=>O(a.value.task_id)),disabled:i.value.has(a.value.task_id),class:"text-xs font-medium px-3 py-1.5 rounded-lg bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 disabled:opacity-40 transition-all duration-150"},C(i.value.has(a.value.task_id)?"Stopping…":"Stop Task"),9,_1)):(_(),w("span",w1)),p("button",{type:"button",onClick:ce,class:"bg-surface-3/50 hover:bg-surface-3/70 text-txt-secondary text-sm px-4 py-1.5 rounded-lg border border-edge transition-all duration-150"}," Close ")])])])):te("",!0)]))}}),E1={class:"flex flex-col h-full"},k1={class:"flex-1 overflow-y-auto p-3 sm:p-6"},S1={class:"flex justify-between items-center mb-6"},T1=["disabled"],A1={key:0,class:"flex items-center justify-center py-16"},R1={key:1,class:"bg-red-500/10 border border-red-500/20 text-red-400 p-4 rounded-xl mb-4 text-sm"},O1={open:"",class:"mb-8 group/section"},C1={class:"cursor-pointer select-none flex items-center gap-3 text-sm font-semibold text-txt-primary mb-4 py-2"},N1={class:"text-[10px] font-mono text-txt-muted bg-surface-2 px-2 py-0.5 rounded-full border border-edge"},$1={key:0,class:"flex flex-col items-center py-8"},I1={class:"w-10 h-10 rounded-xl bg-surface-2 border border-edge flex items-center justify-center mb-3"},P1={key:1,class:"grid gap-3"},L1={class:"flex flex-wrap items-start gap-3"},j1={class:"flex-1 min-w-0"},M1={class:"flex flex-wrap items-center gap-2 mb-1.5"},D1={class:"font-semibold text-txt-primary break-words min-w-0"},U1={key:0,class:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"},B1={class:"flex flex-wrap items-center gap-3 text-xs text-txt-muted mt-1"},H1={class:"font-mono text-accent/80 bg-surface-0/60 px-2 py-0.5 rounded-lg border border-edge/50 break-all"},F1={key:0,class:"flex items-center gap-1 shrink-0"},V1={key:1,class:"flex items-center gap-1 shrink-0"},q1={key:0,class:"text-xs text-txt-muted mt-1.5 break-words"},K1={class:"flex flex-wrap items-center gap-1.5"},W1=["onClick","disabled"],z1=["onClick","disabled"],G1=["onClick","disabled"],J1=["onClick"],Z1=["onClick","disabled"],Y1={key:0,class:"mt-3"},X1=["onClick"],Q1={key:1,class:"mt-4 pt-4 border-t border-edge/50"},ex={class:"text-[10px] font-semibold text-txt-muted uppercase tracking-widest mb-3"},tx={key:0,class:"flex items-center gap-2 text-txt-muted text-xs py-2 justify-center"},nx={key:1,class:"text-txt-muted text-xs py-2 text-center"},sx={key:2,class:"space-y-1.5"},rx={class:"flex-1 min-w-0"},ix={class:"flex flex-wrap items-center gap-2"},ox={class:"text-txt-secondary"},ax={key:0,class:"text-txt-muted mt-0.5"},lx={key:1,class:"text-red-400 mt-1 break-words bg-red-500/5 rounded px-2 py-1 border border-red-500/10"},cx={open:"",class:"group/section"},ux={class:"cursor-pointer select-none flex items-center gap-3 text-sm font-semibold text-txt-primary mb-4 py-2"},dx={class:"text-[10px] font-mono text-txt-muted bg-surface-2 px-2 py-0.5 rounded-full border border-edge"},hx={key:0,class:"flex flex-col items-center py-8"},fx={class:"w-10 h-10 rounded-xl bg-surface-2 border border-edge flex items-center justify-center mb-3"},px={key:1,class:"grid gap-3"},gx={class:"flex flex-wrap items-start gap-3"},mx={class:"flex-1 min-w-0"},bx={class:"flex flex-wrap items-center gap-2 mb-1.5"},vx={class:"font-semibold text-txt-primary break-words min-w-0"},yx={class:"text-[10px] font-mono text-accent/60 bg-accent/5 px-2 py-0.5 rounded-full border border-accent/10 shrink-0"},_x={key:0,class:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"},wx={class:"flex flex-wrap items-center gap-3 text-xs text-txt-muted mt-1"},xx={class:"font-mono text-accent/80 bg-surface-0/60 px-2 py-0.5 rounded-lg border border-edge/50 break-all"},Ex={key:0,class:"flex items-center gap-1 shrink-0"},kx={key:1,class:"flex items-center gap-1 shrink-0"},Sx={key:0,class:"text-xs text-txt-muted mt-1.5 break-words"},Tx={class:"flex flex-wrap items-center gap-1.5"},Ax=["onClick","disabled"],Rx=["onClick","disabled"],Ox=["onClick","disabled"],Cx=["onClick"],Nx=["onClick","disabled"],$x={key:0,class:"mt-3"},Ix=["onClick"],Px={key:1,class:"mt-4 pt-4 border-t border-edge/50"},Lx={class:"text-[10px] font-semibold text-txt-muted uppercase tracking-widest mb-3"},jx={key:0,class:"flex items-center gap-2 text-txt-muted text-xs py-2 justify-center"},Mx={key:1,class:"text-txt-muted text-xs py-2 text-center"},Dx={key:2,class:"space-y-1.5"},Ux={class:"flex-1 min-w-0"},Bx={class:"flex flex-wrap items-center gap-2"},Hx={class:"text-txt-secondary"},Fx={key:0,class:"text-txt-muted mt-0.5"},Vx={key:1,class:"text-red-400 mt-1 break-words bg-red-500/5 rounded px-2 py-1 border border-red-500/10"},qx=pt({__name:"SchedulesView",setup(e){const t=X([]),n=X([]),s=X(!0),r=X(null),i=X(new Set),o=X(new Map),a=X(new Map),l=X(new Set),c=X(new Set);function u(O){const P=O.includes("T")||O.endsWith("Z")?O:O.replace(" ","T")+"Z";return new Date(P).toLocaleString()}function d(O){return O==="done"?"bg-emerald-400":O==="failed"?"bg-red-400":"bg-accent animate-pulse"}function h(O){return O==="done"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":O==="failed"?"bg-red-500/10 text-red-400 border-red-500/20":"bg-accent/10 text-accent border-accent/20"}function f(O,P){const T=`${O}-${P}`,B=new Set(c.value);B.has(T)?B.delete(T):B.add(T),c.value=B}async function g(O,P){const T=`${O}-${P}`,B=o.value.get(T)??!1,q=new Map(o.value);if(q.set(T,!B),o.value=q,!B&&!a.value.has(T)){const ae=new Set(l.value);ae.add(T),l.value=ae;try{const ge=await Ce(`/api/schedules/${O}/${P}/runs?limit=25`);if(ge.ok){const J=await ge.json(),Z=new Map(a.value);Z.set(T,J.runs??[]),a.value=Z}}catch{}finally{const ge=new Set(l.value);ge.delete(T),l.value=ge}}}async function b(){s.value=!0,r.value=null,a.value=new Map;try{const O=await Ce("/api/schedules");if(!O.ok)throw new Error(`HTTP ${O.status}`);const P=await O.json();t.value=P.io,n.value=P.squads}catch(O){r.value=O instanceof Error?O.message:"Failed to load schedules"}finally{s.value=!1}}async function k(O,P){if(!i.value.has(O)){i.value=new Set(i.value).add(O);try{await P(),await b()}catch(T){r.value=T instanceof Error?T.message:"Action failed"}finally{const T=new Set(i.value);T.delete(O),i.value=T}}}async function x(O,P){await k(`${O}-${P}`,async()=>{const T=await Ce(`/api/schedules/${O}/${P}/pause`,{method:"POST"});if(!T.ok)throw new Error(`HTTP ${T.status}`)})}async function y(O,P){await k(`${O}-${P}`,async()=>{const T=await Ce(`/api/schedules/${O}/${P}/resume`,{method:"POST"});if(!T.ok)throw new Error(`HTTP ${T.status}`)})}async function E(O,P){await k(`${O}-${P}`,async()=>{const T=await Ce(`/api/schedules/${O}/${P}/run-now`,{method:"POST"});if(!T.ok)throw new Error(`HTTP ${T.status}`)})}async function $(O,P,T){window.confirm(`Delete schedule '${T}'?`)&&await k(`${O}-${P}`,async()=>{const B=await Ce(`/api/schedules/${O}/${P}`,{method:"DELETE"});if(!B.ok)throw new Error(`HTTP ${B.status}`)})}return sn(b),(O,P)=>(_(),w("div",E1,[p("div",k1,[p("div",S1,[P[1]||(P[1]=p("div",null,[p("h2",{class:"text-xl font-semibold text-txt-primary tracking-tight"},"Schedules"),p("p",{class:"text-xs text-txt-muted mt-0.5"},"Automated tasks & cron jobs")],-1)),p("button",{onClick:b,disabled:s.value,class:"flex items-center gap-1.5 bg-surface-2/60 hover:bg-surface-3/60 disabled:opacity-50 text-txt-secondary hover:text-txt-primary border border-edge hover:border-edge-bright px-3.5 py-2 rounded-xl text-sm transition-all duration-200"},[xe(je,{paths:'<path d="M11.41 3.64a.5.5 0 0 0 0-.71L9.3.8a.5.5 0 0 0-.7.7l1 1a7.5 7.5 0 0 0-4.08 13.5.5.5 0 0 0 .6-.8A6.5 6.5 0 0 1 10.14 3.5L8.59 5.04a.5.5 0 0 0 .7.7l2.12-2.11ZM8.6 16.36a.5.5 0 0 0 0 .71l2.12 2.12a.5.5 0 0 0 .7-.7l-1-1a7.5 7.5 0 0 0 4.07-13.5.5.5 0 1 0-.59.8A6.5 6.5 0 0 1 9.86 16.5l1.55-1.55a.5.5 0 1 0-.7-.7l-2.12 2.11Z"/>',class:"w-3.5 h-3.5"}),P[0]||(P[0]=we(" Refresh ",-1))],8,T1)]),s.value?(_(),w("div",A1,[...P[2]||(P[2]=[p("div",{class:"flex items-center gap-3 text-txt-muted text-sm"},[p("div",{class:"w-1.5 h-1.5 rounded-full bg-accent animate-pulse"}),we(" Loading schedules… ")],-1)])])):r.value?(_(),w("div",R1,C(r.value),1)):(_(),w(Se,{key:2},[p("details",O1,[p("summary",C1,[xe(je,{paths:'<path d="M7.65 4.15c.2-.2.5-.2.7 0l5.49 5.46c.21.22.21.57 0 .78l-5.49 5.46a.5.5 0 0 1-.7-.7L12.8 10 7.65 4.85a.5.5 0 0 1 0-.7Z"/>',size:16,class:"text-accent transition-transform group-open/section:rotate-90"}),P[3]||(P[3]=p("span",{class:"tracking-wide uppercase text-xs text-txt-secondary"},"IO Schedules",-1)),p("span",N1,C(t.value.length),1),P[4]||(P[4]=p("div",{class:"flex-1 h-px bg-gradient-to-r from-edge to-transparent"},null,-1))]),t.value.length===0?(_(),w("div",$1,[p("div",I1,[xe(je,{paths:'<path d="M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1a7 7 0 1 0 0 14 7 7 0 0 0 0-14Zm-.5 2a.5.5 0 0 1 .5.41V10h2.5a.5.5 0 0 1 .09 1H9.5a.5.5 0 0 1-.5-.41V5.5c0-.28.22-.5.5-.5Z"/>',size:20,class:"text-txt-muted"})]),P[5]||(P[5]=p("p",{class:"text-txt-muted text-sm"},"No IO schedules configured",-1))])):(_(),w("div",P1,[(_(!0),w(Se,null,Ge(t.value,T=>(_(),w("div",{key:T.id,class:"bg-surface-2/50 border border-edge rounded-xl p-4 hover:border-edge-bright hover:shadow-card transition-all duration-200 overflow-hidden"},[p("div",L1,[p("div",j1,[p("div",M1,[p("span",D1,C(T.name),1),p("span",{class:_e(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium tracking-wide uppercase border shrink-0",T.enabled?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-surface-3/60 text-txt-muted border-edge"])},[T.enabled?(_(),w("span",U1)):te("",!0),we(" "+C(T.enabled?"Active":"Paused"),1)],2)]),p("div",B1,[p("code",H1,C(T.cron_expr),1),T.next_run_at?(_(),w("span",F1,[xe(je,{paths:'<path d="M17.22 8.69a1.5 1.5 0 0 1 0 2.62l-10 5.5A1.5 1.5 0 0 1 5 15.5v-11A1.5 1.5 0 0 1 7.22 3.2l10 5.5Zm-.48 1.75a.5.5 0 0 0 0-.88l-10-5.5A.5.5 0 0 0 6 4.5v11c0 .38.4.62.74.44l10-5.5Z"/>',size:12}),we(" "+C(u(T.next_run_at)),1)])):te("",!0),T.last_run_at?(_(),w("span",V1,[xe(je,{paths:'<path d="M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1a7 7 0 1 0 0 14 7 7 0 0 0 0-14Zm-.5 2a.5.5 0 0 1 .5.41V10h2.5a.5.5 0 0 1 .09 1H9.5a.5.5 0 0 1-.5-.41V5.5c0-.28.22-.5.5-.5Z"/>',size:12}),we(" "+C(u(T.last_run_at)),1)])):te("",!0)]),T.notes?(_(),w("p",q1,C(T.notes),1)):te("",!0)]),p("div",K1,[T.enabled?(_(),w("button",{key:0,onClick:B=>x("io",T.id),disabled:i.value.has(`io-${T.id}`),class:"text-txt-secondary hover:text-txt-primary disabled:opacity-50 text-xs px-2.5 py-1.5 rounded-lg bg-surface-3/40 hover:bg-surface-3 border border-edge/50 hover:border-edge transition-all duration-200",title:"Pause"},"⏸ Pause",8,W1)):(_(),w("button",{key:1,onClick:B=>y("io",T.id),disabled:i.value.has(`io-${T.id}`),class:"text-txt-secondary hover:text-txt-primary disabled:opacity-50 text-xs px-2.5 py-1.5 rounded-lg bg-surface-3/40 hover:bg-surface-3 border border-edge/50 hover:border-edge transition-all duration-200",title:"Resume"},"▶ Resume",8,z1)),p("button",{onClick:B=>E("io",T.id),disabled:i.value.has(`io-${T.id}`),class:"text-accent hover:text-white disabled:opacity-50 text-xs px-2.5 py-1.5 rounded-lg bg-accent/10 hover:bg-accent/20 border border-accent/20 hover:border-accent/40 transition-all duration-200",title:"Run now"},"▶ Run now",8,G1),p("button",{onClick:B=>g("io",T.id),class:_e(["text-xs px-2.5 py-1.5 rounded-lg border transition-all duration-200",o.value.get(`io-${T.id}`)?"bg-accent/10 text-accent border-accent/20":"bg-surface-3/40 hover:bg-surface-3 text-txt-secondary hover:text-txt-primary border-edge/50 hover:border-edge"]),title:"Toggle run history"},"📋 History",10,J1),p("button",{onClick:B=>$("io",T.id,T.name),disabled:i.value.has(`io-${T.id}`),class:"text-red-400/70 hover:text-red-400 disabled:opacity-50 text-xs px-2 py-1.5 rounded-lg hover:bg-red-500/10 border border-transparent hover:border-red-500/20 transition-all duration-200",title:"Delete"},[xe(je,{paths:'<path d="M8.5 4h3a1.5 1.5 0 0 0-3 0Zm-1 0a2.5 2.5 0 0 1 5 0h5a.5.5 0 0 1 0 1h-1.05l-1.2 10.34A3 3 0 0 1 12.27 18H7.73a3 3 0 0 1-2.98-2.66L3.55 5H2.5a.5.5 0 0 1 0-1h5ZM5.74 15.23A2 2 0 0 0 7.73 17h4.54a2 2 0 0 0 1.99-1.77L15.44 5H4.56l1.18 10.23ZM8.5 7.5c.28 0 .5.22.5.5v6a.5.5 0 0 1-1 0V8c0-.28.22-.5.5-.5ZM12 8a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V8Z"/>',size:14})],8,Z1)])]),T.prompt?(_(),w("div",Y1,[p("p",{class:_e(["text-xs text-txt-muted break-words",c.value.has(`io-${T.id}`)?"":"line-clamp-2"])},C(T.prompt),3),T.prompt.length>120?(_(),w("button",{key:0,onClick:B=>f("io",T.id),class:"text-[10px] text-accent/70 hover:text-accent mt-1 transition-colors"},C(c.value.has(`io-${T.id}`)?"Show less ▲":"Show more ▼"),9,X1)):te("",!0)])):te("",!0),o.value.get(`io-${T.id}`)?(_(),w("div",Q1,[p("h4",ex," Run history — "+C(T.name),1),l.value.has(`io-${T.id}`)?(_(),w("div",tx,[...P[6]||(P[6]=[p("div",{class:"w-1 h-1 rounded-full bg-accent animate-pulse"},null,-1),we(" Loading… ",-1)])])):!a.value.get(`io-${T.id}`)||a.value.get(`io-${T.id}`).length===0?(_(),w("div",nx," No history yet ")):(_(),w("ul",sx,[(_(!0),w(Se,null,Ge(a.value.get(`io-${T.id}`),B=>(_(),w("li",{key:B.id,class:"flex items-start gap-2.5 text-xs bg-surface-0/50 rounded-lg p-2.5 border border-edge/30"},[p("span",{class:_e(["w-2 h-2 rounded-full mt-1 shrink-0",d(B.status)])},null,2),p("div",rx,[p("div",ix,[p("span",ox,C(u(B.started_at)),1),p("span",{class:_e(["px-1.5 py-0.5 rounded-full text-[10px] font-medium tracking-wide uppercase border shrink-0",h(B.status)])},C(B.status),3)]),B.completed_at?(_(),w("div",ax," Completed: "+C(u(B.completed_at)),1)):te("",!0),B.error_text?(_(),w("div",lx,C(B.error_text),1)):te("",!0)])]))),128))]))])):te("",!0)]))),128))]))]),p("details",cx,[p("summary",ux,[xe(je,{paths:'<path d="M7.65 4.15c.2-.2.5-.2.7 0l5.49 5.46c.21.22.21.57 0 .78l-5.49 5.46a.5.5 0 0 1-.7-.7L12.8 10 7.65 4.85a.5.5 0 0 1 0-.7Z"/>',size:16,class:"text-accent transition-transform group-open/section:rotate-90"}),P[7]||(P[7]=p("span",{class:"tracking-wide uppercase text-xs text-txt-secondary"},"Squad Schedules",-1)),p("span",dx,C(n.value.length),1),P[8]||(P[8]=p("div",{class:"flex-1 h-px bg-gradient-to-r from-edge to-transparent"},null,-1))]),n.value.length===0?(_(),w("div",hx,[p("div",fx,[xe(je,{paths:'<path d="M10 3a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM7.5 4.5a2.5 2.5 0 1 1 5 0 2.5 2.5 0 0 1-5 0Zm8-.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm-10 0a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm1-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm.6 12H5a2 2 0 0 1-2-2V9.25c0-.14.11-.25.25-.25h1.76c.04-.37.17-.7.37-1H3.25C2.56 8 2 8.56 2 9.25V13a3 3 0 0 0 3.4 2.97 4.96 4.96 0 0 1-.3-.97Zm9.5.97A3 3 0 0 0 18 13V9.25C18 8.56 17.44 8 16.75 8h-2.13c.2.3.33.63.37 1h1.76c.14 0 .25.11.25.25V13a2 2 0 0 1-2.1 2c-.07.34-.17.66-.3.97ZM7.25 8C6.56 8 6 8.56 6 9.25V14a4 4 0 0 0 8 0V9.25C14 8.56 13.44 8 12.75 8h-5.5ZM7 9.25c0-.14.11-.25.25-.25h5.5c.14 0 .25.11.25.25V14a3 3 0 1 1-6 0V9.25Z"/>',size:20,class:"text-txt-muted"})]),P[9]||(P[9]=p("p",{class:"text-txt-muted text-sm"},"No squad schedules configured",-1))])):(_(),w("div",px,[(_(!0),w(Se,null,Ge(n.value,T=>(_(),w("div",{key:T.id,class:"bg-surface-2/50 border border-edge rounded-xl p-4 hover:border-edge-bright hover:shadow-card transition-all duration-200 overflow-hidden"},[p("div",gx,[p("div",mx,[p("div",bx,[p("span",vx,C(T.name),1),p("span",yx,C(T.squad_slug),1),p("span",{class:_e(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-medium tracking-wide uppercase border shrink-0",T.enabled?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-surface-3/60 text-txt-muted border-edge"])},[T.enabled?(_(),w("span",_x)):te("",!0),we(" "+C(T.enabled?"Active":"Paused"),1)],2)]),p("div",wx,[p("code",xx,C(T.cron_expr),1),T.next_run_at?(_(),w("span",Ex,[xe(je,{paths:'<path d="M17.22 8.69a1.5 1.5 0 0 1 0 2.62l-10 5.5A1.5 1.5 0 0 1 5 15.5v-11A1.5 1.5 0 0 1 7.22 3.2l10 5.5Zm-.48 1.75a.5.5 0 0 0 0-.88l-10-5.5A.5.5 0 0 0 6 4.5v11c0 .38.4.62.74.44l10-5.5Z"/>',size:12}),we(" "+C(u(T.next_run_at)),1)])):te("",!0),T.last_run_at?(_(),w("span",kx,[xe(je,{paths:'<path d="M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1a7 7 0 1 0 0 14 7 7 0 0 0 0-14Zm-.5 2a.5.5 0 0 1 .5.41V10h2.5a.5.5 0 0 1 .09 1H9.5a.5.5 0 0 1-.5-.41V5.5c0-.28.22-.5.5-.5Z"/>',size:12}),we(" "+C(u(T.last_run_at)),1)])):te("",!0)]),T.notes?(_(),w("p",Sx,C(T.notes),1)):te("",!0)]),p("div",Tx,[T.enabled?(_(),w("button",{key:0,onClick:B=>x("squads",T.id),disabled:i.value.has(`squads-${T.id}`),class:"text-txt-secondary hover:text-txt-primary disabled:opacity-50 text-xs px-2.5 py-1.5 rounded-lg bg-surface-3/40 hover:bg-surface-3 border border-edge/50 hover:border-edge transition-all duration-200",title:"Pause"},"⏸ Pause",8,Ax)):(_(),w("button",{key:1,onClick:B=>y("squads",T.id),disabled:i.value.has(`squads-${T.id}`),class:"text-txt-secondary hover:text-txt-primary disabled:opacity-50 text-xs px-2.5 py-1.5 rounded-lg bg-surface-3/40 hover:bg-surface-3 border border-edge/50 hover:border-edge transition-all duration-200",title:"Resume"},"▶ Resume",8,Rx)),p("button",{onClick:B=>E("squads",T.id),disabled:i.value.has(`squads-${T.id}`),class:"text-accent hover:text-white disabled:opacity-50 text-xs px-2.5 py-1.5 rounded-lg bg-accent/10 hover:bg-accent/20 border border-accent/20 hover:border-accent/40 transition-all duration-200",title:"Run now"},"▶ Run now",8,Ox),p("button",{onClick:B=>g("squads",T.id),class:_e(["text-xs px-2.5 py-1.5 rounded-lg border transition-all duration-200",o.value.get(`squads-${T.id}`)?"bg-accent/10 text-accent border-accent/20":"bg-surface-3/40 hover:bg-surface-3 text-txt-secondary hover:text-txt-primary border-edge/50 hover:border-edge"]),title:"Toggle run history"},"📋 History",10,Cx),p("button",{onClick:B=>$("squads",T.id,T.name),disabled:i.value.has(`squads-${T.id}`),class:"text-red-400/70 hover:text-red-400 disabled:opacity-50 text-xs px-2 py-1.5 rounded-lg hover:bg-red-500/10 border border-transparent hover:border-red-500/20 transition-all duration-200",title:"Delete"},[xe(je,{paths:'<path d="M8.5 4h3a1.5 1.5 0 0 0-3 0Zm-1 0a2.5 2.5 0 0 1 5 0h5a.5.5 0 0 1 0 1h-1.05l-1.2 10.34A3 3 0 0 1 12.27 18H7.73a3 3 0 0 1-2.98-2.66L3.55 5H2.5a.5.5 0 0 1 0-1h5ZM5.74 15.23A2 2 0 0 0 7.73 17h4.54a2 2 0 0 0 1.99-1.77L15.44 5H4.56l1.18 10.23ZM8.5 7.5c.28 0 .5.22.5.5v6a.5.5 0 0 1-1 0V8c0-.28.22-.5.5-.5ZM12 8a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V8Z"/>',size:14})],8,Nx)])]),T.prompt?(_(),w("div",$x,[p("p",{class:_e(["text-xs text-txt-muted break-words",c.value.has(`squads-${T.id}`)?"":"line-clamp-2"])},C(T.prompt),3),T.prompt.length>120?(_(),w("button",{key:0,onClick:B=>f("squads",T.id),class:"text-[10px] text-accent/70 hover:text-accent mt-1 transition-colors"},C(c.value.has(`squads-${T.id}`)?"Show less ▲":"Show more ▼"),9,Ix)):te("",!0)])):te("",!0),o.value.get(`squads-${T.id}`)?(_(),w("div",Px,[p("h4",Lx," Run history — "+C(T.name),1),l.value.has(`squads-${T.id}`)?(_(),w("div",jx,[...P[10]||(P[10]=[p("div",{class:"w-1 h-1 rounded-full bg-accent animate-pulse"},null,-1),we(" Loading… ",-1)])])):!a.value.get(`squads-${T.id}`)||a.value.get(`squads-${T.id}`).length===0?(_(),w("div",Mx," No history yet ")):(_(),w("ul",Dx,[(_(!0),w(Se,null,Ge(a.value.get(`squads-${T.id}`),B=>(_(),w("li",{key:B.id,class:"flex items-start gap-2.5 text-xs bg-surface-0/50 rounded-lg p-2.5 border border-edge/30"},[p("span",{class:_e(["w-2 h-2 rounded-full mt-1 shrink-0",d(B.status)])},null,2),p("div",Ux,[p("div",Bx,[p("span",Hx,C(u(B.started_at)),1),p("span",{class:_e(["px-1.5 py-0.5 rounded-full text-[10px] font-medium tracking-wide uppercase border shrink-0",h(B.status)])},C(B.status),3)]),B.completed_at?(_(),w("div",Fx," Completed: "+C(u(B.completed_at)),1)):te("",!0),B.error_text?(_(),w("div",Vx,C(B.error_text),1)):te("",!0)])]))),128))]))])):te("",!0)]))),128))]))])],64))])]))}}),Kx={class:"flex flex-col h-full p-3 sm:p-6"},Wx={class:"flex justify-between items-center mb-6"},zx={key:0,class:"flex-1 flex items-center justify-center"},Gx={key:1,class:"flex-1 flex flex-col items-center justify-center"},Jx={class:"w-12 h-12 rounded-xl bg-surface-2 border border-edge flex items-center justify-center mb-4"},Zx={key:2,class:"space-y-2 overflow-y-auto flex-1 pr-1"},Yx=["onClick"],Xx={class:"p-4"},Qx={class:"flex items-start gap-3"},eE={class:"flex flex-col items-center pt-1"},tE={key:0,class:"w-2 h-2 rounded-full bg-accent shadow-glow-sm shrink-0"},nE={key:1,class:"w-2 h-2 rounded-full bg-edge shrink-0"},sE={class:"flex-1 min-w-0"},rE={class:"flex items-center gap-2 mb-1"},iE={class:"text-sm font-medium text-txt-primary truncate"},oE={key:0,class:"text-[10px] font-mono tracking-wider uppercase text-txt-muted bg-surface-0/60 px-1.5 py-0.5 rounded border border-edge/50 shrink-0"},aE={class:"text-xs text-txt-muted"},lE=["onClick"],cE={key:0,class:"px-4 pb-4 pt-0"},uE=["innerHTML"],dE=pt({__name:"NotificationsView",setup(e){const t=X([]),n=X(!0),s=X(new Set);function r(c){try{const u=c.includes("T")||c.endsWith("Z")?c:c.replace(" ","T")+"Z";return new Date(u).toLocaleString()}catch{return c}}function i(c){const u=new Set(s.value);u.has(c)?u.delete(c):u.add(c),s.value=u}async function o(){try{const c=await Ce("/api/notifications?limit=100");if(c.ok){const u=await c.json();t.value=u.notifications??[]}}catch{}n.value=!1}async function a(c){try{await Ce(`/api/notifications/${c}/read`,{method:"POST"});const u=t.value.find(d=>d.id===c);u&&(u.read_at=new Date().toISOString())}catch{}}async function l(){try{await Ce("/api/notifications/read-all",{method:"POST"});for(const c of t.value)c.read_at||(c.read_at=new Date().toISOString())}catch{}}return sn(o),(c,u)=>(_(),w("div",Kx,[p("div",Wx,[u[0]||(u[0]=p("div",null,[p("h2",{class:"text-xl font-semibold text-txt-primary tracking-tight"},"Notifications"),p("p",{class:"text-xs text-txt-muted mt-0.5"},"Background activity & alerts")],-1)),t.value.length>0?(_(),w("button",{key:0,onClick:l,class:"text-xs text-accent hover:text-accent-glow transition-colors font-medium"}," Mark all read ")):te("",!0)]),n.value?(_(),w("div",zx,[...u[1]||(u[1]=[p("div",{class:"flex items-center gap-3 text-txt-muted text-sm"},[p("div",{class:"w-1.5 h-1.5 rounded-full bg-accent animate-pulse"}),we(" Loading… ")],-1)])])):t.value.length===0?(_(),w("div",Gx,[p("div",Jx,[xe(je,{paths:'<path d="M10 2a5.92 5.92 0 0 1 5.98 5.36l.02.22V11.4l.92 2.22a1 1 0 0 1 .06.17l.01.08.01.13a1 1 0 0 1-.75.97l-.11.02L16 15h-3.5v.17a2.5 2.5 0 0 1-5 0V15H4a1 1 0 0 1-.26-.03l-.13-.04a1 1 0 0 1-.6-1.05l.02-.13.05-.13L4 11.4V7.57A5.9 5.9 0 0 1 10 2Zm1.5 13h-3v.15a1.5 1.5 0 0 0 1.36 1.34l.14.01c.78 0 1.42-.6 1.5-1.36V15ZM10 3a4.9 4.9 0 0 0-4.98 4.38L5 7.6V11.5l-.04.2L4 14h12l-.96-2.3-.04-.2V7.61A4.9 4.9 0 0 0 10 3Z"/>',size:24,class:"text-txt-muted"})]),u[2]||(u[2]=p("p",{class:"text-txt-muted text-sm"},"No notifications yet",-1))])):(_(),w("ul",Zx,[(_(!0),w(Se,null,Ge(t.value,d=>{var h;return _(),w("li",{key:d.id,class:_e(["group rounded-xl border transition-all duration-200 cursor-pointer overflow-hidden",d.read_at?"bg-surface-1/40 border-edge/50 opacity-60 hover:opacity-80":"bg-surface-2/60 border-edge hover:border-edge-bright hover:shadow-card"]),onClick:f=>i(d.id)},[p("div",Xx,[p("div",Qx,[p("div",eE,[d.read_at?(_(),w("span",nE)):(_(),w("span",tE))]),p("div",sE,[p("div",rE,[p("span",iE,C(d.title),1),(h=d.source)!=null&&h.type?(_(),w("span",oE,C(d.source.type),1)):te("",!0)]),p("p",aE,C(r(d.created_at)),1)]),d.read_at?te("",!0):(_(),w("button",{key:0,onClick:Xt(f=>a(d.id),["stop"]),class:"text-txt-muted hover:text-accent shrink-0 opacity-0 group-hover:opacity-100 transition-all duration-200 p-1 rounded-lg hover:bg-accent/10",title:"Mark as read"},[xe(je,{paths:'<path d="M3.37 10.17a.5.5 0 0 0-.74.66l4 4.5c.19.22.52.23.72.02l10.5-10.5a.5.5 0 0 0-.7-.7L7.02 14.27l-3.65-4.1Z"/>',size:16})],8,lE))])]),s.value.has(d.id)?(_(),w("div",cE,[p("div",{class:"ml-5 mt-2 text-sm text-txt-secondary bg-surface-0/60 rounded-xl p-4 border border-edge/50 wiki-content",innerHTML:$e(os)(d.text)},null,8,uE)])):te("",!0)],10,Yx)}),128))]))]))}}),hE={class:"flex flex-col md:flex-row h-full overflow-hidden bg-surface-0"},fE={class:"p-3.5 shrink-0"},pE={class:"flex items-center justify-between mb-3"},gE={class:"text-[10px] text-txt-muted font-mono bg-surface-2/60 px-1.5 py-0.5 rounded"},mE={key:0,class:"flex-1 flex items-center justify-center"},bE={key:1,class:"flex-1 p-4"},vE={class:"text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2"},yE={key:2,class:"flex-1 overflow-y-auto py-2 px-2"},_E={key:0,class:"px-2 py-3 text-sm text-txt-muted text-center"},wE=["onClick"],xE={key:0,class:"absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-accent shadow-glow-sm"},EE={key:0,class:"md:hidden flex items-center gap-2 px-3 py-2 border-b border-edge bg-surface-1/60 shrink-0"},kE={class:"text-xs text-txt-primary font-medium truncate"},SE={key:1,class:"flex-1 flex flex-col items-center justify-center select-none"},TE={key:2,class:"flex-1 flex items-center justify-center"},AE={key:3,class:"flex-1 p-6"},RE={class:"inline-flex items-center gap-2 text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2"},OE={key:4,class:"flex-1 overflow-y-auto"},CE={class:"max-w-3xl mx-auto px-6 py-6"},NE={class:"text-xl font-bold text-txt-primary mb-4 pb-3 border-b border-edge"},$E=["innerHTML"],IE=pt({__name:"WikiView",setup(e){const t=X([]),n=X(null),s=X(""),r=X(""),i=X(!1),o=X(!1),a=X(""),l=X(""),c=De(()=>{const f=r.value.trim().toLowerCase();return f?t.value.filter(g=>g.title.toLowerCase().includes(f)):t.value}),u=De(()=>os(s.value));async function d(){i.value=!0,a.value="";try{const f=await Ce("/api/wiki");if(!f.ok)throw new Error(`HTTP ${f.status}`);const g=await f.json();t.value=g.pages??[]}catch(f){a.value=f instanceof Error?f.message:"Failed to load pages"}finally{i.value=!1}}async function h(f){var g;if(((g=n.value)==null?void 0:g.path)!==f.path){n.value=f,s.value="",o.value=!0,l.value="";try{const b=await Ce(`/api/wiki/${encodeURIComponent(f.path)}`);if(!b.ok)throw new Error(`HTTP ${b.status}`);const k=await b.json();s.value=k.content??""}catch(b){l.value=b instanceof Error?b.message:"Failed to load page"}finally{o.value=!1}}}return sn(d),(f,g)=>(_(),w("div",hE,[p("div",{class:_e(["bg-surface-1/70 backdrop-blur-sm border-edge flex flex-col",n.value?"hidden md:flex md:w-72 md:shrink-0 md:border-r":"flex w-full md:w-72 md:shrink-0 border-b md:border-b-0 md:border-r md:h-full max-h-64 md:max-h-none"])},[p("div",fE,[p("div",pE,[g[2]||(g[2]=p("h2",{class:"text-sm font-semibold text-txt-primary tracking-tight flex items-center gap-1.5"},[p("span",{class:"text-base"},"📚"),we(" Wiki ")],-1)),p("span",gE,C(c.value.length),1)]),dt(p("input",{"onUpdate:modelValue":g[0]||(g[0]=b=>r.value=b),type:"text",placeholder:"Filter pages…",class:"w-full px-3 py-1.5 text-sm bg-surface-2/50 border border-edge rounded-lg text-txt-primary placeholder-txt-muted/50 focus:outline-none focus:border-accent/40 focus:shadow-glow-sm transition-all duration-200"},null,512),[[Et,r.value]])]),g[4]||(g[4]=p("div",{class:"mx-3 h-px bg-gradient-to-r from-transparent via-edge to-transparent"},null,-1)),i.value?(_(),w("div",mE,[...g[3]||(g[3]=[p("div",{class:"flex items-center gap-2 text-txt-muted text-sm"},[p("span",{class:"w-4 h-4 border-2 border-edge border-t-accent rounded-full animate-spin"}),we(" Loading… ")],-1)])])):a.value?(_(),w("div",bE,[p("div",vE,C(a.value),1)])):(_(),w("ul",yE,[c.value.length===0?(_(),w("li",_E," No pages found ")):te("",!0),(_(!0),w(Se,null,Ge(c.value,b=>{var k,x,y;return _(),w("li",{key:b.path,onClick:E=>h(b),class:_e(["relative px-2.5 py-2 rounded-lg cursor-pointer text-sm transition-all duration-150 mb-0.5",((k=n.value)==null?void 0:k.path)===b.path?"bg-accent/10 text-accent":"text-txt-secondary hover:text-txt-primary hover:bg-surface-3/40"])},[((x=n.value)==null?void 0:x.path)===b.path?(_(),w("span",xE)):te("",!0),p("span",{class:_e(((y=n.value)==null?void 0:y.path)===b.path?"ml-1":"")},C(b.title),3)],10,wE)}),128))]))],2),p("div",{class:_e(["flex-1 min-w-0 flex flex-col overflow-hidden",n.value?"flex":"hidden md:flex"])},[n.value?(_(),w("div",EE,[p("button",{onClick:g[1]||(g[1]=b=>n.value=null),class:"flex items-center gap-1.5 text-xs text-txt-muted hover:text-accent transition-colors py-1"},[xe(je,{paths:'<path d="M12.35 15.85a.5.5 0 0 1-.7 0L6.16 10.4a.55.55 0 0 1 0-.78l5.49-5.46a.5.5 0 1 1 .7.7L7.2 10l5.16 5.15c.2.2.2.5 0 .7Z"/>',size:14}),g[5]||(g[5]=we(" All pages ",-1))]),g[6]||(g[6]=p("span",{class:"text-txt-muted/30"},"·",-1)),p("span",kE,C(n.value.title),1)])):te("",!0),n.value?o.value?(_(),w("div",TE,[...g[8]||(g[8]=[p("div",{class:"flex items-center gap-2 text-txt-muted text-sm"},[p("span",{class:"w-4 h-4 border-2 border-edge border-t-accent rounded-full animate-spin"}),we(" Loading… ")],-1)])])):l.value?(_(),w("div",AE,[p("div",RE,[g[9]||(g[9]=p("span",null,"⚠",-1)),we(" "+C(l.value),1)])])):(_(),w("div",OE,[p("div",CE,[p("h1",NE,C(n.value.title),1),p("div",{class:"wiki-content text-txt-secondary text-sm leading-relaxed",innerHTML:u.value},null,8,$E)])])):(_(),w("div",SE,[...g[7]||(g[7]=[p("div",{class:"w-12 h-12 rounded-xl bg-surface-2/60 border border-edge flex items-center justify-center mb-4"},[p("span",{class:"text-2xl"},"📖")],-1),p("p",{class:"text-txt-muted text-sm"},"Select a page to start reading",-1)])]))],2)]))}}),PE=er(IE,[["__scopeId","data-v-5b6273c1"]]),LE={class:"relative flex items-center justify-center h-screen bg-surface-0 overflow-hidden"},jE={class:"relative w-full max-w-sm mx-4 animate-fade-in"},ME={class:"glass rounded-2xl border border-edge p-8 shadow-glow"},DE={key:0,class:"flex items-center gap-2 text-sm text-red-400 bg-red-500/10 border border-red-500/20 rounded-xl px-3.5 py-2.5"},UE=["disabled"],BE=pt({__name:"LoginView",setup(e){const t=Qs(),n=fu(),s=X(""),r=X(""),i=X(null);async function o(){i.value=null;const a=await t.signIn(s.value,r.value);a?i.value=a:n.push("/chat")}return(a,l)=>(_(),w("div",LE,[l[5]||(l[5]=p("div",{class:"pointer-events-none absolute inset-0"},[p("div",{class:"absolute top-1/4 left-1/3 w-[500px] h-[500px] bg-accent/[0.04] rounded-full blur-[120px]"}),p("div",{class:"absolute bottom-1/4 right-1/4 w-[400px] h-[400px] bg-accent-dim/[0.06] rounded-full blur-[100px]"})],-1)),p("div",jE,[p("div",ME,[l[4]||(l[4]=Zs('<div class="flex flex-col items-center mb-8"><div class="w-14 h-14 rounded-xl bg-accent/10 border border-accent/20 flex items-center justify-center mb-4 shadow-glow-sm"><span class="text-accent font-mono font-bold text-2xl tracking-tighter">IO</span></div><h1 class="text-xl font-semibold text-txt-primary tracking-tight">Welcome back</h1><p class="text-sm text-txt-muted mt-1">Sign in to continue</p></div>',1)),p("form",{onSubmit:Xt(o,["prevent"]),class:"space-y-5"},[p("div",null,[l[2]||(l[2]=p("label",{for:"email",class:"block text-xs font-medium text-txt-secondary mb-1.5 tracking-wide uppercase"},"Email",-1)),dt(p("input",{id:"email","onUpdate:modelValue":l[0]||(l[0]=c=>s.value=c),type:"email",required:"",autocomplete:"email",class:"w-full px-3.5 py-2.5 bg-surface-0/60 border border-edge rounded-xl text-txt-primary placeholder-txt-muted text-sm focus:outline-none focus:border-accent/50 focus:ring-1 focus:ring-accent/20 focus:shadow-glow-sm transition-all duration-200",placeholder:"you@example.com"},null,512),[[Et,s.value]])]),p("div",null,[l[3]||(l[3]=p("label",{for:"password",class:"block text-xs font-medium text-txt-secondary mb-1.5 tracking-wide uppercase"},"Password",-1)),dt(p("input",{id:"password","onUpdate:modelValue":l[1]||(l[1]=c=>r.value=c),type:"password",required:"",autocomplete:"current-password",class:"w-full px-3.5 py-2.5 bg-surface-0/60 border border-edge rounded-xl text-txt-primary placeholder-txt-muted text-sm focus:outline-none focus:border-accent/50 focus:ring-1 focus:ring-accent/20 focus:shadow-glow-sm transition-all duration-200",placeholder:"••••••••"},null,512),[[Et,r.value]])]),i.value?(_(),w("div",DE,[xe(je,{paths:'<path d="m4.09 4.22.06-.07a.5.5 0 0 1 .63-.06l.07.06L10 9.29l5.15-5.14a.5.5 0 0 1 .63-.06l.07.06c.18.17.2.44.06.63l-.06.07L10.71 10l5.14 5.15c.18.17.2.44.06.63l-.06.07a.5.5 0 0 1-.63.06l-.07-.06L10 10.71l-5.15 5.14a.5.5 0 0 1-.63.06l-.07-.06a.5.5 0 0 1-.06-.63l.06-.07L9.29 10 4.15 4.85a.5.5 0 0 1-.06-.63l.06-.07-.06.07Z"/>',size:16,class:"shrink-0"}),we(" "+C(i.value),1)])):te("",!0),p("button",{type:"submit",disabled:$e(t).loading,class:"w-full py-2.5 px-4 bg-accent hover:bg-accent-glow disabled:opacity-50 disabled:cursor-not-allowed text-surface-0 font-semibold text-sm rounded-xl transition-all duration-200 shadow-glow-sm hover:shadow-glow"},C($e(t).loading?"Signing in…":"Sign in"),9,UE)],32)])])]))}}),hd=ng({history:jp("/"),routes:[{path:"/",redirect:"/chat"},{path:"/login",name:"login",component:BE,meta:{public:!0}},{path:"/chat",name:"chat",component:ry},{path:"/skills",name:"skills",component:n_},{path:"/squads",name:"squads",component:sw},{path:"/activity",name:"activity",component:x1},{path:"/wiki",name:"wiki",component:PE},{path:"/schedules",name:"schedules",component:qx},{path:"/notifications",name:"notifications",component:dE},{path:"/inbox",name:"inbox",component:()=>Tb(()=>import("./InboxView-Bl3JrKsd.js"),[])}]});hd.beforeEach(async e=>{const t=Qs();return t.initialized||await t.init(),!t.authEnabled||e.meta.public||t.user?!0:{name:"login"}});const Lo=qf(Eb);Lo.use(zf());Lo.use(hd);Lo.mount("#app");export{Se as F,je as _,p as a,te as b,w as c,pt as d,we as e,xe as f,X as g,Ce as h,_ as i,os as j,sn as o,Ge as r,C as t,$e as u,Xt as w};