1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Ww7FaV3n.js","./BQxKsqNx.js","./DO6Im3pv.js","./BVuhSAiW.js","./DRf1ifx3.js","./CVW2CDSb.js","./HclGiUj8.js","./B02YXSsa.js","./Dt6EmxCu.js","./Bbe-yNQd.js","./QqkPmqyv.js","./FnEOWICV.js","./B9Jx-iZw.js","./CYZhk8Wx.js","./DV2WAxj4.js","./Bc5kaL9Q.js","./Mb01CPJS.js","./Dd_uD5pT.js","./DNoZaTg9.js","./SPGNATgW.js","./DZZq2GiH.js","./CDwnmPl0.js","./BldMfq8j.js","./BECDwmQk.js","./BICtQUGs.js","./BKvKrunw.js","./UuI2Vbgc.js","./DWEoD8ZB.js","./9hZKo1YN.js","./DROvw-J5.js","./BBN_qnyb.js","./CrLAVSpC.js","./C6m-gfwK.js","./BfbbJQWd.js","./Qqxn911P.js","./D21aOOxd.js","./DXmWc-97.js","./DxNStd42.js","./N1KNZr9B.js","./ChHmxM55.js","./Bng2rRDf.js","./DHihWhf5.js","./CgvkOXjc.js","./LczgkNfS.js","./BgUeuhai.js","./uezgIOYs.js","./DigUVwYr.js","./axKBjlVC.js","./BCziHRRg.js","./C2ZEDAdB.js","./BWkBAY5a.js","./BuSRWyJo.js","./pQQ8xf4w.js","./Bm9tDaoY.js","./DB0FwMeh.js","./CNs_Ozdc.js","./uw6Z5EXr.js","./BDNMzG2s.js","./B1LI4Xc8.js","./C8OkvNpv.js","./gquWfK5y.js","./BfxlMBKh.js","./CCIDhS4e.js","./C3T5RuQN.js","./Q1hrcEPp.js","./BhVl5FRk.js","./Daqa2ATD.js","./C86PFsT6.js","./DLAvyxWx.js","./D1sn7E77.js","./DCWEvpUu.js","./Bw2Ca7l0.js","./DbsG0Scl.js","./CPtJ600h.js","./CvmqODzH.js","./Bwlt1oU-.js","./BRJrLxKC.js","./BAljpXfo.js","./bgyLNCfE.js","./Cz_MeymL.js","./DbLUsK6w.js","./X4Q3Fg2M.js","./Cbs_DAMz.js","./X3iTb7gG.js","./DfCZwPY-.js","./BiZS564F.js","./LsQXQGi7.js","./BimE_ND6.js","./CHJL0aQR.js","./Cir6Fqgm.js","./DSp8PU0I.js","./D18JI7xq.js","./OZ0ALdfZ.js","./D3AeUIJi.js","./DVcsrOE6.js","./BscAoJz5.js","./hUxOL7-0.js","./DbbgLwll.js","./DNtdqvZO.js","./BDvdcwUg.js","./z_kqcJEe.js","./useAvatarImageUpload.IiCGksHk.css","./DA_7Ds_b.js","./_f8Erg3N.js","./Cd6wxgFi.js","./vDKwRVd1.js","./CsQeQ-Tm.js","./D183iiZ2.js","./_6kzdk0H.js","./Brdu9FbA.js","./AuthHero.CBcNCKBw.css","./C7Hqee-4.js","./B_FdGjMV.js","./CmmuqWZt.js","./BvYKkHEx.js","./C_cUaQPS.js","./e0qsLpuL.js","./register.BFTFxEWZ.css","./BxrOiA6u.js","./verify.w5mRxTTt.css","./4nDDUN2y.js","./OgMDG6y8.js","./BkgrWLPQ.js","./Ym_utKcY.js","./DVoTcVtN.js","./CwSooe-V.js","./D6w7y3zi.js","./SegmentedActionPill.CkOcGZbX.css","./TnDo456g.js","./B_LyKpoW.js","./CtMVx_fe.js","./AdvancedFiltersDrawer.CaLnah6x.css","./DD0WkWdO.js","./BeVtYlT4.js","./Bqm4DN8a.js","./BMU5X1ym.js","./Du7N4evG.js","./CS-CEVmc.js","./Dk_kIT3v.js","./CNAHQz_b.js","./C-aG0CBb.js","./useWhatsApp.CZCcfNDU.css","./BkdtP-T6.js","./DGq9tuHZ.js","./DQh-Y7AH.js","./C2tiH1Xt.js","./EHVsa3bh.js","./favorites.B6AflUs8.css","./BwDFcWnF.js","./CI7QMSbM.js","./CyfCxyga.js","./DuePAKJV.js","./CX04ED2Z.js","./Cq_HE-WW.js","./CPhKbxLH.js","./BlxJ_bUh.js","./BRNynrLG.js","./DH--FGY5.js","./DnROHWRH.js","./i-bW0kSb.js","./DO4_Qk6l.js","./CH2MhHXX.js","./D0C5Zt05.js","./m199v_xG.js","./BJMs8ohz.js","./DQ3ssmeG.js","./DrKjJ4z1.js","./pFeybnGt.js","./Bysz5Bup.js","./DB9BvHmr.js","./C862IhnB.js","./mj8pY5BE.js","./C6D-mErE.js","./Cj9UDSQF.js","./TfbcvNvk.js","./BdezMhta.js","./B--gMHkC.js","./BEUSUWB5.js","./xZYT7PLg.js","./Shell.wyQHifjx.css","./COhq7Upy.js","./V4JQFHhJ.js","./CeKAxncm.js","./BWkYut7b.js","./Bl0uz1Kk.js","./BpOYkrTC.js","./chat.BFWHfCj0.css","./C74b8sTJ.js","./contact.D6FAQPMF.css","./BD8BzFem.js","./CGMGgOsh.js","./DKpmA265.js","./CvBXor-_.js","./DHf83ZzC.js","./BhXpGauV.js","./DsD_IGdZ.js","./DucF1mfs.js","./LegalDoc.Bv10Z0HS.css","./privacy.C2XKdEU0.css","./CAJ1YcmE.js","./DcvMJL77.js","./D5vI1WU8.js","./Cyc-UeE2.js","./lqnHre87.js","./settings.VxkUWf2H.css","./gQ8TpCQE.js","./RU7LEE3W.js","./BwHXHK4e.js","./CSl2xHL4.js","./LanguageSelect.CBSGxhVC.css","./Bnopm-b1.js","./9ZlIYdt8.js","./pages.BaC6o-_N.css","./Dc2WgAQ2.js","./Bv7z_a1h.js","./auth.dsQVjoPA.css","./Be0UpeoL.js","./BnxAdz9q.js","./BucWdrj_.js","./Dr14WhS0.js","./CPKfJ3ml.js","./rCkbfvuy.js","./ZTRVpgAU.js","./hcJVQU4G.js","./CR-wUy2I.js","./D7GQcVIF.js","./DvQiMT_q.js"])))=>i.map(i=>d[i]); 2import{i as e,t}from"./Dd_uD5pT.js";import{$ as n,$r as r,A as i,Bt as a,C as o,D as s,Dt as c,E as l,Er as u,Et as d,F as f,H as p,Hn as m,I as h,Jt as g,K as _,Kn as v,Ln as y,M as b,N as x,O as S,Or as C,Ot as w,P as ee,Pn as T,Q as te,R as ne,Rn as re,S as ie,T as ae,Tr as oe,U as se,Un as ce,V as E,W as le,Yn as ue,Z as de,Zr as D,Zt as fe,_r as pe,_t as O,a as me,b as he,bn as k,bt as A,c as ge,cn as _e,d as ve,ei as ye,en as j,fn as be,fr as xe,gn as Se,gr as Ce,gt as M,h as we,i as Te,ii as Ee,in as De,ir as Oe,j as ke,k as Ae,kt as N,l as je,lr as Me,lt as Ne,m as Pe,mn as P,n as Fe,o as Ie,ot as F,p as Le,pr as Re,q as ze,qn as I,r as Be,s as Ve,sn as He,st as Ue,t as We,ti as
2L,tn as Ge,ur as Ke,ut as qe,v as Je,vr as R,vt as z,w as Ye,wn as Xe,wr as Ze,wt as Qe,xn as B,xr as $e,y as et,yr as tt,yt as V,z as nt,zt as rt}from"./BQxKsqNx.js";import{$ as it,A as at,B as ot,C as st,Ct as ct,D as lt,E as ut,F as dt,G as ft,H as pt,I as mt,J as ht,K as gt,L as _t,M as vt,N as yt,O as bt,P as xt,Q as St,R as Ct,S as wt,T as Tt,U as Et,V as H,W as Dt,X as Ot,Y as kt,Z as At,_ as jt,b as Mt,d as Nt,et as Pt,f as Ft,g as It,h as Lt,it as Rt,j as zt,k as Bt,m as Vt,n as Ht,q as Ut,r as Wt,rt as Gt,s as Kt,u as qt,v as Jt,w as Yt,x as Xt,xt as Zt,y as Qt,z as $t}from"./BVuhSAiW.js";import{r as en,t as tn}from"./Mb01CPJS.js";import{n as nn,r as rn,t as an}from"./DRf1ifx3.js";import{a as on,c as sn,d as cn,f as ln,g as un,h as dn,l as fn,m as pn,n as mn,p as hn,r as gn,s as _n,t as vn,u as yn}from"./D1sn7E77.js";import{n as bn}from"./vDKwRVd1.js";import{t as xn}from"./CVW2CDSb.js";import{c as Sn,i as Cn,l as wn,n as Tn,o as En,r as Dn,s as On}from"./CsQeQ-Tm.js";import{i as kn,o as An,t as jn}from"./DXmWc-97.js";import{t as U}from"./HclGiUj8.js";import{A as Mn,D as Nn,E as Pn,F as Fn,I as In,L as Ln,O as Rn,R as zn,S as Bn,T as Vn,a as Hn,f as Un,i as Wn,k as Gn,n as Kn,o as qn,r as Jn,t as Yn,w as Xn,x as Zn,z as Qn}from"./DO6Im3pv.js";import{t as $n}from"./B02YXSsa.js";import{a as er,n as tr,o as nr}from"./Dt6EmxCu.js";import{a as rr,c as ir,i as ar,l as or,o as sr,r as cr,s as lr,t as ur}from"./Bbe-yNQd.js";import{n as dr,r as fr,t as pr}from"./QqkPmqyv.js";import{t as mr}from"./DCWEvpUu.js";import{r as hr}from"./CDwnmPl0.js";import{a as gr,i as _r,r as vr}from"./C6m-gfwK.js";import{n as yr,r as br,s as xr}from"./Ym_utKcY.js";import{t as Sr}from"./BvYKkHEx.js";import{t as Cr}from"./DVoTcVtN.js";import{A as wr,E as Tr,O as Er,b as Dr,k as Or,s as kr,t as Ar,u as jr}from"./DNoZaTg9.js";import{g as Mr,i as Nr,m as Pr,r as Fr}from"./SPGNATgW.js";import{t as Ir}from"./Bqm4DN8a.js";import{t as Lr}from"./BMU5X1ym.js";import{d as Rr}from"./BeVtYlT4.js";import{n as zr,r as Br,t as Vr}from"./lqnHre87.js";import{n as Hr,t as Ur}from"./DZZq2GiH.js";import{t as Wr}from"./DWEoD8ZB.js";import{c as Gr,d as Kr,t as qr}from"./BldMfq8j.js";import{a as Jr,n as Yr,r as Xr,t as Zr}from"./ChHmxM55.js";import{h as Qr,m as $r}from"./BgUeuhai.js";import{u as ei}from"./BICtQUGs.js";import{t as ti}from"./BKvKrunw.js";import{t as ni}from"./9hZKo1YN.js";import{t as ri}from"./CvmqODzH.js";import{t as ii}from"./BwHXHK4e.js";import{n as ai,t as oi}from"./D18JI7xq.js";import{t as si}from"./CrLAVSpC.js";import{n as ci,t as li}from"./BfbbJQWd.js";import{t as ui}from"./DxNStd42.js";import{n as di,t as fi}from"./C6D-mErE.js";import{n as pi,t as mi}from"./CSl2xHL4.js";import{t as hi}from"./BDNMzG2s.js";import{i as gi,n as _i,r as vi,t as yi}from"./BWkBAY5a.js";import{t as bi}from"./B--gMHkC.js";import{t as xi}from"./CtMVx_fe.js";import{t as Si}from"./CI7QMSbM.js";import{i as Ci}from"./BDvdcwUg.js";import{t as wi}from"./CPhKbxLH.js";import{t as Ti}from"./DO4_Qk6l.js";import{t as Ei}from"./DbLUsK6w.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),`global`in globalThis||(globalThis.global=globalThis);var Di=/\\/g,Oi=/</g,ki=/"/g,Ai=/%\w+(?:\.\w+)?/g,ji=`%separator`;function Mi(e,t,n=!1){let r;if(t===`s`||t===`pageTitle`)r=e.pageTitle;else if(t.includes(`.`)){let n=t.indexOf(`.`);r=e[t.substring(0,n)]?.[t.substring(n+1)]}else r=e[t];if(r!==void 0)return n?(r||``).replace(Di,`\\\\`).replace(Oi,`\\u003C`).replace(ki,`\\"`):r||``}function Ni(e,t,n,r=!1){if(typeof e!=`string`||!e.includes(`%`))return e;let i=e;try{i=decodeURI(e)}catch{}let a=i.match(Ai);if(!a)return e;let o=e.includes(ji);return e=e.replace(Ai,e=>{if(e===ji||!a.includes(e))return e;let n=Mi(t,e.slice(1),r);return n===void 0?e:n}).trim(),o&&(e=e.split(ji).map(e=>e.trim()).filter(e=>e!==``).join(n?` ${n} `:` `)),e}var Pi=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w,Fi=e=>
2e.includes(`:key`)?e:e.split(`:`).join(`:key:`),Ii=un({key:`aliasSorting`,hooks:{"tags:resolve":e=>{let t=!1;for(let n of e.tags){let r=n.tagPriority;if(!r)continue;let i=String(r);if(i.startsWith(`before:`)){let r=Fi(i.slice(7)),a=e.tagMap.get(r);a&&(typeof a.tagPriority==`number`&&(n.tagPriority=a.tagPriority),n._p=a._p-1,t=!0)}else if(i.startsWith(`after:`)){let r=Fi(i.slice(6)),a=e.tagMap.get(r);a&&(typeof a.tagPriority==`number`&&(n.tagPriority=a.tagPriority),n._p=a._p+1,t=!0)}}t&&(e.tags=e.tags.sort(Pi))}}}),Li=un({key:`deprecations`,hooks:{"entries:normalize":({tags:e})=>{for(let t of e)t.props.children&&(t.innerHTML=t.props.children,delete t.props.children),t.props.hid&&(t.key=t.props.hid,delete t.props.hid),t.props.vmid&&(t.key=t.props.vmid,delete t.props.vmid),`body`in t.props&&(t.props.body&&(t.tagPosition=`bodyClose`),delete t.props.body),t.props.renderPriority!=null&&(t.tagPriority=t.props.renderPriority,delete t.props.renderPriority)}}});function Ri(e){return typeof e?.then==`function`}var zi=256;function Bi(e,t){if(t===e.length)return;if(t===zi){let n=Array(e.length),r=!1;for(;t<e.length;t++){let i=Hi(e[t]);n[t]=i,r||=Ri(i)}return r?n:void 0}let n=Hi(e[t]);if(Ri(n)){let r=Array(e.length);r[t]=n;for(let n=t+1;n<e.length;n++)r[n]=Hi(e[n]);return r}let r=Bi(e,t+1);return r&&(r[t]=n),r}function Vi(e,t,n){if(n===t.length)return;if(n===zi){let r=Array(t.length),i=!1;for(;n<t.length;n++){let a=Hi(e[t[n]]);r[n]=a,i||=Ri(a)}return i?r:void 0}let r=Hi(e[t[n]]);if(Ri(r)){let i=Array(t.length);i[n]=r;for(let r=n+1;r<t.length;r++)i[r]=Hi(e[t[r]]);return i}let i=Vi(e,t,n+1);return i&&(i[n]=r),i}function Hi(e){if(typeof e==`function`)return e;if(Ri(e))return Promise.resolve(e).then(Hi);if(Array.isArray(e)){let t=Bi(e,0);return t?Promise.all(t):e}if(e?.constructor===Object){let t=Object.keys(e),n=Vi(e,t,0);if(n)return Promise.all(n).then(e=>Object.fromEntries(t.map((t,n)=>[t,e[n]])))}return e}var Ui=un(e=>{let t=new WeakMap;return{key:`promises`,hooks:{"entries:resolve":n=>{for(let r=n.entries.length-1;r>=0;r--){let i=n.entries[r],a=i.input;if(t.get(i)===a){n.entries.splice(r,1);continue}let o=Hi(a);if(!Ri(o)){t.delete(i);continue}t.set(i,a),n.entries.splice(r,1),Promise.resolve(o).then(n=>{t.get(i)===a&&(t.delete(i),i.input=n,delete i._tags,e.invalidate?.())},()=>{t.get(i)===a&&t.delete(i)})}}}}},`promises`),Wi={meta:`content`,link:`href`,htmlAttrs:`lang`},Gi=[`innerHTML`,`textContent`];function Ki(e,t,n,r=!1){return typeof e==`string`&&e.includes(`%`)?Ni(e,t,n,r):e}var qi=un(e=>({key:`template-params`,hooks:{"tags:resolve":({tagMap:t,tags:n})=>{let r=t.get(`templateParams`)?.props||{},i=r.separator||`|`;delete r.separator,r.pageTitle=Ki(r.pageTitle||e._title||``,r,i);for(let e of n){if(e.processTemplateParams===!1)continue;let t=Wi[e.tag];if(t&&typeof e.props[t]==`string`)e.props[t]=Ki(e.props[t],r,i);else if(e.processTemplateParams||e.tag===`titleTemplate`||e.tag===`title`)for(let t of Gi)typeof e[t]==`string`&&(e[t]=Ki(e[t],r,i,e.tag===`script`&&typeof e.props.type==`string`&&e.props.type.endsWith(`json`)))}e._templateParams=r,e._separator=i},"tags:afterResolve":({tagMap:t})=>{let n=t.get(`title`);n?.textContent&&n.processTemplateParams!==!1&&(n.textContent=Ki(n.textContent,e._templateParams,e._separator))}}}),`template-params`);function Ji(e,t){if(typeof t==`function`&&t.key&&e.plugins.has(t.key))return;let n=typeof t==`function`?t(e):t,r=n.key||String(e.plugins.size+1);if(!e.plugins.get(r)){e.plugins.set(r,n);for(let t in n.hooks||{})e.hooks?.hook(t,n.hooks[t])}}function Yi(e,t={}){let n=!t.document,r=new Map,i={_entryCount:1,_h:0,plugins:new Map,resolvedOptions:t,ssr:n,entries:r,hooks:void 0,render:()=>e(i),use:e=>Ji(i,e),push(e,t){let a=t?._index??i._entryCount++,o=t?{...t}:{};delete o.head,delete o.onRendered,delete o._index;let s={_i:a,input:e,options:o};return r.set(a,s),{_i:a,dispose(){r.delete(a)},patch(e){n?(s.input=e,delete s._tags):s._pending=e,r.has(a)||r.set(a,s)}}}};return t.init?.forEach(e=>e&&i.push(e)),i}var Xi=()=>location.protocol+`//`+location.host;function Zi(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Ct(n,``)}return Ct(n,e)+r+i}function Qi(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=Zi(e,location),c=n.value,l=t.value,u=0;
vendor: 4,270 bytes, line 2
2if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){let{history:e}=window;e.state&&e.replaceState(H({},e.state,{scroll:Lt()}),``)}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),{pauseListeners:c,listen:l,destroy:d}}function $i(e,t,n,r=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:null}}function ea(e){let{history:t,location:n}=window,r={value:Zi(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Xi()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,H({},t.state,$i(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=H({},i.value,t.state,{forward:e,scroll:Lt()});a(o.current,o,!0),a(e,H({},$i(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function ta(e){e=at(e);let t=ea(e),n=Qi(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=H({location:``,base:e,go:r,createHref:It.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var na={type:0,value:``},ra=/[a-zA-Z0-9_]/;function ia(e){if(!e)return[[]];if(e===`/`)return[[na]];if(!Et(e))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;)switch(c=e[s++],n){case 0:c===`\\`?(r=n,n=4):c===`/`?(l&&d(),o()):c===`:`?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:c===`(`?n=2:ra.test(c)?f():(d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case 2:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`)}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var aa=`[^/]+?`,oa={sensitive:!1,strict:!1,start:!0,end:!0},sa=/[.+*?^${}()[\]/\\]/g;function ca(e,t){let n=H({},oa,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=40+(n.sensitive?.25:0);if(o.type===0)r||(i+=`/`),i+=o.value.replace(sa,`\\$&`),s+=40;else if(o.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||aa;if(u!==aa){s+=10;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=20,c&&(s+=-8),n&&(s+=-20),u===`.*`&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===0)n+=e.value;else if(e.type===1){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(Dt(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=Dt(c)?c.join(`/`):c;
vendor: 9,900 bytes, line 2
2if(!l){if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`)}n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function la(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function ua(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=la(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(da(r))return 1;if(da(i))return-1}return i.length-r.length}function da(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var fa={strict:!1,end:!0,sensitive:!1};function pa(e,t,n){let r=ca(ia(e.path),n),i=H(r,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function ma(e,t){let n=[],r=new Map;t=Ut(fa,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=ga(e);s.aliasOf=r&&r.record;let l=Ut(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(ga(H({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&!Et(u)){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=pa(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!va(d)&&o(e.name)),Sa(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:ht}function o(e){if(ut(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=ba(e,n);n.splice(t,0,e),e.record.name&&!va(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw pt(1,{location:e});s=i.record.name,a=H(ha(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&ha(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name,i.keys.forEach(e=>{e.optional&&!a[e.name]&&delete a[e.name]}));else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw pt(1,{location:e,currentLocation:t});s=i.record.name,a=H({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:ya(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function ha(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function ga(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:_a(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function _a(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function va(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ya(e){return e.reduce((e,t)=>H(e,t.meta),{})}function ba(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;ua(e,t[i])<0?r=i:n=i+1}let i=xa(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function xa(e){let t=e;for(;t=t.parent;)if(Sa(t)&&ua(e,t)===0)return t}function Sa({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ca(e){let t=g(Ot),n=g(kt),r=M(()=>{let n=C(e.to);return t.resolve(n)}),i=M(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(Bt.bind(null,i));if(o>-1)return o;let s=Oa(e[t-2]);return t>1&&Oa(i)===s&&a[a.length-1].path!==s?a.findIndex(Bt.bind(null,e[t-2])):o}),a=M(()=>i.value>-1&&Da(n.params,r.value.params)),o=M(()=>i.value>-1&&i.value===n.matched.length-1&&bt(n.params,r.value.params));function s(n={}){if(Ea(n)){let n=t[C(e.replace)?`replace`:`push`](C(e.to)).catch(ht);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:M(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function wa(e){return e.length===1?e[0]:e}var Ta=N({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Ca,setup(e,{slots:t}){let n=Ce(Ca(e)),{options:r}=g(Ot),i=M(()=>({[ka(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[ka(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&wa(t.default(n));return e.custom?r:a(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function Ea(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(e.button===void 0||e.button===0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Da(e,t){for(let n in t){let r=t[n],i=e[n];if(Dt(r)){if(!Dt(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}else if(r!==i)return!1}return!0}function Oa(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var ka=(e,t,n)=>e??t??n,Aa=N({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=g(At),i=M(()=>e.route||r.value),o=g(it,0),s=M(()=>{let e=C(o),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),c=M(()=>i.value.matched[s.value]);Se(it,M(()=>s.value+1)),Se(gt,c),Se(At,i);let l=R();return m(()=>[l.value,c.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!Bt(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,o=e.name,s=c.value,u=s&&s.components[o];if(!u)return ja(n.default,{Component:u,route:r});let d=s.props[o],f=d?d===!0?r.params:typeof d==`function`?d(r):d:null,p=a(u,H({},f,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(s.instances[o]=null)},ref:l}));return ja(n.default,{Component:p,route:r})||p}}});function ja(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var Ma=Aa;function Na(e){let t=ma(e.routes,e),n=e.parseQuery||vt,r=e.stringifyQuery||mt,i=e.history,a=$t(),o=$t(),s=$t(),c=$e(Vt),l=$e(0),u=Vt;Tt&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let d=ot.bind(null,e=>``+e),f=ot.bind(null,Qt),p=ot.bind(null,jt);function m(e,n){let r,i;ut(e)?(r=t.getRecordMatcher(e),i=n):i=e;let a=t.addRoute(i,r);return l.value++,()=>{a(),l.value++}}function h(e){let n=t.getRecordMatcher(e);n&&(t.removeRoute(n),l.value++)}function g(){t.clearRoutes(),l.value++}function _(){return t.getRoutes().map(e=>e.record)}function v(e){return!!t.getRecordMatcher(e)}function y(e,a){if(l.value,typeof e==`string`){a||=e.startsWith(`/`)?Vt:c.value;let r=yt(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return H(r,o,{params:p(o.params),redirectedFrom:void 0,href:s})}a=H({},a||(e.path!=null&&e.path.startsWith(`/`)&&!(`name`in e&&e.name)?Vt:c.value));let o;if(e.path!=null)o=H({},e,{path:yt(n,e.path,a.path).path});else{let t=H({},e.params);for(let e in t)t[e]??delete t[e];o=H({},e,{params:f(t)}),a.params=f(a.params)}let s=t.resolve(o,a),u=e.hash||``;s.params=d(p(s.params));let m=_t(r,H({},e,{hash:Jt(u),path:s.path})),h=i.createHref(m);return H({fullPath:m,hash:u,query:r===mt?zt(e.query):e.query||{}},s,{redirectedFrom:void 0,href:h})}function b(e){return typeof e==`string`?yt(n,e,c.value.path):H({},e)}function x(e,t){if(u!==e)return pt(8,{from:t,to:e})}function S(e){return T(e)}function w(e){return S(H(b(e),{replace:!0}))}function ee(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=b(i):{path:i},i.params={}),H({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function T(e,t){let n=u=y(e),i=c.value,a=e.state,o=e.force,s=e.replace===!0,l=ee(n,i);if(l)return T(H(b(l),{state:typeof l==`object`?H({},a,l.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&<(r,i,n)&&(f=pt(16,{to:d,from:i}),fe(i,i,!0,!1)),(f?Promise.resolve(f):re(d,i)).catch(e=>ft(e)?ft(e,2)?e:D(e):ue(e,d,i)).then(e=>{if(e){if(ft(e,2))return T(H({replace:s},b(e.to),{state:typeof e.to==`object`?H({},a,e.to.state):a,force:o}),t||d)}else e=ae(d,i,!0,s,a);return ie(d,i,e),e})}function te(e,t){let n=x(e,t);return n?Promise.reject(n):Promise.resolve()}function ne(e){let t=me.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function re(e,t){let n,[r,i,s]=Mt(e,t);n=Xt(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(Yt(r,e,t))});let c=te.bind(null,e,t);return n.push(c),k(n).then(()=>{n=[];for(let r of a.list())n.push(Yt(r,e,t));return n.push(c),k(n)}).then(()=>{n=Xt(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(Yt(r,e,t))});return n.push(c),k(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter){if(Dt(r.beforeEnter))for(let i of r.beforeEnter)n.push(Yt(i,e,t));else n.push(Yt(r.beforeEnter,e,t))}return n.push(c),k(n)}).then(()=>
2(e.matched.forEach(e=>e.enterCallbacks={}),n=Xt(s,`beforeRouteEnter`,e,t,ne),n.push(c),k(n))).then(()=>{n=[];for(let r of o.list())n.push(Yt(r,e,t));return n.push(c),k(n)}).catch(e=>ft(e,8)?e:Promise.reject(e))}function ie(e,t,n){s.list().forEach(r=>ne(()=>r(e,t,n)))}function ae(e,t,n,r,a){let o=x(e,t);if(o)return o;let s=t===Vt,l=Tt?history.state:{};n&&(r||s?i.replace(e.fullPath,H({scroll:s&&l&&l.scroll},a)):i.push(e.fullPath,a)),c.value=e,fe(e,t,n,s),D()}let oe;function se(){oe||=i.listen((e,t,n)=>{if(!he.listening)return;let r=y(e),a=ee(r,he.currentRoute.value);if(a){T(H(a,{replace:!0,force:!0}),r).catch(ht);return}u=r;let o=c.value;Tt&&n.delta&&xt(st(o.fullPath,n.delta)),re(r,o).catch(e=>ft(e,12)?e:ft(e,2)?(T(H(b(e.to),{force:!0}),r).then(e=>{ft(e,20)&&!n.delta&&n.type===`pop`&&i.go(-1,!1)}).catch(ht),Promise.reject()):(n.delta&&i.go(-n.delta,!1),ue(e,r,o))).then(e=>{e||=ae(r,o,!1),e&&(n.delta&&!ft(e,8)?i.go(-n.delta,!1):n.type===`pop`&&ft(e,20)&&i.go(-1,!1)),ie(r,o,e)}).catch(ht)})}let ce=$t(),E=$t(),le;function ue(e,t,n){D(e);let r=E.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function de(){return le&&c.value!==Vt?Promise.resolve():new Promise((e,t)=>{ce.add([e,t])})}function D(e){return le||(le=!e,se(),ce.list().forEach(([t,n])=>e?n(e):t()),ce.reset()),e}function fe(t,n,r,i){let{scrollBehavior:a}=e;if(!Tt||!a)return Promise.resolve();let o=!r&&wt(st(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return Ge().then(()=>a(t,n,o)).then(e=>t===c.value&&e&&dt(e)).catch(e=>t===c.value&&ue(e,t,n))}let pe=e=>i.go(e),O,me=new Set,he={currentRoute:c,listening:!0,addRoute:m,removeRoute:h,clearRoutes:g,hasRoute:v,getRoutes:_,resolve:y,options:e,push:S,replace:w,go:pe,back:()=>pe(-1),forward:()=>pe(1),beforeEach:a.add,beforeResolve:o.add,afterEach:s.add,onError:E.add,isReady:de,install(e){e.component(`RouterLink`,Ta),e.component(`RouterView`,Ma),e.config.globalProperties.$router=he,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>C(c)}),Tt&&!O&&c.value===Vt&&(O=!0,S(i.location).catch(e=>{}));let t={};for(let e in Vt)Object.defineProperty(t,e,{get:()=>c.value[e],enumerable:!0});e.provide(Ot,he),e.provide(kt,tt(t)),e.provide(At,c);let n=e.unmount;me.add(e),e.unmount=function(){me.delete(e),me.size<1&&(u=Vt,oe&&oe(),oe=null,c.value=Vt,O=!1,le=!1),n()}}};function k(e){return e.reduce((e,t)=>e.then(()=>ne(t)),Promise.resolve())}return he}function Pa(e){try{return JSON.parse(e)}catch{return e}}var Fa=[[`NuxtError`,e=>Te(e)],[`EmptyShallowRef`,e=>$e(e===`_`?void 0:e===`0n`?BigInt(0):Pa(e))],[`EmptyRef`,e=>R(e===`_`?void 0:e===`0n`?BigInt(0):Pa(e))],[`ShallowRef`,e=>$e(e)],[`ShallowReactive`,e=>tt(e)],[`Ref`,e=>R(e)],[`Reactive`,e=>Ce(e)]],Ia=E({name:`nuxt:revive-payload:client`,order:-30,async setup(e){let t,r;for(let[e,t]of Fa)En(e,t);Object.assign(e.payload,([t,r]=n(()=>e.runWithContext(On)),t=await t,r(),t)),delete window.__NUXT__}},1);function La(e,t){t.push(le),e.vueApp.use(t);let n=!0,r=()=>{n=!1,t.render()};t.hooks?.hook(`dom:beforeRender`,e=>{e.shouldRender=!n}),e.hooks.hook(`page:start`,()=>{n=!0}),e.hooks.hook(`page:finish`,()=>{e.isHydrating||r()}),e.hooks.hook(`app:error`,r),e.hooks.hook(`app:suspense:resolve`,r);let i=t.push.bind(t);t.push=((t,n)=>{let r=i(t,n),a=r.dispose.bind(r);return r.dispose=()=>{let t=e[`~transitionPromise`];t?t.finally(a):a()},r})}function Ra(e,t,n){let r=e.push,i=e;i.ssr=!1,i.hooks=t,i.dirty=!!i.dirty,i.use=e=>Ji(i,e),i.render=()=>n(i);function a(){t.callHook(`entries:updated`,i),i._b||i.render()}return i.invalidate=()=>{for(let e of i.entries.values())delete e._tags;i.dirty=!0,a()},i.push=(n,o)=>{let s=o?.onRendered?t.hook(`dom:rendered`,o.onRendered):void 0,c=r(n,o),l=e.entries.get(c._i);return l&&(l._o=n),i.dirty=!0,a(),{_i:c._i,patch(e){c.patch(e),i.dirty=!0,a()},dispose(){s?.(),e.entries.has(c._i)&&(c.dispose(),i.invalidate())}}},i}var za=/\s+/;function Ba(e={}){return t=>Ua(t,e)}function Va(e){for(let t of e.entries.values())if(t._pending!==void 0)return!0;return!1}function Ha(e,t){let n={_d:t,_t:t.title,_e:new Map([[`htmlAttrs`,t.documentElement],[`bodyAttrs`,t.body]]),_p:{},_s:{},_l:new Map};for(let t of e.entries.values())if(t._o!==void 0){let e=t._o;for(let t of[`bodyAttrs`,`htmlAttrs`]){let r=e[t]?.class;if(typeof r==`string`){let e=n._e.get(t);for(let i of r.split(za))i&&(n._p[`${t}:attr:class:${i}`]=()=>e.classList.remove(i))}}}return n}function Ua(e,t={}){let n=t.document||e.resolvedOptions.document,r=e._dom;if(!n||e._du||r&&r._d===n&&!e.dirty&&!Va(e))return!1;let i=n.defaultView;e._du=!0;let a=!1;try{let o=function(e,t,n){d._s[e]=!n&&f[e]||t,delete f[e]},s=function(e,t,n,r,i,a){let s=`${e}:event:${t}`,c=d._l.get(s);if(c&&c[0]===a&&c[1]===n&&c[2]===r){o(s,c[4]);return}c?.[4]();let l=`data-${t}`,u=(e=>r.call(i,e)),f=()=>{a.removeEventListener(n,u),i.getAttribute(l)===``&&i.removeAttribute(l),d._l.get(s)?.[3]===u&&d._l.delete(s)};a.addEventListener(n,u),d._l.set(s,[a,n,r,u,f]),i.setAttribute(l,``),o(s,f,!0)},c=function({id:e,$el:t,tag:n}){if(d._e.set(e,t),!n.tag.endsWith(`Attrs`)){let r=n.textContent;r!=null&&r!==``&&(r!==t.textContent&&(t.textContent=r),o(`${e}:text`,()=>{t.textContent===r&&(t.textContent=``)},!0));let i=n.innerHTML;i!=null&&i!==``&&(i!==t.innerHTML&&(t.innerHTML=i),o(`${e}:html`,()=>{t.innerHTML===i&&(t.innerHTML=``)},!0));let a=`${e}:el`;o(a,f[a]||(()=>{t?.remove(),d._e.delete(e)}))}for(let r in n.props){let a=n.props[r];if(r[0]===`o`&&r[1]===`n`&&typeof a==`function`){let o=r.slice(2);t?.dataset?.[`${r}fired`]&&a.call(t,new((i?.Event)||Event)(o)),s(e,r,o,a,t,n.tag===`bodyAttrs`&&i?i:t);continue}let c=`${e}:attr:${r}`;if(r===`class`&&a)for(let e of a){let n=`${c}:${e}`;o(n,f[n]||(()=>t.classList.remove(e))),t.classList.contains(e)||t.classList.add(e)}else if(r===`style`&&a)for(let[e,n]of a){let r=`${c}:${e}`;o(r,f[r]||(()=>t.style.removeProperty(e))),t.style.setProperty(e,n)}else a!==!1&&a!==null&&(t.getAttribute(r)!==a&&t.setAttribute(r,a===!0?``:String(a)),o(c,f[c]||(()=>t.removeAttribute(r))))}},l={shouldRender:!0,tags:[]};if(ln(e,`dom:beforeRender`,l),!l.shouldRender)return!1;let u=r;if(u?._d!==n){if(u){for(let e in u._s)u._s[e]();for(let e in u._p)u._p[e]();u._s=u._p={},u._e.clear(),u._l.clear()}u=void 0}u?u._p=u._s:u=Ha(e,n),u._s={};let d=u,f=d._p,p=[],m={};e.dirty=!1;let h=cn(e,t.tagWeight?{tagWeight:t.tagWeight}:void 0),g=[],_={};for(let e of h){let t=_[e._d]||0,r=(t?`${e._d}:${t}`:e._d)||e._h,i={tag:e,id:r,shouldRender:!0};if(e.tag===`meta`&&e._d&&fn(e._d)&&(_[e._d]=t+1),g.push(i),e.tag===`title`){n.title=e.textContent,o(`title:`,()=>n.title=d._t);continue}i.$el=d._e.get(r),i.$el?c(i):pn.has(e.tag)&&p.push(i)}if(p.length){let e=new Set(d._e.values());for(let t of[...n.body.children,...n.head.children]){let n=t.tagName.toLowerCase();if(!pn.has(n)||e.has(t))continue;let r={innerHTML:t.innerHTML};for(let e of t.getAttributeNames())r[e]=t.getAttribute(e);let i=yn({tag:n,props:{}},r);i.key=t.getAttribute(`data-hid`)||void 0;let a=_n(i)||sn(i),o=a,s=1;for(;d._e.has(o);)o=`${a}:${s++}
2`;d._e.set(o,t)}}for(let e of p){let t=d._e.get(e.id);e.$el=t||n.createElement(e.tag.tag),c(e),t||(m[e.tag.tagPosition||`head`]??=n.createDocumentFragment()).appendChild(e.$el)}m.head&&n.head.appendChild(m.head),m.bodyOpen&&n.body.insertBefore(m.bodyOpen,n.body.firstChild),m.bodyClose&&n.body.appendChild(m.bodyClose);for(let e in f)f[e]();e._dom=d,a=!0,ln(e,`dom:rendered`,{renders:g})}catch(t){throw e.dirty=!0,t}finally{e._du=!1}return a&&(e.dirty||Va(e))&&Ua(e,t),a}var Wa=e=>typeof e.tagPriority==`number`?e.tagPriority:100+(dn[e.tagPriority]||0);function Ga(e={}){e.document=e.document||(typeof window<`u`?document:void 0);let t=e.render||Ba({document:e.document}),n=Ra(Yi(t,{document:e.document,propResolvers:e.propResolvers,_tagWeight:Wa,init:[]}),hn(e.hooks),t);return e.plugins?.forEach(e=>n.use(e)),e.init?.forEach(e=>e&&n.push(e)),n}function Ka(e={}){let t=Ba(),n,r=0;return n=Ga({render:()=>{let e=++r;setTimeout(()=>{e===r&&t(n)},0)},...e}),n.install=on(n),n}var qa={disableDefaults:!0,plugins:[Li,Ui,qi,Ii]},Ja=E({name:`nuxt:head`,enforce:`pre`,setup(e){La(e,Ka(qa))}}),Ya=/(:\w+)\([^)]+\)/g,Xa=/(:\w+)[?+*]/g,Za=/:\w+/g,Qa=(e,t)=>t.path.replace(Ya,`$1`).replace(Xa,`$1`).replace(Za,t=>e.params[t.slice(1)]?.toString()||``),$a=(e,t)=>{let n=e.route.matched.find(t=>t.components?.default===e.Component.type),r=t??n?.meta.key??(n&&Qa(e.route,n));return typeof r==`function`?r(e.route):r},eo=(e,t)=>({default:()=>e?a(Ue,e===!0?{}:e,t):t});function to(e){return Array.isArray(e)?e:[e]}var no=[je(async e=>{let t,r;if(!e.meta?.validate)return;let i=([t,r]=n(()=>Promise.resolve(e.meta.validate(e))),t=await t,r(),t);if(i!==!0)return Te({fatal:!0,status:i&&(i.status||i.statusCode)||404,statusText:i&&(i.statusText||i.statusMessage)||`Page Not Found: ${e.fullPath}`,data:{path:e.fullPath}})},1),je(e=>{let t=wn({path:e.path});if(t.redirect){let n=t.redirect.includes(`#`)?t.redirect:t.redirect+e.hash;return Je(n,{acceptRelative:!0})?(window.location.href=n,!1):n}})],ro={admin:()=>U(()=>import(`./Ww7FaV3n.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),auth:()=>U(()=>import(`./B9Jx-iZw.js`),__vite__mapDeps([12,1,7,5,10,4]),import.meta.url),guest:()=>U(()=>import(`./CYZhk8Wx.js`),__vite__mapDeps([13,1,7,5]),import.meta.url)},io={pageTitleKey:`admin.bug-reports.pageTitle`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},ao={pageTitleKey:`admin.cron-health.pageTitle`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},oo={pageTitleKey:`admin.debug-logs.pageTitle`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},so={pageTitleKey:`admin.common.devices`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},co={pageTitleKey:`admin.common.embeddings`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},lo={key:e=>`admin-recipes-${String(e.query.country??``)}`,pageTitleKey:`admin.home-recipes.pageTitle`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},uo={pageTitleKey:`admin.common.listings`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},fo={pageTitleKey:`admin.promos.pageTitle`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},po={key:e=>`admin-recipes-${String(e.query.country??``)}`,pageTitleKey:`admin.dashboard.recipeMetrics`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},mo={pageTitleKey:`admin.common.referrals`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},ho={pageTitleKey:`admin.common.reports`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},go={pageTitleKey:`admin.dashboard.reviews`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},_o={pageTitleKey:`admin.dashboard.searches`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},vo={pageTitleKey:`admin.dashboard.socialScheduler`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},yo={pageTitleKey:`admin.common.users`,robots:`noindex`,backTo:`/admin`,backLabelKey:`admin.common.admin`,fullWidth:!0},bo={pageTitleKey:`admin.whatsapp.pageTitle`,backTo:`/admin`,backLabelKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},xo={robots:`noindex`},So={robots:`noindex`},Co={robots:`noindex`},wo={robots:`noindex`},To={pageTitleKey:`publishing.ui.importCatalog`};function Eo(e={}){let t=e.path||window.location.pathname,n=new URL(t,window.location.href);if(n.host!==window.location.host)throw b.NUXT_E2010({path:t});if(n.protocol&&he(n.protocol))throw b.NUXT_E2002({toPath:t,protocol:n.protocol});let r={};try{r=JSON.parse(sessionStorage.getItem(`nuxt:reload`)||`{}`)}catch{}if(e.force||r?.path!==t||r?.expires<Date.now()){try{sessionStorage.setItem(`nuxt:reload`,JSON.stringify({path:t,expires:Date.now()+(e.ttl??1e4)}))}catch{}if(e.persistState)try{sessionStorage.setItem(`nuxt:reload:state`,JSON.stringify({state:p().payload.state}))}catch{}window.location.pathname===t?window.location.reload():window.location.href=t}}
2var Do={middleware:[function(e){let{countryCode:t}=Kn(e);if(e.params.slug&&mr(t.value,String(e.params.slug)))return;let n=br(e.query)?e.query:{...e.query,explorar:`1`};return ve({path:`/`,query:n},{redirectCode:301})}],pageTitleKey:`discovery.home.types.start`,pageTitleClass:`font-display italic text-lg font-extrabold text-terracotta-600 text-center flex-1 px-2 leading-none`,fullWidth:!0},Oo={pageTitleKey:`account.stats.favorites`,pageTitleAccentKey:`account.pageTitles.favorites`,pageTitleClass:`font-display text-lg font-extrabold text-ink text-center flex-1 px-2 leading-none`,robots:`noindex`,fullWidth:!0},ko={pageTitleKey:`account.notifications.title`,backTo:`/yo`,fullWidth:!0,robots:`noindex`},Ao={pageTitleKey:`account.stats.title`,backTo:`/yo`,fullWidth:!0,robots:`noindex`},jo={pageTitleKey:`account.notifications.title`,backTo:`/ajustes`,backLabelKey:`account.settings.title`,robots:`noindex`,fullWidth:!0},Mo={pageTitleKey:`account.settings.referralsSection`,pageTitleAccentKey:`account.pageTitles.invite`,backTo:`/ajustes`,robots:`noindex`,fullWidth:!0},No={pageTitleKey:`discovery.labels.listing`,pageTitleClass:`font-display text-lg font-extrabold text-ink text-center flex-1 px-2 leading-none`,backTo:`/?explorar=1`,fullWidth:!0,hideFooterMobile:!0,hideBottomNav:!0},Po={robots:`noindex`},Fo={pageTitleKey:`account.shell.profileTitle`,fullWidth:!0},Io={pageTitleKey:`account.about.breadcrumb`,fullWidth:!0},Lo={pageTitleKey:`admin.common.admin`,robots:`noindex`,fullWidth:!0},Ro={robots:`noindex`,pageTitleKey:`discovery.chat.pageTitle`,backTo:`/`,fullWidth:!0},zo={pageTitleKey:`account.contact.breadcrumb`,fullWidth:!0},Bo={pageTitleKey:`account.history.title`,pageTitleAccentKey:`account.pageTitles.history`,pageTitleClass:`font-display text-lg font-extrabold text-ink text-center flex-1 px-2 leading-none`,robots:`noindex`,fullWidth:!0},Vo={middleware:[function(){return ve(`/`,{replace:!0,redirectCode:301})}]},Ho={robots:`noindex`,pageTitleKey:`account.settings.profileTitle`,pageTitleAccentKey:`account.pageTitles.myProfile`,fullWidth:!0},Uo={pageTitleKey:`legal.ui.privacyTitle`,fullWidth:!0},Wo={pageTitleKey:`account.billingPaymentMethodsSection.addCard`},Go={pageTitleKey:`account.pageTitles.pro`,pageTitleAccentKey:`account.pageTitles.pro`,fullWidth:!0},Ko={fullWidth:!0,robots:`noindex`},qo={pageTitleKey:`account.settings.title`,backTo:`/yo`,robots:`noindex`,fullWidth:!0},Jo={pageTitleKey:`legal.ui.termsTitle`,fullWidth:!0},Yo={layout:!1},Xo=[{name:`admin-bug-reports`,path:`/admin/bug-reports`,meta:{...io||{},middleware:`admin`},component:()=>U(()=>import(`./DV2WAxj4.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59]),import.meta.url)},{name:`admin-cron-health`,path:`/admin/cron-health`,meta:{...ao||{},middleware:`admin`},component:()=>U(()=>import(`./gquWfK5y.js`),__vite__mapDeps([60,1,4,9,31,32,17,3,21,18,37,20,22,24,35,36,33,53,54,55]),import.meta.url)},{name:`admin-debug-logs`,path:`/admin/debug-logs`,meta:{...oo||{},middleware:`admin`},component:()=>U(()=>import(`./BfxlMBKh.js`),__vite__mapDeps([61,1,3,4,2,5,6,7,8,9,10,31,32,17,21,18,35,36,22,37,20,24,33,51,19,34,62,63,25,53,54,55,56,57,58,59]),import.meta.url)},{name:`admin-devices`,path:`/admin/devices`,meta:{...so||{},middleware:`admin`},component:()=>U(()=>import(`./Q1hrcEPp.js`),__vite__mapDeps([64,1,2,3,4,5,6,7,8,9,10,34,21,20,22,24,18,31,32,17,33,58,53,54,55,59,37,35,36]),import.meta.url)},{name:`admin-embeddings`,path:`/admin/embeddings`,meta:{...co||{},middleware:`admin`},component:()=>U(()=>import(`./BhVl5FRk.js`),__vite__mapDeps([65,1,4,36,3,2,5,6,7,8,9,10,31,32,17,21,18,37,20,22,24,35,33,34,54,55,66,19,67,50]),import.meta.url)},{name:`admin-home-recipes`,path:`/admin/home-recipes`,meta:{...lo||{},middleware:`admin`},component:()=>U(()=>import(`./DLAvyxWx.js`),__vite__mapDeps([68,1,4,69,2,3,5,6,7,8,9,10,70,71,21,18,19,20,22,24,72,25,73,29,74,63,31,32,17,37,35,36,33,34,75,50,76,53,54,55,59,77]),import.meta.url)},{name:`admin-listings`,path:`/admin/listings`,meta:{...uo||{},middleware:`admin`},component:()=>U(()=>import(`./bgyLNCfE.js`),__vite__mapDeps([78,1,4,2,3,5,6,7,8,9,10,79,18,15,16,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,51,58,80,39,40,41,81,44,74,50,53,54,55,59]),import.meta.url)},{name:`admin-promos`,path:`/admin/promos`,meta:{...fo||{},middleware:`admin`},component:()=>U(()=>import(`./Cbs_DAMz.js`),__vite__mapDeps([82,1,3,4,69,36,2,5,6,7,8,9,10,31,32,17,21,18,33,20,22,37,24,35,51,19,34,58,80,39,16,40,41,25,81,27,44,74,50,83,62,63,76,53,54,55]),import.meta.url)},{name:`admin-recipes`,path:`/admin/recipes`,meta:{...po||{},middleware:`admin`},component:()=>U(()=>import(`./DfCZwPY-.js`),__vite__mapDeps([84,1,3,4,69,2,5,6,7,8,9,10,70,85,16,17,18,19,20,21,22,27,40,41,39,25,44,23,24,46,72,47,49,28,29,74,31,32,33,37,35,36,51,80,81,50,75,76,53,54,55,59,66,67,77]),import.meta.url)},{name:`admin-referrals`,path:`/admin/referrals`,meta:{...mo||{},middleware:`admin`},component:()=>U(()=>import(`./LsQXQGi7.js`),__vite__mapDeps([86,1,3,4,69,2,5,6,7,8,9,10,31,32,17,21,18,33,20,22,37,24,35,36,51,19,34,58,80,39,16,40,41,25,81,27,44,74,50,83,62,63,76,53,54,55]),import.meta.url)},{name:`admin-reports`,path:`/admin/reports`,meta:{...ho||{},middleware:`admin`},component:()=>U(()=>import(`./BimE_ND6.js`),__vite__mapDeps([87,1,4,2,3,5,6,7,8,9,10,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,80,39,40,41,81,44,74,50,53,54,55,56,57,58,59]),import.meta.url)},{name:`admin-reviews`,path:`/admin/reviews`,meta:{...go||{},middleware:`admin`},component:()=>U(()=>import(`./CHJL0aQR.js`),__vite__mapDeps([88,1,2,3,4,5,6,7,8,9,10,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,58,53,54,55,59,89]),import.meta.url)},{name:`admin-searches`,path:`/admin/searches`,meta:{..._o||{},middleware:`admin`},component:()=>U(()=>import(`./DSp8PU0I.js`),__vite__mapDeps([90,1,4,2,3,5,6,7,8,9,10,91,16,17,18,19,20,21,22,39,40,41,25,24,47,48,49,23,74,52,31,32,37,35,36,33,34,53,54,55,59,66,67,50]),import.meta.url)},{name:`admin-social`,path:`/admin/social`,meta:{...vo||{},middleware:`admin`},component:()=>U(()=>import(`./OZ0ALdfZ.js`),__vite__mapDeps([92,1,3,4,69,2,5,6,7,8,9,10,85,16,17,18,19,20,21,22,27,40,41,39,25,44,23,24,46,72,47,49,28,29,74,31,32,33,93,94,73,30,26,63,15,34,37,35,36,51,80,81,50,83,75,62,76,54,55,95]),import.meta.url)},{name:`admin-users`,path:`/admin/users`,meta:{...yo||{},middleware:`admin`},component:()=>U(()=>import(`./hUxOL7-0.js`),__vite__mapDeps([96,1,3,4,2,5,6,7,8,9,10,21,18,19,20,22,24,25,93,16,17,41,94,72,73,29,74,30,28,26,27,23,63,31,32,33,37,35,36,50,51,38,39,40,42,43,44,45,46,47,48,49,52,34,80,81,62,97,98,99,100,101,53,54,55,59,66,67]),import.meta.url)},{name:`admin-whatsapp`,path:`/admin/whatsapp`,meta:{...bo||{},middleware:`admin`},component:()=>U(()=>import(`./DA_7Ds_b.js`),__vite__mapDeps([102,1,3,4,2,5,6,7,8,9,10,31,32,17,21,18,33,20,22,37,24,35,36,51,19,34,58,54,55,59,95]),import.meta.url)},{name:`auth-confirm`,path:`/auth/confirm`,meta:xo||{},alias:[`/confirmar`],component:()=>U(()=>import(`./_f8Erg3N.js`),__vite__mapDeps([103,1,69,2,3,4,5,6,7,8,9,10,31,32,17,21,18,76,55]),import.meta.url)},{name:`auth-login`,path:`/auth/login`,meta:{...So||{},middleware:`guest`},alias:[`/ingresar`],component:()=>U(()=>import(`./Cd6wxgFi.js`),__vite__mapDeps([104,1,3,69,105,106,17,4,5,36,6,10,21,107,2,7,8,9,31,32,18,37,20,22,24,35,33,80,19,39,16,40,41,25,81,27,44,74,50,76,108,55,109,57,110,
2111,112]),import.meta.url)},{name:`auth-register`,path:`/auth/register`,meta:Co||{},alias:[`/registrar`],component:()=>U(()=>import(`./CmmuqWZt.js`),__vite__mapDeps([113,1,3,4,69,105,106,17,5,36,6,10,21,107,2,7,8,9,114,79,85,16,18,19,20,22,27,40,41,39,25,44,23,24,46,72,47,49,28,29,74,31,32,33,37,35,57,51,62,63,76,115,55,109,110,116,117]),import.meta.url)},{name:`auth-verify`,path:`/auth/verify`,meta:wo||{},alias:[`/verificar`],component:()=>U(()=>import(`./BxrOiA6u.js`),__vite__mapDeps([118,1,3,69,2,4,5,6,7,8,9,10,31,32,17,21,18,35,36,22,37,20,24,33,57,76,108,55,95,109,110,112,119]),import.meta.url)},{name:`import-catalog`,path:`/import/catalog`,meta:{...To||{},middleware:`auth`},alias:[`/importar/catalogo`],component:()=>U(()=>import(`./4nDDUN2y.js`),__vite__mapDeps([120,1,4,69,36,3,2,5,6,7,8,9,10,121,16,17,18,19,20,21,22,40,23,24,72,25,73,29,74,26,27,28,30,63,31,32,37,35,33,75,50,53,55]),import.meta.url)},{name:`listings-browse`,path:`/publicaciones/explorar/:slug?`,meta:Do||{},alias:[`/listings/browse/:slug?`],component:()=>U(()=>import(`./BkgrWLPQ.js`),__vite__mapDeps([122,1,3,4,69,105,106,17,5,36,6,10,21,107,2,7,8,9,70,123,114,79,124,18,19,31,32,37,20,22,24,35,33,38,39,16,40,41,25,42,27,43,44,45,23,46,47,48,49,29,28,26,50,51,52,58,125,76,55,77,126,57,127,128,129,71,72,73,74,63,130,81,131,132,133,134,135,34,99,136,137,53,138,139,108,140,141]),import.meta.url)},{name:`me-favorites`,path:`/me/favorites`,meta:{...Oo||{},middleware:`auth`},alias:[`/yo/favoritos`],component:()=>U(()=>import(`./BkdtP-T6.js`),__vite__mapDeps([142,1,3,69,36,2,4,5,6,7,8,9,10,133,79,124,134,135,31,32,17,21,18,57,99,58,20,22,76,11,143,144,145,146,54,55,138,105,106,107,34,24,33,139,108,140,141,132,37,35,136,137,53,147]),import.meta.url)},{name:`me-notifications`,path:`/me/notifications`,meta:{...ko||{},middleware:`auth`},alias:[`/yo/notificaciones`],component:()=>U(()=>import(`./BwDFcWnF.js`),__vite__mapDeps([148,1,3,4,69,5,36,2,6,7,8,9,10,31,32,17,21,18,149,107,99,144,76,143,145,146,54,55]),import.meta.url)},{name:`me-stats`,path:`/me/stats`,meta:{...Ao||{},middleware:`auth`},alias:[`/yo/estadisticas`],component:()=>U(()=>import(`./CyfCxyga.js`),__vite__mapDeps([150,1,4,69,36,3,2,5,6,7,8,9,10,151,21,18,20,22,24,25,19,152,16,17,94,41,43,23,31,32,37,35,33,99,153,154,58,76,11,143,144,145,146,54,55]),import.meta.url)},{name:`settings-notifications`,path:`/settings/notifications`,meta:{...jo||{},middleware:`auth`},alias:[`/ajustes/notificaciones`],component:()=>U(()=>import(`./BlxJ_bUh.js`),__vite__mapDeps([155,1,2,3,4,5,6,7,8,9,10,71,21,18,19,20,22,24,72,25,73,29,74,63,31,32,17,34,33,53,54,55]),import.meta.url)},{name:`settings-referrals`,path:`/settings/referrals`,meta:{...Mo||{},middleware:`auth`},alias:[`/ajustes/referidos`],component:()=>U(()=>import(`./BRNynrLG.js`),__vite__mapDeps([156,1,69,36,3,2,4,5,6,7,8,9,10,31,32,17,21,18,33,20,22,99,58,76,108,143,144,145,146,54,55,140,157,158]),import.meta.url)},{name:`listings-id`,path:`/listings/:id()`,meta:No||{},alias:[`/anuncios/:id()`],component:()=>U(()=>import(`./i-bW0kSb.js`),__vite__mapDeps([159,1,3,4,105,69,106,17,5,36,6,10,21,107,2,7,8,9,19,18,135,133,79,124,134,31,32,33,20,22,37,24,35,34,99,58,160,80,39,16,40,41,25,81,27,44,74,50,83,75,136,161,139,162,125,123,114,76,55,138,57,108,140,141,163,164,165,166,85,23,46,72,47,49,28,29,45,42,43,48,26,73,67,93,94,30,63,121,51,167,62,115,168,100,98,169,170,157]),import.meta.url)},{name:`r-code`,path:`/r/:code()`,meta:Po||{},component:()=>U(()=>import(`./mj8pY5BE.js`),__vite__mapDeps([171,1,4,2,3,5,6,7,8,9,10,31,32,17,21,18,37,20,22,24,35,36,33,172,173,55,109,57,110,116]),import.meta.url)},{name:`u-id`,path:`/u/:id()`,meta:Fo||{},alias:[`/perfil/:id()`,`/@:id()`],component:()=>U(()=>import(`./TfbcvNvk.js`),__vite__mapDeps([174,1,4,36,3,2,5,6,7,8,9,10,21,18,19,133,79,124,134,135,20,22,24,31,32,17,33,37,35,149,107,58,80,39,16,40,41,25,81,27,44,74,50,83,76,53,54,55,138,105,69,106,57,34,139,108,140,141,164,175,38,42,43,45,23,46,47,48,49,29,28,26,51,52,176,99,153,154,136,161,162,125,123,114,168,137,56,89,128,165,166,85,72,73,67,93,94,30,63,121,167,75,62,115,100,98,169,177,178,179]),import.meta.url)},{name:`about`,path:`/about`,meta:Io||{},alias:[`/acerca`],component:()=>U(()=>import(`./COhq7Upy.js`),__vite__mapDeps([180,1,4,69,36,3,2,5,6,7,8,9,10,151,21,18,20,22,24,25,19,152,16,17,94,41,43,23,31,32,37,35,33,154,153,144,145,181,76,108,53,143,146,182,54,55]),import.meta.url)},{name:`admin`,path:`/admin`,meta:{...Lo||{},middleware:`admin`},alias:[`/admin`],component:()=>U(()=>import(`./BWkYut7b.js`),__vite__mapDeps([183,17,1,4,69,36,3,2,5,6,7,8,9,10,85,16,18,19,20,21,22,27,40,41,39,25,44,23,24,46,72,47,49,28,29,74,31,32,33,91,48,52,37,35,34,58,76,53,54,55,59]),import.meta.url)},{name:`chat`,path:`/chat`,meta:Ro||{},alias:[`/asistente`],component:()=>U(()=>import(`./Bl0uz1Kk.js`),__vite__mapDeps([184,1,3,16,17,18,19,20,21,22,4,69,36,6,2,5,7,8,9,10,114,79,124,135,133,134,24,91,39,40,41,25,47,48,49,23,74,52,31,32,35,33,37,57,50,34,176,99,58,160,83,136,161,106,139,162,125,123,105,107,76,168,169,81,27,44,100,53,54,55,138,108,140,141,185,186]),import.meta.url)},{name:`contact`,path:`/contact`,meta:zo||{},alias:[`/contacto`],component:()=>U(()=>import(`./C74b8sTJ.js`),__vite__mapDeps([187,1,69,9,31,32,17,3,21,18,57,76,108,6,143,144,145,146,36,2,4,5,7,8,10,54,55,188]),import.meta.url)},{name:`history`,path:`/history`,meta:{...Bo||{},middleware:`auth`},alias:[`/historial`],component:()=>U(()=>import(`./BD8BzFem.js`),__vite__mapDeps([189,1,3,4,69,36,2,5,6,7,8,9,10,79,31,32,17,21,18,149,107,99,153,58,20,22,76,143,144,145,146,54,55,126,57,127]),import.meta.url)},{name:`inicio`,path:`/inicio`,meta:Vo||{},component:()=>U(()=>import(`./CGMGgOsh.js`),__vite__mapDeps([190,1,55]),import.meta.url)},{name:`me`,path:`/me`,meta:{...Ho||{},middleware:`auth`},alias:[`/yo`],component:()=>U(()=>import(`./DKpmA265.js`),__vite__mapDeps([191,1,4,69,5,2,3,6,7,8,9,10,21,79,114,18,19,133,124,134,135,85,16,17,20,22,27,40,41,39,25,44,23,24,46,72,47,49,28,29,74,31,32,33,73,71,63,91,48,52,37,35,36,51,99,83,161,106,139,162,125,123,105,107,62,76,192,80,81,50,115,137,97,98,100,101,53,11,55,140,193,165,166,45,42,43,26,67,93,94,30,12
21,34,167,75,136,168,169,175,57,38,176,153,154,56,58,89,138,108,141,128,177,178,179]),import.meta.url)},{name:`privacy`,path:`/privacy`,meta:Uo||{},alias:[`/privacidad`],component:()=>U(()=>import(`./BhXpGauV.js`),__vite__mapDeps([194,1,69,9,35,36,3,21,18,22,57,76,55,195,2,4,5,6,7,8,10,144,196,146,54,197,198]),import.meta.url)},{name:`pro`,path:`/pro`,meta:Go||{},component:()=>U(()=>import(`./CAJ1YcmE.js`),__vite__mapDeps([199,1,3,4,69,36,2,5,6,7,8,9,10,151,21,18,20,22,24,25,19,152,16,17,94,41,43,23,31,32,37,35,33,51,176,34,80,39,40,81,27,44,74,50,181,144,145,76,108,53,143,146,54,55,116]),import.meta.url),children:[{name:`pro-agregar-tarjeta`,path:`agregar-tarjeta`,meta:{...Wo||{},middleware:`auth`},component:()=>U(()=>import(`./DcvMJL77.js`),__vite__mapDeps([200,1,69,9,31,32,17,3,21,18,37,20,22,24,35,36,33,55]),import.meta.url)}]},{name:`review`,path:`/review`,meta:{...Ko||{},middleware:`auth`},alias:[`/resena`],component:()=>U(()=>import(`./D5vI1WU8.js`),__vite__mapDeps([201,1,3,69,36,2,4,5,6,7,8,9,10,71,21,18,19,20,22,24,72,25,73,29,74,63,31,32,17,33,37,35,34,176,149,107,99,58,144,76,53,55,178]),import.meta.url)},{name:`settings`,path:`/settings`,meta:{...qo||{},middleware:`auth`},alias:[`/ajustes`],component:()=>U(()=>import(`./Cyc-UeE2.js`),__vite__mapDeps([202,1,3,4,69,5,36,6,2,7,8,9,10,21,18,19,203,20,22,41,24,25,37,31,32,17,35,33,50,80,39,16,40,81,27,44,74,83,43,45,23,73,29,71,72,63,57,51,144,76,169,47,108,55,95,111,112,170,177,196,146,54,158,204]),import.meta.url)},{name:`terms`,path:`/terms`,meta:Jo||{},alias:[`/terminos`],component:()=>U(()=>import(`./gQ8TpCQE.js`),__vite__mapDeps([205,1,69,9,35,36,3,21,18,22,76,55,195,2,4,5,6,7,8,10,57,144,196,146,54,197]),import.meta.url)},{name:`index`,path:`/`,meta:Yo||{},component:()=>U(()=>import(`./RU7LEE3W.js`),__vite__mapDeps([206,1,3,4,69,5,36,6,2,7,8,9,10,70,123,105,106,17,21,107,114,79,124,19,18,135,207,16,20,22,133,134,27,43,39,40,41,25,23,24,47,152,94,28,29,74,91,48,49,52,31,32,35,33,37,208,57,38,42,44,45,46,26,50,51,209,34,176,149,99,167,81,154,153,58,172,144,145,181,161,139,162,125,76,210,108,211,80,182,54,55,77,138,140,141,185,163,128,129,71,72,73,63,130,131,132,136,137,53,193,164,212]),import.meta.url)}];function Zo(e,t,n){let{pathname:r,search:a,hash:o}=t,s=e.indexOf(`#`);if(s>-1){let t=o.includes(e.slice(s))?e.slice(s).length:1,n=o.slice(t);return n[0]!==`/`&&(n=`/`+n),i(n,``)}let c=i(r,e),l=!n||et(c,n)?c:n;return l+(l.includes(`?`)?``:a)+o}var Qo=E({name:`nuxt:router`,enforce:`pre`,async setup(e){let t,r,i=se().app.baseURL,a=An.history?.(i)??ta(i),o=An.routes?([t,r]=n(()=>An.routes(Xo)),t=await t,r(),t??Xo):Xo,s,c=Na({...An,scrollBehavior:(e,t,n)=>{if(t===Vt){s=n;return}if(An.scrollBehavior){if(c.options.scrollBehavior=An.scrollBehavior,`scrollRestoration`in window.history){let e=c.beforeEach(()=>{e(),window.history.scrollRestoration=`manual`})}return An.scrollBehavior(e,Vt,s||n)}},history:a,routes:o});`scrollRestoration`in window.history&&(window.history.scrollRestoration=`auto`),e.vueApp.use(c);let l=$e(c.currentRoute.value);c.afterEach((e,t)=>{l.value=t}),Object.defineProperty(e.vueApp.config.globalProperties,"previousRoute",{get:()=>l.value});let u=Zo(i,window.location,e.payload.path),d=$e(c.currentRoute.value),f=()=>{d.value=c.currentRoute.value};c.afterEach((e,t)=>{let n=e.matched.at(-1)?.components?.default,r=t.matched.at(-1)?.components?.default;if(n===r){$a({route:e,Component:{type:n}})===$a({route:t,Component:{type:r}})&&f();return}e.matched.length<t.matched.length&&e.matched.every((e,n)=>e.components?.default===t.matched[n]?.components?.default)&&f()});let p={sync:f};for(let e in d.value)Object.defineProperty(p,e,{get:()=>d.value[e],enumerable:!0});e._route=tt(p),e._middleware||={global:[],named:{}};let m=Ve();c.afterEach(async(t,n,r)=>{delete e._processingMiddleware,!e.isHydrating&&m.value&&await e.runWithContext(Be),r&&await e.callHook(`page:loading:end`)});try{[t,r]=n(()=>c.isReady()),await t,r()}catch(i){[t,r]=n(()=>Fe(e,i)),await t,r()}let h=u===c.currentRoute.value.fullPath?c.currentRoute.value:c.resolve(u),g=c.currentRoute.value.fullPath,_=e.isHydrating&&e.payload.prerenderedAt&&e.payload.path&&u!==e.payload.path&&et(c.currentRoute.value.path,e.payload.path);f();function v(t){!e.isHydrating&&t.fullPath!==Zo(i,window.location)&&a.push(t.fullPath)}let y=e.payload.state._layout;return c.beforeEach(async(t,n)=>{await e.callHook(`page:loading:start`),t.meta=Ce(t.meta),e.isHydrating&&y&&!Me(t.meta.layout)&&(t.meta.layout=y),e._processingMiddleware=!0;{let r=new Set([...no,...e._middleware.global]);for(let e of t.matched){let t=e.meta.middleware;if(t)for(let e of to(t))r.add(e)}let i=wn({path:t.path});if(i.appMiddleware)for(let e in i.appMiddleware)i.appMiddleware[e]?r.add(e):r.delete(e);for(let i of r){let r=typeof i==`string`?e._middleware.named[i]||await ro[i]?.().then(e=>e.default||e):i;if(!r)throw b.NUXT_E2004({entry:String(i),validMiddleware:void 0});try{let i=await e.runWithContext(()=>r(t,n));if(!e.payload.serverRendered&&e.isHydrating&&(i===!1||i instanceof Error)){let t=i||Te({status:404,statusText:`Page Not Found: ${u}`});return await e.runWithContext(()=>Ie(t)),!1}if(i===!0)continue;if(i===!1)return i;if(i)return me(i)&&i.fatal&&(await e.runWithContext(()=>Ie(i)),v(t)),i}catch(n){let r=Te(n);return r.fatal&&(await e.runWithContext(()=>Ie(r)),v(t)),r}}}}),c.onError(async()=>{delete e._processingMiddleware,await e.callHook(`page:loading:end`)}),c.afterEach(t=>{if(t.matched.length===0&&!m.value)return e.runWithContext(()=>
2Ie(Te({status:404,fatal:!1,statusText:`Page not found: ${t.fullPath}`,data:{path:t.fullPath}})))}),e.hooks.hookOnce(`app:created`,async()=>{try{if(`name`in h&&(h.name=void 0),c.currentRoute.value.fullPath===g){if(_){let t=c.resolve(e.payload.path);`name`in t&&(t.name=void 0),await c.replace({...t,force:!0});let n=()=>{e[`~restoreDeferredRoute`]&&(e[`~restoreDeferredRoute`]=void 0,c.currentRoute.value=c.resolve(u),f(),c.replace({...h,force:!0}).catch(()=>{}))};e[`~restoreDeferredRoute`]=n,e.hooks.hookOnce(`app:suspense:resolve`,n)}else await c.replace({...h,force:!0})}c.options.scrollBehavior=An.scrollBehavior}catch(t){await Fe(e,t)}}),{provide:{router:c}}}},1),$o={system:-15,vendor:-5,nitro:-4,config:-3,i18n:-2,build:-1,runtime:0};function es(e){return typeof e==`function`?e():e&&e.__v_isRef===!0?e.value:e}function ts(e){e.indexable!==void 0&&(e.indexable=String(e.indexable)!==`false`),e.trailingSlash!==void 0&&!e.trailingSlash&&(e.trailingSlash=String(e.trailingSlash)!==`false`),e.url&&!Je(String(e.url),{acceptRelative:!0,strict:!1})&&(e.url=s(String(e.url)));let t=Object.keys(e).sort((e,t)=>e.localeCompare(t)),n={};for(let r of t)n[r]=e[r];return n}function ns(e){let t=e?.debug||!1,n=[];function r(e){if(!e||typeof e!=`object`||Object.keys(e).length===0)return()=>{};if(!e._context&&t){let t=Error(`tmp`).stack?.split(` 3`)[2]?.split(` `)[5];t?.includes(`/`)&&(t=`anonymous`),e._context=t}let r={};for(let t in e){let n=e[t];n!==void 0&&n!==``&&(r[t]=n)}return Object.keys(r).some(e=>!e.startsWith(`_`))?(n.push(r),()=>{let e=n.indexOf(r);e!==-1&&n.splice(e,1)}):()=>{}}function i(e){let t={};e?.debug&&(t._context={}),t._priority={};for(let r in n.sort((e,t)=>(e._priority||0)-(t._priority||0)))for(let i in n[r]){let a=i,o=e?.resolveRefs?es(n[r][i]):n[r][i];!i.startsWith(`_`)&&o!==void 0&&o!==``&&(t[i]=o,n[r]._priority!==void 0&&n[r]._priority!==-1&&(t._priority[a]=n[r]._priority),e?.debug&&(t._context[a]=n[r]._context?.[a]||n[r]._context||`anonymous`))}return e?.skipNormalize?t:ts(t)}return{stack:n,push:r,get:i}}
3var rs=E({name:`nuxt-site-config:init`,enforce:`pre`,async setup(e){let t=ns(),n=xn(`site-config`);{let e=n.value||window.__NUXT_SITE_CONFIG__||{};for(let n in e)n[0]!==`_`&&t.push({[n]:e[n],_priority:e._priority?.[n]||-1})}return{provide:{nuxtSiteConfig:t}}}}),is=Symbol.for(`@supabase/supabase-js.traceContextExtractor`);function as(){return globalThis[is]}function os(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 ss(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 cs=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),ls=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}}},us=class extends ls{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},ds=class extends ls{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},fs=class extends ls{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},ps;(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`})(ps||={});var ms=class{constructor(e,{headers:t={},customFetch:n,region:r=ps.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=cs(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return ss(this,arguments,void 0,function*(e,t={}){var n;let r,i,a;try{let{headers:n,method:o,body:s,signal:c,timeout:l}=t,u={},{region:d}=t;d||=this.region;let f=new URL(`${this.url}/${e}`);d&&d!==`any`&&(u[`x-region`]=d,f.searchParams.set(`forceFunctionRegion`,d));let p,m=!!n&&Object.keys(n).some(e=>e.toLowerCase()===`content-type`);s&&!m?typeof Blob<`u`&&s instanceof Blob||s instanceof ArrayBuffer?(u[`Content-Type`]=`application/octet-stream`,p=s):typeof s==`string`?(u[`Content-Type`]=`text/plain`,p=s):typeof FormData<`u`&&s instanceof FormData?p=s:(u[`Content-Type`]=`application/json`,p=JSON.stringify(s)):p=s&&typeof s!=`string`&&!(typeof Blob<`u`&&s instanceof Blob)&&!(s instanceof ArrayBuffer)&&!(typeof FormData<`u`&&s instanceof FormData)?JSON.stringify(s):s;let h=c;l&&(i=new AbortController,r=setTimeout(()=>i.abort(),l),c?(h=i.signal,a=()=>i.abort(),c.addEventListener(`abort`,a)):h=i.signal);let g=yield this.fetch(f.toString(),{method:o||`POST`,headers:Object.assign(Object.assign(Object.assign({},u),this.headers),n),body:p,signal:h}).catch(e=>{throw new us(e)}),_=g.headers.get(`x-relay-error`);if(_&&_===`true`)throw new ds(g);if(!g.ok)throw new fs(g);let v=(g.headers.get(`Content-Type`)??`text/plain`).split(`;`)[0].trim().toLowerCase(),y;return y=v===`application/json`?yield g.json():v===`application/octet-stream`||v===`application/pdf`?yield g.blob():v===`text/event-stream`?g:v===`multipart/form-data`?yield g.formData():yield g.text(),{data:y,error:null,response:g}}catch(e){return{data:null,error:e,response:e instanceof fs||e instanceof ds?e.context:void 0}}finally{r&&clearTimeout(r),a&&((n=t.signal)==null||n.removeEventListener(`abort`,a))}})}},hs=class extends Error{constructor(e){super(e.message),this.name=`PostgrestError`,this.details=e.details,this.hint=e.hint,this.co
vendor: 42,272 bytes, lines 3-4
3de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}},gs=3,_s=e=>Math.min(1e3*2**e,3e4),vs=[520,503],ys=[`GET`,`HEAD`,`OPTIONS`];function bs(e){"@babel/helpers - typeof";return bs=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},bs(e)}function xs(e,t){if(bs(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(bs(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ss(e){var t=xs(e,`string`);return bs(t)==`symbol`?t:t+``}function Cs(e,t,n){return(t=Ss(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ws(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 Ts(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ws(Object(n),!0).forEach(function(t){Cs(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ws(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Es(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 Ds(e,t,n,r){return!(!r||n>=gs||!ys.includes(e)||!vs.includes(t))}async function Os(e,t,n,r){let i=0;for(;;){let a=Ts({},n.headers);i>0&&(a[`X-Retry-Count`]=String(i));let o;try{o=await e(t,{method:n.method,headers:a,body:n.body,signal:n.signal})}catch(e){if(e?.name===`AbortError`||e?.code===`ABORT_ERR`||!ys.includes(n.method))throw e;if(r&&i<gs){let e=_s(i);i++,await Es(e,n.signal);continue}throw e}if(Ds(n.method,o.status,i,r)){let e=o.headers?.get(`Retry-After`)??null,t=e===null?_s(i):Math.max(0,parseInt(e,10)||0)*1e3;await o.text(),i++,await Es(t,n.signal);continue}return o}}var ks=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,this.fetch=e.fetch?e.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={};n.headers.forEach((t,n)=>{e[n]=t});let t=await Os(r,n.url.toString(),{method:n.method,headers:e,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal},n.retryEnabled);return await n.processResponse(t)})();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 hs({message:i,details:``,hint:``,code:``})}}}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);if(s&&c&&c.length>1&&(i=parseInt(c[1])),t.isMaybeSingle&&Array.isArray(r)){if(r.length>1){if(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`,t.shouldThrowOnError)throw new hs(Ts(Ts({},n),{},{hint:n.hint??``}))}else 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`)}catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new hs(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},As=class extends ks{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}},js=RegExp(`[,()]`),Ms=class extends As{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`&&js.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`&&js.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}},Ns=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 Ms({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 Ms({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 Ms({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 Ms({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 Ms({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Ps(e,t){try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return new hs({message:String(t.message??e),details:t.details??``,hint:t.hint??``,code:t.code??``})}catch{}return new hs({message:e||t,details:``,hint:``,code:``})}function Fs(e,t,n){let r=e;return{success:!1,error:new hs({message:`${r?.name??`FetchError`}: ${r?.message}`,details:``,hint:``,code:``}),data:null,count:null,status:t,statusText:n}}var Is=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;this.fetch=i!==void 0&&i>0?(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,Ts(Ts({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,Ts(Ts({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}: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 Ns(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})}async getOpenApiSpec(){var e=this;let t=new Headers(e.headers);t.set(`Accept`,`application/openapi+json`),e.schemaName&&t.set(`Accept-Profile`,e.schemaName);let n={};t.forEach((e,t)=>{n[t]=e});let r=e.fetch??globalThis.fetch,i;try{i=await Os(r,`${e.url}/`,{method:`GET`,headers:n},e.retry??!0)}catch(e){return Fs(e,0,``)}let a;try{a=await i.text()}catch(e){return Fs(e,i.status,i.statusText)}if(i.ok)try{return{success:!0,error:null,data:JSON.parse(a),count:null,status:i.status,statusText:i.statusText}}catch{}return{success:!1,error:Ps(a,i.statusText),data:null,count:null,status:i.status,statusText:i.statusText}}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 Ms({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},Ls=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}}},Rs=`realtime-js/2.115.0`,zs=`1.0.0`,Bs=`2.0.0`,Vs=Bs,Hs=1e4,Us=15e3,Ws=1e4,Gs={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},Ks={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},qs={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},Js=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 Ys=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=Xs(i,e,t,r),n),{}):{}},Xs=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?Zs(i,a):Qs(a)},Zs=(e,t)=>{if(e.charAt(0)===`_`)return nc(t,e.slice(1,e.length));switch(e){case W.bool:return $s(t);case W.float4:case W.float8:case W.int2:case W.int4:case W.int8:case W.numeric:case W.oid:return ec(t);case W.json:case W.jsonb:return tc(t);case W.timestamp:return rc(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 Qs(t);default:return Qs(t)}},Qs=e=>e,$s=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},ec=e=>{if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},tc=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},nc=(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=>Zs(t,e))}return e},rc=e=>typeof e==`string`?e.replace(` `,`T`):e,ic=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},ac=e=>typeof e==`function`?e:function(){return e},oc=typeof self<`u`?self:null,sc=typeof window<`u`?window:null,cc=oc||sc||globalThis,lc=`2.0.0`,uc=1e4,dc=1e3,fc=100,pc={connecting:0,open:1,closing:2,closed:3},G={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},mc={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},hc={longpoll:`longpoll`,websocket:`websocket`},gc={complete:4},_c=`base64url.bearer.phx.`,vc=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})}},yc=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))}},bc=class{constructor(e,t,n){this.state=G.closed,this.topic=e,this.params=ac(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new vc(this,mc.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new yc(()=>{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 vc(this,mc.leave,ac({}),this.timeout).send(),this.state=G.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(mc.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(mc.close,e)}onError(e){return this.on(mc.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 vc(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(mc.close,`leave`)},n=new vc(this,mc.leave,ac({}),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}},xc=class{static request(e,t,n,r,i,a,o){if(cc.XDomainRequest){let n=new cc.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,a,o)}if(cc.XMLHttpRequest){let s=new cc.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,i,a,o)}if(cc.fetch&&cc.AbortController)return this.fetchRequest(e,t,n,r,i,a,o);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),cc.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===gc.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)}`}},Sc=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)},Cc=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(_c)&&(this.authToken=atob(t[1].slice(_c.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=pc.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+hc.websocket),`$1/`+hc.longpoll)}endpointURL(){return xc.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=pc.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===pc.open||this.readyState===pc.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=pc.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=Sc(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+fc,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=pc.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=xc.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)}},wc=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))}},Tc={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:mc.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)}}},Ec=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||uc,this.transport=t.transport||cc.WebSocket||Cc,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=cc&&cc.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Tc.encode.bind(Tc),this.defaultDecoder=Tc.decode.bind(Tc),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===Cc?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let r=null;sc&&sc.addEventListener&&(sc.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),sc.addEventListener(`pageshow`,e=>{r===this.connectClock&&(r=null,this.connect())}),sc.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=ac(t.params||{}),this.endPoint=`${e}/${hc.websocket}`,this.vsn=t.vsn||lc,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new yc(()=>{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&&ac(t.authToken)}getLongPollTransport(){return Cc}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=xc.appendParams(xc.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=ac(e)),(!this.conn||this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Cc?this.connectWithF
vendor: 4,375 bytes, line 4
4allback(Cc,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 Cc:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${_c}${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,o=this.transportName(e),s=t=>{this.log(`transport`,`falling back to ${o}...`,t),this.off([i,a]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return s(`memorized`);this.fallbackTimer=setTimeout(s,t),a=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),s(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(s,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(),dc,`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===pc.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)}
vendor: 11,846 bytes, line 4
4triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(mc.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case pc.connecting:return`connecting`;case pc.open:return`open`;case pc.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 bc(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 this.ref=e===this.ref?0: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())}},Dc=class e{constructor(t,n){let r=Ac(n);this.presence=new wc(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=kc(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=Oc(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:jc(t),newPresences:Oc(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:jc(t),leftPresences:Oc(n)}}};function Oc(e){return e.metas.map(e=>{let t=Object.getOwnPropertyDescriptors(e),n=Object.defineProperties({},t);return n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n})}function kc(e){return JSON.parse(JSON.stringify(e))}function Ac(e){return e?.events&&{events:e.events}}function jc(e){return e?.metas?Oc(e):[]}var Mc;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(Mc||={});var Nc=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new Dc(this.channel.channelAdapter,t)}};function Pc(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 Fc=class{constructor(e,t,n){let r=Ic(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===Gs.joined}isJoined(){return this.state===Gs.joined}isJoining(){return this.state===Gs.joining}isClosed(){return this.state===Gs.closed}isLeaving(){return this.state===Gs.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function Ic(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var Lc=/[,()"\\]/,Rc=e=>Lc.test(e)||e!==e.trim(),zc=e=>`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`,Bc=e=>{let t=e===null?`null`:String(e);return Rc(t)?zc(t):t},Vc=e=>e===null?`null`:String(e),Hc=(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=>Bc(e)).join(`,`)})`}return e===`is`?`is.${Vc(t)}`:`${e}.${Bc(t)}`},Uc=class{constructor(){this.filters=[]}add(e,t,n,r=!1){let i=r?`not.`:``;return this.filters.push(`${e}=${i}${Hc(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()}},Wc;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(Wc||={});var Gc;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(Gc||={});var Kc;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(Kc||={});var qc=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 Fc(this.socket.socketAdapter,e,this.params),this.presence=new Nc(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=ic(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,postgres_changes_options:a}}=this.params,o=this.bindings.postgres_changes?.map(e=>e.filter)??[],s=!!this.bindings[Gc.PRESENCE]&&this.bindings[Gc.PRESENCE].length>0||this.params.config.presence?.enabled===!0,c={},l=Object.assign({broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:s}),postgres_changes:o,private:i},a?{postgres_changes_options:a}:{});this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(Kc.CHANNEL_ERROR,Pc(t))}),this._onClose(()=>e?.(Kc.CLOSED)),this.updateJoinPayload(Object.assign({config:l},c)),this._updateFilterMessage();let u=a?.wait&&o.length>0?Math.max(t,(a.timeout??Us)+Ws):t;this.channelAdapter.subscribe(u).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(Kc.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=Gs.errored;let n=Object.values(t).join(`, `)||`error`;e?.(Kc.CHANNEL_ERROR,Error(n,{cause:t}))}).receive(`timeout`,()=>{e?.(Kc.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=Gs.errored,n?.(Kc.CHANNEL_ERROR,Error(`mismatch between server and client bindings for postgres changes`));return}}this.bindings.postgres_changes=a,this.state!=Gs.errored&&n&&n(Kc.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===Gc.PRESENCE||e===Gc.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`){let n=`Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.`;this.socket.hasLogger()?this.socket.log(`channel`,n):console.warn(n);let{event:r,payload:i}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":`application/json`};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);let o={method:`POST`,headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:r,payload:i,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,o,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`}}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(t,n,r){let i=t.toLocaleLowerCase(),a=n?.filter;if((a instanceof Uc||typeof a==`object`&&a&&typeof a.build==`function`)&&(n=Object.assign(Object.assign({},n),{filter:a.build()})),i===Gc.POSTGRES_CHANGES&&this.bindings[i]?.find(t=>e.isSamePostgresFilter(t.filter,n)))return this.socket.log(`error`,`duplicate \`postgres_changes\` binding for ${this.topic} ignored`,n),this;let o=this.channelAdapter.on(t,r),s={type:i,filter:n,callback:r,ref:o};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],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())}{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}}return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=Ks;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)}static isSamePostgresFilter(t,n){let r=(t?.select)?.join()??void 0,i=(n?.select)?.join()??void 0;return t?.event===n?.event&&e.isFilterValueEqual(t?.schema,n?.schema)&&e.isFilterValueEqual(t?.table,n?.table)&&e.isFilterValueEqual(t?.filter,n?.filter)&&r===i}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=Ys(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=Ys(e.columns,e.old_record)),t}},Jc=class{constructor(e,t){this.socket=new Ec(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)}hasLogger(){return this.socket.hasLogger()}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()==qs.connecting}isDisconnecting(){return this.socket.connectionState()==qs.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},Yc={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Xc=[1e3,2e3,5e3,1e4],Zc=1e4;function Qc(){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 $c(){try{if(typeof globalThis<`u`&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return Qc()}var el=` 5 addEventListener("message", (e) => { 6 if (e.data.event === "start") { 7 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 8 } 9 });`,tl=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 Js,this._manuallySetToken=!1,this._authPromise=null,this._authGeneration=0,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 Jc(e,n),this.httpEndpoint=ic(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)}hasLogger(){return this.socketAdapter.hasLogger()}connectionState(){return this.socketAdapter.connectionState()||qs.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 qc(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){let t=++this._authGeneration,n=this._performAuth(e,t);t===this._authGeneration&&(this._authPromise=n);try{await n}finally{this._authPromise===n&&(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,t){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),n=this.accessTokenValue}else n=this.accessTokenValue;t===this._authGeneration&&(this.accessToken?this._manuallySetToken=!1:r&&(this._manuallySetToken=!0),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(e=>{let t={access_token:n,version:Rs};e.updateJoinPayload(t),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(Ks.access_token,{access_token:n})})))}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([el],{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??Hs,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??Yc.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=e?.disconnectOnEmptyChannelsAfterMs??2*(e?.heartbeatIntervalMs??Yc.HEARTBEAT_INTERVAL),t.transport=e?.transport??Ls.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.sessionStorage=e?.sessionStorage??$c(),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>Xc[e-1]||Zc);let n,r,i=e?.vsn??Vs;switch(i){case zs:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case Bs: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,nl=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 rl(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 il(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 al(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=rl(e.baseUrl,r,i),c=await il(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 nl(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 ol(e){return e.join(`�`)}var sl=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:ol(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/${ol(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${ol(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${ol(e.namespace)}`}),!0}catch(e){if(e instanceof nl&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof nl&&e.status===409)return;throw e}}};function cl(e){return e.join(`�`)}var ll=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/${cl(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/${cl(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/${cl(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/${cl(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/${cl(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/${cl(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof nl&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof nl&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},ul=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`);let n=e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`;this.client=al({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new sl(this.client,t),this.tableOps=new ll(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 dl(e){"@babel/helpers - typeof";return dl=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},dl(e)}function fl(e,t){if(dl(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(dl(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function pl(e){var t=fl(e,`string`);return dl(t)==`symbol`?t:t+``}function ml(e,t,n){return(t=pl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hl(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?hl(Object(n),!0).forEach(function(t){ml(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gl=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 _l(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var vl=class extends gl{constructor(e,t,n,r=`storage`,i){super(e,r,t,n),this.name=r===`vectors`?`StorageVectorsApiError`:`StorageApiError`,this.status=t,this.statusCode=n,this.code=i}toJSON(){return K(K({},super.toJSON()),{},{code:this.code})}},yl=class extends gl{constructor(e,t,n=`storage`){super(e,n),this.name=n===`vectors`?`StorageVectorsUnknownError`:`StorageUnknownError`,this.originalError=t}};function bl(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 xl(e){let t={};for(let[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}var Sl=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Cl=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)},wl=e=>{if(Array.isArray(e))return e.map(e=>wl(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]=wl(n)}),t},Tl=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),El=e=>e.split(`/`).map(encodeURIComponent).join(`/`),Dl=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)},Ol=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 vl(Dl(e),i,n,r,e?.code))}).catch(()=>{let e=i+``;t(new vl(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new yl(Dl(e),e,r))},kl=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return K(K({},i),n);if(Cl(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=bl(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 Al(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,kl(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=>Ol(e,c,r,o))})}function jl(e=`storage`){return{get:async(t,n,r,i)=>Al(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>Al(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>Al(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>Al(t,`HEAD`,n,K(K({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>Al(t,`DELETE`,n,i,a,r,e)}}var{get:Ml,post:Nl,put:Pl,head:Fl,remove:Il}=jl(`storage`),Ll=jl(`vectors`),Rl=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=xl(t),this.fetch=Sl(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=bl(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(_l(e))return{data:null,error:e};throw e}}},zl=Symbol.toStringTag,Bl=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[zl]=`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(_l(t))return{data:null,error:t};throw t}}},Vl=Symbol.toStringTag,Hl=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Vl]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new Bl(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(_l(t))return{data:null,error:t};throw t}}},Ul={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},Wl={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},Gl=class extends Rl{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({},Wl),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=bl(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?Pl:Nl)(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({},Wl),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=bl(o,e,t);return{path:a,fullPath:(await Pl(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 Nl(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 gl(`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 Nl(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
9stinationBucket:n?.destinationBucket,sourceVersionId:n?.sourceVersionId},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Nl(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket,sourceVersionId:n?.sourceVersionId},{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 Nl(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 Nl(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)),t?.versionId!=null&&i.set(`versionId`,String(t.versionId));let a=i.toString(),o=this._getFinalPath(e);return new Hl(()=>Ml(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e,t){var n=this;let r=n._getFinalPath(e),i=new URLSearchParams;t?.versionId!=null&&i.set(`versionId`,String(t.versionId));let a=i.toString();return n.handleOperation(async()=>wl(await Ml(n.fetch,`${n.url}/object/info/${r}${a?`?${a}`:``}`,{headers:n.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await Fl(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(_l(e)){let t=e instanceof vl?e.status:e instanceof yl?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 Il(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=El(r._getFinalPath(e)),a=new URLSearchParams;t?.transformations&&a.set(`transformations`,`true`);let o=a.toString();return await Il(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({},Ul.sortBy),t.sortBy):Ul.sortBy,a=K(K(K({},Ul),t),{},{sortBy:i,prefix:e||``});return await Nl(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 Nl(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}},Kl={"X-Client-Info":`storage-js/2.115.0`},ql=class extends Rl{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({},Kl),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await Ml(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Ml(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Nl(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,versioning_status:t.ver
9sioningStatus},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Pl(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes,versioning_status:t.versioningStatus},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Nl(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Il(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 Il(r.fetch,`${r.url}/cdn/${El(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>0?`?`+new URLSearchParams(t).toString():``}},Jl=class extends Rl{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=K(K({},Kl),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Nl(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 Ml(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Il(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!Tl(e))throw new gl(`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 ul({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}})}},Yl=class extends Rl{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=K(K({},Kl),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await Ll.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Ll.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Ll.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Ll.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},Xl=class extends Rl{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=K(K({},Kl),{},{"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 Ll.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Ll.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 Ll.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Ll.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 Ll.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Zl=class extends Rl{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=K(K({},Kl),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ll.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Ll.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Ll.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ll.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Ql=class extends Zl{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new $l(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)}},$l=class extends Yl{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}))}
9async 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 eu(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},eu=class extends Xl{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}))}},tu=class extends ql{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Gl(this.url,this.headers,e,this.fetch)}get vectors(){return new Ql(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new Jl(this.url+`/iceberg`,this.headers,this.fetch)}},nu=`2.115.0`,ru=3e4,iu=3*ru,au=2*ru,ou=`http://localhost:9999`,su=`supabase.auth.token`,cu={"X-Client-Info":`gotrue-js/${nu}`},lu=`X-Supabase-Api-Version`,uu={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},du=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,fu=`sb_flow_id`,pu=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 mu=class extends pu{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function hu(e){return q(e)&&e.name===`AuthApiError`}var gu=class extends pu{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},_u=class extends pu{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},J=class extends _u{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function vu(e){return q(e)&&e.name===`AuthSessionMissingError`}var yu=class extends _u{constructor(){super(`Auth session or user missing`,`AuthInvalidToken
9ResponseError`,500,void 0)}},bu=class extends _u{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},xu=class extends _u{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 Su(e){return q(e)&&e.name===`AuthImplicitGrantRedirectError`}var Cu=class extends _u{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})}},wu=class extends _u{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`)}},Tu=class extends _u{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function Eu(e){return q(e)&&e.name===`AuthRetryableFetchError`}var Du=class extends _u{constructor(e=`Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)`){super(e,`AuthRefreshDiscardedError`,409,void 0)}};function Ou(e){return q(e)&&e.name===`AuthRefreshDiscardedError`}var ku=class extends _u{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},Au=class extends _u{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},ju=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),Mu=` 10\r=`.split(``),Nu=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Mu.length;t+=1)e[Mu[t].charCodeAt(0)]=-2;for(let t=0;t<ju.length;t+=1)e[ju[t].charCodeAt(0)]=t;return e})();function Pu(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(ju[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(ju[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function Fu(e,t,n){let r=Nu[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 Iu(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{zu(e,r,n)};for(let t=0;t<e.length;t+=1)Fu(e.charCodeAt(t),i,a);return t.join(``)}function Lu(e,t){if(e<=127){t(e);return}if(e<=2047){t(192|e>>6),t(128|e&63);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}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 Ru(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}Lu(r,t)}}function zu(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 Bu(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)Fu(e.charCodeAt(t),n,r);return new Uint8Array(t)}function Vu(e){let t=[];return Ru(e,e=>t.push(e)),new Uint8Array(t)}function Hu(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>Pu(e,n,r)),Pu(null,n,r),t.join(``)}function Uu(e){return Math.round(Date.now()/1e3)+e}function Wu(){return Symbol(`auth-callback`)}var Y=()=>typeof window<`u`&&typeof document<`u`,Gu={tested:!1,writable:!1},Ku=()=>{if(!Y())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(Gu.tested)return Gu.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Gu.tested=!0,Gu.writable=!0}catch{Gu.tested=!0,Gu.writable=!1}return Gu.writable};function qu(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEac
10h((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var Ju=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Yu=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,Xu=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},X=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},Zu=async(e,t)=>{await e.removeItem(t)},Qu=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};Qu.promiseConstructor=Promise;function $u(e){let t=e.split(`.`);if(t.length!==3)throw new Au(`Invalid JWT structure`);for(let e=0;e<t.length;e++)if(!du.test(t[e]))throw new Au(`JWT not in base64url format`);return{header:JSON.parse(Iu(t[0])),payload:JSON.parse(Iu(t[1])),signature:Bu(t[2]),raw:{header:t[0],payload:t[1]}}}async function ed(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function td(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 nd(e){return(`0`+e.toString(16)).substr(-2)}function rd(){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,nd).join(``)}async function id(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 ad(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 id(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var od=/^[a-zA-Z0-9_-]{8,64}$/;function sd(e){return typeof e==`string`&&od.test(e)?e:null}function cd(){if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,nd).join(``)}let e=``;for(let t=0;t<32;t++)e+=Math.floor(Math.random()*16).toString(16);return e}var ld=(e,t)=>`${e}-flow-${t}-code-verifier`,ud=e=>`${e}-flows-code-verifier`;async function dd(e,t){let n=await X(e,ud(t));return Array.isArray(n)?n.filter(e=>sd(e)!==null):[]}async function fd(e,t,n,r,i){await Xu(e,ld(t,n),r);let a=(await dd(e,t)).filter(e=>e!==n);for(a.push(n);a.length>5;){let n=a.shift();await Zu(e,ld(t,n)),i?.(n)}await Xu(e,ud(t),a),await Xu(e,`${t}-code-verifier`,r)}async function pd(e,t,n){if(n){let r=await X(e,ld(t,n));return{verifier:typeof r==`string`?r:null,flowId:n}}let r=await X(e,`${t}-code-verifier`);return{verifier:typeof r==`string`?r:null,flowId:null}}async function md(e,t,n){let r=`${t}-code-verifier`;if(!n){await Zu(e,r);return}let i=ld(t,n),a=await X(e,i);await Zu(e,i);let o=await dd(e,t),s=o.filter(e=>e!==n);s.length!==o.length&&(s.length>0?await Xu(e,ud(t),s):await Zu(e,ud(t))),a!=null&&a===await X(e,r)&&await Zu(e,r)}async function hd(e,t){let n=await dd(e,t);for(let r of n)await Zu(e,ld(t,r));await Zu(e,ud(t)),await Zu(e,`${t}-code-verifier`)}function gd(e,t){let n=e.indexOf(`#`),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n),a=r.indexOf(`?`);if(a!==-1){let e=r.slice(0,a),t=r.slice(a+1).split(`&`).filter(e=>e!==``&&e!==`sb_flow_id`&&!e.startsWith(`sb_flow_id=`));r=t.length>0?`${e}?${t.join(`&`)}`:e}let o=r.includes(`?`)?`&`:`?`;return`${r}${o}${fu}=${encodeURIComponent(t)}${i}`}async function _d(e,t,n=!1,r){let i=rd(),a=i;n&&(a+=`/recovery`);let o=cd();await fd(e,t,o,a,r);let s=await ad(i);return[s,i===s?`plain`:`s256`,o]}var vd=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function yd(e){let t=e.headers.get(lu);if(!t||!t.match(vd))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function bd(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function xd(e){switch(e){case`RS256`:return{name:`RSASSA-PKCS1-v1_5`,hash:{name:`
10SHA-256`}};case`ES256`:return{name:`ECDSA`,namedCurve:`P-256`,hash:{name:`SHA-256`}};default:throw Error(`Invalid alg claim`)}}var Sd=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Cd(e){if(!Sd.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function wd(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 Td(){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 Ed(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;if(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 Dd(e){return JSON.parse(JSON.stringify(e))}var Od=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)},kd=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Ad(e){if(!Yu(e))throw new Tu(Od(e),0);let t;try{t=await e.json()}catch(t){throw kd.includes(e.status)?new Tu(e.statusText||`HTTP ${e.status}`,e.status):new gu(Od(t),t)}if(kd.includes(e.status))throw new Tu(Od(t),e.status);let n,r=yd(e);if(r&&r.getTime()>=uu[`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 ku(Od(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new ku(Od(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new J;throw new mu(Od(t),e.status||500,n)}var jd=(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[lu]=uu[`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 Md(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 Md(e,t,n,r,i,a){let o=jd(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw new Tu(Od(e),0)}if(s.ok||await Ad(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await Ad(e)}}function Nd(e){let t=null;zd(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=Uu(e.expires_in)));
10let n=e.user??(typeof e?.id==`string`?e:null);return{data:{session:t,user:n},error:null}}function Pd(e){let t=Nd(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 Fd(e){return{data:{user:e.user??e},error:null}}function Id(e){return{data:e,error:null}}function Ld(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=os(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 Rd(e){return e}function zd(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var Bd=[`global`,`local`,`others`],Vd=class{constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=Ju(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=Bd[0]){if(Bd.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${Bd.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:Fd})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=os(e,[`options`]),r=Object.assign(Object.assign({},n),t);return`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:Ld,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:Fd})}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:Rd});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){Cd(e);try{return await Z(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Fd})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){Cd(e);try{return await Z(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:Fd})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){Cd(e);try{return await Z(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:Fd})}catch(e){if(q(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){Cd(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){Cd(e.userId),Cd(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:Rd});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>
100&&(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){wd(this.experimental),Cd(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){wd(this.experimental),Cd(e.userId),Cd(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 Hd(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&Ku()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`);var Ud=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};function Wd(){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 Gd(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Kd(e){return parseInt(e,16)}function qd(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function Jd(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=Gd(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}`}
12var 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}}},Yd=class extends Q{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function Xd({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(!rf(t))return new Q({message:`${window.location.hostname} 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 Zd({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(!rf(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 Qd=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 $d(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=os(e,[`challenge`,`user`,`excludeCredentials`]),a=Bu(t).buffer,o=Object.assign(Object.assign({},n),{id:Bu(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:Bu(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return s}function ef(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=os(e,[`challenge`,`allowCredentials`]),i=Bu(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:Bu(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return a}function tf(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e;return{id:e.id,rawId:e.id,response:{attestationObject:Hu(new Uint8Array(e.response.attestationObject)),clientDataJSON:Hu(new Uint8Array(e.response.clientDataJSON))},type:`public-key`,clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment??void 0}}function nf(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:Hu(new Uint8Array(r.authenticatorData)),clientDataJSON:Hu(new Uint8Array(r.clientDataJSON)),signature:Hu(new Uint8Array(r.signature)),userHandle:r.userHandle?Hu(new Uint8Array(r.userHandle)):void 0},type:`public-key`,clientExtensionResults:n,authenticatorAttachment:t.authenticatorAttachment??void 0}}function rf(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function af(){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 of(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Yd(`Browser returned unexpected credential type`,t)}:{data:null,error:new Yd(`Empty credential response`,t)}}
12catch(t){return{data:null,error:Xd({error:t,options:e})}}}async function sf(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Yd(`Browser returned unexpected credential type`,t)}:{data:null,error:new Yd(`Empty credential response`,t)}}catch(t){return{data:null,error:Zd({error:t,options:e})}}}var cf={hints:[`security-key`],authenticatorSelection:{authenticatorAttachment:`cross-platform`,requireResidentKey:!1,userVerification:`preferred`,residentKey:`discouraged`},attestation:`direct`},lf={userVerification:`preferred`,hints:[`security-key`],attestation:`direct`};function uf(...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];r[e]=t(n)?uf(n,a):uf(a)}else r[e]=a}}return r}function df(e,t){return uf(cf,e,t||{})}function ff(e,t){return uf(lf,e,t||{})}var pf=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??Qd.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 of({publicKey:df(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=ff(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await sf(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 gu(`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 pu(`rpId is required for WebAuthn authentication`)};try{if(!af())return{data:null,error:new gu(`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 gu(`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 pu(`rpId is required for WebAuthn registration`)};try{if(!af())return{data:null,error:new gu(`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 gu(`Unexpected error in register`,e)}}}};Wd();var mf={url:ou,storageKey:su,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:cu,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},hf={},gf=!1,_f=class e{get jwks(){return hf[this.storageKey]?.jwks??{keys:[]}}set jwks(e){hf[this.storageKey]=Object.assign(Object.assign({},hf[this.storageKey]),{jwks:e})}get jwks_cached_at(){return hf[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){hf[this.storageKey]=Object.assign(Object.assign({},hf[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({},mf),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 Vd({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=Ju(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,gf||(gf=!0,console.warn(`${this._logPrefix()} The "lock" option is deprecated and will be removed in v3. The client now coordinates session refreshes without a lock, so most apps can drop the option. See https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/migrations/lockless-coordination.md`))),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 pf(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:Ku()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Hd(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=Hd(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} (${nu}) ${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=qu(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),Su(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 gu(`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:Nd});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){let t=null;try{let n;if(`email`in e){let{email:r,password:i,options:a}=e,o=null,s=null;this.flowType===`pkce`&&([o,s,t]=await this._getCodeChallengeAndMethod()),n=await Z(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(a?.emailRedirectTo,t),body:{email:r,password:i,data:a?.data??{},gotrue_meta_security:{captcha_token:a?.captchaToken}
12,code_challenge:o,code_challenge_method:s},xform:Nd})}else if(`phone`in e){let{phone:t,password:r,options:i}=e;n=await Z(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Nd})}else throw new bu(`You must provide either an email or phone number and a password`);let{data:r,error:i}=n;if(i||!r)return await md(this.storage,this.storageKey,t),this._returnResult({data:{user:null,session:null},error:i});let a=r.session,o=r.user;return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(await md(this.storage,this.storageKey,t),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:Pd})}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:Pd})}else throw new bu(`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 yu;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,t){return await this.initializePromise,this.lock==null?this._exchangeCodeForSession(e,t):this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e,t))}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=Gd(l[0]),d=o?.signInWithEthereum?.chainId;d||=Kd(await s.request({method:`eth_chainId`})),t=Jd({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:[qd(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:Nd});if(i)throw i;if(!r||!r.session||!r.user){let e=new yu;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:Hu(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Nd});if(i)throw i;if(!r||!r.session||!r.user){let e=new yu;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,t){let n=t?.flowId!=null,r=n?sd(t?.flowId):Y()?sd(qu(window.location.href)[fu]):null;n&&!r&&this._debug(`#_exchangeCodeForSession()`,`provided flowId is not a valid flow id`,t?.flowId);let{verifier:i,flowId:a}=n&&!r?{verifier:null,flowId:null}:await pd(this.storage,this.storageKey,r),[o,s]=(i??``).split(`/`);try{if(!o&&this.flowType===`pkce`)throw new wu;let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:o},xform:Nd});if(await md(this.storage,this.storageKey,a),n)throw n;if(!t||!t.session||!t.user){let e=new yu;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(s===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:s??null}),error:n})}catch(e){if(await md(this.storage,this.storageKey,a),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:Nd});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new yu;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){let t=null;try{if(`email`in e){let{email:n,options:r}=e,i=null,a=null;this.flowType===`pkce`&&([i,a,t]=await this._getCodeChallengeAndMethod());let{error:o}=await Z(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:n,data:r?.data??{},create_user:r?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:r?.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:this._maybeAppendFlowIdToRedirect(r?.emailRedirectTo,t)});return this._returnResult({data:{user:null,session:null},error:o})}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 bu(`You must provide either an email or phone number.`)}
13catch(e){if(await md(this.storage,this.storageKey,t),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:Nd});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){let t=null;try{let n=null,r=null;this.flowType===`pkce`&&([n,r,t]=await this._getCodeChallengeAndMethod());let i=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:this._maybeAppendFlowIdToRedirect(e.options?.redirectTo,t)}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:n,code_challenge_method:r}),headers:this.headers,xform:Id});return i.data?.url&&Y()&&!e.options?.skipBrowserRedirect&&window.location.assign(i.data.url),this._returnResult(i)}catch(e){if(await md(this.storage,this.storageKey,t),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){let t=null;try{let n=`${this.url}/resend`;if(`email`in e){let{email:r,type:i,options:a}=e,o=null,s=null;this.flowType===`pkce`&&([o,s,t]=await this._getCodeChallengeAndMethod());let{error:c}=await Z(this.fetch,`POST`,n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:a?.captchaToken},code_challenge:o,code_challenge_method:s},redirectTo:this._maybeAppendFlowIdToRedirect(a?.emailRedirectTo,t)});return c&&await md(this.storage,this.storageKey,t),this._returnResult({data:{user:null,session:null},error:c})}if(`phone`in e){let{phone:t,type:r,options:i}=e,{data:a,error:o}=await Z(this.fetch,`POST`,n,{headers:this.headers,body:{phone:t,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 bu(`You must provide either an email or phone number and a type`)}catch(e){if(await md(this.storage,this.storageKey,t),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 X(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=this.autoRefreshToken&&e.expires_at?e.expires_at*1e3-Date.now()<iu:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await X(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=Td()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=Ed(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 X(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:Fd}):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:Fd})})}catch(e){if(q(e))return vu(e)&&await this._removeSession(),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={}){let n=null;try{return await this._useSession(async r=>{let{data:i,error:a}=r;if(a)throw a;if(!i.session)throw new J;let o=i.session,s=null,c=null;this.flowType===`pkce`&&e.email!=null&&([s,c,n]=await this._getCodeChallengeAndMethod());let{data:l,error:u}=await Z(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(t?.emailRedirectTo,n),body:Object.assign(Object.assign({},e),{code_challenge:s,code_challenge_method:c}),jwt:o.access_token,xform:Fd});if(u)throw u;return o.user=l.user,await this._saveSession(o),await this._notifyAllSubscribers(`USER_UPDATED`,o),this._returnResult({data:{user:o.user},error:null})})}catch(e){if(await md(this.storage,this.storageKey,n),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}=$u(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 xu(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new xu(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 Cu(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new xu(`Not a valid implicit grant flow url.`)}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new Cu(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code,{flowId:e[fu]});if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),r.searchParams.delete(fu),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 xu(`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;
13f*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){if(!e.code)return!1;let t=sd(e[fu]);return t&&await X(this.storage,ld(this.storageKey,t))?!0:!!await X(this.storage,`${this.storageKey}-code-verifier`)}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()},{data:r,error:i}=t;if(i&&!vu(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&&!(hu(t)&&(t.status===404||t.status===401||t.status===403)||vu(t)))return e!==`others`&&await n(),this._returnResult({error:t})}return e!==`others`&&await n(),this._returnResult({error:null})})}onAuthStateChange(e){let t=Wu(),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),vu(t)||Eu(t)||hu(t)&&(t.code===`refresh_token_not_found`||t.code===`refresh_token_already_used`||t.code===`session_expired`)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null,i=null;this.flowType===`pkce`&&([n,r,i]=await this._getCodeChallengeAndMethod(!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:this._maybeAppendFlowIdToRedirect(t.redirectTo,i)})}catch(e){if(await md(this.storage,this.storageKey,i),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){let t=null;try{let{data:n,error:r}=await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;let{url:a,flowId:o}=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 t=o,await Z(this.fetch,`GET`,a,{headers:this.headers,jwt:r.session?.access_token??void 0})});if(r)throw r;return Y()&&!e.options?.skipBrowserRedirect&&window.location.assign(n?.url),this._returnResult({data:{provider:e.provider,url:n?.url,flowId:t},error:null})}catch(n){if(q(n))return this._returnResult({data:{provider:e.provider,url:null,flowId:t},error:n});throw n}}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:Nd});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 yu}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await md(this.storage,this.storageKey,null),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 td(async n=>(n>0&&await ed(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:Nd})),(e,t)=>{let r=200*2**e;return t&&Eu(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{url:n,flowId:r}=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,flowId:r},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await X(this.storage,this.storageKey);if(t&&this.userStorage){let e=await X(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await Xu(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??Td()}else if(t&&!t.user&&!t.user){let e=await X(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await Zu(this.storage,this.storageKey+`-user`),await Xu(this.storage,this.storageKey,t)):t.user=Td()}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()<iu;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${iu}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(Ou(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),Eu(t)?console.warn(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 Qu,this.refreshingDeferred.promise.then(void 0,()=>{});let t=await X(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 X(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 Du};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 Zu(this.storage,this.storageKey),this.userStorage&&await Zu(this.userStorage,this.storageKey+`-user`);let e={data:null,error:new Du};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(!Eu(i)){let e=await X(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()+au},(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 Xu(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=Dd(e);await Xu(this.storage,this.storageKey,r)}else{let e=Dd(t);await Xu(this.storage,this.storageKey,e)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug(`#_removeSession()`),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await Zu(this.storage,this.storageKey),await hd(this.storage,this.storageKey),await Zu(this.storage,this.storageKey+`-user`),this.userStorage&&await Zu(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(),ru);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)/ru);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${ru}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 Ud)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)/ru);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${ru}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=n?.redirectTo,i=null,a=null,o=null;this.flowType===`pkce`&&([i,a,o]=await this._getCodeChallengeAndMethod(),r=this._maybeAppendFlowIdToRedirect(r,o));let s=[`provider=${encodeURIComponent(t)}`];if(r&&s.push(`redirect_to=${encodeURIComponent(r)}`),n?.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),i!=null&&a!=null){let e=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(e.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);s.push(e.toString())}return n?.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),{url:`${e}?${s.join(`&`)}`,flowId:o}}_maybeAppendFlowIdToRedirect(e,t){return!e||!t||!this.experimental.appendPkceFlowIdToRedirects?e??void 0:gd(e,t)}async _getCodeChallengeAndMethod(e=!1){return _d(this.storage,this.storageKey,e,e=>this._debug(`#_getCodeChallengeAndMethod()`,`evicted oldest pending PKCE verifier slot`,e))}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`?tf(e.webauthn.credential_response):nf(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:$d(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:ef(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}=$u(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}=$u(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}}=$u(n);if(!t?.allowExpired)try{bd(i.exp)}catch(e){throw new Au(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=xd(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,Vu(`${o}.${s}`)))throw new Au(`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){wd(this.experimental);try{if(!af())return this._returnResult({data:null,error:new gu(`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 sf({publicKey:ef(t.options),signal:e?.options?.signal??Qd.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new gu(`WebAuthn ceremony failed`,null)});let a=nf(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){wd(this.experimental);try{if(!af())return this._returnResult({data:null,error:new gu(`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 of({publicKey:$d(t.options),signal:e?.options?.signal??Qd.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new gu(`WebAuthn ceremony failed`,null)});let a=tf(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(){wd(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){wd(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){wd(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){wd(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:Nd});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(){wd(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){wd(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){wd(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}}};_f.nextInstanceID={};var vf=_f,yf=`2.115.0`,bf=``,xf;if(typeof Deno<`u`)bf=`deno`,xf=Deno.version?.deno;else if(typeof document<`u`)bf=`web`;else if(typeof navigator<`u`&&navigator.product===`ReactNative`)bf=`react-native`;else{var Sf;bf=`node`;let e=globalThis.process;xf=e==null||(Sf=e.version)==null?void 0:Sf.replace(/^v/,``)}var Cf=[`runtime=${bf}`];xf&&Cf.push(`runtime-version=${xf}`);var wf={headers:{"X-Client-Info":`supabase-js/${yf}; ${Cf.join(`; `)}`}},Tf={schema:`public`},Ef={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},Df={},Of={enabled:!1,respectSamplingDecision:!0};function kf(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 Af(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(jf(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 jf(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 Mf(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 Nf(e){"@babel/helpers - typeof";return Nf=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},Nf(e)}function Pf(e,t){if(Nf(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Nf(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ff(e){var t=Pf(e,`string`);return Nf(t)==`symbol`?t:t+``}function If(e,t,n){return(t=Ff(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lf(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?Lf(Object(n),!0).forEach(function(t){If(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Rf=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),zf=()=>Headers,Bf=e=>e.startsWith(`sb_publishable_`)||e.startsWith(`sb_secret_`),Vf=`sb_temp_`,Hf=new Set,Uf=e=>{if(!e.startsWith(`sb_`)||Bf(e)||e.startsWith(Vf))return;let t=e.match(/^sb_[a-zA-Z0-9]+_/)?.[0]??`unknown`;Hf.has(t)||(Hf.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.`))},Wf=(e,t,n,r,i,a)=>{let o=Rf(r),s=zf(),c=i?.enabled===!0,l=i?.respectSamplingDecision!==!1,u=c?Mf(t):null,d=!(a?.omitApiKeyAsBearer&&Bf(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=qf(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}))}},Gf=!1,Kf=!1;function qf(e,t,n){let r=as();if(!r)return Gf||(Gf=!0,console.warn("@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at your application entry point (requires the OpenTelemetry API package to be installed). The CDN/UMD build does not support trace propagation.")),null;if(!Af(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let i=r();if(!i||!i.traceparent){var a;if(i!=null&&(a=i.carrierKeys)!=null&&a.length&&!Kf){Kf=!0;let e=i.carrierKeys.includes(`sentry-trace`)?" Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.":` Configure your tracing SDK to emit W3C trace context on outgoing requests.`;console.warn(`@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its propagator wrote [${i.carrierKeys.join(`, `)}] and no W3C traceparent header, so trace headers will not be attached.`+e)}return null}if(n){let e=kf(i.traceparent);if(e&&!e.isSampled)return{traceparent:i.traceparent}}return i}function Jf(e){return typeof e==`boolean`?{enabled:e}:e}function Yf(e){return e.endsWith(`/`)?e:e+`/`}function Xf(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=Jf(e.tracePropagation),d=Jf(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 Zf(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(Yf(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var Qf=class extends vf{constructor(e){super(e)}},$f=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=Zf(e);
13if(!t)throw Error(`supabaseKey is required.`);Uf(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:Tf,realtime:Df,auth:$($({},Ef),{},{storageKey:i}),global:wf,tracePropagation:Of},o=Xf(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=Wf(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation),this.functionsFetch=Wf(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation,{omitApiKeyAsBearer:!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 Is(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit,retry:o.db.retry}),this.storage=new tu(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new ms(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}getOpenApiSpec(){return this.rest.getOpenApiSpec()}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 Qf({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 tl(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)}},ep=(e,t,n)=>new $f(e,t,n);function tp(){if(typeof window<`u`||globalThis.Deno!==void 0)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}tp()&&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 np=t((e=>
13{Object.defineProperty(e,"__esModule",{value:!0}),e.parse=s,e.stringifySetCookie=c,e.serialize=c,e.stringifySetCookie=c,e.serialize=c;var t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,n=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,o=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function s(e,t){let n=new o,r=e.length;if(r<2)return n;let i=t?.decode||f,a=0;do{let t=u(e,a,r);if(t===-1)break;let o=l(e,a,r);if(t>o){a=e.lastIndexOf(`;`,t-1)+1;continue}let s=d(e,a,t);n[s]===void 0&&(n[s]=i(d(e,t+1,o))),a=o+1}while(a<r);return n}function c(e,a,o){let s=typeof e==`object`?e:{...o,name:e,value:String(a)},c=(typeof a==`object`?a:o)?.encode||encodeURIComponent;if(!t.test(s.name))throw TypeError(`argument name is invalid: ${s.name}`);let l=s.value?c(s.value):``;if(!n.test(l))throw TypeError(`argument val is invalid: ${s.value}`);let u=s.name+`=`+l;if(s.maxAge!==void 0){if(!Number.isInteger(s.maxAge))throw TypeError(`option maxAge is invalid: ${s.maxAge}`);u+=`; Max-Age=`+s.maxAge}if(s.domain){if(!r.test(s.domain))throw TypeError(`option domain is invalid: ${s.domain}`);u+=`; Domain=`+s.domain}if(s.path){if(!i.test(s.path))throw TypeError(`option path is invalid: ${s.path}`);u+=`; Path=`+s.path}if(s.expires){if(!p(s.expires)||!Number.isFinite(s.expires.valueOf()))throw TypeError(`option expires is invali
13d: ${s.expires}`);u+=`; Expires=`+s.expires.toUTCString()}if(s.httpOnly&&(u+=`; HttpOnly`),s.secure&&(u+=`; Secure`),s.partitioned&&(u+=`; Partitioned`),s.priority)switch(typeof s.priority==`string`?s.priority.toLowerCase():void 0){case`low`:u+=`; Priority=Low`;break;case`medium`:u+=`; Priority=Medium`;break;case`high`:u+=`; Priority=High`;break;default:throw TypeError(`option priority is invalid: ${s.priority}`)}if(s.sameSite)switch(typeof s.sameSite==`string`?s.sameSite.toLowerCase():s.sameSite){case!0:case`strict`:u+=`; SameSite=Strict`;break;case`lax`:u+=`; SameSite=Lax`;break;case`none`:u+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid: ${s.sameSite}`)}return u}function l(e,t,n){let r=e.indexOf(`;`,t);return r===-1?n:r}function u(e,t,n){let r=e.indexOf(`=`,t);return r<n?r:-1}function d(e,t,n){let r=t,i=n;do{let t=e.charCodeAt(r);if(t!==32&&t!==9)break}while(++r<i);for(;i>r;){let t=e.charCodeAt(i-1);if(t!==32&&t!==9)break;i--}return e.slice(r,i)}function f(e){if(e.indexOf(`%`)===-1)return e;try{return decodeURIComponent(e)}catch{return e}}function p(e){return a.call(e)===`[object Date]`}}));function rp(){return typeof window<`u`&&window.document!==void 0}var ip={path:`/`,sameSite:`lax`,httpOnly:!1,maxAge:3456e4},ap=/^(.*)[.](0|[1-9][0-9]*)$/;function op(e,t){if(e===t)return!0;let n=e.match(ap);return!!(n&&n[1]===t)}
13function sp(e,t,n){let r=n??3180,i=encodeURIComponent(t);if(i.length<=r)return[{name:e,value:t}];let a=[];for(;i.length>0;){let e=i.slice(0,r),t=e.lastIndexOf(`%`);t>r-3&&(e=e.slice(0,t));let n=``;for(;e.length>0;)try{n=decodeURIComponent(e);break}catch(t){if(t instanceof URIError&&e.at(-3)===`%`&&e.length>3)e=e.slice(0,e.length-3);else throw t}a.push(n),i=i.slice(e.length)}return a.map((t,n)=>({name:`${e}.${n}`,value:t}))}async function cp(e,t){let n=await t(e);if(n)return n;let r=[];for(let n=0;;n++){let i=await t(`${e}.${n}`);if(!i)break;r.push(i)}return r.length>0?r.join(``):null}var lp=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),up=` 14\r=`.split(``),dp=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<up.length;t+=1)e[up[t].charCodeAt(0)]=-2;for(let t=0;t<lp.length;t+=1)e[lp[t].charCodeAt(0)]=t;return e})();function fp(e){let t=[],n=0,r=0;if(hp(e,e=>{for(n=n<<8|e,r+=8;r>=6;){let e=n>>r-6&63;t.push(lp[e]),r-=6}}),r>0)for(n<<=6-r,r=6;r>=6;){let e=n>>r-6&63;t.push(lp[e]),r-=6}return t.join(``)}function pp(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i=0,a=0;for(let t=0;t<e.length;t+=1){let o=dp[e.charCodeAt(t)];if(o>-1)for(i=i<<6|o,a+=6;a>=8;)gp(i>>a-8&255,r,n),a-=8;else if(o===-2)continue;else throw Error(`Invalid Base64-URL character "${e.at(t)}" at position ${t}`)}return t.join(``)}function mp(e,t){if(e<=127){t(e);return}if(e<=2047){t(192|e>>6),t(128|e&63);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}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 hp(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}mp(r,t)}}function gp(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)}}var _p=e(np()),vp=`base64-`,yp=/-flow-[A-Za-z0-9_-]{8,64}-code-verifier$/;function bp(e){return yp.test(e)}var xp=`-flows-code-verifier`;function Sp(e){return e.endsWith(xp)}function Cp(e){if(!e.startsWith(vp))return e;let t;try{t=pp(e.substring(7))}catch(e){return console.warn(`@supabase/ssr: could not base64url-decode chunked cookie value, treating as absent. Cookie chunks may have been written partially across responses.`,e),null}try{JSON.parse(t)}catch{return console.warn(`@supabase/ssr: chunked cookie decoded to invalid JSON, treating as absent. This usually indicates that cookie chunks from different writes were combined (e.g. response committed before all Set-Cookie headers were sent).`),null}return t}function wp(e,t){let n=e.cookies??null,r=e.cookieEncoding,i={},a={},o,s,c=()=>{let e=(0,_p.parse)(document.cookie);return Object.keys(e).map(t=>({name:t,value:e[t]??``}))},l=e=>{e.forEach(({name:e,value:t,options:n})=>{document.cookie=(0,_p.serialize)(e,t,n)})};if(n){if(`get`in n){let e=async e=>{let t=e.flatMap(e=>[e,...Array.from({length:5}).map((t,n)=>`${e}.${n}`)]),r=[];for(let e=0;e<t.length;e+=1){let i=await n.get(t[e]);(i||typeof i==`string`)&&r.push({name:t[e],value:i})}return r};if(o=async t=>await e(t),`set`in n&&`remove`in n)s=async e=>{for(let t=0;t<e.length;t+=1){let{name:r,value:i,options:a}=e[t];i?await n.set(r,i,a):await n.remove(r,a)}};else if(t)s=async()=>{console.warn(`@supabase/ssr: createServerClient was configured without set and remove cookie methods, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness. Consider switching to the getAll and setAll cookie methods instead of get, set and remove which are deprecated and can be difficult to use correctly.`)};else throw Error(`@supabase/ssr: createBrowserClient requires configuring a getAll and setAll cookie method (deprecated: alternatively both get, set and remove can be used)`)}else if(`getAll`in n){if(o=async()=>await n.getAll(),`setAll`in n)s=n.setAll;else if(t)s=async()=>
14{console.warn(`@supabase/ssr: createServerClient was configured without the setAll cookie method, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness.`)};else throw Error(`@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)`)}else if(!t&&rp())o=()=>c(),s=l;else throw Error(`@supabase/ssr: ${t?`createServerClient`:`createBrowserClient`} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).${rp()?` As this is called in a browser runtime, consider removing the cookies option object to use the document.cookie API automatically.`:``}`)}else if(!t&&rp())o=()=>c(),s=l;else if(t)throw Error(`@supabase/ssr: createServerClient must be initialized with cookie options that specify getAll and setAll functions (deprecated, not recommended: alternatively use get, set and remove)`);else o=()=>[],s=()=>{throw Error(`@supabase/ssr: createBrowserClient in non-browser runtimes (including Next.js pre-rendering mode) was not initialized cookie options that specify getAll and setAll functions (deprecated: alternatively use get, set and remove), but they were needed`)};if(!t)return{getAll:o,setAll:s,setItems:i,removedItems:a,storage:{isServer:!1,getItem:async e=>{let t=await o([e]),n=await cp(e,async e=>{let n=t?.find(({name:t})=>t===e)||null;return n?n.value:null});return n?Cp(n):null},setItem:async(t,n)=>{let i=(await o([t]))?.map(({name:e})=>e)||[],a=new Set(i.filter(e=>op(e,t))),c=n;r===`base64url`&&(c=vp+fp(n));let l=sp(t,c);l.forEach(({name:e})=>{a.delete(e)});let u={...ip,...e?.cookieOptions,maxAge:0},d={...ip,...e?.cookieOptions,maxAge:ip.maxAge};delete u.name,delete d.name;let f=u.domain?(()=>{let{domain:e,...t}=u;return t})():null,p=[...f?[...a].map(e=>({name:e,value:``,options:f})):[],...[...a].map(e=>({name:e,value:``,options:u})),...l.map(({name:e,value:t})=>({name:e,value:t,options:d}))];p.length>0&&await s(p,{})},removeItem:async t=>{let n=((await o([t]))?.map(({name:e})=>e)||[]).filter(e=>op(e,t));if(n.length===0)return;let r={...ip,...e?.cookieOptions,maxAge:0};delete r.name;let i=r.domain?(()=>{let{domain:e,...t}=r;return t})():null,a=[...i?n.map(e=>({name:e,value:``,options:i})):[],...n.map(e=>({name:e,value:``,options:r}))];await s(a,{})}}};let u=s,d=!1;return s=async(e,t)=>{let n=!d&&Object.keys(t).length>0;await u(e,n?t:{}),n&&(d=!0)},{getAll:o,setAll:s,setItems:i,removedItems:a,storage:{isServer:!0,getItem:async e=>{if(typeof i[e]==`string`)return i[e];if(a[e])return null;let t=await o([e]),n=await cp(e,async e=>{let n=t?.find(({name:t})=>t===e)||null;return n?n.value:null});return n?typeof n==`string`?Cp(n):n:null},setItem:async(t,n)=>{t.endsWith(`-code-verifier`)&&await Tp({getAll:o,setAll:s,setItems:{[t]:n},removedItems:{}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:r}),i[t]=n,delete a[t]},removeItem:async t=>{(bp(t)||Sp(t))&&await Tp({getAll:o,setAll:s,setItems:{},removedItems:{[t]:!0}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:r}),delete i[t],a[t]=!0}}}}async function Tp({getAll:e,setAll:t,setItems:n,removedItems:r},i){let a=i.cookieEncoding,o=i.cookieOptions??null,s=await e([...n?Object.keys(n):[],...r?Object.keys(r):[]]),c=s?.map(({name:e})=>e)||[],l=new Map(s?.map(({name:e,value:t})=>[e,t])||[]),u=Object.keys(r).flatMap(e=>c.filter(t=>op(t,e))),d=Object.keys(n).flatMap(e=>{let t=new Set(c.filter(t=>
14op(t,e))),r=n[e];a===`base64url`&&(r=vp+fp(r));let i=sp(e,r);return i.forEach(e=>{t.delete(e.name)}),u.push(...t),i}).filter(({name:e,value:t})=>l.get(e)!==t),f=u.filter(e=>l.has(e)),p={...ip,...o,maxAge:0},m={...ip,...o,maxAge:ip.maxAge};delete p.name,delete m.name;let h=p.domain&&f.length>0?(()=>{let{domain:e,...t}=p;return t})():null;(f.length!==0||d.length!==0)&&await t([...h?f.map(e=>({name:e,value:``,options:h})):[],...f.map(e=>({name:e,value:``,options:p})),...d.map(({name:e,value:t})=>({name:e,value:t,options:m}))],{"Cache-Control":`private, no-cache, no-store, must-revalidate, max-age=0`,Expires:`0`,Pragma:`no-cache`})}var Ep=`0.12.6`,Dp=new Set;function Op(e){Dp.has(e)||(Dp.add(e),console.warn(e))}var kp=!1,Ap=[`@supabase/auth-helpers-nextjs`,`@supabase/auth-helpers-react`,`@supabase/auth-helpers-remix`,`@supabase/auth-helpers-sveltekit`];function jp(){if(kp||typeof process>`u`||!{}.npm_package_name)return;let e={}.npm_package_name;Ap.includes(e)&&(kp=!0,console.warn(` 15ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 16â â ï¸ IMPORTANT: Package Consolidation Notice â 17â â 18â The ${e.padEnd(35)} package name is deprecated. â 19â â 20â You are now using @supabase/ssr - a unified solution for all frameworks. â 21â â 22â The auth-helpers packages have been consolidated into @supabase/ssr â 23â to provide better maintenance and consistent APIs across frameworks. â 24â â 25â Please update your package.json to use @supabase/ssr directly: â 26â npm uninstall ${e.padEnd(42)} â 27â npm install @supabase/ssr â 28â â 29â For more information, visit: â 30â https://supabase.com/docs/guides/auth/server-side â 31ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 32 `))}var Mp;function Np(e,t,n){jp();let r=n?.isSingleton===!0||(!n||!(`isSingleton`in n))&&rp();if(r&&Mp)return Mp;if(!e||!t)throw Error(`@supabase/ssr: Your project's URL and API key are required to create a Supabase client! 33 34Check your Supabase project's API settings to find these values 35 36https://supabase.com/dashboard/project/_/settings/api`);n?.auth?.storage&&Op("@supabase/ssr: createBrowserClient always manages the session via cookies, so the `auth.storage` option you passed is ignored. If you don't need the session to be readable on the server, use @supabase/supabase-js's createClient directly with your own `storage` instead.");let{storage:i}=wp({...n,cookieEncoding:n?.cookieEncoding??`base64url`},!1),a=ep(e,t,{...n,global:{...n?.global,headers:{...n?.global?.headers,"X-Client-Info":`supabase-ssr/${Ep} createBrowserClient`}},auth:{...n?.auth,...n?.cookieOptions?.name?{storageKey:n.cookieOptions.name}:null,flowType:`pkce`,autoRefreshToken:n?.auth?.autoRefreshToken??rp(),detectSessionInUrl:n?.auth?.detectSessionInUrl??rp(),persistSession:n?.auth?.persistSession??!0,storage:i,...n?.cookies&&`encode`in n.cookies&&n.cookies.encode===`tokens-only`?{userStorage:n?.auth?.userStorage??window.localStorage}:null}});return r&&(Mp=a),a}async function Pp(e,t){for(let n=1;n<=3;n++)try{return await fetch(e,t)}catch(r){if(t?.signal?.aborted)throw r;if(n===3){let{headers:n,...i}=t??{};throw console.error(`Error fetching request ${e}`,r,i),r}console.warn(`Retrying fetch attempt ${n+1} for request: ${e}`),await new Promise(e=>setTimeout(e,100*n))}throw Error(`Unreachable code`)}var Fp=E({name:`supabase`,enforce:`pre`,async setup({provide:e}){let t,r,i=p(),{url:a,key:o,cookieOptions:s,cookiePrefix:c,useSsrCookies:l,clientOptions:u}=se().public.supabase,d;d=l?Np(a,o,{...u,cookieOptions:{...s,name:c},isSingleton:!0,global:{fetch:Pp,...u.global}}):ep(a,o,{...u,global:{fetch:Pp,...u.global}}),e(`supabase`,{client:d});let f=$n(),m=zn();if(!f.value){let{data:e}=([t,r]=n(()=>d.auth.getSession()),t=await t,r(),t);if(e.session){f.value=e.session;let{data:i}=([t,r]=n(()=>
36d.auth.getClaims()),t=await t,r(),t);m.value=i?.claims??null}}i.hook(`page:start`,async()=>{let{data:e}=await d.auth.getClaims();m.value=e?.claims??null}),d.auth.onAuthStateChange((e,t)=>{JSON.stringify(f.value)!==JSON.stringify(t)&&(f.value=t,t?.user?d.auth.getClaims().then(({data:e})=>{m.value=e?.claims??null}):m.value=null)})}},1),Ip=E(()=>{let e=Pe();Kt(()=>{e.beforeResolve(async()=>{await new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})})})})}),Lp=E(e=>{let t;async function n(){let r;try{r=await Sn()}catch(e){let t=e;if(!(`status`in t&&(t.status===404||t.status===403)))throw t}t&&clearTimeout(t),t=setTimeout(n,de);try{let n=await an(nn(`builds/latest.json`)+`?${Date.now()}`);n.id!==r?.id&&(e.hooks.callHook(`app:manifest:update`,n),t&&clearTimeout(t))}catch{}}Kt(()=>{t=setTimeout(n,de)})}),Rp=E({name:`nuxt:chunk-reload-crawler`,setup(e){let t=!0;e.hooks.hookOnce(`app:suspense:resolve`,()=>{t=!1}),e.hook(`app:chunkError`,()=>{t&&h(navigator.userAgent)&&Eo()})}}),zp=E({name:`nuxt:chunk-reload`,setup(e){let t=Pe(),n=se(),r=new Set;t.beforeEach(()=>{r.clear()}),e.hook(`app:chunkError`,({error:e})=>{r.add(e)});function i(e){Eo({path:ie(n.app.baseURL,e.fullPath),persistState:!0})}e.hook(`app:manifest:update`,()=>{t.beforeResolve(i)}),t.onError((e,t)=>{r.has(e)&&i(t)})}}),Bp=E({name:`nuxt:island-link-navigation`,setup(e){}});function Vp(e){let{timeout:t}=e;return new Promise(e=>{let n=!1,r=!1,i=()=>{},a=t=>{r||(r=!0,i(),e(t))};Tr(()=>{n=!0,a(!1)}),Kt(()=>{if(n)return;let{start:e,stop:r}=wr(()=>{a(!0)},t,{immediate:!1});i=r,e()})})}var Hp=E({name:`scripts:init`,env:{islands:!1},parallel:!0,setup(){return{provide:{scripts:{metaPixel:bn({scriptOptions:{proxy:!1,bundle:!1,trigger:Vp({timeout:2e3})}})}}}}}),Up=E({name:`@nuxt/icon`,setup(){let e=se(),t=hr().icon,n=fr(),r=n.native;vr.setFetch((e,t)=>{let n=globalThis.$fetch?.native;return(r||n||globalThis.fetch)(e,t)});let i=[];if(t.provider===`server`){let n=e.app?.baseURL?.replace(/\/$/,``)??``;i.push(n+(t.localApiEndpoint||`/api/_nuxt_icon`)),(t.fallbackToApi===!0||t.fallbackToApi===`client-only`)&&i.push(t.iconifyApiEndpoint)}else t.provider===`none`?vr.setFetch(()=>Promise.resolve(new Response)):i.push(t.iconifyApiEndpoint);async function a(e,t){try{let r=await n(i[0]+`/`+t+`.json`,{query:{icons:e.join(`,`)}});if(!r||r.prefix!==t||!r.icons)throw Error(`Invalid data`+JSON.stringify(r));return r}catch(e){return console.error(`Failed to load custom icons`,e),null}}_r(``,{resources:i});for(let e of t.customCollections||[])e&&gr(a,e)}}),Wp=[[`Icon`,w(()=>U(()=>import(`./C6m-gfwK.js`).then(e=>e.n).then(e=>e.default||e.default||e),__vite__mapDeps([32,17,1,3,21]),import.meta.url))]],Gp=E({name:`nuxt:global-components`,setup(e){for(let[t,n]of Wp)e.vueApp.component(t,n),e.vueApp.component(`Lazy`+t,n)}}),Kp={auth:w(()=>U(()=>import(`./Dc2WgAQ2.js`).then(e=>e.default||e),__vite__mapDeps([213,1,36,3,2,4,5,6,7,8,9,10,208,37,21,20,22,24,18,31,32,17,35,33,57,38,19,39,16,40,41,25,42,27,43,44,45,23,46,47,48,49,29,28,26,50,51,52,209,214,215]),import.meta.url)),default:w(()=>U(()=>import(`./Be0UpeoL.js`).then(e=>e.default||e),__vite__mapDeps([216,1,3,2,4,5,6,7,8,9,10,134,135,31,32,17,21,18,37,20,22,24,35,36,33,80,19,39,16,40,41,25,81,27,44,74,50,75,139,214,210,208,57,38,42,43,45,23,46,47,48,49,29,28,26,51,52,209,108,211,53]),import.meta.url)),fullwidth:w(()=>U(()=>import(`./BnxAdz9q.js`).then(e=>e.default||e),__vite__mapDeps([217,1,135,5,2,3,4,6,7,8,9,10,211,36,31,32,17,21,18,37,20,22,24,35,33,80,19,39,16,40,41,25,81,27,44,74,50]),import.meta.url))},qp=E({name:`nuxt:prefetch`,setup(e){let t=Pe();e.hooks.hook(`app:mounted`,()=>{t.beforeEach(async e=>{let t=e?.meta?.layout;t&&typeof Kp[t]==`function`&&await Kp[t]()})}),e.hooks.hook(`link:prefetch`,e=>{if(Je(e))return;let n=t.resolve(e);if(!n)return;let r=n.meta.layout,i=to(n.meta.middleware).filter(e=>typeof e==`string`);for(let e of i){let t=ro[e];typeof t==`function`&&t()}typeof r==`string`&&r in Kp&&kn(Kp[r])})}});function Jp(e){return e?.defaultForDomains?.[0]||e?.domain||e?.domains?.[0]}function Yp(e,t){return Jp(e)||Jp(t)}var Xp=[`i18n:plugin`,`i18n:plugin:ssg-detect`,`i18n:plugin:route-locale-detect`];function Zp(){return p().$nuxtSiteConfig}function Qp(e){let t=u(e.locales).find(t=>t.code===e.defaultLocale);return t?.language||t?.iso||e.defaultLocale}function $p(e,t){let n=u(e.baseUrl)||void 0;if(!u(e.differentDomains))return n;let r=u(e.locales).find(t=>t.code===u(e.defaultLocale)),i=Yp(u(e.localeProperties),r);return i?Je(i,{strict:!0})?i:`${t}//${i}`:n}function em(e){let t=u(e.localeProperties);return t.language?t.language:Qp(e)}function tm(e){return e.te(`nuxtSiteConfig.description`)?e.t(`nuxtSiteConfig.description`):void 0}function nm(e){return e.te(`nuxtSiteConfig.name`)?e.t(`nuxtSiteConfig.name`):void 0}var rm=E({name:`nuxt-site-config:i18n`,dependsOn:Xp,setup(e){let t=e.$i18n;if(!t)return;let n=Zp(),r=Dn().protocol,i=u(t.baseUrl);if(i){let e=n.get({resolveRefs:!0}),t=e.url;if(t&&!t.includes(`localhost`)){let n=ae(i,`https://`),r=ae(t,`https://`);n.host!==r.host&&e.env===`production`&&console.error(`[Nuxt Site Config] Your I18n baseUrl \`${n.host}\` doesn't match your site url ${r.host}. This will cause production SEO issues. Either provide a matching baseUrl or remove the site url config.`)}}let a=M(()=>Qp(t)),o=M(()=>$p(t,r)),s=M(()=>em(t)),c=M(()=>tm(t)),l=M(()=>nm(t)),d;m(t.locale,()=>{d&&d(),d=n.push({_priority:$o.build,_context:`@nuxtjs/i18n`,url:o,defaultLocale:a,currentLocale:s,description:c,name:l})},{immediate:!0})}}),im=()=>{let e=se().public.supabase,t=e.redirectOptions.saveRedirectToCookie?e.cookiePrefix:e.cookieName,n=Cn(`${t}-redirect-path`,{...e.cookieOptions,readonly:!1});return{path:n,pluck:()=>{let e=n.value;return n.value=null,e}}};function am(e,t){return t.some(t=>t?RegExp(`^${t.replace(/\*/g,`.*`)}$`).test(e):!1)}var om=E({name:`auth-redirect`,setup(){ge(`global-auth`,je(e=>{let{login:t,callback:n,include:r,exclude:i,cookieRedirect:a,saveRedirectToCookie:o}=se().public.supabase.redirectOptions;if(r&&r.length>0&&!am(e.path,r))return;let s=[t,n,...i??[]];if(!am(e.path,s)&&!$n().value){if(a||o){let t=im();t.path.value=e.fullPath}return ve(t)}}),{global:!0})}}),sm=[`es-PY`,`es-BO`,`en`,`fr`,`he`],cm={"es-PY":[{key:`locale_common_46json_c3f658e5`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_account_46json_6bd5ce06`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_publishing_46json_33415803`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_discovery_46json_1846476a`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_legal_46json_80fd2e03`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_admin_46json_0a565a8e`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_native_46json_746ac910`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_server_46json_16cdc4fc`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_assistant_45tools_46json_e3072844`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_common_46json_10850a94`,load:()=>Promise.resolve({}),cache:!0}],"es-BO":[{key:`locale_common_46json_c3f658e5`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_account_46json_6bd5ce06`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_publishing_46json_33415803`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_discovery_46json_1846476a`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_legal_46json_80fd2e03`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_admin_46json_0a565a8e`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_native_46json_746ac910`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_server_46json_16cdc4fc`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_assistant_45tools_46json_e3072844`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_common_46json_b0df9c2f`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_publishing_46json_c91d62f9`,load:()=>Promise.resolve({}),cache:!0}],en:[{key:`locale_common_46json_5a5357d0`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_account_46json_5b43d09b`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_publishing_46json_9af49299`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_discovery_46json_47af467c`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_legal_46json_edd6921b`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_admin_46json_98689353`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_native_46json_d1ff99ed`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_server_46json_ca0a3e34`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_assistant_45tools_46json_b9cc7839`,load:()=>Promise.resolve({}),cache:!0}],fr:[{key:`locale_common_46json_d195a406`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_account_46json_edacae9d`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_publishing_46json_b14d1e3c`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_discovery_46json_5d2457fe`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_legal_46json_99b70dd9`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_admin_46json_dd440f18`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_native_46json_65f5fbbb`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_server_46json_60be01d1`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_assistant_45tools_46json_d343c53a`,load:()=>Promise.resolve({}),cache:!0}],he:[{key:`locale_common_46json_b4f32ecc`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_account_46json_2e095c75`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_publishing_46json_9677c87f`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_discovery_46json_a952b51b`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_legal_46json_993e1e3b`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_admin_46json_33e90d31`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_native_46json_95615839`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_server_46json_dead8096`,load:()=>Promise.resolve({}),cache:!0},{key:`locale_assistant_45tools_46json_b400bb74`,load:()=>Promise.resolve({}),cache:!0}]},lm=[()=>U(()=>import(`./BucWdrj_.js`),__vite__mapDeps([218,8]),import.meta.url)],um=[{code:`es-PY`,language:`es-PY`,name:`Español (Paraguay)`,dir:`ltr`,domains:[],defaultForDomains:[]},{code:`es-BO`,language:`es-BO`,name:`Español (Bolivia)`,dir:`ltr`,domains:[],defaultForDomains:[]},{code:`en`,language:`en`,name:`English`,dir:`ltr`,domains:[],defaultForDomains:[]},{code:`fr`,language:`fr`,name:`Français`,dir:`ltr`,domains:[],defaultForDomains:[]},{code:`he`,language:`he`,name:`×¢×ר×ת`,dir:`rtl`,domains:[],defaultForDomains:[]}],dm=new Map;function fm(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(fm);let t=ar(null);for(let n of Object.keys(e))t[n]=fm(e[n]);return t}
36var pm=we((e,t,n)=>{if(t===`messages`||t===`datetimeFormats`||t===`numberFormats`)return e[t]??=ar(null),rr(n,e[t]),!0});async function mm(e){let t=p(),n={messages:ar(null)};for(let r of e){let e=await r().then(e=>hm(e)?e.default:e),i=lr(e)?await t.runWithContext(()=>e()):e;n=pm(ar(null),i,n)}return n.fallbackLocale??=!1,n}var hm=e=>or(e)===`[object Module]`;async function gm(e,t){let n=p();try{let r=await n.runWithContext(t.load).then(e=>hm(e)?e.default:e);return lr(r)?await n.runWithContext(()=>r(e)):r}catch(t){throw Error(`Failed loading locale (${e}): `+t.message,{cause:t})}}async function _m(e,t=[]){let n=p(),r=await Promise.all(t.map(async t=>{let r=vm(t),i=r||await n.runWithContext(()=>gm(e,t));return!r&&t.cache!==!1&&dm.set(t.key,{ttl:Date.now()+864e5,value:i}),i})),i={};for(let e of r)rr(e,i);return i}function vm(e){if(e.cache===!1)return;let t=dm.get(e.key);if(t!=null)return t.ttl>Date.now()?t.value:void 0}function ym(e){return t=>!e.dynamic.includes(t)&&!e.undeliverable.includes(t)}function bm(e){return t=>!e.ssr||e.undeliverable.includes(t)||e.dynamic.includes(t)&&(e.prerender||e.ssg)}function xm(e=0){return t=>{let n=(typeof t==`string`?t:t.pathname).split(`?`)[0].split(`/`);return n[0]===``&&n.shift(),n.length>e&&n[e]||``}}var Sm=`___`,Cm=`___default`;function wm(e){return typeof e==`string`?e:e==null?``:e.toString()}function Tm(e){return wm(typeof e==`object`?e?.name:e).split(Sm)[0]}function Em(e,t,n){return n?e+Sm+t+Cm:e+Sm+t}var Dm=e=>e?Ae:ke;function Om(e,t,n){return n.routing&&(e!==t||n.strategy===`prefix`)}var km=xm(0),Am=e=>km(e),jm=e=>e.split(Sm).at(1)??``;function Mm(e){return String(typeof e==`object`?e?.name||e?.path||``:e)}function Nm(e){let t=Mm(e);return t[0]===`/`?Am(t):jm(t)||(typeof e==`object`&&e?.path?Am(String(e.path)):``)}function Pm(e,t){return!t.routing&&!t.domains?e=>wm(e):(t,n)=>{let r=wm(t),i=Em(r,n,!0);return e(i)?i:Em(r,n,!1)}}function Fm(e,t){return t.routing?t.strategy===`prefix`?(t,n)=>{let r=`/`+n+(t.path===`/`?``:t.path),i=e.options.routes.find(e=>e.path===r);return i==null?t:e.resolve(cr({},t,i,{path:r}))}:t=>e.resolve(t):e=>e}var Im=(e=``)=>e.replace(/^https?:\/\//i,``).toLowerCase();function Lm(e,t){return!!e?.domains.some(e=>Im(e)===t)}function Rm(e,t,n){let r=e.find(e=>e.code===n);return!r?.domains.length||Lm(r,t)?`here`:e.some(e=>Lm(e,t))?`other-domain`:`off-host`}function zm(e,t,n){return Rm(e,t,n)!==`other-domain`}var Bm=e=>e?.defaultForDomains[0]||e?.domain||e?.domains[0];function Vm(e,t,n){if(!zm(n,e,t))return Bm(n.find(e=>e.code===t))}function Hm(e,t,n){let r=e.filter(e=>Lm(e,t));return(r.find(e=>e.code===n)||r.find(e=>e.defaultForDomains.some(e=>Im(e)===t))||r[0])?.code}function Um(e,t){let n=t.replace(/^\./,``).replace(/:\d+$/,``).toLowerCase();return e.every(e=>e.domains.concat(e.domain||[]).every(e=>{let t=Im(e).replace(/:\d+$/,``);return t===n||t.endsWith(`.`+n)}))}var Wm=(e,t)=>Je(e,{strict:!0})?e:t.protocol+`//`+e;function Gm(e,t,n,r=um){let i=r.find(e=>e.code===n),a=e?.[n]?.domain||i?.domain||i?.domains.find(e=>Im(e)===t.host)||Vm(t.host,n,r);if(a)return Wm(a,t)}function Km(e,t,n=um){let r;for(let i of n){let n=qm(i,e);for(let e of[n.domain,...n.domains])e&&Im(e)===t.host&&(!r||!Je(r,{str
36ict:!0})&&Je(e,{strict:!0}))&&(r=e)}return r&&Wm(r,t)}function qm(e,t){if(typeof e==`string`)return e;let n=e,r=t[n.code]?.domain;return!r||r===n.domain?e:{...n,domain:r,domains:[r],defaultForDomains:n.defaultForDomains.length?[r]:[]}}function Jm(e){let t={};for(let n of sm){let r=Ym(e,[n]);t[n]={fallbacks:r,cacheable:Zm(n,r)}}return t}function Ym(e,t){if(e===!1)return[];if(sr(e))return e;let n=[];if(ir(e))return t.every(t=>t!==e)&&n.push(e),n;let r=[...t,`default`];for(let t of r)t in e!=0&&(n=[...n,...e[t].filter(Boolean)]);return n}function Xm(e){return cm[e]!=null&&cm[e].every(e=>e.cache!==!1)}function Zm(e,t){return Xm(e)&&t.every(e=>Xm(e))}function Qm(e,t=um){return t.find(t=>t.defaultForDomains.some(t=>Im(t)===e))?.code}function $m(e,t,n=um){return Qm(e,n)||t||(n.some(e=>e.domains.length)?n[0]?.code:``)||``}var eh=e=>sm.includes(e||``),th=e=>eh(e)?e:void 0,nh=e=>!!e.path&&!e.name;function rh(e){let{router:t,defaultLocale:n,strictSeo:r,compactRoutes:i}=e,a={strategy:e.strategy,routing:e.routing,domains:e.domains},o=Dm(e.trailingSlash),s=Pm(e=>t.hasRoute(e),a);function c(e,n){e.name=Tm(e.name||t.currentRoute.value);let r=s(e.name,n);if(t.hasRoute(r))e.name=r,i&&e.params&&delete e.params.locale;else if(i&&eh(n)&&d().has(e.name))return e.params={...e.params||{},locale:n},e;return e.name=r,e}let l=Fm(t,a),u;function d(){if(u)return u;if(u=new Set,i)for(let e of t.getRoutes())e.name!=null&&/^\/:locale\(/.test(e.path)&&u.add(String(e.name));return u}function f(e,r){let c=l(e,r),u=Tm(c);if(u){let e=s(u,r);if(t.hasRoute(e)){c.name=e;let t=c;return i&&t.params&&delete t.params.locale,c}if(i&&d().has(u)){let e=c;return e.name=u,e.params={...e.params||{},locale:r},e}return c.name=e,c}return Om(r,n,a)&&(c.path=`/`+r+c.path),c.path=o(c.path,!0),c}let p=()=>t.currentRoute.value.meta.nuxtI18nInternal??{},m=(e,t=p())=>r&&!!e&&Object.keys(t).length>0&&!t[e],h=a.strategy===`prefix_except_default`||a.strategy===`prefix_and_default`,g=(t,n,r)=>!!t&&$m(Im(t),e.configuredDefaultLocale,r)===n,_=e=>(t,n,r,i)=>{let a=e(n);return a?(h&&g(Bm(r),n,i)&&Am(t)===n&&(t=t.slice(n.length+1)||`/`),ie(a,t)):t},v=_(e.getBaseUrl),y=_(e.getCanonicalBaseUrl);return{router:t,getLocale:e.getLocale,getLocales:e.getLocales,getBaseUrl:e.getBaseUrl,getRouteBaseName:Tm,getRouteLocalizedParams:p,getLocalizedDynamicParams:t=>{let n=e.getLocalePathPayload?.();return n?n[t]||{}:p()?.[t]},afterSwitchLocalePath:(t,n)=>{if(m(n))return``;if(!a.domains)return t;let r=e.getHost()??``,i=e.getLocales(),o=i.find(e=>e.code===n);return Lm(o,r)||!t?t:v(t,n,o,i)},getAlternatePath:(t,n)=>{if(n!==e.getLocale()&&m(n))return``;if(!a.domains||!t)return t;let r=e.getLocales();return y(t,n,r.find(e=>e.code===n),r)},resolveLocalizedRouteObject:(e,t)=>nh(e)?f(e,t):c(e,t)}}function ih(e){let t=e?._nuxtI18n?.composableCtx;if(!t)throw Error(`i18n context is not initialized. Ensure the i18n plugin is installed and the composable is used within a Vue component or setup function.`);return t}function ah(e,t=p()){let n=oh(t);return{...rh({router:Pe(),defaultLocale:e.getDefaultLocale(),configuredDefaultLocale:e.config.defaultLocale||``,getLocale:e.getLocale,getLocales:e.getLocales,getBaseUrl:e.getBaseUrl,getCanonicalBaseUrl:e.getCanonicalBaseUrl,getHost:()=>Dn({xForwardedHost:!0}).host,getLocalePathPayload:()=>!1,strategy:`no_prefix`,routing:!1,domains:!1,trailingSlash:!1,strictSeo:!1,compactRoutes:!1}),strictSeo:!1,_head:void 0,get head(){return this._head??=mn({}),this._head},metaState:{htmlAttrs:{},meta:[],link:[]},seoSettings:{dir:!1,lang:!1,seo:typeof e.config.experimental.strictSeo==`object`&&e.config.experimental.strictSeo||!1},localePathPayload:n,routingOptions:{defaultLocale:e.config.defaultLocale||``,domains:!1,strictCanonicals:e.config.experimental.alternateLinkCanonicalQueries??!0,hreflangLinks:!1}}}function oh(e=p()){let t=document.querySelector(`[data-nuxt-i18n-slp="${e._id}"]`)?.textContent;return JSON.parse(t||`{}`)}function sh(e){return e!=null&&`global`in e&&`mode`in e?e.global:e}function ch(e){let t=sh(e);return`__composer`in t?t.__composer:t}function lh(e,t){return e?e.$config.public.i18n:se(t).public.i18n}function uh(e){let t=lh(e).detectBrowserLanguage,n=t||{};
36return{...n,enabled:!!t,cookieKey:n.cookieKey||`i18n_redirected`}}function dh(e){if(e)return{path:`/`+(ir(e)?e:e.path).replace(/^\//,``),code:!ir(e)&&e.statusCode||302}}var fh={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`};function ph(e){return e.replace(/["'&<>]/g,e=>fh[e])}var mh=()=>xn(`i18n:cached-locale-configs`,()=>void 0),hh=()=>xn(`i18n:resolved-locale`,()=>``);function gh(e,t){let n=!lr(t)&&ae(t).protocol;return n?{host:e.host,protocol:n}:e}function _h(e){let{baseUrl:t,appBase:n,domains:r,getDomainForHost:i,getDomainFromLocale:a}=e,o=lr(t)?t:()=>r&&i()||t||``;return e=>ie(e&&a(e)||o(),n)}function vh({cookieCrossOrigin:e,cookieDomain:t,cookieSecure:n,cookieKey:r}){let i=new Date;return Cn(r||`i18n_redirected`,{path:`/`,readonly:!1,expires:new Date(i.setDate(i.getDate()+365)),sameSite:e?`none`:`lax`,domain:t||void 0,secure:e||n})}var yh=ym({dynamic:[],undeliverable:[]});function bh(e,t,n,r=!1){let i=sh(t),a=lh(e),o=uh(e),s=mh(),c=vh(o),l=new Set,u=e=>s.value[e],d,f=()=>d??=gh(Dn({xForwardedHost:!0}),a.baseUrl),p=_h({baseUrl:lr(a.baseUrl)?()=>a.baseUrl(e):a.baseUrl,appBase:e.$config.app.baseURL,domains:!1,getDomainForHost:()=>Km(a.domainLocales,f()),getDomainFromLocale:e=>Gm(a.domainLocales,f(),e)}),m=p,h=hh(),g=bm({ssr:!0,ssg:!1,prerender:!1,dynamic:[],undeliverable:[]}),_=e=>``,v=async t=>{if(!(t in cm))return;let n=await e.runWithContext(()=>_m(t,cm[t])),a=r?fm(n):n;i.mergeLocaleMessage(t,a)},y=async e=>{if(!(e in cm))return;let t=e=>Object.keys(e).filter(e=>!b.usesRuntimeLoaders(e)),n=u(e)?.cacheable?{}:{"Cache-Control":`no-cache`},r=ie(_(e),`/_i18n`,{"es-PY":`04c09417`,"es-BO":`04c09417`,en:`04c09417`,fr:`04c09417`,he:`04c09417`}[e],e,`messages.json`),a=await $fetch(r,{headers:n});for(let e of t(a))i.mergeLocaleMessage(e,a[e])},b={vueI18n:t,initial:!0,preloaded:!1,config:a,rootRedirect:dh(a.rootRedirect),redirectStatusCode:a.redirectStatusCode??302,usesRuntimeLoaders:e=>g(e),getDefaultLocale:()=>n,getLocale:()=>C(i.locale),setLocale:async t=>{let n=b.getLocale();t!==n&&eh(t)&&(Ke(i.locale)?i.locale.value=t:i.locale=t,await e.callHook(`i18n:localeSwitched`,{newLocale:t,oldLocale:n}),h.value=t)},setLocaleSuspend:async t=>{eh(t)&&(b.vueI18n.__pendingLocale=t,b.vueI18n.__pendingLocalePromise=new Promise(e=>{b.vueI18n.__resolvePendingLocalePromise=async()=>{b.setCookieLocale(t),await b.setLocale(t),b.vueI18n.__pendingLocale=void 0,e()}}),(e.isHydrating||!b.config.skipSettingLocaleOnNavigate)&&await b.vueI18n.__resolvePendingLocalePromise?.())},getLocales:()=>C(i.locales).map(e=>ir(e)?{code:e,domains:[],defaultForDomains:[]}:e),setCookieLocale:e=>{o.useCookie&&eh(e)&&(c.value=e)},getBaseUrl:p,getCanonicalBaseUrl:m,loadMessages:async t=>{if(!(e.isHydrating&&l.has(t)))try{let e=u(t)?.fallbacks??[],n=e.includes(t)?e:[...e,t];if(!n.some(e=>b.usesRuntimeLoaders(e)))return await y(t);for(let e of n)try{await(b.usesRuntimeLoaders(e)?v(e):y(e))}catch(t){console.warn(`Failed to load messages for locale "${e}"`,t)}}catch(e){console.warn(`Failed to load messages for locale "${t}"`,e)}finally{l.add(t)}},composableCtx:void 0};return b.composableCtx=ah(b,e),b}function xh(e){if(e._nuxtI18n==null)throw Error(`Nuxt I18n context has not been set up yet.`);return e._nuxtI18n}function Sh(e,t,n=e.getLocale()){if(ir(t)&&Je(t,{acceptRelative:!0}))return t;try{return Th(e,t,n).fullPath}catch{return``}}function Ch(e,t,n=e.getLocale()){try{return Th(e,t,n)}catch{return}}function wh(e){if(!ir(e))return cr({},e);if(e[0]===`/`){let{pathname:t,search:n,hash:r}=o(e);return{path:t,query:Ye(n),hash:r}}return{name:e}}function Th(e,t,n){let r=wh(t),i=e.resolveLocalizedRouteObject(r,n);i.name&&(i.path=void 0);let a=e.router.resolve(i);return a.name?a:e.router.resolve(t)}function Eh(e,t,n=e.router.currentRoute.value){let r=e.getRouteBaseName(n);if(!r)return``;let i=Sh(e,{name:r,params:cr({},n.params,e.getLocalizedDynamicParams(t)),fullPath:n.fullPath,query:n.query,hash:n.hash,meta:n.meta},t);return e.afterSwitchLocalePath(i,t)}function Dh(e,t){let n=[];for(let[r,i]of t.entries()){let a=e.find(e=>e.language?.toLowerCase()===i.toLowerCase());if(a){n.push({code:a.code,score:1-r/t.length});break}}for(let[r,i]of t.entries()){let a=i.split(`-`)[0].toLowerCase(),o=e.find(e=>e.language?.split(`-`)[0].toLowerCase()===a);if(o){n.push({code:o.code,score:.999-r/t.length});break}}return n}function Oh(e,t){return e.score===t.score?t.code.length-e.code.length:t.score-e.score}function kh(e,t){return Dh(e.map(e=>({code:e.code,language:e.language||e.code})),t).sort(Oh).at(0)?.code??``}var Ah=(e,t)=>Cn(t).value||void 0,jh=(e,t)=>Nm(t),Mh=e=>kh(um,navigator.languages),Nh=e=>new URL(window.location.href).host,Ph=e=>{let t=document.referrer;try{return t&&new URL(t).host||void 0}catch{return}},Fh=e=>um.map(t=>qm(t,e)),Ih=(e,t,n)=>{let r=lh(n),i,a,o=()=>i??=Nh(e),s=()=>a??=Fh(r.domainLocales);return{cookie:()=>Ah(e,t.cookieKey),header:()=>void 0,navigator:()=>Mh(e),host:e=>Hm(s(),o(),Am(e)),route:t=>jh(e,t),onHost:e=>!e||zm(s(),o(),e)?e:void 0,fromOwnDomain:()=>{let t=Ph(e);return!!t&&s().some(e=>Lm(e,t))},cookieSpans:()=>!!t.cookieDomain&&Um(s(),t.cookieDomain)}};function Lh(e){let{detection:t,routing:n,domains:r}=e,i=e.isSupportedLocale??eh;function a(e,r){return n?!!(t.redirectOn===`root`&&e!==`/`||t.redirectOn===`no prefix`&&!t.alwaysRedirect&&i(r)):!1}return function(e,s,c){let l=ir(s)?o(s).pathname:s.path,u=e=>e,d=r?e.onHost:u;function*f(){let i=c&&t.enabled&&!a(l,e.route(l));if(i){let t=r&&!e.fromOwnDomain(),n=t&&e.cookieSpans()?u:d,i=t?u:d;yield n(e.cookie()),yield i(e.header()),yield i(e.navigator())}r&&(yield e.host(l)),n&&(yield e.route(s)),i&&(yield d(t.fallbackLocale))}for(let e of f())if(e&&i(e))return e;return``}}
36async function Rh(e,t){let n=xh(e),r=n.getLocale();if(t===r&&!n.initial&&(!n.vueI18n.__pendingLocale||n.vueI18n.__pendingLocale===t))return t;let i={oldLocale:r,newLocale:t,initialSetup:n.initial,context:e},a=await e.callHook(`i18n:beforeLocaleSwitch`,i);return a??=i.newLocale,eh(a)&&(t=a),await n.loadMessages(t),await n.setLocaleSuspend(t),t}function zh(e,t){let n=uh(e),r=Ih(dr(e),n,e),i=xh(e);return Lh({detection:n,routing:!1,domains:!1})(r,t,i.initial)||i.getLocale()||i.getDefaultLocale()||``}var Bh=E({name:`i18n:plugin:route-locale-detect`,dependsOn:[`i18n:plugin`],async setup(e){let t,r,i=p(e._id),a=xh(i),o=hh();[t,r]=n(()=>i.runWithContext(()=>Rh(i,a.initial&&o.value||zh(i,i.$router.currentRoute.value)))),await t,r()}},1);function Vh(e,{extendComposer:t,extendComposerInstance:n}){let r=Oe(),i=e.install.bind(e);e.install=(a,...o)=>{let s=cr({},o[0]);s.__composerExtend=t=>(n(t,ch(e)),()=>{}),e.mode===`legacy`&&(s.__vueI18nExtend=e=>(n(e,ch(e)),()=>{})),Reflect.apply(i,e,[a,s]);let c=ch(e);if(r.run(()=>{t(c),e.mode===`legacy`&&`__composer`in e.global&&n(e.global,ch(e.global))}),e.mode===`composition`&&a.config.globalProperties.$i18n!=null&&n(a.config.globalProperties.$i18n,c),a.unmount){let e=a.unmount.bind(a);a.unmount=()=>{r.stop(),e()}}}}function Hh(e,t=e.getCurrentLanguage(),n=e.getCurrentDirection()){let r={htmlAttrs:{},link:[],meta:[]};if(e.dir&&(r.htmlAttrs.dir=n),e.lang&&t&&(r.htmlAttrs.lang=t),e.seo){let t=e.strictCanonicals?e.getRouteWithoutQuery():void 0,n=Wh(e,t),i=Kh(e,t);r.link=r.link.concat(n,qh(e,i)),r.meta=r.meta.concat(Yh(e,i),Xh(e),Qh(e,Zh(e,n)))}return r}function Uh(e){let t=new Map;for(let n of e){if(!n.language){console.warn("Locale `language` ISO code is required to generate alternate link");continue}let[e,r]=n.language.split(`-`);e&&r&&(n.isCatchallLocale||!t.has(e))&&t.set(e,n),t.set(n.language,n)}return t}function Wh(e,t=e.strictCanonicals?e.getRouteWithoutQuery():void 0){if(!e.hreflangLinks)return[];let n=[],r=Uh(e.locales),i=new Map;for(let[a,o]of r.entries()){let r=i.get(o.code)??Gh(o.code,e,t);if(!r)continue;i.set(o.code,r);let s=e.strictSeo?{rel:`alternate`,href:r,hreflang:a}:{[e.key]:`i18n-alt-${a}`,rel:`alternate`,href:r,hreflang:a};n.push(s),e.defaultLocale&&e.defaultLocale===o.code&&n[0].hreflang!==`x-default`&&n.unshift(e.strictSeo?{rel:`alternate`,href:r,hreflang:`x-default`}:{[e.key]:`i18n-xd`,rel:`alternate`,href:r,hreflang:`x-default`})}return n}function Gh(e,t,n=t.strictCanonicals?t.getRouteWithoutQuery():void 0){let r=t.getLocalizedRoute(e,n);if(r)return S(l(r,t.baseUrl),t.strictCanonicals?Jh(t):{})}function Kh(e,t=e.strictCanonicals?e.getRouteWithoutQuery():void 0){let n=e.getLocalizedRoute(e.currentLocale,t);return n?S(l(n,e.baseUrl),Jh(e)):``}function qh(e,t=Kh(e)){return t?[e.strictSeo?{rel:`canonical`,href:t}:{[e.key]:`i18n-can`,rel:`canonical`,href:t}]:[]}function Jh(e,t=e.getCurrentRoute()){if(!e.canonicalQueries.length)return{};let n=e.getLocaleRoute(Object.assign({},t,{path:void 0,name:e.getRouteBaseName(t)}))?.query??{},r={};for(let t of e.canonicalQueries.filter(e=>e in n)){r[t]??=[];for(let e of eg(n[t]))r[t].push(e||``)}return r}function Yh(e,t=Kh(e)){return t?[e.strictSeo?{property:`og:url`,content:t}:{[e.key]:`i18n-og-url`,property:`og:url`,content:t}]:[]}function Xh(e,t=e.getCurrentLanguage()){return t?[e.strictSeo?{property:`og:locale`,content:$h(t)}:{[e.key]:`i18n-og`,property:`og:locale`,content:$h(t)}]:[]}function Zh(e,t){let n=e.locales.map(e=>e.language||e.code);if(!e.strictSeo)return n;let r=new Set(t.map(e=>e.hreflang));return n.filter(e=>r.has(e))}function Qh(e,t,n=e.getCurrentLanguage()){return t.filter(e=>e&&e!==n).map(t=>e.strictSeo?{property:`og:locale:alternate`,content:$h(t)}:{[e.key]:`i18n-og-alt-${t}`,property:`og:locale:alternate`,content:$h(t)})}function $h(e=``){return e.replace(/-/g,`_`)}function eg(e){return Array.isArray(e)?e:[e]}function tg(e,t,n=e.getLocale(),r=e.getLocales(),i=e.routingOptions.domains?e.getBaseUrl(n):e.getBaseUrl()){let a=r.find(e=>e.code===n)||{code:n},o=[...new Set(typeof t.seo==`object`&&t.seo?.canonicalQueries||[])],s={...e,afterSwitchLocalePath:e.getAlternatePath};
36if(!i&&!e.routingOptions.domains){if(e.strictSeo)throw Error("I18n `baseUrl` is required to generate valid SEO tag links.");console.warn("I18n `baseUrl` is required to generate valid SEO tag links.")}return{...t,key:e.strictSeo?`key`:`id`,strictSeo:e.strictSeo,locales:r,currentLocale:n,baseUrl:i,canonicalQueries:o,hreflangLinks:e.routingOptions.hreflangLinks,defaultLocale:e.routingOptions.defaultLocale,strictCanonicals:e.strictSeo||e.routingOptions.strictCanonicals,getRouteBaseName:e.getRouteBaseName,getCurrentRoute:()=>e.router.currentRoute.value,getCurrentLanguage:()=>a.language,getCurrentDirection:()=>a.dir||`ltr`,getLocaleRoute:t=>Ch(e,t),getLocalizedRoute:(e,t)=>Eh(s,e,t),getRouteWithoutQuery:()=>{try{return cr({},e.router.resolve({query:{}}),{meta:e.router.currentRoute.value.meta})}catch{return}}}}function ng(e,{dir:t=!0,lang:n=!0,seo:r=!0}){return Hh(tg(e,{dir:t,lang:n,seo:r}))}function rg(e=p()){let t=ih(e);return e=>{if(e!=null)return t.getRouteBaseName(e)||void 0}}function ig(e=p()){let t=ih(e);return(e,n)=>Sh(t,e,n)}function ag(e=p()){let t=ih(e);return(e,n)=>Ch(t,e,n)}function og(e=p()){let t=ih(e);return e=>Eh(t,e)}var sg=async e=>{let t=await mm(lm);t.locale=e||t.locale||`en-US`,t.defaultLocale=e,t.fallbackLocale??=!1,t.messages??={};for(let e of sm)t.messages[e]??={};return t},cg=E({name:`i18n:plugin`,parallel:!1,async setup(e){let t,r;Object.defineProperty(e.versions,"nuxtI18n",{get:()=>`10.6.0`});let i=p(e._id),a=lh(i),o=i.ssrContext?.event?.context?.nuxtI18n?.vueI18nOptions,s=$m(Dn({xForwardedHost:!0}).host,a.defaultLocale),c=o||([t,r]=n(()=>sg(s)),t=await t,r(),t),l=mh();l.value??=Jm(c.fallbackLocale),pr(sm.filter(yh).map(e=>`/_i18n/${{"es-PY":`04c09417`,"es-BO":`04c09417`,en:`04c09417`,fr:`04c09417`,he:`04c09417`}[e]}/${e}/messages.json`));let u=ur(c),d=Ih(dr(i),uh(i),i),f=bh(i,u,c.defaultLocale,!!c.flatJson);i._nuxtI18n=f,Vh(u,{extendComposer(e){e.locales=M(()=>a.locales.map(e=>qm(e,a.domainLocales))),e.localeCodes=M(()=>sm);let t=R(f.getBaseUrl());e.baseUrl=M(()=>t.value),m(e.locale,()=>t.value=f.getBaseUrl()),e.strategy=`no_prefix`,e.localeProperties=M(()=>qm(um.find(t=>t.code===e.locale.value)||{code:e.locale.value,domains:[],defaultForDomains:[]},a.domainLocales)),e.setLocale=async e=>{await Rh(i,e),await i.runWithContext(()=>(i.$router.currentRoute.value,void 0))},e.loadLocaleMessages=f.loadMessages,e.differentDomains=!1,e.defaultLocale=c.defaultLocale,e.getBrowserLocale=()=>th(d.navigator()),e.getLocaleCookie=()=>th(d.cookie()),e.setLocaleCookie=f.setCookieLocale,e.finalizePendingLocaleChange=async()=>{u.__pendingLocale&&await u.__resolvePendingLocalePromise?.()},e.waitForPendingLocaleChange=async()=>{await u?.__pendingLocalePromise}},extendComposerInstance(e,t){let n=[[`locales`,()=>t.locales],[`localeCodes`,()=>t.localeCodes],[`baseUrl`,()=>t.baseUrl],[`strategy`,()=>`no_prefix`],[`localeProperties`,()=>t.localeProperties],[`setLocale`,()=>e=>Reflect.apply(t.setLocale,t,[e])],[`loadLocaleMessages`,()=>e=>Reflect.apply(t.loadLocaleMessages,t,[e])],[`differentDomains`,()=>!1],[`defaultLocale`,()=>t.defaultLocale],[`getBrowserLocale`,()=>()=>Reflect.apply(t.getBrowserLocale,t,[])],[`getLocaleCookie`,()=>()=>Reflect.apply(t.getLocaleCookie,t,[])],[`setLocaleCookie`,()=>e=>Reflect.apply(t.setLocaleCookie,t,[e])],[`finalizePendingLocaleChange`,()=>()=>Reflect.apply(t.finalizePendingLocaleChange,t,[])],[`waitForPendingLocaleChange`,()=>()=>Reflect.apply(t.waitForPendingLocaleChange,t,[])]];for(let[t,r]of n)Object.defineProperty(e,t,{get:r})}}),i.vueApp.use(u),Object.defineProperty(i,"$i18n",{get:()=>sh(u)}),i.provide(`localeHead`,e=>ng(i._nuxtI18n.composableCtx,e)),i.provide(`localePath`,ig(i)),i.provide(`localeRoute`,ag(i)),i.provide(`routeBaseName`,rg(i)),i.provide(`getRouteBaseName`,rg(i)),i.provide(`switchLocalePath`,og(i))}},1),lg=`nuxt-i18n-slp`,ug=new RegExp([`<!--${lg}-\\[(\\w+)\\]-->`,`.+?`,`<!--/${lg}-->`].join(``),`g`),dg=E({name:`i18n:plugin:switch-locale-path-ssr`,dependsOn:[`i18n:plugin`],setup(e){let t=p(e._id),n=og(t);t.hook(`app:rendered`,e=>{e.renderResult?.html!=null&&(e.renderResult.html=e.renderResult.html.replaceAll(ug,(e,t)=>{let r=ph(n(t??``));return e.replace(/href="([^"]+)"/,()=>`href="${r||`#`}" `)}))})}}),fg=E({name:`i18n:plugin:preload`,dependsOn:[`i18n:plugin`],async setup(e){}},1),pg={inherit:`inherit`,current:`currentcolor`,transparent:`transparent`,black:`#000`,white:`#fff`,slate:{50:`oklch(98.4% 0.003 247.858)`,100:`oklch(96.8% 0.007 247.896)`,200:`oklch(92.9% 0.013 255.508)`,300:`oklch(86.9% 0.022 252.894)`,400:`oklch(70.4% 0.04 256.788)`,500:`oklch(55.4% 0.046 257.417)`,600:`oklch(44.6% 0.043 257.281)`,700:`oklch(37.2% 0.044 257.287)`,800:`oklch(27.9% 0.041 260.031)`,900:`oklch(20.8% 0.042 265.755)`,950:`oklch(12.9% 0.042 264.695)`},gray:{50:`oklch(98.5% 0.002 247.839)`,100:`oklch(96.7% 0.003 264.542)`,200:`oklch(92.8% 0.006 264.531)`,300:`oklch(87.2% 0.01 258.338)`,400:`oklch(70.7% 0.022 261.325)`,500:`oklch(55.1% 0.027 264.364)`,600:`oklch(44.6% 0.03 256.802)`,700:`oklch(37.3% 0.034 259.733)`,800:`oklch(27.8% 0.033 256.848)`,900:`oklch(21% 0.034 264.665)`,950:`oklch(13% 0.028 261.692)`},zinc:{50:`oklch(98.5% 0 none)`,100:`oklch(96.7% 0.001 286.375)`,200:`oklch(92% 0.004 286.32)`,300:`oklch(87.1% 0.006 286.286)`,400:`oklch(70.5% 0.015 286.067)`,500:`oklch(55.2% 0.016 285.938)`,600:`oklch(44.2% 0.017 285.786)`,700:`oklch(37% 0.013 285.805)`,800:`oklch(27.4% 0.006 286.033)`,900:`oklch(21% 0.006 285.885)`,950:`oklch(14.1% 0.005 285.823)`},neutral:{50:`oklch(98.5% 0 none)`,100:`oklch(97% 0 none)`,200:`oklch(92.2% 0 none)`,300:`oklch(87% 0 none)`,400:`oklch(70.8% 0 none)`,500:`oklch(55.6% 0 n
36one)`,600:`oklch(43.9% 0 none)`,700:`oklch(37.1% 0 none)`,800:`oklch(26.9% 0 none)`,900:`oklch(20.5% 0 none)`,950:`oklch(14.5% 0 none)`},stone:{50:`oklch(98.5% 0.001 106.423)`,100:`oklch(97% 0.001 106.424)`,200:`oklch(92.3% 0.003 48.717)`,300:`oklch(86.9% 0.005 56.366)`,400:`oklch(70.9% 0.01 56.259)`,500:`oklch(55.3% 0.013 58.071)`,600:`oklch(44.4% 0.011 73.639)`,700:`oklch(37.4% 0.01 67.558)`,800:`oklch(26.8% 0.007 34.298)`,900:`oklch(21.6% 0.006 56.043)`,950:`oklch(14.7% 0.004 49.25)`},mauve:{50:`oklch(98.5% 0 none)`,100:`oklch(96% 0.003 325.6)`,200:`oklch(92.2% 0.005 325.62)`,300:`oklch(86.5% 0.012 325.68)`,400:`oklch(71.1% 0.019 323.02)`,500:`oklch(54.2% 0.034 322.5)`,600:`oklch(43.5% 0.029 321.78)`,700:`oklch(36.4% 0.029 323.89)`,800:`oklch(26.3% 0.024 320.12)`,900:`oklch(21.2% 0.019 322.12)`,950:`oklch(14.5% 0.008 326)`},olive:{50:`oklch(98.8% 0.003 106.5)`,100:`oklch(96.6% 0.005 106.5)`,200:`oklch(93% 0.007 106.5)`,300:`oklch(88% 0.011 106.6)`,400:`oklch(73.7% 0.021 106.9)`,500:`oklch(58% 0.031 107.3)`,600:`oklch(46.6% 0.025 107.3)`,700:`oklch(39.4% 0.023 107.4)`,800:`oklch(28.6% 0.016 107.4)`,900:`oklch(22.8% 0.013 107.4)`,950:`oklch(15.3% 0.006 107.1)`},mist:{50:`oklch(98.7% 0.002 197.1)`,100:`oklch(96.3% 0.002 197.1)`,200:`oklch(92.5% 0.005 214.3)`,300:`oklch(87.2% 0.007 219.6)`,400:`oklch(72.3% 0.014 214.4)`,500:`oklch(56% 0.021 213.5)`,600:`oklch(45% 0.017 213.2)`,700:`oklch(37.8% 0.015 216)`,800:`oklch(27.5% 0.011 216.9)`,900:`oklch(21.8% 0.008 223.9)`,950:`oklch(14.8% 0.004 228.8)`},taupe:{50:`oklch(98.6% 0.002 67.8)`,100:`oklch(96% 0.002 17.2)`,200:`oklch(92.2% 0.005 34.3)`,300:`oklch(86.8% 0.007 39.5)`,400:`oklch(71.4% 0.014 41.2)`,500:`oklch(54.7% 0.021 43.1)`,600:`oklch(43.8% 0.017 39.3)`,700:`oklch(36.7% 0.016 35.7)`,800:`oklch(26.8% 0.011 36.5)`,900:`oklch(21.4% 0.009 43.1)`,950:`oklch(14.7% 0.004 49.3)`},red:{50:`oklch(97.1% 0.013 17.38)`,100:`oklch(93.6% 0.032 17.717)`,200:`oklch(88.5% 0.062 18.334)`,300:`oklch(80.8% 0.114 19.571)`,400:`oklch(70.4% 0.191 22.216)`,500:`oklch(63.7% 0.237 25.331)`,600:`oklch(57.7% 0.245 27.325)`,700:`oklch(50.5% 0.213 27.518)`,800:`oklch(44.4% 0.177 26.899)`,900:`oklch(39.6% 0.141 25.723)`,950:`oklch(25.8% 0.092 26.042)`},orange:{50:`oklch(98% 0.016 73.684)`,100:`oklch(95.4% 0.038 75.164)`,200:`oklch(90.1% 0.076 70.697)`,300:`oklch(83.7% 0.128 66.29)`,400:`oklch(75% 0.183 55.934)`,500:`oklch(70.5% 0.213 47.604)`,600:`oklch(64.6% 0.222 41.116)`,700:`oklch(55.3% 0.195 38.402)`,800:`oklch(47% 0.157 37.304)`,900:`oklch(40.8% 0.123 38.172)`,950:`oklch(26.6% 0.079 36.259)`},amber:{50:`oklch(98.7% 0.022 95.277)`,100:`oklch(96.2% 0.059 95.617)`,200:`oklch(92.4% 0.12 95.746)`,300:`oklch(87.9% 0.169 91.605)`,400:`oklch(82.8% 0.189 84.429)`,500:`oklch(76.9% 0.188 70.08)`,600:`oklch(66.6% 0.179 58.318)`,700:`oklch(55.5% 0.163 48.998)`,800:`oklch(47.3% 0.137 46.201)`,900:`oklch(41.4% 0.112 45.904)`,950:`oklch(27.9% 0.077 45.635)`},yellow:{50:`oklch(98.7% 0.026 102.212)`,100:`oklch(97.3% 0.071 103.193)`,200:`oklch(94.5% 0.129 101.54)`,300:`oklch(90.5% 0.182 98.111)`,400:`oklch(85.2% 0.199 91.936)`,500:`oklch(79.5% 0.184 86.047)`,600:`oklch(68.1% 0.162 75.834)`,700:`oklch(55.4% 0.135 66.442)`,800:`oklch(47.6% 0.114 61.907)`,900:`oklch(42.1% 0.095 57.708)`,950:`oklch(28.6% 0.066 53.813)`},lime:{50:`oklch(98.6% 0.031 120.757)`,100:`oklch(96.7% 0.067 122.328)`,200:`oklch(93.8% 0.127 124.321)`,300:`oklch(89.7% 0.196 126.665)`,400:`oklch(84.1% 0.238 128.85)`,500:`oklch(76.8% 0.233 130.85)`,600:`oklch(64.8% 0.2 131.684)`,700:`oklch(53.2% 0.157 131.589)`,800:`oklch(45.3% 0.124 130.933)`,900:`oklch(40.5% 0.101 131.063)`,950:`oklch(27.4% 0.072 132.109)`},green:{50:`oklch(98.2% 0.018 155.826)`,100:`oklch(96.2% 0.044 156.743)`,200:`oklch(92.5% 0.084 155.995)`,300:`oklch(87.1% 0.15 154.449)`,400:`oklch(79.2% 0.209 151.711)`,500:`oklch(72.3% 0.219 149.579)`,600:`oklch(62.7% 0.194 149.214)`,700:`oklch(52.7% 0.154 150.069)`,800:`oklch(44.8% 0.119 151.328)`,900:`oklch(39.3% 0.095 152.535)`,950:`oklch(26.6% 0.065 152.934)`},emerald:{50:`oklch(97.9% 0.021 166.113)`,100:`oklch(95% 0.052 163.051)`,200:`oklch(90.5% 0.093 164.15)`,300:`oklch(84.5% 0.143 164.978)`,400:`oklch(76.5% 0.177 163.223)`,500:`oklch(69.6% 0.17 162.48)`,600:`oklch(59.6% 0.145 163.225)`,700:`oklch(50.8% 0.118 165.612)`,800:`oklch(43.2% 0.095 166.913)`,900:`oklch(37.8
36% 0.077 168.94)`,950:`oklch(26.2% 0.051 172.552)`},teal:{50:`oklch(98.4% 0.014 180.72)`,100:`oklch(95.3% 0.051 180.801)`,200:`oklch(91% 0.096 180.426)`,300:`oklch(85.5% 0.138 181.071)`,400:`oklch(77.7% 0.152 181.912)`,500:`oklch(70.4% 0.14 182.503)`,600:`oklch(60% 0.118 184.704)`,700:`oklch(51.1% 0.096 186.391)`,800:`oklch(43.7% 0.078 188.216)`,900:`oklch(38.6% 0.063 188.416)`,950:`oklch(27.7% 0.046 192.524)`},cyan:{50:`oklch(98.4% 0.019 200.873)`,100:`oklch(95.6% 0.045 203.388)`,200:`oklch(91.7% 0.08 205.041)`,300:`oklch(86.5% 0.127 207.078)`,400:`oklch(78.9% 0.154 211.53)`,500:`oklch(71.5% 0.143 215.221)`,600:`oklch(60.9% 0.126 221.723)`,700:`oklch(52% 0.105 223.128)`,800:`oklch(45% 0.085 224.283)`,900:`oklch(39.8% 0.07 227.392)`,950:`oklch(30.2% 0.056 229.695)`},sky:{50:`oklch(97.7% 0.013 236.62)`,100:`oklch(95.1% 0.026 236.824)`,200:`oklch(90.1% 0.058 230.902)`,300:`oklch(82.8% 0.111 230.318)`,400:`oklch(74.6% 0.16 232.661)`,500:`oklch(68.5% 0.169 237.323)`,600:`oklch(58.8% 0.158 241.966)`,700:`oklch(50% 0.134 242.749)`,800:`oklch(44.3% 0.11 240.79)`,900:`oklch(39.1% 0.09 240.876)`,950:`oklch(29.3% 0.066 243.157)`},blue:{50:`oklch(97% 0.014 254.604)`,100:`oklch(93.2% 0.032 255.585)`,200:`oklch(88.2% 0.059 254.128)`,300:`oklch(80.9% 0.105 251.813)`,400:`oklch(70.7% 0.165 254.624)`,500:`oklch(62.3% 0.214 259.815)`,600:`oklch(54.6% 0.245 262.881)`,700:`oklch(48.8% 0.243 264.376)`,800:`oklch(42.4% 0.199 265.638)`,900:`oklch(37.9% 0.146 265.522)`,950:`oklch(28.2% 0.091 267.935)`},indigo:{50:`oklch(96.2% 0.018 272.314)`,100:`oklch(93% 0.034 272.788)`,200:`oklch(87% 0.065 274.039)`,300:`oklch(78.5% 0.115 274.713)`,400:`oklch(67.3% 0.182 276.935)`,500:`oklch(58.5% 0.233 277.117)`,600:`oklch(51.1% 0.262 276.966)`,700:`oklch(45.7% 0.24 277.023)`,800:`oklch(39.8% 0.195 277.366)`,900:`oklch(35.9% 0.144 278.697)`,950:`oklch(25.7% 0.09 281.288)`},violet:{50:`oklch(96.9% 0.016 293.756)`,100:`oklch(94.3% 0.029 294.588)`,200:`oklch(89.4% 0.057 293.283)`,300:`oklch(81.1% 0.111 293.571)`,400:`oklch(70.2% 0.183 293.541)`,500:`oklch(60.6% 0.25 292.717)`,600:`oklch(54.1% 0.281 293.009)`,700:`oklch(49.1% 0.27 292.581)`,800:`oklch(43.2% 0.232 292.759)`,900:`oklch(38% 0.189 293.745)`,950:`oklch(28.3% 0.141 291.089)`},purple:{50:`oklch(97.7% 0.014 308.299)`,100:`oklch(94.6% 0.033 307.174)`,200:`oklch(90.2% 0.063 306.703)`,300:`oklch(82.7% 0.119 306.383)`,400:`oklch(71.4% 0.203 305.504)`,500:`oklch(62.7% 0.265 303.9)`,600:`oklch(55.8% 0.288 302.321)`,700:`oklch(49.6% 0.265 301.924)`,800:`oklch(43.8% 0.218 303.724)`,900:`oklch(38.1% 0.176 304.987)`,950:`oklch(29.1% 0.149 302.717)`},fuchsia:{50:`oklch(97.7% 0.017 320.058)`,100:`oklch(95.2% 0.037 318.852)`,200:`oklch(90.3% 0.076 319.62)`,300:`oklch(83.3% 0.145 321.434)`,400:`oklch(74% 0.238 322.16)`,500:`oklch(66.7% 0.295 322.15)`,600:`oklch(59.1% 0.293 322.896)`,700:`oklch(51.8% 0.253 323.949)`,800:`oklch(45.2% 0.211 324.591)`,900:`oklch(40.1% 0.17 325.612)`,950:`oklch(29.3% 0.136 325.661)`},pink:{50:`oklch(97.1% 0.014 343.198)`,100:`oklch(94.8% 0.028 342.258)`,200:`oklch(89.9% 0.061 343.231)`,300:`oklch(82.3% 0.12 346.018)`,400:`oklch(71.8% 0.202 349.761)`,500:`oklch(65.6% 0.241 354.308)`,600:`oklch(59.2% 0.249 0.584)`,700:`oklch(52.5% 0.223 3.958)`,800:`oklch(45.9% 0.187 3.815)`,900:`oklch(40.8% 0.153 2.432)`,950:`oklch(28.4% 0.109 3.907)`},rose:{50:`oklch(96.9% 0.015 12.422)`,100:`oklch(94.1% 0.03 12.58)`,200:`oklch(89.2% 0.058 10.001)`,300:`oklch(81% 0.117 11.638)`,400:`oklch(71.2% 0.194 13.428)`,500:`oklch(64.5% 0.246 16.439)`,600:`oklch(58.6% 0.253 17.585)`,700:`oklch(51.4% 0.222 16.935)`,800:`oklch(45.5% 0.188 13.697)`,900:`oklch(41% 0.159 10.272)`,950:`oklch(27.1% 0.105 12.094)`}},mg=[50,100,200,300,400,500,600,700,800,900,950];function hg(e,t){return e in pg&&typeof pg[e]==`object`&&t in pg[e]?pg[e][t]:``}function gg(e,t,n){let r=n?`${n}-`:``;return`${mg.map(n=>`--ui-color-${e}-${n}: var(--${r}color-${t===`neutral`?`old-neutral`:t}-${n}, ${hg(t,n)});`).join(` 37 `)}`}function _g(e,t){return`--ui-${e}: var(--ui-color-${e}-${t});`}function vg(){document.querySelector(`[data-nuxt-ui-colors]`)?.remove()}var yg=E(()=>{let e=hr(),t=p(),n=M(()=>{let{neutral:t,...n}=e.ui.colors,r=e.ui.prefix;return`@layer theme { 38 :root, :host {
39 ${Object.entries(e.ui.colors).map(([e,t])=>gg(e,t,r)).join(` 40 `)} 41 } 42 :root, :host, .light { 43 ${Object.keys(n).map(e=>_g(e,500)).join(` 44 `)} 45 } 46 .dark { 47 ${Object.keys(n).map(e=>_g(e,400)).join(` 48 `)} 49 } 50}`}),r={style:[{innerHTML:n,tagPriority:`critical`,id:`nuxt-ui-colors`}]};if(t.isHydrating&&!t.payload.serverRendered){let e=document.createElement(`style`);e.innerHTML=n.value,e.setAttribute(`data-nuxt-ui-colors`,``),document.head.appendChild(e);let t=vn().hooks?.hook(`dom:rendered`,()=>{vg(),t?.()})}mn(r)}),bg=3e5,xg=5e3,Sg=3e4,Cg=3,wg=3e4;function Tg(){try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(t?.startsWith(`sb-`)&&t.endsWith(`-auth-token`))return!0}}catch{}return!1}var Eg=4e3;function Dg(e){if(!e)return null;try{let t=e.split(`.`);if(t.length<2||!t[1])return null;let n=JSON.parse(atob(t[1].replace(/-/g,`+`).replace(/_/g,`/`)));return{iat:n.iat,exp:n.exp}}catch{return null}}var Og=bg,kg=E(async e=>{let t,r,i=Qn(),a=$n(),{logDebug:o}=Ln(),{markSessionPending:s,markSessionReady:c}=Fn(),l=null,u=0,d=0,f=0,p=null,h=()=>{l&&=(clearTimeout(l),null)},g=async t=>{let n=Date.now(),r=n-d;if(d&&r<Sg){let e=Sg-r;o(`auth.refresh.suppressed_recent`,{reason:t,now_ms:n,since_last_ms:r,wait_ms:e}),h(),l=setTimeout(()=>g(`${t}_after_floor`),e);return}let s=a.value,c=Dg(s?.access_token);o(`auth.refresh.attempt`,{reason:t,now_ms:n,expires_at:s?.expires_at??null,jwt_iat:c?.iat??null,jwt_exp:c?.exp??null,visibility:typeof document<`u`?document.visibilityState:null});try{await i.auth.refreshSession(),d=Date.now(),u=0}catch(n){u++;let r=n instanceof Error?n.message:String(n);if(o(`auth.refresh.failed`,{reason:t,consecutiveFailures:u,now_ms:Date.now()},r.slice(0,500)),u===Cg){let{submitBugReport:t}=await e.runWithContext(()=>Vn());t({category:`auth`,description:`[Auth] refreshSession failing (${u}Ã consecutive)`,errorMessage:r.slice(0,500),silent:!0}).catch(()=>{})}h(),l=setTimeout(()=>g(`retry_after_failure`),wg)}},_=(e,t,n,r)=>{h();let i=Date.now(),a=Dg(e),s=null,c=`none`;if(a?.iat&&a?.exp&&a.exp>a.iat?(s=(a.exp-a.iat)*1e3,c=`jwt_iat_exp`):t&&(s=t*1e3-i,c=`expires_at_fallback`),s===null){o(`auth.refresh.scheduled`,{reason:r,source:c,skipped:!0}),f=0,p=null;return}f=n,p=s;let u=Math.max(0,i-n),d=s-u,m=d-bg,_=Math.max(m,xg);o(`auth.refresh.scheduled`,{reason:r,source:c,now_ms:i,session_acquired_at_ms:n,elapsed_ms:u,lifetime_ms:s,remaining_ms:d,raw_delay_ms:m,delay_ms:_,clamped_to_min:m<xg,jwt_iat:a?.iat??null,jwt_exp:a?.exp??null,expires_at:t??null}),l=setTimeout(()=>g(r===`initial`?`scheduled_initial`:`scheduled`),_)},v=()=>!f||p===null?null:p-(Date.now()-f);o(`auth.refresh.plugin_init`,{now_ms:Date.now(),has_session:!!a.value,has_access_token:!!a.value?.access_token,expires_at:a.value?.expires_at??null});let y=null,b=!1;!a.value?.access_token&&Tg()&&(o(`auth.refresh.eager_gate_armed`,{now_ms:Date.now()}),b=!0,s(),y=setTimeout(()=>{o(`auth.refresh.eager_gate_safety_release`,{now_ms:Date.now()}),b=!1,y=null,c()},Eg));let x=()=>{y&&=(clearTimeout(y),null),b&&(b=!1,c())},S=!1,C=async e=>{if(S||!a.value?.access_token)return;S=!0;let t=Dg(a.value.access_token),n=t?.iat?t.iat*1e3:Date.now();_(a.value.access_token,a.value.expires_at,n,`initial`);let r=v();if(r===null||r>=Og){x();return}o(`auth.refresh.cold_start`,{now_ms:Date.now(),entry_reason:e,remaining_ms:r,already_expired:r<=0,expires_at:a.value?.expires_at??null}),y&&(clearTimeout(y),y=null,b=!1),s();try{await i.auth.refreshSession(),d=Date.now()}catch(t){let n=t instanceof Error?t.message:String(t);o(`auth.refresh.cold_start_failed`,{now_ms:Date.now(),entry_reason:e},n.slice(0,500))}finally{c()}};[t,r]=n(()=>C(`plugin_init`)),await t,r();let w=m(a,async e=>{if(S){w();return}e?.access_token&&(w(),await C(`late_hydration`))},{immediate:!1});i.auth.onAuthStateChange((e,t)=>{if(e===`SIGNED_OUT`){h(),x(),u=0,d=0,f=0,p=null;return}if(e===`SIGNED_IN`||e===`TOKEN_REFRESHED`){let n=Dg(t?.access_token),r=Date.now(),i=n?.iat?n.iat*1e3:null,a=i===null?0:r-i,o=i!==null&&a>1e4?i:r;_(t?.access_token,t?.expires_at,o,e.toLowerCase())}}),typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{if(document.visibilityState!==`visible`)return;let e=v();e!==null&&e<bg&&(o(`auth.refresh.visibility_catchup`,{now_ms:Date.now(),remaining_ms:e,expires_at:a.value?.expires_at??null}),g(`visibility_catchup`))})},1),Ag=E(()=>{window.Capacitor?.isNativePlatform?.()||p().hook(`app:chunkError`,()=>{let e=`chunk-reload`,t=sessionStorage.getItem(e),n=Date.now();t&&n-Number(t)<1e4||(sessionStorage.setItem(e,String(n)),window.location.reload())})}),jg=E({name:`keyboard`,async setup(){let e,t,{Capacitor:r}=([e,t]=n(()=>U(()=>import(`./CPKfJ3ml.js`),[],import.meta.url)),e=await e,t(),e);if(!r.isNativePlatform())return;let{Keyboard:i}=([e,t]=n(()=>U(()=>import(`./Dr14WhS0.js`),__vite__mapDeps([219,220]),import.meta.url)),e=await e,t(),e),a=xn(`keyboard:visible`,()=>!1),o=xn(`keyboard:height`,()=>0);
50i.addListener(`keyboardWillShow`,e=>{a.value=!0,o.value=e.keyboardHeight}),i.addListener(`keyboardWillHide`,()=>{a.value=!1,o.value=0})}},1),Mg=E(()=>{Ir()}),Ng=E({name:`piko:ui-locale`,dependsOn:[`i18n:plugin:route-locale-detect`],async setup(e){let t,r,i=e.$i18n.locale;if(xr()){let{Preferences:a}=([t,r]=n(()=>U(()=>import(`./rCkbfvuy.js`),__vite__mapDeps([221,6,220]),import.meta.url)),t=await t,r(),t);try{let o=([t,r]=n(()=>a.get({key:tr})),t=await t,r(),t);er(o.value)&&o.value!==i.value&&([t,r]=n(()=>e.$i18n.setLocale(o.value)),t=await t,r())}catch{}m(i,e=>{er(e)&&a.set({key:tr,value:e}).catch(()=>{})})}}},1),Pg=E({name:`piko:api-base`,dependsOn:[`piko:ui-locale`],async setup(e){let t,r,i=se(),a=i.public.apiBase,o=$n(),s=e.$i18n.locale;a||window.location.protocol===`capacitor:`&&console.error(`[api-base] Missing public.apiBase on native app. Relative /api calls will fail.`);let c=null;if(a&&xr()){let e=i.public.appVersion;try{let{Capacitor:i}=([t,r]=n(()=>U(()=>import(`./CPKfJ3ml.js`),[],import.meta.url)),t=await t,r(),t);if(i.isNativePlatform()){let{Device:i}=([t,r]=n(()=>U(()=>import(`./ZTRVpgAU.js`),__vite__mapDeps([222,6,220]),import.meta.url)),t=await t,r(),t),a=([t,r]=n(()=>i.getInfo()),t=await t,r(),t);c=[e?`v${e}`:null,a.platform,a.webViewVersion?`webview/${a.webViewVersion}`:null,a.manufacturer,a.model].filter(Boolean).join(`; `)}}catch{e&&(c=`v${e}`)}}let u=e=>!a||!e.startsWith(`/api/`)?e:`${a}${e}`,d=e=>{try{let t=new URL(e,window.location.origin);return t.pathname.startsWith(`/api/`)&&(t.origin===window.location.origin||!!a&&t.origin===new URL(a).origin)}catch{return e.startsWith(`/api/`)}},f=()=>a?o.value?.access_token??null:null,p=()=>a?In():Promise.resolve();globalThis.$fetch=globalThis.$fetch.create({async onRequest({options:e,request:t}){let n=typeof t==`string`?t:t.url,r=typeof t==`string`&&e.baseURL?l(n,e.baseURL):n;if(d(r)){a&&!e.baseURL&&n.startsWith(`/api/`)&&(e.baseURL=a),await p();let t=new Headers(e.headers);t.set(`Accept-Language`,s.value);let r=f();r&&t.set(`Authorization`,`Bearer ${r}`),c&&t.set(`X-App-Info`,c),e.headers=t}}});let m=globalThis.fetch.bind(globalThis),h=e=>{let t=f(),n=new Headers(e?.headers);return n.set(`Accept-Language`,s.value),t&&n.set(`Authorization`,`Bearer ${t}`),c&&n.set(`X-App-Info`,c),{...e,headers:n}};globalThis.fetch=((e,t)=>{if(typeof e==`string`&&e.startsWith(`/api/`))return p().then(()=>m(u(e),h(t)));if(typeof e==`string`)return d(e)?p().then(()=>m(e,h(t))):m(e,t);if(e instanceof URL){let n=u(e.toString());return d(n)?p().then(()=>m(n,h(t))):m(n,t)}return e instanceof Request&&d(e.url)?p().then(()=>{let n=new Request(new Request(u(e.url),e),t),r=f();return n.headers.set(`Accept-Language`,s.value),r&&n.headers.set(`Authorization`,`Bearer ${r}`),c&&n.headers.set(`X-App-Info`,c),m(n)}):m(e,t)})}},1),Fg=2e3,Ig=5,Lg=6e4,Rg=6e4;function zg(e){if(!e)return null;try{let t=e.split(`.`);if(t.length<2||!t[1])return null;let n=JSON.parse(atob(t[1].replace(/-/g,`+`).replace(/_/g,`/`)));return{iat:n.iat,exp:n.exp}}catch{return null}}var Bg=E({name:`piko:auth-recovery`,dependsOn:[`piko:ui-locale`],setup(){let{t:e}=Mn(),t=Pn(),{submitBugReport:n}=Vn(),r=Le(),i=Qn(),a=$n(),{logDebug:o}=Ln(),s=!!a.value,c=!1,l=[],u=0,d=!1;(async()=>{if(!d)try{let n=Date.now(),r=await an(`/api/health/time`),i=Date.now(),a=r?.now;if(typeof a!=`number`||!Number.isFinite(a))return;let s=(n+i)/2,c=a-s;if(o(`auth.clock_skew_probe`,{client_midpoint_ms:s,server_ms:a,offset_ms:c,rtt_ms:i-n}),Math.abs(c)<=Rg)return;d=!0,t.add({id:`auth-clock-skew`,title:e(`native.auth.clockTitle`),description:e(`native.auth.clockHelp`),color:`warning`,icon:`i-lucide-clock-alert`,duration:0})}catch{}})();let f=console.error;console.error=(...e)=>{let t=String(e[0]?.message??e[0]??``);if(t.includes(`Invalid Refresh Token`)||t.includes(`Refresh Token Not Found`)){console.debug(`[auth] Refresh token expired, session will be cleared`);return}f(...e)},p().provide(`markExplicitLogout`,()=>{c=!0}),i.auth.onAuthStateChange((i,a)=>{if((i===`SIGNED_IN`||i===`TOKEN_REFRESHED`)&&(s=!0,c=!1),i===`SIGNED_IN`||i===`TOKEN_REFRESHED`||i===`SIGNED_OUT`){let e=Date.now(),t=zg(a?.access_token),n=a?.expires_at??null;o(`auth.${i.toLowerCase()}`,{now_ms:e,expires_at:n,seconds_until_exp:n?n-Math.floor(e/1e3):null,jwt_iat:t?.iat??null,jwt_exp:t?.exp??null,iat_vs_client_skew_sec:t?.iat?Math.floor(e/1e3)-t.iat:null,visibility:typeof document<`u`?document.visibilityState:null,page:typeof window<`u`?window.location.pathname:null})}if(i===`TOKEN_REFRESHED`){let e=Date.now();for(l.push(e);l.length&&e-l[0]>Fg;)l.shift();if(l.length>=Ig&&e-u>Lg){u=e;let t=e-l[0],r=a?.expires_at,i=r?r-Math.floor(e/1e3):null,o=a?.user?.id??null;n({category:`auth`,description:`[Auth] Refresh token storm: ${l.length} rotations in ${t}ms`,errorMessage:JSON.stringify({rotations:l.length,windowMs:t,expires
50InSec:i,userId:o,userAgent:navigator.userAgent,visibility:document.visibilityState,tabs:typeof BroadcastChannel<`u`?`supported`:`none`}),silent:!0}).catch(()=>{})}}i===`SIGNED_OUT`&&s&&!c&&(s=!1,[`/ingresar`,`/verificar`,`/registrar`,`/auth/login`,`/auth/verify`,`/auth/register`].includes(r.path)||t.add({id:`auth-recovery`,title:e(`native.auth.expired`),description:e(`native.auth.loginAgain`),color:`warning`,icon:`i-lucide-log-out`}),[`/`,`/inicio`,`/ingresar`,`/verificar`,`/registrar`,`/about`,`/acerca`,`/privacidad`,`/terminos`,`/contacto`,`/pro`,`/anuncios`,`/u/`,`/@`,`/r/`,`/chat`,`/asistente`].some(e=>e===r.path||e.endsWith(`/`)&&r.path.startsWith(e))||ve(`/ingresar?redirect=${encodeURIComponent(r.fullPath)}`)),i===`SIGNED_OUT`&&(s=!1,c=!1)})}}),Vg=E({name:`piko:favorites-init`,dependsOn:[`piko:ui-locale`],setup(){let{isLoggedIn:e}=Hn(),{fetchFavoritedIds:t}=Rr();m(e,e=>{e&&t().catch(()=>{})},{immediate:!0})}}),Hg=E({name:`piko:geolocation`,dependsOn:[`piko:ui-locale`],setup(){let{isLoggedIn:e,user:t}=Hn(),{initPosition:n}=Sr();e.value&&t.value?.location_lat&&n()}}),Ug=E({name:`piko:local-notifications`,dependsOn:[`piko:ui-locale`],setup(){let{isLoggedIn:e}=Hn(),{locale:t}=Mn(),{scheduleAll:n,refreshLanguage:r}=Bn();Zn().catch(()=>{}),m(e,e=>{e&&n().catch(()=>{})},{immediate:!0}),m(t,()=>{e.value&&r().catch(()=>{})})}}),Wg=E({name:`piko:push-notifications`,dependsOn:[`piko:ui-locale`],setup(){let{isLoggedIn:e}=Hn(),t=$n(),{initPush:n,cleanupPush:r,pushToken:i,registerToken:a}=Un();m(e,e=>{e?n():r()},{immediate:!0}),m(()=>t.value?.access_token,e=>{e&&i.value&&a(i.value).catch(()=>{})})}});function Gg(){let{user:e}=Hn();async function t(){if(e.value)try{let{getDeviceInfo:t}=Gn(),n=await t(),r=n.platform===`web`||n.platform===`unknown`,i=Qn(),a={last_app_platform:r?`web`:n.platform,last_app_version:r?null:n.appVersion??null,last_device_model:r?null:[n.manufacturer,n.model].filter(Boolean).join(` `)||null},o=e.value.last_app_platform!==a.last_app_platform||e.value.last_app_version!==a.last_app_version||e.value.last_device_model!==a.last_device_model,s={last_seen_at:new Date().toISOString(),...o?a:{}};await i.from(`users`).update(s).eq(`id`,e.value.id)}catch{}}return{syncDeviceInfo:t}}var Kg=6e4,qg=[Ia,Ja,Qo,rs,Fp,Ip,Lp,Rp,zp,Bp,Hp,Up,Gp,qp,rm,om,Bh,cg,dg,fg,yg,kg,Ag,jg,Mg,Ng,Pg,Bg,Vg,Hg,Ug,Wg,E(()=>{if(window.Capacitor?.isNativePlatform?.())return;let e=$n(),{syncDeviceInfo:t}=Gg(),n=0,r=()=>{if(!e.value)return;let r=Date.now();r-n<Kg||(n=r,t())};m(e,e=>{e&&r()},{immediate:!0}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&r()})}),E(()=>{Br()}),E({name:`i18n:plugin:ssg-detect`,dependsOn:[`i18n:plugin`,`i18n:plugin:route-locale-detect`],enforce:`post`,setup(e){}})],Jg=N({__name:`DismissableLayerBranch`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=ti();return _e(()=>{Jr.branches.add(r.value)}),be(()=>{Jr.branches.delete(r.value)}),(e,r)=>(P(),z(C(Kr),j({ref:C(n)},t),{default:I(()=>[B(e.$slots,`default`)]),_:3},16))}}),Yg=N({__name:`ToastAnnounceExclude`,props:{altText:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){return(e,t)=>(P(),z(C(Kr),{as:e.as,"as-child":e.asChild,"data-reka-toast-announce-exclude":``,"data-reka-toast-announce-alt":e.altText||void 0},{default:I(()=>[B(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-reka-toast-announce-alt`]))}}),[Xg,Zg]=Hr(`ToastProvider`),Qg=N({inheritAttrs:!1,__name:`ToastProvider`,props:{label:{type:String,required:!1,default:`Notification`},duration:{type:Number,required:!1,default:5e3},disableSwipe:{type:Boolean,required:!1},swipeDirection:{type:String,required:!1,default:`right`},swipeThreshold:{type:Number,required:!1,default:50}},setup(e){let t=e,{label:n,duration:r,disableSwipe:i,swipeDirection:a,swipeThreshold:o}=oe(t);ni({isProvider:!0});let s=R(),c=R(0),l=R(!1),u=R(!1);if(t.label&&typeof t.label==`string`&&!t.label.trim())throw Error("Invalid prop `label` supplied to `ToastProvider`. Expected non-empty `string`.");return Zg({label:n,duration:r,disableSwipe:i,swipeDirection:a,swipeThreshold:o,toastCount:c,viewport:s,onViewportChange(e){s.value=e},onToastAdd(){c.value++},onToastRemove(){c.value--},isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:u}),(e,t)=>B(e.$slots,`default`)}}),$g=N({__name:`ToastAnnounce`,setup(e){let t=Xg(),n=Or(1e3),r=R(!1),i=0,a=0;return jr&&(i=requestAnimationFrame(()=>{a=requestAnimationFrame(()=>{r.value=!0})}),Re(()=>{cancelAnimationFrame(i),cancelAnimationFrame(a)}
50)),(e,i)=>C(n)||r.value?(P(),z(C(ri),{key:0,feature:`fully-hidden`},{default:I(()=>[d(L(C(t).label.value)+` `,1),B(e.$slots,`default`)]),_:3})):V(`v-if`,!0)}}),e_=`toast.viewportPause`,t_=`toast.viewportResume`;function n_(e,t,n){let r=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function r_(e,t,n=0){let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n}function i_(e){return e.nodeType===e.ELEMENT_NODE}function a_(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),i_(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.rekaToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.rekaToastAnnounceAlt;n&&t.push(n)}else t.push(...a_(e))}}}),t}var[o_,s_]=Hr(`ToastRoot`),c_=N({inheritAttrs:!1,__name:`ToastRootImpl`,props:{type:{type:String,required:!1},open:{type:Boolean,required:!1,default:!1},duration:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`li`}},emits:[`close`,`escapeKeyDown`,`pause`,`resume`,`swipeStart`,`swipeMove`,`swipeCancel`,`swipeEnd`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=ti(),{CollectionItem:o}=ni(),s=Xg(),l=R(null),u=R(null),f=M(()=>typeof n.duration==`number`?n.duration:s.duration.value),p=R(0),h=R(f.value),g=R(0),_=R(f.value),v=Pr(()=>{let e=Date.now()-p.value;_.value=Math.max(h.value-e,0)},{fpsLimit:60});function y(e){e<=0||e===1/0||jr&&(window.clearTimeout(g.value),p.value=Date.now(),g.value=window.setTimeout(b,e))}function b(e){let t=e?.pointerType===``;a.value?.contains(Wr())&&t&&s.viewport.value?.focus(),t&&(s.isClosePausedRef.value=!1),r(`close`)}let x=M(()=>a.value?a_(a.value):null);if(n.type&&![`foreground`,`background`].includes(n.type))throw Error("Invalid prop `type` supplied to `Toast`. Expected `foreground | background`.");return ce(e=>{let t=s.viewport.value;if(t){let n=()=>{y(h.value),v.resume(),r(`resume`)},i=()=>{let e=Date.now()-p.value;h.value-=e,window.clearTimeout(g.value),v.pause(),r(`pause`)};t.addEventListener(e_,i),t.addEventListener(t_,n),e(()=>{t.removeEventListener(e_,i),t.removeEventListener(t_,n)})}}),m(()=>[n.open,f.value],()=>{h.value=f.value,n.open&&!s.isClosePausedRef.value&&y(f.value)},{immediate:!0}),Fr(`Escape`,e=>{r(`escapeKeyDown`,e),e.defaultPrevented||(s.isFocusedToastEscapeKeyDownRef.value=!0,b())}),_e(()=>{s.onToastAdd()}),be(()=>{s.onToastRemove()}),s_({onClose:b}),(e,t)=>(P(),A(F,null,[x.value?(P(),z($g,{key:0,role:`alert`,"aria-live":e.type===`foreground`?`assertive`:`polite`},{default:I(()=>[V(` 51 Render each chunk as its own text node so screen readers get the 52 natural pause break between nodes (see comment in utils.ts). 53 Interpolating the array directly with \`{{ announceTextContent }}\` 54 would route through Vue's \`toDisplayString\`, which JSON-stringifies 55 arrays â the live region would then announce literal \`[\`, quotes 56 and commas instead of the toast title and description. 57 `),(P(!0),A(F,null,k(x.value,(e,t)=>(P(),A(F,{key:t},[d(L(e),1)],64))),128))]),_:1},8,[`aria-live`])):V(`v-if`,!0),C(s).viewport.value?(P(),z(qe,{key:1,to:C(s).viewport.value},[c(C(o),null,{default:I(()=>[c(C(Kr),j({ref:C(i),tabindex:`0`},e.$attrs,{as:e.as,"as-child":e.asChild,"data-state":e.open?`open`:`closed`,"data-swipe-direction":C(s).swipeDirection.value,style:C(s).disableSwipe.value?void 0:{userSelect:`none`,touchAction:`none`},onPointerdown:t[0]||=ct(e=>{C(s).disableSwipe.value||(l.value={x:e.clientX,y:e.clientY})},[`left`]),onPointermove:t[1]||=e=>{if(C(s).disableSwipe.value||!l.value)return;let t=e.clientX-l.value.x,n=e.clientY-l.value.y,i=!!u.value,a=[`left`,`right`].includes(C(s).swipeDirection.value),o=[`left`,`up`].includes(C(s).swipeDirection.value)?Math.min:Math.max,c=a?o(0,t):0,d=a?0:o(0,n),f=e.pointerType===`touch`?10:2,p={x:c,y:d},m={originalEvent:e,delta:p};i?(u.value=p,C(n_)(C(`toast.swipeMove`),e=>r(`swipeMove`,e),m)):C(r_)(p,C(s).swipeDirection.value,f)?(u.value=p,C(n_)(C(`toast.swipeStart`),e=>r(`swipeStart`,e),m),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>f||Math.abs(n)>f)&&(l.value=null)},onPointerup:t[2]||=e=>{if(C(s).disableSwipe.value)return;let t=u.value,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),u.value=null,l.value=null,t){let n=e.currentTarget,i={originalEvent:e,delta:t};C(r_)(t,C(s).swipeDirection.value,C(s).swipeThreshold.value)?C(n_)(C(`toast.swipeEnd`),e=>r(`swipeEnd`,e),i):C(n_)(C(`toast.swipeCancel`),e=>r(`swipeCancel`,e),i),n?.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}}}),{default:I(()=>[B(e.$slots,`default`,{remaining:_.value,duration:f.value})]),_:3},16,[`as`,`as-child`,`data-state`,`data-swipe-direction`,`style`])]),_:3})],8,[`to`])):V(`v-if`,!0)],64))}}),l_=N({__name:`ToastClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=o_(),{forwardRef:r}=ti();return(e,i)=>
57(P(),z(Yg,{"as-child":``},{default:I(()=>[c(C(Kr),j(t,{ref:C(r),type:e.as===`button`?`button`:void 0,onClick:C(n).onClose}),{default:I(()=>[B(e.$slots,`default`)]),_:3},16,[`type`,`onClick`])]),_:3}))}}),u_=N({__name:`ToastAction`,props:{altText:{type:String,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){if(!e.altText)throw Error("Missing prop `altText` expected on `ToastAction`");let{forwardRef:t}=ti();return(e,n)=>e.altText?(P(),z(Yg,{key:0,"alt-text":e.altText,"as-child":``},{default:I(()=>[c(l_,{ref:C(t),as:e.as,"as-child":e.asChild},{default:I(()=>[B(e.$slots,`default`)]),_:3},8,[`as`,`as-child`])]),_:3},8,[`alt-text`])):V(`v-if`,!0)}}),d_=N({__name:`ToastDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return ti(),(e,n)=>(P(),z(C(Kr),r(rt(t)),{default:I(()=>[B(e.$slots,`default`)]),_:3},16))}}),f_=N({__name:`ToastPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(P(),z(C(Xr),r(rt(t)),{default:I(()=>[B(e.$slots,`default`)]),_:3},16))}}),p_=N({__name:`ToastRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!0},forceMount:{type:Boolean,required:!1},type:{type:String,required:!1,default:`foreground`},open:{type:Boolean,required:!1,default:void 0},duration:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`li`}},emits:[`escapeKeyDown`,`pause`,`resume`,`swipeStart`,`swipeMove`,`swipeCancel`,`swipeEnd`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i}=ti(),a=Mr(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return(e,t)=>(P(),z(C(tn),{present:e.forceMount||C(a)},{default:I(()=>[c(c_,j({ref:C(i),open:C(a),type:e.type,as:e.as,"as-child":e.asChild,duration:e.duration},e.$attrs,{onClose:t[0]||=e=>a.value=!1,onPause:t[1]||=e=>r(`pause`),onResume:t[2]||=e=>r(`resume`),onEscapeKeyDown:t[3]||=e=>r(`escapeKeyDown`,e),onSwipeStart:t[4]||=e=>{r(`swipeStart`,e),e.defaultPrevented||e.currentTarget.setAttribute(`data-swipe`,`start`)},onSwipeMove:t[5]||=e=>{if(r(`swipeMove`,e),!e.defaultPrevented){let{x:t,y:n}=e.detail.delta,r=e.currentTarget;r.setAttribute(`data-swipe`,`move`),r.style.setProperty(`--reka-toast-swipe-move-x`,`${t}px`),r.style.setProperty(`--reka-toast-swipe-move-y`,`${n}px`)}},onSwipeCancel:t[6]||=e=>{if(r(`swipeCancel`,e),!e.defaultPrevented){let t=e.currentTarget;t.setAttribute(`data-swipe`,`cancel`),t.style.removeProperty(`--reka-toast-swipe-move-x`),t.style.removeProperty(`--reka-toast-swipe-move-y`),t.style.removeProperty(`--reka-toast-swipe-end-x`),t.style.removeProperty(`--reka-toast-swipe-end-y`)}},onSwipeEnd:t[7]||=e=>{if(r(`swipeEnd`,e),!e.defaultPrevented){let{x:t,y:n}=e.detail.delta,r=e.currentTarget;r.setAttribute(`data-swipe`,`end`),r.style.removeProperty(`--reka-toast-swipe-move-x`),r.style.removeProperty(`--reka-toast-swipe-move-y`),r.style.setProperty(`--reka-toast-swipe-end-x`,`${t}px`),r.style.setProperty(`--reka-toast-swipe-end-y`,`${n}px`),a.value=!1}}}),{default:I(({remaining:t,duration:n})=>[B(e.$slots,`default`,{remaining:t,duration:n,open:C(a)})]),_:3},16,[`open`,`type`,`as`,`as-child`,`duration`])]),_:3},8,[`present`]))}}),m_=N({__name:`ToastTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return ti(),(e,n)=>(P(),z(C(Kr),r(rt(t)),{default:I(()=>[B(e.$slots,`default`)]),_:3},16))}}),h_=N({__name:`FocusProxy`,emits:[`focusFromOutsideViewport`],setup(e,{emit:t}){let n=t,r=Xg();return(e,t)=>(P(),z(C(ri),{tabindex:`0`,style:{position:`fixed`},onFocus:t[0]||=e=>{let t=e.relatedTarget;C(r).viewport.value?.contains(t)||n(`focusFromOutsideViewport`)}},{default:I(()=>[B(e.$slots,`default`)]),_:3}))}}),g_=N({inheritAttrs:!1,__name:`ToastViewport`,props:{hotkey:{type:Array,required:!1,default:()=>[`F8`]},label:{type:[String,Function],required:!1,default:`Notifications ({hotkey})`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`ol`}},setup(e){let{hotkey:t,label:n}=oe(e),{forwardRef:r,currentElement:i}=ti(),{CollectionSlot:a,getItems:o}=ni(),s=Xg(),l=M(()=>s.toastCount.value>0),u=R(),d=R(),f=/Key/g,p=/Digit/g,m=M(()=>t.value.join(`+`).replace(f,``).replace(p,``));Fr(t.value,()=>{i.value.focus()}),_e(()=>{s.onViewportChange(i.value)}),ce(e=>{let t=i.value;if(l.value&&t){let n=()=>
57{if(!s.isClosePausedRef.value){let e=new CustomEvent(e_);t.dispatchEvent(e),s.isClosePausedRef.value=!0}},r=()=>{if(s.isClosePausedRef.value){let e=new CustomEvent(t_);t.dispatchEvent(e),s.isClosePausedRef.value=!1}},i=e=>{t.contains(e.relatedTarget)||r()},a=()=>{t.contains(Wr())||r()},o=e=>{let n=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!n){let n=Wr(),r=e.shiftKey;if(e.target===t&&r){u.value?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);$r(i.slice(a+1))?e.preventDefault():r?u.value?.focus():d.value?.focus()}};t.addEventListener(`focusin`,n),t.addEventListener(`focusout`,i),t.addEventListener(`pointermove`,n),t.addEventListener(`pointerleave`,a),t.addEventListener(`keydown`,o),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),e(()=>{t.removeEventListener(`focusin`,n),t.removeEventListener(`focusout`,i),t.removeEventListener(`pointermove`,n),t.removeEventListener(`pointerleave`,a),t.removeEventListener(`keydown`,o),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)})}});function h({tabbingDirection:e}){let t=o().map(e=>e.ref).map(t=>{let n=[t,...Qr(t)];return e===`forwards`?n:n.reverse()});return(e===`forwards`?t.reverse():t).flat()}return(e,t)=>(P(),z(C(Jg),{role:`region`,"aria-label":typeof C(n)==`string`?C(n).replace(`{hotkey}`,m.value):C(n)(m.value),tabindex:`-1`,style:ye({pointerEvents:l.value?void 0:`none`})},{default:I(()=>[l.value?(P(),z(h_,{key:0,ref:e=>{e&&(u.value=C(Nr)(e))},onFocusFromOutsideViewport:t[0]||=()=>{let e=h({tabbingDirection:`forwards`});C($r)(e)}},null,512)):V(`v-if`,!0),c(C(a),null,{default:I(()=>[c(C(Kr),j({ref:C(r),tabindex:`-1`,as:e.as,"as-child":e.asChild},e.$attrs),{default:I(()=>[B(e.$slots,`default`)]),_:3},16,[`as`,`as-child`])]),_:3}),l.value?(P(),z(h_,{key:1,ref:e=>{e&&(d.value=C(Nr)(e))},onFocusFromOutsideViewport:t[1]||=()=>{let e=h({tabbingDirection:`backwards`});C($r)(e)}},null,512)):V(`v-if`,!0)]),_:3},8,[`aria-label`,`style`]))}}),__={key:0,class:`bg-linear-to-r from-sand-100 to-sand-200 text-sand-900 border-b border-sand-300/60 pt-[max(0.5rem,var(--sai-top))] pb-2.5 px-4`},v_={class:`flex items-center justify-between gap-3 max-w-2xl mx-auto`},y_={class:`flex-1 min-w-0 truncate`},b_={class:`flex items-center gap-1.5 shrink-0`},x_=Object.assign(N({__name:`AppBanner`,props:{visible:{type:Boolean},actionLabel:{},dismissible:{type:Boolean,default:!0}},emits:[`action`,`dismiss`],setup(e){let{t}=Mn();return(n,r)=>{let i=ui;return P(),z(Pt,{"enter-active-class":`transition-all duration-300 ease-out`,"leave-active-class":`transition-all duration-200 ease-in`,"enter-from-class":`-translate-y-full opacity-0`,"enter-to-class":`translate-y-0 opacity-100`,"leave-from-class":`translate-y-0 opacity-100`,"leave-to-class":`-translate-y-full opacity-0`},{default:I(()=>[e.visible?(P(),A(`div`,__,[O(`div`,v_,[O(`div`,y_,[B(n.$slots,`default`)]),O(`div`,b_,[c(i,{color:`secondary`,variant:`pill`,size:`sm`,class:`font-semibold!`,onClick:r[0]||=e=>n.$emit(`action`)},{default:I(()=>[d(L(e.actionLabel),1)]),_:1}),e.dismissible?(P(),z(i,{key:0,variant:`ghost`,color:`neutral`,icon:`i-lucide-x`,class:`size-8 p-0 justify-center text-sand-400 hover:text-sand-600 hover:bg-sand-300/40`,ui:{leadingIcon:`size-4.5`},"aria-label":C(t)(`common.actions.close`),onClick:r[1]||=e=>n.$emit(`dismiss`)},null,8,[`aria-label`])):V(``,!0)])])])):V(``,!0)]),_:3})}}}),{__name:`AppBanner`}),S_=`dismissed_install_banner`,C_=R(!1),w_=R(null);function T_(){return!!window.Capacitor?.isNativePlatform?.()}function E_(){function e(){if(T_()||localStorage.getItem(S_))return;let e=navigator.userAgent;/FBAN|FBAV|Instagram|musical_ly|BytedanceWebview|TikTok/i.test(e)||(/android/i.test(e.toLowerCase())?(w_.value=`android`,C_.value=!0):/iphone|ipad|ipod/i.test(e)&&(w_.value=`ios`,C_.value=!0))}function t(){localStorage.setItem(S_,`1`),C_.value=!1}function n(){let e=w_.value===`ios`?fi:di;window.open(e,`_blank`)}return{showBanner:pe(C_),platform:pe(w_),checkEligibility:e,dismissBanner:t,openStore:n}}var D_={class:`text-sm font-medium truncate`},O_=Object.assign(N({__name:`AppInstallBanner`,setup(e){let{t}=Mn(),{showBanner:n,platform:r,checkEligibility:i,dismissBanner:
57a,openStore:o}=E_();_e(i);let s=M(()=>r.value===`ios`?t(`native.install.ios`):t(`native.install.android`));return(e,r)=>{let i=x_;return P(),z(i,{visible:C(n),"action-label":C(t)(`native.install.get`),onAction:C(o),onDismiss:C(a)},{default:I(()=>[O(`p`,D_,L(C(s)),1)]),_:1},8,[`visible`,`action-label`,`onAction`,`onDismiss`])}}}),{__name:`AppInstallBanner`}),k_={class:`flex flex-col h-full`},A_={class:`flex items-center justify-between px-4 py-2.5 min-h-14 pt-[max(0.625rem,var(--sai-top))] bg-white border-b border-sand-300/70`},j_={class:`px-3 py-2 border-b border-sand-200`},M_={class:`min-w-0 flex-1`},N_={class:`flex items-center gap-1.5 flex-wrap`},P_={class:`font-display font-extrabold text-lg leading-tight text-ink tracking-[-0.01em]`},F_={key:0,class:`mt-0.5 text-sm font-semibold text-teal-700 truncate`},I_={dir:`ltr`},L_={class:`flex-1 min-h-0 overflow-y-auto pb-6`},R_={class:`px-5.5 pt-3.5 pb-1.5 text-2xs font-extrabold uppercase tracking-[0.12em] text-subtle`},z_={class:`truncate`},B_={key:1,class:`ms-auto px-2.5 py-1 rounded-full bg-mango-500 text-white text-xs font-extrabold tracking-wide shrink-0`},V_={key:2,class:`ms-auto min-w-5 h-5 px-1.5 rounded-full bg-terracotta-500 text-white text-xs font-extrabold inline-flex items-center justify-center shrink-0`},H_={class:`truncate`},U_={class:`p-4 border-b border-sand-300/70`},W_={class:`flex-1 min-h-0 overflow-y-auto divide-y divide-sand-200`},G_={class:`flex items-center gap-3`},K_={class:`text-ink`},q_={class:`border-t border-sand-300/70`},J_={class:`flex items-center justify-center gap-4 p-4 text-sm text-sand-500`},Y_=Object.assign(N({__name:`MobileMenu`,setup(e){let{t,isRtl:n}=Mn(),{user:r,isLoggedIn:i,isAdmin:a,logout:o}=Hn(),{isPro:s}=Xn(),{unreadCount:l}=Si(),u=Le(),f=R(!1),p=M(()=>r.value?.nickname?`@${r.value.nickname}`:r.value?.name?`@`+r.value.name.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``).trim().replace(/\s+/g,`.`):``),m=M(()=>r.value?.name?r.value.name.split(` `).map(e=>e[0]).join(``).substring(0,2).toUpperCase():`?`),h=M(()=>r.value?.avatar_url?Ci(r.value.avatar_url).thumb:void 0),g=M(()=>{let e=[{label:t(`common.nav.profile`),icon:`i-lucide-user`,to:`/yo`,section:1,match:e=>e===`/yo`||e.startsWith(`/yo/`)&&!e.startsWith(`/yo/favoritos`)&&!e.startsWith(`/yo/estadisticas`)&&!e.startsWith(`/yo/notificaciones`)},{label:t(`common.nav.assistant`),icon:`i-lucide-sparkles`,to:`/asistente`,section:1,aiSpark:!0},{label:t(`common.nav.explore`),icon:`i-lucide-compass`,to:`/?explorar=1`,section:2,match:e=>e===`/`},{label:t(`common.nav.notifications`),icon:`i-lucide-bell`,to:`/yo/notificaciones`,section:2,notifications:!0},{label:t(`common.nav.favorites`),icon:`i-lucide-heart`,to:`/yo/favoritos`,section:2},{label:t(`common.nav.history`),icon:`i-lucide-history`,to:`/historial`,section:2},{label:t(`common.nav.statistics`),icon:`i-lucide-bar-chart-3`,to:`/yo/estadisticas`,section:3},{label:s.value?t(`common.nav.subscription`):t(`common.nav.goPro`),icon:s.value?`i-lucide-receipt`:`i-lucide-crown`,to:`/pro`,section:3,subscription:!0},{label:t(`common.nav.invite`),icon:`i-lucide-gift`,to:`/ajustes/referidos`,section:3},{label:t(`common.nav.settings`),icon:`i-lucide-settings`,to:`/ajustes`,section:4,match:e=>e===`/ajustes`},{label:t(`common.nav.howItWorks`),icon:`i-lucide-info`,to:`/acerca`,section:4},{label:t(`common.nav.helpContact`),icon:`i-lucide-help-circle`,to:`/contacto`,section:4}];return a.value&&e.push({label:t(`common.nav.admin`),icon:`i-lucide-shield`,to:`/admin`,section:4,admin:!0}),e}),_=M(()=>({1:t(`common.nav.sections.activity`),2:t(`common.nav.sections.discover`),3:t(`common.nav.sections.business`),4:t(`common.nav.sections.account`)})),v=M(()=>{let e=[[],[],[],[]],t=null;for(let n of g.value)n.admin?t=n:e[n.section-1].push(n);return{groups:[1,2,3,4].map(t=>({section:t,label:_.value[t],items:e[t-1]})).filter(e=>e.items.length>0),admin:t}});function y(e){let t=u.path;return e.match?e.match(t):t===e.to||t.startsWith(e.to+`/`)}let b=M(()=>[{label:t(`common.nav.explore`),icon:`i-lucide-compass`,to:`/?explorar=1`},{label:t(`common.nav.assistant`),icon:`i-lucide-sparkles`,to:`/asistente`},{label:t(`common.nav.howItWorks`),icon:`i-lucide-info`,to:`/acerca`},{label:`Piko Pro`,icon:`i-lucide-crown`,to:`/pro`},{label:t(`common.nav.contact`),icon:`i-lucide-mail`,to:`/contacto`}]),x=M(()=>[{label:t(`common.nav.terms`),to:`/terminos`},{label:t(`common.nav.privacy`),to:`/privacidad`}]);async function S(){f.value=!1,await o()}return(e,a)=>{let o=ui,u=pi,g=jn,_=mi,w=li,ee=bi,T=si,te=xi;return P(),z(te,{open:C(f),"onUpdate:open":a[8]||=e=>Ke(f)?f.value=e:null,side:C(n)?`left`:`right`,title:C(t)(`common.nav.menu`),description:C(t)(`common.nav.menu`),close:!1,transition:!1,ui:{content:`max-w-[88vw] w-80 bg-white pb-[var(--sai-bottom)] `,overlay:`bg-sand-900/30 data-[state=open]:animate-[fade-in_300ms_ease-out] data-[state=closed]:animate-[fade-out_250ms_ease-in]`}},{content:I(()=>[O(`div`,k_,[O(`div`,A_,[c(g,{to:`/`,"aria-label":`Piko · ${C(t)(`common.nav.home`)}`,class:`rounded-md outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-teal-500/50`,onClick:a[0]||=e=>f.value=!1},{default:I(()=>[c(u,{"font-size":`1.375rem`})]),_:1},8,[`aria-label`]),c(o,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,class:`-me-1 size-10 rounded-full text-muted`,ui:{leadingIcon:`size-5`},"aria-label":C(t)(`common.nav.closeMenu`),onClick:a[1]||=e=>f.value=!1},null,8,[`aria-label`])]),O(`div`,j_,[c(_)]),C(i)?(P(),A(F,{key:0},[c(g,{to:`/yo`,class:`flex items-center gap-3.5 px-4.5 pt-4.5 pb-4 bg-linear-to-br from-teal-100 to-white border-b border-sand-300/70`,onClick:a[2]||=e=>f.value=!1},{default:I(()=>[c(w,{src:C(h),text:C(m),ui:{root:`size-14 rounded-full shrink-0 shadow-[0_0_0_3px_#fff]`,fallback:`bg-teal-200 text-teal-800 font-extrabold text-lg`}},null,8,[`src`,`text`]),O(`div`,M_,[O(`div`,N_,[O(`span`,P_,[O(`bdi`,null,L(C(r)?.name||C(t)(`common.nav.account`)),1)]),C(s)?(P(),z(ee,{key:0,size:`sm`,class:`shrink-0`})):V(``,!0)]),C(p)?(P(),A(`div`,F_,[O(`bdi`,I_,L(C(p)),1)])):V(``,!0)]),c(T,{name:`i-lucide-chevron-right`,class:`rtl-mirror size-4 text-muted shrink-0`})]),_:1}),O(`nav`,L_,[(P(!0),A(F,null,k(C(v).groups,e=>(P(),A(F,{key:e.section},[O(`div`,R_,L(e.label),1),(P(!0),A(F,null,k(e.items,e=>(P(),z(g,{key:e.to,to:e.to,class:D([`flex items-center gap-3.5 px-5.5 py-3.25 min-h-13 text-base font-medium transition-colors`,y(e)?`bg-terracotta-100 text-terracotta-700 font-bold`:`text-default hover:bg-sand-100 active:bg-sand-100`]),onClick:a[3]||=e=>f.value=!1},{default:I(()=>[c(T,{name:e.icon,class:D([`size-5 shrink-0`,y(e)?`opacity-100`:`opacity-70`])},null,8,[`name`,`class`]),O(`span`,z_,L(e.label),1),e.aiSpark?(P(),z(T,{key:0,name:`i-lucide-sparkles`,class:`-ms-1.5 size-3 text-terracotta-500 shrink-0`})):V(``,!0),e.subscription?(P(),A(F,{key:1},[C(s)?(P(),z(ee,{key:0,size:`sm`,class:`ms-auto shrink-0`})):(P(),A(`span`,B_,L(C(t)(`common.nav.upgrade`)),1))],64)):e.notifications&&C(l)>0?(P(),A(`span`,V_,L(C(l)>99?`99+`:C(l)),1)):(P(),z(T,{key:3,name:`i-lucide-chevron-right`,class:D([`rtl-mirror ms-auto size-4.5 shrink-0`,y(e)?`text-terracotta-700`:`text-subtle`])},null,8,[`class`]))]),_:2},1032,[`to`,`class`]))),128))],64))),128)),C(v).admin?(P(),A(F,{key:0},[a[9]||=O(`div`,{class:`h-px bg-sand-300/70 mx-5.5 my-1.5`},null,-1),c(g,{to:C(v).admin.to,class:`flex items-center gap-3.5 px-5.5 py-3.25 min-h-13 text-base font-medium text-muted hover:bg-terracotta-50 hover:text-terracotta-700 transition-colors`,onClick:a[4]||=e=>f.value=!1},{default:I(()=>[c(T,{name:C(v).admin.icon,class:`size-5 shrink-0 text-terracotta-700 opacity-90`},null,8,[`name`]),O(`span`,H_,L(C(v).admin.label),1)]),_:1},8,[`to`])],64)):V(``,!0),a[10]||=O(`div`,{class:`h-px bg-sand-300/70 mx-5.5 my-1.5`},null,-1),O(`button`,{type:`button`,class:`flex items-center gap-3.5 w-full px-5.5 py-3.25 min-h-13 text-base font-medium text-muted hover:bg-terracotta-50 hover:text-terracotta-700 transition-colors`,onClick:S},[c(T,{name:`i-lucide-log-out`,class:`size-5 shrink-0 opacity-70`}),O(`span`,null,L(C(t)(`common.nav.logout`)),1)])])],64)):(P(),A(F,{key:1},[O(`div`,U_,[c(o,{to:`/ingresar`,color:`primary`,block:``,size:`lg`,onClick:a[5]||=e=>f.value=!1},{default:I(()=>[d(L(C(t)(`common.nav.login`)),1)]),_:1})]),O(`nav`,W_,[(P(!0),A(F,null,k(C(b),e=>(P(),z(g,{key:e.to,to:e.to,class:`flex items-center justify-between p-4 hover:bg-sand-100 active:bg-sand-200 transition-colors`,onClick:a[6]||=e=>f.value=!1},{default:I(()=>[O(`div`,G_,[c(T,{name:e.icon,class:`size-5 text-sand-400`},null,8,[`name`]),O(`span`,K_,L(e.label),1)]),c(T,{name:`i-lucide-chevron-right`,class:`rtl-mirror size-5 text-sand-400`})]),_:2},1032,[`to`]))),128))]),O(`div`,q_,[O(`div`,J_,[(P(!0),A(F,null,k(C(x),e=>(P(),z(g,{key:e.to,to:e.to,class:`hover:text-sand-700 transition-colors`,onClick:a[7]||=e=>f.value=!1},{default:I(()=>[d(L(e.label),1)]),_:2},1032,[`to`]))),128))])])],64))])]),default:I(()=>[c(o,{icon:`i-lucide-menu`,color:`neutral`,variant:`ghost`,class:`size-10 rounded-[10px] text-ink`,ui:{leadingIcon:`size-5.5`},"aria-label":C(t)(`common.nav.openMenu`)},null,8,[`aria-label`])]),_:1},8,[`open`,`side`,`title`,`description`])}}}),{__name:`AppMobileMenu`}),X_={class:`sm:hidden sticky top-0 z-40 bg-sand-100 pt-[max(0rem,var(--sai-top))] border-b border-sand-300/70`},Z_={class:`relative flex items-center justify-between px-3 py-2.5 gap-2`},Q_={class:`absolute inset-x-0 inset-y-0 flex items-center justify-center pointer-events-none px-14`},$_={class:`pointer-events-auto min-w-0 max-w-full truncate`},ev={class:`relative shrink-0 flex justify-start`},tv={class:`relative shrink-0 flex justify-end gap-1.5 ms-auto`},nv=Object.assign(N({__name:`MobileTopBar`,setup(e){return(e,t)=>(P(),A(`header`,X_,[O(`div`,Z_,[O(`div`,Q_,[O(`div`,$_,[B(e.$slots,`default`)])]),O(`div`,ev,[B(e.$slots,`leading`)]),O(`div`,tv,[B(e.$slots,`trailing`)])])]))}}),{__name:`AppMobileTopBar`}),rv=Object.assign(N({__name:`BackButton`,props:{to:{},label:{default:void 0}},setup(e){let{t}=Mn(),n=e,r=Pe();function i(){let e=n.to??`/`,t=r.currentRoute.value.fullPath;r.back(),setTimeout(()=>{r.currentRoute.value.fullPath===t&&ve(e,{replace:!0})},80)}return(n,r)=>{let a=ui;return P(),z(a,{icon:`i-lucide-arrow-left`,ui:{leadingIcon:`rtl-mirror`},variant:`icon-pill`,color:`secondary`,"aria-label":e.label??C(t)(`common.actions.back`),onClick:i},null,8,[`aria-label`])}}}),{__name:`BackButton`}),iv={key:0,class:`italic text-terracotta-700`},av={class:`flex items-center gap-3 app-shell-x pt-4 md:pt-5 pb-4`},ov={key:0,class:`flex text-meta text-sand-600 items-center gap-2 min-w-0`},sv={class:`text-ink font-bold truncate`},cv={key:1,class:`ms-auto shrink-0 flex gap-0.5`},lv=`font-display text-[17px] font-bold tracking-[-0.01em] text-ink text-center flex-1 px-2`,uv=Object.assign(N({__name:`PageHeader`,props:{title:{},backTo:{},backLabel:{},titleClass:{},titleAccent:{}},setup(e){let t=e,{t:n}=Mn(),{isLoggedIn:r}=Hn(),{headerActions:i}=Ti(),a=y(),o=M(()=>!!a.actions),s=M(()=>!!t.title),l=M(()=>i.value.length>0),u=M(()=>i.value.filter(e=>!e.mobileOnly)),f=M(()=>u.value.length>0),p=M(()=>!!(t.title&&t.backTo&&(t.backLabel||t.backTo===`/`))),m=Le(),h=M(()=>m.meta.fullWidth?`bg-sand-100`:`bg-sand-200`),g=R({});function _(e,t,n){g.value={...g.value,[t]:!1},n.currentTarget?.blur(),e.onClick()}return(t,a)=>{let m=rv,v=ui,y=Y_,b=mi,x=nv,S=jn,w=oi;return P(),A(F,null,[c(x,null,Qe({leading:I(()=>[c(m,{to:e.backTo},null,8,[`to`])]),default:I(()=>[C(s)?(P(),A(`h1`,{key:0,class:D(e.titleClass||lv)},[e.titleAccent?(P(),A(`em`,iv,L(e.titleAccent),1)):(P(),A(F,{key:1}
57,[d(L(e.title),1)],64))],2)):V(``,!0)]),_:2},[C(s)?{name:`trailing`,fn:I(()=>[C(l)?(P(!0),A(F,{key:0},k(C(i),(e,t)=>(P(),z(v,{key:t,icon:e.icon,color:`secondary`,variant:`icon-pill`,"aria-label":e.tooltip,onClick:e.onClick},null,8,[`icon`,`aria-label`,`onClick`]))),128)):B(t.$slots,`actions`,{},()=>[C(r)?(P(),z(y,{key:0})):(P(),z(b,{key:1,compact:``}))],void 0,1)]),key:`0`}:void 0]),1024),C(p)||C(o)||C(f)?(P(),A(`div`,{key:0,class:D([`hidden sm:block w-full`,C(h)])},[O(`div`,av,[C(p)?(P(),A(`nav`,ov,[c(S,{to:`/`,class:`text-sand-600 hover:text-ink`},{default:I(()=>[d(L(C(n)(`common.nav.home`)),1)]),_:1}),a[1]||=O(`span`,{class:`text-sand-500 rtl-mirror`},`âº`,-1),e.backTo&&e.backLabel&&e.backTo!==`/`?(P(),A(F,{key:0},[c(S,{to:e.backTo,class:`text-sand-600 hover:text-ink`},{default:I(()=>[d(L(e.backLabel),1)]),_:1},8,[`to`]),a[0]||=O(`span`,{class:`text-sand-500 rtl-mirror`},`âº`,-1)],64)):V(``,!0),O(`span`,sv,L(e.title),1)])):V(``,!0),C(o)||C(f)?(P(),A(`div`,cv,[C(f)?(P(!0),A(F,{key:0},k(C(u),(e,t)=>(P(),z(w,{key:t,text:e.tooltip,disabled:!e.tooltip,open:C(g)[t],"delay-duration":400,"onUpdate:open":e=>g.value={...C(g),[t]:e}},{default:I(()=>[c(v,{icon:e.icon,color:`neutral`,variant:`ghost`,class:`size-8.5 p-0! rounded-full! justify-center bg-white border border-sand-300/60 text-sand-500 hover:bg-sand-100! hover:text-terracotta-700 hover:border-terracotta-200 transition-all duration-150`,ui:{leadingIcon:`size-4`},onClick:n=>_(e,t,n)},null,8,[`icon`,`onClick`])]),_:2},1032,[`text`,`disabled`,`open`,`onUpdate:open`]))),128)):B(t.$slots,`actions`,{},void 0,void 0,1)])):V(``,!0)])],2)):V(``,!0)],64)}}}),{__name:`PageHeader`}),dv=(e=`RouteProvider`)=>N({name:e,props:{route:{type:Object,required:!0},vnode:Object,vnodeRef:Object,renderKey:String,trackRootNodes:Boolean,routeRecord:Object},setup(e){let t=e.renderKey,n=e.route,r={};for(let i in e.route)Object.defineProperty(r,i,{get:()=>t===e.renderKey?e.route[i]:n[i],enumerable:!0});return Se(f,tt(r)),()=>e.vnode?a(e.vnode,{ref:e.vnodeRef}):e.vnode}}),fv=dv(),pv=new WeakMap,mv=N({name:`NuxtPage`,inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(e,{attrs:t,slots:n,expose:r}){let i=p(),o=R(),s=g(f,null),c=new Set,l;r({pageRef:o});let u=g(x,null),d,h=i.deferHydration(),v=!1,y=!1,b,S=0;if(i.isHydrating){let e=i.hooks.hookOnce(`app:error`,h),t=Pe().beforeEach(()=>{e(),t()})}e.pageKey&&m(()=>e.pageKey,(e,t)=>{e!==t&&i.callHook(`page:loading:start`)});let C=!1;{let e=Pe().beforeResolve(()=>{C=!1});De(()=>{e(),h()})}return()=>a(Ma,{name:e.name,route:e.route,...t},{default:_v(t=>{let r=hv(s,t.route,t.Component),f=s&&s.matched.length===t.route.matched.length;if(!t.Component){if(d&&!f&&!yv(d))return d;h();return}if(d&&u&&!yv(d)&&!u.isCurrent(t.route))return d;if(r&&s&&(!u||u?.isCurrent(s)))return(f||d)&&!yv(d)?d:null;let p=$a(t,e.pageKey),m=gv(s,t.route,t.Component);!i.isHydrating&&l===p&&!m&&Ge(()=>{C||(C=!0,i.callHook(`page:loading:end`))}),v&&l!==p&&y&&S++,l=p;let g=!!(e.transition??t.route.meta.pageTransition??_),x=g&&Nt([e.transition,t.route.meta.pageTransition,_,{onAfterLeave(){i[`~transitionFinish`]?.(),delete i[`~transitionFinish`],delete i[`~transitionPromise`],i.callHook(`page:transition:finish`,t.Component)}}]),w=e.keepalive??t.route.meta.keepalive??!1,ee=t.Component.type,T=ee.name||ee.__name;t.route.meta.keepalive&&T&&c.add(T);let te;if(c.size>0&&e.keepalive==null&&(!w||typeof w==`object`&&w&&w.include)){let e=typeof w==`object`&&w?{...w}:{},t=e.include?Array.isArray(e.include)?e.include:[e.include]:[];te={...e,include:Array.from(new Set([...t,...c]))}}else te=w;return d=Ft(g&&x,eo(te,a(Ne,{key:S,suspensible:!0,onPending:()=>{v=!0,g&&!i[`~transitionPromise`]&&(i[`~transitionPromise`]=new Promise(e=>{i[`~transitionFinish`]=e})),b=i.callHook(`page:start`,t.Component)}
57,onResolve:async()=>{v=!1,y=!0,i.isHydrating&&i[`~restoreDeferredRoute`]?.();try{await Ge(),i._route.sync?.(),await b,await i.callHook(`page:finish`,t.Component),!C&&!m&&(C=!0,await i.callHook(`page:loading:end`))}finally{h()}}},{default:()=>{let e={key:p||void 0,vnode:n.default?vv(n.default,t):t.Component,route:t.route,renderKey:p||void 0,trackRootNodes:g,vnodeRef:o,routeRecord:void 0};if(!te)return a(fv,e);let r=ee,i=pv.get(r);return i||(i=dv(T),pv.set(r,i)),a(i,e)}}))).default(),d})})}});function hv(e,t,n){if(!e)return!1;let r=t.matched.findIndex(e=>e.components?.default===n?.type);if(r===-1)return!1;let i=t.matched.slice(0,r).filter(e=>e.components?.default);if(!i.length)return!1;let a=e.matched.filter(e=>e.components?.default);return i.some((e,t)=>e.components?.default!==a[t]?.components?.default)||n&&$a({route:t,Component:n})!==$a({route:e,Component:n})}function gv(e,t,n){return e?t.matched.findIndex(e=>e.components?.default===n?.type)<t.matched.length-1:!1}function _v(e){let t=(t=>{let n=e(t);return Array.isArray(n)?n:n==null||!fe(n)?[V()]:[n]});return t._n=!0,t}function vv(e,t){let n=e(t);return n.length===1?a(n[0]):a(F,void 0,n)}function yv(e){return!!e&&(!!e.suspense?.isUnmounted||!!e.component?.isUnmounted)}var bv=N({name:`LayoutLoader`,inheritAttrs:!1,props:{name:String,layoutProps:Object},setup(e,t){return()=>a(Kp[e.name],e.layoutProps,t.slots)}}),xv=N({name:`NuxtLayout`,inheritAttrs:!1,props:{name:{type:[String,Boolean,Object],default:null},fallback:{type:[String,Object],default:null}},setup(e,t){let n=p(),r=g(f),i=!r||r===Le()?St():r,o=M(()=>{let t=Tn(i,e.name);return t&&!(t in Kp)&&e.fallback&&(t=C(e.fallback)),t});Se(ee,o);let s=$e();t.expose({layoutRef:s});let c=n.deferHydration();if(n.isHydrating){let e=n.hooks.hookOnce(`app:error`,c),t=Pe().beforeEach(()=>{e(),t()})}let l;return()=>{let r=!!o.value&&o.value in Kp&&!!(i?.meta.layoutTransition??!1),u=r&&Nt([i?.meta.layoutTransition,!1,{onBeforeLeave(){n[`~transitionPromise`]=new Promise(e=>{n[`~transitionFinish`]=e})},onAfterLeave(){n[`~transitionFinish`]?.(),delete n[`~transitionFinish`],delete n[`~transitionPromise`]}}]),d=l;return l=o.value,Ft(u,{default:()=>a(Ne,{suspensible:!0,onResolve:async()=>{await Ge(c)}},{default:()=>a(Sv,{layoutProps:j(t.attrs,i.meta.layoutProps??{},{ref:s}),key:o.value||void 0,name:o.value,shouldProvide:!e.name,isRenderingNewLayout:e=>e!==d&&e===o.value,hasTransition:r},t.slots)})}).default()}}}),Sv=N({name:`NuxtLayoutProvider`,inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean},isRenderingNewLayout:{type:Function,required:!0}},setup(e,t){let n=e.name;e.shouldProvide&&Se(x,{isCurrent:e=>n===!1||n===Tn(e)});let r=g(f),i=r&&r===Le(),o=g(x,null);if(i){let t=St(),n={};for(let i in t){let a=i;Object.defineProperty(n,a,{enumerable:!0,get:()=>e.isRenderingNewLayout(e.name)&&(!o||o.isCurrent(t))?t[a]:r[a]})}Se(f,tt(n))}return()=>!n||typeof n==`string`&&!(n in Kp)?t.slots.default?.():a(bv,{key:n,layoutProps:e.layoutProps,name:n},t.slots)}}),Cv={base:`min-h-[calc(100vh-var(--ui-header-height))]`},wv={__name:`UMain`,props:{as:{type:null,required:!1,default:`main`},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){let t=Ur(`main`,e),n=hr(),r=M(()=>qr({extend:Cv,...n.ui?.main||{}}));return(e,n)=>(P(),z(C(Kr),{as:C(t).as,class:D(r.value({class:[C(t).ui?.base,C(t).class]}))},{default:I(()=>[B(e.$slots,`default`)]),_:3},8,[`as`,`class`]))}};function Tv(){let e=xn(`keyboard:visible`,()=>!1),t=xn(`keyboard:height`,()=>0);return{isVisible:pe(e),keyboardHeight:pe(t),hide:async()=>{let{Capacitor:e}=await U(async()=>{let{Capacitor:e}=await import(`./CPKfJ3ml.js`);return{Capacitor:e}},[],import.meta.url);if(!e.isNativePlatform())return;let{Keyboard:t}=await U(async()=>{let{Keyboard:e}=await import(`./Dr14WhS0.js`);return{Keyboard:e}},__vite__mapDeps([219,220]),import.meta.url);await t.hide()}}}var Ev={class:`fixed bottom-0 inset-x-0 flex justify-center pointer-events-none z-50 sm:hidden`},Dv={class:`relative w-full`},Ov={class:`absolute top-0 left-0 right-0 h-14 flex items-center justify-between px-8 pointer-events-auto`},kv={class:`text-2xs mt-1 font-semibold`},Av={class:`text-2xs font-semibold`},jv={role:`tablist`,class:`relative flex p-1 bg-sand-100 rounded-xl mb-4`},Mv={role:`tabpanel`,class:`grid grid-cols-2 gap-3`},Nv={class:`text-sm font-medium text-sand-900`}
57,Pv=320,Fv=56,Iv=54,Lv=10,Rv=14,zv=20,Bv=Object.assign(hi(N({__name:`BottomNav`,setup(e){let{t}=Mn(),n=Le(),{isLoggedIn:r}=Hn(),{openSignup:i}=Lr(),{showCreateMenu:a,createMenuSide:o,requestOptions:s,offerOptions:l,openCreateMenu:u,handleCreateOption:f}=wi(),{impact:p,ImpactStyle:h}=Cr();function g(){p(h.Light),r.value?u():i()}function _(e){if(e.preventDefault(),r.value){ve(`/yo`);return}i()}let{unreadCount:v}=Si(),y=M(()=>v.value>0),b=M(()=>r.value||xr()?`/`:`/?explorar=1`),x=M(()=>n.path===`/`||n.path.startsWith(`/publicaciones/explorar`)||n.path.startsWith(`/listings/browse`)||n.path.startsWith(`/listings/`)||n.path.startsWith(`/anuncios/`)),S=M(()=>n.path.startsWith(`/yo`)||n.path.startsWith(`/me`)||n.path.startsWith(`/profile`)||n.path.startsWith(`/settings`)||n.path.startsWith(`/ajustes`)||n.path===`/history`||n.path===`/historial`||n.path===`/pro`||n.path.startsWith(`/pro/`)),w=Pv/2-Iv/2,ee=` 58 M0,${Fv} 59 L0,${zv} 60 Q0,0 ${zv},0 61 L119,0 62 Q${w},0 ${w},${Rv} 63 L${w},${Lv} 64 A${Iv/2},${Iv/2} 0 0 0 187,${Lv} 65 L187,${Rv} 66 Q187,0 201,0 67 L300,0 68 Q${Pv},0 ${Pv},${zv} 69 L${Pv},${Fv} 70 Z 71`,T=R(`offer`);m(a,e=>{e&&o.value&&(T.value=o.value,o.value=null)});let te=M(()=>T.value===`demand`?s.value:l.value),ne=R(null);function re(e,t){p(h.Light),ne.value=e,setTimeout(()=>{f(e,t),ne.value=null},200)}let ie=M(()=>T.value===`demand`?`teal`:`terracotta`),{isVisible:ae}=Tv();return(e,n)=>{let r=si,i=jn,o=ci,s=ui,l=Ei;return ue((P(),A(`nav`,Ev,[O(`div`,Dv,[O(`svg`,{class:`nav-shadow-clip w-full h-14 nav-top-shadow`,viewBox:`0 0 320 56`,preserveAspectRatio:`none`},[O(`path`,{d:ee,class:`fill-sand-50`})]),n[4]||=O(`div`,{class:`h-(--sai-bottom) bg-sand-50`},null,-1),O(`div`,Ov,[c(i,{to:C(b),class:D([`flex flex-col items-center justify-center flex-1 h-full transition-colors`,C(x)?`text-teal-700`:`text-[#7A7268]`])},{default:I(()=>[c(r,{name:`i-lucide-search`,class:`w-5 h-5`}),O(`span`,kv,L(C(t)(`common.actions.search`)),1)]),_:1},8,[`to`,`class`]),n[3]||=O(`div`,{class:`w-16`},null,-1),c(s,{type:`button`,variant:`ghost`,color:`neutral`,class:D([`flex-col flex-1 h-full justify-center rounded-none! gap-0.5 hover:bg-transparent! transition-colors pointer-events-auto`,C(S)?`text-teal-700`:`text-[#7A7268]`]),onClick:_},{default:I(()=>[c(o,{text:C(v)>99?`99+`:C(v),show:C(y),inset:!0,ui:{base:`translate-x-3`}},{default:I(()=>[c(r,{name:`i-lucide-user`,class:`w-5.5 h-5.5`})]),_:1},8,[`text`,`show`]),O(`span`,Av,L(C(t)(`common.nav.you`)),1)]),_:1},8,[`class`])]),c(s,{type:`button`,variant:`icon-circle`,color:`primary`,icon:`i-lucide-plus`,"aria-label":C(t)(`common.publish.create`),class:`absolute left-1/2 -translate-x-1/2 -top-6 z-10 w-14 h-14 shadow-[0_4px_10px_rgba(110,58,45,0.5),inset_0_1px_0_rgba(255,255,255,0.3)]! pointer-events-auto active:scale-95`,ui:{leadingIcon:`size-6.5`},onClick:g},null,8,[`aria-label`])]),c(l,{open:C(a),"onUpdate:open":n[2]||=e=>Ke(a)?a.value=e:null,title:C(t)(`common.publish.question`),description:C(t)(`common.publish.description`),ui:{content:`sm:max-w-md`}},{body:I(()=>[O(`div`,jv,[O(`div`,{class:D([`absolute top-1 bottom-1 w-[calc(50%-4px)] rounded-lg transition-all duration-300 ease-out`,[C(T)===`offer`?`start-1 bg-terracotta-500`:`start-[calc(50%+2px)] bg-teal-500`]])},null,2),c(s,{role:`tab`,type:`button`,variant:`ghost`,color:`neutral`,"aria-selected":C(T)===`offer`,class:D([`relative flex-1 justify-center py-2.5 px-4 rounded-lg! text-sm font-medium transition-colors duration-200 z-10 bg-transparent! hover:bg-transparent! active:bg-transparent! focus:bg-transparent! focus-visible:bg-transparent!`,C(T)===`offer`?`text-white`:`text-sand-600`]),onClick:n[0]||=e=>T.value=`offer`},{default:I(()=>[d(L(C(t)(`common.publish.offer`)),1)]),_:1},8,[`aria-selected`,`class`]),c(s,{role:`tab`,type:`button`,variant:`ghost`,color:`neutral`,"aria-selected":C(T)===`demand`,class:D([`relative flex-1 justify-center py-2.5 px-4 rounded-lg! text-sm font-medium transition-colors duration-200 z-10 bg-transparent! hover:bg-transparent! active:bg-transparent! focus:bg-transparent! focus-visible:bg-transparent!`,C(T)===`demand`?`text-white`:`text-sand-600`]),onClick:n[1]||=e=>T.value=`demand`},{default:I(()=>[d(L(C(t)(`common.publish.demand`)),1)]),_:1},8,[`aria-selected`,`class`])]),O(`div`,Mv,[(P(!0),A(F,null,k(C(te),e=>(P(),z(s,{key:e.type,type:`button`,variant:`ghost`,color:`neutral`,class:D([`group relative overflow-hidden flex-col gap-2 p-4 rounded-xl! transition-all duration-150 text-center justify-center`,[C(ne)===e.type?`scale-95 bg-sand-200`:`bg-sand-50 hover:bg-sand-100 active:scale-95`]]),onClick:t=>re(e.type,e.side)},{default:I(()=>[O(`span`,{class:D([`ripple-effect`,{"animate-ripple":C(ne)===e.type}])},null,2),O(`div`,{class:D([`w-10 h-10 rounded-full flex items-center justify-center transition-transform duration-150 group-active:scale-110`,C(ie)===`teal`?`bg-teal-500/10`:`bg-terracotta-500/10`])},[c(r,{name:e.icon,class:D([`w-5 h-5`,C(ie)===`teal`?`text-teal-500`:`text-terracotta-500`])},null,8,[`name`,`class`])],2),O(`span`,Nv,L(e.label),1)]),_:2},1032,[`class`,`onClick`]))),128))])]),_:1},8,[`open`,`title`,`description`])],512)),[[Zt,!C(ae)]])}}}
71),[[`__scopeId`,`data-v-7eb8bbcc`]]),{__name:`AppBottomNav`}),Vv={slots:{root:`relative group overflow-hidden bg-default shadow-lg rounded-lg ring ring-default p-4 flex gap-2.5`,wrapper:`w-0 flex-1 flex flex-col`,title:`text-sm font-medium text-highlighted`,description:`text-sm text-muted`,icon:`shrink-0 size-5`,avatar:`shrink-0`,avatarSize:`2xl`,actions:`flex gap-1.5 shrink-0`,progress:`absolute inset-x-0 bottom-0`,close:`p-0`},variants:{color:{primary:{root:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`,icon:`text-primary`},secondary:{root:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`,icon:`text-secondary`},success:{root:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`,icon:`text-success`},info:{root:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`,icon:`text-info`},warning:{root:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`,icon:`text-warning`},error:{root:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`,icon:`text-error`},neutral:{root:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`,icon:`text-highlighted`}},orientation:{horizontal:{root:`items-center`,actions:`items-center`},vertical:{root:`items-start`,actions:`items-start mt-2.5`}},title:{true:{description:`mt-1`}}},defaultVariants:{color:`primary`}},Hv={__name:`UToast`,props:{as:{type:null,required:!1},title:{type:[String,Object,Function],required:!1},description:{type:[String,Object,Function],required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},color:{type:null,required:!1},orientation:{type:null,required:!1,default:`vertical`},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},actions:{type:Array,required:!1},duration:{type:Number,required:!1},progress:{type:[Boolean,Object],required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},type:{type:String,required:!1}},emits:[`escapeKeyDown`,`pause`,`resume`,`swipeStart`,`swipeMove`,`swipeCancel`,`swipeEnd`,`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=y(),o=Ur(`toast`,r),{t:s}=_i(),l=hr(),u=ei(Dr(o,`as`,`defaultOpen`,`open`,`duration`,`type`),i),f=M(()=>qr({extend:Vv,...l.ui?.toast||{}})({color:o.color,orientation:o.orientation,title:!!o.title||!!a.title})),p=re(`rootRef`),m=R(0);return _e(()=>{p.value?.$el?.getBoundingClientRect&&(m.value=p.value.$el.getBoundingClientRect().height)}),t({height:m}),(e,t)=>(P(),z(C(p_),j({ref_key:`rootRef`,ref:p},C(u),{"data-orientation":C(o).orientation,"data-slot":`root`,class:f.value.root({class:[C(o).ui?.root,C(o).class]}),style:{"--height":m.value}}),{default:I(({remaining:n,duration:r,open:i})=>[B(e.$slots,`leading`,{ui:f.value},()=>[C(o).avatar?(P(),z(li,j({key:0,size:C(o).ui?.avatarSize||f.value.avatarSize()},C(o).avatar,{"data-slot":`avatar`,class:f.value.avatar({class:C(o).ui?.avatar})}),null,16,[`size`,`class`])):C(o).icon?(P(),z(si,{key:1,name:C(o).icon,"data-slot":`icon`,class:D(f.value.icon({class:C(o).ui?.icon}))},null,8,[`name`,`class`])):V(``,!0)]),O(`div`,{"data-slot":`wrapper`,class:D(f.value.wrapper({class:C(o).ui?.wrapper}))},[C(o).title||a.title?(P(),z(C(m_),{key:0,"data-slot":`title`,class:D(f.value.title({class:C(o).ui?.title}))},{default:I(()=>[B(e.$slots,`title`,{},()=>[typeof C(o).title==`function`?(P(),z(Xe(C(o).title()),{key:0})):typeof C(o).title==`object`?(P(),z(Xe(C(o).title),{key:1})):(P(),A(F,{key:2},[d(L(C(o).title),1)],64))])]),_:3},8,[`class`])):V(``,!0),C(o).description||a.description?(P(),z(C(d_),{key:1,"data-slot":`description`,class:D(f.value.description({class:C(o).ui?.description}))},{default:I(()=>[B(e.$slots,`description`,{},()=>[typeof C(o).description==`function`?(P(),z(Xe(C(o).description()),{key:0})):typeof C(o).description==`object`?(P(),z(Xe(C(o).description),{key:1})):(P(),A(F,{key:2},[d(L(C(o).description),1)],64))])]),_:3},8,[`class`])):V(``,!0),C(o).orientation===`vertical`&&(C(o).actions?.length||a.actions)?(P(),A(`div`,{key:2,"data-slot":`actions`,class:D(f.value.actions({class:C(o).ui?.actions}))},[B(e.$slots,`actions`,{},()=>[(P(!0),A(F,null,k(C(o).actions,(e,n)=>
71(P(),z(C(u_),{key:n,"alt-text":e.label||`Action`,"as-child":``,onClick:t[0]||=ct(()=>{},[`stop`])},{default:I(()=>[c(ui,j({size:`xs`,color:C(o).color},{ref_for:!0},e),null,16,[`color`])]),_:2},1032,[`alt-text`]))),128))])],2)):V(``,!0)],2),C(o).orientation===`horizontal`&&(C(o).actions?.length||a.actions)||C(o).close?(P(),A(`div`,{key:0,"data-slot":`actions`,class:D(f.value.actions({class:C(o).ui?.actions,orientation:`horizontal`}))},[C(o).orientation===`horizontal`&&(C(o).actions?.length||a.actions)?B(e.$slots,`actions`,{},()=>[(P(!0),A(F,null,k(C(o).actions,(e,n)=>(P(),z(C(u_),{key:n,"alt-text":e.label||`Action`,"as-child":``,onClick:t[1]||=ct(()=>{},[`stop`])},{default:I(()=>[c(ui,j({size:`xs`,color:C(o).color},{ref_for:!0},e),null,16,[`color`])]),_:2},1032,[`alt-text`]))),128))],void 0,0):V(``,!0),C(o).close||a.close?(P(),z(C(l_),{key:1,"as-child":``},{default:I(()=>[B(e.$slots,`close`,{ui:f.value},()=>[C(o).close?(P(),z(ui,j({key:0,icon:C(o).closeIcon||C(l).ui.icons.close,color:`neutral`,variant:`link`,"aria-label":C(s)(`toast.close`)},typeof C(o).close==`object`?C(o).close:{},{"data-slot":`close`,class:f.value.close({class:C(o).ui?.close}),onClick:t[2]||=ct(()=>{},[`stop`])}),null,16,[`icon`,`aria-label`,`class`])):V(``,!0)])]),_:3})):V(``,!0)],2)):V(``,!0),C(o).progress&&i&&n>0&&r?(P(),z(zr,j({key:1,"model-value":n/r*100,color:C(o).color},typeof C(o).progress==`object`?C(o).progress:{},{size:`sm`,"data-slot":`progress`,class:f.value.progress({class:C(o).ui?.progress})}),null,16,[`model-value`,`color`,`class`])):V(``,!0)]),_:3},16,[`data-orientation`,`class`,`style`]))}},Uv={slots:{viewport:`fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-(--height) focus:outline-none`,base:`pointer-events-auto absolute inset-x-0 z-(--index) transform-(--transform) data-[expanded=false]:data-[front=false]:h-(--front-height) data-[expanded=false]:data-[front=false]:*:opacity-0 data-[front=false]:*:transition-opacity data-[front=false]:*:duration-100 data-[state=closed]:animate-[toast-closed_200ms_var(--ease-out)] data-[state=closed]:data-[expanded=false]:data-[front=false]:animate-[toast-collapsed-closed_200ms_var(--ease-out)] motion-safe:data-[state=open]:data-[pulsing=odd]:animate-[toast-pulse-a_200ms_var(--ease-out)] motion-safe:data-[state=open]:data-[pulsing=even]:animate-[toast-pulse-b_200ms_var(--ease-out)] data-[swipe=move]:transition-none transition-[transform,translate,height] duration-200 ease-out motion-reduce:transition-none`},variants:{position:{"top-left":{viewport:`left-4`},"top-center":{viewport:`left-1/2 transform -translate-x-1/2`},"top-right":{viewport:`right-4`},"bottom-left":{viewport:`left-4`},"bottom-center":{viewport:`left-1/2 transform -translate-x-1/2`},"bottom-right":{viewport:`right-4`}},swipeDirection:{up:`data-[swipe=end]:animate-[toast-slide-up_200ms_var(--ease-out)]`,right:`data-[swipe=end]:animate-[toast-slide-right_200ms_var(--ease-out)]`,down:`data-[swipe=end]:animate-[toast-slide-down_200ms_var(--ease-out)]`,left:`data-[swipe=end]:animate-[toast-slide-left_200ms_var(--ease-out)]`}},compoundVariants:[{position:[`top-left`,`top-center`,`top-right`],class:{viewport:`top-4`,base:`top-0 data-[state=open]:animate-[toast-slide-in-from-top_200ms_var(--ease-out)]`}},{position:[`bottom-left`,`bottom-center`,`bottom-right`],class:{viewport:`bottom-4`,base:`bottom-0 data-[state=open]:animate-[toast-slide-in-from-bottom_200ms_var(--ease-out)]`}},{swipeDirection:[`left`,`right`],class:`data-[swipe=move]:translate-x-(--reka-toast-swipe-move-x) data-[swipe=end]:translate-x-(--reka-toast-swipe-end-x) data-[swipe=cancel]:translate-x-0`},{swipeDirection:[`up`,`down`],class:`data-[swipe=move]:translate-y-(--reka-toast-swipe-move-y) data-[swipe=end]:translate-y-(--reka-toast-swipe-end-y) data-[swipe=cancel]:translate-y-0`}],defaultVariants:{position:`bottom-right`}},Wv=Object.assign(N({__name:`Toaster`,setup(e){let{t}=Mn(),{toasts:n,remove:r}=Rn(),i=hr();Se(Nn,R(5));let a=R([]),o=M(()=>a.value.reduce((e,t)=>e+t.height+16,0)),s=M(()=>qr({extend:Uv,...i.ui?.toaster})({position:`top-center`,swipeDirection:`up`})),l=e=>a.value.slice(e+1).reduce((e,t)=>
71e+t.height+16,0),u=({id:e,_duplicate:t,_updated:n,onClick:r,...i})=>i;return(e,i)=>{let d=Hv;return P(),z(C(Qg),{label:C(t)(`common.nav.notifications`),duration:5e3,"swipe-direction":`up`},{default:I(()=>[B(e.$slots,`default`),(P(!0),A(F,null,k(C(n),(e,t)=>(P(),z(d,j({key:e.id,ref_for:!0,ref_key:`refs`,ref:a},{ref_for:!0},u(e),{"data-expanded":`true`,"data-front":t===C(n).length-1,"data-pulsing":e._duplicate?e._duplicate%2==0?`even`:`odd`:void 0,class:C(s).base({class:e.onClick?`cursor-pointer`:void 0}),style:{"--index":t,"--offset":l(t),"--scale":`1`,"--translate":`calc(var(--offset) * var(--translate-factor))`,"--transform":`translateY(var(--translate)) scale(var(--scale))`},"onUpdate:open":t=>!t&&C(r)(e.id),onClick:t=>e.onClick?.(e)}),null,16,[`data-front`,`data-pulsing`,`class`,`style`,`onUpdate:open`,`onClick`]))),128)),c(C(f_),null,{default:I(()=>[c(C(g_),{label:e=>C(t)(`common.notificationViewport`,{hotkey:e}),"data-expanded":`true`,class:D(C(s).viewport()),style:ye({"--scale-factor":`0.05`,"--translate-factor":`1px`,"--gap":`16px`,"--height":`${C(o)}px`})},null,8,[`label`,`class`,`style`])]),_:1})]),_:3},8,[`label`])}}}),{__name:`AppToaster`}),Gv=Object.assign(Object.assign({name:`Toaster`},{props:{position:{type:null,required:!1},expand:{type:Boolean,required:!1,default:!0},progress:{type:Boolean,required:!1,default:!0},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},max:{type:Number,required:!1,default:5},class:{type:null,required:!1},ui:{type:Object,required:!1},label:{type:String,required:!1},duration:{type:Number,required:!1,default:5e3},disableSwipe:{type:Boolean,required:!1},swipeThreshold:{type:Number,required:!1}},setup(e){let t=Ur(`toaster`,e),{toasts:n,remove:i}=Rn(),a=hr();Se(Nn,Ze(()=>t.max));let o=ei(Dr(t,`duration`,`label`,`swipeThreshold`,`disableSwipe`)),s=Yr(Ze(()=>t.portal)),l=M(()=>{switch(t.position){case`top-center`:return`up`;case`top-right`:case`bottom-right`:return`right`;case`bottom-center`:return`down`;case`top-left`:case`bottom-left`:return`left`}return`right`}),u=M(()=>qr({extend:Uv,...a.ui?.toaster||{}})({position:t.position,swipeDirection:l.value}));function d(e,t){e||i(t)}let f=R(!1),p=M(()=>t.expand||f.value),m=R([]),h=M(()=>m.value.reduce((e,{height:t})=>e+t+16,0)),g=M(()=>m.value[m.value.length-1]?.height||0);function _(e){return m.value.slice(e+1).reduce((e,{height:t})=>e+t+16,0)}return(e,i)=>(P(),z(C(Qg),j({"swipe-direction":l.value},C(o)),{default:I(()=>[B(e.$slots,`default`),(P(!0),A(F,null,k(C(n),(e,r)=>(P(),z(Hv,j({key:e.id,ref_for:!0,ref_key:`refs`,ref:m,progress:C(t).progress},{ref_for:!0},C(Gr)(e,[`id`,`close`,`_duplicate`,`_updated`]),{close:e.close,"data-expanded":p.value,"data-front":!p.value&&r===C(n).length-1,"data-pulsing":e._duplicate?e._duplicate%2==0?`even`:`odd`:void 0,style:{"--index":r-C(n).length+C(n).length,"--before":C(n).length-1-r,"--offset":_(r),"--scale":p.value?`1`:`calc(1 - var(--before) * var(--scale-factor))`,"--translate":p.value?`calc(var(--offset) * var(--translate-factor))`:`calc(var(--before) * var(--gap))`,"--transform":`translateY(var(--translate)) scale(var(--scale))`},"data-slot":`base`,class:u.value.base({class:[C(t).ui?.base,e.onClick?`cursor-pointer`:void 0]}),"onUpdate:open":t=>d(t,e.id),onClick:t=>e.onClick&&e.onClick(e)}),null,16,[`progress`,`close`,`data-expanded`,`data-front`,`data-pulsing`,`style`,`class`,`onUpdate:open`,`onClick`]))),128)),c(C(f_),r(rt(C(s))),{default:I(()=>[c(C(g_),{"data-expanded":p.value,"data-slot":`viewport`,class:D(u.value.viewport({class:[C(t).ui?.viewport,C(t).class]})),style:ye({"--scale-factor":`0.05`,"--translate-factor":C(t).position?.startsWith(`top`)?`1px`:`-1px`,"--gap":C(t).position?.startsWith(`top`)?`16px`:`-16px`,"--front-height":`${g.value}px`,"--height":`${h.value}px`}),onMouseenter:i[0]||=e=>f.value=!0,onMouseleave:i[1]||=e=>f.value=!1},null,8,[`data-expanded`,`class`,`style`])]),_:1},16)]),_:3},16,[`swipe-direction`]))}}),{__name:`UToaster`});function Kv(){let e=tt([]),t=(t,i)=>{let{props:a,defaultOpen:s,destroyOnClose:c}=i||{},l=Ce({id:Symbol(``),isOpen:!!s,component:xe(t),isMounted:!!s,destroyOnClose:!!c,originalProps:a||{},props:{...a}});return e.push(l),{...l,open:e=>n(l.id,e),close:e=>r(l.id,e),patch:e=>o(l.id,e)}},n=(e,t)=>{let n=s(e);n.props=t?{...n.originalProps,...t}:{...n.originalProps},n.isOpen=!0,n.isMounted=!0;let r=new Promise(e=>n.resolvePromise=e);return Object.assign(r,{id:e,isMounted:n.isMounted,isOpen:n.isOpen,result:r})},r=(e,t)=>{let n=s(e);n.isOpen=!1,n.resolvePromise&&=(n.resolvePromise(t),void 0)},i=()=>
71{e.forEach(e=>r(e.id))},a=t=>{let n=s(t);if(n.isMounted=!1,n.destroyOnClose){let n=e.findIndex(e=>e.id===t);e.splice(n,1)}},o=(e,t)=>{let n=s(e);n.props={...n.props,...t}},s=t=>{let n=e.find(e=>e.id===t);if(!n)throw Error(`Overlay not found`);return n};return{overlays:e,open:n,close:r,closeAll:i,create:t,patch:o,unmount:a,isOpen:e=>s(e).isOpen}}var qv=kr(Kv),Jv={__name:`UOverlayProvider`,setup(e){let{overlays:t,unmount:n,close:r}=qv(),i=M(()=>t.filter(e=>e.isMounted)),a=e=>{r(e),n(e)},o=(e,t)=>{r(e,t)};return(e,t)=>(P(!0),A(F,null,k(i.value,e=>(P(),z(Xe(e.component),j({key:e.id},{ref_for:!0},e.props,{open:e.isOpen,"onUpdate:open":t=>e.isOpen=t,onClose:t=>o(e.id,t),"onAfter:leave":t=>a(e.id)}),null,16,[`open`,`onUpdate:open`,`onClose`,`onAfter:leave`]))),128))}},Yv=Object.assign(Object.assign({name:`App`},{props:{tooltip:{type:Object,required:!1},toaster:{type:[Object,null],required:!1},locale:{type:Object,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:`body`},dir:{type:String,required:!1},scrollBody:{type:[Boolean,Object],required:!1},nonce:{type:String,required:!1}},setup(e){let t=e,n=Ar(Dr(t,`scrollBody`)),i=Ze(()=>t.tooltip),a=Ze(()=>t.toaster),o=Ze(()=>t.locale);Se(yi,o);let s=Ze(()=>t.portal);return Se(Zr,s),(s,l)=>(P(),z(C(en),j({"use-id":()=>T(),dir:t.dir||o.value?.dir,locale:o.value?.code},C(n)),{default:I(()=>[c(C(ai),r(rt(i.value)),{default:I(()=>[e.toaster===null?B(s.$slots,`default`,{},void 0,void 0,1):(P(),z(Gv,r(j({key:0},a.value)),{default:I(()=>[B(s.$slots,`default`)]),_:3},16)),c(Jv)]),_:3},16)]),_:3},16,[`use-id`,`dir`,`locale`]))}}),{__name:`UApp`});function Xv(){let{countryCode:e}=Kn(),{$i18n:t}=p(),n=async()=>{let n=t.locale.value;if(!er(n))return;let r=nr(n,e.value);r!==n&&await t.setLocale(r)};{let r=Rn();m([e,t.locale],()=>{n().catch(()=>{r.add({title:t.t(`common.language.changeError`),color:`error`})})})}return n}var Zv=4;function Qv(e){let t=e.split(`.`).map(Number);return t.length!==3||t.some(isNaN)?null:t[0]*1e4+t[1]*100+t[2]}function $v(e){if(e.availableVersionCode&&e.currentVersionCode){let t=Number(e.availableVersionCode),n=Number(e.currentVersionCode);if(!isNaN(t)&&!isNaN(n))return t-n}if(e.availableVersionName&&e.currentVersionName){let t=Qv(e.availableVersionName),n=Qv(e.currentVersionName);if(t!==null&&n!==null)return t-n}return null}function ey(){let e=xn(`app_update_visible`,()=>!1);async function t(){try{let{Capacitor:t}=await U(async()=>{let{Capacitor:e}=await import(`./CPKfJ3ml.js`);return{Capacitor:e}},[],import.meta.url);if(!t.isNativePlatform())return;let{AppUpdate:n}=await U(async()=>{let{AppUpdate:e}=await import(`./hcJVQU4G.js`);return{AppUpdate:e}},__vite__mapDeps([223,6,220]),import.meta.url),r=await n.getAppUpdateInfo();if(r.updateAvailability!==2)return;let i=$v(r);i!==null&&i>=Zv&&(e.value=!0)}catch{}}function n(){e.value=!1}function r(){let t=navigator.userAgent.toLowerCase(),n=/iphone|ipad|ipod/.test(t)?fi:di;window.open(n,`_blank`),e.value=!1}return{visible:pe(e),checkForUpdate:t,dismiss:n,openStore:r}}var ty=gi({name:`Español`,code:`es`,messages:{alert:{close:`Cerrar`},authForm:{hidePassword:`Ocultar contraseña`,showPassword:`Mostrar contraseña`,submit:`Continuar`},banner:{close:`Cerrar`},calendar:{nextMonth:`Mes siguiente`,nextYear:`Año siguiente`,prevMonth:`Mes anterior`,prevYear:`Año anterior`},carousel:{dots:`Elegir diapositiva a mostrar`,goto:`Ir a la diapositiva {slide}`,next:`Siguiente`,prev:`Anterior`},chatPrompt:{placeholder:`Escribe tu mensaje aquÃâ¦`},chatPromptSubmit:{label:`Enviar`},chatReasoning:{thinking:`Pensandoâ¦`,thought:`Pensó`,thoughtFor:`Pensó durante {duration}`},colorMode:{dark:`Oscuro`,light:`Claro`,switchToDark:`Cambiar a modo oscuro`,switchToLight:`Cambiar a modo claro`,system:`Sistema`},commandPalette:{back:`Atrás`,close:`Cerrar`,noData:`Sin datos`,noMatch:`No hay datos coincidentes`,placeholder:`Escribe un comando o buscaâ¦`},contentSearch:{links:`Enlaces`,search:`Resultados`,theme:`Tema`},contentSearchButton:{label:`Buscarâ¦`},contentToc:{title:`En esta página`},dropdownMenu:{noMatch:`No hay datos coincidentes`,search:`Buscarâ¦`},dashboardSearch:{theme:`Tema`},dashboardSearchButton:{label:`Buscarâ¦`},dashboardSidebarCollapse:{collapse:`Colapsar barra lateral`,expand:`Expandir barra lateral`},dashboardSidebarToggle:{close:`Cerrar barra lateral`,open:`Abrir barra lateral`},drawer:{close:`Cerrar`},error:{clear:`Volver al inicio`},fileUpload:{removeFile:`Eliminar {filename}`},header:{close:`Cerrar menú`,open:`Abrir menú`},inputMenu:{create:`Crear "{label}"`,noData:`Sin datos`,noMatch:`No hay datos coincidentes`},inputNumber:{decrement:`Decrementar`,increment:`Incrementar`},listbox:{noData:`Sin datos`,noMatch:`No hay datos coincidentes`,search:`Buscarâ¦`},modal:{close:`Cerrar`},pricingTable:{caption:`Comparación de planes de precios`},prose:{codeCollapse:{closeText:`Colapsar`,name:`código`,openText:`Expandir`},collapsible:{closeText:`Ocultar`,name:`propiedades`,openText:`Mostrar`},pre:{copy:`Copiar código al portapapeles`},prompt:{copy:`Copiar prompt`,openIn:`Abrir en {name}`}},sidebar:{close:`Cerrar`,toggle:`Alternar`},selectMenu:{create:`Crear "{label}"`,noData:`Sin datos`,noMatch:`No hay datos coincidentes`,search:`Buscarâ¦`},slideover:{close:`Cerrar`},table:{noData:`Sin datos`},toast:{close:`Cerrar`}}}),ny=gi({name:`Français`,code:`fr`,messages:{alert:{close:`Fermer`},authForm:{hidePassword:`Masquer le mot de passe`,showPassword:`Afficher le mot de passe`,submit:`Continuer`},banner:{close:`Fermer`},calendar:{nextMonth:`Mois suivant`,nextYear:`Année suivante`,prevMonth:`Mois précédent`,prevYear:`Année précédente`},carousel:{dots:`Choisir la diapositive à afficher`,goto:`Aller à {slide}`,next:`Suivant`,prev:`Précédent`},chatPrompt:{placeholder:`Ãcrivez votre message iciâ¦`},chatPromptSubmit:{label:`Envoyer`},chatReasoning:{thinking:`Réflexion en coursâ¦`,thought:`Réflexion`,thoughtFor:`Réflexion pendant {duration}`},colorMode:{dark:`Sombre`,light:`Clair`,switchToDark:`Passer en mode sombre`,switchToLight:`Passer en mode clair`,system:`Système`},commandPalette:{back:`Retour`,close:`Fermer`,noData:`Aucune donnée`,noMatch:`Aucune donnée correspondante`,placeholder:`Tapez une commande ou recherchezâ¦`},contentSearch:{links:`Liens`,search:`Résultats`,theme:`Thème`},contentSearchButton:{label:`Rechercherâ¦`},contentToc:{title:`Sur cette page`},dropdownMenu:{noMatch:`Aucune donnée correspondante`,search:`Rechercherâ¦`},dashboardSearch:{theme:`Thème`},dashboardSearchButton:{label:`Rechercherâ¦`},dashboardSidebarCollapse:{collapse:`Replier la barre latérale`,expand:`Déployer la barre latérale`},dashboardSidebarToggle:{close:`Fermer la barre latérale`,open:`Ouvrir la barre latérale`},drawer:{close:`Fermer`},error:{clear:`Retour à l'accueil`},fileUpload:{removeFile:`Supprimer {filename}`},header:{close:`Fermer le menu`,open:`Ouvrir le menu`},inputMenu:{create:`Créer "{label}"`,noData:`Aucune donnée`,noMatch:`Aucune donnée correspondante`},inputNumber:{decrement:`Diminuer`,increment:`Augmenter`},listbox:{noData:`Aucune donnée`,noMatch:`Aucune donnée correspondante`,search:`Rechercherâ¦`},modal:{close:`Fermer`},pricingTable:{caption:`Comparaison des plans de prix`},prose:{codeCollapse:{closeText:`Réduire`,name:`code`,openText:`Développer`},collapsible:{closeText:`Masquer`,name:`propriétés`,openText:`Afficher`},pre:{copy:`Copier le code dans le presse-papiers`},prompt:{copy:`Copier le prompt`,openIn:`Ouvrir dans {name}`}},sidebar:{close:`Fermer`,toggle:`Basculer`},selectMenu:{create:`Créer "{label}"`,noData:`Aucune donnée`,noMatch:`Aucune donnée correspondante`,search:`Rechercherâ¦`},slideover:{close:`Fermer`},table:{noData:`Aucune donnée`},toast:{close:`Fermer`}}}),ry=gi({name:`×¢×ר×ת`,code:`he`,dir:`rtl`,messages:{alert:{close:`ס××ר`},authForm:{hidePassword:`×סתר ס×ס××`,showPassword:`××¦× ×¡×ס××`,submit:`××ש×`},banner:{close:`ס××ר`},calendar:{nextMonth:`×××ש ×××`,nextYear:`×©× × ××××`,prevMonth:`×××ש ×§×××`,prevYear:`×©× × ×§×××ת`},carousel:{dots:`××ר שק×פ×ת ××צ××`,goto:`××¢×ר × {slide}`,next:`×××`,prev:`××§×××`},chatPrompt:{placeholder:`×ת×× ×ת ×××××¢× ×©×× ×××â¦`},chatPromptSubmit:{label:`ש××`},chatReasoning:{thinking:`××ש×â¦`,thought:`×ש×`,thoughtFor:`××©× ×××©× {duration}`},colorMode:{dark:`×××`,light:`×××ר`,switchToDark:`×¢××ר ×××¦× ×××`,switchToLight:`×¢××ר ×××¦× ×××ר`,system:`×ער×ת`},commandPalette:{back:`×××ר`,close:`ס××ר`,noData:`××× × ×ª×× ×× ×××× ××`,noMatch:`×× × ×צ×× ×ת×××`,placeholder:`××§×× ×¤×§×××â¦`},contentSearch:{links:`×§×ש×ר××`,search:`ת×צ××ת`,theme:`ער×ת × ×ש×`},contentSearchButton:{label:`××פ×שâ¦`},contentToc:{title:`×××£ ××`},dropdownMenu:{noMatch:`×× × ×צ×× ×ת×××`,search:`×פשâ¦`},dashboardSearch:{theme:`ער×ת × ×ש×`},dashboardSearchButton:{label:`××פ×שâ¦`},dashboardSidebarCollapse:{collapse:`××××¥ סר×× ×¦×`,expand:`×ר×× ×¡×¨×× ×¦×`},dashboardSidebarToggle:{close:`ס××ר סר×× ×¦×`,open:`×¤×ª× ×¡×¨×× ×¦×`},drawer:{close:`ס××ר`},error:{clear:`×××¨× ×××£ ×××ת`},fileUpload:{removeFile:`×סר {filename}`},header:{close:`ס××ר תפר××`,open:`×¤×ª× ×ª×¤×¨××`},inputMenu:{create:`צ×ר "{label}"`,noData:`××× × ×ª×× ××`,noMatch:`××× ×ת×××`},inputNumber:{decrement:`×פ×ת`,increment:`××סף`},listbox:{noData:`××× × ×ª×× ××`,noMatch:`×× × ×צ×× ×ת×××`,search:`×פשâ¦`},modal:{close:`ס××ר`},pricingTable:{caption:`ש×פ×ר ×××ר××`},prose:{codeCollapse:{closeText:`××××¥`,name:`×§××`,openText:`×ר××`},collapsible:{closeText:`×סתר`,name:`××פ××× ××`,openText:`×צ×`},pre:{copy:`×עתק ×§×× ××××`},prompt:{copy:`×עתק ×× ×××`,openIn:`×¤×ª× ×-{name}`}},sidebar:{close:`ס××ר`,toggle:`××××£`},selectMenu:{create:`צ×ר "{label}"`,noData:`××× × ×ª×× ××`,noMatch:`×× × ×צ×× ×ת×××`,search:`×פשâ¦`},slideover:{close:`ס××ר`},table:{noData:`××× × ×ª×× ×× ××צ××`},toast:{close:`ס××ר`}}}),iy=w(()=>U(()=>import(`./CR-wUy2I.js`).then(e=>e.default||e),__vite__mapDeps([224,1,3,4,2,5,6,7,8,9,10,79,114,124,19,18,166,16,17,20,21,22,85,27,40,41,39,25,44,23,24,46,72,47,49,28,29,74,31,32,33,45,42,43,48,26,73,67,93,94,30,63,121,37,35,36,50,51,34,99,167,81,83,75,136,139,161,106,162,125,123,105,69,107,62,115,76,168,100,98,71,154,153,80,169,192,137,97,101]),import.meta.url)),ay={key:0,class:`fixed top-(--sai-top) inset-x-0 z-50 flex justify-center px-4 pt-2`},oy={class:`bg-white rounded-2xl shadow-lg border border-sand-200 p-4 flex items-center gap-3 max-w-md w-full`},sy={class:`flex-1 min-w-0`},cy={class:`text-sm font-medium text-sand-900`},ly={class:`text-xs text-sand-500`},uy={key:1,class:`flex items-center gap-1`},dy=N({__name:`app`,async setup(e){let t,n,{t:r,locale:i,isRtl:a}=Mn(),o=M(()=>i.value===`he`?ry:i.value===`fr`?ny:i.value===`en`?vi:ty),s=xn(`i18n.now`,()=>Date.now());Er(()=>{s.value=Date.now()},6e4),mn(()=>({htmlAttrs:{lang:i.value,dir:a.value?`rtl`:`ltr`}})),gn({description:()=>r(`common.seo.description`),ogDescription:()=>r(`common.seo.description`),twitterDescription:()=>r(`common.seo.description`),ogLocale:()=>i.value.replace(`-`,`_`)});let l=qn(),{error:u}=([t,n]=v(()=>Wt(Jn,Wn,{watch:[l],default:()=>null,server:!0})),t=await t,n(),t),f=an;[t,n]=v(()=>Wt(Yn,()=>f(`/api/markets`),{default:()=>({markets:[],suggestedCountry:`PY`}),server:!0})),await t,n();let p=Xv();[t,n]=v(()=>p()),await t,n();function h(e){let t=e.toLowerCase();return t.includes(`failed to fetch`)||t.includes(`load failed`)||t.includes(`networkerror`)||t.includes(`network request failed`)}let{isLoggedIn:g,user:_}=Hn(),y=M(()=>_.value?.avatar_url?Ci(_.value.avatar_url).thumb:void 0);mn({link:M(()=>y.value?[{rel:`preload`,as:`image`,href:y.value,type:`image/webp`}]:[])});let b=Le(),{visible:x,checkForUpdate:S,dismiss:w,openStore:ee}=ey(),{syncDeviceInfo:T}=Gg();_e(()=>{let{logDebug:e}=Ln();e(`auth.app_mounted`,{route:b.path,isLoggedIn:g.value,hasUserValue:!!_.value}),setTimeout(async()=>
71{if(!g.value||_.value){e(`auth.invariant_ok`,{route:b.path,isLoggedIn:g.value,hasUserValue:!!_.value});return}e(`auth.invariant_violation`,{route:b.path});let t=null;try{await Ht(Jn)}catch(e){t=e instanceof Error?e.message:String(e)}let n=!!_.value,r=u.value?.message??``,i=!n&&h(t??r);if(e(`auth.invariant_recovery`,{route:b.path,recovered:n,hadError:!!t,transientNetwork:i,fetchError:r||void 0}),n&&!t||i)return;let{submitBugReport:a}=Vn();a({category:`auth`,description:`[Auth] Invariant violation NOT recovered: isLoggedIn=true but user.value=null 3s after mount (route=${b.path})`,errorMessage:JSON.stringify({recovered:n,recoveryError:t}),silent:!0}).catch(()=>{})},3e3),te(),S()}),m(_,(e,t)=>{e&&!t&&T()},{immediate:!0});async function te(){try{let{Capacitor:e}=await U(async()=>{let{Capacitor:e}=await import(`./CPKfJ3ml.js`);return{Capacitor:e}},[],import.meta.url);if(!e.isNativePlatform())return;let{CapacitorUpdater:t}=await U(async()=>{let{CapacitorUpdater:e}=await import(`./D7GQcVIF.js`);return{CapacitorUpdater:e}},__vite__mapDeps([225,6,220,226]),import.meta.url);await t.notifyAppReady()}catch{}}let ne=[`/ingresar`,`/verificar`,`/registrar`,`/confirmar`],re=M(()=>b.path.startsWith(`/auth`)||b.path.startsWith(`/r/`)||ne.includes(b.path)),ie=M(()=>b.path.startsWith(`/r/`)),ae=M(()=>b.path===`/`&&!g.value&&!xr()&&!br(b.query)&&!yr(b.query)),oe=M(()=>b.path.startsWith(`/chat`)||b.path.startsWith(`/asistente`)),se=M(()=>g.value||xr()),ce=M(()=>re.value||ae.value),E=M(()=>!!b.meta.hideBottomNav),le=M(()=>se.value&&!re.value&&!oe.value&&!E.value),ue=M(()=>b.meta.pageTitleKey?r(b.meta.pageTitleKey):void 0),de=M(()=>b.meta.pageTitleClass),fe=M(()=>b.meta.pageTitleAccentKey?r(b.meta.pageTitleAccentKey):void 0),pe=M(()=>b.meta.backTo),me=M(()=>b.meta.backLabelKey?r(b.meta.backLabelKey):void 0),he=M(()=>!!ue.value&&!ce.value),k=M(()=>!ce.value&&!he.value),ge=M(()=>!ce.value);return(e,t)=>{let n=si,i=ui,a=qt,s=O_,l=pi,u=jn,f=Y_,p=mi,m=nv,h=ii,_=uv,v=mv,y=xv,b=wv,S=Bv,T=iy,te=Wv,ne=Yv;return P(),z(ne,{locale:C(o),toaster:null},{default:I(()=>[c(te,null,{default:I(()=>[c(a,null,{default:I(()=>[(P(),z(qe,{to:`body`},[c(Pt,{"enter-active-class":`transition-all duration-300 ease-out`,"enter-from-class":`opacity-0 -translate-y-full`,"enter-to-class":`opacity-100 translate-y-0`,"leave-active-class":`transition-all duration-200 ease-in`,"leave-from-class":`opacity-100 translate-y-0`,"leave-to-class":`opacity-0 -translate-y-full`},{default:I(()=>[C(x)?(P(),A(`div`,ay,[O(`div`,oy,[c(n,{name:`i-lucide-download`,class:`w-6 h-6 text-teal-500 shrink-0`}),O(`div`,sy,[O(`p`,cy,L(C(r)(`common.update.title`)),1),O(`p`,ly,L(C(r)(`common.update.description`)),1)]),c(i,{size:`sm`,color:`primary`,onClick:C(ee)},{default:I(()=>[d(L(C(r)(`common.actions.update`)),1)]),_:1},8,[`onClick`]),c(i,{size:`sm`,color:`neutral`,variant:`ghost`,icon:`i-lucide-x`,"aria-label":C(r)(`common.actions.close`),onClick:C(w)},null,8,[`aria-label`,`onClick`])])])):V(``,!0)]),_:1})]))]),_:1}),c(a,null,{default:I(()=>[C(ie)?V(``,!0):(P(),z(s,{key:0}))]),_:1}),C(k)?(P(),z(m,{key:0},{leading:I(()=>[c(u,{to:`/`},{default:I(()=>[c(l,{size:`md`})]),_:1})]),trailing:I(()=>[c(a,null,{default:I(()=>[C(g)?(P(),z(f,{key:0})):(P(),A(`div`,uy,[c(p,{compact:``}),c(u,{to:`/ingresar`,class:`px-3 py-2 rounded-full text-[0.8125rem] font-bold text-ink hover:bg-sand-200 transition-colors`},{default:I(()=>[d(L(C(r)(`common.nav.login`)),1)]),_:1}),c(u,{to:`/registrar`,class:`px-3.5 py-2 rounded-full text-[0.8125rem] font-bold bg-ink text-white`},{default:I(()=>[d(L(C(r)(`common.nav.signup`)),1)]),_:1})]))]),_:1})]),_:1})):V(``,!0),C(ge)?(P(),z(h,{key:1,class:`hidden sm:block`})):V(``,!0),c(b,{class:D(C(oe)?`min-h-dvh sm:min-h-[calc(100dvh-var(--ui-header-height))]`:`bg-transparent`)},{default:I(()=>[C(he)?(P(),z(_,{key:0,title:C(ue),"title-class":C(de),"title-accent":C(fe),"back-to":C(pe),"back-label":C(me)},null,8,[`title`,`title-class`,`title-accent`,`back-to`,`back-label`])):V(``,!0),c(y,null,{default:I(()=>[c(v)]),_:1})]),_:1},8,[`class`]),c(a,null,{default:I(()=>[C(le)?(P(),z(S,{key:0})):V(``,!0)]),_:1}),c(a,null,{default:I(()=>[c(T)]),_:1})]),_:1})]),_:1},8,[`locale`])}}}),fy=rn(`/images/mascot/piko-shrug.webp`),py={class:`min-h-screen bg-sand-200 flex flex-col`},my={class:`flex-1 flex items-center justify-center px-4 py-12`},hy={class:`text-center max-w-lg`},gy=[`alt`],_y={class:`inline-flex items-center gap-2 px-4 py-2 rounded-full bg-sand-100 border border-sand-300 mb
71-6`},vy={class:`text-sm font-medium text-sand-600`},yy={class:`text-lg font-bold text-terracotta-500`},by={class:`mb-4`},xy={class:`text-sand-600 text-base sm:text-lg mb-8 max-w-md mx-auto`},Sy={class:`mt-6 flex flex-col items-center gap-3`},Cy={class:`text-sm text-sand-500`},wy=N({__name:`error`,props:{error:{}},setup(e){let{t}=Mn(),n=e,r=()=>Be({redirect:`/`}),i=M(()=>n.error?.status===404),a=R(!1),o=window.location.href;return(n,s)=>{let l=pi,u=jn,f=si,p=ui,m=Vr;return P(),A(`div`,py,[O(`div`,my,[O(`div`,hy,[c(u,{to:`/`,class:`inline-block mb-8`},{default:I(()=>[c(l,{size:`xl`})]),_:1}),O(`img`,{src:fy,alt:C(t)(`common.errors.mascot`),class:`mb-8 mx-auto w-48 h-48 sm:w-64 sm:h-64 object-contain`},null,8,gy),O(`div`,_y,[O(`span`,vy,L(C(t)(`common.status.error`)),1),O(`span`,yy,L(e.error?.status||500),1)]),O(`h1`,by,[C(i)?(P(),A(F,{key:0},[d(L(C(t)(`common.errors.pageNotFound`)),1)],64)):(P(),A(F,{key:1},[d(L(C(t)(`common.errors.unexpectedTitle`)),1)],64))]),O(`p`,xy,[C(i)?(P(),A(F,{key:0},[d(L(C(t)(`common.errors.notFoundHelp`)),1)],64)):(P(),A(F,{key:1},[d(L(C(t)(`common.errors.unexpectedHelp`)),1)],64))]),c(p,{size:`xl`,color:`primary`,class:`px-8`,onClick:r},{default:I(()=>[c(f,{name:`i-lucide-home`,class:`w-5 h-5 me-2`}),d(` `+L(C(t)(`common.errors.home`)),1)]),_:1}),O(`div`,Sy,[C(i)?V(``,!0):(P(),z(p,{key:0,variant:`soft`,color:`neutral`,size:`sm`,icon:`i-lucide-bug`,onClick:s[0]||=e=>a.value=!0},{default:I(()=>[d(L(C(t)(`common.errors.report`)),1)]),_:1})),O(`p`,Cy,[d(L(C(t)(`common.errors.help`))+` `,1),c(u,{to:`/contacto`,class:`text-teal-600 hover:text-teal-700 underline underline-offset-2 transition-colors`},{default:I(()=>[d(L(C(t)(`common.errors.contact`)),1)]),_:1})])])])]),c(m,{open:C(a),"onUpdate:open":s[1]||=e=>Ke(a)?a.value=e:null,"error-code":e.error?.status,"error-message":e.error?.message,"page-url":C(o)},null,8,[`open`,`error-code`,`error-message`,`page-url`])])}}}),Ty=()=>null,Ey={key:0},Dy={__name:`nuxt-root`,setup(e){let t=p(),n=t.deferHydration();if(t.isHydrating){let e=t.hooks.hookOnce(`app:error`,n),r=Pe().beforeEach(()=>{e(),r()})}window.location.pathname,Se(f,Le()),t.hooks.callHookWith(e=>e.map(e=>e()),`vue:setup`,[]);let r=Ve();function i(e,n,r){let i=t.vueApp.config.errorHandler;if(i&&!i.__nuxt_default)try{i(e,n,r)}catch(e){console.error("[nuxt] Error in `app.config.errorHandler`",e)}}return He((e,n,r)=>{if(t.hooks.callHook(`vue:error`,e,n,r)?.catch(e=>console.error("[nuxt] Error in `vue:error` hook",e)),h(navigator.userAgent))return We(t,e),!1;if(me(e)&&(e.fatal||e.unhandled))return t.runWithContext(()=>Ie(e)),i(e,n,r),!1}),(e,t)=>(P(),z(Ne,{onResolve:C(n)},{default:I(()=>[C(!1)?(P(),A(`div`,Ey)):C(r)?(P(),z(C(wy),{key:1,error:C(r)},null,8,[`error`])):C(!1)?(P(),z(C(Ty),{key:2,context:C(!1)},null,8,[`context`])):C(!1)?(P(),z(Xe(C(!1)),{key:3})):(P(),z(C(dy),{key:4}))]),_:1},8,[`onResolve`]))}},Oy;{let e;Oy=async function(){if(e)return e;let t=!!(window.__NUXT__?.serverRendered??document.getElementById(`__NUXT_DATA__`)?.dataset.ssr===`true`),n=t?Rt(Dy):Gt(Dy),r=nt({vueApp:n});async function i(e){await r.callHook(`app:error`,e),r.payload.error||=Te(e)}i.__nuxt_default=!0,n.config.errorHandler=i,r.hook(`app:suspense:resolve`,()=>{n.config.errorHandler===i&&(n.config.errorHandler=void 0)}),!t&&ze.id&&r.hook(`app:suspense:resolve`,()=>{document.getElementById(ze.id)?.remove()});try{await ne(r,qg)}catch(e){i(e)}try{await r.hooks.callHook(`app:created`,n),await r.hooks.callHook(`app:beforeMount`,n),n.mount(te),await r.hooks.callHook(`app:mounted`,n),await Ge()}catch(e){i(e)}return n},e=Oy().catch(e=>{throw Ee.NUXT_E1009({cause:e}),e})}
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.