heyio 0.36.0 → 0.38.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.
- package/package.json +1 -1
- package/web-dist/assets/AgentActivityView-9D_RDmmt.js +1 -0
- package/web-dist/assets/ChatView-5ySvKPi9.js +4 -0
- package/web-dist/assets/FeedView-BDaNijfW.js +1 -0
- package/web-dist/assets/InboxView-DKP-ahnW.js +1 -0
- package/web-dist/assets/LoginView-BHp6tqp8.js +1 -0
- package/web-dist/assets/McpView-CWYN7lRW.js +1 -0
- package/web-dist/assets/SchedulesView-BpcU8RrX.js +1 -0
- package/web-dist/assets/SettingsTabs.vue_vue_type_script_setup_true_lang-CYIbgQ2F.js +1 -0
- package/web-dist/assets/SkillsView-BHoQKBHu.js +1 -0
- package/web-dist/assets/SquadsView-Bg--LUPA.js +1 -0
- package/web-dist/assets/StatusIndicator.vue_vue_type_script_setup_true_lang-BpggUfx8.js +1 -0
- package/web-dist/assets/WikiView-CqfWT-Hg.js +1 -0
- package/web-dist/assets/index-Cilo_iXJ.js +81 -0
- package/web-dist/assets/index-VErxBQJ_.css +10 -0
- package/web-dist/index.html +4 -4
- package/web-dist/assets/index-BF3SnkDw.css +0 -10
- package/web-dist/assets/index-DmOgGsHI.js +0 -88
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SquadsView-Bg--LUPA.js","assets/StatusIndicator.vue_vue_type_script_setup_true_lang-BpggUfx8.js","assets/AgentActivityView-9D_RDmmt.js","assets/SkillsView-BHoQKBHu.js","assets/SettingsTabs.vue_vue_type_script_setup_true_lang-CYIbgQ2F.js","assets/McpView-CWYN7lRW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
|
|
3
|
+
* @vue/shared v3.5.34
|
|
4
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
+
* @license MIT
|
|
6
|
+
**/function po(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ee={},Vn=[],Lt=()=>{},Ml=()=>!1,Ds=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Us=e=>e.startsWith("onUpdate:"),De=Object.assign,go=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},yh=Object.prototype.hasOwnProperty,ve=(e,t)=>yh.call(e,t),ne=Array.isArray,Gn=e=>Vr(e)==="[object Map]",Bs=e=>Vr(e)==="[object Set]",Fo=e=>Vr(e)==="[object Date]",le=e=>typeof e=="function",Te=e=>typeof e=="string",ct=e=>typeof e=="symbol",we=e=>e!==null&&typeof e=="object",jl=e=>(we(e)||le(e))&&le(e.then)&&le(e.catch),Dl=Object.prototype.toString,Vr=e=>Dl.call(e),_h=e=>Vr(e).slice(8,-1),Ul=e=>Vr(e)==="[object Object]",Hs=e=>Te(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,br=po(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Fs=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},vh=/-\w/g,tt=Fs(e=>e.replace(vh,t=>t.slice(1).toUpperCase())),wh=/\B([A-Z])/g,hn=Fs(e=>e.replace(wh,"-$1").toLowerCase()),qs=Fs(e=>e.charAt(0).toUpperCase()+e.slice(1)),di=Fs(e=>e?`on${qs(e)}`:""),Pt=(e,t)=>!Object.is(e,t),fs=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Bl=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ks=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Eh=e=>{const t=Te(e)?Number(e):NaN;return isNaN(t)?e:t};let qo;const Ws=()=>qo||(qo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Vs(e){if(ne(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Te(r)?Th(r):Vs(r);if(s)for(const i in s)t[i]=s[i]}return t}else if(Te(e)||we(e))return e}const Sh=/;(?![^(]*\))/g,kh=/:([^]+)/,Ah=/\/\*[^]*?\*\//g;function Th(e){const t={};return e.replace(Ah,"").split(Sh).forEach(n=>{if(n){const r=n.split(kh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function yt(e){let t="";if(Te(e))t=e;else if(ne(e))for(let n=0;n<e.length;n++){const r=yt(e[n]);r&&(t+=r+" ")}else if(we(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Rh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",xh=po(Rh);function Hl(e){return!!e||e===""}function Oh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Gr(e[r],t[r]);return n}function Gr(e,t){if(e===t)return!0;let n=Fo(e),r=Fo(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=ct(e),r=ct(t),n||r)return e===t;if(n=ne(e),r=ne(t),n||r)return n&&r?Oh(e,t):!1;if(n=we(e),r=we(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!Gr(e[o],t[o]))return!1}}return String(e)===String(t)}function Ch(e,t){return e.findIndex(n=>Gr(n,t))}const Fl=e=>!!(e&&e.__v_isRef===!0),Le=e=>Te(e)?e:e==null?"":ne(e)||we(e)&&(e.toString===Dl||!le(e.toString))?Fl(e)?Le(e.value):JSON.stringify(e,ql,2):String(e),ql=(e,t)=>Fl(t)?ql(e,t.value):Gn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],i)=>(n[fi(r,i)+" =>"]=s,n),{})}:Bs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>fi(n))}:ct(t)?fi(t):we(t)&&!ne(t)&&!Ul(t)?String(t):t,fi=(e,t="")=>{var n;return ct(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
7
|
+
* @vue/reactivity v3.5.34
|
|
8
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
+
* @license MIT
|
|
10
|
+
**/let je;class Kl{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&&je&&(je.active?(this.parent=je,this.index=(je.scopes||(je.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=je;try{return je=this,t()}finally{je=n}}}on(){++this._on===1&&(this.prevScope=je,je=this)}off(){if(this._on>0&&--this._on===0){if(je===this)je=this.prevScope;else{let t=je;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,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function Wl(e){return new Kl(e)}function Vl(){return je}function Nh(e,t=!1){je&&je.cleanups.push(e)}let ke;const pi=new WeakSet;class Gl{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,je&&(je.active?je.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,pi.has(this)&&(pi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Jl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ko(this),Yl(this);const t=ke,n=_t;ke=this,_t=!0;try{return this.fn()}finally{Zl(this),ke=t,_t=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)yo(t);this.deps=this.depsTail=void 0,Ko(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?pi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Li(this)&&this.run()}get dirty(){return Li(this)}}let zl=0,yr,_r;function Jl(e,t=!1){if(e.flags|=8,t){e.next=_r,_r=e;return}e.next=yr,yr=e}function mo(){zl++}function bo(){if(--zl>0)return;if(_r){let t=_r;for(_r=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;yr;){let t=yr;for(yr=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Yl(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,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),yo(r),Ih(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Li(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Xl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Xl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===xr)||(e.globalVersion=xr,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Li(e))))return;e.flags|=2;const t=e.dep,n=ke,r=_t;ke=e,_t=!0;try{Yl(e);const s=e.fn(e._value);(t.version===0||Pt(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ke=n,_t=r,Zl(e),e.flags&=-3}}function yo(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)yo(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ih(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let _t=!0;const Ql=[];function Gt(){Ql.push(_t),_t=!1}function zt(){const e=Ql.pop();_t=e===void 0?!0:e}function Ko(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ke;ke=void 0;try{t()}finally{ke=n}}}let xr=0;class Ph{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 _o{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ke||!_t||ke===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ke)n=this.activeLink=new Ph(ke,this),ke.deps?(n.prevDep=ke.depsTail,ke.depsTail.nextDep=n,ke.depsTail=n):ke.deps=ke.depsTail=n,ec(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ke.depsTail,n.nextDep=void 0,ke.depsTail.nextDep=n,ke.depsTail=n,ke.deps===n&&(ke.deps=r)}return n}trigger(t){this.version++,xr++,this.notify(t)}notify(t){mo();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{bo()}}}function ec(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)ec(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const vs=new WeakMap,Tn=Symbol(""),$i=Symbol(""),Or=Symbol("");function Ge(e,t,n){if(_t&&ke){let r=vs.get(e);r||vs.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new _o),s.map=r,s.key=n),s.track()}}function Kt(e,t,n,r,s,i){const o=vs.get(e);if(!o){xr++;return}const a=l=>{l&&l.trigger()};if(mo(),t==="clear")o.forEach(a);else{const l=ne(e),c=l&&Hs(n);if(l&&n==="length"){const u=Number(r);o.forEach((h,d)=>{(d==="length"||d===Or||!ct(d)&&d>=u)&&a(h)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(Or)),t){case"add":l?c&&a(o.get("length")):(a(o.get(Tn)),Gn(e)&&a(o.get($i)));break;case"delete":l||(a(o.get(Tn)),Gn(e)&&a(o.get($i)));break;case"set":Gn(e)&&a(o.get(Tn));break}}bo()}function Lh(e,t){const n=vs.get(e);return n&&n.get(t)}function Nn(e){const t=pe(e);return t===e?t:(Ge(t,"iterate",Or),lt(e)?t:t.map(vt))}function Gs(e){return Ge(e=pe(e),"iterate",Or),e}function Ct(e,t){return Jt(e)?Qn(Vt(e)?vt(t):t):vt(t)}const $h={__proto__:null,[Symbol.iterator](){return gi(this,Symbol.iterator,e=>Ct(this,e))},concat(...e){return Nn(this).concat(...e.map(t=>ne(t)?Nn(t):t))},entries(){return gi(this,"entries",e=>(e[1]=Ct(this,e[1]),e))},every(e,t){return Mt(this,"every",e,t,void 0,arguments)},filter(e,t){return Mt(this,"filter",e,t,n=>n.map(r=>Ct(this,r)),arguments)},find(e,t){return Mt(this,"find",e,t,n=>Ct(this,n),arguments)},findIndex(e,t){return Mt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Mt(this,"findLast",e,t,n=>Ct(this,n),arguments)},findLastIndex(e,t){return Mt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Mt(this,"forEach",e,t,void 0,arguments)},includes(...e){return mi(this,"includes",e)},indexOf(...e){return mi(this,"indexOf",e)},join(e){return Nn(this).join(e)},lastIndexOf(...e){return mi(this,"lastIndexOf",e)},map(e,t){return Mt(this,"map",e,t,void 0,arguments)},pop(){return or(this,"pop")},push(...e){return or(this,"push",e)},reduce(e,...t){return Wo(this,"reduce",e,t)},reduceRight(e,...t){return Wo(this,"reduceRight",e,t)},shift(){return or(this,"shift")},some(e,t){return Mt(this,"some",e,t,void 0,arguments)},splice(...e){return or(this,"splice",e)},toReversed(){return Nn(this).toReversed()},toSorted(e){return Nn(this).toSorted(e)},toSpliced(...e){return Nn(this).toSpliced(...e)},unshift(...e){return or(this,"unshift",e)},values(){return gi(this,"values",e=>Ct(this,e))}};function gi(e,t,n){const r=Gs(e),s=r[t]();return r!==e&&!lt(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const Mh=Array.prototype;function Mt(e,t,n,r,s,i){const o=Gs(e),a=o!==e&&!lt(e),l=o[t];if(l!==Mh[t]){const h=l.apply(e,i);return a?vt(h):h}let c=n;o!==e&&(a?c=function(h,d){return n.call(this,Ct(e,h),d,e)}:n.length>2&&(c=function(h,d){return n.call(this,h,d,e)}));const u=l.call(o,c,r);return a&&s?s(u):u}function Wo(e,t,n,r){const s=Gs(e),i=s!==e&&!lt(e);let o=n,a=!1;s!==e&&(i?(a=r.length===0,o=function(c,u,h){return a&&(a=!1,c=Ct(e,c)),n.call(this,c,Ct(e,u),h,e)}):n.length>3&&(o=function(c,u,h){return n.call(this,c,u,h,e)}));const l=s[t](o,...r);return a?Ct(e,l):l}function mi(e,t,n){const r=pe(e);Ge(r,"iterate",Or);const s=r[t](...n);return(s===-1||s===!1)&&zs(n[0])?(n[0]=pe(n[0]),r[t](...n)):s}function or(e,t,n=[]){Gt(),mo();const r=pe(e)[t].apply(e,n);return bo(),zt(),r}const jh=po("__proto__,__v_isRef,__isVue"),tc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ct));function Dh(e){ct(e)||(e=String(e));const t=pe(this);return Ge(t,"has",e),t.hasOwnProperty(e)}class nc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(s?i?zh:oc:i?ic:sc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=ne(t);if(!s){let l;if(o&&(l=$h[n]))return l;if(n==="hasOwnProperty")return Dh}const a=Reflect.get(t,n,Oe(t)?t:r);if((ct(n)?tc.has(n):jh(n))||(s||Ge(t,"get",n),i))return a;if(Oe(a)){const l=o&&Hs(n)?a:a.value;return s&&we(l)?ji(l):l}return we(a)?s?ji(a):zr(a):a}}class rc extends nc{constructor(t=!1){super(!1,t)}set(t,n,r,s){let i=t[n];const o=ne(t)&&Hs(n);if(!this._isShallow){const c=Jt(i);if(!lt(r)&&!Jt(r)&&(i=pe(i),r=pe(r)),!o&&Oe(i)&&!Oe(r))return c||(i.value=r),!0}const a=o?Number(n)<t.length:ve(t,n),l=Reflect.set(t,n,r,Oe(t)?t:s);return t===pe(s)&&(a?Pt(r,i)&&Kt(t,"set",n,r):Kt(t,"add",n,r)),l}deleteProperty(t,n){const r=ve(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Kt(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!ct(n)||!tc.has(n))&&Ge(t,"has",n),r}ownKeys(t){return Ge(t,"iterate",ne(t)?"length":Tn),Reflect.ownKeys(t)}}class Uh extends nc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Bh=new rc,Hh=new Uh,Fh=new rc(!0);const Mi=e=>e,Xr=e=>Reflect.getPrototypeOf(e);function qh(e,t,n){return function(...r){const s=this.__v_raw,i=pe(s),o=Gn(i),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=s[e](...r),u=n?Mi:t?Qn:vt;return!t&&Ge(i,"iterate",l?$i:Tn),De(Object.create(c),{next(){const{value:h,done:d}=c.next();return d?{value:h,done:d}:{value:a?[u(h[0]),u(h[1])]:u(h),done:d}}})}}function Qr(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Kh(e,t){const n={get(s){const i=this.__v_raw,o=pe(i),a=pe(s);e||(Pt(s,a)&&Ge(o,"get",s),Ge(o,"get",a));const{has:l}=Xr(o),c=t?Mi:e?Qn:vt;if(l.call(o,s))return c(i.get(s));if(l.call(o,a))return c(i.get(a));i!==o&&i.get(s)},get size(){const s=this.__v_raw;return!e&&Ge(pe(s),"iterate",Tn),s.size},has(s){const i=this.__v_raw,o=pe(i),a=pe(s);return e||(Pt(s,a)&&Ge(o,"has",s),Ge(o,"has",a)),s===a?i.has(s):i.has(s)||i.has(a)},forEach(s,i){const o=this,a=o.__v_raw,l=pe(a),c=t?Mi:e?Qn:vt;return!e&&Ge(l,"iterate",Tn),a.forEach((u,h)=>s.call(i,c(u),c(h),o))}};return De(n,e?{add:Qr("add"),set:Qr("set"),delete:Qr("delete"),clear:Qr("clear")}:{add(s){const i=pe(this),o=Xr(i),a=pe(s),l=!t&&!lt(s)&&!Jt(s)?a:s;return o.has.call(i,l)||Pt(s,l)&&o.has.call(i,s)||Pt(a,l)&&o.has.call(i,a)||(i.add(l),Kt(i,"add",l,l)),this},set(s,i){!t&&!lt(i)&&!Jt(i)&&(i=pe(i));const o=pe(this),{has:a,get:l}=Xr(o);let c=a.call(o,s);c||(s=pe(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,i),c?Pt(i,u)&&Kt(o,"set",s,i):Kt(o,"add",s,i),this},delete(s){const i=pe(this),{has:o,get:a}=Xr(i);let l=o.call(i,s);l||(s=pe(s),l=o.call(i,s)),a&&a.call(i,s);const c=i.delete(s);return l&&Kt(i,"delete",s,void 0),c},clear(){const s=pe(this),i=s.size!==0,o=s.clear();return i&&Kt(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=qh(s,e,t)}),n}function vo(e,t){const n=Kh(e,t);return(r,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(ve(n,s)&&s in r?n:r,s,i)}const Wh={get:vo(!1,!1)},Vh={get:vo(!1,!0)},Gh={get:vo(!0,!1)};const sc=new WeakMap,ic=new WeakMap,oc=new WeakMap,zh=new WeakMap;function Jh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Yh(e){return e.__v_skip||!Object.isExtensible(e)?0:Jh(_h(e))}function zr(e){return Jt(e)?e:wo(e,!1,Bh,Wh,sc)}function ac(e){return wo(e,!1,Fh,Vh,ic)}function ji(e){return wo(e,!0,Hh,Gh,oc)}function wo(e,t,n,r,s){if(!we(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=Yh(e);if(i===0)return e;const o=s.get(e);if(o)return o;const a=new Proxy(e,i===2?r:n);return s.set(e,a),a}function Vt(e){return Jt(e)?Vt(e.__v_raw):!!(e&&e.__v_isReactive)}function Jt(e){return!!(e&&e.__v_isReadonly)}function lt(e){return!!(e&&e.__v_isShallow)}function zs(e){return e?!!e.__v_raw:!1}function pe(e){const t=e&&e.__v_raw;return t?pe(t):e}function Eo(e){return!ve(e,"__v_skip")&&Object.isExtensible(e)&&Bl(e,"__v_skip",!0),e}const vt=e=>we(e)?zr(e):e,Qn=e=>we(e)?ji(e):e;function Oe(e){return e?e.__v_isRef===!0:!1}function Ae(e){return lc(e,!1)}function Zh(e){return lc(e,!0)}function lc(e,t){return Oe(e)?e:new Xh(e,t)}class Xh{constructor(t,n){this.dep=new _o,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:pe(t),this._value=n?t:vt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||lt(t)||Jt(t);t=r?t:pe(t),Pt(t,n)&&(this._rawValue=t,this._value=r?t:vt(t),this.dep.trigger())}}function He(e){return Oe(e)?e.value:e}const Qh={get:(e,t,n)=>t==="__v_raw"?e:He(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Oe(s)&&!Oe(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function cc(e){return Vt(e)?e:new Proxy(e,Qh)}function ed(e){const t=ne(e)?new Array(e.length):{};for(const n in e)t[n]=nd(e,n);return t}class td{constructor(t,n,r){this._object=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._key=ct(n)?n:String(n),this._raw=pe(t);let s=!0,i=t;if(!ne(t)||ct(this._key)||!Hs(this._key))do s=!zs(i)||lt(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=He(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Oe(this._raw[this._key])){const n=this._object[this._key];if(Oe(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Lh(this._raw,this._key)}}function nd(e,t,n){return new td(e,t,n)}class rd{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new _o(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ke!==this)return Jl(this,!0),!0}get value(){const t=this.dep.track();return Xl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function sd(e,t,n=!1){let r,s;return le(e)?r=e:(r=e.get,s=e.set),new rd(r,s,n)}const es={},ws=new WeakMap;let _n;function id(e,t=!1,n=_n){if(n){let r=ws.get(n);r||ws.set(n,r=[]),r.push(e)}}function od(e,t,n=Ee){const{immediate:r,deep:s,once:i,scheduler:o,augmentJob:a,call:l}=n,c=T=>s?T:lt(T)||s===!1||s===0?Wt(T,1):Wt(T);let u,h,d,f,p=!1,m=!1;if(Oe(e)?(h=()=>e.value,p=lt(e)):Vt(e)?(h=()=>c(e),p=!0):ne(e)?(m=!0,p=e.some(T=>Vt(T)||lt(T)),h=()=>e.map(T=>{if(Oe(T))return T.value;if(Vt(T))return c(T);if(le(T))return l?l(T,2):T()})):le(e)?t?h=l?()=>l(e,2):e:h=()=>{if(d){Gt();try{d()}finally{zt()}}const T=_n;_n=u;try{return l?l(e,3,[f]):e(f)}finally{_n=T}}:h=Lt,t&&s){const T=h,D=s===!0?1/0:s;h=()=>Wt(T(),D)}const w=Vl(),E=()=>{u.stop(),w&&w.active&&go(w.effects,u)};if(i&&t){const T=t;t=(...D)=>{T(...D),E()}}let y=m?new Array(e.length).fill(es):es;const v=T=>{if(!(!(u.flags&1)||!u.dirty&&!T))if(t){const D=u.run();if(s||p||(m?D.some((B,j)=>Pt(B,y[j])):Pt(D,y))){d&&d();const B=_n;_n=u;try{const j=[D,y===es?void 0:m&&y[0]===es?[]:y,f];y=D,l?l(t,3,j):t(...j)}finally{_n=B}}}else u.run()};return a&&a(v),u=new Gl(h),u.scheduler=o?()=>o(v,!1):v,f=T=>id(T,!1,u),d=u.onStop=()=>{const T=ws.get(u);if(T){if(l)l(T,4);else for(const D of T)D();ws.delete(u)}},t?r?v(!0):y=u.run():o?o(v.bind(null,!0),!0):u.run(),E.pause=u.pause.bind(u),E.resume=u.resume.bind(u),E.stop=E,E}function Wt(e,t=1/0,n){if(t<=0||!we(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Oe(e))Wt(e.value,t,n);else if(ne(e))for(let r=0;r<e.length;r++)Wt(e[r],t,n);else if(Bs(e)||Gn(e))e.forEach(r=>{Wt(r,t,n)});else if(Ul(e)){for(const r in e)Wt(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Wt(e[r],t,n)}return e}/**
|
|
11
|
+
* @vue/runtime-core v3.5.34
|
|
12
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
+
* @license MIT
|
|
14
|
+
**/function Jr(e,t,n,r){try{return r?e(...r):e()}catch(s){Js(s,t,n)}}function wt(e,t,n,r){if(le(e)){const s=Jr(e,t,n,r);return s&&jl(s)&&s.catch(i=>{Js(i,t,n)}),s}if(ne(e)){const s=[];for(let i=0;i<e.length;i++)s.push(wt(e[i],t,n,r));return s}}function Js(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||Ee;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 h=0;h<u.length;h++)if(u[h](e,l,c)===!1)return}a=a.parent}if(i){Gt(),Jr(i,null,10,[e,l,c]),zt();return}}ad(e,n,s,r,o)}function ad(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const et=[];let Rt=-1;const zn=[];let nn=null,Un=0;const uc=Promise.resolve();let Es=null;function er(e){const t=Es||uc;return e?t.then(this?e.bind(this):e):t}function ld(e){let t=Rt+1,n=et.length;for(;t<n;){const r=t+n>>>1,s=et[r],i=Cr(s);i<e||i===e&&s.flags&2?t=r+1:n=r}return t}function So(e){if(!(e.flags&1)){const t=Cr(e),n=et[et.length-1];!n||!(e.flags&2)&&t>=Cr(n)?et.push(e):et.splice(ld(t),0,e),e.flags|=1,hc()}}function hc(){Es||(Es=uc.then(fc))}function cd(e){ne(e)?zn.push(...e):nn&&e.id===-1?nn.splice(Un+1,0,e):e.flags&1||(zn.push(e),e.flags|=1),hc()}function Vo(e,t,n=Rt+1){for(;n<et.length;n++){const r=et[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;et.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function dc(e){if(zn.length){const t=[...new Set(zn)].sort((n,r)=>Cr(n)-Cr(r));if(zn.length=0,nn){nn.push(...t);return}for(nn=t,Un=0;Un<nn.length;Un++){const n=nn[Un];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}nn=null,Un=0}}const Cr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function fc(e){try{for(Rt=0;Rt<et.length;Rt++){const t=et[Rt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Jr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Rt<et.length;Rt++){const t=et[Rt];t&&(t.flags&=-2)}Rt=-1,et.length=0,dc(),Es=null,(et.length||zn.length)&&fc()}}let Ve=null,pc=null;function Ss(e){const t=Ve;return Ve=e,pc=e&&e.type.__scopeId||null,t}function ln(e,t=Ve,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Ts(-1);const i=Ss(t);let o;try{o=e(...s)}finally{Ss(i),r._d&&Ts(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function ud(e,t){if(Ve===null)return e;const n=ni(Ve),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,o,a,l=Ee]=t[s];i&&(le(i)&&(i={mounted:i,updated:i}),i.deep&&Wt(o),r.push({dir:i,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function fn(e,t,n,r){const s=e.dirs,i=t&&t.dirs;for(let o=0;o<s.length;o++){const a=s[o];i&&(a.oldValue=i[o].value);let l=a.dir[r];l&&(Gt(),wt(l,n,8,[e.el,a,e,t]),zt())}}function ps(e,t){if(Je){let n=Je.provides;const r=Je.parent&&Je.parent.provides;r===n&&(n=Je.provides=Object.create(r)),n[e]=t}}function ft(e,t,n=!1){const r=xo();if(r||Rn){let s=Rn?Rn._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&le(t)?t.call(r&&r.proxy):t}}function hd(){return!!(xo()||Rn)}const dd=Symbol.for("v-scx"),fd=()=>ft(dd);function cn(e,t,n){return gc(e,t,n)}function gc(e,t,n=Ee){const{immediate:r,deep:s,flush:i,once:o}=n,a=De({},n),l=t&&r||!t&&i!=="post";let c;if(Lr){if(i==="sync"){const f=fd();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=Lt,f.resume=Lt,f.pause=Lt,f}}const u=Je;a.call=(f,p,m)=>wt(f,u,p,m);let h=!1;i==="post"?a.scheduler=f=>{Xe(f,u&&u.suspense)}:i!=="sync"&&(h=!0,a.scheduler=(f,p)=>{p?f():So(f)}),a.augmentJob=f=>{t&&(f.flags|=4),h&&(f.flags|=2,u&&(f.id=u.uid,f.i=u))};const d=od(e,t,a);return Lr&&(c?c.push(d):l&&d()),d}function pd(e,t,n){const r=this.proxy,s=Te(e)?e.includes(".")?mc(r,e):()=>r[e]:e.bind(r,r);let i;le(t)?i=t:(i=t.handler,n=t);const o=Yr(this),a=gc(s,i.bind(r),n);return o(),a}function mc(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const en=new WeakMap,bc=Symbol("_vte"),yc=e=>e.__isTeleport,wn=e=>e&&(e.disabled||e.disabled===""),gd=e=>e&&(e.defer||e.defer===""),Go=e=>typeof SVGElement<"u"&&e instanceof SVGElement,zo=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Di=(e,t)=>{const n=e&&e.to;return Te(n)?t?t(n):null:n},md={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,i,o,a,l,c){const{mc:u,pc:h,pbc:d,o:{insert:f,querySelector:p,createText:m,createComment:w,parentNode:E}}=c,y=wn(t.props);let{dynamicChildren:v}=t;const T=(j,q,C)=>{j.shapeFlag&16&&u(j.children,q,C,s,i,o,a,l)},D=(j=t)=>{const q=wn(j.props),C=j.target=Di(j.props,p),X=Ui(C,j,m,f);C&&(o!=="svg"&&Go(C)?o="svg":o!=="mathml"&&zo(C)&&(o="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(C),q||(T(j,C,X),hr(j,!1)))},B=j=>{const q=()=>{if(en.get(j)===q){if(en.delete(j),wn(j.props)){const C=E(j.el)||n;T(j,C,j.anchor),hr(j,!0)}D(j)}};en.set(j,q),Xe(q,i)};if(e==null){const j=t.el=m(""),q=t.anchor=m("");if(f(j,n,r),f(q,n,r),gd(t.props)||i&&i.pendingBranch){B(t);return}y&&(T(t,n,q),hr(t,!0)),D()}else{t.el=e.el;const j=t.anchor=e.anchor,q=en.get(e);if(q){q.flags|=8,en.delete(e),B(t);return}t.targetStart=e.targetStart;const C=t.target=e.target,X=t.targetAnchor=e.targetAnchor,ae=wn(e.props),F=ae?n:C,ce=ae?j:X;if(o==="svg"||Go(C)?o="svg":(o==="mathml"||zo(C))&&(o="mathml"),v?(d(e.dynamicChildren,v,F,s,i,o,a),To(e,t,!0)):l||h(e,t,F,ce,s,i,o,a,!1),y)ae?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ts(t,n,j,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ge=t.target=Di(t.props,p);ge&&ts(t,ge,null,c,0)}else ae&&ts(t,C,X,c,1);hr(t,y)}},remove(e,t,n,{um:r,o:{remove:s}},i){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:h,props:d}=e;let f=i||!wn(d);const p=en.get(e);if(p&&(p.flags|=8,en.delete(e),f=!1),h&&(s(c),s(u)),i&&s(l),o&16)for(let m=0;m<a.length;m++){const w=a[m];r(w,t,n,f,!!w.dynamicChildren)}},move:ts,hydrate:bd};function ts(e,t,n,{o:{insert:r},m:s},i=2){i===0&&r(e.targetAnchor,t,n);const{el:o,anchor:a,shapeFlag:l,children:c,props:u}=e,h=i===2;if(h&&r(o,t,n),!en.has(e)&&(!h||wn(u))&&l&16)for(let d=0;d<c.length;d++)s(c[d],t,n,2);h&&r(a,t,n)}function bd(e,t,n,r,s,i,{o:{nextSibling:o,parentNode:a,querySelector:l,insert:c,createText:u}},h){function d(w,E){let y=E;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")t.targetStart=y;else if(y.data==="teleport anchor"){t.targetAnchor=y,w._lpa=t.targetAnchor&&o(t.targetAnchor);break}}y=o(y)}}function f(w,E){E.anchor=h(o(w),E,a(w),n,r,s,i)}const p=t.target=Di(t.props,l),m=wn(t.props);if(p){const w=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(f(e,t),d(p,w),t.targetAnchor||Ui(p,t,u,c,a(e)===p?e:null)):(t.anchor=o(e),d(p,w),t.targetAnchor||Ui(p,t,u,c),h(w&&o(w),t,p,n,r,s,i))),hr(t,m)}else m&&t.shapeFlag&16&&(f(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}const yd=md;function hr(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Ui(e,t,n,r,s=null){const i=t.targetStart=n(""),o=t.targetAnchor=n("");return i[bc]=o,e&&(r(i,e,s),r(o,e,s)),o}const xt=Symbol("_leaveCb"),ar=Symbol("_enterCb");function _d(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Xs(()=>{e.isMounted=!0}),Tc(()=>{e.isUnmounting=!0}),e}const ht=[Function,Array],_c={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ht,onEnter:ht,onAfterEnter:ht,onEnterCancelled:ht,onBeforeLeave:ht,onLeave:ht,onAfterLeave:ht,onLeaveCancelled:ht,onBeforeAppear:ht,onAppear:ht,onAfterAppear:ht,onAppearCancelled:ht},vc=e=>{const t=e.subTree;return t.component?vc(t.component):t},vd={name:"BaseTransition",props:_c,setup(e,{slots:t}){const n=xo(),r=_d();return()=>{const s=t.default&&Sc(t.default(),!0),i=s&&s.length?wc(s):n.subTree?rt():void 0;if(!i)return;const o=pe(e),{mode:a}=o;if(r.isLeaving)return bi(i);const l=Jo(i);if(!l)return bi(i);let c=Bi(l,o,r,n,h=>c=h);l.type!==ze&&Nr(l,c);let u=n.subTree&&Jo(n.subTree);if(u&&u.type!==ze&&!En(u,l)&&vc(n).type!==ze){let h=Bi(u,o,r,n);if(Nr(u,h),a==="out-in"&&l.type!==ze)return r.isLeaving=!0,h.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete h.afterLeave,u=void 0},bi(i);a==="in-out"&&l.type!==ze?h.delayLeave=(d,f,p)=>{const m=Ec(r,u);m[String(u.key)]=u,d[xt]=()=>{f(),d[xt]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function wc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ze){t=n;break}}return t}const wd=vd;function Ec(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Bi(e,t,n,r,s){const{appear:i,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:h,onBeforeLeave:d,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:w,onAppear:E,onAfterAppear:y,onAppearCancelled:v}=t,T=String(e.key),D=Ec(n,e),B=(C,X)=>{C&&wt(C,r,9,X)},j=(C,X)=>{const ae=X[1];B(C,X),ne(C)?C.every(F=>F.length<=1)&&ae():C.length<=1&&ae()},q={mode:o,persisted:a,beforeEnter(C){let X=l;if(!n.isMounted)if(i)X=w||l;else return;C[xt]&&C[xt](!0);const ae=D[T];ae&&En(e,ae)&&ae.el[xt]&&ae.el[xt](),B(X,[C])},enter(C){if(D[T]===e)return;let X=c,ae=u,F=h;if(!n.isMounted)if(i)X=E||c,ae=y||u,F=v||h;else return;let ce=!1;C[ar]=Ce=>{ce||(ce=!0,Ce?B(F,[C]):B(ae,[C]),q.delayedLeave&&q.delayedLeave(),C[ar]=void 0)};const ge=C[ar].bind(null,!1);X?j(X,[C,ge]):ge()},leave(C,X){const ae=String(e.key);if(C[ar]&&C[ar](!0),n.isUnmounting)return X();B(d,[C]);let F=!1;C[xt]=ge=>{F||(F=!0,X(),ge?B(m,[C]):B(p,[C]),C[xt]=void 0,D[ae]===e&&delete D[ae])};const ce=C[xt].bind(null,!1);D[ae]=e,f?j(f,[C,ce]):ce()},clone(C){const X=Bi(C,t,n,r,s);return s&&s(X),X}};return q}function bi(e){if(Ys(e))return e=un(e),e.children=null,e}function Jo(e){if(!Ys(e))return yc(e.type)&&e.children?wc(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&&le(n.default))return n.default()}}function Nr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Nr(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 Sc(e,t=!1,n){let r=[],s=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===be?(o.patchFlag&128&&s++,r=r.concat(Sc(o.children,t,a))):(t||o.type!==ze)&&r.push(a!=null?un(o,{key:a}):o)}if(s>1)for(let i=0;i<r.length;i++)r[i].patchFlag=-2;return r}function On(e,t){return le(e)?De({name:e.name},t,{setup:e}):e}function kc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Yo(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ks=new WeakMap;function vr(e,t,n,r,s=!1){if(ne(e)){e.forEach((m,w)=>vr(m,t&&(ne(t)?t[w]:t),n,r,s));return}if(Jn(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&vr(e,t,n,r.component.subTree);return}const i=r.shapeFlag&4?ni(r.component):r.el,o=s?null:i,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Ee?a.refs={}:a.refs,h=a.setupState,d=pe(h),f=h===Ee?Ml:m=>Yo(u,m)?!1:ve(d,m),p=(m,w)=>!(w&&Yo(u,w));if(c!=null&&c!==l){if(Zo(t),Te(c))u[c]=null,f(c)&&(h[c]=null);else if(Oe(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(le(l))Jr(l,a,12,[o,u]);else{const m=Te(l),w=Oe(l);if(m||w){const E=()=>{if(e.f){const y=m?f(l)?h[l]:u[l]:p()||!e.k?l.value:u[e.k];if(s)ne(y)&&go(y,i);else if(ne(y))y.includes(i)||y.push(i);else if(m)u[l]=[i],f(l)&&(h[l]=u[l]);else{const v=[i];p(l,e.k)&&(l.value=v),e.k&&(u[e.k]=v)}}else m?(u[l]=o,f(l)&&(h[l]=o)):w&&(p(l,e.k)&&(l.value=o),e.k&&(u[e.k]=o))};if(o){const y=()=>{E(),ks.delete(e)};y.id=-1,ks.set(e,y),Xe(y,n)}else Zo(e),E()}}}function Zo(e){const t=ks.get(e);t&&(t.flags|=8,ks.delete(e))}Ws().requestIdleCallback;Ws().cancelIdleCallback;const Jn=e=>!!e.type.__asyncLoader,Ys=e=>e.type.__isKeepAlive;function Ed(e,t){Ac(e,"a",t)}function Sd(e,t){Ac(e,"da",t)}function Ac(e,t,n=Je){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Zs(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Ys(s.parent.vnode)&&kd(r,t,n,s),s=s.parent}}function kd(e,t,n,r){const s=Zs(t,e,r,!0);Qs(()=>{go(r[t],s)},n)}function Zs(e,t,n=Je,r=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Gt();const a=Yr(n),l=wt(t,n,e,o);return a(),zt(),l});return r?s.unshift(i):s.push(i),i}}const Yt=e=>(t,n=Je)=>{(!Lr||e==="sp")&&Zs(e,(...r)=>t(...r),n)},Ad=Yt("bm"),Xs=Yt("m"),Td=Yt("bu"),Rd=Yt("u"),Tc=Yt("bum"),Qs=Yt("um"),xd=Yt("sp"),Od=Yt("rtg"),Cd=Yt("rtc");function Nd(e,t=Je){Zs("ec",e,t)}const Id="components";function Hv(e,t){return Ld(Id,e,!0,t)||e}const Pd=Symbol.for("v-ndc");function Ld(e,t,n=!0,r=!1){const s=Ve||Je;if(s){const i=s.type;{const a=vf(i,!1);if(a&&(a===t||a===tt(t)||a===qs(tt(t))))return i}const o=Xo(s[e]||i[e],t)||Xo(s.appContext[e],t);return!o&&r?i:o}}function Xo(e,t){return e&&(e[t]||e[tt(t)]||e[qs(tt(t))])}function Yn(e,t,n,r){let s;const i=n,o=ne(e);if(o||Te(e)){const a=o&&Vt(e);let l=!1,c=!1;a&&(l=!lt(e),c=Jt(e),e=Gs(e)),s=new Array(e.length);for(let u=0,h=e.length;u<h;u++)s[u]=t(l?c?Qn(vt(e[u])):vt(e[u]):e[u],u,void 0,i)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,i)}else if(we(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,i));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];s[l]=t(e[u],u,l,i)}}else s=[];return s}function Fv(e,t,n={},r,s){if(Ve.ce||Ve.parent&&Jn(Ve.parent)&&Ve.parent.ce){const c=Object.keys(n).length>0;return Y(),tr(be,null,[he("slot",n,r)],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),Y();const o=i&&Rc(i(n)),a=n.key||o&&o.key,l=tr(be,{key:(a&&!ct(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||[],o&&e._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),i&&i._c&&(i._d=!0),l}function Rc(e){return e.some(t=>Pr(t)?!(t.type===ze||t.type===be&&!Rc(t.children)):!0)?e:null}const Hi=e=>e?Gc(e)?ni(e):Hi(e.parent):null,wr=De(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=>Hi(e.parent),$root:e=>Hi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Oc(e),$forceUpdate:e=>e.f||(e.f=()=>{So(e.update)}),$nextTick:e=>e.n||(e.n=er.bind(e.proxy)),$watch:e=>pd.bind(e)}),yi=(e,t)=>e!==Ee&&!e.__isScriptSetup&&ve(e,t),$d={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:i,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const d=o[t];if(d!==void 0)switch(d){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(yi(r,t))return o[t]=1,r[t];if(s!==Ee&&ve(s,t))return o[t]=2,s[t];if(ve(i,t))return o[t]=3,i[t];if(n!==Ee&&ve(n,t))return o[t]=4,n[t];Fi&&(o[t]=0)}}const c=wr[t];let u,h;if(c)return t==="$attrs"&&Ge(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==Ee&&ve(n,t))return o[t]=4,n[t];if(h=l.config.globalProperties,ve(h,t))return h[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:i}=e;return yi(s,t)?(s[t]=n,!0):r!==Ee&&ve(r,t)?(r[t]=n,!0):ve(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:i,type:o}},a){let l;return!!(n[a]||e!==Ee&&a[0]!=="$"&&ve(e,a)||yi(t,a)||ve(i,a)||ve(r,a)||ve(wr,a)||ve(s.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ve(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Qo(e){return ne(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Fi=!0;function Md(e){const t=Oc(e),n=e.proxy,r=e.ctx;Fi=!1,t.beforeCreate&&ea(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:d,beforeUpdate:f,updated:p,activated:m,deactivated:w,beforeDestroy:E,beforeUnmount:y,destroyed:v,unmounted:T,render:D,renderTracked:B,renderTriggered:j,errorCaptured:q,serverPrefetch:C,expose:X,inheritAttrs:ae,components:F,directives:ce,filters:ge}=t;if(c&&jd(c,r,null),o)for(const P in o){const M=o[P];le(M)&&(r[P]=M.bind(n))}if(s){const P=s.call(n,n);we(P)&&(e.data=zr(P))}if(Fi=!0,i)for(const P in i){const M=i[P],re=le(M)?M.bind(n,n):le(M.get)?M.get.bind(n,n):Lt,ue=!le(M)&&le(M.set)?M.set.bind(n):Lt,me=Fe({get:re,set:ue});Object.defineProperty(r,P,{enumerable:!0,configurable:!0,get:()=>me.value,set:ye=>me.value=ye})}if(a)for(const P in a)xc(a[P],r,n,P);if(l){const P=le(l)?l.call(n):l;Reflect.ownKeys(P).forEach(M=>{ps(M,P[M])})}u&&ea(u,e,"c");function A(P,M){ne(M)?M.forEach(re=>P(re.bind(n))):M&&P(M.bind(n))}if(A(Ad,h),A(Xs,d),A(Td,f),A(Rd,p),A(Ed,m),A(Sd,w),A(Nd,q),A(Cd,B),A(Od,j),A(Tc,y),A(Qs,T),A(xd,C),ne(X))if(X.length){const P=e.exposed||(e.exposed={});X.forEach(M=>{Object.defineProperty(P,M,{get:()=>n[M],set:re=>n[M]=re,enumerable:!0})})}else e.exposed||(e.exposed={});D&&e.render===Lt&&(e.render=D),ae!=null&&(e.inheritAttrs=ae),F&&(e.components=F),ce&&(e.directives=ce),C&&kc(e)}function jd(e,t,n=Lt){ne(e)&&(e=qi(e));for(const r in e){const s=e[r];let i;we(s)?"default"in s?i=ft(s.from||r,s.default,!0):i=ft(s.from||r):i=ft(s),Oe(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[r]=i}}function ea(e,t,n){wt(ne(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function xc(e,t,n,r){let s=r.includes(".")?mc(n,r):()=>n[r];if(Te(e)){const i=t[e];le(i)&&cn(s,i)}else if(le(e))cn(s,e.bind(n));else if(we(e))if(ne(e))e.forEach(i=>xc(i,t,n,r));else{const i=le(e.handler)?e.handler.bind(n):t[e.handler];le(i)&&cn(s,i,e)}}function Oc(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,a=i.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(c=>As(l,c,o,!0)),As(l,t,o)),we(t)&&i.set(t,l),l}function As(e,t,n,r=!1){const{mixins:s,extends:i}=t;i&&As(e,i,n,!0),s&&s.forEach(o=>As(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=Dd[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Dd={data:ta,props:na,emits:na,methods:dr,computed:dr,beforeCreate:Ze,created:Ze,beforeMount:Ze,mounted:Ze,beforeUpdate:Ze,updated:Ze,beforeDestroy:Ze,beforeUnmount:Ze,destroyed:Ze,unmounted:Ze,activated:Ze,deactivated:Ze,errorCaptured:Ze,serverPrefetch:Ze,components:dr,directives:dr,watch:Bd,provide:ta,inject:Ud};function ta(e,t){return t?e?function(){return De(le(e)?e.call(this,this):e,le(t)?t.call(this,this):t)}:t:e}function Ud(e,t){return dr(qi(e),qi(t))}function qi(e){if(ne(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ze(e,t){return e?[...new Set([].concat(e,t))]:t}function dr(e,t){return e?De(Object.create(null),e,t):t}function na(e,t){return e?ne(e)&&ne(t)?[...new Set([...e,...t])]:De(Object.create(null),Qo(e),Qo(t??{})):t}function Bd(e,t){if(!e)return t;if(!t)return e;const n=De(Object.create(null),e);for(const r in t)n[r]=Ze(e[r],t[r]);return n}function Cc(){return{app:null,config:{isNativeTag:Ml,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 Hd=0;function Fd(e,t){return function(r,s=null){le(r)||(r=De({},r)),s!=null&&!we(s)&&(s=null);const i=Cc(),o=new WeakSet,a=[];let l=!1;const c=i.app={_uid:Hd++,_component:r,_props:s,_container:null,_context:i,_instance:null,version:Ef,get config(){return i.config},set config(u){},use(u,...h){return o.has(u)||(u&&le(u.install)?(o.add(u),u.install(c,...h)):le(u)&&(o.add(u),u(c,...h))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,h){return h?(i.components[u]=h,c):i.components[u]},directive(u,h){return h?(i.directives[u]=h,c):i.directives[u]},mount(u,h,d){if(!l){const f=c._ceVNode||he(r,s);return f.appContext=i,d===!0?d="svg":d===!1&&(d=void 0),e(f,u,d),l=!0,c._container=u,u.__vue_app__=c,ni(f.component)}},onUnmount(u){a.push(u)},unmount(){l&&(wt(a,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,h){return i.provides[u]=h,c},runWithContext(u){const h=Rn;Rn=c;try{return u()}finally{Rn=h}}};return c}}let Rn=null;const qd=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${tt(t)}Modifiers`]||e[`${hn(t)}Modifiers`];function Kd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Ee;let s=n;const i=t.startsWith("update:"),o=i&&qd(r,t.slice(7));o&&(o.trim&&(s=n.map(u=>Te(u)?u.trim():u)),o.number&&(s=n.map(Ks)));let a,l=r[a=di(t)]||r[a=di(tt(t))];!l&&i&&(l=r[a=di(hn(t))]),l&&wt(l,e,6,s);const c=r[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,wt(c,e,6,s)}}const Wd=new WeakMap;function Nc(e,t,n=!1){const r=n?Wd:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const i=e.emits;let o={},a=!1;if(!le(e)){const l=c=>{const u=Nc(c,t,!0);u&&(a=!0,De(o,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!i&&!a?(we(e)&&r.set(e,null),null):(ne(i)?i.forEach(l=>o[l]=null):De(o,i),we(e)&&r.set(e,o),o)}function ei(e,t){return!e||!Ds(t)?!1:(t=t.slice(2).replace(/Once$/,""),ve(e,t[0].toLowerCase()+t.slice(1))||ve(e,hn(t))||ve(e,t))}function ra(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[i],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:d,setupState:f,ctx:p,inheritAttrs:m}=e,w=Ss(e);let E,y;try{if(n.shapeFlag&4){const T=s||r,D=T;E=Nt(c.call(D,T,u,h,f,d,p)),y=a}else{const T=t;E=Nt(T.length>1?T(h,{attrs:a,slots:o,emit:l}):T(h,null)),y=t.props?a:Vd(a)}}catch(T){Er.length=0,Js(T,e,1),E=he(ze)}let v=E;if(y&&m!==!1){const T=Object.keys(y),{shapeFlag:D}=v;T.length&&D&7&&(i&&T.some(Us)&&(y=Gd(y,i)),v=un(v,y,!1,!0))}return n.dirs&&(v=un(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Nr(v,n.transition),E=v,Ss(w),E}const Vd=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ds(n))&&((t||(t={}))[n]=e[n]);return t},Gd=(e,t)=>{const n={};for(const r in e)(!Us(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function zd(e,t,n){const{props:r,children:s,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 r?sa(r,o,c):!!o;if(l&8){const u=t.dynamicProps;for(let h=0;h<u.length;h++){const d=u[h];if(Ic(o,r,d)&&!ei(c,d))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?sa(r,o,c):!0:!!o;return!1}function sa(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const i=r[s];if(Ic(t,e,i)&&!ei(n,i))return!0}return!1}function Ic(e,t,n){const r=e[n],s=t[n];return n==="style"&&we(r)&&we(s)?!Gr(r,s):r!==s}function Jd({vnode:e,parent:t,suspense:n},r){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=r,e=s),s===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Pc={},Lc=()=>Object.create(Pc),$c=e=>Object.getPrototypeOf(e)===Pc;function Yd(e,t,n,r=!1){const s={},i=Lc();e.propsDefaults=Object.create(null),Mc(e,t,s,i);for(const o in e.propsOptions[0])o in s||(s[o]=void 0);n?e.props=r?s:ac(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function Zd(e,t,n,r){const{props:s,attrs:i,vnode:{patchFlag:o}}=e,a=pe(s),[l]=e.propsOptions;let c=!1;if((r||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let h=0;h<u.length;h++){let d=u[h];if(ei(e.emitsOptions,d))continue;const f=t[d];if(l)if(ve(i,d))f!==i[d]&&(i[d]=f,c=!0);else{const p=tt(d);s[p]=Ki(l,a,p,f,e,!1)}else f!==i[d]&&(i[d]=f,c=!0)}}}else{Mc(e,t,s,i)&&(c=!0);let u;for(const h in a)(!t||!ve(t,h)&&((u=hn(h))===h||!ve(t,u)))&&(l?n&&(n[h]!==void 0||n[u]!==void 0)&&(s[h]=Ki(l,a,h,void 0,e,!0)):delete s[h]);if(i!==a)for(const h in i)(!t||!ve(t,h))&&(delete i[h],c=!0)}c&&Kt(e.attrs,"set","")}function Mc(e,t,n,r){const[s,i]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(br(l))continue;const c=t[l];let u;s&&ve(s,u=tt(l))?!i||!i.includes(u)?n[u]=c:(a||(a={}))[u]=c:ei(e.emitsOptions,l)||(!(l in r)||c!==r[l])&&(r[l]=c,o=!0)}if(i){const l=pe(n),c=a||Ee;for(let u=0;u<i.length;u++){const h=i[u];n[h]=Ki(s,l,h,c[h],e,!ve(c,h))}}return o}function Ki(e,t,n,r,s,i){const o=e[n];if(o!=null){const a=ve(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&le(l)){const{propsDefaults:c}=s;if(n in c)r=c[n];else{const u=Yr(s);r=c[n]=l.call(null,t),u()}}else r=l;s.ce&&s.ce._setProp(n,r)}o[0]&&(i&&!a?r=!1:o[1]&&(r===""||r===hn(n))&&(r=!0))}return r}const Xd=new WeakMap;function jc(e,t,n=!1){const r=n?Xd:t.propsCache,s=r.get(e);if(s)return s;const i=e.props,o={},a=[];let l=!1;if(!le(e)){const u=h=>{l=!0;const[d,f]=jc(h,t,!0);De(o,d),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 we(e)&&r.set(e,Vn),Vn;if(ne(i))for(let u=0;u<i.length;u++){const h=tt(i[u]);ia(h)&&(o[h]=Ee)}else if(i)for(const u in i){const h=tt(u);if(ia(h)){const d=i[u],f=o[h]=ne(d)||le(d)?{type:d}:De({},d),p=f.type;let m=!1,w=!0;if(ne(p))for(let E=0;E<p.length;++E){const y=p[E],v=le(y)&&y.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(w=!1)}else m=le(p)&&p.name==="Boolean";f[0]=m,f[1]=w,(m||ve(f,"default"))&&a.push(h)}}const c=[o,a];return we(e)&&r.set(e,c),c}function ia(e){return e[0]!=="$"&&!br(e)}const ko=e=>e==="_"||e==="_ctx"||e==="$stable",Ao=e=>ne(e)?e.map(Nt):[Nt(e)],Qd=(e,t,n)=>{if(t._n)return t;const r=ln((...s)=>Ao(t(...s)),n);return r._c=!1,r},Dc=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ko(s))continue;const i=e[s];if(le(i))t[s]=Qd(s,i,r);else if(i!=null){const o=Ao(i);t[s]=()=>o}}},Uc=(e,t)=>{const n=Ao(t);e.slots.default=()=>n},Bc=(e,t,n)=>{for(const r in t)(n||!ko(r))&&(e[r]=t[r])},ef=(e,t,n)=>{const r=e.slots=Lc();if(e.vnode.shapeFlag&32){const s=t._;s?(Bc(r,t,n),n&&Bl(r,"_",s,!0)):Dc(t,r)}else t&&Uc(e,t)},tf=(e,t,n)=>{const{vnode:r,slots:s}=e;let i=!0,o=Ee;if(r.shapeFlag&32){const a=t._;a?n&&a===1?i=!1:Bc(s,t,n):(i=!t.$stable,Dc(t,s)),o=t}else t&&(Uc(e,t),o={default:1});if(i)for(const a in s)!ko(a)&&o[a]==null&&delete s[a]},Xe=af;function nf(e){return rf(e)}function rf(e,t){const n=Ws();n.__VUE__=!0;const{insert:r,remove:s,patchProp:i,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:d,setScopeId:f=Lt,insertStaticContent:p}=e,m=(g,b,_,S=null,N=null,R=null,x=void 0,H=null,L=!!b.dynamicChildren)=>{if(g===b)return;g&&!En(g,b)&&(S=O(g),ye(g,N,R,!0),g=null),b.patchFlag===-2&&(L=!1,b.dynamicChildren=null);const{type:k,ref:ee,shapeFlag:K}=b;switch(k){case ti:w(g,b,_,S);break;case ze:E(g,b,_,S);break;case gs:g==null&&y(b,_,S,x);break;case be:F(g,b,_,S,N,R,x,H,L);break;default:K&1?D(g,b,_,S,N,R,x,H,L):K&6?ce(g,b,_,S,N,R,x,H,L):(K&64||K&128)&&k.process(g,b,_,S,N,R,x,H,L,Q)}ee!=null&&N?vr(ee,g&&g.ref,R,b||g,!b):ee==null&&g&&g.ref!=null&&vr(g.ref,null,R,g,!0)},w=(g,b,_,S)=>{if(g==null)r(b.el=a(b.children),_,S);else{const N=b.el=g.el;b.children!==g.children&&c(N,b.children)}},E=(g,b,_,S)=>{g==null?r(b.el=l(b.children||""),_,S):b.el=g.el},y=(g,b,_,S)=>{[g.el,g.anchor]=p(g.children,b,_,S,g.el,g.anchor)},v=({el:g,anchor:b},_,S)=>{let N;for(;g&&g!==b;)N=d(g),r(g,_,S),g=N;r(b,_,S)},T=({el:g,anchor:b})=>{let _;for(;g&&g!==b;)_=d(g),s(g),g=_;s(b)},D=(g,b,_,S,N,R,x,H,L)=>{if(b.type==="svg"?x="svg":b.type==="math"&&(x="mathml"),g==null)B(b,_,S,N,R,x,H,L);else{const k=g.el&&g.el._isVueCE?g.el:null;try{k&&k._beginPatch(),C(g,b,N,R,x,H,L)}finally{k&&k._endPatch()}}},B=(g,b,_,S,N,R,x,H)=>{let L,k;const{props:ee,shapeFlag:K,transition:Z,dirs:se}=g;if(L=g.el=o(g.type,R,ee&&ee.is,ee),K&8?u(L,g.children):K&16&&q(g.children,L,null,S,N,_i(g,R),x,H),se&&fn(g,null,S,"created"),j(L,g,g.scopeId,x,S),ee){for(const U in ee)U!=="value"&&!br(U)&&i(L,U,null,ee[U],R,S);"value"in ee&&i(L,"value",null,ee.value,R),(k=ee.onVnodeBeforeMount)&&kt(k,S,g)}se&&fn(g,null,S,"beforeMount");const I=sf(N,Z);I&&Z.beforeEnter(L),r(L,b,_),((k=ee&&ee.onVnodeMounted)||I||se)&&Xe(()=>{try{k&&kt(k,S,g),I&&Z.enter(L),se&&fn(g,null,S,"mounted")}finally{}},N)},j=(g,b,_,S,N)=>{if(_&&f(g,_),S)for(let R=0;R<S.length;R++)f(g,S[R]);if(N){let R=N.subTree;if(b===R||qc(R.type)&&(R.ssContent===b||R.ssFallback===b)){const x=N.vnode;j(g,x,x.scopeId,x.slotScopeIds,N.parent)}}},q=(g,b,_,S,N,R,x,H,L=0)=>{for(let k=L;k<g.length;k++){const ee=g[k]=H?qt(g[k]):Nt(g[k]);m(null,ee,b,_,S,N,R,x,H)}},C=(g,b,_,S,N,R,x)=>{const H=b.el=g.el;let{patchFlag:L,dynamicChildren:k,dirs:ee}=b;L|=g.patchFlag&16;const K=g.props||Ee,Z=b.props||Ee;let se;if(_&&pn(_,!1),(se=Z.onVnodeBeforeUpdate)&&kt(se,_,b,g),ee&&fn(b,g,_,"beforeUpdate"),_&&pn(_,!0),(K.innerHTML&&Z.innerHTML==null||K.textContent&&Z.textContent==null)&&u(H,""),k?X(g.dynamicChildren,k,H,_,S,_i(b,N),R):x||M(g,b,H,null,_,S,_i(b,N),R,!1),L>0){if(L&16)ae(H,K,Z,_,N);else if(L&2&&K.class!==Z.class&&i(H,"class",null,Z.class,N),L&4&&i(H,"style",K.style,Z.style,N),L&8){const I=b.dynamicProps;for(let U=0;U<I.length;U++){const z=I[U],ie=K[z],fe=Z[z];(fe!==ie||z==="value")&&i(H,z,ie,fe,N,_)}}L&1&&g.children!==b.children&&u(H,b.children)}else!x&&k==null&&ae(H,K,Z,_,N);((se=Z.onVnodeUpdated)||ee)&&Xe(()=>{se&&kt(se,_,b,g),ee&&fn(b,g,_,"updated")},S)},X=(g,b,_,S,N,R,x)=>{for(let H=0;H<b.length;H++){const L=g[H],k=b[H],ee=L.el&&(L.type===be||!En(L,k)||L.shapeFlag&198)?h(L.el):_;m(L,k,ee,null,S,N,R,x,!0)}},ae=(g,b,_,S,N)=>{if(b!==_){if(b!==Ee)for(const R in b)!br(R)&&!(R in _)&&i(g,R,b[R],null,N,S);for(const R in _){if(br(R))continue;const x=_[R],H=b[R];x!==H&&R!=="value"&&i(g,R,H,x,N,S)}"value"in _&&i(g,"value",b.value,_.value,N)}},F=(g,b,_,S,N,R,x,H,L)=>{const k=b.el=g?g.el:a(""),ee=b.anchor=g?g.anchor:a("");let{patchFlag:K,dynamicChildren:Z,slotScopeIds:se}=b;se&&(H=H?H.concat(se):se),g==null?(r(k,_,S),r(ee,_,S),q(b.children||[],_,ee,N,R,x,H,L)):K>0&&K&64&&Z&&g.dynamicChildren&&g.dynamicChildren.length===Z.length?(X(g.dynamicChildren,Z,_,N,R,x,H),(b.key!=null||N&&b===N.subTree)&&To(g,b,!0)):M(g,b,_,ee,N,R,x,H,L)},ce=(g,b,_,S,N,R,x,H,L)=>{b.slotScopeIds=H,g==null?b.shapeFlag&512?N.ctx.activate(b,_,S,x,L):ge(b,_,S,N,R,x,L):Ce(g,b,L)},ge=(g,b,_,S,N,R,x)=>{const H=g.component=gf(g,S,N);if(Ys(g)&&(H.ctx.renderer=Q),mf(H,!1,x),H.asyncDep){if(N&&N.registerDep(H,A,x),!g.el){const L=H.subTree=he(ze);E(null,L,b,_),g.placeholder=L.el}}else A(H,g,b,_,N,R,x)},Ce=(g,b,_)=>{const S=b.component=g.component;if(zd(g,b,_))if(S.asyncDep&&!S.asyncResolved){P(S,b,_);return}else S.next=b,S.update();else b.el=g.el,S.vnode=b},A=(g,b,_,S,N,R,x)=>{const H=()=>{if(g.isMounted){let{next:K,bu:Z,u:se,parent:I,vnode:U}=g;{const ut=Hc(g);if(ut){K&&(K.el=U.el,P(g,K,x)),ut.asyncDep.then(()=>{Xe(()=>{g.isUnmounted||k()},N)});return}}let z=K,ie;pn(g,!1),K?(K.el=U.el,P(g,K,x)):K=U,Z&&fs(Z),(ie=K.props&&K.props.onVnodeBeforeUpdate)&&kt(ie,I,K,U),pn(g,!0);const fe=ra(g),Ie=g.subTree;g.subTree=fe,m(Ie,fe,h(Ie.el),O(Ie),g,N,R),K.el=fe.el,z===null&&Jd(g,fe.el),se&&Xe(se,N),(ie=K.props&&K.props.onVnodeUpdated)&&Xe(()=>kt(ie,I,K,U),N)}else{let K;const{el:Z,props:se}=b,{bm:I,m:U,parent:z,root:ie,type:fe}=g,Ie=Jn(b);pn(g,!1),I&&fs(I),!Ie&&(K=se&&se.onVnodeBeforeMount)&&kt(K,z,b),pn(g,!0);{ie.ce&&ie.ce._hasShadowRoot()&&ie.ce._injectChildStyle(fe,g.parent?g.parent.type:void 0);const ut=g.subTree=ra(g);m(null,ut,_,S,g,N,R),b.el=ut.el}if(U&&Xe(U,N),!Ie&&(K=se&&se.onVnodeMounted)){const ut=b;Xe(()=>kt(K,z,ut),N)}(b.shapeFlag&256||z&&Jn(z.vnode)&&z.vnode.shapeFlag&256)&&g.a&&Xe(g.a,N),g.isMounted=!0,b=_=S=null}};g.scope.on();const L=g.effect=new Gl(H);g.scope.off();const k=g.update=L.run.bind(L),ee=g.job=L.runIfDirty.bind(L);ee.i=g,ee.id=g.uid,L.scheduler=()=>So(ee),pn(g,!0),k()},P=(g,b,_)=>{b.component=g;const S=g.vnode.props;g.vnode=b,g.next=null,Zd(g,b.props,S,_),tf(g,b.children,_),Gt(),Vo(g),zt()},M=(g,b,_,S,N,R,x,H,L=!1)=>{const k=g&&g.children,ee=g?g.shapeFlag:0,K=b.children,{patchFlag:Z,shapeFlag:se}=b;if(Z>0){if(Z&128){ue(k,K,_,S,N,R,x,H,L);return}else if(Z&256){re(k,K,_,S,N,R,x,H,L);return}}se&8?(ee&16&&Ye(k,N,R),K!==k&&u(_,K)):ee&16?se&16?ue(k,K,_,S,N,R,x,H,L):Ye(k,N,R,!0):(ee&8&&u(_,""),se&16&&q(K,_,S,N,R,x,H,L))},re=(g,b,_,S,N,R,x,H,L)=>{g=g||Vn,b=b||Vn;const k=g.length,ee=b.length,K=Math.min(k,ee);let Z;for(Z=0;Z<K;Z++){const se=b[Z]=L?qt(b[Z]):Nt(b[Z]);m(g[Z],se,_,null,N,R,x,H,L)}k>ee?Ye(g,N,R,!0,!1,K):q(b,_,S,N,R,x,H,L,K)},ue=(g,b,_,S,N,R,x,H,L)=>{let k=0;const ee=b.length;let K=g.length-1,Z=ee-1;for(;k<=K&&k<=Z;){const se=g[k],I=b[k]=L?qt(b[k]):Nt(b[k]);if(En(se,I))m(se,I,_,null,N,R,x,H,L);else break;k++}for(;k<=K&&k<=Z;){const se=g[K],I=b[Z]=L?qt(b[Z]):Nt(b[Z]);if(En(se,I))m(se,I,_,null,N,R,x,H,L);else break;K--,Z--}if(k>K){if(k<=Z){const se=Z+1,I=se<ee?b[se].el:S;for(;k<=Z;)m(null,b[k]=L?qt(b[k]):Nt(b[k]),_,I,N,R,x,H,L),k++}}else if(k>Z)for(;k<=K;)ye(g[k],N,R,!0),k++;else{const se=k,I=k,U=new Map;for(k=I;k<=Z;k++){const st=b[k]=L?qt(b[k]):Nt(b[k]);st.key!=null&&U.set(st.key,k)}let z,ie=0;const fe=Z-I+1;let Ie=!1,ut=0;const dn=new Array(fe);for(k=0;k<fe;k++)dn[k]=0;for(k=se;k<=K;k++){const st=g[k];if(ie>=fe){ye(st,N,R,!0);continue}let St;if(st.key!=null)St=U.get(st.key);else for(z=I;z<=Z;z++)if(dn[z-I]===0&&En(st,b[z])){St=z;break}St===void 0?ye(st,N,R,!0):(dn[St-I]=k+1,St>=ut?ut=St:Ie=!0,m(st,b[St],_,null,N,R,x,H,L),ie++)}const Uo=Ie?of(dn):Vn;for(z=Uo.length-1,k=fe-1;k>=0;k--){const st=I+k,St=b[st],Bo=b[st+1],Ho=st+1<ee?Bo.el||Fc(Bo):S;dn[k]===0?m(null,St,_,Ho,N,R,x,H,L):Ie&&(z<0||k!==Uo[z]?me(St,_,Ho,2):z--)}}},me=(g,b,_,S,N=null)=>{const{el:R,type:x,transition:H,children:L,shapeFlag:k}=g;if(k&6){me(g.component.subTree,b,_,S);return}if(k&128){g.suspense.move(b,_,S);return}if(k&64){x.move(g,b,_,Q);return}if(x===be){r(R,b,_);for(let K=0;K<L.length;K++)me(L[K],b,_,S);r(g.anchor,b,_);return}if(x===gs){v(g,b,_);return}if(S!==2&&k&1&&H)if(S===0)H.beforeEnter(R),r(R,b,_),Xe(()=>H.enter(R),N);else{const{leave:K,delayLeave:Z,afterLeave:se}=H,I=()=>{g.ctx.isUnmounted?s(R):r(R,b,_)},U=()=>{R._isLeaving&&R[xt](!0),K(R,()=>{I(),se&&se()})};Z?Z(R,I,U):U()}else r(R,b,_)},ye=(g,b,_,S=!1,N=!1)=>{const{type:R,props:x,ref:H,children:L,dynamicChildren:k,shapeFlag:ee,patchFlag:K,dirs:Z,cacheIndex:se,memo:I}=g;if(K===-2&&(N=!1),H!=null&&(Gt(),vr(H,null,_,g,!0),zt()),se!=null&&(b.renderCache[se]=void 0),ee&256){b.ctx.deactivate(g);return}const U=ee&1&&Z,z=!Jn(g);let ie;if(z&&(ie=x&&x.onVnodeBeforeUnmount)&&kt(ie,b,g),ee&6)Ue(g.component,_,S);else{if(ee&128){g.suspense.unmount(_,S);return}U&&fn(g,null,b,"beforeUnmount"),ee&64?g.type.remove(g,b,_,Q,S):k&&!k.hasOnce&&(R!==be||K>0&&K&64)?Ye(k,b,_,!1,!0):(R===be&&K&384||!N&&ee&16)&&Ye(L,b,_),S&&qe(g)}const fe=I!=null&&se==null;(z&&(ie=x&&x.onVnodeUnmounted)||U||fe)&&Xe(()=>{ie&&kt(ie,b,g),U&&fn(g,null,b,"unmounted"),fe&&(g.el=null)},_)},qe=g=>{const{type:b,el:_,anchor:S,transition:N}=g;if(b===be){Ne(_,S);return}if(b===gs){T(g);return}const R=()=>{s(_),N&&!N.persisted&&N.afterLeave&&N.afterLeave()};if(g.shapeFlag&1&&N&&!N.persisted){const{leave:x,delayLeave:H}=N,L=()=>x(_,R);H?H(g.el,R,L):L()}else R()},Ne=(g,b)=>{let _;for(;g!==b;)_=d(g),s(g),g=_;s(b)},Ue=(g,b,_)=>{const{bum:S,scope:N,job:R,subTree:x,um:H,m:L,a:k}=g;oa(L),oa(k),S&&fs(S),N.stop(),R&&(R.flags|=8,ye(x,g,b,_)),H&&Xe(H,b),Xe(()=>{g.isUnmounted=!0},b)},Ye=(g,b,_,S=!1,N=!1,R=0)=>{for(let x=R;x<g.length;x++)ye(g[x],b,_,S,N)},O=g=>{if(g.shapeFlag&6)return O(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const b=d(g.anchor||g.el),_=b&&b[bc];return _?d(_):b};let G=!1;const V=(g,b,_)=>{let S;g==null?b._vnode&&(ye(b._vnode,null,null,!0),S=b._vnode.component):m(b._vnode||null,g,b,null,null,null,_),b._vnode=g,G||(G=!0,Vo(S),dc(),G=!1)},Q={p:m,um:ye,m:me,r:qe,mt:ge,mc:q,pc:M,pbc:X,n:O,o:e};return{render:V,hydrate:void 0,createApp:Fd(V)}}function _i({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 pn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function sf(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function To(e,t,n=!1){const r=e.children,s=t.children;if(ne(r)&&ne(s))for(let i=0;i<r.length;i++){const o=r[i];let a=s[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[i]=qt(s[i]),a.el=o.el),!n&&a.patchFlag!==-2&&To(o,a)),a.type===ti&&(a.patchFlag===-1&&(a=s[i]=qt(a)),a.el=o.el),a.type===ze&&!a.el&&(a.el=o.el)}}function of(e){const t=e.slice(),n=[0];let r,s,i,o,a;const l=e.length;for(r=0;r<l;r++){const c=e[r];if(c!==0){if(s=n[n.length-1],e[s]<c){t[r]=s,n.push(r);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[r]=n[i-1]),n[i]=r)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function Hc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Hc(t)}function oa(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Fc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Fc(t.subTree):null}const qc=e=>e.__isSuspense;function af(e,t){t&&t.pendingBranch?ne(e)?t.effects.push(...e):t.effects.push(e):cd(e)}const be=Symbol.for("v-fgt"),ti=Symbol.for("v-txt"),ze=Symbol.for("v-cmt"),gs=Symbol.for("v-stc"),Er=[];let at=null;function Y(e=!1){Er.push(at=e?null:[])}function lf(){Er.pop(),at=Er[Er.length-1]||null}let Ir=1;function Ts(e,t=!1){Ir+=e,e<0&&at&&t&&(at.hasOnce=!0)}function Kc(e){return e.dynamicChildren=Ir>0?at||Vn:null,lf(),Ir>0&&at&&at.push(e),e}function te(e,t,n,r,s,i){return Kc($(e,t,n,r,s,i,!0))}function tr(e,t,n,r,s){return Kc(he(e,t,n,r,s,!0))}function Pr(e){return e?e.__v_isVNode===!0:!1}function En(e,t){return e.type===t.type&&e.key===t.key}const Wc=({key:e})=>e??null,ms=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Te(e)||Oe(e)||le(e)?{i:Ve,r:e,k:t,f:!!n}:e:null);function $(e,t=null,n=null,r=0,s=null,i=e===be?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Wc(t),ref:t&&ms(t),scopeId:pc,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:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ve};return a?(Ro(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=Te(n)?8:16),Ir>0&&!o&&at&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&at.push(l),l}const he=cf;function cf(e,t=null,n=null,r=0,s=null,i=!1){if((!e||e===Pd)&&(e=ze),Pr(e)){const a=un(e,t,!0);return n&&Ro(a,n),Ir>0&&!i&&at&&(a.shapeFlag&6?at[at.indexOf(e)]=a:at.push(a)),a.patchFlag=-2,a}if(wf(e)&&(e=e.__vccOpts),t){t=uf(t);let{class:a,style:l}=t;a&&!Te(a)&&(t.class=yt(a)),we(l)&&(zs(l)&&!ne(l)&&(l=De({},l)),t.style=Vs(l))}const o=Te(e)?1:qc(e)?128:yc(e)?64:we(e)?4:le(e)?2:0;return $(e,t,n,r,s,o,i,!0)}function uf(e){return e?zs(e)||$c(e)?De({},e):e:null}function un(e,t,n=!1,r=!1){const{props:s,ref:i,patchFlag:o,children:a,transition:l}=e,c=t?df(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Wc(c),ref:t&&t.ref?n&&i?ne(i)?i.concat(ms(t)):[i,ms(t)]:ms(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!==be?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&&un(e.ssContent),ssFallback:e.ssFallback&&un(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Nr(u,l.clone(u)),u}function Vc(e=" ",t=0){return he(ti,null,e,t)}function hf(e,t){const n=he(gs,null,e);return n.staticCount=t,n}function rt(e="",t=!1){return t?(Y(),tr(ze,null,e)):he(ze,null,e)}function Nt(e){return e==null||typeof e=="boolean"?he(ze):ne(e)?he(be,null,e.slice()):Pr(e)?qt(e):he(ti,null,String(e))}function qt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:un(e)}function Ro(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ne(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Ro(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!$c(t)?t._ctx=Ve:s===3&&Ve&&(Ve.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else le(t)?(t={default:t,_ctx:Ve},n=32):(t=String(t),r&64?(n=16,t=[Vc(t)]):n=8);e.children=t,e.shapeFlag|=n}function df(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=yt([t.class,r.class]));else if(s==="style")t.style=Vs([t.style,r.style]);else if(Ds(s)){const i=t[s],o=r[s];o&&i!==o&&!(ne(i)&&i.includes(o))?t[s]=i?[].concat(i,o):o:o==null&&i==null&&!Us(s)&&(t[s]=o)}else s!==""&&(t[s]=r[s])}return t}function kt(e,t,n,r=null){wt(e,t,7,[n,r])}const ff=Cc();let pf=0;function gf(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||ff,i={uid:pf++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Kl(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:jc(r,s),emitsOptions:Nc(r,s),emit:null,emitted:null,propsDefaults:Ee,inheritAttrs:r.inheritAttrs,ctx:Ee,data:Ee,props:Ee,attrs:Ee,slots:Ee,refs:Ee,setupState:Ee,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=Kd.bind(null,i),e.ce&&e.ce(i),i}let Je=null;const xo=()=>Je||Ve;let Rs,Wi;{const e=Ws(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),i=>{s.length>1?s.forEach(o=>o(i)):s[0](i)}};Rs=t("__VUE_INSTANCE_SETTERS__",n=>Je=n),Wi=t("__VUE_SSR_SETTERS__",n=>Lr=n)}const Yr=e=>{const t=Je;return Rs(e),e.scope.on(),()=>{e.scope.off(),Rs(t)}},aa=()=>{Je&&Je.scope.off(),Rs(null)};function Gc(e){return e.vnode.shapeFlag&4}let Lr=!1;function mf(e,t=!1,n=!1){t&&Wi(t);const{props:r,children:s}=e.vnode,i=Gc(e);Yd(e,r,i,t),ef(e,s,n||t);const o=i?bf(e,t):void 0;return t&&Wi(!1),o}function bf(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$d);const{setup:r}=n;if(r){Gt();const s=e.setupContext=r.length>1?_f(e):null,i=Yr(e),o=Jr(r,e,0,[e.props,s]),a=jl(o);if(zt(),i(),(a||e.sp)&&!Jn(e)&&kc(e),a){if(o.then(aa,aa),t)return o.then(l=>{la(e,l)}).catch(l=>{Js(l,e,0)});e.asyncDep=o}else la(e,o)}else zc(e)}function la(e,t,n){le(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:we(t)&&(e.setupState=cc(t)),zc(e)}function zc(e,t,n){const r=e.type;e.render||(e.render=r.render||Lt);{const s=Yr(e);Gt();try{Md(e)}finally{zt(),s()}}}const yf={get(e,t){return Ge(e,"get",""),e[t]}};function _f(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,yf),slots:e.slots,emit:e.emit,expose:t}}function ni(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(cc(Eo(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in wr)return wr[n](e)},has(t,n){return n in t||n in wr}})):e.proxy}function vf(e,t=!0){return le(e)?e.displayName||e.name:e.name||t&&e.__name}function wf(e){return le(e)&&"__vccOpts"in e}const Fe=(e,t)=>sd(e,t,Lr);function Oo(e,t,n){try{Ts(-1);const r=arguments.length;return r===2?we(t)&&!ne(t)?Pr(t)?he(e,null,[t]):he(e,t):he(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Pr(n)&&(n=[n]),he(e,t,n))}finally{Ts(1)}}const Ef="3.5.34";/**
|
|
15
|
+
* @vue/runtime-dom v3.5.34
|
|
16
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
17
|
+
* @license MIT
|
|
18
|
+
**/let Vi;const ca=typeof window<"u"&&window.trustedTypes;if(ca)try{Vi=ca.createPolicy("vue",{createHTML:e=>e})}catch{}const Jc=Vi?e=>Vi.createHTML(e):e=>e,Sf="http://www.w3.org/2000/svg",kf="http://www.w3.org/1998/Math/MathML",Bt=typeof document<"u"?document:null,ua=Bt&&Bt.createElement("template"),Af={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Bt.createElementNS(Sf,e):t==="mathml"?Bt.createElementNS(kf,e):n?Bt.createElement(e,{is:n}):Bt.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Bt.createTextNode(e),createComment:e=>Bt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Bt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,i){const o=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{ua.innerHTML=Jc(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=ua.content;if(r==="svg"||r==="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]}},Xt="transition",lr="animation",$r=Symbol("_vtc"),Yc={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},Tf=De({},_c,Yc),Rf=e=>(e.displayName="Transition",e.props=Tf,e),bs=Rf((e,{slots:t})=>Oo(wd,xf(e),t)),gn=(e,t=[])=>{ne(e)?e.forEach(n=>n(...t)):e&&e(...t)},ha=e=>e?ne(e)?e.some(t=>t.length>1):e.length>1:!1;function xf(e){const t={};for(const F in e)F in Yc||(t[F]=e[F]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,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:h=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=e,p=Of(s),m=p&&p[0],w=p&&p[1],{onBeforeEnter:E,onEnter:y,onEnterCancelled:v,onLeave:T,onLeaveCancelled:D,onBeforeAppear:B=E,onAppear:j=y,onAppearCancelled:q=v}=t,C=(F,ce,ge,Ce)=>{F._enterCancelled=Ce,mn(F,ce?u:a),mn(F,ce?c:o),ge&&ge()},X=(F,ce)=>{F._isLeaving=!1,mn(F,h),mn(F,f),mn(F,d),ce&&ce()},ae=F=>(ce,ge)=>{const Ce=F?j:y,A=()=>C(ce,F,ge);gn(Ce,[ce,A]),da(()=>{mn(ce,F?l:i),jt(ce,F?u:a),ha(Ce)||fa(ce,r,m,A)})};return De(t,{onBeforeEnter(F){gn(E,[F]),jt(F,i),jt(F,o)},onBeforeAppear(F){gn(B,[F]),jt(F,l),jt(F,c)},onEnter:ae(!1),onAppear:ae(!0),onLeave(F,ce){F._isLeaving=!0;const ge=()=>X(F,ce);jt(F,h),F._enterCancelled?(jt(F,d),ma(F)):(ma(F),jt(F,d)),da(()=>{F._isLeaving&&(mn(F,h),jt(F,f),ha(T)||fa(F,r,w,ge))}),gn(T,[F,ge])},onEnterCancelled(F){C(F,!1,void 0,!0),gn(v,[F])},onAppearCancelled(F){C(F,!0,void 0,!0),gn(q,[F])},onLeaveCancelled(F){X(F),gn(D,[F])}})}function Of(e){if(e==null)return null;if(we(e))return[vi(e.enter),vi(e.leave)];{const t=vi(e);return[t,t]}}function vi(e){return Eh(e)}function jt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[$r]||(e[$r]=new Set)).add(t)}function mn(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[$r];n&&(n.delete(t),n.size||(e[$r]=void 0))}function da(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Cf=0;function fa(e,t,n,r){const s=e._endId=++Cf,i=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=Nf(e,t);if(!o)return r();const c=o+"end";let u=0;const h=()=>{e.removeEventListener(c,d),i()},d=f=>{f.target===e&&++u>=l&&h()};setTimeout(()=>{u<l&&h()},a+1),e.addEventListener(c,d)}function Nf(e,t){const n=window.getComputedStyle(e),r=p=>(n[p]||"").split(", "),s=r(`${Xt}Delay`),i=r(`${Xt}Duration`),o=pa(s,i),a=r(`${lr}Delay`),l=r(`${lr}Duration`),c=pa(a,l);let u=null,h=0,d=0;t===Xt?o>0&&(u=Xt,h=o,d=i.length):t===lr?c>0&&(u=lr,h=c,d=l.length):(h=Math.max(o,c),u=h>0?o>c?Xt:lr:null,d=u?u===Xt?i.length:l.length:0);const f=u===Xt&&/\b(?:transform|all)(?:,|$)/.test(r(`${Xt}Property`).toString());return{type:u,timeout:h,propCount:d,hasTransform:f}}function pa(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ga(n)+ga(e[r])))}function ga(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ma(e){return(e?e.ownerDocument:document).body.offsetHeight}function If(e,t,n){const r=e[$r];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ba=Symbol("_vod"),Pf=Symbol("_vsh"),Lf=Symbol(""),$f=/(?:^|;)\s*display\s*:/;function Mf(e,t,n){const r=e.style,s=Te(n);let i=!1;if(n&&!s){if(t)if(Te(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&fr(r,a,"")}else for(const o in t)n[o]==null&&fr(r,o,"");for(const o in n){o==="display"&&(i=!0);const a=n[o];a!=null?Df(e,o,!Te(t)&&t?t[o]:void 0,a)||fr(r,o,a):fr(r,o,"")}}else if(s){if(t!==n){const o=r[Lf];o&&(n+=";"+o),r.cssText=n,i=$f.test(n)}}else t&&e.removeAttribute("style");ba in e&&(e[ba]=i?r.display:"",e[Pf]&&(r.display="none"))}const ya=/\s*!important$/;function fr(e,t,n){if(ne(n))n.forEach(r=>fr(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=jf(e,t);ya.test(n)?e.setProperty(hn(r),n.replace(ya,""),"important"):e[r]=n}}const _a=["Webkit","Moz","ms"],wi={};function jf(e,t){const n=wi[t];if(n)return n;let r=tt(t);if(r!=="filter"&&r in e)return wi[t]=r;r=qs(r);for(let s=0;s<_a.length;s++){const i=_a[s]+r;if(i in e)return wi[t]=i}return t}function Df(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Te(r)&&n===r}const va="http://www.w3.org/1999/xlink";function wa(e,t,n,r,s,i=xh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(va,t.slice(6,t.length)):e.setAttributeNS(va,t,n):n==null||i&&!Hl(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ct(n)?String(n):n)}function Ea(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Jc(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=Hl(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(s||t)}function Sn(e,t,n,r){e.addEventListener(t,n,r)}function Uf(e,t,n,r){e.removeEventListener(t,n,r)}const Sa=Symbol("_vei");function Bf(e,t,n,r,s=null){const i=e[Sa]||(e[Sa]={}),o=i[t];if(r&&o)o.value=r;else{const[a,l]=Hf(t);if(r){const c=i[t]=Kf(r,s);Sn(e,a,c,l)}else o&&(Uf(e,a,o,l),i[t]=void 0)}}const ka=/(?:Once|Passive|Capture)$/;function Hf(e){let t;if(ka.test(e)){t={};let r;for(;r=e.match(ka);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):hn(e.slice(2)),t]}let Ei=0;const Ff=Promise.resolve(),qf=()=>Ei||(Ff.then(()=>Ei=0),Ei=Date.now());function Kf(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;wt(Wf(r,n.value),t,5,[r])};return n.value=e,n.attached=qf(),n}function Wf(e,t){if(ne(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const Aa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Vf=(e,t,n,r,s,i)=>{const o=s==="svg";t==="class"?If(e,r,o):t==="style"?Mf(e,n,r):Ds(t)?Us(t)||Bf(e,t,n,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Gf(e,t,r,o))?(Ea(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&wa(e,t,r,o,i,t!=="value")):e._isVueCE&&(zf(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Te(r)))?Ea(e,tt(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),wa(e,t,r,o))};function Gf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Aa(t)&&le(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 s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Aa(t)&&Te(n)?!1:t in e}function zf(e,t){const n=e._def.props;if(!n)return!1;const r=tt(t);return Array.isArray(n)?n.some(s=>tt(s)===r):Object.keys(n).some(s=>tt(s)===r)}const xs=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ne(t)?n=>fs(t,n):t};function Jf(e){e.target.composing=!0}function Ta(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Zn=Symbol("_assign");function Ra(e,t,n){return t&&(e=e.trim()),n&&(e=Ks(e)),e}const Yf={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Zn]=xs(s);const i=r||s.props&&s.props.type==="number";Sn(e,t?"change":"input",o=>{o.target.composing||e[Zn](Ra(e.value,n,i))}),(n||i)&&Sn(e,"change",()=>{e.value=Ra(e.value,n,i)}),t||(Sn(e,"compositionstart",Jf),Sn(e,"compositionend",Ta),Sn(e,"change",Ta))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:i}},o){if(e[Zn]=xs(o),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?Ks(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"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l)}},qv={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const s=Bs(t);Sn(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?Ks(Os(o)):Os(o));e[Zn](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,er(()=>{e._assigning=!1})}),e[Zn]=xs(r)},mounted(e,{value:t}){xa(e,t)},beforeUpdate(e,t,n){e[Zn]=xs(n)},updated(e,{value:t}){e._assigning||xa(e,t)}};function xa(e,t){const n=e.multiple,r=ne(t);if(!(n&&!r&&!Bs(t))){for(let s=0,i=e.options.length;s<i;s++){const o=e.options[s],a=Os(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(c=>String(c)===String(a)):o.selected=Ch(t,a)>-1}else o.selected=t.has(a);else if(Gr(Os(o),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Os(e){return"_value"in e?e._value:e.value}const Zf=["ctrl","shift","alt","meta"],Xf={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)=>Zf.some(n=>e[`${n}Key`]&&!t.includes(n))},Qf=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(s,...i)=>{for(let o=0;o<t.length;o++){const a=Xf[t[o]];if(a&&a(s,t))return}return e(s,...i)})},ep={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Kv=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=s=>{if(!("key"in s))return;const i=hn(s.key);if(t.some(o=>o===i||ep[o]===i))return e(s)})},tp=De({patchProp:Vf},Af);let Oa;function np(){return Oa||(Oa=nf(tp))}const rp=(...e)=>{const t=np().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=ip(r);if(!s)return;const i=t._component;!le(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=n(s,!1,sp(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t};function sp(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ip(e){return Te(e)?document.querySelector(e):e}/*!
|
|
19
|
+
* pinia v2.3.1
|
|
20
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
21
|
+
* @license MIT
|
|
22
|
+
*/let Zc;const ri=e=>Zc=e,Xc=Symbol();function Gi(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Sr;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Sr||(Sr={}));function op(){const e=Wl(!0),t=e.run(()=>Ae({}));let n=[],r=[];const s=Eo({install(i){ri(s),s._a=i,i.provide(Xc,s),i.config.globalProperties.$pinia=s,r.forEach(o=>n.push(o)),r=[]},use(i){return this._a?n.push(i):r.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return s}const Qc=()=>{};function Ca(e,t,n,r=Qc){e.push(t);const s=()=>{const i=e.indexOf(t);i>-1&&(e.splice(i,1),r())};return!n&&Vl()&&Nh(s),s}function In(e,...t){e.slice().forEach(n=>{n(...t)})}const ap=e=>e(),Na=Symbol(),Si=Symbol();function zi(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],s=e[n];Gi(s)&&Gi(r)&&e.hasOwnProperty(n)&&!Oe(r)&&!Vt(r)?e[n]=zi(s,r):e[n]=r}return e}const lp=Symbol();function cp(e){return!Gi(e)||!e.hasOwnProperty(lp)}const{assign:tn}=Object;function up(e){return!!(Oe(e)&&e.effect)}function hp(e,t,n,r){const{state:s,actions:i,getters:o}=t,a=n.state.value[e];let l;function c(){a||(n.state.value[e]=s?s():{});const u=ed(n.state.value[e]);return tn(u,i,Object.keys(o||{}).reduce((h,d)=>(h[d]=Eo(Fe(()=>{ri(n);const f=n._s.get(e);return o[d].call(f,f)})),h),{}))}return l=eu(e,c,t,n,r,!0),l}function eu(e,t,n={},r,s,i){let o;const a=tn({actions:{}},n),l={deep:!0};let c,u,h=[],d=[],f;const p=r.state.value[e];!i&&!p&&(r.state.value[e]={});let m;function w(q){let C;c=u=!1,typeof q=="function"?(q(r.state.value[e]),C={type:Sr.patchFunction,storeId:e,events:f}):(zi(r.state.value[e],q),C={type:Sr.patchObject,payload:q,storeId:e,events:f});const X=m=Symbol();er().then(()=>{m===X&&(c=!0)}),u=!0,In(h,C,r.state.value[e])}const E=i?function(){const{state:C}=n,X=C?C():{};this.$patch(ae=>{tn(ae,X)})}:Qc;function y(){o.stop(),h=[],d=[],r._s.delete(e)}const v=(q,C="")=>{if(Na in q)return q[Si]=C,q;const X=function(){ri(r);const ae=Array.from(arguments),F=[],ce=[];function ge(P){F.push(P)}function Ce(P){ce.push(P)}In(d,{args:ae,name:X[Si],store:D,after:ge,onError:Ce});let A;try{A=q.apply(this&&this.$id===e?this:D,ae)}catch(P){throw In(ce,P),P}return A instanceof Promise?A.then(P=>(In(F,P),P)).catch(P=>(In(ce,P),Promise.reject(P))):(In(F,A),A)};return X[Na]=!0,X[Si]=C,X},T={_p:r,$id:e,$onAction:Ca.bind(null,d),$patch:w,$reset:E,$subscribe(q,C={}){const X=Ca(h,q,C.detached,()=>ae()),ae=o.run(()=>cn(()=>r.state.value[e],F=>{(C.flush==="sync"?u:c)&&q({storeId:e,type:Sr.direct,events:f},F)},tn({},l,C)));return X},$dispose:y},D=zr(T);r._s.set(e,D);const j=(r._a&&r._a.runWithContext||ap)(()=>r._e.run(()=>(o=Wl()).run(()=>t({action:v}))));for(const q in j){const C=j[q];if(Oe(C)&&!up(C)||Vt(C))i||(p&&cp(C)&&(Oe(C)?C.value=p[q]:zi(C,p[q])),r.state.value[e][q]=C);else if(typeof C=="function"){const X=v(C,q);j[q]=X,a.actions[q]=C}}return tn(D,j),tn(pe(D),j),Object.defineProperty(D,"$state",{get:()=>r.state.value[e],set:q=>{w(C=>{tn(C,q)})}}),r._p.forEach(q=>{tn(D,o.run(()=>q({store:D,app:r._a,pinia:r,options:a})))}),p&&i&&n.hydrate&&n.hydrate(D.$state,p),c=!0,u=!0,D}/*! #__NO_SIDE_EFFECTS__ */function tu(e,t,n){let r,s;const i=typeof t=="function";typeof e=="string"?(r=e,s=i?n:t):(s=e,r=e.id);function o(a,l){const c=hd();return a=a||(c?ft(Xc,null):null),a&&ri(a),a=Zc,a._s.has(r)||(i?eu(r,t,s,a):hp(r,s,a)),a._s.get(r)}return o.$id=r,o}/*!
|
|
23
|
+
* vue-router v4.6.4
|
|
24
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
25
|
+
* @license MIT
|
|
26
|
+
*/const Bn=typeof document<"u";function nu(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function dp(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&nu(e.default)}const _e=Object.assign;function ki(e,t){const n={};for(const r in t){const s=t[r];n[r]=Et(s)?s.map(e):e(s)}return n}const kr=()=>{},Et=Array.isArray;function Ia(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const ru=/#/g,fp=/&/g,pp=/\//g,gp=/=/g,mp=/\?/g,su=/\+/g,bp=/%5B/g,yp=/%5D/g,iu=/%5E/g,_p=/%60/g,ou=/%7B/g,vp=/%7C/g,au=/%7D/g,wp=/%20/g;function Co(e){return e==null?"":encodeURI(""+e).replace(vp,"|").replace(bp,"[").replace(yp,"]")}function Ep(e){return Co(e).replace(ou,"{").replace(au,"}").replace(iu,"^")}function Ji(e){return Co(e).replace(su,"%2B").replace(wp,"+").replace(ru,"%23").replace(fp,"%26").replace(_p,"`").replace(ou,"{").replace(au,"}").replace(iu,"^")}function Sp(e){return Ji(e).replace(gp,"%3D")}function kp(e){return Co(e).replace(ru,"%23").replace(mp,"%3F")}function Ap(e){return kp(e).replace(pp,"%2F")}function Mr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Tp=/\/$/,Rp=e=>e.replace(Tp,"");function Ai(e,t,n="/"){let r,s={},i="",o="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),i=t.slice(l,a>0?a:t.length),s=e(i.slice(1))),a>=0&&(r=r||t.slice(0,a),o=t.slice(a,t.length)),r=Np(r??t,n),{fullPath:r+i+o,path:r,query:s,hash:Mr(o)}}function xp(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Pa(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Op(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&nr(t.matched[r],n.matched[s])&&lu(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function nr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function lu(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Cp(e[n],t[n]))return!1;return!0}function Cp(e,t){return Et(e)?La(e,t):Et(t)?La(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function La(e,t){return Et(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Np(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,o,a;for(o=0;o<r.length;o++)if(a=r[o],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(o).join("/")}const Qt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Yi=function(e){return e.pop="pop",e.push="push",e}({}),Ti=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function Ip(e){if(!e)if(Bn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Rp(e)}const Pp=/^[^#]+#/;function Lp(e,t){return e.replace(Pp,"#")+t}function $p(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const si=()=>({left:window.scrollX,top:window.scrollY});function Mp(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=$p(s,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 $a(e,t){return(history.state?history.state.position-t:-1)+e}const Zi=new Map;function jp(e,t){Zi.set(e,t)}function Dp(e){const t=Zi.get(e);return Zi.delete(e),t}function Up(e){return typeof e=="string"||e&&typeof e=="object"}function cu(e){return typeof e=="string"||typeof e=="symbol"}let Re=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const uu=Symbol("");Re.MATCHER_NOT_FOUND+"",Re.NAVIGATION_GUARD_REDIRECT+"",Re.NAVIGATION_ABORTED+"",Re.NAVIGATION_CANCELLED+"",Re.NAVIGATION_DUPLICATED+"";function rr(e,t){return _e(new Error,{type:e,[uu]:!0},t)}function Dt(e,t){return e instanceof Error&&uu in e&&(t==null||!!(e.type&t))}const Bp=["params","query","hash"];function Hp(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Bp)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Fp(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(su," "),i=s.indexOf("="),o=Mr(i<0?s:s.slice(0,i)),a=i<0?null:Mr(s.slice(i+1));if(o in t){let l=t[o];Et(l)||(l=t[o]=[l]),l.push(a)}else t[o]=a}return t}function Ma(e){let t="";for(let n in e){const r=e[n];if(n=Sp(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Et(r)?r.map(s=>s&&Ji(s)):[r&&Ji(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function qp(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Et(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const Kp=Symbol(""),ja=Symbol(""),ii=Symbol(""),No=Symbol(""),Xi=Symbol("");function cr(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function rn(e,t,n,r,s,i=o=>o()){const o=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=d=>{d===!1?l(rr(Re.NAVIGATION_ABORTED,{from:n,to:t})):d instanceof Error?l(d):Up(d)?l(rr(Re.NAVIGATION_GUARD_REDIRECT,{from:t,to:d})):(o&&r.enterCallbacks[s]===o&&typeof d=="function"&&o.push(d),a())},u=i(()=>e.call(r&&r.instances[s],t,n,c));let h=Promise.resolve(u);e.length<3&&(h=h.then(c)),h.catch(d=>l(d))})}function Ri(e,t,n,r,s=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(nu(l)){const c=(l.__vccOpts||l)[t];c&&i.push(rn(c,n,r,o,a,s))}else{let c=l();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const h=dp(u)?u.default:u;o.mods[a]=u,o.components[a]=h;const d=(h.__vccOpts||h)[t];return d&&rn(d,n,r,o,a,s)()}))}}return i}function Wp(e,t){const n=[],r=[],s=[],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=>nr(c,a))?r.push(a):n.push(a));const l=e.matched[o];l&&(t.matched.find(c=>nr(c,l))||s.push(l))}return[n,r,s]}/*!
|
|
27
|
+
* vue-router v4.6.4
|
|
28
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
29
|
+
* @license MIT
|
|
30
|
+
*/let Vp=()=>location.protocol+"//"+location.host;function hu(e,t){const{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let o=s.includes(e.slice(i))?e.slice(i).length:1,a=s.slice(o);return a[0]!=="/"&&(a="/"+a),Pa(a,"")}return Pa(n,e)+r+s}function Gp(e,t,n,r){let s=[],i=[],o=null;const a=({state:d})=>{const f=hu(e,location),p=n.value,m=t.value;let w=0;if(d){if(n.value=f,t.value=d,o&&o===p){o=null;return}w=m?d.position-m.position:0}else r(f);s.forEach(E=>{E(n.value,p,{delta:w,type:Yi.pop,direction:w?w>0?Ti.forward:Ti.back:Ti.unknown})})};function l(){o=n.value}function c(d){s.push(d);const f=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return i.push(f),f}function u(){if(document.visibilityState==="hidden"){const{history:d}=window;if(!d.state)return;d.replaceState(_e({},d.state,{scroll:si()}),"")}}function h(){for(const d of i)d();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:h}}function Da(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?si():null}}function zp(e){const{history:t,location:n}=window,r={value:hu(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,c,u){const h=e.indexOf("#"),d=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+l:Vp()+e+l;try{t[u?"replaceState":"pushState"](c,"",d),s.value=c}catch(f){console.error(f),n[u?"replace":"assign"](d)}}function o(l,c){i(l,_e({},t.state,Da(s.value.back,l,s.value.forward,!0),c,{position:s.value.position}),!0),r.value=l}function a(l,c){const u=_e({},s.value,t.state,{forward:l,scroll:si()});i(u.current,u,!0),i(l,_e({},Da(r.value,l,null),{position:u.position+1},c),!1),r.value=l}return{location:r,state:s,push:a,replace:o}}function Jp(e){e=Ip(e);const t=zp(e),n=Gp(e,t.state,t.location,t.replace);function r(i,o=!0){o||n.pauseListeners(),history.go(i)}const s=_e({location:"",base:e,go:r,createHref:Lp.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let kn=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Me=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Me||{});const Yp={type:kn.Static,value:""},Zp=/[a-zA-Z0-9_]/;function Xp(e){if(!e)return[[]];if(e==="/")return[[Yp]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(f){throw new Error(`ERR (${n})/"${c}": ${f}`)}let n=Me.Static,r=n;const s=[];let i;function o(){i&&s.push(i),i=[]}let a=0,l,c="",u="";function h(){c&&(n===Me.Static?i.push({type:kn.Static,value:c}):n===Me.Param||n===Me.ParamRegExp||n===Me.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:kn.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function d(){c+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Me.ParamRegExp){r=n,n=Me.EscapeNext;continue}switch(n){case Me.Static:l==="/"?(c&&h(),o()):l===":"?(h(),n=Me.Param):d();break;case Me.EscapeNext:d(),n=r;break;case Me.Param:l==="("?n=Me.ParamRegExp:Zp.test(l)?d():(h(),n=Me.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Me.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Me.ParamRegExpEnd:u+=l;break;case Me.ParamRegExpEnd:h(),n=Me.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===Me.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),h(),o(),s}const Ua="[^/]+?",Qp={sensitive:!1,strict:!1,start:!0,end:!0};var Qe=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(Qe||{});const eg=/[.+*?^${}()[\]/\\]/g;function tg(e,t){const n=_e({},Qp,t),r=[];let s=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[Qe.Root];n.strict&&!c.length&&(s+="/");for(let h=0;h<c.length;h++){const d=c[h];let f=Qe.Segment+(n.sensitive?Qe.BonusCaseSensitive:0);if(d.type===kn.Static)h||(s+="/"),s+=d.value.replace(eg,"\\$&"),f+=Qe.Static;else if(d.type===kn.Param){const{value:p,repeatable:m,optional:w,regexp:E}=d;i.push({name:p,repeatable:m,optional:w});const y=E||Ua;if(y!==Ua){f+=Qe.BonusCustomRegExp;try{`${y}`}catch(T){throw new Error(`Invalid custom RegExp for param "${p}" (${y}): `+T.message)}}let v=m?`((?:${y})(?:/(?:${y}))*)`:`(${y})`;h||(v=w&&c.length<2?`(?:/${v})`:"/"+v),w&&(v+="?"),s+=v,f+=Qe.Dynamic,w&&(f+=Qe.BonusOptional),m&&(f+=Qe.BonusRepeatable),y===".*"&&(f+=Qe.BonusWildcard)}u.push(f)}r.push(u)}if(n.strict&&n.end){const c=r.length-1;r[c][r[c].length-1]+=Qe.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const o=new RegExp(s,n.sensitive?"":"i");function a(c){const u=c.match(o),h={};if(!u)return null;for(let d=1;d<u.length;d++){const f=u[d]||"",p=i[d-1];h[p.name]=f&&p.repeatable?f.split("/"):f}return h}function l(c){let u="",h=!1;for(const d of e){(!h||!u.endsWith("/"))&&(u+="/"),h=!1;for(const f of d)if(f.type===kn.Static)u+=f.value;else if(f.type===kn.Param){const{value:p,repeatable:m,optional:w}=f,E=p in c?c[p]:"";if(Et(E)&&!m)throw new Error(`Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`);const y=Et(E)?E.join("/"):E;if(!y)if(w)d.length<2&&(u.endsWith("/")?u=u.slice(0,-1):h=!0);else throw new Error(`Missing required param "${p}"`);u+=y}}return u||"/"}return{re:o,score:r,keys:i,parse:a,stringify:l}}function ng(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Qe.Static+Qe.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Qe.Static+Qe.Segment?1:-1:0}function du(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const i=ng(r[n],s[n]);if(i)return i;n++}if(Math.abs(s.length-r.length)===1){if(Ba(r))return 1;if(Ba(s))return-1}return s.length-r.length}function Ba(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const rg={strict:!1,end:!0,sensitive:!1};function sg(e,t,n){const r=tg(Xp(e.path),n),s=_e(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function ig(e,t){const n=[],r=new Map;t=Ia(rg,t);function s(h){return r.get(h)}function i(h,d,f){const p=!f,m=Fa(h);m.aliasOf=f&&f.record;const w=Ia(t,h),E=[m];if("alias"in h){const T=typeof h.alias=="string"?[h.alias]:h.alias;for(const D of T)E.push(Fa(_e({},m,{components:f?f.record.components:m.components,path:D,aliasOf:f?f.record:m})))}let y,v;for(const T of E){const{path:D}=T;if(d&&D[0]!=="/"){const B=d.record.path,j=B[B.length-1]==="/"?"":"/";T.path=d.record.path+(D&&j+D)}if(y=sg(T,d,w),f?f.alias.push(y):(v=v||y,v!==y&&v.alias.push(y),p&&h.name&&!qa(y)&&o(h.name)),fu(y)&&l(y),m.children){const B=m.children;for(let j=0;j<B.length;j++)i(B[j],y,f&&f.children[j])}f=f||y}return v?()=>{o(v)}:kr}function o(h){if(cu(h)){const d=r.get(h);d&&(r.delete(h),n.splice(n.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=n.indexOf(h);d>-1&&(n.splice(d,1),h.record.name&&r.delete(h.record.name),h.children.forEach(o),h.alias.forEach(o))}}function a(){return n}function l(h){const d=lg(h,n);n.splice(d,0,h),h.record.name&&!qa(h)&&r.set(h.record.name,h)}function c(h,d){let f,p={},m,w;if("name"in h&&h.name){if(f=r.get(h.name),!f)throw rr(Re.MATCHER_NOT_FOUND,{location:h});w=f.record.name,p=_e(Ha(d.params,f.keys.filter(v=>!v.optional).concat(f.parent?f.parent.keys.filter(v=>v.optional):[]).map(v=>v.name)),h.params&&Ha(h.params,f.keys.map(v=>v.name))),m=f.stringify(p)}else if(h.path!=null)m=h.path,f=n.find(v=>v.re.test(m)),f&&(p=f.parse(m),w=f.record.name);else{if(f=d.name?r.get(d.name):n.find(v=>v.re.test(d.path)),!f)throw rr(Re.MATCHER_NOT_FOUND,{location:h,currentLocation:d});w=f.record.name,p=_e({},d.params,h.params),m=f.stringify(p)}const E=[];let y=f;for(;y;)E.unshift(y.record),y=y.parent;return{name:w,path:m,params:p,matched:E,meta:ag(E)}}e.forEach(h=>i(h));function u(){n.length=0,r.clear()}return{addRoute:i,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Ha(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Fa(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:og(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 og(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function qa(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ag(e){return e.reduce((t,n)=>_e(t,n.meta),{})}function lg(e,t){let n=0,r=t.length;for(;n!==r;){const i=n+r>>1;du(e,t[i])<0?r=i:n=i+1}const s=cg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function cg(e){let t=e;for(;t=t.parent;)if(fu(t)&&du(e,t)===0)return t}function fu({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ka(e){const t=ft(ii),n=ft(No),r=Fe(()=>{const l=He(e.to);return t.resolve(l)}),s=Fe(()=>{const{matched:l}=r.value,{length:c}=l,u=l[c-1],h=n.matched;if(!u||!h.length)return-1;const d=h.findIndex(nr.bind(null,u));if(d>-1)return d;const f=Wa(l[c-2]);return c>1&&Wa(u)===f&&h[h.length-1].path!==f?h.findIndex(nr.bind(null,l[c-2])):d}),i=Fe(()=>s.value>-1&&fg(n.params,r.value.params)),o=Fe(()=>s.value>-1&&s.value===n.matched.length-1&&lu(n.params,r.value.params));function a(l={}){if(dg(l)){const c=t[He(e.replace)?"replace":"push"](He(e.to)).catch(kr);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:Fe(()=>r.value.href),isActive:i,isExactActive:o,navigate:a}}function ug(e){return e.length===1?e[0]:e}const hg=On({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:Ka,setup(e,{slots:t}){const n=zr(Ka(e)),{options:r}=ft(ii),s=Fe(()=>({[Va(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Va(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&ug(t.default(n));return e.custom?i:Oo("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),ys=hg;function dg(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 fg(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!Et(s)||s.length!==r.length||r.some((i,o)=>i.valueOf()!==s[o].valueOf()))return!1}return!0}function Wa(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Va=(e,t,n)=>e??t??n,pg=On({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=ft(Xi),s=Fe(()=>e.route||r.value),i=ft(ja,0),o=Fe(()=>{let c=He(i);const{matched:u}=s.value;let h;for(;(h=u[c])&&!h.components;)c++;return c}),a=Fe(()=>s.value.matched[o.value]);ps(ja,Fe(()=>o.value+1)),ps(Kp,a),ps(Xi,s);const l=Ae();return cn(()=>[l.value,a.value,e.name],([c,u,h],[d,f,p])=>{u&&(u.instances[h]=c,f&&f!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=f.leaveGuards),u.updateGuards.size||(u.updateGuards=f.updateGuards))),c&&u&&(!f||!nr(u,f)||!d)&&(u.enterCallbacks[h]||[]).forEach(m=>m(c))},{flush:"post"}),()=>{const c=s.value,u=e.name,h=a.value,d=h&&h.components[u];if(!d)return Ga(n.default,{Component:d,route:c});const f=h.props[u],p=f?f===!0?c.params:typeof f=="function"?f(c):f:null,w=Oo(d,_e({},p,t,{onVnodeUnmounted:E=>{E.component.isUnmounted&&(h.instances[u]=null)},ref:l}));return Ga(n.default,{Component:w,route:c})||w}}});function Ga(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Qi=pg;function gg(e){const t=ig(e.routes,e),n=e.parseQuery||Fp,r=e.stringifyQuery||Ma,s=e.history,i=cr(),o=cr(),a=cr(),l=Zh(Qt);let c=Qt;Bn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=ki.bind(null,O=>""+O),h=ki.bind(null,Ap),d=ki.bind(null,Mr);function f(O,G){let V,Q;return cu(O)?(V=t.getRecordMatcher(O),Q=G):Q=O,t.addRoute(Q,V)}function p(O){const G=t.getRecordMatcher(O);G&&t.removeRoute(G)}function m(){return t.getRoutes().map(O=>O.record)}function w(O){return!!t.getRecordMatcher(O)}function E(O,G){if(G=_e({},G||l.value),typeof O=="string"){const _=Ai(n,O,G.path),S=t.resolve({path:_.path},G),N=s.createHref(_.fullPath);return _e(_,S,{params:d(S.params),hash:Mr(_.hash),redirectedFrom:void 0,href:N})}let V;if(O.path!=null)V=_e({},O,{path:Ai(n,O.path,G.path).path});else{const _=_e({},O.params);for(const S in _)_[S]==null&&delete _[S];V=_e({},O,{params:h(_)}),G.params=h(G.params)}const Q=t.resolve(V,G),de=O.hash||"";Q.params=u(d(Q.params));const g=xp(r,_e({},O,{hash:Ep(de),path:Q.path})),b=s.createHref(g);return _e({fullPath:g,hash:de,query:r===Ma?qp(O.query):O.query||{}},Q,{redirectedFrom:void 0,href:b})}function y(O){return typeof O=="string"?Ai(n,O,l.value.path):_e({},O)}function v(O,G){if(c!==O)return rr(Re.NAVIGATION_CANCELLED,{from:G,to:O})}function T(O){return j(O)}function D(O){return T(_e(y(O),{replace:!0}))}function B(O,G){const V=O.matched[O.matched.length-1];if(V&&V.redirect){const{redirect:Q}=V;let de=typeof Q=="function"?Q(O,G):Q;return typeof de=="string"&&(de=de.includes("?")||de.includes("#")?de=y(de):{path:de},de.params={}),_e({query:O.query,hash:O.hash,params:de.path!=null?{}:O.params},de)}}function j(O,G){const V=c=E(O),Q=l.value,de=O.state,g=O.force,b=O.replace===!0,_=B(V,Q);if(_)return j(_e(y(_),{state:typeof _=="object"?_e({},de,_.state):de,force:g,replace:b}),G||V);const S=V;S.redirectedFrom=G;let N;return!g&&Op(r,Q,V)&&(N=rr(Re.NAVIGATION_DUPLICATED,{to:S,from:Q}),me(Q,Q,!0,!1)),(N?Promise.resolve(N):X(S,Q)).catch(R=>Dt(R)?Dt(R,Re.NAVIGATION_GUARD_REDIRECT)?R:ue(R):M(R,S,Q)).then(R=>{if(R){if(Dt(R,Re.NAVIGATION_GUARD_REDIRECT))return j(_e({replace:b},y(R.to),{state:typeof R.to=="object"?_e({},de,R.to.state):de,force:g}),G||S)}else R=F(S,Q,!0,b,de);return ae(S,Q,R),R})}function q(O,G){const V=v(O,G);return V?Promise.reject(V):Promise.resolve()}function C(O){const G=Ne.values().next().value;return G&&typeof G.runWithContext=="function"?G.runWithContext(O):O()}function X(O,G){let V;const[Q,de,g]=Wp(O,G);V=Ri(Q.reverse(),"beforeRouteLeave",O,G);for(const _ of Q)_.leaveGuards.forEach(S=>{V.push(rn(S,O,G))});const b=q.bind(null,O,G);return V.push(b),Ye(V).then(()=>{V=[];for(const _ of i.list())V.push(rn(_,O,G));return V.push(b),Ye(V)}).then(()=>{V=Ri(de,"beforeRouteUpdate",O,G);for(const _ of de)_.updateGuards.forEach(S=>{V.push(rn(S,O,G))});return V.push(b),Ye(V)}).then(()=>{V=[];for(const _ of g)if(_.beforeEnter)if(Et(_.beforeEnter))for(const S of _.beforeEnter)V.push(rn(S,O,G));else V.push(rn(_.beforeEnter,O,G));return V.push(b),Ye(V)}).then(()=>(O.matched.forEach(_=>_.enterCallbacks={}),V=Ri(g,"beforeRouteEnter",O,G,C),V.push(b),Ye(V))).then(()=>{V=[];for(const _ of o.list())V.push(rn(_,O,G));return V.push(b),Ye(V)}).catch(_=>Dt(_,Re.NAVIGATION_CANCELLED)?_:Promise.reject(_))}function ae(O,G,V){a.list().forEach(Q=>C(()=>Q(O,G,V)))}function F(O,G,V,Q,de){const g=v(O,G);if(g)return g;const b=G===Qt,_=Bn?history.state:{};V&&(Q||b?s.replace(O.fullPath,_e({scroll:b&&_&&_.scroll},de)):s.push(O.fullPath,de)),l.value=O,me(O,G,V,b),ue()}let ce;function ge(){ce||(ce=s.listen((O,G,V)=>{if(!Ue.listening)return;const Q=E(O),de=B(Q,Ue.currentRoute.value);if(de){j(_e(de,{replace:!0,force:!0}),Q).catch(kr);return}c=Q;const g=l.value;Bn&&jp($a(g.fullPath,V.delta),si()),X(Q,g).catch(b=>Dt(b,Re.NAVIGATION_ABORTED|Re.NAVIGATION_CANCELLED)?b:Dt(b,Re.NAVIGATION_GUARD_REDIRECT)?(j(_e(y(b.to),{force:!0}),Q).then(_=>{Dt(_,Re.NAVIGATION_ABORTED|Re.NAVIGATION_DUPLICATED)&&!V.delta&&V.type===Yi.pop&&s.go(-1,!1)}).catch(kr),Promise.reject()):(V.delta&&s.go(-V.delta,!1),M(b,Q,g))).then(b=>{b=b||F(Q,g,!1),b&&(V.delta&&!Dt(b,Re.NAVIGATION_CANCELLED)?s.go(-V.delta,!1):V.type===Yi.pop&&Dt(b,Re.NAVIGATION_ABORTED|Re.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ae(Q,g,b)}).catch(kr)}))}let Ce=cr(),A=cr(),P;function M(O,G,V){ue(O);const Q=A.list();return Q.length?Q.forEach(de=>de(O,G,V)):console.error(O),Promise.reject(O)}function re(){return P&&l.value!==Qt?Promise.resolve():new Promise((O,G)=>{Ce.add([O,G])})}function ue(O){return P||(P=!O,ge(),Ce.list().forEach(([G,V])=>O?V(O):G()),Ce.reset()),O}function me(O,G,V,Q){const{scrollBehavior:de}=e;if(!Bn||!de)return Promise.resolve();const g=!V&&Dp($a(O.fullPath,0))||(Q||!V)&&history.state&&history.state.scroll||null;return er().then(()=>de(O,G,g)).then(b=>b&&Mp(b)).catch(b=>M(b,O,G))}const ye=O=>s.go(O);let qe;const Ne=new Set,Ue={currentRoute:l,listening:!0,addRoute:f,removeRoute:p,clearRoutes:t.clearRoutes,hasRoute:w,getRoutes:m,resolve:E,options:e,push:T,replace:D,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:i.add,beforeResolve:o.add,afterEach:a.add,onError:A.add,isReady:re,install(O){O.component("RouterLink",ys),O.component("RouterView",Qi),O.config.globalProperties.$router=Ue,Object.defineProperty(O.config.globalProperties,"$route",{enumerable:!0,get:()=>He(l)}),Bn&&!qe&&l.value===Qt&&(qe=!0,T(s.location).catch(Q=>{}));const G={};for(const Q in Qt)Object.defineProperty(G,Q,{get:()=>l.value[Q],enumerable:!0});O.provide(ii,Ue),O.provide(No,ac(G)),O.provide(Xi,l);const V=O.unmount;Ne.add(O),O.unmount=function(){Ne.delete(O),Ne.size<1&&(c=Qt,ce&&ce(),ce=null,l.value=Qt,qe=!1,P=!1),V()}}};function Ye(O){return O.reduce((G,V)=>G.then(()=>C(V)),Promise.resolve())}return Ue}function Wv(){return ft(ii)}function pu(e){return ft(No)}const mg={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},bg={key:4,d:"M5 6.5A2.5 2.5 0 0 1 7.5 4h9A2.5 2.5 0 0 1 19 6.5v6A2.5 2.5 0 0 1 16.5 15H10l-4 4v-4.2A2.5 2.5 0 0 1 5 12.5Z"},yg={key:5,d:"M4 12h4l2.2-5 3.6 10 2.2-5H20"},_g={key:8,d:"m6 9 6 6 6-6"},vg={key:9,d:"m6 15 6-6 6 6"},wg={key:10,d:"m9 6 6 6-6 6"},Eg={key:14,d:"M13 2 5 13h5l-1 9 8-11h-5Z"},Sg={key:18,cx:"12",cy:"12",r:"4.25",fill:"currentColor",stroke:"none"},it=On({__name:"AppIcon",props:{name:{}},setup(e){return(t,n)=>(Y(),te("svg",mg,[e.name==="grid"?(Y(),te(be,{key:0},[n[0]||(n[0]=$("rect",{x:"4",y:"4",width:"6",height:"6",rx:"1.5"},null,-1)),n[1]||(n[1]=$("rect",{x:"14",y:"4",width:"6",height:"6",rx:"1.5"},null,-1)),n[2]||(n[2]=$("rect",{x:"4",y:"14",width:"6",height:"6",rx:"1.5"},null,-1)),n[3]||(n[3]=$("rect",{x:"14",y:"14",width:"6",height:"6",rx:"1.5"},null,-1))],64)):e.name==="book"?(Y(),te(be,{key:1},[n[4]||(n[4]=$("path",{d:"M5 5.5a2.5 2.5 0 0 1 2.5-2.5H20v17H7.5A2.5 2.5 0 0 0 5 22Z"},null,-1)),n[5]||(n[5]=$("path",{d:"M5 5.5V22"},null,-1)),n[6]||(n[6]=$("path",{d:"M9 7h7"},null,-1))],64)):e.name==="settings"?(Y(),te(be,{key:2},[n[7]||(n[7]=$("circle",{cx:"12",cy:"12",r:"3.25"},null,-1)),n[8]||(n[8]=$("path",{d:"M19.4 15a1 1 0 0 0 .2 1.1l.1.1a1.9 1.9 0 0 1 0 2.7 1.9 1.9 0 0 1-2.7 0l-.1-.1a1 1 0 0 0-1.1-.2 1 1 0 0 0-.6.9V20a2 2 0 0 1-4 0v-.2a1 1 0 0 0-.6-.9 1 1 0 0 0-1.1.2l-.1.1a1.9 1.9 0 0 1-2.7 0 1.9 1.9 0 0 1 0-2.7l.1-.1a1 1 0 0 0 .2-1.1 1 1 0 0 0-.9-.6H4a2 2 0 0 1 0-4h.2a1 1 0 0 0 .9-.6 1 1 0 0 0-.2-1.1l-.1-.1a1.9 1.9 0 0 1 0-2.7 1.9 1.9 0 0 1 2.7 0l.1.1a1 1 0 0 0 1.1.2 1 1 0 0 0 .6-.9V4a2 2 0 0 1 4 0v.2a1 1 0 0 0 .6.9 1 1 0 0 0 1.1-.2l.1-.1a1.9 1.9 0 0 1 2.7 0 1.9 1.9 0 0 1 0 2.7l-.1.1a1 1 0 0 0-.2 1.1 1 1 0 0 0 .9.6H20a2 2 0 0 1 0 4h-.2a1 1 0 0 0-.9.6Z"},null,-1))],64)):e.name==="terminal"?(Y(),te(be,{key:3},[n[9]||(n[9]=$("path",{d:"M4 6h16v12H4z",rx:"2"},null,-1)),n[10]||(n[10]=$("path",{d:"m8 10 2 2-2 2"},null,-1)),n[11]||(n[11]=$("path",{d:"M12.5 16H16"},null,-1))],64)):e.name==="message"?(Y(),te("path",bg)):e.name==="activity"?(Y(),te("path",yg)):e.name==="sparkles"?(Y(),te(be,{key:6},[n[12]||(n[12]=$("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5Z"},null,-1)),n[13]||(n[13]=$("path",{d:"m19 14 .7 2.1L22 16.8l-2.3.7L19 20l-.7-2.5-2.3-.7 2.3-.7Z"},null,-1)),n[14]||(n[14]=$("path",{d:"m5 15 .8 2.3L8 18l-2.2.7L5 21l-.8-2.3L2 18l2.2-.7Z"},null,-1))],64)):e.name==="git-branch"?(Y(),te(be,{key:7},[n[15]||(n[15]=$("path",{d:"M6 4v9a3 3 0 1 0 2 2.8V8h8"},null,-1)),n[16]||(n[16]=$("path",{d:"M16 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1)),n[17]||(n[17]=$("path",{d:"M8 16a3 3 0 1 0-4 2.8"},null,-1))],64)):e.name==="chevron-down"?(Y(),te("path",_g)):e.name==="chevron-up"?(Y(),te("path",vg)):e.name==="chevron-right"?(Y(),te("path",wg)):e.name==="plus"?(Y(),te(be,{key:11},[n[18]||(n[18]=$("path",{d:"M12 5v14"},null,-1)),n[19]||(n[19]=$("path",{d:"M5 12h14"},null,-1))],64)):e.name==="trash"?(Y(),te(be,{key:12},[n[20]||(n[20]=hf('<path d="M4 7h16"></path><path d="M10 11v6"></path><path d="M14 11v6"></path><path d="M6 7l1 12h10l1-12"></path><path d="M9 7V4h6v3"></path>',5))],64)):e.name==="x"?(Y(),te(be,{key:13},[n[21]||(n[21]=$("path",{d:"M6 6l12 12"},null,-1)),n[22]||(n[22]=$("path",{d:"M18 6 6 18"},null,-1))],64)):e.name==="zap"?(Y(),te("path",Eg)):e.name==="calendar"?(Y(),te(be,{key:15},[n[23]||(n[23]=$("rect",{x:"3.5",y:"5",width:"17",height:"15.5",rx:"2"},null,-1)),n[24]||(n[24]=$("path",{d:"M7 3v4"},null,-1)),n[25]||(n[25]=$("path",{d:"M17 3v4"},null,-1)),n[26]||(n[26]=$("path",{d:"M3.5 9.5h17"},null,-1))],64)):e.name==="inbox"?(Y(),te(be,{key:16},[n[27]||(n[27]=$("path",{d:"M4 6h16l-2 10H6Z"},null,-1)),n[28]||(n[28]=$("path",{d:"M8 12h8"},null,-1)),n[29]||(n[29]=$("path",{d:"M7 16h10"},null,-1))],64)):e.name==="server"?(Y(),te(be,{key:17},[n[30]||(n[30]=$("rect",{x:"4",y:"4",width:"16",height:"6",rx:"1.5"},null,-1)),n[31]||(n[31]=$("rect",{x:"4",y:"14",width:"16",height:"6",rx:"1.5"},null,-1)),n[32]||(n[32]=$("path",{d:"M8 7h.01"},null,-1)),n[33]||(n[33]=$("path",{d:"M8 17h.01"},null,-1))],64)):e.name==="circle"?(Y(),te("circle",Sg)):rt("",!0)]))}});function oi(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function kg(e,t,n,r){function s(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(r.next(u))}catch(h){o(h)}}function l(u){try{c(r.throw(u))}catch(h){o(h)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}const Ag=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Io extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class Tg extends Io{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class za extends Io{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Ja extends Io{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var eo;(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"})(eo||(eo={}));class Rg{constructor(t,{headers:n={},customFetch:r,region:s=eo.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=Ag(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return kg(this,arguments,void 0,function*(n,r={}){var s;let i,o;try{const{headers:a,method:l,body:c,signal:u,timeout:h}=r;let d={},{region:f}=r;f||(f=this.region);const p=new URL(`${this.url}/${n}`);f&&f!=="any"&&(d["x-region"]=f,p.searchParams.set("forceFunctionRegion",f));let m;c&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",m=c):typeof c=="string"?(d["Content-Type"]="text/plain",m=c):typeof FormData<"u"&&c instanceof FormData?m=c:(d["Content-Type"]="application/json",m=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?m=JSON.stringify(c):m=c;let w=u;h&&(o=new AbortController,i=setTimeout(()=>o.abort(),h),u?(w=o.signal,u.addEventListener("abort",()=>o.abort())):w=o.signal);const E=yield this.fetch(p.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),a),body:m,signal:w}).catch(D=>{throw new Tg(D)}),y=E.headers.get("x-relay-error");if(y&&y==="true")throw new za(E);if(!E.ok)throw new Ja(E);let v=((s=E.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),T;return v==="application/json"?T=yield E.json():v==="application/octet-stream"||v==="application/pdf"?T=yield E.blob():v==="text/event-stream"?T=E:v==="multipart/form-data"?T=yield E.formData():T=yield E.text(),{data:T,error:null,response:E}}catch(a){return{data:null,error:a,response:a instanceof Ja||a instanceof za?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const gu=3,Ya=e=>Math.min(1e3*2**e,3e4),xg=[520,503],mu=["GET","HEAD","OPTIONS"];var Og=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 Za(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const r=setTimeout(()=>{t==null||t.removeEventListener("abort",s),n()},e);function s(){clearTimeout(r),n()}t==null||t.addEventListener("abort",s)})}function Cg(e,t,n,r){return!(!r||n>=gu||!mu.includes(e)||!xg.includes(t))}var Ng=class{constructor(e){var t,n,r,s,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=(r=e.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s: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 r=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 r(n.url.toString(),{method:n.method,headers:c,body:JSON.stringify(n.body,(h,d)=>typeof d=="bigint"?d.toString():d),signal:n.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!mu.includes(n.method))throw h;if(n.retryEnabled&&o<gu){const d=Ya(o);o++,await Za(d,n.signal);continue}throw h}if(Cg(n.method,u.status,o,n.retryEnabled)){var a,l;const h=(a=(l=u.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,d=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:Ya(o);await u.text(),o++,await Za(d,n.signal);continue}return await n.processResponse(u)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var a;let l="",c="",u="";const h=o==null?void 0:o.cause;if(h){var d,f,p,m;const y=(d=h==null?void 0:h.message)!==null&&d!==void 0?d:"",v=(f=h==null?void 0:h.code)!==null&&f!==void 0?f:"";l=`${(p=o==null?void 0:o.name)!==null&&p!==void 0?p:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
|
|
31
|
+
|
|
32
|
+
Caused by: ${(m=h==null?void 0:h.name)!==null&&m!==void 0?m:"Error"}: ${y}`,v&&(l+=` (${v})`),h!=null&&h.stack&&(l+=`
|
|
33
|
+
${h.stack}`)}else{var w;l=(w=o==null?void 0:o.stack)!==null&&w!==void 0?w:""}const E=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)",E>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${E} 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.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",E>this.urlLengthLimit&&(c+=`. Your request URL is ${E} 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,r=null,s=null,i=e.status,o=e.statusText;if(e.ok){var a,l;if(t.method!=="HEAD"){var c;const d=await e.text();d===""||(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"))?r=d:r=JSON.parse(d))}const u=(a=t.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),h=(l=e.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");u&&h&&h.length>1&&(s=parseInt(h[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,i=406,o="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const u=await e.text();try{n=JSON.parse(u),Array.isArray(n)&&e.status===404&&(r=[],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 Og(n)}return{success:n===null,error:n,data:r,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},Ig=class extends Ng{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const i=s?`${s}.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 r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${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:r=!1,wal:s=!1,format:i="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"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 Xa=new RegExp("[,()]");var Hn=class extends Ig{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(r=>typeof r=="string"&&Xa.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&Xa.test(r)?`"${r}"`:`${r}`).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:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const i=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}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 r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},Pg=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=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),r&&l.append("Prefer",`count=${r}`),new Hn({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="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 Hn({method:s,url:i,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!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),r&&l.append("Prefer",`count=${r}`),s||l.append("Prefer","missing=default"),Array.isArray(e)){const c=e.reduce((u,h)=>u.concat(Object.keys(h)),[]);if(c.length>0){const u=[...new Set(c)].map(h=>`"${h}"`);a.searchParams.set("columns",u.join(","))}}return new Hn({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 r="PATCH",{url:s,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new Hn({method:r,url:s,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:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Hn({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function jr(e){"@babel/helpers - typeof";return jr=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},jr(e)}function Lg(e,t){if(jr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $g(e){var t=Lg(e,"string");return jr(t)=="symbol"?t:t+""}function Mg(e,t,n){return(t=$g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ns(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qa(Object(n),!0).forEach(function(r){Mg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qa(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var jg=class bu{constructor(t,{headers:n={},schema:r,fetch:s,timeout:i,urlLengthLimit:o=8e3,retry:a}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=o;const l=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(c,u)=>{const h=new AbortController,d=setTimeout(()=>h.abort(),i),f=u==null?void 0:u.signal;if(f){if(f.aborted)return clearTimeout(d),l(c,u);const p=()=>{clearTimeout(d),h.abort()};return f.addEventListener("abort",p,{once:!0}),l(c,ns(ns({},u),{},{signal:h.signal})).finally(()=>{clearTimeout(d),f.removeEventListener("abort",p)})}return l(c,ns(ns({},u),{},{signal:h.signal})).finally(()=>clearTimeout(d))}: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 bu(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:r=!1,get:s=!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)),h=r&&Object.values(n).some(u);h?(a="POST",c=n):r||s?(a=r?"HEAD":"GET",Object.entries(n).filter(([f,p])=>p!==void 0).map(([f,p])=>[f,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([f,p])=>{l.searchParams.append(f,p)})):(a="POST",c=n);const d=new Headers(this.headers);return h?d.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&d.set("Prefer",`count=${i}`),new Hn({method:a,url:l,headers:d,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class Dg{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 r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.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 s=globalThis.process;if(s){const i=s.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:
|
|
34
|
+
import ws from "ws"
|
|
35
|
+
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+=`
|
|
36
|
+
|
|
37
|
+
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 Ug="2.105.4",Bg=`realtime-js/${Ug}`,Hg="1.0.0",yu="2.0.0",Fg=yu,qg=1e4,Kg=100,sn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},_u={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},to={connecting:"connecting",closing:"closing",closed:"closed"};class Wg{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 r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_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,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,r){var s,i;const o=t.topic,a=(s=t.ref)!==null&&s!==void 0?s:"",l=(i=t.join_ref)!==null&&i!==void 0?i:"",c=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=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(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const d=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+c.length+h.length,f=new ArrayBuffer(this.HEADER_LENGTH+d);let p=new DataView(f),m=0;p.setUint8(m++,this.KINDS.userBroadcastPush),p.setUint8(m++,l.length),p.setUint8(m++,a.length),p.setUint8(m++,o.length),p.setUint8(m++,c.length),p.setUint8(m++,h.length),p.setUint8(m++,n),Array.from(l,E=>p.setUint8(m++,E.charCodeAt(0))),Array.from(a,E=>p.setUint8(m++,E.charCodeAt(0))),Array.from(o,E=>p.setUint8(m++,E.charCodeAt(0))),Array.from(c,E=>p.setUint8(m++,E.charCodeAt(0))),Array.from(h,E=>p.setUint8(m++,E.charCodeAt(0)));var w=new Uint8Array(f.byteLength+r.byteLength);return w.set(new Uint8Array(f),0),w.set(new Uint8Array(r),f.byteLength),w.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,i,o,a,l]=r;return n({join_ref:s,ref:i,topic:o,event:a,payload:l})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,s)}}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),a=n.getUint8(4);let l=this.HEADER_LENGTH+4;const c=r.decode(t.slice(l,l+s));l=l+s;const u=r.decode(t.slice(l,l+i));l=l+i;const h=r.decode(t.slice(l,l+o));l=l+o;const d=t.slice(l,t.byteLength),f=a===this.JSON_ENCODING?JSON.parse(r.decode(d)):d,p={type:this.BROADCAST_EVENT,event:u,payload:f};return o>0&&(p.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_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(([r])=>n.includes(r)))}}var Se;(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"})(Se||(Se={}));const el=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=Vg(o,e,t,s),i),{}):{}},Vg=(e,t,n,r)=>{const s=t.find(a=>a.name===e),i=s==null?void 0:s.type,o=n[e];return i&&!r.includes(i)?vu(i,o):no(o)},vu=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return Yg(t,n)}switch(e){case Se.bool:return Gg(t);case Se.float4:case Se.float8:case Se.int2:case Se.int4:case Se.int8:case Se.numeric:case Se.oid:return zg(t);case Se.json:case Se.jsonb:return Jg(t);case Se.timestamp:return Zg(t);case Se.abstime:case Se.date:case Se.daterange:case Se.int4range:case Se.int8range:case Se.money:case Se.reltime:case Se.text:case Se.time:case Se.timestamptz:case Se.timetz:case Se.tsrange:case Se.tstzrange:return no(t);default:return no(t)}},no=e=>e,Gg=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},zg=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Jg=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},Yg=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>vu(t,a))}return e},Zg=e=>typeof e=="string"?e.replace(" ","T"):e,wu=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 Ar=e=>typeof e=="function"?e:function(){return e},Xg=typeof self<"u"?self:null,Fn=typeof window<"u"?window:null,Ot=Xg||Fn||globalThis,Qg="2.0.0",em=1e4,tm=1e3,It={connecting:0,open:1,closing:2,closed:3},nt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ht={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},ro={longpoll:"longpoll",websocket:"websocket"},nm={complete:4},so="base64url.bearer.phx.",rs=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,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(r=>r.status===e).forEach(r=>r.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})}},Eu=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))}},rm=class{constructor(e,t,n){this.state=nt.closed,this.topic=e,this.params=Ar(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new rs(this,Ht.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Eu(()=>{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=nt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=nt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=nt.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=nt.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 rs(this,Ht.leave,Ar({}),this.timeout).send(),this.state=nt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ht.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}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=nt.closed,this.bindings=[]}onClose(e){this.on(Ht.close,e)}onError(e){return this.on(Ht.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 r=new rs(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=nt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ht.close,"leave")},n=new rs(this,Ht.leave,Ar({}),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,r){return this.topic!==e?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=nt.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let s=this.onMessage(e,t,n,r);if(t&&!s)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(s,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===nt.closed}isErrored(){return this.state===nt.errored}isJoined(){return this.state===nt.joined}isJoining(){return this.state===nt.joining}isLeaving(){return this.state===nt.leaving}},Cs=class{static request(e,t,n,r,s,i,o){if(Ot.XDomainRequest){let a=new Ot.XDomainRequest;return this.xdomainRequest(a,e,t,r,s,i,o)}else if(Ot.XMLHttpRequest){let a=new Ot.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,s,i,o)}else{if(Ot.fetch&&Ot.AbortController)return this.fetchRequest(e,t,n,r,s,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,r,s,i,o){let a={method:e,headers:n,body:r},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),a.signal=l.signal),Ot.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,r,s,i,o){return e.timeout=s,e.open(t,n),e.onload=()=>{let a=this.parseJSON(e.responseText);o&&o(a)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,s,i,o,a){e.open(t,n,!0),e.timeout=i;for(let[l,c]of Object.entries(r))e.setRequestHeader(l,c);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===nm.complete&&a){let l=this.parseJSON(e.responseText);a(l)}},o&&(e.ontimeout=o),e.send(s),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 r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let s=t?`${t}[${r}]`:r,i=e[r];typeof i=="object"?n.push(this.serialize(i,s)):n.push(encodeURIComponent(s)+"="+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)}`}},sm=e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let s=0;s<r;s++)t+=String.fromCharCode(n[s]);return btoa(t)},Pn=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(so)&&(this.authToken=atob(t[1].slice(so.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=It.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+ro.websocket),"$1/"+ro.longpoll)}endpointURL(){return Cs.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=It.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===It.open||this.readyState===It.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:r,messages:s}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=It.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=sm(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(`
|
|
38
|
+
`),()=>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 s of this.reqs)s.abort();this.readyState=It.closed;let r=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",r)):this.onclose(r)}ajax(e,t,n,r,s){let i,o=()=>{this.reqs.delete(i),r()};i=Cs.request(e,this.endpointURL(),t,n,this.timeout,o,a=>{this.reqs.delete(i),this.isActive()&&s(a)}),this.reqs.add(i)}},im=class pr{constructor(t,n={}){let r=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(r.state,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=pr.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=pr.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel.on(r.diff,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=pr.syncDiff(this.state,s,i,o),a())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return pr.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,r,s){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 h=c.metas.map(m=>m.phx_ref),d=u.metas.map(m=>m.phx_ref),f=c.metas.filter(m=>d.indexOf(m.phx_ref)<0),p=u.metas.filter(m=>h.indexOf(m.phx_ref)<0);f.length>0&&(o[l]=c,o[l].metas=f),p.length>0&&(a[l]=this.clone(u),a[l].metas=p)}else o[l]=c}),this.syncDiff(i,{joins:o,leaves:a},r,s)}static syncDiff(t,n,r,s){let{joins:i,leaves:o}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(i,(a,l)=>{let c=t[a];if(t[a]=this.clone(l),c){let u=t[a].metas.map(d=>d.phx_ref),h=c.metas.filter(d=>u.indexOf(d.phx_ref)<0);t[a].metas.unshift(...h)}r(a,c,l)}),this.map(o,(a,l)=>{let c=t[a];if(!c)return;let u=l.metas.map(h=>h.phx_ref);c.metas=c.metas.filter(h=>u.indexOf(h.phx_ref)<0),s(a,c,l),c.metas.length===0&&delete t[a]}),t}static list(t,n){return n||(n=function(r,s){return s}),this.map(t,(r,s)=>n(r,s))}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},ss={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,r,s,i,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:i,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:s,payload:i}=e,o=this.META_LENGTH+t.length+n.length+s.length+r.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++,s.length),l.setUint8(c++,r.length),Array.from(t,h=>l.setUint8(c++,h.charCodeAt(0))),Array.from(n,h=>l.setUint8(c++,h.charCodeAt(0))),Array.from(s,h=>l.setUint8(c++,h.charCodeAt(0))),Array.from(r,h=>l.setUint8(c++,h.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),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(o,o+r));o=o+r;let l=n.decode(e.slice(o,o+s));o=o+s;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 r=t.getUint8(1),s=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+r));a=a+r;let c=n.decode(e.slice(a,a+s));a=a+s;let u=n.decode(e.slice(a,a+i));a=a+i;let h=n.decode(e.slice(a,a+o));a=a+o;let d=e.slice(a,e.byteLength),f={status:h,response:d};return{join_ref:l,ref:c,topic:u,event:Ht.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),i=this.HEADER_LENGTH+2,o=n.decode(e.slice(i,i+r));i=i+r;let a=n.decode(e.slice(i,i+s));i=i+s;let l=e.slice(i,e.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:l}}},om=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||em,this.transport=t.transport||Ot.WebSocket||Pn,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=Ot&&Ot.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=ss.encode.bind(ss),this.defaultDecoder=ss.decode.bind(ss),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!==Pn?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Fn&&Fn.addEventListener&&(Fn.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Fn.addEventListener("pageshow",s=>{r===this.connectClock&&(r=null,this.connect())}),Fn.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=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,i,o)=>{console.log(`${s}: ${i}`,o)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Ar(t.params||{}),this.endPoint=`${e}/${ro.websocket}`,this.vsn=t.vsn||Qg,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Eu(()=>{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 Pn}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=Cs.appendParams(Cs.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=Ar(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Pn?this.connectWithFallback(Pn,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 r=this.onMessage(s=>{s.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Pn:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${so}${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,r=!0,s,i,o=this.transportName(e),a=l=>{this.log("transport",`falling back to ${o}...`,l),this.off([s,i]),r=!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),r&&!n&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){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(),tm,"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 r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(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===It.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(Ht.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case It.connecting:return"connecting";case It.open:return"open";case It.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 rm(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:s,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${s})`,r)}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:r,payload:s,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(s.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",`${s.status||""} ${n} ${r} ${i&&"("+i+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(n,r,s,o)&&l.trigger(r,s,i,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}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 Tr{constructor(t,n){const r=lm(n);this.presence=new im(t.getChannel(),r),this.presence.onJoin((s,i,o)=>{const a=Tr.onJoinPayload(s,i,o);t.getChannel().trigger("presence",a)}),this.presence.onLeave((s,i,o)=>{const a=Tr.onLeavePayload(s,i,o);t.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return Tr.transformState(this.presence.state)}static transformState(t){return t=am(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return n[r]=_s(s),n},{})}static onJoinPayload(t,n,r){const s=tl(n),i=_s(r);return{event:"join",key:t,currentPresences:s,newPresences:i}}static onLeavePayload(t,n,r){const s=tl(n),i=_s(r);return{event:"leave",key:t,currentPresences:s,leftPresences:i}}}function _s(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function am(e){return JSON.parse(JSON.stringify(e))}function lm(e){return(e==null?void 0:e.events)&&{events:e.events}}function tl(e){return e!=null&&e.metas?_s(e):[]}var nl;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(nl||(nl={}));class cm{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new Tr(this.channel.channelAdapter,n)}}function um(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 hm{constructor(t,n,r){const s=dm(r);this.channel=t.getSocket().channel(n,s),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,r){let s;try{s=this.channel.push(t,n,r)}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>Kg){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}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===sn.joined}isJoined(){return this.state===sn.joined}isJoining(){return this.state===sn.joining}isClosed(){return this.state===sn.closed}isLeaving(){return this.state===sn.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function dm(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var rl;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(rl||(rl={}));var Wn;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Wn||(Wn={}));var Ft;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Ft||(Ft={}));class Rr{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:{}},r){var s,i;if(this.topic=t,this.params=n,this.socket=r,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 hm(this.socket.socketAdapter,t,this.params),this.presence=new cm(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=wu(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.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 r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:a,private:l}}=this.params,c=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(f=>f.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[Wn.PRESENCE]&&this.bindings[Wn.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,h={},d={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(f=>{t==null||t(Ft.CHANNEL_ERROR,um(f))}),this._onClose(()=>t==null?void 0:t(Ft.CLOSED)),this.updateJoinPayload(Object.assign({config:d},h)),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(Ft.SUBSCRIBED);return}this._updatePostgresBindings(f,t)}).receive("error",f=>{this.state=sn.errored;const p=Object.values(f).join(", ")||"error";t==null||t(Ft.CHANNEL_ERROR,new Error(p,{cause:f}))}).receive("timeout",()=>{t==null||t(Ft.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var r;const s=this.bindings.postgres_changes,i=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,o=[];for(let a=0;a<i;a++){const l=s[a],{filter:{event:c,schema:u,table:h,filter:d}}=l,f=t&&t[a];if(f&&f.event===c&&Rr.isFilterValueEqual(f.schema,u)&&Rr.isFilterValueEqual(f.table,h)&&Rr.isFilterValueEqual(f.filter,d))o.push(Object.assign(Object.assign({},l),{id:f.id}));else{this.unsubscribe(),this.state=sn.errored,n==null||n(Ft.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=sn.errored&&n&&n(Ft.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,r){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=t===Wn.PRESENCE||t===Wn.POSTGRES_CHANGES;if(s&&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,r)}async httpSend(t,n,r={}){var s;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,(s=r.timeout)!==null&&s!==void 0?s: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 r,s;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,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.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,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),o}_on(t,n,r){const s=t.toLocaleLowerCase(),i=this.channelAdapter.on(t,r),o={type:s,filter:n,callback:r,ref:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,r)=>{var s,i,o,a,l,c,u;const h=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,r))return!1;const d=(s=this.bindings[h])===null||s===void 0?void 0:s.find(f=>f.ref===t.ref);if(!d)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in d){const f=d.id,p=(i=d.filter)===null||i===void 0?void 0:i.event;return f&&((o=n.ids)===null||o===void 0?void 0:o.includes(f))&&(p==="*"||(p==null?void 0:p.toLocaleLowerCase())===((a=n.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const f=(c=(l=d==null?void 0:d.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 d.type.toLocaleLowerCase()===h})}_notThisChannelEvent(t,n){const{close:r,error:s,leave:i,join:o}=_u;return n&&[r,s,i,o].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:i,table:o,commit_timestamp:a,type:l,errors:c}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:a,eventType:l,new:{},old:{},errors:c}),this._getPayloadRecords(s))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const r of t.bindings[n])this._on(r.type,r.filter,r.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=el(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=el(t.columns,t.old_record)),n}}class fm{constructor(t,n){this.socket=new om(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,r,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{t(),i("ok")},n,r)})}push(t){this.socket.push(t)}log(t,n,r){this.socket.log(t,n,r)}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()==to.connecting}isDisconnecting(){return this.socket.connectionState()==to.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const sl={HEARTBEAT_INTERVAL:25e3},pm=[1e3,2e3,5e3,1e4],gm=1e4;function mm(){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 bm(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return mm()}const ym=`
|
|
39
|
+
addEventListener("message", (e) => {
|
|
40
|
+
if (e.data.event === "start") {
|
|
41
|
+
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
42
|
+
}
|
|
43
|
+
});`;class _m{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 r;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 Wg,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),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const s=this._initializeOptions(n);this.socketAdapter=new fm(t,s),this.httpEndpoint=wu(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}
|
|
44
|
+
|
|
45
|
+
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
46
|
+
|
|
47
|
+
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
48
|
+
Option 2: Install and provide the "ws" package:
|
|
49
|
+
|
|
50
|
+
npm install ws
|
|
51
|
+
|
|
52
|
+
import ws from "ws"
|
|
53
|
+
const client = new RealtimeClient(url, {
|
|
54
|
+
...options,
|
|
55
|
+
transport: ws
|
|
56
|
+
})`):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 r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(t);return await this.disconnect(),n}log(t,n,r){this.socketAdapter.log(t,n,r)}connectionState(){return this.socketAdapter.connectionState()||to.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new Rr(`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,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const i={access_token:n,version:Bg};n&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(_u.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,r)=>{n=="sent"&&this._setAuthSafely(),t&&t(n,r)}}_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 r=new Blob([ym],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(t){var n,r,s,i,o,a,l,c,u,h,d,f;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=t==null?void 0:t.accessToken)!==null&&r!==void 0?r:null;const p={};p.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:qg,p.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:sl.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:sl.HEARTBEAT_INTERVAL),p.transport=(l=t==null?void 0:t.transport)!==null&&l!==void 0?l:Dg.getWebSocketConstructor(),p.params=t==null?void 0:t.params,p.logger=t==null?void 0:t.logger,p.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),p.sessionStorage=(c=t==null?void 0:t.sessionStorage)!==null&&c!==void 0?c:bm(),p.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:y=>pm[y-1]||gm;let m,w;const E=(h=t==null?void 0:t.vsn)!==null&&h!==void 0?h:Fg;switch(E){case Hg:m=(y,v)=>v(JSON.stringify(y)),w=(y,v)=>v(JSON.parse(y));break;case yu:m=this.serializer.encode.bind(this.serializer),w=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${p.vsn}`)}if(p.vsn=E,p.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:m,p.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:w,p.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,p.params=Object.assign(Object.assign({},p.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,p.autoSendHeartbeat=!this.worker}return p}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Dr=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 vm(e,t,n){const r=new URL(t,e);if(n)for(const[s,i]of Object.entries(n))i!==void 0&&r.searchParams.set(s,i);return r.toString()}async function wm(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 Em(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=vm(e.baseUrl,r,s),l=await wm(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(),h=(c.headers.get("content-type")||"").includes("application/json"),d=h&&u?JSON.parse(u):u;if(!c.ok){const f=h?d:void 0,p=f==null?void 0:f.error;throw new Dr((p==null?void 0:p.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:p==null?void 0:p.type,icebergCode:p==null?void 0:p.code,details:f})}return{status:c.status,headers:c.headers,data:d}}}}function is(e){return e.join("")}var Sm=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:is(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}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/${is(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${is(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${is(e.namespace)}`}),!0}catch(t){if(t instanceof Dr&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Dr&&n.status===409)return;throw n}}};function Ln(e){return e.join("")}var km=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/${Ln(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/${Ln(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/${Ln(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/${Ln(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/${Ln(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/${Ln(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Dr&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Dr&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},Am=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=Em({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new Sm(this.client,t),this.tableOps=new km(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 Ur(e){"@babel/helpers - typeof";return Ur=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},Ur(e)}function Tm(e,t){if(Ur(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ur(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rm(e){var t=Tm(e,"string");return Ur(t)=="symbol"?t:t+""}function xm(e,t,n){return(t=Rm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?il(Object(n),!0).forEach(function(r){xm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):il(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ai=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function li(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var io=class extends ai{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return oe({},super.toJSON())}},Su=class extends ai{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function Ns(e,t,n){const r=oe({},e),s=t.toLowerCase();for(const i of Object.keys(r))i.toLowerCase()===s&&delete r[i];return r[s]=n,r}function Om(e){const t={};for(const[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}const Cm=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Nm=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)},oo=e=>{if(Array.isArray(e))return e.map(n=>oo(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[s]=oo(r)}),t},Im=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),ol=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,r)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const s=e;let i=parseInt(String(s.status),10);Number.isFinite(i)||(i=500),s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";t(new io(ol(o),i,a,r))}).catch(()=>{const o=i+"";t(new io(s.statusText||`HTTP ${i} error`,i,o,r))})}else t(new Su(ol(e),e,r))},Lm=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!r)return oe(oe({},s),n);if(Nm(r)){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);s.headers=Ns(o,"Content-Type",(i=a)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(r)}else s.body=r;return t!=null&&t.duplex&&(s.duplex=t.duplex),oe(oe({},s),n)};async function ur(e,t,n,r,s,i,o){return new Promise((a,l)=>{e(n,Lm(t,r,s,i)).then(c=>{if(!c.ok)throw c;if(r!=null&&r.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,r,o))})}function ku(e="storage"){return{get:async(t,n,r,s)=>ur(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,i)=>ur(t,"POST",n,s,i,r,e),put:async(t,n,r,s,i)=>ur(t,"PUT",n,s,i,r,e),head:async(t,n,r,s)=>ur(t,"HEAD",n,oe(oe({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,i)=>ur(t,"DELETE",n,s,i,r,e)}}const $m=ku("storage"),{get:Br,post:gt,put:ao,head:Mm,remove:Po}=$m,ot=ku("vectors");var ir=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=Om(t),this.fetch=Cm(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Ns(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(li(n))return{data:null,error:n};throw n}}},jm=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(li(t))return{data:null,error:t};throw t}}};let Au;Au=Symbol.toStringTag;var Dm=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Au]="BlobDownloadBuilder",this.promise=null}asStream(){return new jm(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(li(t))return{data:null,error:t};throw t}}};const Um={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},al={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Bm=class extends ir{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let i;const o=oe(oe({},al),r);let a=oe(oe({},s.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",s.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",s.encodeMetadata(l))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers)for(const[d,f]of Object.entries(r.headers))a=Ns(a,d,f);const c=s._removeEmptyFolders(t),u=s._getFinalPath(c),h=await(e=="PUT"?ao:gt)(s.fetch,`${s.url}/object/${u}`,i,oe({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:c,id:h.Id,fullPath:h.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const i=s._removeEmptyFolders(e),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",t),s.handleOperation(async()=>{let l;const c=oe(oe({},al),r);let u=oe(oe({},s.headers),{"x-upsert":String(c.upsert)});const h=c.metadata;if(typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),h&&l.append("metadata",s.encodeMetadata(h)),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.has("cacheControl")||l.append("cacheControl",c.cacheControl),h&&!l.has("metadata")&&l.append("metadata",s.encodeMetadata(h))):(l=n,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType,h&&(u["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&l instanceof ReadableStream||l&&typeof l=="object"&&"pipe"in l&&typeof l.pipe=="function")&&!c.duplex&&(c.duplex="half")),r!=null&&r.headers)for(const[d,f]of Object.entries(r.headers))u=Ns(u,d,f);return{path:i,fullPath:(await ao(s.fetch,a.toString(),l,oe({headers:u},c!=null&&c.duplex?{duplex:c.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=oe({},n.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const i=await gt(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+i.url),a=o.searchParams.get("token");if(!a)throw new ai("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 r=this;return r.handleOperation(async()=>await gt(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await gt(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e);const i=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let o=await gt(r.fetch,`${r.url}/object/sign/${s}`,oe({expiresIn:t},i?{transform:n.transform}:{}),{headers:r.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(`${r.url}${o.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await gt(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.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 s.map(a=>oe(oe({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const i=s.toString(),o=this._getFinalPath(e),a=()=>Br(this.fetch,`${this.url}/${r}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new Dm(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>oo(await Br(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await Mm(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(li(s)){var r;const i=s instanceof io?s.status:s instanceof Su?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=new URLSearchParams;t!=null&&t.download&&r.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(r,t.transform),(t==null?void 0:t.cacheNonce)!=null&&r.set("cacheNonce",String(t.cacheNonce));const s=r.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}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await Po(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=oe(oe(oe({},Um),t),{},{prefix:e||""});return await gt(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=oe({},e);return await gt(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{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 Hm="2.105.4",Zr={"X-Client-Info":`storage-js/${Hm}`};var Fm=class extends ir{constructor(e,t={},n,r){const s=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=oe(oe({},Zr),t);super(i,o,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await Br(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Br(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await gt(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 ao(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 gt(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Po(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():""}},qm=class extends ir{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=oe(oe({},Zr),t);super(r,s,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await gt(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 r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Br(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Po(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!Im(e))throw new ai("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 Am({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(l){if(r)throw l;return{data:null,error:l}}}}})}},Km=class extends ir{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=oe(oe({},Zr),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await ot.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await ot.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await ot.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await ot.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},Wm=class extends ir{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=oe(oe({},Zr),{},{"Content-Type":"application/json"},t);super(r,s,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 ot.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await ot.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 ot.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await ot.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 ot.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Vm=class extends ir{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=oe(oe({},Zr),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await ot.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ot.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await ot.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await ot.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Gm=class extends Vm{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new zm(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)}},zm=class extends Km{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,oe(oe({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,oe(oe({},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 Jm(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},Jm=class extends Wm{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,oe(oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,oe(oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,oe(oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,oe(oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,oe(oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Ym=class extends Fm{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Bm(this.url,this.headers,e,this.fetch)}get vectors(){return new Gm(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new qm(this.url+"/iceberg",this.headers,this.fetch)}};const Tu="2.105.4",qn=30*1e3,lo=3,xi=lo*qn,Zm="http://localhost:9999",Xm="supabase.auth.token",Qm={"X-Client-Info":`gotrue-js/${Tu}`},co="X-Supabase-Api-Version",Ru={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},eb=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,tb=10*60*1e3;class Hr extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function W(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class nb extends Hr{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function rb(e){return W(e)&&e.name==="AuthApiError"}class bt extends Hr{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Zt extends Hr{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class Be extends Zt{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function os(e){return W(e)&&e.name==="AuthSessionMissingError"}class $n extends Zt{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class as extends Zt{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class ls extends Zt{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 sb(e){return W(e)&&e.name==="AuthImplicitGrantRedirectError"}class ll extends Zt{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 ib extends Zt{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 uo extends Zt{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Oi(e){return W(e)&&e.name==="AuthRetryableFetchError"}class cl extends Zt{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class ho extends Zt{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Is="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ul=`
|
|
57
|
+
\r=`.split(""),ob=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<ul.length;t+=1)e[ul[t].charCodeAt(0)]=-2;for(let t=0;t<Is.length;t+=1)e[Is[t].charCodeAt(0)]=t;return e})();function hl(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Is[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Is[r]),t.queuedBits-=6}}function xu(e,t,n){const r=ob[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function dl(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{cb(o,r,n)};for(let o=0;o<e.length;o+=1)xu(e.charCodeAt(o),s,i);return t.join("")}function ab(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 lb(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}ab(r,t)}}function cb(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;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 Xn(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)xu(e.charCodeAt(s),n,r);return new Uint8Array(t)}function ub(e){const t=[];return lb(e,n=>t.push(n)),new Uint8Array(t)}function An(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>hl(s,n,r)),hl(null,n,r),t.join("")}function hb(e){return Math.round(Date.now()/1e3)+e}function db(){return Symbol("auth-callback")}const We=()=>typeof window<"u"&&typeof document<"u",bn={tested:!1,writable:!1},Ou=()=>{if(!We())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(bn.tested)return bn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),bn.tested=!0,bn.writable=!0}catch{bn.tested=!0,bn.writable=!1}return bn.writable};function fb(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,i)=>{t[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const Cu=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),pb=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Kn=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},yn=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},Ke=async(e,t)=>{await e.removeItem(t)};class ci{constructor(){this.promise=new ci.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}ci.promiseConstructor=Promise;function cs(e){const t=e.split(".");if(t.length!==3)throw new ho("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!eb.test(t[r]))throw new ho("JWT not in base64url format");return{header:JSON.parse(dl(t[0])),payload:JSON.parse(dl(t[1])),signature:Xn(t[2]),raw:{header:t[0],payload:t[1]}}}async function gb(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function mb(e,t){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){r(o);return}}catch(o){if(!t(i,o)){s(o);return}}})()})}function bb(e){return("0"+e.toString(16)).substr(-2)}function yb(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let i=0;i<56;i++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,bb).join("")}async function _b(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function vb(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 _b(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Mn(e,t,n=!1){const r=yb();let s=r;n&&(s+="/recovery"),await Kn(e,`${t}-code-verifier`,s);const i=await vb(r);return[i,r===i?"plain":"s256"]}const wb=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Eb(e){const t=e.headers.get(co);if(!t||!t.match(wb))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function Sb(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 kb(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 Ab=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ut(e){if(!Ab.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function pt(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 Ci(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="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 Tb(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const i=r.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,r,s)}return!t.value&&typeof r=="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,r,s)}})}function fl(e){return JSON.parse(JSON.stringify(e))}const vn=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)},Rb=[502,503,504,520,521,522,523,524,530];async function pl(e){var t;if(!pb(e))throw new uo(vn(e),0);if(Rb.includes(e.status))throw new uo(vn(e),e.status);let n;try{n=await e.json()}catch(i){throw new bt(vn(i),i)}let r;const s=Eb(e);if(s&&s.getTime()>=Ru["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new cl(vn(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Be}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 cl(vn(n),e.status,n.weak_password.reasons);throw new nb(vn(n),e.status||500,r)}const xb=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function J(e,t,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[co]||(i[co]=Ru["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await Ob(e,t,n+a,{headers:i,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function Ob(e,t,n,r,s,i){const o=xb(t,r,s,i);let a;try{a=await e(n,Object.assign({},o))}catch(l){throw console.error(l),new uo(vn(l),0)}if(a.ok||await pl(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(l){await pl(l)}}function dt(e){var t;let n=null;Ib(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=hb(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function gl(e){const t=dt(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,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function on(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function Cb(e){return{data:e,error:null}}function Nb(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=e,o=oi(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function ml(e){return e}function Ib(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const Ni=["global","local","others"];class Pb{constructor({url:t="",headers:n={},fetch:r,experimental:s}){this.url=t,this.headers=n,this.fetch=Cu(r),this.experimental=s??{},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=Ni[0]){if(Ni.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ni.join(", ")}`);try{return await J(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(W(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await J(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:on})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=oi(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await J(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:Nb,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(W(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await J(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:on})}catch(n){if(W(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await J(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:ml});if(u.error)throw u.error;const h=await u.json(),d=(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(p=>{const m=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(p.split(";")[1].split("=")[1]);c[`${w}Page`]=m}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(W(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){Ut(t);try{return await J(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:on})}catch(n){if(W(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Ut(t);try{return await J(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:on})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){Ut(t);try{return await J(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:on})}catch(r){if(W(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){Ut(t.userId);try{const{data:n,error:r}=await J(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Ut(t.userId),Ut(t.id);try{return{data:await J(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await J(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:ml});if(u.error)throw u.error;const h=await u.json(),d=(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(p=>{const m=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(p.split(";")[1].split("=")[1]);c[`${w}Page`]=m}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(W(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(t){try{return await J(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await J(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await J(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(W(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await J(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await J(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await J(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(W(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await J(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await J(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await J(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(W(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{return await J(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}async _adminListPasskeys(t){pt(this.experimental),Ut(t.userId);try{return await J(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(W(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(t){pt(this.experimental),Ut(t.userId),Ut(t.passkeyId);try{return await J(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(W(n))return{data:null,error:n};throw n}}}function bl(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const At={debug:!!(globalThis&&Ou()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Nu extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class yl extends Nu{}async function Lb(e,t,n){At.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;let s;t>0&&(s=setTimeout(()=>{r.abort(),At.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:r.signal},async i=>{if(i){clearTimeout(s),At.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{At.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw At.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new yl(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(At.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(s),await n()}})}catch(i){if(t>0&&clearTimeout(s),i!==null&&typeof i=="object"&&"name"in i&&i.name==="AbortError"&&t>0){if(r.signal.aborted)return At.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){At.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await n()}finally{At.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 At.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new yl(`Lock "${e}" was released because another request stole it`)}throw i}}function $b(){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 Iu(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Mb(e){return parseInt(e,16)}function jb(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function Db(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:c,scheme:u,uri:h,version:d}=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(!r)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(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(d!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
|
|
58
|
+
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const f=Iu(e.address),p=u?`${u}://${r}`:r,m=e.statement?`${e.statement}
|
|
59
|
+
`:"",w=`${p} wants you to sign in with your Ethereum account:
|
|
60
|
+
${f}
|
|
61
|
+
|
|
62
|
+
${m}`;let E=`URI: ${h}
|
|
63
|
+
Version: ${d}
|
|
64
|
+
Chain ID: ${n}${o?`
|
|
65
|
+
Nonce: ${o}`:""}
|
|
66
|
+
Issued At: ${i.toISOString()}`;if(s&&(E+=`
|
|
67
|
+
Expiration Time: ${s.toISOString()}`),a&&(E+=`
|
|
68
|
+
Not Before: ${a.toISOString()}`),l&&(E+=`
|
|
69
|
+
Request ID: ${l}`),c){let y=`
|
|
70
|
+
Resources:`;for(const v of c){if(!v||typeof v!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${v}`);y+=`
|
|
71
|
+
- ${v}`}E+=y}return`${w}
|
|
72
|
+
${E}`}class Pe extends Error{constructor({message:t,code:n,cause:r,name:s}){var i;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=s??(r instanceof Error?r.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 Ps extends Pe{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function Ub({error:e,options:t}){var n,r,s;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 Pe({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 Pe({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Pe({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Pe({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 Pe({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Pe({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 Pe({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Pe({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(Pu(o)){if(i.rp.id!==o)return new Pe({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Pe({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 Pe({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 Pe({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 Pe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Bb({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 Pe({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Pe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(Pu(r)){if(n.rpId!==r)return new Pe({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Pe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Pe({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 Pe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class Hb{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 fo=new Hb;function _l(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:r}=e,s=oi(e,["challenge","user","excludeCredentials"]),i=Xn(t).buffer,o=Object.assign(Object.assign({},n),{id:Xn(n.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){const c=r[l];a.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:Xn(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function vl(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,r=oi(e,["challenge","allowCredentials"]),s=Xn(t).buffer,i=Object.assign(Object.assign({},r),{challenge:s});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:Xn(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function wl(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:An(new Uint8Array(e.response.attestationObject)),clientDataJSON:An(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function El(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:An(new Uint8Array(s.authenticatorData)),clientDataJSON:An(new Uint8Array(s.clientDataJSON)),signature:An(new Uint8Array(s.signature)),userHandle:s.userHandle?An(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Pu(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Ls(){var e,t;return!!(We()&&"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 Lu(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ps("Browser returned unexpected credential type",t)}:{data:null,error:new Ps("Empty credential response",t)}}catch(t){return{data:null,error:Ub({error:t,options:e})}}}async function $u(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ps("Browser returned unexpected credential type",t)}:{data:null,error:new Ps("Empty credential response",t)}}catch(t){return{data:null,error:Bb({error:t,options:e})}}}const Fb={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},qb={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function $s(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))r[i]=o;else if(n(o))r[i]=o;else if(t(o)){const a=r[i];t(a)?r[i]=$s(a,o):r[i]=$s(o)}else r[i]=o}return r}function Kb(e,t){return $s(Fb,e,t||{})}function Wb(e,t){return $s(qb,e,t||{})}class Vb{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:r,signal:s},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=s??fo.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;if(!u.name){const h=r;if(h)u.name=`${u.id}:${h}`;else{const f=(await this.client.getUser()).data.user,p=((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}:${p}`}}u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{const u=Kb(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:h,error:d}=await Lu({publicKey:u,signal:c});return h?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:h}},error:null}:{data:null,error:d}}case"request":{const u=Wb(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:h,error:d}=await $u(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:c}));return h?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:h}},error:null}:{data:null,error:d}}}}catch(a){return W(a)?{data:null,error:a}:{data:null,error:new bt("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new Hr("rpId is required for WebAuthn authentication")};try{if(!Ls())return{data:null,error:new bt("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{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:r,credential_response:l.credential_response}})}catch(o){return W(o)?{data:null,error:o}:{data:null,error:new bt("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new Hr("rpId is required for WebAuthn registration")};try{if(!Ls())return{data:null,error:new bt("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 h;return(h=u.data)===null||h===void 0?void 0:h.all.find(d=>d.factor_type==="webauthn"&&d.friendly_name===t&&d.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:r},signal:s},{create:i});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(o){return W(o)?{data:null,error:o}:{data:null,error:new bt("Unexpected error in register",o)}}}}$b();const Gb={url:Zm,storageKey:Xm,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Qm,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function Sl(e,t,n){return await n()}const jn={};class Fr{get jwks(){var t,n;return(n=(t=jn[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){jn[this.storageKey]=Object.assign(Object.assign({},jn[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=jn[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){jn[this.storageKey]=Object.assign(Object.assign({},jn[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s,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({},Gb),t);if(this.storageKey=o.storageKey,this.instanceID=(n=Fr.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Fr.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&We()){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=(r=o.experimental)!==null&&r!==void 0?r:{},this.admin=new Pb({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=Cu(o.fetch),this.lock=o.lock||Sl,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&&We()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=Lb:this.lock=Sl,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 Vb(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:Ou()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=bl(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=bl(this.memoryStorage)),We()&&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} (${Tu}) ${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={},r="none";if(We()&&(n=fb(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),We()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),sb(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}=s;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 W(n)?this._returnResult({error:n}):this._returnResult({error:new bt("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const i=await J(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:dt}),{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(W(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var n,r,s;try{let i;if("email"in t){const{email:u,password:h,options:d}=t;let f=null,p=null;this.flowType==="pkce"&&([f,p]=await Mn(this.storage,this.storageKey)),i=await J(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d==null?void 0:d.emailRedirectTo,body:{email:u,password:h,data:(n=d==null?void 0:d.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:f,code_challenge_method:p},xform:dt})}else if("phone"in t){const{phone:u,password:h,options:d}=t;i=await J(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:h,data:(r=d==null?void 0:d.data)!==null&&r!==void 0?r:{},channel:(s=d==null?void 0:d.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:dt})}else throw new as("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await Ke(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 Ke(this.storage,`${this.storageKey}-code-verifier`),W(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 J(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:gl})}else if("phone"in t){const{phone:i,password:o,options:a}=t;n=await J(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:gl})}else throw new as("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const i=new $n;return this._returnResult({data:{user:null,session:null},error:i})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.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,r,s,i,o,a,l,c,u,h,d;let f,p;if("message"in t)f=t.message,p=t.signature;else{const{chain:m,wallet:w,statement:E,options:y}=t;let v;if(We())if(typeof w=="object")v=w;else{const C=window;if("ethereum"in C&&typeof C.ethereum=="object"&&"request"in C.ethereum&&typeof C.ethereum.request=="function")v=C.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 w!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");v=w}const T=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href),D=await v.request({method:"eth_requestAccounts"}).then(C=>C).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!D||D.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const B=Iu(D[0]);let j=(r=y==null?void 0:y.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!j){const C=await v.request({method:"eth_chainId"});j=Mb(C)}const q={domain:T.host,address:B,statement:E,uri:T.href,version:"1",chainId:j,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.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=Db(q),p=await v.request({method:"personal_sign",params:[jb(f),B]})}try{const{data:m,error:w}=await J(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:p},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(d=t.options)===null||d===void 0?void 0:d.captchaToken}}:null),xform:dt});if(w)throw w;if(!m||!m.session||!m.user){const E=new $n;return this._returnResult({data:{user:null,session:null},error:E})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:w})}catch(m){if(W(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var n,r,s,i,o,a,l,c,u,h,d,f;let p,m;if("message"in t)p=t.message,m=t.signature;else{const{chain:w,wallet:E,statement:y,options:v}=t;let T;if(We())if(typeof E=="object")T=E;else{const B=window;if("solana"in B&&typeof B.solana=="object"&&("signIn"in B.solana&&typeof B.solana.signIn=="function"||"signMessage"in B.solana&&typeof B.solana.signMessage=="function"))T=B.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 E!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");T=E}const D=new URL((n=v==null?void 0:v.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in T&&T.signIn){const B=await T.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},v==null?void 0:v.signInWithSolana),{version:"1",domain:D.host,uri:D.href}),y?{statement:y}:null));let j;if(Array.isArray(B)&&B[0]&&typeof B[0]=="object")j=B[0];else if(B&&typeof B=="object"&&"signedMessage"in B&&"signature"in B)j=B;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in j&&"signature"in j&&(typeof j.signedMessage=="string"||j.signedMessage instanceof Uint8Array)&&j.signature instanceof Uint8Array)p=typeof j.signedMessage=="string"?j.signedMessage:new TextDecoder().decode(j.signedMessage),m=j.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in T)||typeof T.signMessage!="function"||!("publicKey"in T)||typeof T!="object"||!T.publicKey||!("toBase58"in T.publicKey)||typeof T.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${D.host} wants you to sign in with your Solana account:`,T.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${D.href}`,`Issued At: ${(s=(r=v==null?void 0:v.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=v==null?void 0:v.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${v.signInWithSolana.notBefore}`]:[],...!((o=v==null?void 0:v.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${v.signInWithSolana.expirationTime}`]:[],...!((a=v==null?void 0:v.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${v.signInWithSolana.chainId}`]:[],...!((l=v==null?void 0:v.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${v.signInWithSolana.nonce}`]:[],...!((c=v==null?void 0:v.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${v.signInWithSolana.requestId}`]:[],...!((h=(u=v==null?void 0:v.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||h===void 0)&&h.length?["Resources",...v.signInWithSolana.resources.map(j=>`- ${j}`)]:[]].join(`
|
|
73
|
+
`);const B=await T.signMessage(new TextEncoder().encode(p),"utf8");if(!B||!(B instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=B}}try{const{data:w,error:E}=await J(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:An(m)},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:dt});if(E)throw E;if(!w||!w.session||!w.user){const y=new $n;return this._returnResult({data:{user:null,session:null},error:y})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:E})}catch(w){if(W(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async _exchangeCodeForSession(t){const n=await yn(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new ib;const{data:i,error:o}=await J(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:dt});if(await Ke(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new $n;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(await Ke(this.storage,`${this.storageKey}-code-verifier`),W(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=t,a=await J(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:dt}),{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 $n;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(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,i,o;try{if("email"in t){const{email:a,options:l}=t;let c=null,u=null;this.flowType==="pkce"&&([c,u]=await Mn(this.storage,this.storageKey));const{error:h}=await J(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:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!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:h})}if("phone"in t){const{phone:a,options:l}=t,{data:c,error:u}=await J(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},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 as("You must provide either an email or phone number.")}catch(a){if(await Ke(this.storage,`${this.storageKey}-code-verifier`),W(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(t){var n,r;try{let s,i;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await J(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:dt});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(s){if(W(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,i,o;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Mn(this.storage,this.storageKey));const c=await J(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:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.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:Cb});return!((i=c.data)===null||i===void 0)&&i.url&&We()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(a){if(await Ke(this.storage,`${this.storageKey}-code-verifier`),W(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:r}=t;if(r)throw r;if(!n)throw new Be;const{error:s}=await J(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(W(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:r,type:s,options:i}=t,{error:o}=await J(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,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:r,type:s,options:i}=t,{data:o,error:a}=await J(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,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 as("You must provide either an email or phone number and a type")}catch(n){if(W(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 r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}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 yn(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 r=t.expires_at?t.expires_at*1e3-Date.now()<xi:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await yn(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Ci()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=Tb(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},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 J(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:on}):await this._useSession(async n=>{var r,s,i;const{data:o,error:a}=n;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Be}:await J(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:on})})}catch(n){if(W(n))return os(n)&&(await this._removeSession(),await Ke(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 r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new Be;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await Mn(this.storage,this.storageKey));const{data:c,error:u}=await J(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:on});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(r){if(await Ke(this.storage,`${this.storageKey}-code-verifier`),W(r))return this._returnResult({data:{user:null},error:r});throw r}}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 Be;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=cs(t.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){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:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(W(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 r;if(!t){const{data:o,error:a}=n;if(a)throw a;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Be;const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(W(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){var r;try{if(!We())throw new ls("No browser detected.");if(t.error||t.error_description||t.error_code)throw new ls(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 ll("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ls("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 ll("No code detected.");const{data:v,error:T}=await this._exchangeCodeForSession(t.code);if(T)throw T;const D=new URL(window.location.href);return D.searchParams.delete("code"),window.history.replaceState(window.history.state,"",D.toString()),{data:{session:v.session,redirectType:(r=v.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:s,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 ls("No session defined in URL");const h=Math.round(Date.now()/1e3),d=parseInt(l);let f=h+d;c&&(f=parseInt(c));const p=f-h;p*1e3<=qn&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);const m=f-d;h-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,f,h):h-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,f,h);const{data:w,error:E}=await this._getUser(o);if(E)throw E;const y={provider_token:s,provider_refresh_token:i,access_token:o,expires_in:d,expires_at:f,refresh_token:a,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(s){if(W(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_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 yn(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 r;const{data:s,error:i}=n;if(i&&!os(i))return this._returnResult({error:i});const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,t);if(a&&!(rb(a)&&(a.status===404||a.status===401||a.status===403)||os(a)))return this._returnResult({error:a})}return t!=="others"&&(await this._removeSession(),await Ke(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=db(),r={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,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,s;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),os(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Mn(this.storage,this.storageKey,!0));try{return await J(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await Ke(this.storage,`${this.storageKey}-code-verifier`),W(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(W(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:r,error:s}=await this._useSession(async i=>{var o,a,l,c,u;const{data:h,error:d}=i;if(d)throw d;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 J(this.fetch,"GET",f,{headers:this.headers,jwt:(u=(c=h.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return We()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(W(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:i}}=n;if(s)throw s;const{options:o,provider:a,token:l,access_token:c,nonce:u}=t,h=await J(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=i==null?void 0:i.access_token)!==null&&r!==void 0?r: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:dt}),{data:d,error:f}=h;return f?this._returnResult({data:{user:null,session:null},error:f}):!d||!d.session||!d.user?this._returnResult({data:{user:null,session:null},error:new $n}):(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),this._returnResult({data:d,error:f}))}catch(s){if(await Ke(this.storage,`${this.storageKey}-code-verifier`),W(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)throw o;return await J(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(W(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 r=Date.now();return await mb(async s=>(s>0&&await gb(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await J(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:dt})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Oi(i)&&Date.now()+o-r<qn})}catch(r){if(this._debug(n,"error",r),W(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}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 r=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",r),We()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await yn(this.storage,this.storageKey);if(s&&this.userStorage){let o=await yn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Kn(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Ci()}else if(s&&!s.user&&!s.user){const o=await yn(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await Ke(this.storage,this.storageKey+"-user"),await Kn(this.storage,this.storageKey,s)):s.user=Ci()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const i=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<xi;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${xi}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Oi(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(s.access_token);!a&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Be;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new ci;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new Be;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(s,"error",i),W(i)){const o={data:null,error:i};return Oi(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&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(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Ke(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Kn(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=fl(s);await Kn(this.storage,this.storageKey,i)}else{const s=fl(n);await Kn(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Ke(this.storage,this.storageKey),await Ke(this.storage,this.storageKey+"-code-verifier"),await Ke(this.storage,this.storageKey+"-user"),this.userStorage&&await Ke(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&We()&&(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(),qn);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:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-t)/qn);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${qn}ms, refresh threshold is ${lo} ticks`),s<=lo&&await this._callRefreshToken(r.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 Nu)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!We()||!(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,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await Mn(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?this._returnResult({data:null,error:i}):await J(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;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 J(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(t.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.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(W(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 r;const{data:s,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"?wl(t.webauthn.credential_response):El(t.webauthn.credential_response)})}:{code:t.code}),{data:a,error:l}=await J(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.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(W(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 r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await J(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.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:_l(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:vl(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,s,i;if(t)try{const{payload:f}=cs(t);let p=null;f.aal&&(p=f.aal);let m=p;const{data:{user:w},error:E}=await this.getUser(t);if(E)return this._returnResult({data:null,error:E});((r=(n=w==null?void 0:w.factors)===null||n===void 0?void 0:n.filter(T=>T.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(m="aal2");const v=f.amr||[];return{data:{currentLevel:p,nextLevel:m,currentAuthenticationMethods:v},error:null}}catch(f){if(W(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}=cs(o.access_token);let c=null;l.aal&&(c=l.aal);let u=c;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(f=>f.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(u="aal2");const d=l.amr||[];return{data:{currentLevel:c,nextLevel:u,currentAuthenticationMethods:d},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await J(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Be})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new Be});const o=await J(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&We()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new Be});const o=await J(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&We()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await J(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Be})})}catch(t){if(W(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await J(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Be})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(a=>a.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(a=>a.kid===t),r&&this.jwks_cached_at+tb>s)return r;const{data:i,error:o}=await J(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=s,r=i.keys.find(a=>a.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:f,error:p}=await this.getSession();if(p||!f.session)return this._returnResult({data:null,error:p});r=f.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=cs(r);n!=null&&n.allowExpired||Sb(i.exp);const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!c){const{error:f}=await this.getUser(r);if(f)throw f;return{data:{claims:i,header:s,signature:o},error:null}}const u=kb(s.alg),h=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,h,o,ub(`${a}.${l}`)))throw new ho("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(t){var n,r,s;pt(this.experimental);try{if(!Ls())return this._returnResult({data:null,error:new bt("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=vl(i.options),l=(s=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&s!==void 0?s:fo.createNewAbortSignal(),{data:c,error:u}=await $u({publicKey:a,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new bt("WebAuthn ceremony failed",null)});const h=El(c);return this._verifyPasskeyAuthentication({challengeId:i.challenge_id,credential:h})}catch(i){if(W(i))return this._returnResult({data:null,error:i});throw i}}async registerPasskey(t){var n,r;pt(this.experimental);try{if(!Ls())return this._returnResult({data:null,error:new bt("Browser does not support WebAuthn",null)});const{data:s,error:i}=await this._startPasskeyRegistration();if(i||!s)return this._returnResult({data:null,error:i});const o=_l(s.options),a=(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&r!==void 0?r:fo.createNewAbortSignal(),{data:l,error:c}=await Lu({publicKey:o,signal:a});if(c||!l)return this._returnResult({data:null,error:c??new bt("WebAuthn ceremony failed",null)});const u=wl(l);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:u})}catch(s){if(W(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){pt(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Be});const{data:s,error:i}=await J(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:s,error:null})})}catch(t){if(W(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){pt(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new Be});const{data:i,error:o}=await J(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.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(W(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(t){var n;pt(this.experimental);try{const{data:r,error:s}=await J(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 s?this._returnResult({data:null,error:s}):this._returnResult({data:r,error:null})}catch(r){if(W(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(t){pt(this.experimental);try{const{data:n,error:r}=await J(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:dt});return r?this._returnResult({data:null,error:r}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){pt(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Be});const{data:s,error:i}=await J(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:s,error:null})})}catch(t){if(W(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){pt(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new Be});const{data:i,error:o}=await J(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:t.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:i,error:null})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(t){pt(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new Be});const{error:i}=await J(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(n){if(W(n))return this._returnResult({data:null,error:n});throw n}}}Fr.nextInstanceID={};const zb=Fr,Jb="2.105.4";let gr="";typeof Deno<"u"?gr="deno":typeof document<"u"?gr="web":typeof navigator<"u"&&navigator.product==="ReactNative"?gr="react-native":gr="node";const Yb={"X-Client-Info":`supabase-js-${gr}/${Jb}`},Zb={headers:Yb},Xb={schema:"public"},Qb={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ey={};function qr(e){"@babel/helpers - typeof";return qr=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},qr(e)}function ty(e,t){if(qr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ny(e){var t=ty(e,"string");return qr(t)=="symbol"?t:t+""}function ry(e,t,n){return(t=ny(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function xe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kl(Object(n),!0).forEach(function(r){ry(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const sy=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),iy=()=>Headers,oy=(e,t,n)=>{const r=sy(n),s=iy();return async(i,o)=>{var a;const l=(a=await t())!==null&&a!==void 0?a:e;let c=new s(o==null?void 0:o.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),r(i,xe(xe({},o),{},{headers:c}))}};function ay(e){return e.endsWith("/")?e:e+"/"}function ly(e,t){var n,r;const{db:s,auth:i,realtime:o,global:a}=e,{db:l,auth:c,realtime:u,global:h}=t,d={db:xe(xe({},l),s),auth:xe(xe({},c),i),realtime:xe(xe({},u),o),storage:{},global:xe(xe(xe({},h),a),{},{headers:xe(xe({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?d.accessToken=e.accessToken:delete d.accessToken,d}function cy(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(ay(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var uy=class extends zb{constructor(e){super(e)}},hy=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const i=cy(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:Xb,realtime:ey,auth:xe(xe({},Qb),{},{storageKey:o}),global:Zb},l=ly(n??{},a);if(this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} 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=oy(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(xe({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 jg(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 Ym(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new Rg(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:r}=await e.auth.getSession();return(t=(n=r.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:r,userStorage:s,storageKey:i,flowType:o,lock:a,debug:l,throwOnError:c,experimental:u,lockAcquireTimeout:h,skipAutoInitialize:d},f,p){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new uy({url:this.authUrl.href,headers:xe(xe({},m),f),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:c,experimental:u,fetch:p,lockAcquireTimeout:h,skipAutoInitialize:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(w=>w.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new _m(this.realtimeUrl.href,xe(xe({},e),{},{params:xe(xe({},{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 dy=(e,t,n)=>new hy(e,t,n);function fy(){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}fy()&&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 us=null,hs=null;async function Mu(){if(us)return us;try{const e=await fetch("/api/auth/config");if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=await e.json();return us={authEnabled:t.authEnabled,supabaseUrl:t.supabaseUrl??void 0,supabaseAnonKey:t.supabaseAnonKey??void 0},us}catch{return{authEnabled:!1}}}async function mr(){if(hs)return hs;const e=await Mu();return!e.authEnabled||!e.supabaseUrl||!e.supabaseAnonKey?null:(hs=dy(e.supabaseUrl,e.supabaseAnonKey,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0}}),hs)}const ui=tu("auth",()=>{const e=Ae(null),t=Ae(null),n=Ae(!1),r=Ae(!1),s=Ae(!1),i=Fe(()=>!r.value||!!e.value);let o=!1;async function a(){var p;const d=await mr();if(!d){t.value=null,e.value=null;return}const{data:f}=await d.auth.getSession();t.value=f.session??null,e.value=((p=f.session)==null?void 0:p.user)??null}async function l(d=!1){if(n.value&&!d)return;s.value=!0;const f=await Mu();if(r.value=!!f.authEnabled,!r.value){n.value=!0,s.value=!1;return}await a();const p=await mr();p&&!o&&(p.auth.onAuthStateChange((m,w)=>{t.value=w,e.value=(w==null?void 0:w.user)??null,n.value=!0}),o=!0),n.value=!0,s.value=!1}async function c(d,f){s.value=!0;try{const p=await mr();if(!p)throw new Error("Authentication is disabled for this workspace.");const{error:m}=await p.auth.signInWithPassword({email:d,password:f});if(m)throw m;await a()}finally{s.value=!1,n.value=!0}}async function u(){if(!r.value){e.value=null,t.value=null;return}const d=await mr();await(d==null?void 0:d.auth.signOut()),e.value=null,t.value=null}async function h(){var d,f;return r.value?(n.value||await l(),(d=t.value)!=null&&d.access_token?t.value.access_token:(await a(),((f=t.value)==null?void 0:f.access_token)??null)):null}return{user:e,session:t,initialized:n,authEnabled:r,loading:s,isAuthenticated:i,init:l,signIn:c,signOut:u,getAccessToken:h}});function ju(e){return/^https?:\/\//i.test(e)||e.startsWith("/")?e:`/${e}`}async function $t(e,t){const n=ui(),r=ju(e),s=new Headers(t==null?void 0:t.headers),i=await n.getAccessToken();i&&s.set("Authorization",`Bearer ${i}`);const o=await fetch(r,{...t,headers:s});if(o.status===401&&n.authEnabled){const a=await mr();if(a){const{data:l,error:c}=await a.auth.refreshSession();if(l.session){const u=new Headers(t==null?void 0:t.headers);return u.set("Authorization",`Bearer ${l.session.access_token}`),fetch(r,{...t,headers:u})}c||await n.signOut()}}return o}async function py(e){const n=await ui().getAccessToken(),r=ju(e),s=/^https?:\/\//i.test(r)?new URL(r):new URL(r,window.location.origin);return n&&s.searchParams.set("token",n),s.toString()}const gy={class:"flex w-12 shrink-0 flex-col items-center border-r border-border bg-sidebar py-3"},my={class:"flex flex-col gap-1"},by={key:0,class:"absolute top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r bg-primary",style:{left:"-4px"}},yy={class:"pointer-events-none absolute left-full ml-2 whitespace-nowrap rounded border border-border bg-popover px-2 py-1 font-mono text-xs text-foreground opacity-0 transition-opacity group-hover:opacity-100"},_y={class:"flex flex-1 flex-col justify-between"},vy={class:"flex flex-col gap-1"},wy={key:0,class:"absolute top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r bg-primary",style:{left:"-4px"}},Ey={class:"pointer-events-none absolute left-full ml-2 whitespace-nowrap rounded border border-border bg-popover px-2 py-1 font-mono text-xs text-foreground opacity-0 transition-opacity group-hover:opacity-100"},Sy={class:"flex flex-col gap-1"},ky={key:0,class:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 font-mono text-[9px] font-bold leading-none text-white"},Ay={key:1,class:"absolute top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r bg-primary",style:{left:"-4px"}},Ty={class:"pointer-events-none absolute left-full ml-2 whitespace-nowrap rounded border border-border bg-popover px-2 py-1 font-mono text-xs text-foreground opacity-0 transition-opacity group-hover:opacity-100"},Ry=On({__name:"AppSidebar",setup(e){const t=pu(),n=Ae(0),r=Ae(0);let s=0;const i=[{to:"/squads",label:"Squads",icon:"grid"},{to:"/wiki",label:"Wiki",icon:"book"},{to:"/skills",label:"Settings",icon:"settings",match:["/skills","/mcp"]}],o=[{to:"/chat",label:"Chat",icon:"terminal"},{to:"/activity",label:"Activity",icon:"activity"},{to:"/schedules",label:"Schedules",icon:"calendar"},{to:"/feed",label:"Feed",icon:"message",badge:"feed"},{to:"/inbox",label:"Inbox",icon:"inbox",badge:"inbox"}];function a(u){return(u.match??[u.to]).some(d=>t.path.startsWith(d))}function l(u){return u.badge==="feed"?n.value:u.badge==="inbox"?r.value:0}async function c(){try{const[u,h]=await Promise.all([$t("/api/feed/count"),$t("/api/inbox/count")]);u.ok&&(n.value=Number((await u.json()).count??0)),h.ok&&(r.value=Number((await h.json()).count??0))}catch{n.value=0,r.value=0}}return Xs(()=>{c(),s=window.setInterval(c,15e3)}),Qs(()=>{window.clearInterval(s)}),(u,h)=>(Y(),te("aside",gy,[$("div",my,[(Y(),te(be,null,Yn(i,d=>he(He(ys),{key:d.to,to:d.to,class:yt(["group relative flex h-9 w-9 items-center justify-center rounded-lg transition-all",a(d)?"bg-primary/15 text-primary":"text-muted-foreground/50 hover:bg-white/[0.04] hover:text-foreground"])},{default:ln(()=>[he(it,{name:d.icon,class:"h-4 w-4"},null,8,["name"]),a(d)?(Y(),te("div",by)):rt("",!0),$("span",yy,Le(d.label),1)]),_:2},1032,["to","class"])),64))]),h[0]||(h[0]=$("div",{class:"my-3 h-px w-6 bg-border/80"},null,-1)),$("div",_y,[$("div",vy,[(Y(!0),te(be,null,Yn(o.slice(0,3),d=>(Y(),tr(He(ys),{key:d.to,to:d.to,class:yt(["group relative flex h-9 w-9 items-center justify-center rounded-lg transition-all",a(d)?"bg-primary/15 text-primary":"text-muted-foreground/50 hover:bg-white/[0.04] hover:text-foreground"])},{default:ln(()=>[he(it,{name:d.icon,class:"h-4 w-4"},null,8,["name"]),a(d)?(Y(),te("div",wy)):rt("",!0),$("span",Ey,Le(d.label),1)]),_:2},1032,["to","class"]))),128))]),$("div",Sy,[(Y(!0),te(be,null,Yn(o.slice(3),d=>(Y(),tr(He(ys),{key:d.to,to:d.to,class:yt(["group relative flex h-9 w-9 items-center justify-center rounded-lg transition-all",a(d)?"bg-primary/15 text-primary":"text-muted-foreground/50 hover:bg-white/[0.04] hover:text-foreground"])},{default:ln(()=>[he(it,{name:d.icon,class:"h-4 w-4"},null,8,["name"]),l(d)>0?(Y(),te("span",ky,Le(l(d)),1)):rt("",!0),a(d)?(Y(),te("div",Ay)):rt("",!0),$("span",Ty,Le(d.label),1)]),_:2},1032,["to","class"]))),128))])])]))}});function xy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Du(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],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Du(n)}),e}class Al{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Uu(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function an(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const Oy="</span>",Tl=e=>!!e.scope,Cy=(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((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class Ny{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=Uu(t)}openNode(t){if(!Tl(t))return;const n=Cy(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Tl(t)&&(this.buffer+=Oy)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const Rl=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Lo{constructor(){this.rootNode=Rl(),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=Rl({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(r=>this._walk(t,r)),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=>{Lo._collapse(n)}))}}class Iy extends Lo{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Ny(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Kr(e){return e?typeof e=="string"?e:e.source:null}function Bu(e){return Cn("(?=",e,")")}function Py(e){return Cn("(?:",e,")*")}function Ly(e){return Cn("(?:",e,")?")}function Cn(...e){return e.map(n=>Kr(n)).join("")}function $y(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"("+($y(e).capture?"":"?:")+e.map(r=>Kr(r)).join("|")+")"}function Hu(e){return new RegExp(e.toString()+"|").exec("").length-1}function My(e,t){const n=e&&e.exec(t);return n&&n.index===0}const jy=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Mo(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Kr(r),o="";for(;i.length>0;){const a=jy.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])+s):(o+=a[0],a[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const Dy=/\b\B/,Fu="[a-zA-Z]\\w*",jo="[a-zA-Z_]\\w*",qu="\\b\\d+(\\.\\d+)?",Ku="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Wu="\\b(0b[01]+)",Uy="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",By=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Cn(t,/.*\b/,e.binary,/\b.*/)),an({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Wr={begin:"\\\\[\\s\\S]",relevance:0},Hy={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Wr]},Fy={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Wr]},qy={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/},hi=function(e,t,n={}){const r=an({scope:"comment",begin:e,end:t,contains:[]},n);r.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 s=$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 r.contains.push({begin:Cn(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Ky=hi("//","$"),Wy=hi("/\\*","\\*/"),Vy=hi("#","$"),Gy={scope:"number",begin:qu,relevance:0},zy={scope:"number",begin:Ku,relevance:0},Jy={scope:"number",begin:Wu,relevance:0},Yy={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Wr,{begin:/\[/,end:/\]/,relevance:0,contains:[Wr]}]},Zy={scope:"title",begin:Fu,relevance:0},Xy={scope:"title",begin:jo,relevance:0},Qy={begin:"\\.\\s*"+jo,relevance:0},e_=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 ds=Object.freeze({__proto__:null,APOS_STRING_MODE:Hy,BACKSLASH_ESCAPE:Wr,BINARY_NUMBER_MODE:Jy,BINARY_NUMBER_RE:Wu,COMMENT:hi,C_BLOCK_COMMENT_MODE:Wy,C_LINE_COMMENT_MODE:Ky,C_NUMBER_MODE:zy,C_NUMBER_RE:Ku,END_SAME_AS_BEGIN:e_,HASH_COMMENT_MODE:Vy,IDENT_RE:Fu,MATCH_NOTHING_RE:Dy,METHOD_GUARD:Qy,NUMBER_MODE:Gy,NUMBER_RE:qu,PHRASAL_WORDS_MODE:qy,QUOTE_STRING_MODE:Fy,REGEXP_MODE:Yy,RE_STARTERS_RE:Uy,SHEBANG:By,TITLE_MODE:Zy,UNDERSCORE_IDENT_RE:jo,UNDERSCORE_TITLE_MODE:Xy});function t_(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function n_(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function r_(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=t_,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function s_(e,t){Array.isArray(e.illegal)&&(e.illegal=$o(...e.illegal))}function i_(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 o_(e,t){e.relevance===void 0&&(e.relevance=1)}const a_=(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(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Cn(n.beforeMatch,Bu(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},l_=["of","and","for","in","not","or","if","then","parent","list","value"],c_="keyword";function Vu(e,t,n=c_){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(i){Object.assign(r,Vu(e[i],t,i))}),r;function s(i,o){t&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){const l=a.split("|");r[l[0]]=[i,u_(l[0],l[1])]})}}function u_(e,t){return t?Number(t):h_(e)?0:1}function h_(e){return l_.includes(e.toLowerCase())}const xl={},xn=e=>{console.error(e)},Ol=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Dn=(e,t)=>{xl[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),xl[`${e}/${t}`]=!0)},Ms=new Error;function Gu(e,t,{key:n}){let r=0;const s=e[n],i={},o={};for(let a=1;a<=t.length;a++)o[a+r]=s[a],i[a+r]=!0,r+=Hu(t[a-1]);e[n]=o,e[n]._emit=i,e[n]._multi=!0}function d_(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw xn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ms;if(typeof e.beginScope!="object"||e.beginScope===null)throw xn("beginScope must be object"),Ms;Gu(e,e.begin,{key:"beginScope"}),e.begin=Mo(e.begin,{joinWith:""})}}function f_(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw xn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ms;if(typeof e.endScope!="object"||e.endScope===null)throw xn("endScope must be object"),Ms;Gu(e,e.end,{key:"endScope"}),e.end=Mo(e.end,{joinWith:""})}}function p_(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function g_(e){p_(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),d_(e),f_(e)}function m_(e){function t(o,a){return new RegExp(Kr(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+=Hu(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=t(Mo(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((h,d)=>d>0&&h!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{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 s(o){const a=new r;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;[n_,i_,g_,a_].forEach(u=>u(o,a)),e.compilerExtensions.forEach(u=>u(o,a)),o.__beforeBegin=null,[r_,s_,o_].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=Vu(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=Kr(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 b_(u==="self"?o:u)})),o.contains.forEach(function(u){i(u,l)}),o.starts&&i(o.starts,a),l.matcher=s(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=an(e.classNameAliases||{}),i(e)}function zu(e){return e?e.endsWithParent||zu(e.starts):!1}function b_(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return an(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:zu(e)?an(e,{starts:e.starts?an(e.starts):null}):Object.isFrozen(e)?an(e):e}var y_="11.11.1";class __ extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Ii=Uu,Cl=an,Nl=Symbol("nomatch"),v_=7,Ju=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!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:Iy};function l(A){return a.noHighlightRe.test(A)}function c(A){let P=A.className+" ";P+=A.parentNode?A.parentNode.className:"";const M=a.languageDetectRe.exec(P);if(M){const re=q(M[1]);return re||(Ol(i.replace("{}",M[1])),Ol("Falling back to no-highlight mode for this block.",A)),re?M[1]:"no-highlight"}return P.split(/\s+/).find(re=>l(re)||q(re))}function u(A,P,M){let re="",ue="";typeof P=="object"?(re=A,M=P.ignoreIllegals,ue=P.language):(Dn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Dn("10.7.0",`Please use highlight(code, options) instead.
|
|
74
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),ue=A,re=P),M===void 0&&(M=!0);const me={code:re,language:ue};ge("before:highlight",me);const ye=me.result?me.result:h(me.language,me.code,M);return ye.code=me.code,ge("after:highlight",ye),ye}function h(A,P,M,re){const ue=Object.create(null);function me(I,U){return I.keywords[U]}function ye(){if(!x.keywords){L.addText(k);return}let I=0;x.keywordPatternRe.lastIndex=0;let U=x.keywordPatternRe.exec(k),z="";for(;U;){z+=k.substring(I,U.index);const ie=S.case_insensitive?U[0].toLowerCase():U[0],fe=me(x,ie);if(fe){const[Ie,ut]=fe;if(L.addText(z),z="",ue[ie]=(ue[ie]||0)+1,ue[ie]<=v_&&(ee+=ut),Ie.startsWith("_"))z+=U[0];else{const dn=S.classNameAliases[Ie]||Ie;Ue(U[0],dn)}}else z+=U[0];I=x.keywordPatternRe.lastIndex,U=x.keywordPatternRe.exec(k)}z+=k.substring(I),L.addText(z)}function qe(){if(k==="")return;let I=null;if(typeof x.subLanguage=="string"){if(!t[x.subLanguage]){L.addText(k);return}I=h(x.subLanguage,k,!0,H[x.subLanguage]),H[x.subLanguage]=I._top}else I=f(k,x.subLanguage.length?x.subLanguage:null);x.relevance>0&&(ee+=I.relevance),L.__addSublanguage(I._emitter,I.language)}function Ne(){x.subLanguage!=null?qe():ye(),k=""}function Ue(I,U){I!==""&&(L.startScope(U),L.addText(I),L.endScope())}function Ye(I,U){let z=1;const ie=U.length-1;for(;z<=ie;){if(!I._emit[z]){z++;continue}const fe=S.classNameAliases[I[z]]||I[z],Ie=U[z];fe?Ue(Ie,fe):(k=Ie,ye(),k=""),z++}}function O(I,U){return I.scope&&typeof I.scope=="string"&&L.openNode(S.classNameAliases[I.scope]||I.scope),I.beginScope&&(I.beginScope._wrap?(Ue(k,S.classNameAliases[I.beginScope._wrap]||I.beginScope._wrap),k=""):I.beginScope._multi&&(Ye(I.beginScope,U),k="")),x=Object.create(I,{parent:{value:x}}),x}function G(I,U,z){let ie=My(I.endRe,z);if(ie){if(I["on:end"]){const fe=new Al(I);I["on:end"](U,fe),fe.isMatchIgnored&&(ie=!1)}if(ie){for(;I.endsParent&&I.parent;)I=I.parent;return I}}if(I.endsWithParent)return G(I.parent,U,z)}function V(I){return x.matcher.regexIndex===0?(k+=I[0],1):(se=!0,0)}function Q(I){const U=I[0],z=I.rule,ie=new Al(z),fe=[z.__beforeBegin,z["on:begin"]];for(const Ie of fe)if(Ie&&(Ie(I,ie),ie.isMatchIgnored))return V(U);return z.skip?k+=U:(z.excludeBegin&&(k+=U),Ne(),!z.returnBegin&&!z.excludeBegin&&(k=U)),O(z,I),z.returnBegin?0:U.length}function de(I){const U=I[0],z=P.substring(I.index),ie=G(x,I,z);if(!ie)return Nl;const fe=x;x.endScope&&x.endScope._wrap?(Ne(),Ue(U,x.endScope._wrap)):x.endScope&&x.endScope._multi?(Ne(),Ye(x.endScope,I)):fe.skip?k+=U:(fe.returnEnd||fe.excludeEnd||(k+=U),Ne(),fe.excludeEnd&&(k=U));do x.scope&&L.closeNode(),!x.skip&&!x.subLanguage&&(ee+=x.relevance),x=x.parent;while(x!==ie.parent);return ie.starts&&O(ie.starts,I),fe.returnEnd?0:U.length}function g(){const I=[];for(let U=x;U!==S;U=U.parent)U.scope&&I.unshift(U.scope);I.forEach(U=>L.openNode(U))}let b={};function _(I,U){const z=U&&U[0];if(k+=I,z==null)return Ne(),0;if(b.type==="begin"&&U.type==="end"&&b.index===U.index&&z===""){if(k+=P.slice(U.index,U.index+1),!s){const ie=new Error(`0 width match regex (${A})`);throw ie.languageName=A,ie.badRule=b.rule,ie}return 1}if(b=U,U.type==="begin")return Q(U);if(U.type==="illegal"&&!M){const ie=new Error('Illegal lexeme "'+z+'" for mode "'+(x.scope||"<unnamed>")+'"');throw ie.mode=x,ie}else if(U.type==="end"){const ie=de(U);if(ie!==Nl)return ie}if(U.type==="illegal"&&z==="")return k+=`
|
|
75
|
+
`,1;if(Z>1e5&&Z>U.index*3)throw new Error("potential infinite loop, way more iterations than matches");return k+=z,z.length}const S=q(A);if(!S)throw xn(i.replace("{}",A)),new Error('Unknown language: "'+A+'"');const N=m_(S);let R="",x=re||N;const H={},L=new a.__emitter(a);g();let k="",ee=0,K=0,Z=0,se=!1;try{if(S.__emitTokens)S.__emitTokens(P,L);else{for(x.matcher.considerAll();;){Z++,se?se=!1:x.matcher.considerAll(),x.matcher.lastIndex=K;const I=x.matcher.exec(P);if(!I)break;const U=P.substring(K,I.index),z=_(U,I);K=I.index+z}_(P.substring(K))}return L.finalize(),R=L.toHTML(),{language:A,value:R,relevance:ee,illegal:!1,_emitter:L,_top:x}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:A,value:Ii(P),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:K,context:P.slice(K-100,K+100),mode:I.mode,resultSoFar:R},_emitter:L};if(s)return{language:A,value:Ii(P),illegal:!1,relevance:0,errorRaised:I,_emitter:L,_top:x};throw I}}function d(A){const P={value:Ii(A),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return P._emitter.addText(A),P}function f(A,P){P=P||a.languages||Object.keys(t);const M=d(A),re=P.filter(q).filter(X).map(Ne=>h(Ne,A,!1));re.unshift(M);const ue=re.sort((Ne,Ue)=>{if(Ne.relevance!==Ue.relevance)return Ue.relevance-Ne.relevance;if(Ne.language&&Ue.language){if(q(Ne.language).supersetOf===Ue.language)return 1;if(q(Ue.language).supersetOf===Ne.language)return-1}return 0}),[me,ye]=ue,qe=me;return qe.secondBest=ye,qe}function p(A,P,M){const re=P&&n[P]||M;A.classList.add("hljs"),A.classList.add(`language-${re}`)}function m(A){let P=null;const M=c(A);if(l(M))return;if(ge("before:highlightElement",{el:A,language:M}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.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(A)),a.throwUnescapedHTML))throw new __("One of your code blocks includes unescaped HTML.",A.innerHTML);P=A;const re=P.textContent,ue=M?u(re,{language:M,ignoreIllegals:!0}):f(re);A.innerHTML=ue.value,A.dataset.highlighted="yes",p(A,M,ue.language),A.result={language:ue.language,re:ue.relevance,relevance:ue.relevance},ue.secondBest&&(A.secondBest={language:ue.secondBest.language,relevance:ue.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ue,text:re})}function w(A){a=Cl(a,A)}const E=()=>{T(),Dn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){T(),Dn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let v=!1;function T(){function A(){T()}if(document.readyState==="loading"){v||window.addEventListener("DOMContentLoaded",A,!1),v=!0;return}document.querySelectorAll(a.cssSelector).forEach(m)}function D(A,P){let M=null;try{M=P(e)}catch(re){if(xn("Language definition for '{}' could not be registered.".replace("{}",A)),s)xn(re);else throw re;M=o}M.name||(M.name=A),t[A]=M,M.rawDefinition=P.bind(null,e),M.aliases&&C(M.aliases,{languageName:A})}function B(A){delete t[A];for(const P of Object.keys(n))n[P]===A&&delete n[P]}function j(){return Object.keys(t)}function q(A){return A=(A||"").toLowerCase(),t[A]||t[n[A]]}function C(A,{languageName:P}){typeof A=="string"&&(A=[A]),A.forEach(M=>{n[M.toLowerCase()]=P})}function X(A){const P=q(A);return P&&!P.disableAutodetect}function ae(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=P=>{A["before:highlightBlock"](Object.assign({block:P.el},P))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=P=>{A["after:highlightBlock"](Object.assign({block:P.el},P))})}function F(A){ae(A),r.push(A)}function ce(A){const P=r.indexOf(A);P!==-1&&r.splice(P,1)}function ge(A,P){const M=A;r.forEach(function(re){re[M]&&re[M](P)})}function Ce(A){return Dn("10.7.0","highlightBlock will be removed entirely in v12.0"),Dn("10.7.0","Please use highlightElement now."),m(A)}Object.assign(e,{highlight:u,highlightAuto:f,highlightAll:T,highlightElement:m,highlightBlock:Ce,configure:w,initHighlighting:E,initHighlightingOnLoad:y,registerLanguage:D,unregisterLanguage:B,listLanguages:j,getLanguage:q,registerAliases:C,autoDetection:X,inherit:Cl,addPlugin:F,removePlugin:ce}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=y_,e.regex={concat:Cn,lookahead:Bu,either:$o,optional:Ly,anyNumberOfTimes:Py};for(const A in ds)typeof ds[A]=="object"&&Du(ds[A]);return Object.assign(e,ds),e},sr=Ju({});sr.newInstance=()=>Ju({});var w_=sr;sr.HighlightJS=sr;sr.default=sr;const $e=xy(w_),js="[A-Za-z$_][0-9A-Za-z$_]*",Yu=["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"],Zu=["true","false","null","undefined","NaN","Infinity"],Xu=["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"],Qu=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],eh=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],th=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],nh=[].concat(eh,Xu,Qu);function E_(e){const t=e.regex,n=(M,{after:re})=>{const ue="</"+M[0].slice(1);return M.input.indexOf(ue,re)!==-1},r=js,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,re)=>{const ue=M[0].length+M.index,me=M.input[ue];if(me==="<"||me===","){re.ignoreMatch();return}me===">"&&(n(M,{after:ue})||re.ignoreMatch());let ye;const qe=M.input.substring(ue);if(ye=qe.match(/^\s*=/)){re.ignoreMatch();return}if((ye=qe.match(/^\s+extends\s+/))&&ye.index===0){re.ignoreMatch();return}}},a={$pattern:js,keyword:Yu,literal:Zu,built_in:nh,"variable.language":th},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={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},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,m,w,{match:/\$\d+/},h];d.contains=v.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(v)});const T=[].concat(y,d.contains),D=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(T)}]),B={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:D},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},q={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:{_:[...Xu,...Qu]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},X={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[B],illegal:/%/},ae={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(M){return t.concat("(?!",M.join("|"),")")}const ce={match:t.concat(/\b/,F([...eh,"super","import"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ge={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},B]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[B]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:q},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,m,w,y,{match:/\$\d+/},h,q,{scope:"attr",match:r+t.lookahead(":"),relevance:0},P,{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:A,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:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.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"]}]}]},X,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[B,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ge,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[B]},ce,ae,j,Ce,{match:/\$[(.]/}]}}function rh(e){const t=e.regex,n=E_(e),r=js,s=["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:s},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:js,keyword:Yu.concat(l),literal:Zu,built_in:nh.concat(s),"variable.language":th},u={className:"meta",begin:"@"+r},h=(m,w,E)=>{const y=m.contains.findIndex(v=>v.label===w);if(y===-1)throw new Error("can not find mode to replace");m.contains.splice(y,1,E)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const d=n.contains.find(m=>m.scope==="attr"),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([u,i,o,f]),h(n,"shebang",e.SHEBANG()),h(n,"use_strict",a);const p=n.contains.find(m=>m.label==="func.def");return p.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}const Il="[A-Za-z$_][0-9A-Za-z$_]*",S_=["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"],k_=["true","false","null","undefined","NaN","Infinity"],sh=["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"],ih=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],oh=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],A_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],T_=[].concat(oh,sh,ih);function ah(e){const t=e.regex,n=(M,{after:re})=>{const ue="</"+M[0].slice(1);return M.input.indexOf(ue,re)!==-1},r=Il,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,re)=>{const ue=M[0].length+M.index,me=M.input[ue];if(me==="<"||me===","){re.ignoreMatch();return}me===">"&&(n(M,{after:ue})||re.ignoreMatch());let ye;const qe=M.input.substring(ue);if(ye=qe.match(/^\s*=/)){re.ignoreMatch();return}if((ye=qe.match(/^\s+extends\s+/))&&ye.index===0){re.ignoreMatch();return}}},a={$pattern:Il,keyword:S_,literal:k_,built_in:T_,"variable.language":A_},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={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},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,m,w,{match:/\$\d+/},h];d.contains=v.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(v)});const T=[].concat(y,d.contains),D=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(T)}]),B={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:D},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},q={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:{_:[...sh,...ih]}},C={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},X={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[B],illegal:/%/},ae={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(M){return t.concat("(?!",M.join("|"),")")}const ce={match:t.concat(/\b/,F([...oh,"super","import"].map(M=>`${M}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ge={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ce={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},B]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[B]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:q},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),C,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,m,w,y,{match:/\$\d+/},h,q,{scope:"attr",match:r+t.lookahead(":"),relevance:0},P,{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:A,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:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.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"]}]}]},X,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[B,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ge,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[B]},ce,ae,j,Ce,{match:/\$[(.]/}]}}function lh(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["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:r,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},h={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]},d="[0-9](_?[0-9])*",f=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,p=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${f}))[eE][+-]?(${d})[jJ]?(?=${p})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${d})[jJ](?=${p})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,h,e.HASH_COMMENT_MODE]}]};return c.contains=[h,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},h,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{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:[m,E,h]}]}}function ch(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={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,s]};s.contains.push(a);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},h={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},d=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${d.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],E={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],T=["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"],D=["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:m,literal:w,built_in:[...y,...v,"set","shopt",...T,...D]},contains:[f,e.SHEBANG(),p,h,i,o,E,a,l,c,u,n]}}function R_(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const x_=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_-]*/}}),O_=["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"],C_=["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"],N_=[...O_,...C_],I_=["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(),P_=["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(),L_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$_=["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 M_(e){const t=e.regex,n=x_(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="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,r,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:":("+P_.join("|")+")"},{begin:":(:)?("+L_.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$_.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:s,attribute:I_.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+N_.join("|")+")\\b"}]}}function uh(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={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:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{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},s,{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 j_(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={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"],h=["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"],d=["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,p=[...c,...l].filter(D=>!u.includes(D)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function y(D){return t.concat(/\b/,t.either(...D.map(B=>B.replace(/\s+/,"\\s+"))),/\b/)}const v={scope:"keyword",match:y(d),relevance:0};function T(D,{exceptions:B,when:j}={}){const q=j;return B=B||[],D.map(C=>C.match(/\|\d+$/)||B.includes(C)?C:q(C)?`${C}|0`:C)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:T(p,{when:D=>D.length<3}),literal:i,type:a,built_in:h},contains:[{scope:"type",match:y(o)},v,E,m,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function hh(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={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,s]},a=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),d={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},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},w=[r,{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}},d,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,m,i,o],E=[...w];return E.pop(),E.push(a),f.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}function dh(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={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}]},h=e.inherit(c,{contains:[]}),d=e.inherit(u,{contains:[]});c.contains.push(d),u.contains.push(h);let f=[n,l];return[c,u,h,d].forEach(E=>{E.contains=E.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:"$"},s,r,l,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}$e.registerLanguage("typescript",rh);$e.registerLanguage("ts",rh);$e.registerLanguage("javascript",ah);$e.registerLanguage("js",ah);$e.registerLanguage("python",lh);$e.registerLanguage("py",lh);$e.registerLanguage("bash",ch);$e.registerLanguage("sh",ch);$e.registerLanguage("json",R_);$e.registerLanguage("css",M_);$e.registerLanguage("html",uh);$e.registerLanguage("xml",uh);$e.registerLanguage("sql",j_);$e.registerLanguage("yaml",hh);$e.registerLanguage("yml",hh);$e.registerLanguage("markdown",dh);$e.registerLanguage("md",dh);function mt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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,r)=>`<a href="${/^https?:\/\//i.test(r)||r.startsWith("/")||r.startsWith("#")?r:"#"}" target="_blank" rel="noopener" class="text-blue-400 hover:underline">${n}</a>`)}function fh(e){const t=e.trim();return t.startsWith("|")&&t.endsWith("|")&&t.length>2}function Pl(e){return fh(e)&&/^\|[\s|:\-]+\|$/.test(e.trim())}function Pi(e){return e.trim().slice(1,-1).split("|").map(t=>t.trim())}function D_(e){const t=e.trim();return t.startsWith(":")&&t.endsWith(":")?"text-center":t.endsWith(":")?"text-right":"text-left"}function U_(e){if(e.length<2)return e.map(a=>`<p class="my-1">${mt(a)}</p>`).join(`
|
|
76
|
+
`);const t=Pi(e[0]),n=e[1],r=Pl(n)?Pi(n).map(D_):t.map(()=>"text-left"),s=Pl(n)?e.slice(2):e.slice(1),i=t.map((a,l)=>`<th class="px-3 py-1.5 font-medium text-gray-300 ${r[l]??"text-left"}">${mt(a)}</th>`).join(""),o=s.map(a=>{const l=Pi(a);return`<tr class="border-b border-gray-800">${t.map((u,h)=>`<td class="px-3 py-1.5 text-gray-400 ${r[h]??"text-left"}">${mt(l[h]??"")}</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 ph(e){if(!e)return"";const t=e.split(`
|
|
77
|
+
`),n=[];let r=!1,s=null,i=!1,o=!1,a=[],l="",c=[];function u(){s&&(n.push(`</${s}>`),s=null)}function h(){o&&(n.push(U_(c)),c=[],o=!1)}function d(){i&&(n.push("</blockquote>"),i=!1)}for(const f of t){if(f.startsWith("```")){if(u(),h(),!r)r=!0,l=f.slice(3).trim().split(/\s+/)[0].toLowerCase(),a=[];else{const D=a.join(`
|
|
78
|
+
`);let B;try{B=l&&$e.getLanguage(l)?$e.highlight(D,{language:l,ignoreIllegals:!0}).value:$e.highlightAuto(D).value}catch{B=D.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const j=l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),q=j?`<span class="text-[10px] text-txt-muted font-mono absolute top-2 right-3 select-none">${j}</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">${B}</code></pre>${q}</div>`),r=!1,l="",a=[]}continue}if(r){a.push(f);continue}if(fh(f)){u(),o=!0,c.push(f);continue}o&&h();const p=f.match(/^####\s+(.+)/),m=f.match(/^###\s+(.+)/),w=f.match(/^##\s+(.+)/),E=f.match(/^#\s+(.+)/);if(p){u(),d(),n.push(`<h4 class="text-sm font-semibold text-gray-200 mt-4 mb-1">${mt(p[1])}</h4>`);continue}if(m){u(),d(),n.push(`<h3 class="text-base font-semibold text-gray-100 mt-5 mb-2">${mt(m[1])}</h3>`);continue}if(w){u(),d(),n.push(`<h2 class="text-lg font-bold text-gray-100 mt-6 mb-2 pb-1 border-b border-gray-800">${mt(w[1])}</h2>`);continue}if(E){u(),d(),n.push(`<h1 class="text-xl font-bold text-gray-100 mt-6 mb-3">${mt(E[1])}</h1>`);continue}if(/^---+$/.test(f.trim())){u(),d(),n.push('<hr class="border-gray-800 my-4" />');continue}const y=f.match(/^[-*+]\s+(.+)/);if(y){s==="ol"&&u(),d(),s||(n.push('<ul class="list-disc list-inside my-2 space-y-1 pl-2">'),s="ul"),n.push(`<li>${mt(y[1])}</li>`);continue}const v=f.match(/^\d+\.\s+(.+)/);if(v){s==="ul"&&u(),d(),s||(n.push('<ol class="list-decimal list-inside my-2 space-y-1 pl-2">'),s="ol"),n.push(`<li>${mt(v[1])}</li>`);continue}const T=f.match(/^>\s?(.*)/);if(T){u(),i||(n.push('<blockquote class="border-l-2 border-txt-muted pl-3 my-2 text-txt-muted italic">'),i=!0),n.push(`<p class="my-0">${mt(T[1])}</p>`);continue}if(f.trim()===""){u(),d(),n.push('<div class="my-2"></div>');continue}u(),d(),n.push(`<p class="my-1">${mt(f)}</p>`)}if(r&&a.length){const f=a.join(`
|
|
79
|
+
`).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");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">${f}</code></pre>`)}return h(),u(),d(),n.join(`
|
|
80
|
+
`)}function Vv(e){const t=(e??"").toLowerCase();return["error","failed","failure","cancelled","aborted"].some(n=>t.includes(n))?"error":["success","completed","done","healthy"].some(n=>t.includes(n))?"success":["working","running","active","queued","pending","in_progress","processing"].some(n=>t.includes(n))?"working":"idle"}function Gv(e){const t=(e??"").toLowerCase();return["failed","error","aborted","cancelled"].some(n=>t.includes(n))?"failed":["success","completed","merged"].some(n=>t.includes(n))?"success":["pause","idle"].some(n=>t.includes(n))?"paused":"running"}function Ll(e){switch((e??"").toLowerCase()){case"gi joe":return"#5fff87";case"thundercats":return"#ffd000";case"a-team":return"#ff6b35";case"ghostbusters":return"#c4a7ff";default:return"#00d9ff"}}function zv(e){switch(e){case"failed":return"#ff3864";case"success":return"#5fff87";case"paused":return"#8a8a99";default:return"#00d9ff"}}function B_(e,t){const n=e.replace("#","");if(n.length!==6)return e;const r=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),i=Number.parseInt(n.slice(4,6),16);return`rgba(${r}, ${s}, ${i}, ${t})`}function gh(e){return(e??"io").replace(/[_/]+/g," ").replace(/-/g," ").replace(/\.[^.]+$/,"").replace(/\w/g,t=>t.toUpperCase())}function mh(e){if(!e)return"just now";const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=t.getTime()-Date.now(),r=n<=0,s=Math.abs(n),i=6e4,o=60*i,a=24*o;let l=0,c="m";return s<o?(l=Math.max(1,Math.round(s/i)),c="m"):s<a?(l=Math.round(s/o),c="h"):(l=Math.round(s/a),c="d"),r?`${l}${c} ago`:`in ${l}${c}`}function Jv(e,t){const n=`${e} ${t??""}`.toLowerCase();return/(read|write|edit|glob|file|path|fs)/.test(n)?"File System":/(grep|search|code|analy|lint|semantic|test|debug)/.test(n)?"Code Intelligence":/(git|branch|commit|pr|issue|ci|build|release)/.test(n)?"Git & CI":"Communication"}function Yv(e){const t=[];for(const n of e){const r=n.path.split("/").filter(Boolean);let s=t,i="";for(const[o,a]of r.entries()){i=i?`${i}/${a}`:a;let l=s.find(c=>c.id===i);l||(l={id:i,label:o===r.length-1?n.title:gh(a),path:o===r.length-1?n.path:void 0,children:[]},s.push(l)),s=l.children}}return t}function Zv(e,t){return e.some(n=>n.status==="error")?"error":e.some(n=>n.status==="working")?"working":e.some(n=>n.status==="success")?"success":((t==null?void 0:t.instances_active)??0)>0?"working":"idle"}const H_={key:0,class:"fixed inset-y-0 right-0 z-50 flex w-[420px] max-w-[calc(100vw-1rem)] flex-col border-l border-border bg-sidebar"},F_={class:"flex shrink-0 items-center justify-between border-b border-border px-5 py-4"},q_={class:"flex items-center gap-2"},K_={key:0,class:"rounded-full bg-destructive px-1.5 py-0.5 font-mono text-[9px] font-bold text-white"},W_={class:"flex-1 overflow-y-auto"},V_={key:0,class:"px-5 py-8 font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/50"},G_={key:1,class:"px-5 py-8 font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/50"},z_={key:2},J_={class:"sticky top-0 z-10 border-b border-border/40 bg-sidebar/95 px-5 py-2 backdrop-blur"},Y_=["onClick"],Z_={class:"flex items-start gap-3"},X_={class:"mt-1.5 shrink-0"},Q_={key:0,class:"h-1.5 w-1.5 rounded-full bg-primary",style:{boxShadow:"var(--glow-cyan)"}},ev={key:1,class:"h-1.5 w-1.5"},tv={class:"min-w-0 flex-1"},nv={class:"mb-1 flex flex-wrap items-center gap-1.5"},rv={class:"font-mono text-[10px] text-muted-foreground/50"},sv={class:"text-[10px] text-muted-foreground/50"},iv={class:"flex items-center justify-between gap-2"},ov={class:"font-mono text-[10px] text-muted-foreground/40"},av={key:0,class:"text-[10px] text-primary/60"},lv={key:0,class:"mt-2.5 rounded border border-white/[0.06] bg-black/30 p-3 text-xs text-foreground/60"},cv=["innerHTML"],uv=On({__name:"FeedFlyout",props:{open:{type:Boolean}},emits:["close"],setup(e,{emit:t}){const n=e,r=t,s=Ae([]),i=Ae({}),o=Ae(null),a=Ae(!1),l=Fe(()=>{var d;const h=new Map;for(const f of s.value){const p=f.squad_slug??"io",m=i.value[p];h.has(p)||h.set(p,{key:p,label:(m==null?void 0:m.name)??gh(p),universe:m==null?void 0:m.universe,entries:[]}),(d=h.get(p))==null||d.entries.push(f)}return[...h.values()]});async function c(){a.value=!0;try{const[h,d]=await Promise.all([$t("/api/feed?limit=80"),$t("/api/squads")]);if(h.ok&&(s.value=(await h.json()).entries),d.ok){const f=await d.json();i.value=Object.fromEntries(f.squads.map(p=>[p.slug??p.id??p.name.toLowerCase(),{name:p.name,universe:p.universe}]))}}finally{a.value=!1}}async function u(h){o.value=o.value===h.id?null:h.id,h.read_at||(await $t(`/api/feed/${h.id}/read`,{method:"POST"}).catch(()=>null),h.read_at=new Date().toISOString())}return cn(()=>n.open,h=>{h?c():o.value=null}),(h,d)=>(Y(),tr(yd,{to:"body"},[he(bs,{"enter-active-class":"duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:ln(()=>[e.open?(Y(),te("div",{key:0,class:"fixed inset-0 z-40 bg-black/40",onClick:d[0]||(d[0]=f=>r("close"))})):rt("",!0)]),_:1}),he(bs,{"enter-active-class":"duration-300 ease-[cubic-bezier(0.22,1,0.36,1)]","enter-from-class":"translate-x-full","enter-to-class":"translate-x-0","leave-active-class":"duration-200 ease-in","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full"},{default:ln(()=>[e.open?(Y(),te("aside",H_,[$("div",F_,[$("div",q_,[he(it,{name:"message",class:"h-4 w-4 text-primary"}),d[2]||(d[2]=$("span",{class:"text-sm font-semibold"},"Activity Feed",-1)),s.value.filter(f=>!f.read_at).length?(Y(),te("span",K_,Le(s.value.filter(f=>!f.read_at).length),1)):rt("",!0)]),$("button",{class:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",onClick:d[1]||(d[1]=f=>r("close"))},[he(it,{name:"x",class:"h-4 w-4"})])]),$("div",W_,[a.value?(Y(),te("div",V_,"Syncing feed…")):l.value.length?(Y(),te("div",z_,[(Y(!0),te(be,null,Yn(l.value,f=>(Y(),te("section",{key:f.key,class:"border-b border-border/40 last:border-b-0"},[$("div",J_,[$("span",{class:"rounded px-1.5 py-0.5 font-mono text-[10px]",style:Vs({color:He(Ll)(f.universe),backgroundColor:He(B_)(He(Ll)(f.universe),.15)})},Le(f.label),5)]),$("div",null,[(Y(!0),te(be,null,Yn(f.entries,p=>(Y(),te("article",{key:p.id,class:yt(["cursor-pointer px-5 py-3.5 transition-colors hover:bg-white/[0.02]",p.read_at?"":"bg-white/[0.015]"]),onClick:m=>u(p)},[$("div",Z_,[$("div",X_,[p.read_at?(Y(),te("div",ev)):(Y(),te("div",Q_))]),$("div",tv,[$("div",nv,[$("span",rv,Le(p.source_ref??p.instance_id??p.task_id??p.type),1),d[3]||(d[3]=$("span",{class:"font-mono text-[10px] text-muted-foreground/40"},"·",-1)),$("span",sv,Le(p.source_type??"IO"),1)]),$("div",{class:yt(["mb-1 text-sm leading-snug",p.read_at?"text-foreground/70":"text-foreground"])},Le(p.title),3),$("div",iv,[$("span",ov,Le(He(mh)(p.created_at)),1),p.body?(Y(),te("span",av,Le(o.value===p.id?"▲ collapse":"▼ details"),1)):rt("",!0)]),he(bs,{"enter-active-class":"duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:ln(()=>[o.value===p.id&&p.body?(Y(),te("div",lv,[$("div",{class:"wiki-content text-xs font-mono leading-relaxed",innerHTML:He(ph)(p.body)},null,8,cv)])):rt("",!0)]),_:2},1024)])])],10,Y_))),128))])]))),128))])):(Y(),te("div",G_,"No feed activity."))])])):rt("",!0)]),_:1})]))}}),hv=tu("chat",()=>{const e=Ae([]),t=Ae(!1);let n=null,r=null;function s(d){return e.value.length?d?e.value.find(f=>f.id===d)??null:e.value[e.value.length-1]??null:null}function i(d){const f={id:d.id??crypto.randomUUID(),createdAt:d.createdAt??new Date().toISOString(),streaming:d.streaming??!1,role:d.role,text:d.text,kind:d.kind};return e.value.push(f),f}function o(d,f){const p=s(f??r??void 0);p&&(p.text+=d)}function a(d,f){const p=s(f??r??void 0);p&&(p.streaming=d)}function l(){n==null||n.close(),n=null,r=null,t.value=!1}async function c(d,f=[]){const p=d.trim();if(!p)return;l(),i({role:"user",text:p});const m=i({role:"assistant",text:"",streaming:!0});r=m.id,t.value=!0;const w=await py("/api/events");n=new EventSource(w),n.onmessage=y=>{try{const v=JSON.parse(y.data);if(v.type==="delta"){o(String(v.text??""),m.id);return}if(v.type==="done"){a(!1,m.id),l();return}v.type==="feed"&&i({role:"system",kind:"feed",text:[v.title,v.body].filter(Boolean).join(`
|
|
81
|
+
`)||JSON.stringify(v,null,2)})}catch{o(y.data,m.id)}},n.onerror=()=>{m.text||(m.text="stream disconnected"),a(!1,m.id),l()};const E=await $t("/api/message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:p,attachments:f})});if(!E.ok){const y=await E.text();m.text=y||`Request failed (${E.status})`,a(!1,m.id),l()}}async function u(){await $t("/api/orchestrator/abort",{method:"POST"}).catch(()=>null),a(!1),l()}function h(){l(),e.value=[]}return{messages:e,isLoading:t,addMessage:i,appendToLast:o,setLastStreaming:a,sendMessage:c,abortRun:u,clearMessages:h}}),dv={class:"fixed bottom-4 right-4 z-50 flex w-[360px] max-w-[calc(100vw-1.5rem)] flex-col"},fv={key:0,class:"flex h-[380px] flex-col overflow-hidden rounded-t-xl border border-border border-b-0 bg-sidebar"},pv={class:"flex shrink-0 items-center justify-between border-b border-border/50 px-4 py-2.5"},gv={class:"flex items-center gap-2"},mv={key:0,class:"whitespace-pre-wrap"},bv=["innerHTML"],yv={type:"submit",class:"flex shrink-0 items-center gap-1 rounded bg-primary/15 px-2.5 py-1 font-mono text-xs text-primary transition-colors hover:bg-primary/25"},_v=On({__name:"FloatingChat",setup(e,{expose:t}){const n=hv(),r=Ae(""),s=Ae(!1),i=Ae(null),o=Ae(null),a=Fe(()=>n.messages.length?n.messages:[{id:"welcome",role:"assistant",text:"IO online. What do you need?",createdAt:new Date().toISOString(),streaming:!1}]),l=Fe(()=>a.value.map(f=>`${f.id}:${f.text.length}:${f.streaming}`).join("|"));function c(){o.value&&(o.value.scrollTop=o.value.scrollHeight)}async function u(){const f=r.value.trim();f&&(r.value="",await n.sendMessage(f))}function h(){s.value=!0}function d(){s.value=!1}return cn(s,async f=>{var p;f&&(await er(),(p=i.value)==null||p.focus(),c())}),cn(l,async()=>{s.value&&(await er(),c())}),t({open:h,isOpen:s}),(f,p)=>(Y(),te("div",dv,[he(bs,{"enter-active-class":"duration-200 ease-out","enter-from-class":"translate-y-2 scale-[0.97] opacity-0","enter-to-class":"translate-y-0 scale-100 opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"translate-y-0 scale-100 opacity-100","leave-to-class":"translate-y-2 scale-[0.97] opacity-0"},{default:ln(()=>[s.value?(Y(),te("div",fv,[$("div",pv,[$("div",gv,[he(it,{name:"terminal",class:"h-3.5 w-3.5 text-primary"}),p[1]||(p[1]=$("span",{class:"font-mono text-xs text-foreground/70"},"IO Command",-1))]),$("button",{class:"text-muted-foreground/40 transition-colors hover:text-muted-foreground",onClick:d},[he(it,{name:"chevron-down",class:"h-4 w-4"})])]),$("div",{ref_key:"scrollPanel",ref:o,class:"flex-1 space-y-2.5 overflow-y-auto px-4 py-3"},[(Y(!0),te(be,null,Yn(a.value,m=>(Y(),te("div",{key:m.id,class:yt(["flex",m.role==="user"?"justify-end":"justify-start"])},[$("div",{class:yt(["max-w-[85%] rounded-lg px-3 py-2 text-xs leading-relaxed",m.role==="user"?"rounded-br-sm border border-primary/20 bg-primary/15 font-mono text-primary":"rounded-bl-sm border border-white/[0.06] bg-white/[0.04] text-foreground/75"])},[m.role==="user"?(Y(),te("div",mv,Le(m.text),1)):(Y(),te("div",{key:1,class:"wiki-content text-xs",innerHTML:He(ph)(m.text||(m.streaming?"…":""))},null,8,bv))],2)],2))),128))],512)])):rt("",!0)]),_:1}),$("div",{class:yt(["overflow-hidden border border-border bg-sidebar",s.value?"rounded-b-xl border-t-0":"rounded-xl"])},[s.value?(Y(),te("form",{key:0,class:"flex items-center gap-2 border-t border-border/50 px-3 py-2.5",onSubmit:Qf(u,["prevent"])},[ud($("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":p[0]||(p[0]=m=>r.value=m),type:"text",placeholder:"Command IO...",class:"flex-1 bg-transparent font-mono text-sm text-foreground placeholder:text-muted-foreground/40"},null,512),[[Yf,r.value]]),$("button",yv,[he(it,{name:"zap",class:"h-3 w-3"}),p[2]||(p[2]=Vc(" send ",-1))])],32)):(Y(),te("button",{key:1,class:"flex w-full items-center gap-2.5 px-4 py-3 text-left transition-colors hover:bg-white/[0.03]",onClick:h},[he(it,{name:"terminal",class:"h-4 w-4 text-primary",style:{filter:"drop-shadow(0 0 6px #00d9ff88)"}}),p[3]||(p[3]=$("span",{class:"flex-1 font-mono text-sm text-muted-foreground/60"},"Command IO...",-1)),he(it,{name:"chevron-up",class:"h-4 w-4 text-muted-foreground/30"})]))],2)]))}}),vv={class:"dark flex h-full flex-col overflow-hidden bg-background text-foreground"},wv={class:"flex shrink-0 items-center justify-between border-b border-border bg-sidebar px-5 py-3"},Ev={class:"flex items-center gap-2"},Sv={key:0,class:"absolute -right-1.5 -top-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-destructive font-mono text-[9px] font-bold text-white"},kv={class:"flex min-h-0 flex-1 overflow-hidden"},Av={class:"flex min-w-0 flex-1 flex-col overflow-hidden"},Tv={class:"min-h-0 flex-1 overflow-hidden"},Rv={class:"shrink-0 border-t border-border bg-sidebar px-5 py-2"},xv={class:"flex items-center justify-between font-mono text-[11px]"},Ov={class:"flex items-center gap-4"},Cv={class:"flex items-center gap-1.5"},Nv={class:"text-muted-foreground"},Iv={class:"text-accent-foreground"},Pv={class:"flex items-center gap-4"},Lv={key:0,class:"flex items-center gap-1.5 text-primary"},$v={class:"text-muted-foreground/40"},Mv={key:1,class:"h-full"},jv=On({__name:"App",setup(e){const t=pu(),n=ui(),r=Ae(null),s=Ae(!1),i=Ae(0),o=Ae(null),a=Ae({squads:0,agents:0,instances:0,runningInstances:0,working:0});let l=0;const c=Fe(()=>t.name!=="login"&&n.isAuthenticated),u=Fe(()=>mh(o.value));function h(){var p;(p=r.value)==null||p.open()}function d(p){(p.metaKey||p.ctrlKey)&&p.key==="."&&(p.preventDefault(),h())}async function f(){try{const[p,m,w]=await Promise.all([$t("/api/feed/count"),$t("/api/squads"),$t("/api/tasks")]);if(p.ok&&(i.value=Number((await p.json()).count??0)),m.ok){const E=await m.json();a.value.squads=E.squads.length,a.value.agents=E.squads.reduce((y,v)=>y+Number(v.agents_count??0),0),a.value.instances=E.squads.reduce((y,v)=>y+Number(v.instances_total??0),0),a.value.runningInstances=E.squads.reduce((y,v)=>y+Number(v.instances_active??0),0)}if(w.ok){const E=await w.json();a.value.working=E.tasks.filter(y=>/running|working|queued|pending|in_progress/i.test(y.status)).length}o.value=new Date().toISOString()}catch{}}return Xs(()=>{n.init(),f(),l=window.setInterval(f,3e4),window.addEventListener("keydown",d)}),Qs(()=>{window.clearInterval(l),window.removeEventListener("keydown",d)}),(p,m)=>(Y(),te("div",vv,[c.value?(Y(),te(be,{key:0},[$("div",wv,[m[3]||(m[3]=$("div",{class:"flex items-center gap-4"},[$("div",{class:"select-none pl-1 font-mono text-xl font-bold tracking-tight text-primary text-glow-cyan"},"IO"),$("div",{class:"h-4 w-px bg-border"}),$("div",{class:"font-mono text-xs text-muted-foreground"},"Mission Control · Developer AI Assistant")],-1)),$("div",Ev,[$("button",{class:"relative flex items-center gap-2 rounded border border-border px-3 py-1.5 text-sm text-muted-foreground transition-all hover:border-primary/40 hover:bg-primary/5 hover:text-foreground",onClick:m[0]||(m[0]=w=>s.value=!0)},[he(it,{name:"message",class:"h-4 w-4"}),m[2]||(m[2]=$("span",{class:"text-xs font-medium"},"Feed",-1)),i.value>0?(Y(),te("span",Sv,Le(i.value),1)):rt("",!0)])])]),$("div",kv,[he(Ry),$("div",Av,[$("div",Tv,[he(He(Qi))])])]),$("div",Rv,[$("div",xv,[$("div",Ov,[$("div",Cv,[he(it,{name:"circle",class:"h-2 w-2 text-status-success"}),m[4]||(m[4]=$("span",{class:"text-muted-foreground"},"Daemon running",-1))]),m[5]||(m[5]=$("span",{class:"text-muted-foreground/40"},"·",-1)),$("span",Nv,Le(a.value.squads)+" squads · "+Le(a.value.agents)+" agents",1),m[6]||(m[6]=$("span",{class:"text-muted-foreground/40"},"·",-1)),$("span",Iv,Le(a.value.runningInstances)+"/"+Le(a.value.instances)+" instances active",1)]),$("div",Pv,[a.value.working>0?(Y(),te("div",Lv,[he(it,{name:"activity",class:"h-3 w-3"}),$("span",null,Le(a.value.working)+" working",1)])):rt("",!0),$("span",$v,"Last sync: "+Le(u.value),1)])])]),he(uv,{open:s.value,onClose:m[1]||(m[1]=w=>s.value=!1)},null,8,["open"]),he(_v,{ref_key:"floatingChat",ref:r},null,512)],64)):(Y(),te("div",Mv,[he(He(Qi))]))]))}}),Dv="modulepreload",Uv=function(e){return"/"+e},$l={},Tt=function(t,n,r){let s=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"));s=Promise.allSettled(n.map(l=>{if(l=Uv(l),l in $l)return;$l[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":Dv,c||(h.as="script"),h.crossOrigin="",h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((d,f)=>{h.addEventListener("load",d),h.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 s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},bh=gg({history:Jp(),routes:[{path:"/",redirect:"/chat"},{path:"/login",name:"login",component:()=>Tt(()=>import("./LoginView-BHp6tqp8.js"),[]),meta:{title:"Login",subtitle:"Authenticate against Supabase",public:!0}},{path:"/chat",name:"chat",component:()=>Tt(()=>import("./ChatView-5ySvKPi9.js"),[]),meta:{title:"Chat",subtitle:"Live orchestrator stream"}},{path:"/squads",name:"squads",component:()=>Tt(()=>import("./SquadsView-Bg--LUPA.js"),__vite__mapDeps([0,1])),meta:{title:"Squads",subtitle:"Project crews and worktrees"}},{path:"/activity",name:"activity",component:()=>Tt(()=>import("./AgentActivityView-9D_RDmmt.js"),__vite__mapDeps([2,1])),meta:{title:"Activity",subtitle:"Task execution and event stream"}},{path:"/schedules",name:"schedules",component:()=>Tt(()=>import("./SchedulesView-BpcU8RrX.js"),[]),meta:{title:"Schedules",subtitle:"Cron-driven automation matrix"}},{path:"/skills",name:"skills",component:()=>Tt(()=>import("./SkillsView-BHoQKBHu.js"),__vite__mapDeps([3,4])),meta:{title:"Skills",subtitle:"Installed skill manifests and content"}},{path:"/wiki",name:"wiki",component:()=>Tt(()=>import("./WikiView-CqfWT-Hg.js"),[]),meta:{title:"Wiki",subtitle:"Workspace knowledge browser"}},{path:"/mcp",name:"mcp",component:()=>Tt(()=>import("./McpView-CWYN7lRW.js"),__vite__mapDeps([5,4])),meta:{title:"MCP",subtitle:"Server registry and transport health"}},{path:"/feed",name:"feed",component:()=>Tt(()=>import("./FeedView-BDaNijfW.js"),[]),meta:{title:"Feed",subtitle:"Notifications and durable activity"}},{path:"/inbox",name:"inbox",component:()=>Tt(()=>import("./InboxView-DKP-ahnW.js"),[]),meta:{title:"Inbox",subtitle:"Operator-facing messages"}}]});bh.beforeEach(async e=>{const t=ui();return await t.init(),e.path==="/"?"/chat":t.authEnabled?!t.user&&e.path!=="/login"&&!e.meta.public?{path:"/login",query:{redirect:e.fullPath}}:t.user&&e.path==="/login"?"/chat":!0:e.path==="/login"?"/chat":!0});const Do=rp(jv),Bv=op();Do.use(Bv);Do.use(bh);Do.mount("#app");export{ln as A,B_ as B,zv as C,tr as D,Ll as E,be as F,$t as G,Vv as H,Gv as I,mh as J,Zv as K,Qs as L,py as M,Jv as N,Hv as O,Yv as P,qv as Q,ys as R,Fv as S,bs as T,gh as U,it as _,$ as a,He as b,te as c,On as d,Kv as e,Qf as f,rt as g,Wv as h,pu as i,Y as j,hv as k,cn as l,Yn as m,he as n,Xs as o,Vc as p,Fe as q,Ae as r,yt as s,Le as t,ui as u,Yf as v,ud as w,ph as x,er as y,Vs as z};
|