1var e=Error.captureStackTrace,t=class t extends Error{name;code;docs;fix;sources;get why(){return this.message}constructor(n,r=t){super(n.why,{cause:n.cause}),this.code=this.name=n.code,this.fix=n.fix,this.docs=n.docs,this.sources=n.sources,e?.(this,r)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function n(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}function r(e={}){let{docsBase:r,reporters:i=[]}=e;return new Proxy({},{get(e,a){if(typeof a!=`string`)return;let o=(e={},s={})=>{let c=n(r,a),l=new t({code:a,why:c??``,docs:c,cause:e.cause,sources:e.sources},o);for(let e of i)e(l,s);return l};return o}})}function i(e){return`https://nuxt.com/docs/4.x/errors/${e.replace(`NUXT_`,``).toLowerCase()}`}var a=[e=>{console.error(`[${e.name}]`)}],o=r({docsBase:i,reporters:a});function s(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var c={},l=[],u=()=>{},d=()=>!1,f=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),p=e=>e.startsWith(`onUpdate:`),m=Object.assign,h=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},g=Object.prototype.hasOwnProperty,_=(e,t)=>
vendor: 19,084 bytes, line 1
1g.call(e,t),v=Array.isArray,y=e=>te(e)===`[object Map]`,b=e=>te(e)===`[object Set]`,x=e=>te(e)===`[object Date]`,S=e=>te(e)===`[object RegExp]`,C=e=>typeof e==`function`,w=e=>typeof e==`string`,T=e=>typeof e==`symbol`,E=e=>typeof e==`object`&&!!e,D=e=>(E(e)||C(e))&&C(e.then)&&C(e.catch),ee=Object.prototype.toString,te=e=>ee.call(e),ne=e=>te(e).slice(8,-1),re=e=>te(e)===`[object Object]`,ie=e=>w(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ae=s(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),oe=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},se=/-\w/g,O=oe(e=>e.replace(se,e=>e.slice(1).toUpperCase())),ce=/\B([A-Z])/g,le=oe(e=>e.replace(ce,`-$1`).toLowerCase()),ue=oe(e=>e.charAt(0).toUpperCase()+e.slice(1)),de=oe(e=>e?`on${ue(e)}`:``),fe=(e,t)=>!Object.is(e,t),pe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},me=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},he=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ge=e=>{let t=w(e)?Number(e):NaN;return isNaN(t)?e:t},_e,ve=()=>_e||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function ye(e){if(v(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=w(r)?Ce(r):ye(r);if(i)for(let e in i)t[e]=i[e]}return t}else if(w(e)||E(e))return e}var be=/;(?![^(]*\))/g,xe=/:([^]+)/,Se=/\/\*[^]*?\*\//g;function Ce(e){let t={};return e.replace(Se,``).split(be).forEach(e=>{if(e){let n=e.split(xe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function we(e){let t=``;if(w(e))t=e;else if(v(e))for(let n=0;n<e.length;n++){let r=we(e[n]);r&&(t+=r+` `)}else if(E(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var Te=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Ee=s(Te);Te+``;function De(e){return!!e||e===``}function Oe(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=ke(e[r],t[r]);return n}function ke(e,t){if(e===t)return!0;let n=x(e),r=x(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=T(e),r=T(t),n||r)return e===t;if(n=v(e),r=v(t),n||r)return n&&r?Oe(e,t):!1;if(n=E(e),r=E(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!ke(e[n],t[n]))return!1}}return String(e)===String(t)}function Ae(e,t){return e.findIndex(e=>ke(e,t))}var je=e=>!!(e&&e.__v_isRef===!0),Me=e=>w(e)?e:e==null?``:v(e)||E(e)&&(e.toString===ee||!C(e.toString))?je(e)?Me(e.value):JSON.stringify(e,Ne,2):String(e),Ne=(e,t)=>je(t)?Ne(e,t.value):y(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Pe(t,r)+` =>`]=n,e),{})}:b(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Pe(e))}:T(t)?Pe(t):E(t)&&!v(t)&&!re(t)?String(t):t,Pe=(e,t=``)=>T(e)?`Symbol(${e.description??t})`:e,k,Fe=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&k&&(k.active?(this.parent=k,this.index=(k.scopes||=[]).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=k;try{return k=this,e()}finally{k=t}}}on(){++this._on===1&&(this.prevScope=k,k=this)}off(){if(this._on>0&&--this._on===0){if(k===this)k=this.prevScope;else{let e=k;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function Ie(e){return new Fe(e)}function Le(){return k}function Re(e,t=!1){k&&k.cleanups.push(e)}var A,ze=new WeakSet,Be=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,k&&(k.active?k.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ze.has(this)&&(ze.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||We(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rt(this),qe(this);let e=A,t=$e;A=this,$e=!0;try{return this.fn()}finally{Je(this),A=e,$e=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ze(e);this.deps=this.depsTail=void 0,rt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ze.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ye(this)&&this.run()}get dirty(){return Ye(this)}},Ve=0,He,Ue;function We(e,t=!1){if(e.flags|=8,t){e.next=Ue,Ue=e;return}e.next=He,He=e}function Ge(){Ve++}function Ke(){if(--Ve>0)return;if(Ue){let e=Ue;for(Ue=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;He;){let t=He;for(He=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function qe(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Je(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ze(r),Qe(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Ye(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Xe(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Xe(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===it)||(e.globalVersion=it,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ye(e))))return;e.flags|=2;let t=e.dep,n=A,r=$e;A=e,$e=!0;try{qe(e);let n=e.fn(e._value);(t.version===0||fe(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{A=n,$e=r,Je(e),e.flags&=-3}}function Ze(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Ze(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Qe(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var $e=!0,et=[];function tt(){et.push($e),$e=!1}function nt(){let e=et.pop();$e=e===void 0||e}function rt(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=A;A=void 0;try{t()}finally{A=e}}}var it=0,at=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},ot=class{constructor(e){this.computed=e,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(e){if(!A||!$e||A===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==A)t=this.activeLink=new at(A,this),A.deps?(t.prevDep=A.depsTail,A.depsTail.nextDep=t,A.depsTail=t):A.deps=A.depsTail=t,st(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=A.depsTail,t.nextDep=void 0,A.depsTail.nextDep=t,A.depsTail=t,A.deps===t&&(A.deps=e)}return t}trigger(e){this.version++,it++,this.notify(e)}notify(e){Ge();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ke()}}};function st(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)st(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var ct=new WeakMap,lt=Symbol(``),ut=Symbol(``),dt=Symbol(``);function j(e,t,n){if($e&&A){let t=ct.get(e);t||ct.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new ot),r.map=t,r.key=n),r.track()}}function ft(e,t,n,r,i,a){let o=ct.get(e);if(!o){it++;return}let s=e=>{e&&e.trigger()};if(Ge(),t===`clear`)o.forEach(s);else{let i=v(e),a=i&&ie(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===dt||!T(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(dt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(lt)),y(e)&&s(o.get(ut)));break;case`delete`:i||(s(o.get(lt)),y(e)&&s(o.get(ut)));break;case`set`:y(e)&&s(o.get(lt));break}}Ke()}function pt(e,t){let n=ct.get(e);return n&&n.get(t)}function mt(e){let t=M(e);return t===e?t:(j(t,`iterate`,dt),$t(e)?t:t.map(nn))}function ht(e){return j(e=M(e),`iterate`,dt),e}function gt(e,t){return Qt(e)?rn(Zt(e)?nn(t):t):nn(t)}var _t={__proto__:null,[Symbol.iterator](){return vt(this,Symbol.iterator,e=>gt(this,e))},concat(...e){return mt(this).concat(...e.map(e=>v(e)?mt(e):e))},entries(){return vt(this,`entries`,e=>(e[1]=gt(this,e[1]),e))},every(e,t){return bt(this,`every`,e,t,void 0,arguments)},filter(e,t){return bt(this,`filter`,e,t,e=>e.map(e=>gt(this,e)),arguments)},find(e,t){return bt(this,`find`,e,t,e=>gt(this,e),arguments)},findIndex(e,t){return bt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return bt(this,`findLast`,e,t,e=>gt(this,e),arguments)},findLastIndex(e,t){return bt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return bt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return St(this,`includes`,e)},indexOf(...e){return St(this,`indexOf`,e)},join(e){return mt(this).join(e)},lastIndexOf(...e){return St(this,`lastIndexOf`,e)},map(e,t){return bt(this,`map`,e,t,void 0,arguments)},pop(){return Ct(this,`pop`)},push(...e){return Ct(this,`push`,e)},reduce(e,...t){return xt(this,`reduce`,e,t)},reduceRight(e,...t){return xt(this,`reduceRight`,e,t)},shift(){return Ct(this,`shift`)},some(e,t){return bt(this,`some`,e,t,void 0,arguments)},splice(...e){return Ct(this,`splice`,e)},toReversed(){return mt(this).toReversed()},toSorted(e){return mt(this).toSorted(e)},toSpliced(...e){return mt(this).toSpliced(...e)},unshift(...e){return Ct(this,`unshift`,e)},values(){return vt(this,`values`,e=>gt(this,e))}};function vt(e,t,n){let r=ht(e),i=r[t]();return r!==e&&!$t(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var yt=Array.prototype;function bt(e,t,n,r,i,a){let o=ht(e),s=o!==e&&!$t(e),c=o[t];if(c!==yt[t]){let t=c.apply(e,a);return s?nn(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,gt(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function xt(e,t,n,r){let i=ht(e),a=i!==e&&!$t(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=gt(e,t)),n.call(this,t,gt(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?gt(e,c):c}function St(e,t,n){let r=M(e);j(r,`iterate`,dt);let i=r[t](...n);return(i===-1||i===!1)&&en(n[0])?(n[0]=M(n[0]),r[t](...n)):i}function Ct(e,t,n=[]){tt(),Ge();let r=M(e)[t].apply(e,n);return Ke(),nt(),r}var wt=s(`__proto__,__v_isRef,__isVue`),Tt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(T));function Et(e){T(e)||(e=String(e));let t=M(this);return j(t,`has`,e),t.hasOwnProperty(e)}var Dt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Gt:Wt:i?Ut:Ht).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=v(e);if(!r){let e;if(a&&(e=_t[t]))return e;if(t===`hasOwnProperty`)return Et}let o=Reflect.get(e,t,N(e)?e:n);if((T(t)?Tt.has(t):wt(t))||(r||j(e,`get`,t),i))return o;if(N(o)){let e=a&&ie(t)?o:o.value;return r&&E(e)?Yt(e):e}return E(o)?r?Yt(o):qt(o):o}},Ot=class extends Dt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=v(e)&&ie(t);if(!this._isShallow){let e=Qt(i);if(!$t(n)&&!Qt(n)&&(i=M(i),n=M(n)),!a&&N(i)&&!N(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:_(e,t),s=Reflect.set(e,t,n,N(e)?e:r);return e===M(r)&&s&&(o?fe(n,i)&&ft(e,`set`,t,n,i):ft(e,`add`,t,n)),s}deleteProperty(e,t){let n=_(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&ft(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!T(t)||!Tt.has(t))&&j(e,`has`,t),n}ownKeys(e){return j(e,`iterate`,v(e)?`length`:lt),Reflect.ownKeys(e)}},kt=class extends Dt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},At=new Ot,jt=new kt,Mt=new Ot(!0),Nt=e=>e,Pt=e=>Reflect.getPrototypeOf(e);function Ft(e,t,n){return function(...r){let i=this.__v_raw,a=M(i),o=y(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Nt:t?rn:nn;return!t&&j(a,`iterate`,c?ut:lt),m(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function It(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Lt(e,t){let n={get(n){let r=this.__v_raw,i=M(r),a=M(n);e||(fe(n,a)&&j(i,`get`,n),j(i,`get`,a));let{has:o}=Pt(i),s=t?Nt:e?rn:nn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&j(M(t),`iterate`,lt),t.size},has(t){let n=this.__v_raw,r=M(n),i=M(t);return e||(fe(t,i)&&j(r,`has`,t),j(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=M(a),s=t?Nt:e?rn:nn;return!e&&j(o,`iterate`,lt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return m(n,e?{add:It(`add`),set:It(`set`),delete:It(`delete`),clear:It(`clear`)}:{add(e){let n=M(this),r=Pt(n),i=M(e),a=!t&&!$t(e)&&!Qt(e)?i:e;return r.has.call(n,a)||fe(e,a)&&r.has.call(n,e)||fe(i,a)&&r.has.call(n,i)||(n.add(a),ft(n,`add`,a,a)),this},set(e,n){!t&&!$t(n)&&!Qt(n)&&(n=M(n));let r=M(this),{has:i,get:a}=Pt(r),o=i.call(r,e);o||=(e=M(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?fe(n,s)&&ft(r,`set`,e,n,s):ft(r,`add`,e,n),this},delete(e){let t=M(this),{has:n,get:r}=Pt(t),i=n.call(t,e);i||=(e=M(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&ft(t,`delete`,e,void 0,a),o},clear(){let e=M(this),t=e.size!==0,n=e.clear();return t&&ft(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Ft(r,e,t)}),n}function Rt(e,t){let n=Lt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(_(n,r)&&r in t?n:t,r,i)}var zt={get:Rt(!1,!1)},Bt={get:Rt(!1,!0)},Vt={get:Rt(!0,!1)},Ht=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,Gt=new WeakMap;function Kt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function qt(e){return Qt(e)?e:Xt(e,!1,At,zt,Ht)}function Jt(e){return Xt(e,!1,Mt,Bt,Ut)}function Yt(e){return Xt(e,!0,jt,Vt,Wt)}function Xt(e,t,n,r,i){if(!E(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Kt(ne(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Zt(e){return Qt(e)?Zt(e.__v_raw):!!(e&&e.__v_isReactive)}function Qt(e){return!!(e&&e.__v_isReadonly)}function $t(e){return!!(e&&e.__v_isShallow)}function en(e){return e?!!e.__v_raw:!1}function M(e){let t=e&&e.__v_raw;return t?M(t):e}function tn(e){return!_(e,`__v_skip`)&&Object.isExtensible(e)&&me(e,`__v_skip`,!0),e}var nn=e=>E(e)?qt(e):e,rn=e=>E(e)?Yt(e):e;function N(e){return e?e.__v_isRef===!0:!1}function an(e){return sn(e,!1)}function on(e){return sn(e,!0)}function sn(e,t){return N(e)?e:new cn(e,t)}var cn=class{constructor(e,t){this.dep=new ot,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:M(e),this._value=t?e:nn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||$t(e)||Qt(e);e=n?e:M(e),fe(e,t)&&(this._rawValue=e,this._value=n?e:nn(e),this.dep.trigger())}};function ln(e){return N(e)?e.value:e}function un(e){return C(e)?e():ln(e)}var dn={get:(e,t,n)=>t===`__v_raw`?e:ln(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return N(i)&&!N(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function fn(e){return Zt(e)?e:new Proxy(e,dn)}var pn=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=T(t)?t:String(t),this._raw=M(e);let r=!0,i=e;if(!v(e)||T(this._key)||!ie(this._key))do r=!en(i)||$t(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=ln(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&N(this._raw[this._key])){let t=this._object[this._key];if(N(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return pt(this._raw,this._key)}},mn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function hn(e,t,n){return N(e)?e:C(e)?new mn(e):E(e)&&arguments.length>1?gn(e,t,n):an(e)}function gn(e,t,n){return new pn(e,t,n)}var _n=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ot(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=it-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&A!==this)return We(this,!0),!0}get value(){let e=this.dep.track();return Xe(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function vn(e,t,n=!1){let r,i;return C(e)?r=e:(r=e.get,i=e.set),new _n(r,i,n)}var yn={},bn=new WeakMap,xn=void 0;function Sn(e,t=!1,n=xn){if(n){let t=bn.get(n);t||bn.set(n,t=[]),t.push(e)}}function Cn(e,t,n=c){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:l}=n,d=e=>i?e:$t(e)||i===!1||i===0?wn(e,1):wn(e),f,p,m,g,_=!1,y=!1;if(N(e)?(p=()=>e.value,_=$t(e)):Zt(e)?(p=()=>d(e),_=!0):v(e)?(y=!0,_=e.some(e=>Zt(e)||$t(e)),p=()=>e.map(e=>{if(N(e))return e.value;if(Zt(e))return d(e);if(C(e))return l?l(e,2):e()})):p=C(e)?t?l?()=>l(e,2):e:()=>{if(m){tt();try{m()}finally{nt()}}let t=xn;xn=f;try{return l?l(e,3,[g]):e(g)}finally{xn=t}}:u,t&&i){let e=p,t=i===!0?1/0:i;p=()=>wn(e(),t)}let b=Le(),x=()=>{f.stop(),b&&b.active&&h(b.effects,f)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return x(),n}}let S=y?Array(e.length).fill(yn):yn,w=e=>{if(!(!(f.flags&1)||!f.dirty&&!e))if(t){let n=f.run();if(e||i||_||(y?n.some((e,t)=>fe(e,S[t])):fe(n,S))){m&&m();let e=xn;xn=f;try{let e=[n,S===yn?void 0:y&&S[0]===yn?[]:S,g];S=n,l?l(t,3,e):t(...e)}finally{xn=e}}}else f.run()};
vendor: 4,078 bytes, line 1
1return s&&s(w),f=new Be(p),f.scheduler=o?()=>o(w,!1):w,g=e=>Sn(e,!1,f),m=f.onStop=()=>{let e=bn.get(f);if(e){if(l)l(e,4);else for(let t of e)t();bn.delete(f)}},t?r?w(!0):S=f.run():o?o(w.bind(null,!0),!0):f.run(),x.pause=f.pause.bind(f),x.resume=f.resume.bind(f),x.stop=x,x}function wn(e,t=1/0,n){if(t<=0||!E(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,N(e))wn(e.value,t,n);else if(v(e))for(let r=0;r<e.length;r++)wn(e[r],t,n);else if(b(e)||y(e))e.forEach(e=>{wn(e,t,n)});else if(re(e)){for(let r in e)wn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&wn(e[r],t,n)}return e}function Tn(e,t,n,r){try{return r?e(...r):e()}catch(e){Dn(e,t,n)}}function En(e,t,n,r){if(C(e)){let i=Tn(e,t,n,r);return i&&D(i)&&i.catch(e=>{Dn(e,t,n)}),i}if(v(e)){let i=[];for(let a=0;a<e.length;a++)i.push(En(e[a],t,n,r));return i}}function Dn(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||c;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){tt(),Tn(a,null,10,[e,i,o]),nt();return}}On(e,n,i,r,o)}function On(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var P=[],kn=-1,An=[],jn=null,Mn=0,Nn=Promise.resolve(),Pn=null;function Fn(e){let t=Pn||Nn;return e?t.then(this?e.bind(this):e):t}function In(e){let t=kn+1,n=P.length;for(;t<n;){let r=t+n>>>1,i=P[r],a=Hn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Ln(e){if(!(e.flags&1)){let t=Hn(e),n=P[P.length-1];!n||!(e.flags&2)&&t>=Hn(n)?P.push(e):P.splice(In(t),0,e),e.flags|=1,Rn()}}function Rn(){Pn||=Nn.then(Un)}function zn(e){v(e)?An.push(...e):jn&&e.id===-1?jn.splice(Mn+1,0,e):e.flags&1||(An.push(e),e.flags|=1),Rn()}function Bn(e,t,n=kn+1){for(;n<P.length;n++){let t=P[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;P.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function Vn(e){if(An.length){let e=[...new Set(An)].sort((e,t)=>Hn(e)-Hn(t));if(An.length=0,jn){jn.push(...e);return}for(jn=e,Mn=0;Mn<jn.length;Mn++){let e=jn[Mn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}jn=null,Mn=0}}var Hn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Un(e){try{for(kn=0;kn<P.length;kn++){let e=P[kn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Tn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;kn<P.length;kn++){let e=P[kn];e&&(e.flags&=-2)}kn=-1,P.length=0,Vn(e),Pn=null,(P.length||An.length)&&Un(e)}}var F=null,Wn=null;function Gn(e){let t=F;return F=e,Wn=e&&e.type.__scopeId||null,t}function Kn(e,t=F,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Qa(-1);let i=Gn(t),a=Ja.length,o;try{o=e(...n)}finally{for(let e=Ja.length;e>a;e--)Xa();Gn(i),r._d&&Qa(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function qn(e,t){if(F===null)return e;let n=Io(F),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=c]=t[e];i&&(C(i)&&(i={mounted:i,updated:i}),i.deep&&wn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function Jn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(tt(),En(c,n,8,[e.el,s,e,t]),nt())}}function Yn(e,t){if(U){let n=U.provides,r=U.parent&&U.parent.provides;r===n&&(n=U.provides=Object.create(r)),n[e]=t}}function Xn(e,t,n=!1){let r=xo();if(r||Wi){let i=Wi?Wi._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&C(t)?t.call(r&&r.proxy):t}}function Zn(){return!!(xo()||Wi)}var Qn=Symbol.for(`v-scx`),$n=()=>Xn(Qn);function er(e,t){return nr(e,null,t)}function tr(e,t,n){return nr(e,t,n)}function nr(e,t,n=c){let{immediate:r,deep:i,flush:a,once:o}=n,s=m({},n),l=t&&r||!t&&a!==`post`,d;if(Do){if(a===`sync`){let e=$n();d=e.__watcherHandles||=[]}else if(!l){let e=()=>{};return e.stop=u,e.resume=u,e.pause=u,e}}let f=U;s.call=(e,t,n)=>En(e,f,t,n);let p=!1;a===`post`?s.scheduler=e=>{L(e,f&&f.suspense)}
vendor: 8,957 bytes, lines 1-3
1:a!==`sync`&&(p=!0,s.scheduler=(e,t)=>{t?e():Ln(e)}),s.augmentJob=e=>{t&&(e.flags|=4),p&&(e.flags|=2,f&&(e.id=f.uid,e.i=f))};let h=Cn(e,t,s);return Do&&(d?d.push(h):l&&h()),h}function rr(e,t,n){let r=this.proxy,i=w(e)?e.includes(`.`)?ir(r,e):()=>r[e]:e.bind(r,r),a;C(t)?a=t:(a=t.handler,n=t);let o=wo(this),s=nr(i,a.bind(r),n);return o(),s}function ir(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var ar=Symbol(`_vte`),or=e=>e.__isTeleport,sr=Symbol(`_leaveCb`),cr=Symbol(`_enterCb`);function lr(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ti(()=>{e.isMounted=!0}),ii(()=>{e.isUnmounting=!0}),e}var ur=[Function,Array],dr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ur,onEnter:ur,onAfterEnter:ur,onEnterCancelled:ur,onBeforeLeave:ur,onLeave:ur,onAfterLeave:ur,onLeaveCancelled:ur,onBeforeAppear:ur,onAppear:ur,onAfterAppear:ur,onAppearCancelled:ur},fr=e=>{let t=e.subTree;return t.component?fr(t.component):t},pr={name:`BaseTransition`,props:dr,setup(e,{slots:t}){let n=xo(),r=lr();return()=>{let i=t.default&&xr(t.default(),!0),a=i&&i.length?mr(i):n.subTree?po():void 0;if(!a)return;let o=M(e),{mode:s}=o;if(r.isLeaving)return vr(a);let c=yr(a);if(!c)return vr(a);let l=_r(c,o,r,n,e=>l=e);c.type!==z&&br(c,l);let u=n.subTree&&yr(n.subTree);if(u&&u.type!==z&&!ro(u,c)&&fr(n).type!==z){let e=_r(u,o,r,n);if(br(u,e),s===`out-in`&&c.type!==z)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},vr(a);s===`in-out`&&c.type!==z?e.delayLeave=(e,t,n)=>{let i=gr(r,u);i[String(u.key)]=u,e[sr]=()=>{t(),e[sr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function mr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==z){t=n;break}}return t}var hr=pr;function gr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function _r(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=gr(n,e),C=(e,t)=>{e&&En(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),v(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=g||c;else return;t[sr]&&t[sr](!0);let i=S[x];i&&ro(e,i)&&i.el[sr]&&i.el[sr](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=d;if(!n.isMounted)if(a)r=_||l,i=y||u,o=b||d;else return;let s=!1;t[cr]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[cr]=void 0)};let c=t[cr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[cr]&&t[cr](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[sr]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[sr]=void 0,S[i]===e&&delete S[i])};let o=t[sr].bind(null,!1);S[i]=e,p?w(p,[t,o]):o()},clone(e){let a=_r(e,t,n,r,i);return i&&i(a),a}};return T}function vr(e){if(Ur(e))return e=lo(e),e.children=null,e}function yr(e){if(!Ur(e))return or(e.type)&&e.children?mr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&C(n.default))return n.default()}}function br(e,t){e.shapeFlag&6&&e.component?(e.transition=t,br(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 xr(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===R?(o.patchFlag&128&&i++,r=r.concat(xr(o.children,t,s))):(t||o.type!==z)&&r.push(s==null?o:lo(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function Sr(e,t){return C(e)?m({name:e.name},t,{setup:e}):e}function Cr(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function wr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Tr=new WeakMap;function Er(e,t,n,r,i=!1){if(v(e)){e.forEach((e,a)=>Er(e,t&&(v(t)?t[a]:t),n,r,i));return}if(Hr(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Er(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Io(r.component):r.el,o=i?null:a,{i:s,r:l}=e,u=t&&t.r,f=s.refs===c?s.refs={}:s.refs,p=s.setupState,m=M(p),g=p===c?d:e=>!wr(f,e)&&_(m,e),y=(e,t)=>!(t&&wr(f,t));if(u!=null&&u!==l){if(Dr(t),w(u))f[u]=null,g(u)&&(p[u]=null);else if(N(u)){let e=t;y(u,e.k)&&(u.value=null),e.k&&(f[e.k]=null)}}if(C(l))Tn(l,s,12,[o,f]);else{let t=w(l),r=N(l);if(t||r){let s=()=>{if(e.f){let n=t?g(l)?p[l]:f[l]:y(l)||!e.k?l.value:f[e.k];if(i)v(n)&&h(n,a);else if(v(n))n.includes(a)||n.push(a);else if(t)f[l]=[a],g(l)&&(p[l]=f[l]);else{let t=[a];y(l,e.k)&&(l.value=t),e.k&&(f[e.k]=t)}}else t?(f[l]=o,g(l)&&(p[l]=o)):r&&(y(l,e.k)&&(l.value=o),e.k&&(f[e.k]=o))};if(o){let t=()=>{s(),Tr.delete(e)};t.id=-1,Tr.set(e,t),L(t,n)}else Dr(e),s()}}}function Dr(e){let t=Tr.get(e);t&&(t.flags|=8,Tr.delete(e))}var Or=!1,kr=()=>{Or||=(console.error(`Hydration completed but contains mismatches.`),!0)},Ar=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,jr=e=>e.namespaceURI.includes(`MathML`),Mr=e=>{if(e.nodeType===1){if(Ar(e))return`svg`;if(jr(e))return`mathml`}},Nr=e=>e.nodeType===8;function Pr(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:s,insert:c,createComment:l}}=e,u=(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),Vn(),t._vnode=e;return}d(t.firstChild,e,null,null,null),Vn(),t._vnode=e},d=(n,r,s,l,u,f=!1)=>{f||=!!r.dynamicChildren;let b=Nr(n)&&n.data===`[`,x=()=>g(n,r,s,l,u,b),{type:S,ref:C,shapeFlag:w,patchFlag:T}=r,E=n.nodeType;r.el=n,T===-2&&(f=!1,r.dynamicChildren=null);let D=null;switch(S){case Ka:E===3?(n.data!==r.children&&(kr(),n.data=r.children),D=a(n)):r.children===``?(c(r.el=i(``),o(n),n),D=n):D=x();break;case z:y(n)?(D=a(n),v(r.el=n.content.firstChild,n,s)):D=E!==8||b?x():a(n);break;case qa:if(b&&(n=a(n),E=n.nodeType),E===1||E===3){D=n;let e=!r.children.length;for(let t=0;t<r.staticCount;t++)e&&(r.children+=D.nodeType===1?D.outerHTML:D.data),t===r.staticCount-1&&(r.anchor=D),D=a(D);return b?a(D):D}else x();break;case R:D=b?h(n,r,s,l,u,f):x();break;default:if(w&1)D=(E!==1||r.type.toLowerCase()!==n.tagName.toLowerCase())&&!y(n)?x():p(n,r,s,l,u,f);else if(w&6){r.slotScopeIds=u;let e=o(n);if(D=b?_(n):Nr(n)&&n.data===`teleport start`?_(n,n.data,`teleport end`):a(n),t(r,e,null,s,l,Mr(e),f),Hr(r)&&!r.type.__asyncResolved){let t;b?(t=V(R),t.anchor=D?D.previousSibling:e.lastChild):t=n.nodeType===3?uo(``):V(`div`),t.el=n,r.component.subTree=t}}else w&64?D=E===8?r.type.hydrate(n,r,s,l,u,f,e,m):x():w&128&&(D=r.type.hydrate(n,r,s,l,Mr(o(n)),u,f,e,d))}return C!=null&&Er(C,null,l,r),D},p=(e,t,n,i,a,o)=>{o||=!!t.dynamicChildren;let{type:c,dynamicProps:l,props:u,patchFlag:d,shapeFlag:p,dirs:h,transition:g}=t,_=c===`input`||c===`option`,b=!!l;if(_||b||d!==-1){h&&Jn(t,null,n,`created`);let c=!1;if(y(e)){c=Da(null,g)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(c){let e=r.getAttribute(`class`);e&&(r.$cls=e),g.beforeEnter(r)}v(r,e,n),t.el=e=r}if(p&16&&!(u&&(u.innerHTML||u.textContent))){let r=m(e.firstChild,t,e,n,i,a,o);for(r&&!Lr(e,1)&&kr();r;){let e=r;r=r.nextSibling,s(e)}}else if(p&8){let n=t.children;n[0]===` 2`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,` 3`)&&(Lr(e,0)||kr(),e.textContent=t.children)}if(u){if(_||b||!o||d&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in u)(_&&(a.endsWith(`value`)||a===`indeterminate`)||f(a)&&!ae(a)||a[0]===`.`||t&&!ae(a)||l&&l.includes(a))&&r(e,a,null,u[a],i,n)}else if(u.onClick)r(e,`onClick`,null,u.onClick,void 0,n);else if(d&4&&Zt(u.style))for(let e in u.style)u.style[e]}let x;(x=u&&u.onVnodeBeforeMount)&&H(x,n,t),h&&Jn(t,null,n,`beforeMount`),((x=u&&u.onVnodeMounted)||h||c)&&Ua(()=>{x&&H(x,n,t),c&&g.enter(e),h&&Jn(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,l,u)=>{u||=!!t.dynamicChildren;let f=t.children,p=f.length,m=!1;for(let t=0;t<p;t++){let h=u?f[t]:f[t]=mo(f[t]),g=h.type===Ka;e?(g&&!u&&t+1<p&&mo(f[t+1]).type===Ka&&(c(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=d(e,h,o,s,l,u)):g&&!h.children?c(h.el=i(``),r):(m||(m=!0,Lr(r,1)||kr()),n(null,h,r,null,o,s,Mr(r),l))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&Nr(f)&&f.data===`]`?a(t.anchor=f):(kr(),c(t.anchor=l(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(zr(e,t)||kr(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,Mr(d),c),r&&(r.vnode.el=t.el,ra(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&Nr(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e}
vendor: 4,897 bytes, line 3
3,v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[u,d]}var Fr=`data-allow-mismatch`,Ir={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Lr(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Fr);)e=e.parentElement;return Rr(e&&e.getAttribute(Fr),t)}function Rr(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Ir[t])}}function zr(e,t){return Lr(e.parentElement,1)||Br(e)||Vr(t)}function Br(e){return e.nodeType===1&&Rr(e.getAttribute(Fr),1)}function Vr({props:e}){let t=e&&e[Fr];return typeof t==`string`&&Rr(t,1)}ve().requestIdleCallback,ve().cancelIdleCallback;var Hr=e=>!!e.type.__asyncLoader,Ur=e=>e.type.__isKeepAlive,Wr={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=xo(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),L(()=>{a.isDeactivated=!1,a.a&&pe(a.a);let t=e.props&&e.props.onVnodeMounted;t&&H(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;ja(t.m),ja(t.a),l(e,f,null,1,s),L(()=>{t.da&&pe(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&H(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){Xr(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=Lo(Hr(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!ro(t,o))?p(t):o&&Xr(o),i.delete(e),a.delete(e)}tr(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Gr(e,t)),t&&m(e=>!Gr(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(Na(n.subTree.type)?L(()=>{i.set(g,Zr(n.subTree))},n.subTree.suspense):i.set(g,Zr(n.subTree)))};return ti(_),ri(_),ii(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=Zr(t);if(e.type===i.type&&e.key===i.key){Xr(i);let e=i.component.da;e&&L(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!no(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=Zr(r);if(s.type===z)return o=null,s;let c=s.type,l=Lo(Hr(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Gr(u,l))||d&&l&&Gr(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=lo(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&br(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,Na(r.type)?r:s}}};function Gr(e,t){return v(e)?e.some(e=>Gr(e,t)):w(e)?e.split(`,`).includes(t):S(e)?(e.lastIndex=0,e.test(t)):!1}function Kr(e,t){Jr(e,`a`,t)}function qr(e,t){Jr(e,`da`,t)}function Jr(e,t,n=U){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Qr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ur(e.parent.vnode)&&Yr(r,t,n,e),e=e.parent}}function Yr(e,t,n,r){let i=Qr(t,e,r,!0);ai(()=>{h(r[t],i)},n)}function Xr(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Zr(e){return e.shapeFlag&128?e.ssContent:e}function Qr(e,t,n=U,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{tt();let i=wo(n),a=En(t,n,e,r);return i(),nt(),a};return r?i.unshift(a):i.push(a),a}}var $r=e=>(t,n=U)=>{(!Do||e===`sp`)&&Qr(e,(...e)=>t(...e),n)},ei=$r(`bm`),ti=$r(`m`),ni=$r(`bu`),ri=$r(`u`),ii=$r(`bum`),ai=$r(`um`),oi=$r(`sp`),si=$r(`rtg`),ci=$r(`rtc`);function li(e,t=U){Qr(`ec`,e,t)}var ui=`components`,di=`directives`;function fi(e,t){return gi(ui,e,!0,t)||e}var pi=Symbol.for(`v-ndc`);function mi(e){return w(e)?gi(ui,e,!1)||e:e||pi}function hi(e){return gi(di,e)}function gi(e,t,n=!0,r=!1){let i=F||U;if(i){let n=i.type;if(e===ui){let e=Lo(n,!1);if(e&&(e===t||e===O(t)||e===ue(O(t))))return n}let a=_i(i[e]||n[e],t)||_i(i.appContext[e],t);return!a&&r?n:a}}function _i(e,t){return e&&(e[t]||e[O(t)]||e[ue(O(t))])}function vi(e,t,n,r){let i,a=n&&n[r],o=v(e);if(o||w(e)){let n=o&&Zt(e),r=!1,s=!1;n&&(r=!$t(e),s=Qt(e),e=ht(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?rn(nn(e[n])):nn(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(E(e))if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}else i=[];return n&&(n[r]=i),i}function yi(e,t,n={},r,i,a){if(F.ce||F.parent&&Hr(F.parent)&&F.parent.ce){let e=a!=null&&n.key==null?m({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),Ya(),to(R,null,[V(`slot`,e,r&&r())],i?-2:64)}
vendor: 4,355 bytes, line 3
3let o=e[t];o&&o._c&&(o._d=!1);let s=Ja.length;Ya();let c;try{let i=o&&bi(o(n)),s=n.key||a||i&&i.key;c=to(R,{key:(s&&!T(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Ja.length;e>s;e--)Xa();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function bi(e){return e.some(e=>!no(e)||!(e.type===z||e.type===R&&!bi(e.children)))?e:null}var xi=e=>e?Eo(e)?Io(e):xi(e.parent):null,Si=m(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=>xi(e.parent),$root:e=>xi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Mi(e),$forceUpdate:e=>e.f||=()=>{Ln(e.update)},$nextTick:e=>e.n||=Fn.bind(e.proxy),$watch:e=>rr.bind(e)}),Ci=(e,t)=>e!==c&&!e.__isScriptSetup&&_(e,t),wi={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:l}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Ci(r,t))return o[t]=1,r[t];else if(i!==c&&_(i,t))return o[t]=2,i[t];else if(_(a,t))return o[t]=3,a[t];else if(n!==c&&_(n,t))return o[t]=4,n[t];else Di&&(o[t]=0)}let u=Si[t],d,f;if(u)return t===`$attrs`&&j(e.attrs,`get`,``),u(e);if((d=s.__cssModules)&&(d=d[t]))return d;if(n!==c&&_(n,t))return o[t]=4,n[t];if(f=l.config.globalProperties,_(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Ci(i,t)?(i[t]=n,!0):r!==c&&_(r,t)?(r[t]=n,!0):_(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let l;return!!(n[s]||e!==c&&s[0]!==`$`&&_(e,s)||Ci(t,s)||_(a,s)||_(r,s)||_(Si,s)||_(i.config.globalProperties,s)||(l=o.__cssModules)&&l[s])},defineProperty(e,t,n){return n.get==null?_(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function Ti(e){return v(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Ei(e){let t=xo(),n=Do,r=e();To(),n&&Co(!1);let i=()=>{wo(t),n&&Co(!0)},a=()=>{xo()!==t&&t.scope.off(),To(),n&&Co(!1)};return D(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var Di=!0;function Oi(e){let t=Mi(e),n=e.proxy,r=e.ctx;Di=!1,t.beforeCreate&&Ai(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:d,beforeMount:f,mounted:p,beforeUpdate:m,updated:h,activated:g,deactivated:_,beforeDestroy:y,beforeUnmount:b,destroyed:x,unmounted:S,render:w,renderTracked:T,renderTriggered:D,errorCaptured:ee,serverPrefetch:te,expose:ne,inheritAttrs:re,components:ie,directives:ae,filters:oe}=t;if(l&&ki(l,r,null),o)for(let e in o){let t=o[e];C(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);E(t)&&(e.data=qt(t))}if(Di=!0,a)for(let e in a){let t=a[e],i=zo({get:C(t)?t.bind(n,n):C(t.get)?t.get.bind(n,n):u,set:!C(t)&&C(t.set)?t.set.bind(n):u});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)ji(s[e],r,n,e);if(c){let e=C(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Yn(t,e[t])})}d&&Ai(d,e,`c`);function se(e,t){v(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(se(ei,f),se(ti,p),se(ni,m),se(ri,h),se(Kr,g),se(qr,_),se(li,ee),se(ci,T),se(si,D),se(ii,b),se(ai,S),se(oi,te),v(ne))if(ne.length){let t=e.exposed||={};ne.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};w&&e.render===u&&(e.render=w),re!=null&&(e.inheritAttrs=re),ie&&(e.components=ie),ae&&(e.directives=ae),te&&Cr(e)}function ki(e,t,n=u){v(e)&&(e=Li(e));for(let n in e){let r=e[n],i;i=E(r)?`default`in r?Xn(r.from||n,r.default,!0):Xn(r.from||n):Xn(r),N(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Ai(e,t,n){En(v(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ji(e,t,n,r){let i=r.includes(`.`)?ir(n,r):()=>n[r];if(w(e)){let n=t[e];C(n)&&tr(i,n)}else if(C(e))tr(i,e.bind(n));else if(E(e))if(v(e))e.forEach(e=>ji(e,t,n,r));else{let r=C(e.handler)?e.handler.bind(n):t[e.handler];C(r)&&tr(i,r,e)}}function Mi(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={}
vendor: 4,519 bytes, line 3
3,i.length&&i.forEach(e=>Ni(c,e,o,!0)),Ni(c,t,o)),E(t)&&a.set(t,c),c}function Ni(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Ni(e,a,n,!0),i&&i.forEach(t=>Ni(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Pi[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Pi={data:Fi,props:zi,emits:zi,methods:Ri,computed:Ri,beforeCreate:I,created:I,beforeMount:I,mounted:I,beforeUpdate:I,updated:I,beforeDestroy:I,beforeUnmount:I,destroyed:I,unmounted:I,activated:I,deactivated:I,errorCaptured:I,serverPrefetch:I,components:Ri,directives:Ri,watch:Bi,provide:Fi,inject:Ii};function Fi(e,t){return t?e?function(){return m(C(e)?e.call(this,this):e,C(t)?t.call(this,this):t)}:t:e}function Ii(e,t){return Ri(Li(e),Li(t))}function Li(e){if(v(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function I(e,t){return e?[...new Set([].concat(e,t))]:t}function Ri(e,t){return e?m(Object.create(null),e,t):t}function zi(e,t){return e?v(e)&&v(t)?[...new Set([...e,...t])]:m(Object.create(null),Ti(e),Ti(t??{})):t}function Bi(e,t){if(!e)return t;if(!t)return e;let n=m(Object.create(null),e);for(let r in t)n[r]=I(e[r],t[r]);return n}function Vi(){return{app:null,config:{isNativeTag:d,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}}var Hi=0;function Ui(e,t){return function(n,r=null){C(n)||(n=m({},n)),r!=null&&!E(r)&&(r=null);let i=Vi(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:Hi++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Vo,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&C(e.install)?(a.add(e),e.install(c,...t)):C(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||V(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,Io(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(En(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=Wi;Wi=c;try{return e()}finally{Wi=t}}};return c}}var Wi=null,Gi=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${O(t)}Modifiers`]||e[`${le(t)}Modifiers`];function Ki(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||c,i=n,a=t.startsWith(`update:`),o=a&&Gi(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>w(e)?e.trim():e)),o.number&&(i=n.map(he)));let s,l=r[s=de(t)]||r[s=de(O(t))];!l&&a&&(l=r[s=de(le(t))]),l&&En(l,e,6,i);let u=r[s+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,En(u,e,6,i)}}var qi=new WeakMap;function Ji(e,t,n=!1){let r=n?qi:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!C(e)){let r=e=>{let n=Ji(e,t,!0);n&&(s=!0,m(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(E(e)&&r.set(e,null),null):(v(a)?a.forEach(e=>o[e]=null):m(o,a),E(e)&&r.set(e,o),o)}function Yi(e,t){return!e||!f(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),_(e,t[0].toLowerCase()+t.slice(1))||_(e,le(t))||_(e,t))}function Xi(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:m,ctx:h,inheritAttrs:g}=e,_=Gn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=mo(l.call(t,e,u,d,m,f,h)),y=s}else{let e=t;v=mo(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),y=t.props?s:Qi(s)}}catch(t){Ja.length=0,Dn(t,e,1),v=V(z)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(p)&&(y=$i(y,a)),b=lo(b,y,!1,!0))}return n.dirs&&(b=lo(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&br(b,n.transition),v=b,Gn(_),v}function Zi(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(no(r)){if(r.type!==z||r.children===`v-if`){if(n)return;n=r}}else return}return n}var Qi=e=>{let t;for(let n in e)(n===`class`||n===`style`||f(n))&&((t||={})[n]=e[n]);return t},$i=(e,t)=>{let n={};for(let r in e)(!p(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ea(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;
vendor: 12,507 bytes, line 3
3if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?ta(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(na(o,r,n)&&!Yi(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||ta(r,o,l):!!o;return!1}function ta(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(na(t,e,a)&&!Yi(n,a))return!0}return!1}function na(e,t,n){let r=e[n],i=t[n];return n===`style`&&E(r)&&E(i)?!ke(r,i):r!==i}function ra({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var ia={},aa=()=>Object.create(ia),oa=e=>Object.getPrototypeOf(e)===ia;function sa(e,t,n,r=!1){let i={},a=aa();e.propsDefaults=Object.create(null),la(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:Jt(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function ca(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=M(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Yi(e.emitsOptions,o))continue;let u=t[o];if(c)if(_(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=O(o);i[t]=ua(c,s,t,u,e,!1)}else u!==a[o]&&(a[o]=u,l=!0)}}}else{la(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!_(t,a)&&((r=le(a))===a||!_(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=ua(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!_(t,e))&&(delete a[e],l=!0)}l&&ft(e.attrs,`set`,``)}function la(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(ae(c))continue;let l=t[c],u;i&&_(i,u=O(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:Yi(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=M(n),r=s||c;for(let o=0;o<a.length;o++){let s=a[o];n[s]=ua(i,t,s,r[s],e,!_(r,s))}}return o}function ua(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=_(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&C(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=wo(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===le(n))&&(r=!0))}return r}var da=new WeakMap;function fa(e,t,n=!1){let r=n?da:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],u=!1;if(!C(e)){let r=e=>{u=!0;let[n,r]=fa(e,t,!0);m(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!u)return E(e)&&r.set(e,l),l;if(v(a))for(let e=0;e<a.length;e++){let t=O(a[e]);pa(t)&&(o[t]=c)}else if(a)for(let e in a){let t=O(e);if(pa(t)){let n=a[e],r=o[t]=v(n)||C(n)?{type:n}:m({},n),i=r.type,c=!1,l=!0;if(v(i))for(let e=0;e<i.length;++e){let t=i[e],n=C(t)&&t.name;if(n===`Boolean`){c=!0;break}else n===`String`&&(l=!1)}else c=C(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||_(r,`default`))&&s.push(t)}}let d=[o,s];return E(e)&&r.set(e,d),d}function pa(e){return e[0]!==`$`&&!ae(e)}var ma=e=>e===`_`||e===`_ctx`||e===`$stable`,ha=e=>v(e)?e.map(mo):[mo(e)],ga=(e,t,n)=>{if(t._n)return t;let r=Kn((...e)=>ha(t(...e)),n);return r._c=!1,r},_a=(e,t,n)=>{let r=e._ctx;for(let n in e){if(ma(n))continue;let i=e[n];if(C(i))t[n]=ga(n,i,r);else if(i!=null){let e=ha(i);t[n]=()=>e}}},va=(e,t)=>{let n=ha(t);e.slots.default=()=>n},ya=(e,t,n)=>{for(let r in t)(n||!ma(r))&&(e[r]=t[r])},ba=(e,t,n)=>{let r=e.slots=aa();if(e.vnode.shapeFlag&32){let e=t._;e?(ya(r,t,n),n&&me(r,`_`,e,!0)):_a(t,r)}else t&&va(e,t)},xa=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=c;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:ya(i,t,n):(a=!t.$stable,_a(t,i)),o=t}else t&&(va(e,t),o={default:1});if(a)for(let e in i)!ma(e)&&o[e]==null&&delete i[e]},L=Ua;function Sa(e){return wa(e)}function Ca(e){return wa(e,Pr)}function wa(e,t){let n=ve();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=u,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!ro(e,t)&&(r=be(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Ka:y(e,t,n,r);break;case z:b(e,t,n,r);break;case qa:e??x(t,n,r,o);break;case R:re(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?ie(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,Ce)}u!=null&&i?Er(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Er(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=d(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ee(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,s,c,l,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=o(e.type,c,m&&m.is,m),h&8?p(d,e.children):h&16&&D(e.children,d,null,i,s,Ta(e,c),l,u),_&&Jn(e,null,i,`created`),E(d,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!ae(e)&&a(d,e,null,m[e],c,i);`value`in m&&a(d,`value`,null,m.value,c),(f=m.onVnodeBeforeMount)&&H(f,i,e)}_&&Jn(e,null,i,`beforeMount`);let v=Da(s,g);v&&g.beforeEnter(d),r(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&L(()=>{try{f&&H(f,i,e),v&&g.enter(d),_&&Jn(e,null,i,`mounted`)}finally{}},s)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||Na(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;E(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},D=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?ho(e[l]):mo(e[l]);v(null,c,t,n,r,i,a,o,s)}},ee=(e,t,n,r,i,o,s)=>{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||c,h=t.props||c,g;if(n&&Ea(n,!1),(g=h.onVnodeBeforeUpdate)&&H(g,n,t,e),f&&Jn(t,e,n,`beforeUpdate`),n&&Ea(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?te(e.dynamicChildren,d,l,n,r,Ta(t,i),o):s||le(e,t,l,null,n,r,Ta(t,i),o,!1),u>0){if(u&16)ne(l,m,h,n,i);else if(u&2&&m.class!==h.class&&a(l,`class`,null,h.class,i),u&4&&a(l,`style`,m.style,h.style,i),u&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(l,r,o,s,i,n)}}u&1&&e.children!==t.children&&p(l,t.children)}else!s&&d==null&&ne(l,m,h,n,i);((g=h.onVnodeUpdated)||f)&&L(()=>{g&&H(g,n,t,e),f&&Jn(t,e,n,`updated`)},r)},te=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===R||!ro(c,l)||c.shapeFlag&198)?m(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},ne=(e,t,n,r,i)=>{if(t!==n){if(t!==c)for(let o in t)!ae(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(ae(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},re=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),D(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(te(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Oa(e,t,!0)):le(e,t,n,f,a,o,c,l,u)},ie=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):oe(t,n,r,i,a,o,c):se(e,t,c)},oe=(e,t,n,r,i,a,o)=>{let s=e.component=bo(e,r,i);if(Ur(e)&&(s.ctx.renderer=Ce),Oo(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,O,o),!e.el){let r=s.subTree=V(z);b(null,r,t,n),e.placeholder=r.el}}else O(s,e,t,n,i,a,o)},se=(e,t,n)=>{let r=t.component=e.component;if(ea(e,t,n))if(r.asyncDep&&!r.asyncResolved){ce(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},O=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Aa(e);if(n){t&&(t.el=c.el,ce(e,t,o)),n.asyncDep.then(()=>{L(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Ea(e,!1),t?(t.el=c.el,ce(e,t,o)):t=c,n&&pe(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&H(d,s,t,c),Ea(e,!0);let f=Xi(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),be(p),e,i,a),t.el=f.el,u===null&&ra(e,f.el),r&&L(r,i),(d=t.props&&t.props.onVnodeUpdated)&&L(()=>H(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Hr(t);if(Ea(e,!1),l&&pe(l),!m&&(o=c&&c.onVnodeBeforeMount)&&H(o,d,t),Ea(e,!0),s&&Te){let t=()=>{e.subTree=Xi(e),Te(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Xi(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&L(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;L(()=>H(o,d,e),i)}(t.shapeFlag&256||d&&Hr(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&L(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Be(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Ln(u),Ea(e,!0),l()},ce=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,ca(e,t.props,r,n),xa(e,t.children,n),tt(),Bn(e),nt()},le=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){de(l,d,n,r,i,a,o,s,c);return}else if(f&256){ue(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&ye(l,i,a),d!==l&&p(n,d)):u&16?m&16?de(l,d,n,r,i,a,o,s,c):ye(l,i,a,!0):(u&8&&p(n,``),m&16&&D(d,n,r,i,a,o,s,c))},ue=(e,t,n,r,i,a,o,s,c)=>{e||=l,t||=l;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;p<f;p++){let r=t[p]=c?ho(t[p]):mo(t[p]);v(e[p],r,n,null,i,a,o,s,c)}u>d?ye(e,i,a,!0,!1,f):D(t,n,r,i,a,o,s,c,f)},de=(e,t,n,r,i,a,o,s,c)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],l=t[u]=c?ho(t[u]):mo(t[u]);if(ro(r,l))v(r,l,n,null,i,a,o,s,c);else break;u++}for(;u<=f&&u<=p;){let r=e[f],l=t[p]=c?ho(t[p]):mo(t[p]);if(ro(r,l))v(r,l,n,null,i,a,o,s,c);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,l=e<d?t[e].el:r;for(;u<=p;)v(null,t[u]=c?ho(t[u]):mo(t[u]),n,l,i,a,o,s,c),u++}}else if(u>p)for(;u<=f;)me(e[u],i,a,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=c?ho(t[u]):mo(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u<b;u++)C[u]=0;for(u=m;u<=f;u++){let r=e[u];if(y>=b){me(r,i,a,!0);continue}let l;if(r.key!=null)l=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&ro(r,t[_])){l=_;break}l===void 0?me(r,i,a,!0):(C[l-h]=u+1,l>=S?S=l:x=!0,v(r,t[l],n,null,i,a,o,s,c),y++)}let w=x?ka(C):l;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,l=t[e],f=t[e+1],p=e+1<d?f.el||Ma(f):r;C[u]===0?v(null,l,n,p,i,a,o,s,c):x&&(_<0||u!==w[_]?fe(l,n,p,2):_--)}}},fe=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){fe(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,Ce);return}if(c===R){r(s,t,n);for(let e=0;e<u.length;e++)fe(u[e],t,n,a);r(e.anchor,t,n);return}if(c===qa){S(e,t,n);return}if(a!==2&&d&1&&l)if(a===0)l.persisted&&!s[sr]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),L(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[sr];s._isLeaving&&s[sr](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}else r(s,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(tt(),Er(s,null,n,e,!0),nt()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Hr(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&H(_,t,e),u&6)_e(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Jn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Ce,r):l&&!l.hasOnce&&(a!==R||d>0&&d&64)?ye(l,t,n,!1,!0):(a===R&&d&384||!i&&u&16)&&ye(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&L(()=>{_&&H(_,t,e),h&&Jn(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===R){ge(n,r);return}if(t===qa){C(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},ge=(e,t)=>
vendor: 10,727 bytes, line 3
3{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},_e=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;ja(c),ja(l),r&&pe(r),i.stop(),a&&(a.flags|=8,me(o,e,t,n)),s&&L(s,t),L(()=>{e.isUnmounted=!0},t)},ye=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)me(e[o],t,n,r,i)},be=e=>{if(e.shapeFlag&6)return be(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[ar];return n?h(n):t},xe=!1,Se=(e,t,n)=>{let r;e==null?t._vnode&&(me(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,xe||=(xe=!0,Bn(r),Vn(),!1)},Ce={p:v,um:me,m:fe,r:he,mt:oe,mc:D,pc:le,pbc:te,n:be,o:e},we,Te;return t&&([we,Te]=t(Ce)),{render:Se,hydrate:we,createApp:Ui(Se,we)}}function Ta({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 Ea({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Da(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Oa(e,t,n=!1){let r=e.children,i=t.children;if(v(r)&&v(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=ho(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Oa(t,a)),a.type===Ka&&(a.patchFlag===-1&&(a=i[e]=ho(a)),a.el=t.el),a.type===z&&!a.el&&(a.el=t.el)}}function ka(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Aa(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Aa(t)}function ja(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ma(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Ma(t.subTree):null}var Na=e=>e.__isSuspense,Pa=0,Fa={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)La(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Ra(e,t,n,r,i,o,s,c,l)}},hydrate:Ba,normalize:Va};function Ia(e,t){let n=e.props&&e.props[t];C(n)&&n()}function La(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=za(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(Ia(e,`onPending`),Ia(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),Wa(f,e.ssFallback)):f.resolve(!1,!0)}function Ra(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,ro(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&(_||(c(m,p,n,r,i,null,a,o,s),Wa(d,p)))):(d.pendingId=Pa++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():(c(m,p,n,r,i,null,a,o,s),Wa(d,p))):m&&ro(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&ro(m,f))c(m,f,n,r,i,d,a,o,s),Wa(d,f);else if(Ia(t,`onPending`),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Pa++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function za(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=Ga(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?ge(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Pa++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),zn(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&L(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,Wa(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){y.effects.push(...c),S=!0;break}y=y.parent}!S&&!g&&zn(c),x.effects=[],v&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!n&&t.resolve()),Ia(r,`onResolve`)},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=x;Ia(t,`onFallback`);let o=m(n),l=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,e,i,o,r,null,a,s,c),Wa(x,e))},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{Dn(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;To(),e.asyncResolved=!0;let{vnode:s}=e;Ao(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),ra(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function Ba(e,t,n,r,i,a,o,s,c){let l=t.suspense=za(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function Va(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=Ha(r?n.default:n),e.ssFallback=r?Ha(n.fallback):V(z)}function Ha(e){let t;if(C(e)){let n=Za&&e._c;n&&(e._d=!1,Ya()),e=e(),n&&(e._d=!0,t=B,Xa())}return v(e)&&(e=Zi(e)),e=mo(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function Ua(e,t){t&&t.pendingBranch?v(e)?t.effects.push(...e):t.effects.push(e):zn(e)}function Wa(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,ra(r,i))}function Ga(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var R=Symbol.for(`v-fgt`),Ka=Symbol.for(`v-txt`),z=Symbol.for(`v-cmt`),qa=Symbol.for(`v-stc`),Ja=[],B=null;function Ya(e=!1){Ja.push(B=e?null:[])}function Xa(){Ja.pop(),B=Ja[Ja.length-1]||null}var Za=1;function Qa(e,t=!1){Za+=e,e<0&&B&&t&&(B.hasOnce=!0)}function $a(e){return e.dynamicChildren=Za>0?B||l:null,Xa(),Za>0&&B&&B.push(e),e}function eo(e,t,n,r,i,a){return $a(oo(e,t,n,r,i,a,!0))}function to(e,t,n,r,i){return $a(V(e,t,n,r,i,!0))}function no(e){return e?e.__v_isVNode===!0:!1}function ro(e,t){return e.type===t.type&&e.key===t.key}var io=({key:e})=>e??null,ao=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:w(e)||N(e)||C(e)?{i:F,r:e,k:t,f:!!n}:e);function oo(e,t=null,n=null,r=0,i=null,a=e===R?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&io(t),ref:t&&ao(t),scopeId:Wn,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:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:F};return s?(go(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=w(n)?8:16),Za>0&&!o&&B&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&B.push(c),c}var V=so;function so(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===pi)&&(e=z),no(e)){let r=lo(e,t,!0);return n&&go(r,n),Za>0&&!a&&B&&(r.shapeFlag&6?B[B.indexOf(e)]=r:B.push(r)),r.patchFlag=-2,r}if(Ro(e)&&(e=e.__vccOpts),t){t=co(t);let{class:e,style:n}=t;e&&!w(e)&&(t.class=we(e)),E(n)&&(en(n)&&!v(n)&&(n=m({},n)),t.style=ye(n))}let o=w(e)?1:Na(e)?128:or(e)?64:E(e)?4:C(e)?2:0;return oo(e,t,n,r,i,o,a,!0)}function co(e){return e?en(e)||oa(e)?m({},e):e:null}function lo(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?_o(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&io(l),ref:t&&t.ref?n&&a?v(a)?a.concat(ao(t)):[a,ao(t)]:ao(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==R?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&lo(e.ssContent),ssFallback:e.ssFallback&&lo(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&br(u,c.clone(u)),u}function uo(e=` `,t=0){return V(Ka,null,e,t)}function fo(e,t){let n=V(qa,null,e);return n.staticCount=t,n}function po(e=``,t=!1){return t?(Ya(),to(z,null,e)):V(z,null,e)}function mo(e){return e==null||typeof e==`boolean`?V(z):v(e)?V(R,null,e.slice()):no(e)?ho(e):V(Ka,null,String(e))}function ho(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:lo(e)}function go(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(v(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),go(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!oa(t)?t._ctx=F:r===3&&F&&(F.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(C(t)){if(r&65){go(e,{default:t});return}t={default:t,_ctx:F},n=32}else t=String(t),r&64?(n=16,t=[uo(t)]):n=8;e.children=t,e.shapeFlag|=n}function _o(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=we([t.class,r.class]));else if(e===`style`)t.style=ye([t.style,r.style]);else if(f(e)){let n=t[e],i=r[e];i&&n!==i&&!(v(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!p(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function H(e,t,n,r=null){En(e,t,7,[n,r])}var vo=Vi(),yo=0;function bo(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||vo,a={uid:yo++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Fe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:fa(r,i),emitsOptions:J
vendor: 3,230 bytes, line 3
3i(r,i),emit:null,emitted:null,propsDefaults:c,inheritAttrs:r.inheritAttrs,ctx:c,data:c,props:c,attrs:c,slots:c,refs:c,setupState:c,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=Ki.bind(null,a),e.ce&&e.ce(a),a}var U=null,xo=()=>U||F,So,Co;{let e=ve(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};So=t(`__VUE_INSTANCE_SETTERS__`,e=>U=e),Co=t(`__VUE_SSR_SETTERS__`,e=>Do=e)}var wo=e=>{let t=U;return So(e),e.scope.on(),()=>{e.scope.off(),So(t)}},To=()=>{U&&U.scope.off(),So(null)};function Eo(e){return e.vnode.shapeFlag&4}var Do=!1;function Oo(e,t=!1,n=!1){t&&Co(t);let{props:r,children:i}=e.vnode,a=Eo(e);sa(e,r,a,t),ba(e,i,n||t);let o=a?ko(e,t):void 0;return t&&Co(!1),o}function ko(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wi);let{setup:r}=n;if(r){tt();let n=e.setupContext=r.length>1?Fo(e):null,i=wo(e),a=Tn(r,e,0,[e.props,n]),o=D(a);if(nt(),i(),(o||e.sp)&&!Hr(e)&&Cr(e),o){if(a.then(To,To),t)return a.then(n=>{Ao(e,n,t)}).catch(t=>{Dn(t,e,0)});e.asyncDep=a}else Ao(e,a,t)}else No(e,t)}function Ao(e,t,n){C(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:E(t)&&(e.setupState=fn(t)),No(e,n)}var jo,Mo;function No(e,t,n){let r=e.type;if(!e.render){if(!t&&jo&&!r.render){let t=r.template||Mi(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=jo(t,m(m({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||u,Mo&&Mo(e)}{let t=wo(e);tt();try{Oi(e)}finally{nt(),t()}}}var Po={get(e,t){return j(e,`get`,``),e[t]}};function Fo(e){return{attrs:new Proxy(e.attrs,Po),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Io(e){return e.exposed?e.exposeProxy||=new Proxy(fn(tn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Si)return Si[n](e)},has(e,t){return t in e||t in Si}}):e.proxy}function Lo(e,t=!0){return C(e)?e.displayName||e.name:e.name||t&&e.__name}function Ro(e){return C(e)&&`__vccOpts`in e}var zo=(e,t)=>vn(e,t,Do);function Bo(e,t,n){try{Qa(-1);let r=arguments.length;return r===2?E(t)&&!v(t)?no(t)?V(e,null,[t]):V(e,t):V(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&no(n)&&(n=[n]),V(e,t,n))}finally{Qa(1)}}var Vo=`3.5.40`,Ho=void 0,Uo=typeof window<`u`&&window.trustedTypes;if(Uo)try{Ho=Uo.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Wo=Ho?e=>Ho.createHTML(e):e=>e,Go=`http://www.w3.org/2000/svg`,Ko=`http://www.w3.org/1998/Math/MathML`,qo=typeof document<`u`?document:null,Jo=qo&&qo.createElement(`template`),Yo={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?qo.createElementNS(Go,e):t===`mathml`?qo.createElementNS(Ko,e):n?qo.createElement(e,{is:n}):qo.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>qo.createTextNode(e),createComment:e=>qo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>
vendor: 7,271 bytes, line 3
3{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>qo.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{Jo.innerHTML=Wo(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Jo.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Xo=`transition`,Zo=`animation`,Qo=Symbol(`_vtc`),$o={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},es=m({},dr,$o),ts=(e=>(e.displayName=`Transition`,e.props=es,e))((e,{slots:t})=>Bo(hr,is(e),t)),ns=(e,t=[])=>{v(e)?e.forEach(e=>e(...t)):e&&e(...t)},rs=e=>e?v(e)?e.some(e=>e.length>1):e.length>1:!1;function is(e){let t={};for(let n in e)n in $o||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,h=as(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,cs(e,t?u:s),cs(e,t?l:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,cs(e,d),cs(e,p),cs(e,f),t&&t()},ee=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);ns(i,[t,o]),ls(()=>{cs(t,e?c:a),ss(t,e?u:s),rs(i)||ds(t,r,g,o)})};return m(t,{onBeforeEnter(e){ns(v,[e]),ss(e,a),ss(e,o)},onBeforeAppear(e){ns(C,[e]),ss(e,c),ss(e,l)},onEnter:ee(!1),onAppear:ee(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);ss(e,d),e._enterCancelled?(ss(e,f),hs(e)):(hs(e),ss(e,f)),ls(()=>{e._isLeaving&&(cs(e,d),ss(e,p),rs(x)||ds(e,r,_,n))}),ns(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),ns(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),ns(T,[e])},onLeaveCancelled(e){D(e),ns(S,[e])}})}function as(e){if(e==null)return null;if(E(e))return[os(e.enter),os(e.leave)];{let t=os(e);return[t,t]}}function os(e){return ge(e)}function ss(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Qo]||(e[Qo]=new Set)).add(t)}function cs(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Qo];n&&(n.delete(t),n.size||(e[Qo]=void 0))}function ls(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var us=0;function ds(e,t,n,r){let i=e._endId=++us,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=fs(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function fs(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${Xo}Delay`),a=r(`${Xo}Duration`),o=ps(i,a),s=r(`${Zo}Delay`),c=r(`${Zo}Duration`),l=ps(s,c),u=null,d=0,f=0;t===Xo?o>0&&(u=Xo,d=o,f=a.length):t===Zo?l>0&&(u=Zo,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?Xo:Zo:null,f=u?u===Xo?a.length:c.length:0);let p=u===Xo&&/\b(?:transform|all)(?:,|$)/.test(r(`${Xo}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function ps(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>ms(t)+ms(e[n])))}function ms(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function hs(e){return(e?e.ownerDocument:document).body.offsetHeight}function gs(e,t,n){let r=e[Qo];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var _s=Symbol(`_vod`),vs=Symbol(`_vsh`),ys=Symbol(``),bs=/(?:^|;)\s*display\s*:/;function xs(e,t,n){let r=e.style,i=w(n),a=!1;if(n&&!i){if(t)if(w(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Cs(r,t,``)}else for(let e in t)n[e]??Cs(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Cs(r,i,``):Ds(e,i,!w(t)&&t?t[i]:void 0,o)||Cs(r,i,o)}}else if(i){if(t!==n){let e=r[ys];e&&(n+=`;`+e),r.cssText=n,a=bs.test(n)}}else t&&e.removeAttribute(`style`);_s in e&&(e[_s]=a?r.display:``,e[vs]&&(r.display=`none`))}var Ss=/\s*!important$/;function Cs(e,t,n){if(v(n))n.forEach(n=>Cs(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Es(e,t);Ss.test(n)?e.setProperty(le(r),n.replace(Ss,``),`important`):e[r]=n}}var ws=[`Webkit`,`Moz`,`ms`],Ts={};function Es(e,t){let n=Ts[t];if(n)return n;let r=O(t);if(r!==`filter`&&r in e)return Ts[t]=r;r=ue(r);for(let n=0;n<ws.length;n++){let i=ws[n]+r;if(i in e)return Ts[t]=i}return t}function Ds(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&w(r)&&n===r}var Os=`http://www.w3.org/1999/xlink`;function ks(e,t,n,r,i,a=Ee(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Os,t.slice(6,t.length)):e.setAttributeNS(Os,t,n):n==null||a&&!De(n)?e.removeAttribute(t):e.setAttribute(t,a?``:T(n)?String(n):n)}function As(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?Wo(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=De(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function js(e,t,n,r){e.addEventListener(t,n,r)}function Ms(e,t,n,r){e.removeEventListener(t,n,r)}var Ns=Symbol(`_vei`);function Ps(e,t,n,r,i=null){let a=e[Ns]||(e[Ns]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Ls(t);r?js(e,n,a[t]=Vs(r,i),s):o&&(Ms(e,n,o,s),a[t]=void 0)}}var Fs=/(Once|Passive|Capture)$/,Is=/^on:?(?:Once|Passive|Capture)$/;function Ls(e){let t,n;for(;(n=e.match(Fs))&&!Is.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):le(e.slice(2)),t]}var Rs=0,zs=Promise.resolve(),Bs=()=>Rs||=(zs.then(()=>Rs=0),Date.now());function Vs(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(v(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&En(e,t,5,a)}}else En(r,t,5,[e])};return n.value=e,n.attached=Bs(),n}var Hs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Us=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?gs(e,r,o):t===`style`?xs(e,n,r):f(t)?p(t)||Ps(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Ws(e,t,r,o))?(As(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&ks(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Gs(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!w(r)))?As(e,O(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`fal
3se-value`&&(e._falseValue=r),ks(e,t,r,o))};function Ws(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Hs(t)&&C(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`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Hs(t)&&w(n)?!1:t in e}function Gs(e,t){let n=e._def.props;if(!n)return!1;let r=O(t);return Array.isArray(n)?n.some(e=>O(e)===r):Object.keys(n).some(e=>O(e)===r)}var Ks=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return v(t)?e=>pe(t,e):t};function qs(e){e.target.composing=!0}function Js(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Ys=Symbol(`_assign`);function Xs(e,t,n){return t&&(e=e.trim()),n&&(e=he(e)),e}var Zs={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Ys]=Ks(i);let a=r||i.props&&i.props.type===`number`;js(e,t?`change`:`input`,t=>{t.target.composing||e[Ys](Xs(e.value,n,a))}),(n||a)&&js(e,`change`,()=>{e.value=Xs(e.value,n,a)}),t||(js(e,`compositionstart`,qs),js(e,`compositionend`,Js),js(e,`change`,Js))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Ys]=Ks(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?he(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Qs={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,js(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?he(ec(e)):ec(e));e[Ys](e.multiple?b(e._modelValue)?new Set(t):t:t[0]),e._assigning=!0,Fn(()=>{e._assigning=!1})}),e[Ys]=Ks(r)},mounted(e,{value:t}){$s(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ys]=Ks(n)},updated(e,{value:t}){e._assigning||$s(e,t)}};function $s(e,t){let n=e.multiple,r=v(t);if(!(n&&!r&&!b(t))){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=ec(a);if(n)if(r){let e=typeof o;e===`string`||e===`number`?a.selected=t.some(e=>String(e)===String(o)):a.selected=Ae(t,o)>-1}else a.selected=t.has(o);else if(ke(ec(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ec(e){return`_value`in e?e._value:e.value}var tc=[`ctrl`,`shift`,`alt`,`meta`],nc={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)=>tc.some(n=>e[`${n}Key`]&&!t.includes(n))},rc=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=nc[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ic=m({patchProp:Us},Yo),ac,oc=!1;function sc(){return ac||=Sa(ic)}function cc(){return ac=oc?ac:Ca(ic),oc=!0,ac}var lc=((...e)=>{let t=sc().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=fc(e);if(!r)return;let i=t._component;!C(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,dc(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),uc=((...e)=>{let t=cc().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=fc(e);if(t)return n(t,!0,dc(t))},t});function dc(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function fc(e){return w(e)?document.querySelector(e):e}function pc(e,t={},n){for(let r in e){let i=e[r],a=n?`${n}:${r}`:r;typeof i==`object`&&i?pc(i,t,a):typeof i==`function`&&(t[a]=i)}return t}var mc=(()=>{if(console.createTask)return console.createTask;let e={run:e=>e()};return()=>e})();function hc(e,t,n,r){for(let i=n;i<e.length;i+=1)try{let n=r?r.run(()=>e[i](...t)):e[i](...t);if(n&&typeof n.then==`function`)return Promise.resolve(n).then(()=>hc(e,t,i+1,r))}catch(e){return Promise.reject(e)}}
3function gc(e,t,n){if(e.length>0)return hc(e,t,0,mc(n))}function _c(e,t,n){if(e.length>0){let r=mc(n);return Promise.all(e.map(e=>r.run(()=>e(...t))))}}function vc(e,t){for(let n of[...e])n(t)}var yc=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,n={}){if(!e||typeof t!=`function`)return()=>{};let r=e,i;for(;this._deprecatedHooks[e];)i=this._deprecatedHooks[e],e=i.to;if(i&&!n.allowDeprecated){let e=i.message;e||=`${r} hook has been deprecated`+(i.to?`, please use ${i.to}`:``),this._deprecatedMessages||=new Set,this._deprecatedMessages.has(e)||(console.warn(e),this._deprecatedMessages.add(e))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>`_`+e.replace(/\W+/g,`_`)+`_hook_cb`,configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&=(this.removeHook(e,t),void 0)}}hookOnce(e,t){let n,r=(...e)=>(typeof n==`function`&&n(),n=void 0,r=void 0,t(...e));return n=this.hook(e,r),n}removeHook(e,t){let n=this._hooks[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&(this._hooks[e]=void 0)}}clearHook(e){this._hooks[e]=void 0}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t==`string`?{to:t}:t;let n=this._hooks[e]||[];this._hooks[e]=void 0;for(let t of n)this.hook(e,t)}deprecateHooks(e){for(let t in e)this.deprecateHook(t,e[t])}addHooks(e){let t=pc(e),n=Object.keys(t).map(e=>this.hook(e,t[e]));return()=>{for(let e of n)e();n.length=0}}removeHooks(e){let t=pc(e);for(let e in t)this.removeHook(e,t[e])}removeAllHooks(){this._hooks={}}callHook(e,...t){return this.callHookWith(gc,e,t)}callHookParallel(e,...t){return this.callHookWith(_c,e,t)}callHookWith(e,t,n){let r=this._before||this._after?{name:t,args:n,context:{}}:void 0;this._before&&vc(this._before,r);let i=e(this._hooks[t]?[...this._hooks[t]]:[],n,t);return i instanceof Promise?i.finally(()=>{this._after&&r&&vc(this._after,r)}):(this._after&&r&&vc(this._after,r),i)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){let t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){let t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}};function bc(){return new yc}var xc=class{_hooks;constructor(){this._hooks={}}hook(e,t){return!e||typeof t!=`function`?()=>{}:(this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&=(this.removeHook(e,t),void 0)})}removeHook(e,t){let n=this._hooks[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&(this._hooks[e]=void 0)}}callHook(e,...t){let n=this._hooks[e];if(!(!n||n.length===0))return hc(n,t,0)}};function Sc(){return globalThis.AsyncLocalStorage||globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncLocalStorage}function Cc(e={}){let t,n=!1,r=e=>{if(t&&t!==e)throw Error(`Context conflict`)},i;if(e.asyncContext){let t=e.AsyncLocalStorage||Sc();t?i=new t:console.warn("[unctx] `AsyncLocalStorage` is not provided.")}let a=e=>i&&typeof e==`object`&&e?{__unctx_weak:new WeakRef(e)}:e,o=e=>e&&e.__unctx_weak?e.__unctx_weak.deref():e,s=()=>{if(i){let e=i.getStore();if(e!==void 0)return o(e)}return t};return{use:()=>{let e=s();if(e===void 0)throw Error(`Context is not available`);return e},tryUse:()=>s(),set:(e,i)=>{i||r(e),t=e,n=!0},unset:()=>{t=void 0,n=!1},call:(e,o)=>{r(e),t=e;try{return i?i.run(a(e),o):o()}finally{n||(t=void 0)}},async callAsync(e,r){t=e;let o=()=>{t=e},s=()=>t===e?o:void 0;Ac.add(s);try{let o=i?i.run(a(e),r):r();return n||(t=void 0),await o}finally{Ac.delete(s)}}}}function wc(e={}){let t={};return{get(n,r={}){return t[n]||(t[n]=Cc({...e,...r})),t[n]}}}var Tc=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof global<`u`?global:typeof window<`u`?window:{},Ec=`__unctx__`,Dc=Tc[Ec]||(Tc[Ec]=wc()),Oc=(e,t={})=>Dc.get(e,t),kc=`__unctx_async_handlers__`,Ac=Tc[kc]||(Tc[kc]=new Set);function jc(e){let t=[];for(let e of Ac){let n=e();
3n&&t.push(n)}let n=()=>{for(let e of t)e()},r=e();return r&&typeof r==`object`&&`catch`in r&&(r=r.catch(e=>{throw n(),e})),[r,n]}var Mc={link:[{rel:`icon`,type:`image/x-icon`,href:`/favicon.ico`},{rel:`preconnect`,href:`https://fonts.googleapis.com`},{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossorigin:`anonymous`},{rel:`stylesheet`,href:`https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600;700&family=Roboto+Mono:wght@300;400&display=swap`}],meta:[{charset:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{name:`theme-color`,content:`#141414`},{name:`author`,content:`Daniel Akinleye`},{name:`google-site-verification`,content:`E7uvu-IZTcujPfx_4KYFdc1p1RJKDV8acXoRe9rHTMg`},{property:`og:image`,content:`og-image.png`},{property:`og:image:type`,content:`image/png`},{property:`og:image:width`,content:1200},{property:`og:image:height`,content:630},{name:`twitter:image`,content:`og-image.png`},{name:`twitter:image:type`,content:`image/png`},{name:`twitter:image:width`,content:1200},{name:`twitter:image:height`,content:630},{property:`og:type`,content:`website`}],style:[],script:[{src:`https://www.googletagmanager.com/gtag/js?id=G-4H78PN7FZ5`,async:!0},{innerHTML:"window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag(`js`,new Date),gtag(`config`,`G-4H78PN7FZ5`);"}],noscript:[],titleTemplate:`%s`,title:`Danny Kinz â Design Engineer | Product Designer | Framer Developer`,htmlAttrs:{}},Nc={id:`__nuxt-loader`},Pc={componentName:`NuxtLink`,prefetch:!0,prefetchOn:{visibility:!0}},Fc={deep:!1},Ic={},Lc=`#__nuxt`,Rc=`nuxt-app`,zc=36e5,Bc=`vite:preloadError`;function Vc(e=`nuxt-app`){return Oc(e,{asyncContext:!1})}var Hc=`__nuxt_plugin`;function Uc(e){let t=0,n={_id:e.id||`nuxt-app`,_scope:Ie(),provide:void 0,versions:{get nuxt(){return`4.5.0`},get vue(){return n.vueApp.version}},payload:Jt({...e.ssrContext?.payload||{},data:Jt({}),state:qt({}),once:new Set,_errors:Jt({})}),static:{data:{}},runWithContext(e){return n._scope.active&&!Le()?n._scope.run(()=>qc(n,e)):qc(n,e)},isHydrating:!0,deferHydration(){if(!n.isHydrating)return()=>{};t++;let e=!1;return()=>{if(!e&&(e=!0,t--,t===0))return n.isHydrating=!1,n.callHook(`app:suspense:resolve`)}},_asyncDataPromises:{},_asyncData:Jt({}),_state:Jt({}),_payloadRevivers:{},...e};{let e=window.__NUXT__;if(e)for(let t in e)switch(t){case`data`:case`state`:case`_errors`:Object.assign(n.payload[t],e[t]);break;default:n.payload[t]=e[t]}}n.hooks=bc(),n.hook=n.hooks.hook;{let e=n.hooks.callHook;n.hooks.callHook=(t,...n)=>Promise.resolve().then(()=>e(t,...n))}n.callHook=n.hooks.callHook,n.provide=(e,t)=>{let r=`$`+e;Zc(n,r,t),Zc(n.vueApp.config.globalProperties,r,t)},Zc(n.vueApp,`$nuxt`,n),Zc(n.vueApp.config.globalProperties,`$nuxt`,n);{window.addEventListener(Bc,e=>{n.callHook(`app:chunkError`,{error:e.payload}),e.payload?.message?.includes(`Unable to preload CSS`)&&e.preventDefault()}),window.useNuxtApp||=Yc;let e=n.hook(`app:error`,(...e)=>{o.NUXT_E1005({cause:e.length>1?e:e[0]})});n.hook(`app:mounted`,e)}let r=n.payload.config;return n.provide(`config`,r),n}async function Wc(e,t){if(typeof t==`function`){let{provide:n}=await e.runWithContext(()=>t(e))||{};if(n&&typeof n==`object`)for(let t in n)e.provide(t,n[t])}}async function Gc(e,t){let n;for(let r of t)try{await Wc(e,r)}catch(t){if(!e.payload.error)throw t;n||=t}if(n)throw e.payload.error||n}function Kc(e){if(typeof e==`function`)return e;let t=e._name||e.name;return delete e.name,Object.assign(e.setup||(()=>{}),e,{[Hc]:!0,_name:t})}function qc(e,t,n){return Vc(e._id).set(e),e.vueApp.runWithContext(()=>n?t(...n):t())}function Jc(e){let t;return Zn()&&(t=xo()?.appContext.app.$nuxt),t||=Vc(e).tryUse(),t||null}function Yc(e){let t=Jc(e);if(!t)throw o.NUXT_E1001();return t}function Xc(e){return Yc().$config}function Zc(e,t,n){Object.defineProperty(e,t,{get:()=>n})}var Qc=/bot\b|chrome-lighthouse|facebookexternalhit|google\b/i;function $c(e){return Qc.test(e)}import.meta.url.replace(/\/app\/.*$/,`/`);var el=Symbol(`layout-meta`),tl=Symbol(`route`),nl=r({docsBase:i,reporters:a});String.fromCharCode;
3var rl=/#/g,il=/&/g,al=/\//g,ol=/=/g,sl=/\?/g,cl=/\+/g,ll=/%5e/gi,ul=/%60/gi,dl=/%7c/gi,fl=/%20/gi,pl=/%2f/gi,ml=/%252f/gi;function hl(e){return encodeURI(``+e).replace(dl,`|`)}function gl(e){return hl(typeof e==`string`?e:JSON.stringify(e)).replace(cl,`%2B`).replace(fl,`+`).replace(rl,`%23`).replace(il,`%26`).replace(ul,"`").replace(ll,`^`).replace(al,`%2F`)}function _l(e){return gl(e).replace(ol,`%3D`)}function vl(e){return hl(e).replace(rl,`%23`).replace(sl,`%3F`).replace(ml,`%2F`).replace(il,`%26`).replace(cl,`%2B`)}function yl(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function bl(e){return yl(e.replace(pl,`%252F`))}function xl(e){return yl(e.replace(cl,` `))}function Sl(e){return yl(e.replace(cl,` `))}function Cl(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=xl(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=Sl(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function wl(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${_l(e)}=${gl(t)}`).join(`&`):`${_l(e)}=${gl(t)}`:_l(e)}function Tl(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>wl(t,e[t])).filter(Boolean).join(`&`)}var El=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Dl=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Ol=/^([/\\]\s*){2,}[^/\\]/,kl=/^[\s\0]*(blob|data|javascript|vbscript):$/i,Al=/\/$|\/\?|\/#/,jl=/^\.?\//;function Ml(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?El.test(e):Dl.test(e)||(t.acceptRelative?Ol.test(e):!1)}function Nl(e){return!!e&&kl.test(e)}function Pl(e=``,t){return t?Al.test(e):e.endsWith(`/`)}function Fl(e=``,t){if(!t)return(Pl(e)?e.slice(0,-1):e)||`/`;if(!Pl(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function Il(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(Pl(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function Ll(e=``){return e.startsWith(`/`)}function Rl(e=``){return Ll(e)?e:`/`+e}function zl(e,t){if(Hl(t)||Ml(e))return e;let n=Fl(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return Wl(n,e)}function Bl(e,t){if(Hl(t))return e;let n=Fl(t);if(!e.startsWith(n))return e;let r=e[n.length];return r&&r!==`/`&&r!==`?`?e:`/`+e.slice(n.length).replace(/^\/+/,``)}function Vl(e,t){let n=Xl(e);return n.search=Tl({...Cl(n.search),...t}),Ql(n)}function Hl(e){return!e||e===`/`}function Ul(e){return e&&e!==`/`}function Wl(e,...t){let n=e||``;for(let e of t.filter(e=>Ul(e)))if(n){let t=e.replace(jl,``);n=Il(n)+t}else n=e;return n}function Gl(...e){let t=/\/(?!\/)/,n=e.filter(Boolean),r=[],i=0;for(let e of n)if(!(!e||e===`/`)){for(let[n,a]of e.split(t).entries())if(!(!a||a===`.`)){if(a===`..`){if(r.length===1&&Ml(r[0]))continue;r.pop(),i--;continue}if(n===1&&r[r.length-1]?.endsWith(`:/`)){r[r.length-1]+=`/`+a;continue}r.push(a),i++}}let a=r.join(`/`);return i>=0?n[0]?.startsWith(`/`)&&!a.startsWith(`/`)?a=`/`+a:n[0]?.startsWith(`./`)&&!a.startsWith(`./`)&&(a=`./`+a):a=`../`.repeat(-1*i)+a,n[n.length-1]?.endsWith(`/`)&&!a.endsWith(`/`)&&(a+=`/`),a}function Kl(e){return ql(e,`https://`)}function ql(e,t){let n=e.match(Dl);return n||=e.match(/^\/{2,}/),n?t+e.slice(n[0].length):t+e}function Jl(e,t){return yl(Fl(e))===yl(Fl(t))}var Yl=Symbol.for(`ufo:protocolRelative`);function Xl(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!Ml(e,{acceptRelative:!0}))return t?Xl(t+e):Zl(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=Zl(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[Yl]:!r}}function Zl(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function Ql(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[Yl]?(e.protocol||``)+`//`:``)+i+a+t+n+r}function $l(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function eu(e,t,n=`.`,r){if(!$l(t))return eu(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:$l(a)&&$l(i[t])?i[t]=eu(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function tu(e){return(...t)=>t.reduce((t,n)=>eu(t,n,``,e),{})}var nu=tu();function ru(e,t){try{return t in e}catch{return!1}}
3var iu=class extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(e,t={}){super(e,t),t.cause&&!this.cause&&(this.cause=t.cause)}toJSON(){let e={message:this.message,statusCode:lu(this.statusCode,500)};return this.statusMessage&&(e.statusMessage=cu(this.statusMessage)),this.data!==void 0&&(e.data=this.data),e}};function au(e){if(typeof e==`string`)return new iu(e);if(ou(e))return e;let t=new iu(e.message??e.statusMessage??``,{cause:e.cause||e});if(ru(e,`stack`))try{Object.defineProperty(t,"stack",{get(){return e.stack}})}catch{try{t.stack=e.stack}catch{}}if(e.data&&(t.data=e.data),e.statusCode?t.statusCode=lu(e.statusCode,t.statusCode):e.status&&(t.statusCode=lu(e.status,t.statusCode)),e.statusMessage?t.statusMessage=e.statusMessage:e.statusText&&(t.statusMessage=e.statusText),t.statusMessage){let e=t.statusMessage;cu(t.statusMessage)!==e&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return e.fatal!==void 0&&(t.fatal=e.fatal),e.unhandled!==void 0&&(t.unhandled=e.unhandled),t}function ou(e){return e?.constructor?.__h3_error__===!0}var su=/[^\u0009\u0020-\u007E]/g;function cu(e=``){return e.replace(su,``)}function lu(e,t=200){return!e||(typeof e==`string`&&(e=Number.parseInt(e,10)),e<100||e>999)?t:e}globalThis.Headers,globalThis.Response;var uu=()=>Yc()?.$router,du=(()=>Zn()?Xn(tl,Yc()._route):Yc()._route);function fu(e){return e}var pu=()=>{try{if(Yc()._processingMiddleware)return!0}catch{return!1}return!1},mu=(e,t)=>{e||=`/`;let n=typeof e==`string`?e:`path`in e?hu(e):uu().resolve(e).href;if(t?.open){let{protocol:e}=new URL(n,window.location.href);if(e&&Nl(e))throw nl.NUXT_E2002({toPath:n,protocol:e});let{target:r=`_blank`,windowFeatures:i={}}=t.open,a=[];for(let[e,t]of Object.entries(i))t!==void 0&&a.push(`${e.toLowerCase()}=${t}`);return open(n,r,a.join(`, `)),Promise.resolve()}let r=Ml(n,{acceptRelative:!0}),i=t?.external||r;if(i){if(!t?.external)throw nl.NUXT_E2001({toPath:n});let{protocol:e}=new URL(n,window.location.href);if(e&&Nl(e))throw nl.NUXT_E2002({toPath:n,protocol:e})}let a=pu();if(!i&&a){if(t?.replace){if(typeof e==`string`){let{pathname:t,search:n,hash:r}=Xl(e);return{path:t,...n&&{query:Cl(n)},...r&&{hash:r},replace:!0}}return{...e,replace:!0}}return e}let o=uu(),s=Yc();if(i)return s._scope.stop(),t?.replace?location.replace(n):location.href=n,a?s.isHydrating?new Promise(()=>{}):!1:Promise.resolve();let c=typeof e==`string`?gu(e):e;return t?.replace?o.replace(c):o.push(c)};function hu(e){return Vl(e.path||``,e.query||{})+(e.hash||``)}function gu(e){let t=Xl(e);return vl(bl(t.pathname))+t.search+t.hash}var _u=`__nuxt_error`,vu=()=>hn(Yc().payload,`error`),yu=e=>{let t=wu(e);try{let e=vu();Yc().hooks.callHook(`app:error`,t),e.value||=t}catch{throw t}return t},bu=(e,t)=>{let n=e.callHook(`app:error`,wu(t));return o.NUXT_E1012({userAgent:navigator.userAgent,cause:t}),n},xu=async(e,t)=>{if($c(navigator.userAgent)){await bu(e,t);return}await e.runWithContext(()=>yu(t))},Su=async(e={})=>{let t=Yc(),n=vu();t.callHook(`app:error:cleared`,e),e.redirect&&await uu().replace(e.redirect),n.value=void 0},Cu=e=>!!e&&typeof e==`object`&&`__nuxt_error`in e,wu=e=>{typeof e!=`string`&&e.statusText&&(e.message??=e.statusText);let t=au(e);return Object.defineProperty(t,_u,{value:!0,configurable:!1,writable:!1}),Object.defineProperty(t,"status",{get:()=>t.statusCode,configurable:!0}),Object.defineProperty(t,"statusText",{get:()=>t.statusMessage,configurable:!0}),t},Tu=r({docsBase:i,reporters:a});function Eu(e,t){return t&&typeof e==`function`&&(e.key=t),e}var Du=new Set([`link`,`style`,`script`,`noscript`]),Ou=new Set([`title`,`titleTemplate`,`script`,`style`,`noscript`]),ku=new Set([`base`,`meta`,`link`,`style`,`script`,`noscript`]),Au=new Set([`title`,`base`,`htmlAttrs`,`bodyAttrs`,`meta`,`link`,`style`,`script`,`noscript`]),ju=new Set([`base`,`title`,`titleTemplate`,`bodyAttrs`,`htmlAttrs`,`templateParams`]),Mu=new Set([`key`,`tagPosition`,`tagPriority`,`tagDuplicateStrategy`,`innerHTML`,`textContent`,`processTemplateParams`]),Nu=new Set([`templateParams`,`htmlAttrs`,`bodyAttrs`]),Pu=new Set([`theme-color`,`google-site-verification`,`og`,`article`,`book`,`profile`,`twitter`,`author`]),Fu={critical:-8,high:-1,low:2};function Iu(e){return e===`__proto__`||e===`constructor`||e===`prototype`}var Lu={META:new Set([`twitter`,`fediverse`]),OG:new Set([`og`,`book`,`article`,`profile`,`fb`,`payment`]),MEDIA:new Set([`ogImage`,`ogVideo`,`ogAudio`,`twitterImage`]),HTTP_EQUIV:new Set([`contentType`,`defaultStyle`,`xUaCompatible`])},Ru={articleExpirationTime:`article:expiration_time`,articleModifiedTime:`article:modified_time`,articlePublishedTime:`article:published_time`,bookReleaseDate:`book:release_date`,fbAppId:`fb:app_id`,ogAudioSecureUrl:`og:audio:secure_url`,ogAudioUrl:`og:audio`,ogImageSecureUrl:`og:image:secure_url`,ogImageUrl:`og:image`,ogSiteName:`og:site_name`,ogVideoSecureUrl:`og:video:secure_url`,ogVideoUrl:`og:video`,paymentExpiresAt:`payment:expires_at`,paymentSuccessUrl:`payment:success_url`,profileFirstName:`profile:first_name`,profileLastName:`profile:last_name`,profileUsername:`profile:username`,msapplicationConfig:`msapplication-Config`,msapplicationTileColor:`msapplication-TileColor`,msapplicationTileImage:`msapplication-TileImage`},zu=/([A-Z])/g,Bu=/^(?:og|twitter)/,Vu={appleItunesApp:{unpack:{entrySeparator:`, `,resolve:({key:e,value:t})=>`${Hu(e)}=${t}`}},refresh:{metaKey:`http-equiv`,unpack:{entrySeparator:`;`,resolve:({key:e,value:t})=>e===`seconds`?`${t}`:void 0}},robots:{unpack:{entrySeparator:`, `,resolve:({key:e,value:t})=>typeof t==`boolean`?Hu(e):`${Hu(e)}:${t}`}},contentSecurityPolicy:{metaKey:`http-equiv`,unpack:{entrySeparator:`; `,resolve:({key:e,value:t})=>`${Hu(e)} ${t}`}},charset:{}};function Hu(e){let t=e.replace(zu,`-$1`).toLowerCase(),n=t.indexOf(`-`);return n===-1?t:Lu.META.has(t.slice(0,n))||Lu.OG.has(t.slice(0,n))?e.replace(zu,`:$1`).toLowerCase():t}function Uu(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>String(t)!==`false`&&e))}function Wu(e){return Array.isArray(e)?e.map(Wu):!e||typeof e!=`object`?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[Hu(e),Wu(t)]))}function Gu(e,t={}){let{entrySeparator:n=``,keyValueSeparator:r=``,wrapValue:i,resolve:a}=t;return Object.entries(e).map(([e,n])=>{if(a){let t=a({key:e,value:n});if(t!==void 0)return t}
3let o=typeof n==`object`?Gu(n,t):typeof n==`number`?n.toString():typeof n==`string`&&i?`${i}${n.replace(new RegExp(i,`g`),`\\${i}`)}${i}`:n;return`${e}${r}${o}`}).join(n)}function Ku(e,t){let n=Uu(t),r=Hu(e),i=qu(r);return Pu.has(r)?Xu(Object.fromEntries(Object.entries(n).map(([t,n])=>[`${e}${t===`url`?``:`${t[0].toUpperCase()}${t.slice(1)}`}`,n]))||{}).sort((e,t)=>(e[i]?.length||0)-(t[i]?.length||0)):[{[i]:r,...n}]}function qu(e){if(Vu[e]?.metaKey===`http-equiv`||Lu.HTTP_EQUIV.has(e))return`http-equiv`;let t=Hu(e),n=t.indexOf(`:`);return n===-1?`name`:Lu.OG.has(t.slice(0,n))?`property`:`name`}function Ju(e){return Ru[e]||Hu(e)}function Yu(e,t){return t===`refresh`?`${e.seconds};url=${e.url}`:Gu(Wu(e),{keyValueSeparator:`=`,entrySeparator:`, `,resolve:({value:e,key:t})=>e===null?``:typeof e==`boolean`?t:void 0,...Vu[t]?.unpack})}function Xu(e){let t=[],n={};for(let[r,i]of Object.entries(e)){if(Array.isArray(i)){if(r===`themeColor`){i.forEach(e=>{typeof e==`object`&&e&&t.push({name:`theme-color`,...e})});continue}for(let e of i)if(typeof e==`object`&&e){let n=[],i=[];for(let[t,a]of Object.entries(e)){let e=Xu({[`${r}${t===`url`?``:`:${t}`}`]:a});(t===`url`?n:i).push(...e)}t.push(...n,...i)}else t.push(...typeof e==`string`?Xu({[r]:e}):Ku(r,e));continue}if(typeof i==`object`&&i)if(Lu.MEDIA.has(r)){let e=r.startsWith(`twitter`)?`twitter`:`og`,n=r.replace(Bu,``).toLowerCase(),a=e===`twitter`?`name`:`property`;i.url&&t.push({[a]:`${e}:${n}`,content:i.url}),i.secureUrl&&t.push({[a]:`${e}:${n}:secure_url`,content:i.secureUrl});for(let[r,o]of Object.entries(i))r!==`url`&&r!==`secureUrl`&&t.push({[a]:`${e}:${n}:${r}`,content:o})}else Pu.has(Hu(r))?t.push(...Ku(r,i)):n[r]=Uu(i);else n[r]=i}let r=Object.entries(n).map(([e,t])=>{if(e===`charset`)return{charset:t===null?`_null`:t};let n=qu(e),r=Ju(e),i=t===null?`_null`:typeof t==`object`?Yu(t,e):typeof t==`number`?t.toString():t;return n===`http-equiv`?{"http-equiv":r,content:i}:{[n]:r,content:i}});return[...t,...r].map(e=>`content`in e&&e.content===`_null`?{...e,content:null}:e)}var Zu=Eu({key:`flatMeta`,hooks:{"entries:normalize":e=>{let t=!1,n=[],r=[];for(let i of e.tags){if(i.tag!==`_flatMeta`){n.push(i);continue}t=!0;for(let e of Xu(i.props))r.push({...i,tag:`meta`,props:e})}if(t){for(let e of r)n.push(e);e.tags=n}}}});function Qu(e){let t=new xc;for(let n in e||{})t.hook(n,e[n]);return t}function $u(e,t,n){if(e.hooks?._hooks?.[t]?.length)return e.hooks?.callHook(t,n)}var ed=/^(?:viewport|description|keywords|robots)$/,td=[`name`,`property`,`http-equiv`];function nd(e){let t=e.indexOf(`:`);if(t===-1)return!1;let n=e.indexOf(`:`,t+1);return Pu.has(e.slice(t+1,n===-1?e.length:n))}function rd(e){let{props:t,tag:n,key:r}=e;if(ju.has(n))return n;if(n===`link`){if(t.rel===`canonical`)return`canonical`;if(t.rel===`alternate`&&t.hreflang)return`alternate:${t.hreflang}`}if(t.charset)return`charset`;if(n===`meta`)for(let e of td){let n=t[e];if(n!==void 0)return`meta:${n}${(typeof n!=`string`||!n.includes(`:`))&&!ed.test(n)&&r?`:key:${r}`:``}`}return r?`${n}:key:${r}`:t.id?`${n}:id:${t.id}`:n===`link`&&t.rel&&t.href?`link:${t.rel}:${t.href}`:Ou.has(n)&&(e.textContent||e.innerHTML)?`${n}:content:${e.textContent||e.innerHTML}`:void 0}function id(e){let t=e._h||e._d||e.textContent||e.innerHTML;if(t)return t;let n=Object.keys(e.props).sort(),r=`${e.tag}:`,i=``;for(let t of n)r+=`${i}${t}:${String(e.props[t])}`,i=`,`;return r}function ad(e,t,n){if(n===`_resolver`)return e;typeof e==`function`&&(!n||n!==`titleTemplate`&&!n.startsWith(`on`))&&(e=e());let r=t?t(n,e):e;if(Array.isArray(r)){let e;for(let n=0;n<r.length;n++){let i=ad(r[n],t);e?e[n]=i:i!==r[n]&&(e=r.slice(0,n),e[n]=i)}return e||r}if(r?.constructor===Object){let e;for(let n in r){let i=Iu(n),a=i?void 0:ad(r[n],t,n);if(!e&&(i||a!==r[n])){e={};for(let t in r){if(t===n)break;e[t]=r[t]}}e&&!i&&(e[n]=a)}return e||r}return r}var od=/[\s"'<>/=\x00-\x1F\x7F]/;function sd(e,t){let n=e===`style`,r=n?new Map:new Set,i=e=>{if(e)if(n){let t=e.indexOf(`:`);t>0&&r.set(e.slice(0,t).trim(),e.slice(t+1).trim())}else e.split(` `).forEach(e=>e&&r.add(e))};if(typeof t==`string`)(n?t.split(`;
3`):[t]).forEach(i);else if(Array.isArray(t))t.forEach(i);else if(t&&typeof t==`object`)for(let e in t){let a=t[e];a&&a!==`false`&&(n?r.set(e.trim(),String(a)):i(e))}return r}function cd(e,t){if(e.props=e.props||{},!t)return e;if(e.tag===`templateParams`)return e.props=t,e;let n=ku.has(e.tag)||e.tag===`htmlAttrs`||e.tag===`bodyAttrs`;for(let r in t){if(Iu(r))continue;let i=r.startsWith(`data-`),a=n&&!Mu.has(r),o=a&&!i?r.toLowerCase():r;if(a&&(!o||od.test(o)))continue;let s=t[r];if(s===null)e.props[o]=null;else if(r===`class`||r===`style`)e.props[r]=sd(r,s);else if(Mu.has(r))if((r===`textContent`||r===`innerHTML`)&&typeof s==`object`){let n=t.type||`application/json`;(n.endsWith(`json`)||n===`speculationrules`||n===`importmap`)&&(e.props.type=t.type=n,e[r]=JSON.stringify(s))}else e[r]=s;else if(s!==void 0){let t=String(s),n=e.tag===`meta`&&o===`content`;e.props[o]=t===`true`||t===``?i||n?t:!0:!s&&i&&t===`false`?`false`:s}}return e}function ld(e,t){let n=cd({tag:e,props:{}},typeof t==`object`&&typeof t!=`function`?t:{[e===`script`||e===`noscript`||e===`style`?`innerHTML`:`textContent`]:t});if(n.key&&Du.has(n.tag)&&(n.props[`data-hid`]=n._h=n.key),n.tag===`script`&&typeof n.innerHTML==`object`&&(n.innerHTML=JSON.stringify(n.innerHTML),n.props.type=n.props.type||`application/json`),Array.isArray(n.props.content)){let e=[];for(let t of n.props.content)e.push({...n,props:{...n.props,content:t}});return e}return n}function ud(e,t){if(Array.isArray(t))for(let n of t)e.push(n);else e.push(t)}function dd(e,t){if(!e)return[];typeof e==`function`&&(e=e());let n;t.length&&(n=(e,n)=>{for(let r=0;r<t.length;r++)n=t[r](e,n);return n},e=n(void 0,e)),e=ad(e,n);let r=[];for(let t in e){let n=e[t];if(n!==void 0)if(Array.isArray(n))for(let e of n)ud(r,ld(t,e));else ud(r,ld(t,n))}return r}var fd=/</g,pd=/<\/script/g,md=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w,hd=()=>100;function gd(e){for(let t in e)return!1;return!0}var _d=/^tags:|:render/;function vd(e,t){let n=(t[`entries:resolve`]?.length||0)+(t[`entries:normalize`]?.length||0);if(e._h!==n){e._h=n;for(let t of e.entries.values())delete t._tags}}function yd(e){for(let t=0;t<e.length;t++){let n=e[t],r={...n.props};r.class instanceof Set&&(r.class=new Set(r.class)),r.style instanceof Map&&(r.style=new Map(r.style)),e[t]={...n,props:r}}}function bd(e,t){let n=e.tags,r=0;for(let t of e.tagMap.values())if(Array.isArray(t))for(let e of t)n[r++]=e;else n[r++]=t;n.length=r,t&&n.sort(md)}function xd(e){let t=!1;for(let n of e.tags.sort(md)){let r=n._d||id(n);if(!r)continue;let i=e.tagMap.get(r);if(!i){e.tagMap.set(r,n);continue}if((n.tagDuplicateStrategy||(Nu.has(n.tag)?`merge`:null)||(n.key&&n.key===i.key?`merge`:null))===`merge`){let t={...i.props};for(let e in n.props)t[e]=e===`style`?new Map([...i.props.style||new Map,...n.props[e]]):e===`class`?new Set([...i.props.class||[],...n.props[e]]):n.props[e];e.tagMap.set(r,{...n,props:t})}else n._p>>10==i._p>>10&&n.tag===`meta`&&nd(r)?(e.tagMap.set(r,Object.assign([...Array.isArray(i)?i:[i],n],n)),t=!0):(n._w===i._w?n._p>i._p:n._w<i._w)&&e.tagMap.set(r,n)}return t}function Sd(e,t){let n=e.tagMap.get(`title`),r=e.tagMap.get(`titleTemplate`);if(t._title=n?.textContent,!r)return;let i=r.textContent;if(t._titleTemplate=i,!i)return;let a=typeof i==`function`?i(n?.textContent):i;typeof a==`string`&&!t.plugins.has(`template-params`)&&(a=a.replace(`%s`,n?.textContent||``)),n?a===null?e.tagMap.delete(`title`):e.tagMap.set(`title`,{...n,textContent:a}):e.tagMap.set(`titleTemplate`,{...r,tag:`title`,textContent:a})}function Cd(e){let t=0;for(let n of e){let{innerHTML:r,tag:i,props:a}=n;if(!(!Au.has(i)||gd(a)&&!r&&!n.textContent)&&!(i===`meta`&&!a.content&&!a[`http-equiv`]&&!a.charset)){if(i===`script`&&(r||n.textContent)){let e=String(a.type),t=e.endsWith(`json`)||e===`importmap`||e===`speculationrules`,i=e=>t?(typeof e==`string`?e:JSON.stringify(e)).replace(fd,`\\u003C`):typeof e==`string`?e.replace(pd,`<\\/script`):e;n={...n},r&&(n.innerHTML=i(r)),n.textContent&&=i(n.textContent),n._d=rd(n)}e[t++]=n}}return e.length=t,e}function wd(e,t){let n=t?.tagWeight??e.resolvedOptions._tagWeight??hd,r={tagMap:new Map,tags:[]},i=e.hooks?._hooks||{};vd(e,i);for(let t of e.entries.values())t._pending!==void 0&&(t.input=t._pending,delete t._pending,delete t._tags,delete t._precomputedTags);let a;(i[`entries:resolve`]?.length||i[`entries:normalize`]?.length)&&(a=[...e.entries.values()],i[`entries:resolve`]?.length&&$u(e,`entries:resolve`,{entr
3ies:a,...r})),vd(e,i);for(let t of a||e.entries.values()){let a=t._tags;if(!a)if(t._precomputedTags&&n===e.resolvedOptions._tagWeight&&!i[`entries:normalize`]?.length&&!i[`entries:resolve`]?.length&&(!t.options||gd(t.options)))a=t._precomputedTags;else{if(a=dd(t.input,e.resolvedOptions.propResolvers||[]),t.options&&!gd(t.options))for(let e of a)Object.assign(e,t.options);if(i[`entries:normalize`]?.length){let n={tags:a,entry:t};$u(e,`entries:normalize`,n),a=n.tags}for(let e=0;e<a.length;e++){let r=a[e];r._w=n(r),r._p=(t._i<<10)+e,r._d=rd(r),r._d||(r._h=id(r))}t._tags=a}r.tags.push(...a)}for(let e in i)if(i[e]?.length&&_d.test(e)){yd(r.tags);break}let o=xd(r);return Sd(r,e),bd(r,o),$u(e,`tags:beforeResolve`,r),$u(e,`tags:resolve`,r),$u(e,`tags:afterResolve`,r),Cd(r.tags)}var Td=`usehead`;function Ed(){if(Zn()){let e=Xn(Td);if(e)return e}throw Error(`useHead() was called without provide context, ensure you call it through the setup() function.`)}function Dd(e){return{install(t){t.config.globalProperties.$unhead=e,t.config.globalProperties.$head=e,t.provide(Td,e)}}.install}var Od=Object.assign((e,t)=>N(t)?un(t):t,{_static:!0});function kd(e,t={}){return Ad(t.head||Ed(),e,t)}function Ad(e,t,n={}){let r=Le();if(r&&!r.active)return{patch(){},dispose(){},_i:-1};let i=an(!1);if(n.onRendered&&r){let e=n.onRendered;n={...n,onRendered:t=>r.run(()=>e(t))}}let a;return er(()=>{let r=i.value?{}:ad(t,Od);a?a.patch(r):a=e.push(r,n)}),xo()&&(ii(()=>{a.dispose()}),qr(()=>{i.value=!0}),Kr(()=>{i.value=!1})),a}function jd(e){if(e._flatMeta)return e;let t={};for(let n in e)!Object.hasOwn(e,n)||n===`title`||n===`titleTemplate`||(t[n]=e[n]);return{title:e.title,titleTemplate:e.titleTemplate,_flatMeta:t}}function Md(e={},t={}){(t.head||Ed()).use(Zu);let n=kd(jd(e),t),r=n.patch;return n.__patched||=(n.patch=e=>r(jd(e)),!0),n}function Nd(e){let t=e||Yc();return t.ssrContext?.head||t.runWithContext(()=>{if(Zn()){let e=Xn(`usehead`);if(!e)throw Tu.NUXT_E6001();return e}})}function Pd(e,t={}){return kd(e,{head:t.head||Nd(t.nuxt),...t})}function Fd(e,t={}){return Md(e,{head:t.head||Nd(t.nuxt),...t})}var Id=`modulepreload`,Ld=function(e,t){return new URL(e,t).href},Rd={},zd=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ld(t,n),t=s(t),t in Rd)return;Rd[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Id,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function Bd(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Vd(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var Hd=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Ud=class extends Error{constructor(e,t=`FunctionsError`,n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}},Wd=class extends Ud{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},Gd=class extends Ud{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},Kd=class extends Ud{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},qd;(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`})(qd||={});var Jd=class{constructor(e,{headers:t={},customFetch:n,region:r=qd.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=Hd(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Vd(this,arguments,void 0,function*(e,t={}){let n,r;try{let{headers:i,method:a,body:o,signal:s,timeout:c}=t,l={},{region:u}=t;u||=this.region;let d=new URL(`${this.url}/${e}`);u&&u!==`any`&&(l[`x-region`]=u,d.searchParams.set(`forceFunctionRegion`,u));let f,p=!!i&&Object.keys(i).some(e=>e.toLowerCase()===`content-type`);o&&!p?typeof Blob<`u`&&o instanceof Blob||o instanceof ArrayBuffer?(l[`Content-Type`]=`application/octet-stream`,f=o):typeof o==`string`?(l[`Content-Type`]=`text/plain`,f=o):typeof FormData<`u`&&o instanceof FormData?f=o:(l[`Content-Type`]=`application/json`,f=JSON.stringify(o)):f=o&&typeof o!=`string`&&!(typeof Blob<`u`&&o instanceof Blob)&&!(o instanceof ArrayBuffer)&&!(typeof FormData<`u`&&o instanceof FormData)?JSON.stringify(o):o;let m=s;c&&(r=new AbortController,n=setTimeout(()=>r.abort(),c),s?(m=r.signal,s.addEventListener(`abort`,()=>r.abort())):m=r.signal);let h=yield this.fetch(d.toString(),{method:a||`POST`,headers:Object.assign(Object.assign(Object.assign({},l),this.headers),i),body:f,signal:m}).catch(e=>{throw new Wd(e)}),g=h.headers.get(`x-relay-error`);if(g&&g===`true`)throw new Gd(h);if(!h.ok)throw new Kd(h);let _=(h.headers.get(`Content-Type`)??`text/plain`).split(`;`)[0].trim(),v;return v=_===`application/json`?yield h.json():_===`application/octet-stream`||_===`application/pdf`?yield h.blob():_===`text/event-stream`?h:_===`multipart/form-data`?yield h.formData():yield h.text(),{data:v,error:null,response:h}}catch(e){return{data:null,error:e,response:e instanceof Kd||e instanceof Gd?e.context:void 0}}finally{n&&clearTimeout(n)}})}},Yd=3,Xd=e=>Math.min(1e3*2**e,3e4),Zd=[520,503],Qd=[`GET`,`HEAD`,`OPTIONS`],$d=class extends
3Error{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 ef(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t?.addEventListener(`abort`,i)})}function tf(e,t,n,r){return!(!r||n>=Yd||!Qd.includes(e)||!Zd.includes(t))}var nf=class{constructor(e){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=e.shouldThrowOnError??!1,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle??!1,this.shouldStripNulls=e.shouldStripNulls??!1,this.urlLengthLimit=e.urlLengthLimit??8e3,this.retryEnabled=e.retry??!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 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){let e=this.headers.get(`Accept`);e===`application/vnd.pgrst.object+json`?this.headers.set(`Accept`,`application/vnd.pgrst.object+json;nulls=stripped`):(!e||e===`application/json`)&&this.headers.set(`Accept`,`application/vnd.pgrst.array+json;nulls=stripped`)}let r=this.fetch,i=(async()=>{let e=0;for(;;){let t={};n.headers.forEach((e,n)=>{t[n]=e}),e>0&&(t[`X-Retry-Count`]=String(e));let i;try{i=await r(n.url.toString(),{method:n.method,headers:t,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal})}catch(t){if(t?.name===`AbortError`||t?.code===`ABORT_ERR`||!Qd.includes(n.method))throw t;if(n.retryEnabled&&e<Yd){let t=Xd(e);e++,await ef(t,n.signal);continue}throw t}if(tf(n.method,i.status,e,n.retryEnabled)){let t=i.headers?.get(`Retry-After`)??null,r=t===null?Xd(e):Math.max(0,parseInt(t,10)||0)*1e3;await i.text(),e++,await ef(r,n.signal);continue}return await n.processResponse(i)}})();return this.shouldThrowOnError||(i=i.catch(e=>{let t=``,n=``,r=``,i=e?.cause;if(i){let n=i?.message??``,r=i?.code??``;t=`${e?.name??`FetchError`}: ${e?.message}`,t+=`\n\nCaused by: ${i?.name??`Error`}: ${n}`,r&&(t+=` (${r})`),i?.stack&&(t+=`\n${i.stack}`)}else t=e?.stack??``;let a=this.url.toString().length;return e?.name===`AbortError`||e?.code===`ABORT_ERR`?(r=``,n=`Request was aborted (timeout or manual cancellation)`,a>this.urlLengthLimit&&(n+=`. Note: Your request URL is ${a} 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.`)):(i?.name===`HeadersOverflowError`||i?.code===`UND_ERR_HEADERS_OVERFLOW`)&&(r=``,n=`HTTP headers exceeded server limits (typically 16KB)`,a>this.urlLengthLimit&&(n+=`. Your request URL is ${a} 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:`${e?.name??`FetchError`}: ${e?.message}`,details:t,hint:n,code:r},data:null,count:null,status:0,statusText:``}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,i=null,a=e.status,o=e.statusText;if(e.ok){if(t.method!==`HEAD`){let i=await e.text();if(i!==``)if(t.headers.get(`Accept`)===`text/csv`)r=i;else if(t.headers.get(`Accept`)&&t.headers.get(`Accept`)?.includes(`application/vnd.pgrst.plan+text`))r=i;else try{r=JSON.parse(i)}catch{if(n={message:i},r=null,t.shouldThrowOnError)throw new $d({message:i,details:``,hint:``,code:``})}}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);s&&c&&c.length>1&&(i=parseInt(c[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,i=null,a=406,o=`Not Acceptable`):r=r.length===1?r[0]:null)}else{let i=await e.text();try{n=JSON.parse(i),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o=`OK`)}
vendor: 52,386 bytes, lines 3-4
3catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new $d(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},rf=class extends nf{throwOnError(){return super.throwOnError()}select(e){let t=!1,n=(e??`*`).split(``).map(e=>/\s/.test(e)&&!t?``:(e===`"`&&(t=!t),e)).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:i=r}={}){let a=i?`${i}.order`:`order`,o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:``}${e}.${t?`asc`:`desc`}${n===void 0?``:n?`.nullsfirst`:`.nullslast`}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){let r=n===void 0?`limit`:`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){let i=r===void 0?`offset`:`${r}.offset`,a=r===void 0?`limit`:`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${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:i=!1,format:a=`text`}={}){let o=[e?`analyze`:null,t?`verbose`:null,n?`settings`:null,r?`buffers`:null,i?`wal`:null].filter(Boolean).join(`|`),s=this.headers.get(`Accept`)??`application/json`;return this.headers.set(`Accept`,`application/vnd.pgrst.plan+${a}; for="${s}"; options=${o};`),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}},af=RegExp(`[,()]`),of=class extends rf{throwOnError(){return super.throwOnError()}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){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&af.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&af.test(e)?`"${e}"`:`${e}`).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 i=``;r===`plain`?i=`pl`:r===`phrase`?i=`ph`:r===`websearch`&&(i=`w`);let a=n===void 0?``:`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){let 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}},sf=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:n=!1,count:r}=t??{},i=n?`HEAD`:`GET`,a=!1,o=(e??`*`).split(``).map(e=>/\s/.test(e)&&!a?``:(e===`"`&&(a=!a),e)).join(``),{url:s,headers:c}=this.cloneRequestState();return s.searchParams.set(`select`,o),r&&c.append(`Prefer`,`count=${r}`),new of({method:i,url:s,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){let{url:r,headers:i}=this.cloneRequestState();if(t&&i.append(`Prefer`,`count=${t}`),n||i.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);r.searchParams.set(`columns`,e.join(`,`))}}return new of({method:`POST`,url:r,headers:i,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){let{url:a,headers:o}=this.cloneRequestState();if(o.append(`Prefer`,`resolution=${n?`ignore`:`merge`}-duplicates`),t!==void 0&&a.searchParams.set(`on_conflict`,t),r&&o.append(`Prefer`,`count=${r}`),i||o.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set(`columns`,e.join(`,`))}}return new of({method:`POST`,url:a,headers:o,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){let{url:n,headers:r}=this.cloneRequestState();return t&&r.append(`Prefer`,`count=${t}`),new of({method:`PATCH`,url:n,headers:r,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){let{url:t,headers:n}=this.cloneRequestState();return e&&n.append(`Prefer`,`count=${e}`),new of({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function cf(e){"@babel/helpers - typeof";return cf=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cf(e)}function lf(e,t){if(cf(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cf(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function uf(e){var t=lf(e,`string`);return cf(t)==`symbol`?t:t+``}function df(e,t,n){return(t=uf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ff(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ff(Object(n),!0).forEach(function(t){df(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ff(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var mf=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=a;let s=r??globalThis.fetch;i!==void 0&&i>0?this.fetch=(e,t)=>{let n=new AbortController,r=setTimeout(()=>n.abort(),i),a=t?.signal;if(a){if(a.aborted)return clearTimeout(r),s(e,t);let i=()=>{clearTimeout(r),n.abort()};return a.addEventListener(`abort`,i,{once:!0}),s(e,pf(pf({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,pf(pf({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:this.fetch=s,this.retry=o}from(e){if(!e||typeof e!=`string`||e.trim()===``)throw Error(`Invalid relation name: relation must be a non-empty string.`);return new sf(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){let a,o=new URL(`${this.url}/rpc/${e}`),s,c=e=>typeof e==`object`&&!!e&&(!Array.isArray(e)||e.some(c)),l=n&&Object.values(t).some(c);l?(a=`POST`,s=t):n||r?(a=n?`HEAD`:`GET`,Object.entries(t).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(`,`)}}`:`${t}`]).forEach(([e,t])=>{o.searchParams.append(e,t)})):(a=`POST`,s=t);let u=new Headers(this.headers);return l?u.set(`Prefer`,i?`count=${i},return=minimal`:`return=minimal`):i&&u.set(`Prefer`,`count=${i}`),new of({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},hf=class{constructor(){}static detectEnvironment(){if(typeof WebSocket<`u`)return{type:`native`,wsConstructor:WebSocket};let e=globalThis;if(typeof globalThis<`u`&&e.WebSocket!==void 0)return{type:`native`,wsConstructor:e.WebSocket};let t=typeof global<`u`?global:void 0;if(t&&t.WebSocket!==void 0)return{type:`native`,wsConstructor:t.WebSocket};if(typeof globalThis<`u`&&e.WebSocketPair!==void 0&&globalThis.WebSocket===void 0)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`&&e.EdgeRuntime||typeof navigator<`u`&&navigator.userAgent?.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.`};let n=globalThis.process;if(n){let e=n.versions;if(e&&e.node)return{type:`unsupported`,error:`Node.js detected but native WebSocket not found.`,workaround:`Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option.`}}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(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||`WebSocket not supported in this environment.`;throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{return this.detectEnvironment().type===`native`}catch{return!1}}},gf=`realtime-js/2.110.7`,_f=`1.0.0`,vf=`2.0.0`,yf=vf,bf=1e4,xf={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},Sf={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},Cf={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},wf=class{constructor(e){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=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event==`string`)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){return this._isArrayBuffer(e.payload?.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){let t=e.payload?.payload??new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,t)}_encodeJsonUserBroadcastPush(e){let t=e.payload?.payload??{},n=new TextEncoder().encode(JSON.stringify(t)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,n)}_encodeUserBroadcastPush(e,t,n){let r=new TextEncoder,i=r.encode(e.topic),a=r.encode(e.ref??``),o=r.encode(e.join_ref??``),s=r.encode(e.payload.event),c=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=r.encode(Object.keys(c).length===0?``:JSON.stringify(c));if(o.length>255)throw Error(`joinRef length ${o.length} exceeds maximum of 255`);if(a.length>255)throw Error(`ref length ${a.length} exceeds maximum of 255`);if(i.length>255)throw Error(`topic length ${i.length} exceeds maximum of 255`);if(s.length>255)throw Error(`userEvent length ${s.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let u=this.USER_BROADCAST_PUSH_META_LENGTH+o.length+a.length+i.length+s.length+l.length,d=new ArrayBuffer(this.HEADER_LENGTH+u),f=new DataView(d),p=new Uint8Array(d),m=0;f.setUint8(m++,this.KINDS.userBroadcastPush),f.setUint8(m++,o.length),f.setUint8(m++,a.length),f.setUint8(m++,i.length),f.setUint8(m++,s.length),f.setUint8(m++,l.length),f.setUint8(m++,t),p.set(o,m),m+=o.length,p.set(a,m),m+=a.length,p.set(i,m),m+=i.length,p.set(s,m),m+=s.length,p.set(l,m),m+=l.length;var h=new Uint8Array(d.byteLength+n.byteLength);return h.set(new Uint8Array(d),0),h.set(new Uint8Array(n),d.byteLength),h.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if(typeof e==`string`){let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,r)}}_decodeUserBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+4,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength),f=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,p={type:this.BROADCAST_EVENT,event:l,payload:f};return a>0&&(p.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){return e instanceof ArrayBuffer||e?.constructor?.name===`ArrayBuffer`}_pick(e,t){return!e||typeof e!=`object`?{}:Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e)))}},W;(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`})(W||={});var Tf=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=Ef(i,e,t,r),n),{}):{}},Ef=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?Df(i,a):Of(a)},Df=(e,t)=>{if(e.charAt(0)===`_`)return Mf(t,e.slice(1,e.length));switch(e){case W.bool:return kf(t);case W.float4:case W.float8:case W.int2:case W.int4:case W.int8:case W.numeric:case W.oid:return Af(t);case W.json:case W.jsonb:return jf(t);case W.timestamp:return Nf(t);case W.abstime:case W.date:case W.daterange:case W.int4range:case W.int8range:case W.money:case W.reltime:case W.text:case W.time:case W.timestamptz:case W.timetz:case W.tsrange:case W.tstzrange:return Of(t);default:return Of(t)}},Of=e=>e,kf=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},Af=e=>{if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},jf=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},Mf=(e,t)=>{if(typeof e!=`string`)return e;let n=e.length-1,r=e[n];if(e[0]===`{`&&r===`}`){let r,i=e.slice(1,n);try{r=JSON.parse(`[`+i+`]`)}catch{r=i?i.split(`,`):[]}return r.map(e=>Df(t,e))}return e},Nf=e=>typeof e==`string`?e.replace(` `,`T`):e,Pf=e=>{let 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+=`/api/broadcast`,t.href},Ff=e=>typeof e==`function`?e:function(){return e},If=typeof self<`u`?self:null,Lf=typeof window<`u`?window:null,Rf=If||Lf||globalThis,zf=`2.0.0`,Bf=1e4,Vf=1e3,Hf=100,Uf={connecting:0,open:1,closing:2,closed:3},G={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},Wf={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},Gf={longpoll:`longpoll`,websocket:`websocket`},Kf={complete:4},qf=`base64url.bearer.phx.`,Jf=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(t=>t.status===e).forEach(e=>e.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})}},Yf=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+=1,this.callback()},this.timerCalc(this.tries+1))}},Xf=class{constructor(e,t,n){this.state=G.closed,this.topic=e,this.params=Ff(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Jf(this,Wf.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Yf(()=>{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=G.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,e=>{this.state=G.errored,this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log(`channel`,`close ${this.topic}`),this.state=G.closed,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=G.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 Jf(this,Wf.leave,Ff({}),this.timeout).send(),this.state=G.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Wf.reply,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw 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=G.closed,this.bindings=[]}onClose(e){this.on(Wf.close,e)}onError(e){return this.on(Wf.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&&(t===void 0||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t||={},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Jf(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=G.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(Wf.close,`leave`)},n=new Jf(this,Wf.leave,Ff({}),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?r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(`channel`,`dropping outdated message`,{topic:e,event:t,payload:n,joinRef:r}),!1):!0:!1}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=G.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw Error(`channel onMessage callbacks must return the payload, modified or unmodified`);let a=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let e=0;e<a.length;e++)a[e].callback(i,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===G.closed}isErrored(){return this.state===G.errored}isJoined(){return this.state===G.joined}isJoining(){return this.state===G.joining}isLeaving(){return this.state===G.leaving}},Zf=class{static request(e,t,n,r,i,a,o){if(Rf.XDomainRequest){let n=new Rf.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,a,o)}else if(Rf.XMLHttpRequest){let s=new Rf.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,i,a,o)}else if(Rf.fetch&&Rf.AbortController)return this.fetchRequest(e,t,n,r,i,a,o);else throw Error(`No suitable XMLHttpRequest implementation found`)}static fetchRequest(e,t,n,r,i,a,o){let s={method:e,headers:n,body:r},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),s.signal=c.signal),Rf.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{e.name===`AbortError`&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,i,a,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,o,s){e.open(t,n,!0),e.timeout=a;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{e.readyState===Kf.complete&&s&&s(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),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 i=t?`${t}[${r}]`:r,a=e[r];typeof a==`object`?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+`=`+encodeURIComponent(a))}return n.join(`&`)}static appendParams(e,t){return Object.keys(t).length===0?e:`${e}${e.match(/\?/)?`&`:`?`}${this.serialize(t)}`}},Qf=e=>{let t=``,n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)},$f=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(qf)&&(this.authToken=atob(t[1].slice(qf.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=Uf.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+Gf.websocket),`$1/`+Gf.longpoll)}endpointURL(){return Zf.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=Uf.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===Uf.open||this.readyState===Uf.connecting}poll(){let e={Accept:`application/json`};this.authToken&&(e[`X-Phoenix-AuthToken`]=this.authToken),this.ajax(`GET`,e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,`session_gone`,!1);return}this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Uf.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 Error(`unhandled poll status ${t}`)}})}send(e){typeof e!=`string`&&(e=Qf(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,t=0){this.awaitingBatchAck=!0;let n=t+Hf,r=e.slice(t,n);this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},r.join(` 4`),()=>this.onerror(`timeout`),t=>{!t||t.status!==200?(this.awaitingBatchAck=!1,this.onerror(t&&t.status),this.closeAndRetry(1011,`internal server error`,!1)):n<e.length?this.batchSend(e,n):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=Uf.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,i){let a;a=Zf.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(a),r()},e=>{this.reqs.delete(a),this.isActive()&&i(e)}),this.reqs.add(a)}},ep=class e{constructor(t,n={}){let r=n.events||{state:`presence_state`,diff:`presence_diff`};this.state=Object.create(null),this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let i=this.toNullProtoObj(this.clone(e));t=this.toNullProtoObj(t);let a=Object.create(null),o=Object.create(null);return this.map(i,(e,n)=>{t[e]||(o[e]=n)}),this.map(t,(e,t)=>{let n=i[e];if(n){let r=t.metas.map(e=>e.phx_ref),i=n.metas.map(e=>e.phx_ref),s=t.metas.filter(e=>i.indexOf(e.phx_ref)<0),c=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);s.length>0&&(a[e]=t,a[e].metas=s),c.length>0&&(o[e]=this.clone(n),o[e].metas=c)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},n,r)}static syncDiff(e,t,n,r){e=this.toNullProtoObj(e);let{joins:i,leaves:a}=this.clone(t);return n||=function(){},r||=function(){},this.map(i,(t,r)=>{let i=e[t];if(e[t]=this.clone(r),i){let n=e[t].metas.map(e=>e.phx_ref),r=i.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,i,r)}),this.map(a,(t,n)=>{let i=e[t];if(!i)return;let a=n.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>a.indexOf(e.phx_ref)<0),r(t,i,n),i.metas.length===0&&delete e[t]}),e}static list(e,t){return t||=function(e,t){return t},this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static toNullProtoObj(e){if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=e[n]}),t}static clone(e){return JSON.parse(JSON.stringify(e))}},tp={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,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,o=new TextEncoder,s=o.encode(t),c=o.encode(n),l=o.encode(i),u=o.encode(r);this.assertFieldSize(s.byteLength,`join_ref`),this.assertFieldSize(c.byteLength,`ref`),this.assertFieldSize(l.byteLength,`topic`),this.assertFieldSize(u.byteLength,`event`);let d=this.META_LENGTH+s.byteLength+c.byteLength+l.byteLength+u.byteLength,f=new ArrayBuffer(this.HEADER_LENGTH+d),p=new Uint8Array(f),m=new DataView(f),h=0;m.setUint8(h++,this.KINDS.push),m.setUint8(h++,s.byteLength),m.setUint8(h++,c.byteLength),m.setUint8(h++,l.byteLength),m.setUint8(h++,u.byteLength),p.set(s,h),h+=s.byteLength,p.set(c,h),h+=c.byteLength,p.set(l,h),h+=l.byteLength,p.set(u,h),h+=u.byteLength;var g=new Uint8Array(f.byteLength+a.byteLength);return g.set(p,0),g.set(new Uint8Array(a),f.byteLength),g.buffer},assertFieldSize(e,t){if(e>255)throw Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},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),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(o,o+r));o+=r;let c=n.decode(e.slice(o,o+i));o+=i;let l=n.decode(e.slice(o,o+a));return o+=a,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=n.decode(e.slice(s,s+o));s+=o;let f={status:d,response:e.slice(s,e.byteLength)};return{join_ref:c,ref:l,topic:u,event:Wf.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a+=r;let s=n.decode(e.slice(a,a+i));return a+=i,{join_ref:null,ref:null,topic:o,event:s,payload:e.slice(a,e.byteLength)}}},np=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||Bf,this.transport=t.transport||Rf.WebSocket||$f,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=Rf&&Rf.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=tp.encode.bind(tp),this.defaultDecoder=tp.decode.bind(tp),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===$f?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let r=null;Lf&&Lf.addEventListener&&(Lf.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Lf.addEventListener(`pageshow`,e=>{r===this.connectClock&&(r=null,this.connect())}),Lf.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=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Ff(t.params||{}),this.endPoint=`${e}/${Gf.websocket}`,this.vsn=t.vsn||zf,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Yf(()=>{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&&Ff(t.authToken)}getLongPollTransport(){return $f}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&=(this.conn.close(),null),this.transport=e}protocol(){return location.protocol.match(/^https/)?`wss`:`ws`}endPointURL(){let e=Zf.appendParams(Zf.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)===`/`?e.charAt(1)===`/`?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`: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=Ff(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==$f?this.connectWithFallback($f,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(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case $f:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${qf}${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=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}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,i,a=this.transportName(e),o=t=>{this.log(`transport`,`falling back to ${a}...`,t),this.off([void 0,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o(`memorized`);this.fallbackTimer=setTimeout(o,t),i=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),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(Error(`heartbeat timeout`)),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),Vf,`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();let 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===Uf.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(Wf.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Uf.connecting:return`connecting`;case Uf.open:return`open`;case Uf.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(([t])=>e.indexOf(t)===-1)}channel(e,t={}){let n=new Xf(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}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,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status===`ok`?`ok`:`error`,e)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`.trim(),r);for(let e=0;e<this.channels.length;e++){let o=this.channels[e];o.isMember(t,n,r,a)&&o.trigger(n,r,i,a)}this.triggerStateCallbacks(`message`,e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(t){this.log(`error`,`error in ${e} callback`,t)}})}catch(t){this.log(`error`,`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},rp=class e{constructor(t,n){let r=op(n);this.presence=new ep(t.getChannel(),r),this.presence.onJoin((n,r,i)=>{let a=e.onJoinPayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onLeave((n,r,i)=>{let a=e.onLeavePayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onSync(()=>{t.getChannel().trigger(`presence`,{event:`sync`})})}get state(){return e.transformState(this.presence.state)}static transformState(e){return e=ap(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=ip(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:sp(t),newPresences:ip(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:sp(t),leftPresences:ip(n)}}};function ip(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function ap(e){return JSON.parse(JSON.stringify(e))}function op(e){return e?.events&&{events:e.events}}function sp(e){return e?.metas?ip(e):[]}var cp;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(cp||={});var lp=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new rp(this.channel.channelAdapter,t)}};function up(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(e&&typeof e==`object`){let t=e;if(typeof t.code==`number`){let n=typeof t.reason==`string`&&t.reason?` (${t.reason})`:``;return Error(`socket closed: ${t.code}${n}`,{cause:e})}return Error(`channel error: transport failure`,{cause:e})}return Error(`channel error: connection lost`)}var dp=class{constructor(e,t,n){let r=fp(n);this.channel=e.getSocket().channel(t,r),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,n){let r;try{r=this.channel.push(e,t,n)}catch{throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log(`channel`,`discarded push due to buffer overflow: ${e.event}`,e.payload())}return r}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===xf.joined}isJoined(){return this.state===xf.joined}isJoining(){return this.state===xf.joining}isClosed(){return this.state===xf.closed}isLeaving(){return this.state===xf.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function fp(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var pp=/[,()"\\]/,mp=e=>pp.test(e)||e!==e.trim(),hp=e=>`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`,gp=e=>{let t=e===null?`null`:String(e);return mp(t)?hp(t):t},_p=e=>e===null?`null`:String(e),vp=(e,t)=>{if(e===`in`){let e=Array.isArray(t)?t:[t];if(e.length===0)throw Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(e)).map(e=>gp(e)).join(`,`)})`}return e===`is`?`is.${_p(t)}`:`${e}.${gp(t)}`},yp=class{constructor(){this.filters=[]}add(e,t,n,r=!1){let i=r?`not.`:``;return this.filters.push(`${e}=${i}${vp(t,n)}`),this}eq(e,t){return this.add(e,`eq`,t)}neq(e,t){return this.add(e,`neq`,t)}gt(e,t){return this.add(e,`gt`,t)}gte(e,t){return this.add(e,`gte`,t)}lt(e,t){return this.add(e,`lt`,t)}lte(e,t){return this.add(e,`lte`,t)}in(e,t){return this.add(e,`in`,t)}like(e,t){return this.add(e,`like`,t)}ilike(e,t){return this.add(e,`ilike`,t)}match(e,t){return this.add(e,`match`,t)}imatch(e,t){return this.add(e,`imatch`,t)}is(e,t){return this.add(e,`is`,t)}isDistinct(e,t){return this.add(e,`isdistinct`,t)}not(e,t,n){return this.add(e,t,n,!0)}build(){return this.filters.join(`,`)}toString(){return this.build()}},bp;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(bp||={});var xp;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(xp||={});var Sp;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(Sp||={});var Cp=class e{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}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(e,t={config:{}},n){if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,``),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},t.config),this.channelAdapter=new dp(this.socket.socketAdapter,e,this.params),this.presence=new lp(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Pf(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&this.params.config?.broadcast?.replay)throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:n,presence:r,private:i}}=this.params,a=this.bindings.postgres_changes?.map(e=>e.filter)??[],o=!!this.bindings[xp.PRESENCE]&&this.bindings[xp.PRESENCE].length>0||this.params.config.presence?.enabled===!0,s={},c={broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:o}),postgres_changes:a,private:i};this.socket.accessTokenValue&&(s.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(Sp.CHANNEL_ERROR,up(t))}),this._onClose(()=>e?.(Sp.CLOSED)),this.updateJoinPayload(Object.assign({config:c},s)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(Sp.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=xf.errored;let n=Object.values(t).join(`, `)||`error`;e?.(Sp.CHANNEL_ERROR,Error(n,{cause:t}))}).receive(`timeout`,()=>{e?.(Sp.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){let r=this.bindings.postgres_changes,i=r?.length??0,a=[];for(let o=0;o<i;o++){let i=r[o],{filter:{event:s,schema:c,table:l,filter:u}}=i,d=t&&t[o];if(d&&d.event===s&&e.isFilterValueEqual(d.schema,c)&&e.isFilterValueEqual(d.table,l)&&e.isFilterValueEqual(d.filter,u))a.push(Object.assign(Object.assign({},i),{id:d.id}));else{this.unsubscribe(),this.state=xf.errored,n?.(Sp.CHANNEL_ERROR,Error(`mismatch between server and client bindings for postgres changes`));return}}this.bindings.postgres_changes=a,this.state!=xf.errored&&n&&n(Sp.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:`presence`,event:`track`,payload:e},t)}async untrack(e={}){return await this.send({type:`presence`,event:`untrack`},e)}on(e,t,n){let r=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===xp.PRESENCE||e===xp.POSTGRES_CHANGES;if(r&&i)throw this.socket.log(`channel`,`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,n)}async httpSend(e,t,n={}){if(t==null)return Promise.reject(Error(`Payload is required for httpSend()`));let r=t instanceof ArrayBuffer||ArrayBuffer.isView(t),i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":r?`application/octet-stream`:`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&a.searchParams.set(`private`,`true`);let o={method:`POST`,headers:i,body:r?t:JSON.stringify(t)},s=await this._fetchWithTimeout(a.toString(),o,n.timeout??this.timeout);if(s.status===202)return{success:!0};if(s.status===404)return Promise.reject(Error(`httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realt
4ime-js/migrations/httpsend-server-version.md`));let c=s.statusText;try{let e=await s.json();c=e.error||e.message||c}catch{}return Promise.reject(Error(c))}async send(e,t={}){if(!this.channelAdapter.canPush()&&e.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.`);let{event:n,payload:r}=e,i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a={method:`POST`,headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:r,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,a,t.timeout??this.timeout);return await e.body?.cancel(),e.ok?`ok`:`error`}catch(e){return e instanceof Error&&e.name===`AbortError`?`timed out`:`error`}}else return new Promise(n=>{let r=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type===`broadcast`&&!this.params?.config?.broadcast?.ack&&n(`ok`),r.receive(`ok`,()=>n(`ok`)),r.receive(`error`,()=>n(`error`)),r.receive(`timeout`,()=>n(`timed out`))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive(`ok`,()=>t(`ok`)).receive(`timeout`,()=>t(`timed out`)).receive(`error`,()=>t(`error`))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),a}_on(e,t,n){let r=e.toLocaleLowerCase(),i=t?.filter;(i instanceof yp||typeof i==`object`&&i&&typeof i.build==`function`)&&(t=Object.assign(Object.assign({},t),{filter:i.build()}));let a=this.channelAdapter.on(e,n),o={type:r,filter:t,callback:n,ref:a};return this.bindings[r]?this.bindings[r].push(o):this.bindings[r]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{let r=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(r,n))return!1;let i=this.bindings[r]?.find(t=>t.ref===e.ref);if(!i)return!0;if([`broadcast`,`presence`,`postgres_changes`].includes(r))if(`id`in i){let e=i.id,n=i.filter?.event;return e&&t.ids?.includes(e)&&(n===`*`||n?.toLocaleLowerCase()===t.data?.type.toLocaleLowerCase())}else{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}else return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=Sf;return t&&[n,r,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t==`object`&&`ids`in t){let e=t.data,{schema:n,table:r,commit_timestamp:i,type:a,errors:o}=e;return Object.assign(Object.assign({},{schema:n,table:r,commit_timestamp:i,eventType:a,new:{},old:{},errors:o}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error(`cannot copy bindings into joined channel`);for(let t in e.bindings)for(let n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=Tf(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=Tf(e.columns,e.old_record)),t}},wp=class{constructor(e,t){this.socket=new np(e,t)}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(e){this.socket.heartbeatCallback=e}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(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i(`timeout`),r),this.socket.disconnect(()=>{e(),i(`ok`)},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Cf.connecting}isDisconnecting(){return this.socket.connectionState()==Cf.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},Tp={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Ep=[1e3,2e3,5e3,1e4],Dp=1e4;function Op(){let e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){return Array.from(e.keys())[t]??null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function kp(){try{if(typeof globalThis<`u`&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return Op()}var Ap=` 5 addEventListener("message", (e) => { 6 if (e.data.event === "start") { 7 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 8 } 9 });`,jp=class{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(e,t){if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint=``,this.headers={},this.params={}
9,this.ref=0,this.serializer=new wf,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!t?.params?.apikey)throw Error(`API key is required to connect to Realtime`);this.apiKey=t.params.apikey;let n=this._initializeOptions(t);this.socketAdapter=new wp(e,n),this.httpEndpoint=Pf(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(`connect`),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let t=e.message;throw Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?`ok`:await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return t===`ok`&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||Cf.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{let n=new Cp(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.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}
9this._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(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let n={access_token:t,version:gf};t&&e.updateJoinPayload(n),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(Sf.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=`general`){this._isManualToken()||this.setAuth().catch(t=>{this.log(`error`,`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log(`error`,`error waiting for auth on connect`,e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t!==`disconnected`&&(t==`sent`&&this._setAuthSafely(),e&&e(t,n))}}_startWorkerHeartbeat(){this.workerUrl?this.log(`worker`,`starting worker for from ${this.workerUrl}`):this.log(`worker`,`starting default worker`);let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log(`worker`,`worker error`,e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{e.data.event===`keepAlive`&&this.sendHeartbeat()},this.workerRef.postMessage({event:`start`,interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&=(this.log(`worker`,`terminating worker`),this.workerRef.terminate(),void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([Ap],{type:`application/javascript`});t=URL.createObjectURL(e)}return t}_initializeOptions(e){this.worker=e?.worker??!1,this.accessToken=e?.accessToken??null;let t={};t.timeout=e?.timeout??bf,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??Tp.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=e?.disconnectOnEmptyChannelsAfterMs??2*(e?.heartbeatIntervalMs??Tp.HEARTBEAT_INTERVAL),t.transport=e?.transport??hf.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.sessionStorage=e?.sessionStorage??kp(),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>Ep[e-1]||Dp);let n,r,i=e?.vsn??yf;switch(i){case _f:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case vf:n=this.serializer.encode.bind(this.serializer),r=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${t.vsn}`)}if(t.vsn=i,t.encode=e?.encode??n,t.decode=e?.decode??r,t.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,t.params=Object.assign(Object.assign({},t.params),{log_level:this.logLevel})),this.worker){if(typeof window<`u`&&!window.Worker)throw Error(`Web Worker is not supported`);this.workerUrl=e?.workerUrl,t.autoSendHeartbeat=!this.worker}return t}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
vendor: 4,836 bytes, line 9
9,Mp=class extends Error{constructor(e,t){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)&&t.icebergType?.includes(`CommitState`)===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Np(e,t,n){let r=new URL(t,e);if(n)for(let[e,t]of Object.entries(n))t!==void 0&&r.searchParams.set(e,t);return r.toString()}async function Pp(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 Fp(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=Np(e.baseUrl,r,i),c=await Pp(e.auth),l=await t(s,{method:n,headers:{...a?{"Content-Type":`application/json`}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await l.text(),d=(l.headers.get(`content-type`)||``).includes(`application/json`),f=d&&u?JSON.parse(u):u;if(!l.ok){let e=d?f:void 0,t=e?.error;throw new Mp(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:f}}}}function Ip(e){return e.join(`�`)}var Lp=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:Ip(e.namespace)}:void 0;return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let n={namespace:e.namespace,properties: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/${Ip(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${Ip(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${Ip(e.namespace)}`}),!0}catch(e){if(e instanceof Mp&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof Mp&&e.status===409)return;throw e}}};function Rp(e){return e.join(`�`)}var zp=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/${Rp(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let n={};return this.accessDelegation&&(n[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${Rp(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){let n=await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${Rp(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/${Rp(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${Rp(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation);try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${Rp(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof Mp&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Mp&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},Bp=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`);let n=e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`;this.client=Fp({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new Lp(this.client,t),this.tableOps=new zp(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)}
9async 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 Vp(e){"@babel/helpers - typeof";return Vp=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Vp(e)}function Hp(e,t){if(Vp(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Vp(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Up(e){var t=Hp(e,`string`);return Vp(t)==`symbol`?t:t+``}function Wp(e,t,n){return(t=Up(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gp(Object(n),!0).forEach(function(t){Wp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Kp=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 qp(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var Jp=class extends Kp{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 K({},super.toJSON())}},Yp=class extends Kp{constructor(e,t,n=`storage`){super(e,n),this.name=n===`vectors`?`StorageVectorsUnknownError`:`StorageUnknownError`,this.originalError=t}};function Xp(e,t,n){let r=K({},e),i=t.toLowerCase();for(let e of Object.keys(r))e.toLowerCase()===i&&delete r[e];return r[i]=n,r}function Zp(e){let t={};for(let[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}var Qp=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),$p=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},em=e=>{if(Array.isArray(e))return e.map(e=>em(e));if(typeof e==`function`||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,n])=>{let r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,``));t[r]=em(n)}),t},tm=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),nm=e=>{if(typeof e==`object`&&e){let 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){let e=t.error;if(typeof e.message==`string`)return e.message}}return JSON.stringify(e)},rm=async(e,t,n,r)=>{if(typeof e==`object`&&e&&`json`in e&&typeof e.json==`function`){let n=e,i=parseInt(String(n.status),10);Number.isFinite(i)||(i=500),n.json().then(e=>{let n=e?.statusCode||e?.code||i+``;t(new Jp(nm(e),i,n,r))}).catch(()=>{let e=i+``;t(new Jp(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new Yp(nm(e),e,r))},im=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return K(K({},i),n);if($p(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=Xp(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),K(K({},i),n)};async function am(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,im(t,r,i,a)).then(e=>{if(!e.ok)throw e;if(r?.noResolveJson)return e;if(o===`vectors`){let t=e.headers.get(`content-type`);if(e.headers.get(`content-length`)===`0`||e.status===204||!t||!t.includes(`application/json`))return{}}return e.json()}).then(e=>s(e)).catch(e=>rm(e,c,r,o))})}function om(e=`storage`){return{get:async(t,n,r,i)=>am(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>am(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>am(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>am(t,`HEAD`,n,K(K({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>am(t,`DELETE`,n,i,a,r,e)}}var{get:sm,post:cm,put:lm,head:um,remove:dm}=om(`storage`),fm=om(`vectors`),pm=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=Zp(t),this.fetch=Qp(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Xp(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(qp(e))return{data:null,error:e};throw e}}},mm=Symbol.toStringTag,hm=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[mm]=`StreamDownloadBuilder`,this.promise=null}
9then(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.execute(),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(qp(t))return{data:null,error:t};throw t}}},gm=Symbol.toStringTag,_m=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[gm]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new hm(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.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(qp(t))return{data:null,error:t};throw t}}},vm={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},ym={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},bm=class extends pm{constructor(e,t={},n,r){super(e,t,r,`storage`),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a,o=K(K({},ym),r),s=K(K({},i.headers),e===`POST`&&{"x-upsert":String(o.upsert)}),c=o.metadata;if(typeof Blob<`u`&&n instanceof Blob?(a=new FormData,a.append(`cacheControl`,o.cacheControl),c&&a.append(`metadata`,i.encodeMetadata(c)),a.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(a=n,a.has(`cacheControl`)||a.append(`cacheControl`,o.cacheControl),c&&!a.has(`metadata`)&&a.append(`metadata`,i.encodeMetadata(c))):(a=n,s[`cache-control`]=`max-age=${o.cacheControl}`,s[`content-type`]=o.contentType,c&&(s[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&a instanceof ReadableStream||a&&typeof a==`object`&&`pipe`in a&&typeof a.pipe==`function`)&&!o.duplex&&(o.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))s=Xp(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?lm:cm)(i.fetch,`${i.url}/object/${u}`,a,K({headers:s},o?.duplex?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate(`POST`,e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;let a=i._removeEmptyFolders(e),o=i._getFinalPath(a),s=new URL(i.url+`/object/upload/sign/${o}`);return s.searchParams.set(`token`,t),i.handleOperation(async()=>{let e,t=K(K({},ym),r),o=K(K({},i.headers),{"x-upsert":String(t.upsert)}),c=t.metadata;if(typeof Blob<`u`&&n instanceof Blob?(e=new FormData,e.append(`cacheControl`,t.cacheControl),c&&e.append(`metadata`,i.encodeMetadata(c)),e.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(e=n,e.has(`cacheControl`)||e.append(`cacheControl`,t.cacheControl),c&&!e.has(`metadata`)&&e.append(`metadata`,i.encodeMetadata(c))):(e=n,o[`cache-control`]=`max-age=${t.cacheControl}`,o[`content-type`]=t.contentType,c&&(o[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&e instanceof ReadableStream||e&&typeof e==`object`&&`pipe`in e&&typeof e.pipe==`function`)&&!t.duplex&&(t.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))o=Xp(o,e,t);return{path:a,fullPath:(await lm(i.fetch,s.toString(),e,K({headers:o},t?.duplex?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e),i=K({},n.headers);t?.upsert&&(i[`x-upsert`]=`true`);let a=await cm(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(n.url+a.url),s=o.searchParams.get(`token`);if(!s)throw new Kp(`No token returned by API`);return{signedUrl:o.toString(),path:e,token:s}})}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 cm(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
9stinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await cm(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,o=await cm(r.fetch,`${r.url}/object/sign/${i}`,K({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers}),s=new URLSearchParams;n?.download&&s.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&s.set(`cacheNonce`,String(n.cacheNonce));let c=s.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:``}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{let i=await cm(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n?.download&&a.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&a.set(`cacheNonce`,String(n.cacheNonce));let o=a.toString();return i.map(e=>K(K({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${o?`&${o}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new _m(()=>sm(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;let n=t._getFinalPath(e);return t.handleOperation(async()=>em(await sm(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await um(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(qp(e)){let t=e instanceof Jp?e.status:e instanceof Yp?e.originalError?.status:void 0;if(t!==void 0&&[400,404].includes(t))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let n=this._getFinalPath(e),r=new URLSearchParams;t?.download&&r.set(`download`,t.download===!0?``:t.download),t?.transform&&this.applyTransformOptsToQuery(r,t.transform),t?.cacheNonce!=null&&r.set(`cacheNonce`,String(t.cacheNonce));let i=r.toString(),a=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image`:`object`;return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(i?`?${i}`:``)}}}async remove(e){var t=this;return t.handleOperation(async()=>await dm(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=new URLSearchParams;t?.transformations&&a.set(`transformations`,`true`);let o=a.toString();return await dm(r.fetch,`${r.url}/cdn/${i}${o?`?${o}`:``}`,{},{headers:r.headers},n)})}async list(e,t,n){var r=this;return r.handleOperation(async()=>{let i=t?.sortBy?K(K({},vm.sortBy),t.sortBy):vm.sortBy,a=K(K(K({},vm),t),{},{sortBy:i,prefix:e||``});return await cm(r.fetch,`${r.url}/object/list/${r.bucketId}`,a,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{let r=K({},e);return await cm(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}},xm={"X-Client-Info":`storage-js/2.110.7`},Sm=class extends pm{constructor(e,t={},n,r){let i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes(`storage.supabase.`)&&(i.hostname=i.hostname.replace(`supabase.`,`storage.supabase.`));let a=i.href.replace(/\/$/,``),o=K(K({},xm),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await sm(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await sm(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await cm(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 lm(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 cm(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await dm(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async purgeBucketCache(e,t,n){var r=this;return r.handleOperation(async()=>{let i=new URLSearchParams;t?.transformations&&i.set(`transformations`,`true`);let a=i.toString();return await dm(r.fetch,`${r.url}/cdn/${e}${a?`?${a}`:``}`,{},{headers:r.headers},n)})}listBucketOptionsToQueryString(e){let 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>
90?`?`+new URLSearchParams(t).toString():``}},Cm=class extends pm{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=K(K({},xm),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await cm(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=new URLSearchParams;e?.limit!==void 0&&n.set(`limit`,e.limit.toString()),e?.offset!==void 0&&n.set(`offset`,e.offset.toString()),e?.sortColumn&&n.set(`sortColumn`,e.sortColumn),e?.sortOrder&&n.set(`sortOrder`,e.sortOrder),e?.search&&n.set(`search`,e.search);let r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await sm(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await dm(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!tm(e))throw new Kp(`Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.`);let n=new Bp({baseUrl:this.url,catalogName:e,auth:{type:`custom`,getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){let n=e[t];return typeof n==`function`?async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}}:n}})}},wm=class extends pm{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=K(K({},xm),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await fm.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await fm.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},Tm=class extends pm{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=K(K({},xm),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error(`Vector batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await fm.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 Error(`segmentCount must be between 1 and 16`);if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await fm.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 Error(`Keys batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Em=class extends pm{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=K(K({},xm),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await fm.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}}
9,Dm=class extends Em{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Om(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},Om=class extends wm{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,K(K({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,K(K({},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 km(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},km=class extends Tm{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,K(K({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,K(K({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,K(K({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,K(K({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,K(K({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Am=class extends Sm{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 Dm(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new Cm(this.url+`/iceberg`,this.headers,this.fetch)}},jm=`2.110.7`,Mm=30*1e3,Nm=3*Mm,Pm=2*Mm,Fm=`http://localhost:9999`,Im=`supabase.auth.token`,Lm={"X-Client-Info":`gotrue-js/${jm}`},Rm=`X-Supabase-Api-Version`,zm={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},Bm=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Vm=class extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name=`AuthError`,this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};function q(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}var Hm=class extends Vm{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function Um(e){return q(e)&&e.name===`AuthApiError`}var Wm=class extends Vm{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},Gm=class extends Vm{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},J=class extends Gm{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function Km(e){return q(e)&&e.name===`AuthSessionMissingError`}var qm=class extends Gm{constructor(){super(`Auth session or user missing`,`AuthInvalidToken
9ResponseError`,500,void 0)}},Jm=class extends Gm{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},Ym=class extends Gm{constructor(e,t=null){super(e,`AuthImplicitGrantRedirectError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};function Xm(e){return q(e)&&e.name===`AuthImplicitGrantRedirectError`}var Zm=class extends Gm{constructor(e,t=null){super(e,`AuthPKCEGrantCodeExchangeError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}},Qm=class extends Gm{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`)}},$m=class extends Gm{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function eh(e){return q(e)&&e.name===`AuthRetryableFetchError`}var th=class extends Gm{constructor(e=`Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)`){super(e,`AuthRefreshDiscardedError`,409,void 0)}};function nh(e){return q(e)&&e.name===`AuthRefreshDiscardedError`}var rh=class extends Gm{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},ih=class extends Gm{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},ah=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),oh=` 10\r=`.split(``),sh=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<oh.length;t+=1)e[oh[t].charCodeAt(0)]=-2;for(let t=0;t<ah.length;t+=1)e[ah[t].charCodeAt(0)]=t;return e})();function ch(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(ah[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue<<=6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(ah[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function lh(e,t,n){let r=sh[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;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function uh(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{ph(e,r,n)};for(let t=0;t<e.length;t+=1)lh(e.charCodeAt(t),i,a);return t.join(``)}function dh(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 Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function fh(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|t)+65536,n+=1}dh(r,t)}}function ph(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;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 Error(`Invalid UTF-8 sequence`);--t.utf8seq}else if(t.utf8seq>0){if(e<=127)throw Error(`Invalid UTF-8 sequence`);t.codepoint=t.codepoint<<6|e&63,--t.utf8seq,t.utf8seq===0&&n(t.codepoint)}}function mh(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)lh(e.charCodeAt(t),n,r);return new Uint8Array(t)}function hh(e){let t=[];return fh(e,e=>t.push(e)),new Uint8Array(t)}function gh(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>ch(e,n,r)),ch(null,n,r),t.join(``)}function _h(e){return Math.round(Date.now()/1e3)+e}function vh(){return Symbol(`auth-callback`)}var Y=()=>typeof window<`u`&&typeof document<`u`,yh={tested:!1,writable:!1},bh=()=>
10{if(!Y())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(yh.tested)return yh.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),yh.tested=!0,yh.writable=!0}catch{yh.tested=!0,yh.writable=!1}return yh.writable};function xh(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var Sh=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Ch=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,wh=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Th=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},X=async(e,t)=>{await e.removeItem(t)},Eh=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};Eh.promiseConstructor=Promise;function Dh(e){let t=e.split(`.`);if(t.length!==3)throw new ih(`Invalid JWT structure`);for(let e=0;e<t.length;e++)if(!Bm.test(t[e]))throw new ih(`JWT not in base64url format`);return{header:JSON.parse(uh(t[0])),payload:JSON.parse(uh(t[1])),signature:mh(t[2]),raw:{header:t[0],payload:t[1]}}}async function Oh(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function kh(e,t){return new Promise((n,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{let r=await e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})()})}function Ah(e){return(`0`+e.toString(16)).substr(-2)}function jh(){let e=new Uint32Array(56);if(typeof crypto>`u`){let e=``;for(let t=0;t<56;t++)e+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`.charAt(Math.floor(Math.random()*66));return e}return crypto.getRandomValues(e),Array.from(e,Ah).join(``)}async function Mh(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join(``)}async function Nh(e){if(!(typeof crypto<`u`&&crypto.subtle!==void 0&&typeof TextEncoder<`u`))return console.warn(`WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.`),e;let t=await Mh(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function Ph(e,t,n=!1){let r=jh(),i=r;n&&(i+=`/recovery`),await wh(e,`${t}-code-verifier`,i);let a=await Nh(r);return[a,r===a?`plain`:`s256`]}var Fh=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Ih(e){let t=e.headers.get(Rm);if(!t||!t.match(Fh))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function Lh(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function Rh(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 Error(`Invalid alg claim`)}}var zh=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Bh(e){if(!zh.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function Vh(e){if(!e.passkey)throw 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 Hh(){return new Proxy({},{get:(e,t)=>{if(t===`__isUserNotAvailableProxy`)return!0;if(typeof t==`symbol`){let e=t.toString();if(e===`Symbol(Symbol.toPrimitive)`||e===`Symbol(Symbol.toStringTag)`||e===`Symbol(util.inspect.custom)`)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Uh(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;
10if(typeof n==`symbol`){let t=n.toString();if(t===`Symbol(Symbol.toPrimitive)`||t===`Symbol(Symbol.toStringTag)`||t===`Symbol(util.inspect.custom)`||t===`Symbol(nodejs.util.inspect.custom)`)return Reflect.get(e,n,r)}return!t.value&&typeof n==`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(e,n,r)}})}function Wh(e){return JSON.parse(JSON.stringify(e))}var Gh=e=>{if(typeof e==`object`&&e){let 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)},Kh=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function qh(e){if(!Ch(e))throw new $m(Gh(e),0);if(Kh.includes(e.status))throw new $m(Gh(e),e.status);let t;try{t=await e.json()}catch(e){throw new Wm(Gh(e),e)}let n,r=Ih(e);if(r&&r.getTime()>=zm[`2024-01-01`].timestamp&&typeof t==`object`&&t&&typeof t.code==`string`?n=t.code:typeof t==`object`&&t&&typeof t.error_code==`string`&&(n=t.error_code),!n){if(typeof t==`object`&&t&&typeof t.weak_password==`object`&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0))throw new rh(Gh(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new rh(Gh(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new J;throw new Hm(Gh(t),e.status||500,n)}var Jh=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};return e===`GET`?i:(i.headers=Object.assign({"Content-Type":`application/json;charset=UTF-8`},t?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Z(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[Rm]=zm[`2024-01-01`].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);let a=r?.query??{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let o=await Yh(e,t,n+(Object.keys(a).length?`?`+new URLSearchParams(a).toString():``),{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(o):{data:Object.assign({},o),error:null}}async function Yh(e,t,n,r,i,a){let o=Jh(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw console.error(e),new $m(Gh(e),0)}if(s.ok||await qh(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await qh(e)}}function Xh(e){let t=null;ng(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=_h(e.expires_in)));let n=e.user??(typeof e?.id==`string`?e:null);return{data:{session:t,user:n},error:null}}function Zh(e){let t=Xh(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((e,t)=>e&&typeof t==`string`,!0)&&(t.data.weak_password=e.weak_password),t}function Qh(e){return{data:{user:e.user??e},error:null}}function $h(e){return{data:e,error:null}}function eg(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=Bd(e,[`action_link`,`email_otp`,`hashed_token`,`redirect_to`,`verification_type`]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},user:Object.assign({},o)},error:null}}function tg(e){return e}function ng(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var rg=[`global`,`local`,`others`],ig=class{constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=Sh(n),this.experimental=r??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=rg[0]){if(rg.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${rg.join(`, `)}`);try{return await Z(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(q(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await Z(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:Qh})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=Bd(e,[`options`]),r=Object.assign(Object.assign({},n),t);
10return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await Z(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:eg,redirectTo:t?.redirectTo})}catch(e){if(q(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await Z(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Qh})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await Z(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:tg});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(q(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){Bh(e);try{return await Z(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Qh})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){Bh(e);try{return await Z(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:Qh})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){Bh(e);try{return await Z(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:Qh})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){Bh(e.userId);try{let{data:t,error:n}=await Z(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(q(e))return{data:null,error:e};throw e}}async _deleteFactor(e){Bh(e.userId),Bh(e.id);try{return{data:await Z(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(q(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await Z(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:tg});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(q(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await Z(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(q(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await Z(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(q(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await Z(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(q(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await Z(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(q(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await Z(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(q(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await Z(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(q(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await Z(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(q(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await Z(this.fetch,`GET`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(q(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await Z(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(q(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await Z(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(q(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){Vh(this.experimental),Bh(e.userId);try{return await Z(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(q(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){Vh(this.experimental),Bh(e.userId),Bh(e.passkeyId);try{return await Z(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(q(e))return{data:null,error:e};throw e}}};function ag(e={}){return{getItem:t=>
10e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&bh()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`);var og=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};function sg(){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 cg(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function lg(e){return parseInt(e,16)}function ug(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function dg(e){let{chainId:t,domain:n,expirationTime:r,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:s,resources:c,scheme:l,uri:u,version:d}=e;if(!Number.isInteger(t))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw Error(`@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.`);if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!u)throw Error(`@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.`);if(d!==`1`)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(e.statement?.includes(` 11`))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=cg(e.address),p=`${l?`${l}://${n}`:n} wants you to sign in with your Ethereum account:\n${f}\n\n${e.statement?`${e.statement}\n`:``}`,m=`URI: ${u}\nVersion: ${d}\nChain ID: ${t}${a?`\nNonce: ${a}`:``}\nIssued At: ${i.toISOString()}`;if(r&&(m+=`\nExpiration Time: ${r.toISOString()}`),o&&(m+=`\nNot Before: ${o.toISOString()}`),s&&(m+=`\nRequest ID: ${s}`),c){let e=` 12Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}var Q=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=r??(n instanceof Error?n.name:void 0)??`Unknown Error`,this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}},fg=class extends Q{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function pg({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Q({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new Q({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new Q({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new Q({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 Q({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Q({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new Q({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Q({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!bg(t))return new Q({message:`${window.location.hostname}
12 is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Q({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Q({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 Q({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 Q({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function mg({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Q({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Q({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!bg(t))return new Q({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Q({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new Q({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 Q({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var hg=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}};function gg(e){if(!e)throw Error(`Credential creation options are required`);if(typeof PublicKeyCredential<`u`&&`parseCreationOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==`function`)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:n,excludeCredentials:r}=e,i=Bd(e,[`challenge`,`user`,`excludeCredentials`]),a=mh(t).buffer,o=Object.assign(Object.assign({},n),{id:mh(n.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){s.excludeCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];s.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:mh(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return s}function _g(e){if(!e)throw Error(`Credential request options are required`);if(typeof PublicKeyCredential<`u`&&`parseRequestOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON==`function`)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:n}=e,r=Bd(e,[`challenge`,`allowCredentials`]),i=mh(t).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];a.allowCredentials[e]=Object.assign(Object.assign({},t),{id:mh(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return a}function vg(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e;return{id:e.id,rawId:e.id,response:{attestationObject:gh(new Uint8Array(e.response.attestationObject)),clientDataJSON:gh(new Uint8Array(e.response.clientDataJSON))},type:`public-key`,clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment??void 0}}function yg(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e,n=e.getClientExtensionResults(),r=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:gh(new Uint8Array(r.authenticatorData)),clientDataJSON:gh(new Uint8Array(r.clientDataJSON)),signature:gh(new Uint8Array(r.signature)),userHandle:r.userHandle?gh(new Uint8Array(r.userHandle)):void 0},type:`public-key`,clientExtensionResults:n,authenticatorAttachment:t.authenticatorAttachment??void 0}}function bg(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function xg(){return!!(Y()&&`PublicKeyCredential`in window&&window.PublicKeyCredential&&`credentials`in navigator&&typeof(navigator==null?void 0:navigator.credentials)?.create==`function`&&typeof(navigator==null?void 0:navigator.credentials)?.get==`function`)}async function Sg(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new fg(`Browser returned unexpected credential type`,t)}:{data:null,error:new fg(`Empty credential response`,t)}}
12catch(t){return{data:null,error:pg({error:t,options:e})}}}async function Cg(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new fg(`Browser returned unexpected credential type`,t)}:{data:null,error:new fg(`Empty credential response`,t)}}catch(t){return{data:null,error:mg({error:t,options:e})}}}var wg={hints:[`security-key`],authenticatorSelection:{authenticatorAttachment:`cross-platform`,requireResidentKey:!1,userVerification:`preferred`,residentKey:`discouraged`},attestation:`direct`},Tg={userVerification:`preferred`,hints:[`security-key`],attestation:`direct`};function Eg(...e){let t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0)if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];t(n)?r[e]=Eg(n,a):r[e]=Eg(a)}else r[e]=a}return r}function Dg(e,t){return Eg(wg,e,t||{})}function Og(e,t){return Eg(Tg,e,t||{})}var kg=class{constructor(e){this.client=e,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(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:`webauthn`}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},i){try{let{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};let s=r??hg.createNewAbortSignal();if(a.webauthn.type===`create`){let{user:e}=a.webauthn.credential_options.publicKey;if(!e.name){let t=n;if(t)e.name=`${e.id}:${t}`;else{let t=(await this.client.getUser()).data.user,n=t?.user_metadata?.name||t?.email||t?.id||`User`;e.name=`${e.id}:${n}`}}e.displayName||=e.name}switch(a.webauthn.type){case`create`:{let{data:t,error:n}=await Sg({publicKey:Dg(a.webauthn.credential_options.publicKey,i?.create),signal:s});return t?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case`request`:{let t=Og(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await Cg(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:t,signal:s}));return n?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(e){return q(e)?{data:null,error:e}:{data:null,error:new Wm(`Unexpected error in challenge`,e)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new Vm(`rpId is required for WebAuthn authentication`)};try{if(!xg())return{data:null,error:new Wm(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!a)return{data:null,error:o};let{webauthn:s}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:s.type,rpId:t,rpOrigins:n,credential_response:s.credential_response}})}catch(e){return q(e)?{data:null,error:e}:{data:null,error:new Wm(`Unexpected error in authenticate`,e)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new Vm(`rpId is required for WebAuthn registration`)};try{if(!xg())return{data:null,error:new Wm(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(t=>t.data?.all.find(t=>t.factor_type===`webauthn`&&t.friendly_name===e&&t.status!==`unverified`)).then(e=>e?this.client.mfa.unenroll({factorId:e?.id}):void 0),{data:null,error:o};let{data:s,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return s?this._verify({factorId:a.id,challengeId:s.challengeId,webauthn:{rpId:t,rpOrigins:n,type:s.webauthn.type,credential_response:s.webauthn.credential_response}}):{data:null,error:c}}catch(e){return q(e)?{data:null,error:e}:{data:null,error:new Wm(`Unexpected error in register`,e)}}}};sg();var Ag={url:Fm,storageKey:Im,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Lm,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},jg={},Mg=class e{get jwks(){return jg[this.storageKey]?.jwks??{keys:[]}}set jwks(e){jg[this.storageKey]=Object.assign(Object.assign({},jg[this.storageKey]),{jwks:e})}get jwks_cached_at(){return jg[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){jg[this.storageKey]=Object.assign(Object.assign({},jg[this.storageKey]),{cachedAt:e})}constructor(t){var n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let r=Object.assign(Object.assign({},Ag),t);if(this.storageKey=r.storageKey,this.instanceID=e.nextInstanceID[this.storageKey]??0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug==`function`&&(this.logger=r.debug),this.instanceID>0&&Y()){let e=`${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(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.experimental=r.experimental??{},this.admin=new ig({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=Sh(r.fetch),this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock!=null&&(this.lock=r.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),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 kg(this)}
12,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?(r.storage?this.storage=r.storage:bh()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ag(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=ag(this.memoryStorage)),Y()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error(`Failed to create a new BroadcastChannel, multi-tab state changes will not be available`,e)}(n=this.broadcastChannel)==null||n.addEventListener(`message`,async e=>{this._debug(`received broadcast notification from other tab or client`,e),(e.data.event===`TOKEN_REFRESHED`||e.data.event===`SIGNED_IN`)&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug(`#broadcastChannel`,`error`,e)}})}r.skipAutoInitialize||this.initialize().catch(e=>{this._debug(`#initialize()`,`error`,e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${jm}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock==null?await this._initialize():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))();let e=await this.initializePromise,t=this._pendingInitNotifications??[];this._pendingInitNotifications=null;for(let e of t)await this._notifyAllSubscribers(e.event,e.session,e.broadcast);return e}async _initialize(){try{let e={},t=`none`;if(Y()&&(e=xh(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),Y()&&this.detectSessionInUrl&&t!==`none`){let{data:n,error:r}=await this._getSessionFromURL(e,t);if(r){if(this._debug(`#_initialize()`,`error detecting session from URL`,r),Xm(r)){let e=r.details?.code;if(e===`identity_already_exists`||e===`identity_not_found`||e===`single_identity_not_deletable`)return{error:r}}return{error:r}}let{session:i,redirectType:a}=n;return this._debug(`#_initialize()`,`detected session in URL`,i,`redirect type`,a),await this._saveSession(i),setTimeout(async()=>{a===`recovery`?await this._notifyAllSubscribers(`PASSWORD_RECOVERY`,i):await this._notifyAllSubscribers(`SIGNED_IN`,i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return q(e)?this._returnResult({error:e}):this._returnResult({error:new Wm(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:Xh});if(n||!t)return this._returnResult({data:{user:null,session:null},error:n});let r=t.session,i=t.user;return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,r)),this._returnResult({data:{user:i,session:r},error:null})}catch(e){if(q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await Ph(this.storage,this.storageKey)),t=await Z(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:{email:n,password:r,data:i?.data??{},gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},xform:Xh})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await Z(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:n,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Xh})}else throw new Jm(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r||!n)return await X(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:r});let i=n.session,a=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,i)),this._returnResult({data:{user:a,session:i},error:null})}catch(e){if(await X(this.storage,`${this.storageKey}-code-verifier`),q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e;t=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Zh})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Zh})}else throw new Jm(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){let e=new qm;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(e){if(q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock==null?this._exchangeCodeForSession(e):this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!Y()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`ethereum`in e&&typeof e.ethereum==`object`&&`request`in e.ethereum&&typeof e.ethereum.request==`function`)s=e.ethereum;else throw 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.`)}let c=new URL(o?.url??window.location.href),l=await s.request({method:`eth_requestAccounts`}).then(e=>e).catch(()=>{throw Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`)});if(!l||l.length===0)throw Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);let u=cg(l[0]),d=o?.signInWithEthereum?.chainId;d||=lg(await s.request({method:`eth_chainId`})),t=dg({domain:c.host,address:u,statement:a,uri:c.href,version:`1`,chainId:d,nonce:o?.signInWithEthereum?.nonce,issuedAt:o?.signInWithEthereum?.issuedAt??new Date,expirationTime:o?.signInWithEthereum?.expirationTime,notBefore:o?.signInWithEthereum?.notBefore,requestId:o?.signInWithEthereum?.requestId,resources:o?.signInWithEthereum?.resources}),n=await s.request({method:`personal_sign`,params:[ug(t),u]})}try{let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`ethereum`,message:t,signature:n},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Xh});if(i)throw i;if(!r||!r.session||!r.user){let e=new qm;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!Y()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`solana`in e&&typeof e.solana==`object`&&(`signIn`in e.solana&&typeof e.solana.signIn==`function`||`signMessage`in e.
12solana&&typeof e.solana.signMessage==`function`))s=e.solana;else throw 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.`)}let c=new URL(o?.url??window.location.href);if(`signIn`in s&&s.signIn){let e=await s.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},o?.signInWithSolana),{version:`1`,domain:c.host,uri:c.href}),a?{statement:a}:null)),r;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`)r=e[0];else if(e&&typeof e==`object`&&`signedMessage`in e&&`signature`in e)r=e;else throw Error(`@supabase/auth-js: Wallet method signIn() returned unrecognized value`);if(`signedMessage`in r&&`signature`in r&&(typeof r.signedMessage==`string`||r.signedMessage instanceof Uint8Array)&&r.signature instanceof Uint8Array)t=typeof r.signedMessage==`string`?r.signedMessage:new TextDecoder().decode(r.signedMessage),n=r.signature;else throw Error(`@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields`)}else{if(!(`signMessage`in s)||typeof s.signMessage!=`function`||!(`publicKey`in s)||typeof s!=`object`||!s.publicKey||!(`toBase58`in s.publicKey)||typeof s.publicKey.toBase58!=`function`)throw Error(`@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API`);t=[`${c.host} wants you to sign in with your Solana account:`,s.publicKey.toBase58(),...a?[``,a,``]:[``],`Version: 1`,`URI: ${c.href}`,`Issued At: ${o?.signInWithSolana?.issuedAt??new Date().toISOString()}`,...o?.signInWithSolana?.notBefore?[`Not Before: ${o.signInWithSolana.notBefore}`]:[],...o?.signInWithSolana?.expirationTime?[`Expiration Time: ${o.signInWithSolana.expirationTime}`]:[],...o?.signInWithSolana?.chainId?[`Chain ID: ${o.signInWithSolana.chainId}`]:[],...o?.signInWithSolana?.nonce?[`Nonce: ${o.signInWithSolana.nonce}`]:[],...o?.signInWithSolana?.requestId?[`Request ID: ${o.signInWithSolana.requestId}`]:[],...o?.signInWithSolana?.resources?.length?[`Resources`,...o.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join(` 13`);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:gh(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Xh});if(i)throw i;if(!r||!r.session||!r.user){let e=new qm;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await Th(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new Qm;let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:Xh});if(await X(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new qm;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(n===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await X(this.storage,`${this.storageKey}-code-verifier`),q(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:Xh});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new qm;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await Ph(this.storage,this.storageKey));let{error:a}=await Z(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new Jm(`You must provide either an email or phone number.`)}catch(e){if(await X(this.storage,`${this.storageKey}-code-verifier`),q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:Xh});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await Ph(this.storage,this.storageKey));let r=await Z(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:$h});return r.data?.url&&Y()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await X(this.storage,`${this.storageKey}-code-verifier`),q(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,this.lock==null?await this._reauthenticate():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new J;let{error:r}=await Z(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await Ph(this.storage,this.storageKey));let{error:s}=await Z(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},redirectTo:i?.emailRedirectTo});return s&&await X(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:s})}else if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await Z(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new Jm(`You must provide either an email or phone number and a type`)}catch(e){if(await X(this.storage,`${this.storageKey}-code-verifier`),q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,this.lock==null?await this._useSession(async e=>e):await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lock!=null&&!this.lockAcquired&&this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await Th(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not val
13id`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<Nm:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await Th(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=Hh()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=Uh(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:r,error:i}=await this._callRefreshToken(e.refresh_token);if(i){if(e.expires_at&&e.expires_at*1e3>Date.now()){let t=await Th(this.storage,this.storageKey);if(t&&t.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:i})}return this._returnResult({data:{session:r},error:null})}finally{this._debug(`#__loadSession()`,`end`)}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t;return t=this.lock==null?await this._getUser():await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()),t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await Z(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:Qh}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new J}:await Z(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:Qh})})}catch(e){if(q(e))return Km(e)&&(await this._removeSession(),await X(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,this.lock==null?await this._updateUser(e,t):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new J;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await Ph(this.storage,this.storageKey));let{data:c,error:l}=await Z(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:Qh});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await X(this.storage,`${this.storageKey}-code-verifier`),q(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,this.lock==null?await this._setSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new J;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=Dh(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers(`SIGNED_IN`,i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(q(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,this.lock==null?await this._refreshSession(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new J;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!Y())throw new Ym(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new Ym(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new Zm(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new Ym(`Not a valid implicit grant flow url.`);break;default:}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new Zm(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);
13if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new Ym(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(q(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){let t=await Th(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,this.lock==null?await this._signOut(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let n=async()=>{await this._removeSession(),await X(this.storage,`${this.storageKey}-code-verifier`)},{data:r,error:i}=t;if(i&&!Km(i))return this._returnResult({error:i});let a=r.session?.access_token;if(a){let{error:t}=await this.admin.signOut(a,e);if(t&&!(Um(t)&&(t.status===404||t.status===401||t.status===403)||Km(t)))return e!==`others`&&await n(),this._returnResult({error:t})}return e!==`others`&&await n(),this._returnResult({error:null})})}onAuthStateChange(e){let t=vh(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,this.lock==null?await this._emitInitialSession(t):await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),Km(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;this.flowType===`pkce`&&([n,r]=await Ph(this.storage,this.storageKey,!0));try{return await Z(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await X(this.storage,`${this.storageKey}-code-verifier`),q(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await Z(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return Y()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(q(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Xh});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new qm}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await X(this.storage,`${this.storageKey}-code-verifier`),q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await Z(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken()`;this._debug(t,`begin`);try{let n=Date.now();return await kh(async n=>(n>0&&await Oh(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await Z(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Xh})),(e,t)=>{let r=200*2**e;return t&&eh(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),q(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),Y()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await Th(this.storage,this.storageKey);if(t&&this.userStorage){let e=await Th(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await wh(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??Hh()}else if(t&&!t.user&&!t.user){let e=await Th(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await X(this.storage,this.storageKey+`-user`),await wh(this.storage,this.storageKey,t)):t.user=Hh()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not val
13id`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now()<Nm;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${Nm}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(nh(n)?this._debug(e,`refresh discarded by commit guard`,n):this._debug(e,`refresh failed`,n))}}else if(t.user&&t.user.__isUserNotAvailableProxy===!0)try{let{data:n,error:r}=await this._getUser(t.access_token);!r&&n?.user?(t.user=n.user,await this._saveSession(t),await this._notifyAllSubscribers(`SIGNED_IN`,t)):this._debug(e,`could not get user data, skipping SIGNED_IN notification`)}catch(t){console.error(`Error getting user data:`,t),this._debug(e,`error getting user data, skipping SIGNED_IN notification`,t)}else await this._notifyAllSubscribers(`SIGNED_IN`,t)}catch(t){this._debug(e,`error`,t),console.error(t);return}finally{this._debug(e,`end`)}}async _callRefreshToken(e){var t,n;if(!e)throw new J;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug(`#_callRefreshToken()`,`returning cached failure (cooldown active)`),this.lastRefreshFailure.result;let r=`#_callRefreshToken()`;this._debug(r,`begin`);try{this.refreshingDeferred=new Eh;let t=await Th(this.storage,this.storageKey),{data:n,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!n.session)throw new J;let a=await Th(this.storage,this.storageKey);if(t!==null&&(a===null||a.refresh_token!==t.refresh_token)){this._debug(r,`commit guard: storage changed since refresh started, discarding rotated tokens`,{startedWith:`present`,nowHolds:a?`replaced`:`cleared`});let e={data:null,error:new th};return this.refreshingDeferred.resolve(e),e}let o=this._sessionRemovalEpoch;if(await this._saveSession(n.session),this._sessionRemovalEpoch!==o){this._debug(r,`commit guard (post-save): _removeSession ran during _saveSession, undoing write`),await X(this.storage,this.storageKey),this.userStorage&&await X(this.userStorage,this.storageKey+`-user`);let e={data:null,error:new th};return this.refreshingDeferred.resolve(e),e}await this._notifyAllSubscribers(`TOKEN_REFRESHED`,n.session);let s={data:n.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(s),s}catch(i){if(this._debug(r,`error`,i),q(i)){let n={data:null,error:i};if(!eh(i)){let e=await Th(this.storage,this.storageKey);e?.expires_at&&e.expires_at*1e3>Date.now()?this._debug(r,`proactive refresh failed, access token still valid â preserving session`):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:n,expiresAt:Date.now()+Pm},(t=this.refreshingDeferred)==null||t.resolve(n),n}throw(n=this.refreshingDeferred)==null||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(r,`end`)}}async _notifyAllSubscribers(e,t,n=!0){if(this._pendingInitNotifications!==null&&n){this._pendingInitNotifications.push({event:e,session:t,broadcast:n});return}let r=`#_notifyAllSubscribers(${e})`;this._debug(r,`begin`,t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,`end`)}}async _saveSession(e){this._debug(`#_saveSession()`,e),this.suppressGetSessionWarning=!0;let t=Object.assign({},e),n=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&t.user&&await wh(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=Wh(e);await wh(this.storage,this.storageKey,r)}else{let e=Wh(t);await wh(this.storage,this.storageKey,e)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug(`#_removeSession()`),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await X(this.storage,this.storageKey),await X(this.storage,this.storageKey+`-code-verifier`),await X(this.storage,this.storageKey+`-user`),this.userStorage&&await X(this.userStorage,this.storageKey+`-user`),await this._notifyAllSubscribers(`SIGNED_OUT`,null)}_removeVisibilityChangedCallback(){this._debug(`#_removeVisibilityChangedCallback()`);let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Y()&&window!=null&&window.removeEventListener&&window.removeEventListener(`visibilitychange`,e)}
13catch(e){console.error(`removing visibilitychange callback failed`,e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(`#_startAutoRefresh()`);let e=setInterval(()=>this._autoRefreshTokenTick(),Mm);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)==null||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug(`#_autoRefreshTokenTick()`,`begin`),this.lock!=null){try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/Mm);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${Mm}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e instanceof og)this._debug(`auto refresh token tick lock not available`);else throw e}return}if(this.refreshingDeferred!==null){this._debug(`#_autoRefreshTokenTick()`,`refresh already in flight, skipping`);return}try{let e=Date.now();try{await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/Mm);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${Mm}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!Y()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;if(this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==`visible`){this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`);return}await this._recoverAndRefresh()});else{if(document.visibilityState!==`visible`){this._debug(t,`visibilityState is no longer visible, skipping recovery`);return}await this._recoverAndRefresh()}}else document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await Ph(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});
13r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await Z(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await Z(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?vg(e.webauthn.credential_response):yg(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await Z(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(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:o}))})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challenge(e){let t=async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await Z(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;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:gg(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:_g(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}};return this.lock==null?t():this._acquireLock(this.lockAcquireTimeout,t)}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=Dh(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}
13=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=Dh(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Z(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new J})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new J});let a=await Z(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&Y()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new J});let a=await Z(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&Y()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await Z(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new J})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await Z(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new J})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await Z(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}
13=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=Dh(n);if(!t?.allowExpired)try{Lh(i.exp)}catch(e){throw new ih(e instanceof Error?e.message:`JWT validation failed`)}let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=Rh(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,hh(`${o}.${s}`)))throw new ih(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){Vh(this.experimental);try{if(!xg())return this._returnResult({data:null,error:new Wm(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyAuthentication({options:{captchaToken:e?.options?.captchaToken}});if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await Cg({publicKey:_g(t.options),signal:e?.options?.signal??hg.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new Wm(`WebAuthn ceremony failed`,null)});let a=yg(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){Vh(this.experimental);try{if(!xg())return this._returnResult({data:null,error:new Wm(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyRegistration();if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await Sg({publicKey:gg(t.options),signal:e?.options?.signal??hg.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new Wm(`WebAuthn ceremony failed`,null)});let a=vg(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){Vh(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new J});let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){Vh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new J});let{data:i,error:a}=await Z(this.fetch,`POST`,`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){Vh(this.experimental);try{let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:e?.options?.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:t,error:null})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){Vh(this.experimental);try{let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Xh});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,t.session)),this._returnResult({data:t,error:null}))}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){Vh(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new J});let{data:r,error:i}=await Z(this.fetch,`GET`,`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){Vh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new J});let{data:i,error:a}=await Z(this.fetch,`PATCH`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){Vh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new J});let{error:i}=await Z(this.fetch,`DELETE`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(q(e))return this._returnResult({data:null,error:e});throw e}}};Mg.nextInstanceID={};var Ng=Mg,Pg=`2.110.7`,Fg=``,Ig;if(typeof Deno<`u`)Fg=`deno`,Ig=Deno.version?.deno;else if(typeof document<`u`)Fg=`web`;else if(typeof navigator<`u`&&navigator.product===`ReactNative`)Fg=`react-native`;else{var Lg;Fg=`node`;let e=globalThis.process;Ig=e==null||(Lg=e.version)==null?void 0:Lg.replace(/^v/,``)}var Rg=[`runtime=${Fg}`];Ig&&Rg.push(`runtime-version=${Ig}`);var zg={headers:{"X-Client-Info":`supabase-js/${Pg}; ${Rg.join(`; `)}`}},Bg={schema:`public`},Vg={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},Hg={},Ug={enabled:!1,respectSamplingDecision:!0};function Wg(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var Gg=null,Kg=`@opentelemetry/api`;function qg(){return Gg===null&&(Gg=zd(()=>import(Kg),[],import.meta.url).catch(()=>null)),Gg}function Jg(){return Wg(this,void 0,void 0,function*(){try{let e=yield qg();if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function Yg(e){if(!e||typeof e!=`string`)return null;let t=e.split(`-`);if(t.length!==4)return null;let[n,r,i,a]=t;if(n.length!==2||r.length!==32||i.length!==16||a.length!==2)return null;let o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(i)||!o.test(a)||r===`00000000000000000000000000000000`||i===`0000000000000000`?null:{version:n,traceId:r,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)==1}}function Xg(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(let e of t)try{if(typeof e==`string`){if(Zg(n.hostname,e))return!0}
13else if(e instanceof RegExp){if(e.test(n.hostname))return!0}else if(typeof e==`function`&&e(n))return!0}catch{continue}return!1}function Zg(e,t){if(t===e)return!0;if(t.startsWith(`*.`)){let n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith(`.`+n)))return!0}return!1}function Qg(e){let t=[];try{let n=new URL(e);t.push(n.hostname)}catch{}return t.push(`*.supabase.co`,`*.supabase.in`),t.push(`localhost`,`127.0.0.1`,`[::1]`),t}function $g(e){"@babel/helpers - typeof";return $g=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},$g(e)}function e_(e,t){if($g(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if($g(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function t_(e){var t=e_(e,`string`);return $g(t)==`symbol`?t:t+``}function n_(e,t,n){return(t=t_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?r_(Object(n),!0).forEach(function(t){n_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var i_=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),a_=()=>Headers,o_=e=>e.startsWith(`sb_publishable_`)||e.startsWith(`sb_secret_`),s_=`sb_temp_`,c_=new Set,l_=e=>{if(!e.startsWith(`sb_`)||o_(e)||e.startsWith(s_))return;let t=e.match(/^sb_[a-zA-Z0-9]+_/)?.[0]??`unknown`;c_.has(t)||(c_.add(t),console.warn(`@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type.`))},u_=(e,t,n,r,i,a)=>{let o=i_(r),s=a_(),c=i?.enabled===!0,l=i?.respectSamplingDecision!==!1,u=c?Qg(t):null,d=!(a?.omitApiKeyAsBearer&&o_(e));return async(t,r)=>{let i=await n(),a=new s(r?.headers);if(a.has(`apikey`)||a.set(`apikey`,e),!a.has(`Authorization`)){let t=i??(d?e:null);t&&a.set(`Authorization`,`Bearer ${t}`)}if(u){let e=await d_(t,u,l);e&&(e.traceparent&&!a.has(`traceparent`)&&a.set(`traceparent`,e.traceparent),e.tracestate&&!a.has(`tracestate`)&&a.set(`tracestate`,e.tracestate),e.baggage&&!a.has(`baggage`)&&a.set(`baggage`,e.baggage))}return o(t,$($({},r),{},{headers:a}))}};async function d_(e,t,n){if(!Xg(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let r=await Jg();if(!r||!r.traceparent)return null;if(n){let e=Yg(r.traceparent);if(e&&!e.isSampled)return null}return r}function f_(e){return typeof e==`boolean`?{enabled:e}:e}function p_(e){return e.endsWith(`/`)?e:e+`/`}function m_(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=f_(e.tracePropagation),d=f_(t.tracePropagation),f={db:$($({},o),n),auth:$($({},s),r),realtime:$($({},c),i),storage:{},global:$($($({},l),a),{},{headers:$($({},l?.headers??{}),a?.headers??{})}),tracePropagation:{enabled:u?.enabled??d?.enabled??!1,respectSamplingDecision:u?.respectSamplingDecision??d?.respectSamplingDecision??!0},accessToken:async()=>``};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function h_(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(p_(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var g_=class extends Ng{constructor(e){super(e)}},__=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=h_(e);if(!t)throw Error(`supabaseKey is required.`);l_(t),this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:Bg,realtime:Hg,auth:$($({},Vg),{},{storageKey:i}),global:zg,tracePropagation:Ug},o=m_(n??{},a);this.settings=o,this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=u_(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation),this.functionsFetch=u_(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation,{omitApiKeyAsBearer
13:!0}),this.realtime=this._initRealtimeClient($({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new mf(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new Am(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new Jd(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}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 _getSessionToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??null}async _getAccessToken(){var e=this;return await e._getSessionToken()??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new g_({url:this.authUrl.href,headers:$($({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,fetch:m,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new jp(this.realtimeUrl.href,$($({},e),{},{params:$($({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`||e===`INITIAL_SESSION`)&&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)}},v_=(e,t,n)=>new __(e,t,n);function y_(){if(typeof window<`u`)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=20:!1}y_()&&console.warn(`â ï¸ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715`);var b_=null,x_=()=>{let e=Xc();return b_||=v_(e.public.supabaseUrl,e.public.supabaseKey),b_};export{Yc as $,Qt as $t,nu as A,Bo as At,Kl as B,Yn as Bt,vu as C,po as Ct,hu as D,V as Dt,mu as E,uo as Et,Wl as F,ii as Ft,Fl as G,hi as Gt,Vl as H,vi as Ht,Cl as I,li as It,tl as J,er as Jt,nl as K,mi as Kt,Xl as L,ti as Lt,Jl as M,no as Mt,Nl as N,Fn as Nt,du as O,Sr as Ot,Gl as P,ei as Pt,Kc as Q,Le as Qt,Tl as R,ai as Rt,yu as S,to as St,gu as T,fo as Tt,Il as U,yi as Ut,Rl as V,zn as Vt,Bl as W,fi as Wt,Gc as X,Kn as Xt,$c as Y,Ei as Yt,Uc as Z,qn as Zt,bu as _,r as _n,Wr as _t,Fd as a,on as an,Ic as at,wu as b,zo as bt,id as c,ln as cn,Lc as ct,wd as d,we as dn,lc as dt,N as en,Xc as et,$u as f,ye as fn,uc as ft,Eu as g,a as gn,R as gt,Fu as h,i as hn,rc as ht,Pd as i,Jt as in,Fc as it,Ml as j,Xn as jt,uu as k,xo as kt,nd as l,re as ln,jc as lt,ku as m,o as mn,Zs as mt,zd as n,qt as nn,Rc as nt,Dd as o,hn as on,Pc as ot,Qu as p,Me as pn,Qs as pt,el as q,tr as qt,Nd as r,an as rn,Nc as rt,rd as s,un as sn,zc as st,x_ as t,Re as tn,Mc as tt,cd as u,D as un,ts as ut,xu as v,Fa as vt,fu as w,eo as wt,Cu as x,oo as xt,Su as y,lo as yt,zl as z,Ya as zt};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.