vendor: 23,657 bytes, lines 1-9
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terms-CNvBhaTO.js","assets/useRouter-Bbx_8wWX.js","assets/Sections-Ds8yhNw8.js","assets/link-eBBbDe5E.js","assets/useStore-CJvvp01j.js","assets/utils-D3Lfb1fn.js","assets/react-dom-wUPVZIUq.js","assets/shop-BoNLUgXg.js","assets/dist-BRJR1vZF.js","assets/class-strength--0F5xwgG.js","assets/refund-C-1ePvpL.js","assets/privacy-Bxmg10uq.js","assets/memberships-DhsHOSzj.js","assets/get-started-DyTbrSoV.js","assets/select-rwDKgfh5.js","assets/check-Dp9-UyCi.js","assets/label-Cw0QE-Q2.js","assets/hero-gym-CUHRqiZr.js","assets/Turnstile-Dv5Ous32.js","assets/input-CDnDA9Zq.js","assets/contact-DY5CXM1D.js","assets/community-Dz_6XTQp.js","assets/textarea-DT5kDch5.js","assets/coaches-BnfkLpsh.js","assets/classes-DphJ3FdK.js","assets/auth-Dr04Unvz.js","assets/academy-Dg67BUBf.js","assets/users-DoKLLQie.js","assets/_-DLZuIlmx.js","assets/route-CT20GCnY.js","assets/routes-CA6dEDm4.js","assets/arrow-right-BdX9rLeP.js","assets/class-gymnastics-By_pAs4M.js","assets/posts-DPxPU9cn.js","assets/blog.functions-B3_az7rn.js","assets/blog.index-DrvN1VpA.js","assets/product._handle-BosyKLRh.js","assets/arrow-left-B04Pwy7t.js","assets/blog._slug-BgDkXAk5.js","assets/coaches.index-CzPIoDFC.js","assets/coaches._slug-Dc9-gQ0C.js","assets/auth.confirm-CjGDHb7v.js","assets/write-QLKUOMx8.js","assets/format-DR1rHuvg.js","assets/admin.posts-DEBedZVe.js","assets/eye-off-Chj9U9ty.js","assets/admin.enquiries-BFPIXw0n.js","assets/admin.chats-C3mqsPj0.js"])))=>i.map(i=>d[i]); 2import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./useRouter-Bbx_8wWX.js";import{t as s}from"./react-dom-wUPVZIUq.js";import{A as c,C as l,D as u,E as d,F as f,M as p,N as m,O as h,P as g,S as _,T as v,_ as y,a as b,b as x,c as S,d as ee,f as C,g as te,h as ne,i as re,j as ie,k as ae,m as oe,n as se,p as ce,r as le,s as ue,t as w,u as E,v as de,w as fe,x as pe,y as me}from"./useStore-CJvvp01j.js";import{i as D,n as O,r as he,t as ge}from"./redirect-C-eRQtnH.js";import{n as _e,r as ve,t as ye}from"./matchContext-BFf1DefC.js";import{t as be}from"./link-eBBbDe5E.js";import{a as xe,i as Se,t as Ce}from"./utils-D3Lfb1fn.js";import{n as we,t as Te}from"./dist-BRJR1vZF.js";var Ee=r((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,ie());else{var t=n(l);t!==null&&se(x,t.startTime-e)}}var S=!1,ee=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<C)}function re(){if(g=!1,S){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(ee),ee=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&se(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():S=!1}}}var ie;if(typeof y==`function`)ie=function(){y(re)};else if(typeof MessageChannel<`u`){var ae=new MessageChannel,oe=ae.port2;ae.port1.onmessage=re,ie=function(){oe.postMessage(null)}}else ie=function(){_(re,0)};function se(t,n){ee=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(ee),ee=-1):h=!0,se(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ie()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),De=r(((e,t)=>{t.exports=Ee()})),Oe=r((t=>{var n=De(),r=e(),i=s();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return d(i),e;if(o===r)return d(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case C:return`Suspense`;case te:return`SuspenseList`;case ie:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ue=Array.isArray,w=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],pe=-1;function me(e){return{current:e}}function D(e){0>pe||(e.current=fe[pe],fe[pe]=null,pe--)}function O(e,t){pe++,fe[pe]=e.current,e.current=t}var he=me(null),ge=me(null),_e=me(null),ve=me(null);function ye(e,t){switch(O(_e,t),O(ge,e),O(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xd(t),e=Zd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}D(he),O(he,e)}function be(){D(he),D(ge),D(_e)}function xe(e){e.memoizedState!==null&&O(ve,e);var t=he.current,n=Zd(t,e.type);t!==n&&(O(ge,e),O(he,n))}function Se(e){ge.current===e&&(D(he),D(ge)),ve.current===e&&(D(ve),op._currentValue=de)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1<e.stack.indexOf(` 3 at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` 4`+Ce+e+we}var Ee=!1;function Oe(e,t){if(!e||Ee)return``;Ee=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(` 5`),l=s.split(` 6`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=` 7`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ee=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Te(n):``}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Te(e.type);case 16:return Te(`Lazy`);case 13:return e.child!==t&&t!==null?Te(`Suspense Fallback`):Te(`Suspense`);case 19:return Te(`SuspenseList`);case 0:case 15:return Oe(e.type,!1);case 11:return Oe(e.type.render,!1);case 1:return Oe(e.type,!0);case 31:return Te(`Activity`);default:return``}}function Ae(e){try{var t=``,n=null;do t+=ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return` 8Error generating stack: `+e.message+` 9`+e.stack}}var je=Object.prototype.hasOwnProperty,Me=n.unstable_scheduleCallback,Ne=n.unstable_cancelCallback,Pe=n.unstable_shouldYield,Fe=n.unstable_requestPaint,Ie=n.unstable_now,Le=n.unstable_getCurrentPriorityLevel,Re=n.unstable_ImmediatePriority,ze=n.unstable_UserBlockingPriority,Be=n.unstable_NormalPriority,Ve=n.unstable_LowPriority,He=n.unstable_IdlePriority,Ue=n.log,We=n.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&<(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=E.p;return e===0?(e=window.event,e===void 0?32:Sp(e.type)):e}function ht(e,t){var n=E.p;try{return E.p=e,t()}finally{E.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt;function Tt(e){delete e[_t],delete e[vt],delete e[bt],delete e[xt],delete e[St]}function Et(e){var t=e[_t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bf(e);e!==null;){if(n=e[_t])return n;e=bf(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function kt(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[wt]=!0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),It={},Lt={};function Rt(e){return je.call(Lt,e)?!0:je.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}function zt(e,t,n){if(Rt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Bt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Vt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ht(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Wt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gt(e){if(!e._valueTracker){var t=Ut(e)?`checked`:`value`;e._valueTracker=Wt(e,t,``+e[t])}}function Kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ut(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function qt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Jt=/[\n"\\]/g;function Yt(e){return e.replace(Jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Xt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ht(t)):e.value!==``+Ht(t)&&(e.value=``+Ht(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Qt(e,o,Ht(n)):Qt(e,o,Ht(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ht(s):e.removeAttribute(`name`)}function Zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Gt(e);return}n=n==null?``:``+Ht(n),t=t==null?n:``+Ht(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Gt(e)}function Qt(e,t,n){t===`number`&&qt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function $t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ht(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function en(e,t,n){if(t!=null&&(t=``+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ht(n)}function tn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ue(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Ht(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Gt(e)}function nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function an(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||rn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&an(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&an(e,o,t[o])}function sn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var cn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`
9clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),ln=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function un(e){return ln.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function dn(){}var fn=null;function pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mn=null,hn=null;function gn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Xt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Yt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[vt]||null;if(!i)throw Error(a(90));Xt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Kt(r)}break a;case`textarea`:en(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&$t(e,!!n.multiple,t,!1)}}}var _n=!1;
vendor: 81,274 bytes, line 9
9function vn(e,t,n){if(_n)return e(t,n);_n=!0;try{return e(t)}finally{if(_n=!1,(mn!==null||hn!==null)&&(ku(),mn&&(t=mn,e=hn,hn=mn=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function yn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var bn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),xn=!1;if(bn)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){xn=!0}}),window.addEventListener(`test`,Sn,Sn),window.removeEventListener(`test`,Sn,Sn)}catch{xn=!1}var Cn=null,wn=null,Tn=null;function En(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Tn=i.slice(e,1<r?1-r:void 0)}function Dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function On(){return!0}function kn(){return!1}function k(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?On:kn,this.isPropagationStopped=kn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=On)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=On)},persist:function(){},isPersistent:On}),t}var An={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jn=k(An),Mn=m({},An,{view:0,detail:0}),A=k(Mn),Nn,Pn,Fn,In=m({},Mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Fn&&(Fn&&e.type===`mousemove`?(Nn=e.screenX-Fn.screenX,Pn=e.screenY-Fn.screenY):Pn=Nn=0,Fn=e),Nn)},movementY:function(e){return`movementY`in e?e.movementY:Pn}}),Ln=k(In),Rn=k(m({},In,{dataTransfer:0})),zn=k(m({},Mn,{relatedTarget:0})),Bn=k(m({},An,{animationName:0,elapsedTime:0,pseudoElement:0})),Vn=k(m({},An,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Hn=k(m({},An,{data:0})),Un={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Wn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Gn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gn[e])?!!t[e]:!1}function qn(){return Kn}var Jn=k(m({},Mn,{key:function(e){if(e.key){var t=Un[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Wn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qn,charCode:function(e){return e.type===`keypress`?Dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Yn=k(m({},In,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Xn=k(m({},Mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qn})),Zn=k(m({},An,{propertyName:0,elapsedTime:0,pseudoElement:0})),Qn=k(m({},In,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),$n=k(m({},An,{newState:0,oldState:0})),er=[9,13,27,32],tr=bn&&`CompositionEvent`in window,nr=null;bn&&`documentMode`in document&&(nr=document.documentMode);var rr=bn&&`TextEvent`in window&&!nr,ir=bn&&(!tr||nr&&8<nr&&11>=nr),ar=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return er.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var lr=!1;function ur(e,t){switch(e){case`compositionend`:return cr(t);case`keypress`:return t.which===32?(or=!0,ar):null;case`textInput`:return e=t.data,e===ar&&or?null:e;default:return null}}function dr(e,t){if(lr)return e===`compositionend`||!tr&&sr(e,t)?(e=En(),Tn=wn=Cn=null,lr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return ir&&t.locale!==`ko`?null:t.data;default:return null}}var fr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!fr[e.type]:t===`textarea`}function mr(e,t,n,r){mn?hn?hn.push(r):hn=[r]:mn=r,t=Fd(t,`onChange`),0<t.length&&(n=new jn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var hr=null,gr=null;function _r(e){Od(e,0)}function vr(e){if(Kt(Ot(e)))return e}function yr(e,t){if(e===`change`)return t}var br=!1;if(bn){var xr;if(bn){var Sr=`oninput`in document;if(!Sr){var Cr=document.createElement(`div`);Cr.setAttribute(`oninput`,`return;`),Sr=typeof Cr.oninput==`function`}xr=Sr}else xr=!1;br=xr&&(!document.documentMode||9<document.documentMode)}function wr(){hr&&(hr.detachEvent(`onpropertychange`,Tr),gr=hr=null)}function Tr(e){if(e.propertyName===`value`&&vr(gr)){var t=[];mr(t,gr,e,pn(e)),vn(_r,t)}}function Er(e,t,n){e===`focusin`?(wr(),hr=t,gr=n,hr.attachEvent(`onpropertychange`,Tr)):e===`focusout`&&wr()}function Dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return vr(gr)}function Or(e,t){if(e===`click`)return vr(t)}function kr(e,t){if(e===`input`||e===`change`)return vr(t)}function Ar(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var jr=typeof Object.is==`function`?Object.is:Ar;function Mr(e,t){if(jr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!je.call(t,i)||!jr(e[i],t[i]))return!1}return!0}function Nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pr(e,t){var n=Nr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Nr(n)}}function Fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ir(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=qt(e.document)}return t}function Lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Rr=bn&&`documentMode`in document&&11>=document.documentMode,zr=null,Br=null,Vr=null,Hr=!1;function Ur(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hr||zr==null||zr!==qt(r)||(r=zr,`selectionStart`in r&&Lr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vr&&Mr(Vr,r)||(Vr=r,r=Fd(Br,`onSelect`),0<r.length&&(t=new jn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=zr)))}function Wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Gr={animationend:Wr(`Animation`,`AnimationEnd`),animationiteration:Wr(`Animation`,`AnimationIteration`),animationstart:Wr(`Animation`,`AnimationStart`),transitionrun:Wr(`Transition`,`TransitionRun`),transitionstart:Wr(`Transition`,`TransitionStart`),transitioncancel:Wr(`Transition`,`TransitionCancel`),transitionend:Wr(`Transition`,`TransitionEnd`)},Kr={},qr={};bn&&(qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),`TransitionEvent`in window||delete Gr.transitionend.transition);function Jr(e){if(Kr[e])return Kr[e];if(!Gr[e])return e;var t=Gr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qr)return Kr[e]=t[n];return e}var Yr=Jr(`animationend`),Xr=Jr(`animationiteration`),Zr=Jr(`animationstart`),Qr=Jr(`transitionrun`),$r=Jr(`transitionstart`),ei=Jr(`transitioncancel`),ti=Jr(`transitionend`),ni=new Map,ri=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ri.push(`scrollEnd`);function ii(e,t){ni.set(e,t),Nt(t,[e])}var ai=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},oi=[],si=0,ci=0;function li(){for(var e=si,t=ci=si=0;t<e;){var n=oi[t];oi[t++]=null;var r=oi[t];oi[t++]=null;var i=oi[t];oi[t++]=null;var a=oi[t];if(oi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&pi(n,i,a)}}function ui(e,t,n,r){oi[si++]=e,oi[si++]=t,oi[si++]=n,oi[si++]=r,ci|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function di(e,t,n,r){return ui(e,t,n,r),mi(e)}function fi(e,t){return ui(e,null,null,t),mi(e)}function pi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function mi(e){if(50<bu)throw bu=0,xu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hi={};function gi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _i(e,t,n,r){return new gi(e,t,n,r)}function vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yi(e,t){var n=e.alternate;return n===null?(n=_i(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function bi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function xi(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)vi(e)&&(s=1);else if(typeof e==`string`)s=Zf(e,n,he.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ie:return e=_i(31,n,t,i),e.elementType=ie,e.lanes=o,e;case v:return Si(n.children,i,o,t);case y:s=8,i|=24;break;case b:return e=_i(12,n,t,i|2),e.elementType=b,e.lanes=o,e;case C:return e=_i(13,n,t,i),e.elementType=C,e.lanes=o,e;case te:return e=_i(19,n,t,i),e.elementType=te,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case ee:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=_i(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Si(e,t,n,r){return e=_i(7,e,r,t),e.lanes=n,e}function Ci(e,t,n){return e=_i(6,e,null,t),e.lanes=n,e}function wi(e){var t=_i(18,null,null,0);return t.stateNode=e,t}function Ti(e,t,n){return t=_i(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ei=new WeakMap;function Di(e,t){if(typeof e==`object`&&e){var n=Ei.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Ei.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Oi=[],ki=0,Ai=null,ji=0,Mi=[],Ni=0,Pi=null,Fi=1,Ii=``;function Li(e,t){Oi[ki++]=ji,Oi[ki++]=Ai,Ai=e,ji=t}function Ri(e,t,n){Mi[Ni++]=Fi,Mi[Ni++]=Ii,Mi[Ni++]=Pi,Pi=e;var r=Fi;e=Ii;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Fi=1<<32-Je(t)+i|n<<i|r,Ii=a+e}else Fi=1<<a|n<<i|r,Ii=e}function zi(e){e.return!==null&&(Li(e,1),Ri(e,1,0))}function Bi(e){for(;e===Ai;)Ai=Oi[--ki],Oi[ki]=null,ji=Oi[--ki],Oi[ki]=null;for(;e===Pi;)Pi=Mi[--Ni],Mi[Ni]=null,Ii=Mi[--Ni],Mi[Ni]=null,Fi=Mi[--Ni],Mi[Ni]=null}function Vi(e,t){Mi[Ni++]=Fi,Mi[Ni++]=Ii,Mi[Ni++]=Pi,Fi=t.id,Ii=t.overflow,Pi=e}var Hi=null,j=null,M=!1,Ui=null,Wi=!1,Gi=Error(a(519));function Ki(e){throw Qi(Di(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Gi}function qi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:W(`cancel`,t),W(`close`,t);break;case`iframe`:case`object`:case`embed`:W(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ed.length;n++)W(Ed[n],t);break;case`source`:W(`error`,t);break;case`img`:case`image`:case`link`:W(`error`,t),W(`load`,t);break;case`details`:W(`toggle`,t);break;case`input`:W(`invalid`,t),Zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:W(`invalid`,t);break;case`textarea`:W(`invalid`,t),tn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Vd(t.textContent,n)?(r.popover!=null&&(W(`beforetoggle`,t),W(`toggle`,t)),r.onScroll!=null&&W(`scroll`,t),r.onScrollEnd!=null&&W(`scrollend`,t),r.onClick!=null&&(t.onclick=dn),t=!0):t=!1,t||Ki(e,!0)}function Ji(e){for(Hi=e.return;Hi;)switch(Hi.tag){case 5:case 31:case 13:Wi=!1;return;case 27:case 3:Wi=!0;return;default:Hi=Hi.return}}function Yi(e){if(e!==Hi)return!1;if(!M)return Ji(e),M=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Qd(e.type,e.memoizedProps)),n=!n),n&&j&&Ki(e),Ji(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));j=yf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));j=yf(e)}else t===27?(t=j,sf(e.type)?(e=vf,vf=null,j=e):j=t):j=Hi?_f(e.stateNode.nextSibling):null;return!0}function Xi(){j=Hi=null,M=!1}function Zi(){var e=Ui;return e!==null&&(su===null?su=e:su.push.apply(su,e),Ui=null),e}function Qi(e){Ui===null?Ui=[e]:Ui.push(e)}var $i=me(null),ea=null,ta=null;function na(e,t,n){O($i,t._currentValue),t._currentValue=n}function ra(e){e._currentValue=$i.current,D($i)}function ia(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function aa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ia(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ia(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function oa(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;jr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===ve.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[op]:e.push(op))}i=i.return}e!==null&&aa(t,e,n,r),t.flags|=262144}function sa(e){for(e=e.firstContext;e!==null;){if(!jr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ca(e){ea=e,ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function la(e){return da(ea,e)}function ua(e,t){return ea===null&&ca(e),da(e,t)}function da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ta===null){if(e===null)throw Error(a(308));ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ta=ta.next=t;return n}var fa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},pa=n.unstable_scheduleCallback,ma=n.unstable_NormalPriority,ha={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ga(){return{controller:new fa,data:new Map,refCount:0}}function _a(e){e.refCount--,e.refCount===0&&pa(ma,function(){e.controller.abort()})}var va=null,ya=0,ba=0,xa=null;function Sa(e,t){if(va===null){var n=va=[];ya=0,ba=bd(),xa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ya++,t.then(Ca,Ca),t}function Ca(){if(--ya===0&&va!==null){xa!==null&&(xa.status=`fulfilled`);var e=va;va=null,ba=0,xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ta=w.S;w.S=function(e,t){uu=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&Sa(e,t),Ta!==null&&Ta(e,t)};var Ea=me(null);function Da(){var e=Ea.current;return e===null?Jl.pooledCache:e}function Oa(e,t){t===null?O(Ea,Ea.current):O(Ea,t.pool)}function ka(){var e=Da();return e===null?null:{parent:ha._currentValue,pool:e}}var Aa=Error(a(460)),ja=Error(a(474)),Ma=Error(a(542)),Na={then:function(){}};function Pa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Fa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dn,dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,za(e),e;default:if(typeof t.status==`string`)t.then(dn,dn);else{if(e=Jl,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,za(e),e}throw La=t,Aa}}function Ia(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(La=e,Aa):e}}var La=null;function Ra(){if(La===null)throw Error(a(459));var e=La;return La=null,e}function za(e){if(e===Aa||e===Ma)throw Error(a(483))}var Ba=null,Va=0;function N(e){var t=Va;return Va+=1,Ba===null&&(Ba=[]),Fa(Ba,e,t)}function Ha(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ua(e,t){throw t.$$typeof===h?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Wa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=yi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ci(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===re&&Ia(a)===t.type)?(t=i(t,n.props),Ha(t,n),t.return=e,t):(t=xi(n.type,n.key,n.props,null,e.mode,r),Ha(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ti(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Si(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=xi(t.type,t.key,t.props,null,e.mode,n),Ha(n,t),n.return=e,n;case _:return t=Ti(t,e.mode,n),t.return=e,t;case re:return t=Ia(t),f(e,t,n)}if(ue(t)||se(t))return t=Si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,N(t),n);if(t.$$typeof===S)return f(e,ua(e,t),n);Ua(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case re:return n=Ia(n),p(e,t,n,r)}if(ue(n)||se(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,N(n),r);if(n.$$typeof===S)return p(e,t,ua(e,n),r);Ua(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=Ia(r),m(e,t,n,r,i)}if(ue(r)||se(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,N(r),i);if(r.$$typeof===S)return m(e,t,n,ua(t,r),i);Ua(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),M&&Li(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return M&&Li(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),M&&Li(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),M&&Li(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return M&&Li(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),M&&Li(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===v&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Ia(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ha(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===v?(c=Si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=xi(o.type,o.key,o.props,null,e.mode,c),Ha(c,o),c.return=e,e=c)}return s(e);case _:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=Ti(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=Ia(o),b(e,r,o,c)}if(ue(o))return h(e,r,o,c);if(se(o)){if(l=se(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,N(o),c);if(o.$$typeof===S)return b(e,r,ua(e,o),c);Ua(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=Ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Va=0;var i=b(e,t,n,r);return Ba=null,i}catch(t){if(t===Aa||t===Ma)throw t;var a=_i(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ga=Wa(!0),Ka=Wa(!1),qa=!1;function Ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,R&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=mi(e),pi(e,null,n),t}return ui(e,r,t,n),mi(e)}function Qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function $a(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var eo=!1;function to(){if(eo){var e=xa;if(e!==null)throw e}}function no(e,t,n,r){eo=!1;var i=e.updateQueue;qa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(B&f)===f:(r&f)===f){f!==0&&f===ba&&(eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:qa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),tu|=o,e.lanes=o,e.memoizedState=d}}function ro(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function io(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ro(n[e],t)}var ao=me(null),oo=me(0);function so(e,t){e=$l,O(oo,e),O(ao,t),$l=e|t.baseLanes}function co(){O(oo,$l),O(ao,ao.current)}function lo(){$l=oo.current,D(ao),D(oo)}var uo=me(null),fo=null;function po(e){var t=e.alternate;O(vo,vo.current&1),O(uo,e),fo===null&&(t===null||ao.current!==null||t.memoizedState!==null)&&(fo=e)}function mo(e){O(vo,vo.current),O(uo,e),fo===null&&(fo=e)}function ho(e){e.tag===22?(O(vo,vo.current),O(uo,e),fo===null&&(fo=e)):go(e)}function go(){O(vo,vo.current),O(uo,uo.current)}function _o(e){D(uo),fo===e&&(fo=null),D(vo)}var vo=me(0);function yo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mf(n)||hf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bo=0,P=null,xo=null,So=null,Co=!1,wo=!1,To=!1,Eo=0,Do=0,Oo=null,ko=0;function Ao(){throw Error(a(321))}function jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jr(e[n],t[n]))return!1;return!0}function Mo(e,t,n,r,i,a){return bo=a,P=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?qs:Js,To=!1,a=n(r,i),To=!1,wo&&(a=Po(t,n,r,i)),No(e),a}function No(e){w.H=Ks;var t=xo!==null&&xo.next!==null;if(bo=0,So=xo=P=null,Co=!1,Do=0,Oo=null,t)throw Error(a(300));e===null||dc||(e=e.dependencies,e!==null&&sa(e)&&(dc=!0))}function Po(e,t,n,r){P=e;var i=0;do{if(wo&&(Oo=null),Do=0,wo=!1,25<=i)throw Error(a(301));if(i+=1,So=xo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}w.H=Ys,o=t(n,r)}while(wo);return o}function Fo(){var e=w.H,t=e.useState()[0];return t=typeof t.then==`function`?F(t):t,e=e.useState()[0],(xo===null?null:xo.memoizedState)!==e&&(P.flags|=1024),t}function Io(){var e=Eo!==0;return Eo=0,e}function Lo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ro(e){if(Co){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Co=!1}bo=0,So=xo=P=null,wo=!1,Do=Eo=0,Oo=null}function zo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return So===null?P.memoizedState=So=e:So=So.next=e,So}function Bo(){if(xo===null){var e=P.alternate;e=e===null?null:e.memoizedState}else e=xo.next;var t=So===null?P.memoizedState:So.next;if(t!==null)So=t,xo=e;else{if(e===null)throw P.alternate===null?Error(a(467)):Error(a(310));xo=e,e={memoizedState:xo.memoizedState,baseState:xo.baseState,baseQueue:xo.baseQueue,queue:xo.queue,next:null},So===null?P.memoizedState=So=e:So=So.next=e}return So}function Vo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function F(e){var t=Do;return Do+=1,Oo===null&&(Oo=[]),e=Fa(Oo,e,t),t=P,(So===null?t.memoizedState:So.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?qs:Js),e}function I(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return F(e);if(e.$$typeof===S)return la(e)}throw Error(a(438,String(e)))}function Ho(e){var t=null,n=P.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=P.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Vo(),P.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ae;return t.index++,n}function Uo(e,t){return typeof t==`function`?t(e):t}function Wo(e){return Go(Bo(),xo,e)}function Go(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(bo&f)===f:(B&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ba&&(d=!0);else if((bo&p)===p){u=u.next,p===ba&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,P.lanes|=p,tu|=p;f=u.action,To&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,P.lanes|=f,tu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!jr(o,e.memoizedState)&&(dc=!0,d&&(n=xa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ko(e){var t=Bo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);jr(o,t.memoizedState)||(dc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function qo(e,t,n){var r=P,i=Bo(),o=M;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!jr((xo||i).memoizedState,n);if(s&&(i.memoizedState=n,dc=!0),i=i.queue,vs(Xo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||So!==null&&So.memoizedState.tag&1){if(r.flags|=2048,ps(9,{destroy:void 0},Yo.bind(null,r,i,n,t),null),Jl===null)throw Error(a(349));o||bo&127||Jo(r,t,n)}return n}function Jo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=P.updateQueue,t===null?(t=Vo(),P.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Yo(e,t,n,r){t.value=n,t.getSnapshot=r,Zo(t)&&Qo(e)}function Xo(e,t,n){return n(function(){Zo(t)&&Qo(e)})}function Zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jr(e,n)}catch{return!0}}function Qo(e){var t=fi(e,2);t!==null&&wu(t,e,2)}function $o(e){var t=zo();if(typeof e==`function`){var n=e;if(e=n(),To){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:e},t}function es(e,t,n,r){return e.baseState=n,Go(e,xo,typeof r==`function`?r:Uo)}function ts(e,t,n,r,i){if(Us(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};w.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ns(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ns(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=w.T,o={};w.T=o;try{var s=n(i,r),c=w.S;c!==null&&c(o,s),rs(e,t,s)}catch(n){as(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),w.T=a}}else try{a=n(i,r),rs(e,t,a)}catch(n){as(e,t,n)}}function rs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){is(e,t,n)},function(n){return as(e,t,n)}):is(e,t,n)}function is(e,t,n){t.status=`fulfilled`,t.value=n,os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ns(e,n)))}function as(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,os(t),t=t.next;while(t!==r)}e.action=null}function os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ss(e,t){return t}function cs(e,t){if(M){var n=Jl.formState;if(n!==null){a:{var r=P;if(M){if(j){b:{for(var i=j,a=Wi;i.nodeType!==8;){if(!a){i=null;break b}if(i=_f(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){j=_f(i.nextSibling),r=i.data===`F!`;break a}}Ki(r)}r=!1}r&&(t=n[0])}}return n=zo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:t},n.queue=r,n=Bs.bind(null,P,r),r.dispatch=n,r=$o(!1),a=Hs.bind(null,P,!1,r.queue),r=zo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ts.bind(null,P,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ls(e){return us(Bo(),xo,e)}function us(e,t,n){if(t=Go(e,t,ss)[0],e=Wo(Uo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=F(t)}catch(e){throw e===Aa?Ma:e}else r=t;t=Bo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(P.flags|=2048,ps(9,{destroy:void 0},ds.bind(null,i,n),null)),[r,a,e]}function ds(e,t){e.action=t}function fs(e){var t=Bo(),n=xo;if(n!==null)return us(t,n,e);Bo(),t=t.memoizedState,n=Bo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ps(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=P.updateQueue,t===null&&(t=Vo(),P.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ms(){return Bo().memoizedState}function hs(e,t,n,r){var i=zo();P.flags|=e,i.memoizedState=ps(1|t,{destroy:void 0},n,r===void 0?null:r)}function gs(e,t,n,r){var i=Bo();r=r===void 0?null:r;var a=i.memoizedState.inst;xo!==null&&r!==null&&jo(r,xo.memoizedState.deps)?i.memoizedState=ps(t,a,n,r):(P.flags|=e,i.memoizedState=ps(1|t,a,n,r))}function _s(e,t){hs(8390656,8,e,t)}function vs(e,t){gs(2048,8,e,t)}function ys(e){P.flags|=4;var t=P.updateQueue;if(t===null)t=Vo(),P.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function bs(e){var t=Bo().memoizedState;return ys({ref:t,nextImpl:e}),function(){if(R&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function xs(e,t){return gs(4,2,e,t)}function Ss(e,t){return gs(4,4,e,t)}function Cs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ws(e,t,n){n=n==null?null:n.concat([e]),gs(4,4,Cs.bind(null,t,e),n)}function Ts(){}function Es(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ds(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&jo(t,r[1]))return r[0];if(r=e(),To){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Os(e,t,n){return n===void 0||bo&1073741824&&!(B&261930)?e.memoizedState=t:(e.memoizedState=n,e=Cu(),P.lanes|=e,tu|=e,n)}function ks(e,t,n,r){return jr(n,t)?n:ao.current===null?!(bo&42)||bo&1073741824&&!(B&261930)?(dc=!0,e.memoizedState=n):(e=Cu(),P.lanes|=e,tu|=e,t):(e=Os(e,n,r),jr(e,t)||(dc=!0),e)}function As(e,t,n,r,i){var a=E.p;E.p=a!==0&&8>a?a:8;var o=w.T,s={};w.T=s,Hs(e,!1,t,n);try{var c=i(),l=w.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Vs(e,t,wa(c,r),Su(e)):Vs(e,t,r,Su(e))}catch(n){Vs(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{E.p=a,o!==null&&s.types!==null&&(o.types=s.types),w.T=o}}function js(){}function Ms(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Ns(e).queue;As(e,i,t,de,n===null?js:function(){return Ps(e),n(r)})}function Ns(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:de},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ps(e){var t=Ns(e);t.next===null&&(t=e.alternate.memoizedState),Vs(e,t.next.queue,{},Su())}function Fs(){return la(op)}function Is(){return Bo().memoizedState}function Ls(){return Bo().memoizedState}function Rs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=Xa(n);var r=Za(t,e,n);r!==null&&(wu(r,t,n),Qa(r,t,n)),t={cache:ga()},e.payload=t;return}t=t.return}}function zs(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Us(e)?Ws(t,n):(n=di(e,t,n,r),n!==null&&(wu(n,e,r),Gs(n,t,r)))}function Bs(e,t,n){Vs(e,t,n,Su())}function Vs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Us(e))Ws(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,jr(s,o))return ui(e,t,i,0),Jl===null&&li(),!1}catch{}if(n=di(e,t,i,r),n!==null)return wu(n,e,r),Gs(n,t,r),!0}return!1}function Hs(e,t,n,r){if(r={lane:2,revertLane:bd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Us(e)){if(t)throw Error(a(479))}else t=di(e,n,r,2),t!==null&&wu(t,e,2)}function Us(e){var t=e.alternate;return e===P||t!==null&&t===P}function Ws(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var Ks={readContext:la,use:I,useCallback:Ao,useContext:Ao,useEffect:Ao,useImperativeHandle:Ao,useLayoutEffect:Ao,useInsertionEffect:Ao,useMemo:Ao,useReducer:Ao,useRef:Ao,useState:Ao,useDebugValue:Ao,useDeferredValue:Ao,useTransition:Ao,useSyncExternalStore:Ao,useId:Ao,useHostTransitionStatus:Ao,useFormState:Ao,useActionState:Ao,useOptimistic:Ao,useMemoCache:Ao,useCacheRefresh:Ao};Ks.useEffectEvent=Ao;var qs={readContext:la,use:I,useCallback:function(e,t){return zo().memoizedState=[e,t===void 0?null:t],e},useContext:la,useEffect:_s,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),hs(4194308,4,Cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hs(4194308,4,e,t)},useInsertionEffect:function(e,t){hs(4,2,e,t)},useMemo:function(e,t){var n=zo();t=t===void 0?null:t;var r=e();if(To){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zo();if(n!==void 0){var i=n(t);if(To){qe(!0);try{n(t)}finally{qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=zs.bind(null,P,e),[r.memoizedState,e]},useRef:function(e){var t=zo();return e={current:e},t.memoizedState=e},useState:function(e){e=$o(e);var t=e.queue,n=Bs.bind(null,P,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ts,useDeferredValue:function(e,t){return Os(zo(),e,t)},useTransition:function(){var e=$o(!1);return e=As.bind(null,P,e.queue,!0,!1),zo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=P,i=zo();if(M){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Jl===null)throw Error(a(349));B&127||Jo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,_s(Xo.bind(null,r,o,e),[e]),r.flags|=2048,ps(9,{destroy:void 0},Yo.bind(null,r,o,n,t),null),n},useId:function(){var e=zo(),t=Jl.identifierPrefix;if(M){var n=Ii,r=Fi;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Eo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Fs,useFormState:cs,useActionState:cs,useOptimistic:function(e){var t=zo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Hs.bind(null,P,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ho,useCacheRefresh:function(){return zo().memoizedState=Rs.bind(null,P)},useEffectEvent:function(e){var t=zo(),n={impl:e};return t.memoizedState=n,function(){if(R&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Js={readContext:la,use:I,useCallback:Es,useContext:la,useEffect:vs,useImperativeHandle:ws,useInsertionEffect:xs,useLayoutEffect:Ss,useMemo:Ds,useReducer:Wo,useRef:ms,useState:function(){return Wo(Uo)},useDebugValue:Ts,useDeferredValue:function(e,t){return ks(Bo(),xo.memoizedState,e,t)},useTransition:function(){var e=Wo(Uo)[0],t=Bo().memoizedState;return[typeof e==`boolean`?e:F(e),t]},useSyncExternalStore:qo,useId:Is,useHostTransitionStatus:Fs,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){return es(Bo(),xo,e,t)},useMemoCache:Ho,useCacheRefresh:Ls};Js.useEffectEvent=bs;var Ys={readContext:la,use:I,useCallback:Es,useContext:la,useEffect:vs,useImperativeHandle:ws,useInsertionEffect:xs,useLayoutEffect:Ss,useMemo:Ds,useReducer:Ko,useRef:ms,useState:function(){return Ko(Uo)},useDebugValue:Ts,useDeferredValue:function(e,t){var n=Bo();return xo===null?Os(n,e,t):ks(n,xo.memoizedState,e,t)},useTransition:function(){var e=Ko(Uo)[0],t=Bo().memoizedState;return[typeof e==`boolean`?e:F(e),t]},useSyncExternalStore:qo,useId:Is,useHostTransitionStatus:Fs,useFormState:fs,useActionState:fs,useOptimistic:function(e,t){var n=Bo();return xo===null?(n.baseState=e,[e,n.queue.dispatch]):es(n,xo,e,t)},useMemoCache:Ho,useCacheRefresh:Ls};Ys.useEffectEvent=bs;function Xs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Xa(r);i.payload=t,n!=null&&(i.callback=n),t=Za(e,i,r),t!==null&&(wu(t,e,r),Qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Xa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Za(e,i,r),t!==null&&(wu(t,e,r),Qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Su(),r=Xa(n);r.tag=2,t!=null&&(r.callback=t),t=Za(e,r,n),t!==null&&(wu(t,e,n),Qa(t,e,n))}};function Qs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Mr(n,r)||!Mr(i,a):!0}function $s(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Zs.enqueueReplaceState(t,t.state,null)}function ec(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function tc(e){ai(e)}function nc(e){console.error(e)}function rc(e){ai(e)}function ic(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ac(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function oc(e,t,n){return n=Xa(n),n.tag=3,n.payload={element:null},n.callback=function(){ic(e,t)},n}function sc(e){return e=Xa(e),e.tag=3,e}function cc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){ac(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ac(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function lc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&oa(t,n,i,!0),n=uo.current,n!==null){switch(n.tag){case 31:case 13:return fo===null?Iu():n.alternate===null&&eu===0&&(eu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Na?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),td(e,r,i)),!1;case 22:return n.flags|=65536,r===Na?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),td(e,r,i)),!1}throw Error(a(435,n.tag))}return td(e,r,i),Iu(),!1}if(M)return t=uo.current,t===null?(r!==Gi&&(t=Error(a(423),{cause:r}),Qi(Di(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Di(r,n),i=oc(e.stateNode,r,i),$a(e,i),eu!==4&&(eu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Gi&&(e=Error(a(422),{cause:r}),Qi(Di(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Di(o,n),ou===null?ou=[o]:ou.push(o),eu!==4&&(eu=2),t===null)return!0;r=Di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=oc(n.stateNode,r,e),$a(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(pu===null||!pu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=sc(i),cc(i,e,n,r),$a(n,i),!1}n=n.return}while(n!==null);return!1}var uc=Error(a(461)),dc=!1;function fc(e,t,n,r){t.child=e===null?Ka(t,null,n,r):Ga(t,e.child,n,r)}function pc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ca(t),r=Mo(e,t,n,o,a,i),s=Io(),e!==null&&!dc?(Lo(e,t,i),Lc(e,t,i)):(M&&s&&zi(t),t.flags|=1,fc(e,t,r,i),t.child)}function mc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!vi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,hc(e,t,a,r,i)):(e=xi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Rc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Mr:n,n(o,r)&&e.ref===t.ref)return Lc(e,t,i)}return t.flags|=1,e=yi(a,r),e.ref=t.ref,e.return=t,t.child=e}function hc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mr(a,r)&&e.ref===t.ref)if(dc=!1,t.pendingProps=r=a,Rc(e,i))e.flags&131072&&(dc=!0);else return t.lanes=e.lanes,Lc(e,t,i)}return Cc(e,t,n,r,i)}function gc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Oa(t,a===null?null:a.cachePool),a===null?co():so(t,a),ho(t);else return r=t.lanes=536870912,vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Oa(t,null),co(),go(t)):(Oa(t,a.cachePool),so(t,a),go(t),t.memoizedState=null);return fc(e,t,i,n),t.child}function _c(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function vc(e,t,n,r,i){var a=Da();return a=a===null?null:{parent:ha._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Oa(t,null),co(),ho(t),e!==null&&oa(e,t,r,!0),t.childLanes=i,null}function yc(e,t){return t=Mc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function bc(e,t,n){return Ga(t,e.child,null,n),e=yc(t,t.pendingProps),e.flags|=2,_o(t),t.memoizedState=null,e}function xc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(M){if(r.mode===`hidden`)return e=yc(t,r),t.lanes=536870912,_c(null,e);if(mo(t),(e=j)?(e=pf(e,Wi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,j=null)):e=null,e===null)throw Ki(t);return t.lanes=536870912,null}return yc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(mo(t),i)if(t.flags&256)t.flags&=-257,t=bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(dc||oa(e,t,n,!1),i=(n&e.childLanes)!==0,dc||i){if(r=Jl,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,fi(e,s),wu(r,e,s),uc;Iu(),t=bc(e,t,n)}else e=o.treeContext,j=_f(s.nextSibling),Hi=t,M=!0,Ui=null,Wi=!1,e!==null&&Vi(t,e),t=yc(t,r),t.flags|=4096;return t}return e=yi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Sc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Cc(e,t,n,r,i){return ca(t),n=Mo(e,t,n,r,void 0,i),r=Io(),e!==null&&!dc?(Lo(e,t,i),Lc(e,t,i)):(M&&r&&zi(t),t.flags|=1,fc(e,t,n,i),t.child)}function wc(e,t,n,r,i,a){return ca(t),t.updateQueue=null,n=Po(t,r,n,i),No(e),r=Io(),e!==null&&!dc?(Lo(e,t,a),Lc(e,t,a)):(M&&r&&zi(t),t.flags|=1,fc(e,t,n,a),t.child)}function Tc(e,t,n,r,i){if(ca(t),t.stateNode===null){var a=hi,o=n.contextType;typeof o==`object`&&o&&(a=la(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ja(t),o=n.contextType,a.context=typeof o==`object`&&o?la(o):hi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Xs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Zs.enqueueReplaceState(a,a.state,null),no(t,r,a,i),to(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=ec(n,s);a.props=c;var l=a.context,u=n.contextType;o=hi,typeof u==`object`&&u&&(o=la(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&$s(t,a,r,o),qa=!1;var f=t.memoizedState;a.state=f,no(t,r,a,i),to(),l=t.memoizedState,s||f!==l||qa?(typeof d==`function`&&(Xs(t,n,d,r),l=t.memoizedState),(c=qa||Qs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ya(e,t),o=t.memoizedProps,u=ec(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=hi,typeof l==`object`&&l&&(c=la(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&$s(t,a,r,c),qa=!1,f=t.memoizedState,a.state=f,no(t,r,a,i),to();var p=t.memoizedState;o!==d||f!==p||qa||e!==null&&e.dependencies!==null&&sa(e.dependencies)?(typeof s==`function`&&(Xs(t,n,s,r),p=t.memoizedState),(u=qa||Qs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&sa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Sc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ga(t,e.child,null,i),t.child=Ga(t,null,n,i)):fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Lc(e,t,i),e}function Ec(e,t,n,r){return Xi(),t.flags|=256,fc(e,t,n,r),t.child}var Dc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Oc(e){return{baseLanes:e,cachePool:ka()}}function kc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=iu),e}function Ac(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(vo.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(M){if(i?po(t):go(t),(e=j)?(e=pf(e,Wi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,j=null)):e=null,e===null)throw Ki(t);return hf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(go(t),i=t.mode,c=Mc({mode:`hidden`,children:c},i),r=Si(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Oc(n),r.childLanes=kc(e,s,n),t.memoizedState=Dc,_c(null,r)):(po(t),jc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(po(t),t.flags&=-257,t=Nc(e,t,n)):t.memoizedState===null?(go(t),c=r.fallback,i=t.mode,r=Mc({mode:`visible`,children:r.children},i),c=Si(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ga(t,e.child,null,n),r=t.child,r.memoizedState=Oc(n),r.childLanes=kc(e,s,n),t.memoizedState=Dc,t=_c(null,r)):(go(t),t.child=e.child,t.flags|=128,t=null);else if(po(t),hf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Qi({value:r,source:null,stack:null}),t=Nc(e,t,n)}else if(dc||oa(e,t,n,!1),s=(n&e.childLanes)!==0,dc||s){if(s=Jl,s!==null&&(r=dt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,fi(e,r),wu(s,e,r),uc;mf(c)||Iu(),t=Nc(e,t,n)}else mf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,j=_f(c.nextSibling),Hi=t,M=!0,Ui=null,Wi=!1,e!==null&&Vi(t,e),t=jc(t,r.children),t.flags|=4096);return t}return i?(go(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=yi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=Si(c,i,n,null),c.flags|=2):c=yi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,_c(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Oc(n):(i=c.cachePool,i===null?i=ka():(l=ha._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=kc(e,s,n),t.memoizedState=Dc,_c(e.child,r)):(po(t),n=e.child,e=n.sibling,n=yi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function jc(e,t){return t=Mc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Mc(e,t){return e=_i(22,e,null,t),e.lanes=0,e}function Nc(e,t,n){return Ga(t,e.child,null,n),e=jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ia(e.return,t,n)}function Fc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ic(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=vo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,O(vo,o),fc(e,t,r,n),r=M?ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pc(e,n,t);else if(e.tag===19)Pc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&yo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Fc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&yo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Fc(t,!0,n,null,a,r);break;case`together`:Fc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Lc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(oa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=yi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Rc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&sa(e))):!0}function zc(e,t,n){switch(t.tag){case 3:ye(t,t.stateNode.containerInfo),na(t,ha,e.memoizedState.cache),Xi();break;case 27:case 5:xe(t);break;case 4:ye(t,t.stateNode.containerInfo);break;case 10:na(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(po(t),e=Lc(e,t,n),e===null?null:e.sibling):Ac(e,t,n):(po(t),t.flags|=128,null);po(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(oa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ic(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),O(vo,vo.current),r)break;return null;case 22:return t.lanes=0,gc(e,t,n,t.pendingProps);case 24:na(t,ha,e.memoizedState.cache)}return Lc(e,t,n)}function Bc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)dc=!0;else{if(!Rc(e,n)&&!(t.flags&128))return dc=!1,zc(e,t,n);dc=!!(e.flags&131072)}else dc=!1,M&&t.flags&1048576&&Ri(t,ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e==`function`)vi(e)?(r=ec(e,r),t.tag=1,t=Tc(null,t,e,r,n)):(t.tag=0,t=Cc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===ee){t.tag=11,t=pc(null,t,e,r,n);break a}else if(i===ne){t.tag=14,t=mc(null,t,e,r,n);break a}}throw t=le(e)||e,Error(a(306,t,``))}}return t;case 0:return Cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=ec(r,t.pendingProps),Tc(e,t,r,i,n);case 3:a:{if(ye(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Ya(e,t),no(t,r,null,n);var s=t.memoizedState;if(r=s.cache,na(t,ha,r),r!==o.cache&&aa(t,[ha],n,!0),to(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Ec(e,t,r,n);break a}else if(r!==i){i=Di(Error(a(424)),t),Qi(i),t=Ec(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(j=_f(e.firstChild),Hi=t,M=!0,Ui=null,Wi=!0,n=Ka(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Xi(),r===i){t=Lc(e,t,n);break a}fc(e,t,r,n)}t=t.child}return t;case 26:return Sc(e,t),e===null?(n=Lf(t.type,null,t.pendingProps,null))?t.memoizedState=n:M||(n=t.type,e=t.pendingProps,r=Yd(_e.current).createElement(n),r[_t]=t,r[vt]=e,Ud(r,n,e),At(r),t.stateNode=r):t.memoizedState=Lf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xe(t),e===null&&M&&(r=t.stateNode=xf(t.type,t.pendingProps,_e.current),Hi=t,Wi=!0,i=j,sf(t.type)?(vf=i,j=_f(r.firstChild)):j=i),fc(e,t,t.pendingProps.children,n),Sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&M&&((i=r=j)&&(r=df(r,t.type,t.pendingProps,Wi),r===null?i=!1:(t.stateNode=r,Hi=t,j=_f(r.firstChild),Wi=!1,i=!0)),i||Ki(t)),xe(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Qd(i,o)?r=null:s!==null&&Qd(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Mo(e,t,Fo,null,null,n),op._currentValue=i),Sc(e,t),fc(e,t,r,n),t.child;case 6:return e===null&&M&&((e=n=j)&&(n=ff(n,t.pendingProps,Wi),n===null?e=!1:(t.stateNode=n,Hi=t,j=null,e=!0)),e||Ki(t)),null;case 13:return Ac(e,t,n);case 4:return ye(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ga(t,null,r,n):fc(e,t,r,n),t.child;case 11:return pc(e,t,t.type,t.pendingProps,n);case 7:return fc(e,t,t.pendingProps,n),t.child;case 8:return fc(e,t,t.pendingProps.children,n),t.child;case 12:return fc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,na(t,t.type,r.value),fc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ca(t),i=la(i),r=r(i),t.flags|=1,fc(e,t,r,n),t.child;case 14:return mc(e,t,t.type,t.pendingProps,n);case 15:return hc(e,t,t.type,t.pendingProps,n);case 19:return Ic(e,t,n);case 31:return xc(e,t,n);case 22:return gc(e,t,n,t.pendingProps);case 24:return ca(t),r=la(ha),e===null?(i=Da(),i===null&&(i=Jl,o=ga(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ja(t),na(t,ha,i)):((e.lanes&n)!==0&&(Ya(e,t),no(t,null,null,n),to()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,na(t,ha,r),r!==i.cache&&aa(t,[ha],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),na(t,ha,r))),fc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Vc(e){e.flags|=4}function Hc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Nu())e.flags|=8192;else throw La=Na,ja}else e.flags&=-16777217}function Uc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Qf(t))if(Nu())e.flags|=8192;else throw La=Na,ja}function Wc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,au|=t)}function Gc(e,t){if(!M)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Kc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qc(e,t,n){var r=t.pendingProps;switch(Bi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kc(t),null;case 1:return Kc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ra(ha),be(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Yi(t)?Vc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zi())),Kc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Vc(t),o===null?(Kc(t),Hc(t,i,null,r,n)):(Kc(t),Uc(t,o))):o?o===e.memoizedState?(Kc(t),t.flags&=-16777217):(Vc(t),Kc(t),Uc(t,o)):(e=e.memoizedProps,e!==r&&Vc(t),Kc(t),Hc(t,i,e,r,n)),null;case 27:if(Se(t),n=_e.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Vc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Kc(t),null}e=he.current,Yi(t)?qi(t,e):(e=xf(i,r,n),t.stateNode=e,Vc(t))}return Kc(t),null;case 5:if(Se(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Vc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Kc(t),null}if(o=he.current,Yi(t))qi(t,o);else{var s=Yd(_e.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[_t]=t,o[vt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ud(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Vc(t)}}return Kc(t),Hc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Vc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=_e.current,Yi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Hi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Vd(e.nodeValue,n)),e||Ki(t,!0)}else e=Yd(e).createTextNode(r),e[_t]=t,t.stateNode=e}return Kc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Yi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[_t]=t}else Xi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Kc(t),e=!1}else n=Zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(_o(t),t):(_o(t),null);if(t.flags&128)throw Error(a(558))}return Kc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Yi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[_t]=t}else Xi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Kc(t),i=!1}else i=Zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(_o(t),t):(_o(t),null)}return _o(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Wc(t,t.updateQueue),Kc(t),null);case 4:return be(),e===null&&jd(t.stateNode.containerInfo),Kc(t),null;case 10:return ra(t.type),Kc(t),null;case 19:if(D(vo),r=t.memoizedState,r===null)return Kc(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Gc(r,!1);else{if(eu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=yo(e),o!==null){for(t.flags|=128,Gc(r,!1),e=o.updateQueue,t.updateQueue=e,Wc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bi(n,e),n=n.sibling;return O(vo,vo.current&1|2),M&&Li(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>du&&(t.flags|=128,i=!0,Gc(r,!1),t.lanes=4194304)}else{if(!i)if(e=yo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Wc(t,e),Gc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!M)return Kc(t),null}else 2*Ie()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,i=!0,Gc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Kc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,n=vo.current,O(vo,i?n&1|2:n&1),M&&Li(t,r.treeForkCount),e);case 22:case 23:return _o(t),lo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Kc(t),t.subtreeFlags&6&&(t.flags|=8192)):Kc(t),n=t.updateQueue,n!==null&&Wc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&D(Ea),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ra(ha),Kc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Jc(e,t){switch(Bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ra(ha),be(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(_o(t),t.alternate===null)throw Error(a(340));Xi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_o(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Xi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(vo),null;case 4:return be(),null;case 10:return ra(t.type),null;case 22:case 23:return _o(t),lo(),e!==null&&D(Ea),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ra(ha),null;case 25:return null;default:return null}}function Yc(e,t){switch(Bi(t),t.tag){case 3:ra(ha),be();break;case 26:case 27:case 5:Se(t);break;case 4:be();break;case 31:t.memoizedState!==null&&_o(t);break;case 13:_o(t);break;case 19:D(vo);break;case 10:ra(t.type);break;case 22:case 23:_o(t),lo(),e!==null&&D(Ea);break;case 24:ra(ha)}}function Xc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ed(t,t.return,e)}}function Zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ed(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ed(t,t.return,e)}}function Qc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{io(t,n)}catch(t){ed(e,e.return,t)}}}function $c(e,t,n){n.props=ec(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ed(e,t,n)}}function el(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ed(e,t,n)}}function L(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){ed(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ed(e,t,n)}else n.current=null}function tl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ed(e,e.return,t)}}function nl(e,t,n){try{var r=e.stateNode;Wd(r,e.type,n,t),r[vt]=t}catch(t){ed(e,e.return,t)}}function rl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sf(e.type)||e.tag===4}function il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||rl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&sf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function al(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=dn));else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ol(e,t,n),e=e.sibling;e!==null;)ol(e,t,n),e=e.sibling}function sl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ud(t,r,n),t[_t]=e,t[vt]=n}catch(t){ed(e,e.return,t)}}var cl=!1,ll=!1,ul=!1,dl=typeof WeakSet==`function`?WeakSet:Set,fl=null;function pl(e,t){if(e=e.containerInfo,qd=hp,e=Ir(e),Lr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Jd={focusedElem:e,selectionRange:n},hp=!1,fl=t;fl!==null;)if(t=fl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,fl=e;else for(;fl!==null;){switch(t=fl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=ec(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){ed(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)uf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:uf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,fl=e;break}fl=t.return}}function ml(e,t,n){var r=n.flags;
vendor: 5,626 bytes, line 9
9switch(n.tag){case 0:case 11:case 15:kl(e,n),r&4&&Xc(5,n);break;case 1:if(kl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ed(n,n.return,e)}else{var i=ec(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ed(n,n.return,e)}}r&64&&Qc(n),r&512&&el(n,n.return);break;case 3:if(kl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{io(e,t)}catch(e){ed(n,n.return,e)}}break;case 27:t===null&&r&4&&sl(n);case 26:case 5:kl(e,n),t===null&&r&4&&tl(n),r&512&&el(n,n.return);break;case 12:kl(e,n);break;case 31:kl(e,n),r&4&&bl(e,n);break;case 13:kl(e,n),r&4&&xl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=id.bind(null,n),gf(e,n))));break;case 22:if(r=n.memoizedState!==null||cl,!r){t=t!==null&&t.memoizedState!==null||ll,i=cl;var a=ll;cl=r,(ll=t)&&!a?jl(e,n,(n.subtreeFlags&8772)!=0):kl(e,n),cl=i,ll=a}break;case 30:break;default:kl(e,n)}}function hl(e){var t=e.alternate;t!==null&&(e.alternate=null,hl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gl=null,_l=!1;function vl(e,t,n){for(n=n.child;n!==null;)yl(e,t,n),n=n.sibling}function yl(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:ll||L(n,t),vl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ll||L(n,t);var r=gl,i=_l;sf(n.type)&&(gl=n.stateNode,_l=!1),vl(e,t,n),Sf(n.stateNode),gl=r,_l=i;break;case 5:ll||L(n,t);case 6:if(r=gl,i=_l,gl=null,vl(e,t,n),gl=r,_l=i,gl!==null)if(_l)try{(gl.nodeType===9?gl.body:gl.nodeName===`HTML`?gl.ownerDocument.body:gl).removeChild(n.stateNode)}catch(e){ed(n,t,e)}else try{gl.removeChild(n.stateNode)}catch(e){ed(n,t,e)}break;case 18:gl!==null&&(_l?(e=gl,cf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Vp(e)):cf(gl,n.stateNode));break;case 4:r=gl,i=_l,gl=n.stateNode.containerInfo,_l=!0,vl(e,t,n),gl=r,_l=i;break;case 0:case 11:case 14:case 15:Zc(2,n,t),ll||Zc(4,n,t),vl(e,t,n);break;case 1:ll||(L(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&$c(n,t,r)),vl(e,t,n);break;case 21:vl(e,t,n);break;case 22:ll=(r=ll)||n.memoizedState!==null,vl(e,t,n),ll=r;break;default:vl(e,t,n)}}function bl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vp(e)}catch(e){ed(t,t.return,e)}}}function xl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vp(e)}catch(e){ed(t,t.return,e)}}function Sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dl),t;default:throw Error(a(435,e.tag))}}function Cl(e,t){var n=Sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ad.bind(null,e,t);t.then(r,r)}})}function wl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(sf(c.type)){gl=c.stateNode,_l=!1;break a}break;case 5:gl=c.stateNode,_l=!1;break a;case 3:case 4:gl=c.stateNode.containerInfo,_l=!0;break a}c=c.return}if(gl===null)throw Error(a(160));yl(o,s,i),gl=null,_l=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)El(t,e),t=t.sibling}var Tl=null;function El(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wl(t,e),Dl(e),r&4&&(Zc(3,e,e.return),Xc(3,e),Zc(5,e,e.return));break;case 1:wl(t,e),Dl(e),r&512&&(ll||n===null||L(n,n.return)),r&64&&cl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=Tl;if(wl(t,e),Dl(e),r&512&&(ll||n===null||L(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[wt]||o[_t]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Ud(o,r,n),o[_t]=e,At(o),r=o;break a;case`link`:var s=Yf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Ud(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Yf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Ud(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[_t]=e,At(o),r=o}e.stateNode=r}else Xf(i,e.type,e.stateNode);else e.stateNode=Wf(i,r,e.memoizedProps);
vendor: 65,853 bytes, lines 9-10
9else o===r?r===null&&e.stateNode!==null&&nl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Xf(i,e.type,e.stateNode):Wf(i,r,e.memoizedProps))}break;case 27:wl(t,e),Dl(e),r&512&&(ll||n===null||L(n,n.return)),n!==null&&r&4&&nl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(wl(t,e),Dl(e),r&512&&(ll||n===null||L(n,n.return)),e.flags&32){i=e.stateNode;try{nn(i,``)}catch(t){ed(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,nl(e,i,n===null?i:n.memoizedProps)),r&1024&&(ul=!0);break;case 6:if(wl(t,e),Dl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){ed(e,e.return,t)}}break;case 3:if(Jf=null,i=Tl,Tl=K(t.containerInfo),wl(t,e),Tl=i,Dl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vp(t.containerInfo)}catch(t){ed(e,e.return,t)}ul&&(ul=!1,Ol(e));break;case 4:r=Tl,Tl=K(e.stateNode.containerInfo),wl(t,e),Dl(e),Tl=r;break;case 12:wl(t,e),Dl(e);break;case 31:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 13:wl(t,e),Dl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lu=Ie()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=cl,d=ll;if(cl=u||i,ll=d||l,wl(t,e),ll=d,cl=u,Dl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||cl||ll||Al(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){ed(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){ed(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?lf(m,!0):lf(l.stateNode,!1)}catch(e){ed(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Cl(e,n))));break;case 19:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 30:break;case 21:break;default:wl(t,e),Dl(e)}}function Dl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(rl(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;ol(e,il(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(nn(o,``),n.flags&=-33),ol(e,il(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;al(e,il(e),s);break;default:throw Error(a(161))}}catch(t){ed(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ol(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ol(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function kl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ml(e,t.alternate,t),t=t.sibling}function Al(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zc(4,t,t.return),Al(t);break;case 1:L(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&$c(t,t.return,n),Al(t);break;case 27:Sf(t.stateNode);case 26:case 5:L(t,t.return),Al(t);break;case 22:t.memoizedState===null&&Al(t);break;case 30:Al(t);break;default:Al(t)}e=e.sibling}}function jl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:jl(i,a,n),Xc(4,a);break;case 1:if(jl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ed(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)ro(c[i],s)}catch(e){ed(r,r.return,e)}}n&&o&64&&Qc(a),el(a,a.return);break;case 27:sl(a);case 26:case 5:jl(i,a,n),n&&r===null&&o&4&&tl(a),el(a,a.return);break;case 12:jl(i,a,n);break;case 31:jl(i,a,n),n&&o&4&&bl(i,a);break;case 13:jl(i,a,n),n&&o&4&&xl(i,a);break;case 22:a.memoizedState===null&&jl(i,a,n),el(a,a.return);break;case 30:break;default:jl(i,a,n)}t=t.sibling}}function Ml(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&_a(n))}function Nl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_a(e))}function Pl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fl(e,t,n,r),t=t.sibling}function Fl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Pl(e,t,n,r),i&2048&&Xc(9,t);break;case 1:Pl(e,t,n,r);break;case 3:Pl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_a(e)));break;case 12:if(i&2048){Pl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){ed(t,t.return,e)}}else Pl(e,t,n,r);break;case 31:Pl(e,t,n,r);break;case 13:Pl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Pl(e,t,n,r):(a._visibility|=2,Il(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Pl(e,t,n,r):Ll(e,t),i&2048&&Ml(o,t);break;case 24:Pl(e,t,n,r),i&2048&&Nl(t.alternate,t);break;default:Pl(e,t,n,r)}}function Il(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Il(a,o,s,c,i),Xc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Il(a,o,s,c,i)):u._visibility&2?Il(a,o,s,c,i):Ll(a,o),i&&l&2048&&Ml(o.alternate,o);break;case 24:Il(a,o,s,c,i),i&&l&2048&&Nl(o.alternate,o);break;default:Il(a,o,s,c,i)}t=t.sibling}}function Ll(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ll(n,r),i&2048&&Ml(r.alternate,r);break;case 24:Ll(n,r),i&2048&&Nl(r.alternate,r);break;default:Ll(n,r)}t=t.sibling}}var Rl=8192;function zl(e,t,n){if(e.subtreeFlags&Rl)for(e=e.child;e!==null;)Bl(e,t,n),e=e.sibling}function Bl(e,t,n){switch(e.tag){case 26:zl(e,t,n),e.flags&Rl&&e.memoizedState!==null&&$f(n,Tl,e.memoizedState,e.memoizedProps);break;case 5:zl(e,t,n);break;case 3:case 4:var r=Tl;Tl=K(e.stateNode.containerInfo),zl(e,t,n),Tl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Rl,Rl=16777216,zl(e,t,n),Rl=r):zl(e,t,n));break;default:zl(e,t,n)}}function Vl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ul(e),e=e.sibling}function Ul(e){switch(e.tag){case 0:case 11:case 15:Hl(e),e.flags&2048&&Zc(9,e,e.return);break;case 3:Hl(e);break;case 12:Hl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wl(e)):Hl(e);break;default:Hl(e)}}function Wl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zc(8,t,t.return),Wl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wl(t));break;default:Wl(t)}e=e.sibling}}function Gl(e,t){for(;fl!==null;){var n=fl;switch(n.tag){case 0:case 11:case 15:Zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:_a(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fl=r;else a:for(n=e;fl!==null;){r=fl;var i=r.sibling,a=r.return;if(hl(r),r===n){fl=null;break a}if(i!==null){i.return=a,fl=i;break a}fl=a}}}var Kl={getCacheForType:function(e){var t=la(ha),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return la(ha).controller.signal}},ql=typeof WeakMap==`function`?WeakMap:Map,R=0,Jl=null,z=null,B=0,V=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=null,su=null,cu=!1,lu=0,uu=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,H=null,yu=null,bu=0,xu=null;function Su(){return R&2&&B!==0?B&-B:w.T===null?mt():bd()}function Cu(){if(iu===0)if(!(B&536870912)||M){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),iu=e}else iu=536870912;return e=uo.current,e!==null&&(e.flags|=32),iu}function wu(e,t,n){(e===Jl&&(V===2||V===9)||e.cancelPendingCommit!==null)&&(ju(e,0),Ou(e,B,iu,!1)),st(e,n),(!(R&2)||e!==Jl)&&(e===Jl&&(!(R&2)&&(nu|=n),eu===4&&Ou(e,B,iu,!1)),pd(e))}function Tu(e,t,n){if(R&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||rt(e,t),i=r?zu(e,t):Lu(e,t,!0),o=r;do{if(i===0){Zl&&!r&&Ou(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Du(n)){i=Lu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=ou;var l=c.current.memoizedState.isDehydrated;if(l&&(ju(c,s).flags|=256),s=Lu(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,nu|=o,i=4;break a}o=su,su=i,o!==null&&(su===null?su=o:su.push.apply(su,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){ju(e,0),Ou(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:Ou(r,t,iu,!Xl);break a;case 2:su=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=lu+300-Ie(),10<i)){if(Ou(r,t,iu,!Xl),nt(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=tf(Eu.bind(null,r,n,su,fu,cu,t,iu,nu,au,Xl,o,`Throttled`,-0,0),i);break a}Eu(r,n,su,fu,cu,t,iu,nu,au,Xl,o,null,-0,0)}}break}while(1);pd(e)}function Eu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dn},Bl(t,a,d);var m=(a&62914560)===a?lu-Ie():(a&4194048)===a?uu-Ie():0;if(m=tp(d,m),m!==null){_u=a,e.cancelPendingCommit=m(Ku.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Ou(e,a,o,!l);return}}Ku(e,t,a,n,r,i,o,s,c)}function Du(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!jr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ou(e,t,n,r){t&=~ru,t&=~nu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&<(e,n,t)}function ku(){return R&6?!0:(md(0,!1),!1)}function Au(){if(z!==null){if(V===0)var e=z.return;else e=z,ta=ea=null,Ro(e),Ba=null,Va=0,e=z;for(;e!==null;)Yc(e.alternate,e),e=e.return;z=null}}function ju(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,nf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,Au(),Jl=e,z=n=yi(e.current,null),B=t,V=0,Yl=null,Xl=!1,Zl=rt(e,t),Ql=!1,au=iu=ru=nu=tu=eu=0,su=ou=null,cu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Je(r),a=1<<i;t|=e[i],r&=~a}return $l=t,li(),n}function Mu(e,t){P=null,w.H=Ks,t===Aa||t===Ma?(t=Ra(),V=3):t===ja?(t=Ra(),V=4):V=t===uc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,z===null&&(eu=1,ic(e,Di(t,e.current)))}function Nu(){var e=uo.current;return e===null?!0:(B&4194048)===B?fo===null:(B&62914560)===B||B&536870912?e===fo:!1}function Pu(){var e=w.H;return w.H=Ks,e===null?Ks:e}function Fu(){var e=w.A;return w.A=Kl,e}function Iu(){eu=4,Xl||(B&4194048)!==B&&uo.current!==null||(Zl=!0),!(tu&134217727)&&!(nu&134217727)||Jl===null||Ou(Jl,B,iu,!1)}function Lu(e,t,n){var r=R;R|=2;var i=Pu(),a=Fu();(Jl!==e||B!==t)&&(fu=null,ju(e,t)),t=!1;var o=eu;a:do try{if(V!==0&&z!==null){var s=z,c=Yl;switch(V){case 8:Au(),o=6;break a;case 3:case 2:case 9:case 6:uo.current===null&&(t=!0);var l=V;if(V=0,Yl=null,Uu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=V,V=0,Yl=null,Uu(e,s,c,l)}}Ru(),o=eu;break}catch(t){Mu(e,t)}while(1);return t&&e.shellSuspendCounter++,ta=ea=null,R=r,w.H=i,w.A=a,z===null&&(Jl=null,B=0,li()),o}function Ru(){for(;z!==null;)Vu(z)}function zu(e,t){var n=R;R|=2;var r=Pu(),i=Fu();Jl!==e||B!==t?(fu=null,du=Ie()+500,ju(e,t)):Zl=rt(e,t);a:do try{if(V!==0&&z!==null){t=z;var o=Yl;b:switch(V){case 1:V=0,Yl=null,Uu(e,t,o,1);break;case 2:case 9:if(Pa(o)){V=0,Yl=null,Hu(t);break}t=function(){V!==2&&V!==9||Jl!==e||(V=7),pd(e)},o.then(t,t);break a;case 3:V=7;break a;case 4:V=5;break a;case 7:Pa(o)?(V=0,Yl=null,Hu(t)):(V=0,Yl=null,Uu(e,t,o,7));break;case 5:var s=null;switch(z.tag){case 26:s=z.memoizedState;case 5:case 27:var c=z;if(s?Qf(s):c.stateNode.complete){V=0,Yl=null;var l=c.sibling;if(l!==null)z=l;else{var u=c.return;u===null?z=null:(z=u,Wu(u))}break b}}V=0,Yl=null,Uu(e,t,o,5);break;case 6:V=0,Yl=null,Uu(e,t,o,6);break;case 8:Au(),eu=6;break a;default:throw Error(a(462))}}Bu();break}catch(t){Mu(e,t)}while(1);return ta=ea=null,w.H=r,w.A=i,R=n,z===null?(Jl=null,B=0,li(),eu):0}function Bu(){for(;z!==null&&!Pe();)Vu(z)}function Vu(e){var t=Bc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Wu(e):z=t}function Hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=wc(n,t,t.pendingProps,t.type,void 0,B);break;case 11:t=wc(n,t,t.pendingProps,t.type.render,t.ref,B);break;case 5:Ro(t);default:Yc(n,t),t=z=bi(t,$l),t=Bc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Wu(e):z=t}function Uu(e,t,n,r){ta=ea=null,Ro(t),Ba=null,Va=0;var i=t.return;try{if(lc(e,i,t,n,B)){eu=1,ic(e,Di(n,e.current)),z=null;return}}catch(t){if(i!==null)throw z=i,t;eu=1,ic(e,Di(n,e.current)),z=null;return}t.flags&32768?(M||r===1?e=!0:Zl||B&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=uo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gu(t,e)):Wu(t)}function Wu(e){var t=e;do{if(t.flags&32768){Gu(t,Xl);return}e=t.return;var n=qc(t.alternate,t,$l);if(n!==null){z=n;return}if(t=t.sibling,t!==null){z=t;return}z=t=e}while(t!==null);eu===0&&(eu=5)}function Gu(e,t){do{var n=Jc(e.alternate,e);if(n!==null){n.flags&=32767,z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){z=e;return}z=e=n}while(e!==null);eu=6,z=null}function Ku(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do Zu();while(mu!==0);if(R&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=ci,ct(e,n,o,s,c,l),e===Jl&&(z=Jl=null,B=0),gu=t,hu=e,_u=n,vu=o,H=i,yu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,od(Be,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=w.T,w.T=null,i=E.p,E.p=2,s=R,R|=4;try{pl(e,t,n)}finally{R=s,E.p=i,w.T=r}}mu=1,qu(),Ju(),Yu()}}function qu(){if(mu===1){mu=0;var e=hu,t=gu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=w.T,w.T=null;var r=E.p;E.p=2;var i=R;R|=4;try{El(t,e);var a=Jd,o=Ir(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Fr(s.ownerDocument.documentElement,s)){if(c!==null&&Lr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Pr(s,h),v=Pr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}hp=!!qd,Jd=qd=null}finally{R=i,E.p=r,w.T=n}}e.current=t,mu=2}}function Ju(){if(mu===2){mu=0;var e=hu,t=gu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=w.T,w.T=null;var r=E.p;E.p=2;var i=R;R|=4;try{ml(e,t.alternate,t)}finally{R=i,E.p=r,w.T=n}}mu=3}}function Yu(){if(mu===4||mu===3){mu=0,Fe();var e=hu,t=gu,n=_u,r=yu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Xu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=null),pt(n),t=t.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=w.T,i=E.p,E.p=2,w.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{w.T=t,E.p=i}}_u&3&&Zu(),pd(e),i=e.pendingLanes,n&261930&&i&42?e===xu?bu++:(bu=0,xu=e):bu=0,md(0,!1)}}function Xu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_a(t)))}function Zu(){return qu(),Ju(),Yu(),Qu()}function Qu(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=pt(_u),r=w.T,i=E.p;try{E.p=32>n?32:n,w.T=null,n=H,H=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,R&6)throw Error(a(331));var c=R;if(R|=4,Ul(o.current),Fl(o,o.current,s,n),R=c,md(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{E.p=i,w.T=r,Xu(e,t)}}function $u(e,t,n){t=Di(n,t),t=oc(e.stateNode,t,2),e=Za(e,t,2),e!==null&&(st(e,2),pd(e))}function ed(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=Di(n,e),n=sc(2),r=Za(t,n,2),r!==null&&(cc(n,r,t,e),st(r,2),pd(r));break}}t=t.return}}function td(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ql;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ql=!0,i.add(n),e=nd.bind(null,e,t,n),t.then(e,e))}function nd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Jl===e&&(B&n)===n&&(eu===4||eu===3&&(B&62914560)===B&&300>Ie()-lu?!(R&2)&&ju(e,0):ru|=n,au===B&&(au=0)),pd(e)}function rd(e,t){t===0&&(t=at()),e=fi(e,t),e!==null&&(st(e,t),pd(e))}function id(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rd(e,n)}function ad(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),rd(e,n)}function od(e,t){return Me(e,t)}var sd=null,cd=null,ld=!1,ud=!1,dd=!1,fd=0;function pd(e){e!==cd&&e.next===null&&(cd===null?sd=cd=e:cd=cd.next=e),ud=!0,ld||(ld=!0,yd())}function md(e,t){if(!dd&&ud){dd=!0;do for(var n=!1,r=sd;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,vd(r,a))}else a=B,a=nt(r,r===Jl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,vd(r,a));r=r.next}while(n);dd=!1}}function hd(){U()}function U(){ud=ld=!1;var e=0;fd!==0&&ef()&&(e=fd);for(var t=Ie(),n=null,r=sd;r!==null;){var i=r.next,a=gd(r,t);a===0?(r.next=null,n===null?sd=i:n.next=i,i===null&&(cd=n)):(n=r,(e!==0||a&3)&&(ud=!0)),r=i}mu!==0&&mu!==5||md(e,!1),fd!==0&&(fd=0)}function gd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Jl,n=B,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(V===2||V===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),pt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=_d.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function _d(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zu()&&e.callbackNode!==n)return null;var r=B;return r=nt(e,e===Jl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Tu(e,r,t),gd(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?_d.bind(null,e):null)}function vd(e,t){if(Zu())return null;Tu(e,t,!0)}function yd(){af(function(){R&6?Me(Re,hd):U()})}function bd(){if(fd===0){var e=ba;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),fd=e}return fd}function xd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:un(``+e)}function Sd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Cd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=xd((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?xd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new jn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(fd!==0){var e=o?Sd(i,o):new FormData(i);Ms(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Sd(i,o):new FormData(i),Ms(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var wd=0;wd<ri.length;wd++){var Td=ri[wd];ii(Td.toLowerCase(),`on`+(Td[0].toUpperCase()+Td.slice(1)))}ii(Yr,`onAnimationEnd`),ii(Xr,`onAnimationIteration`),ii(Zr,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii(Qr,`onTransitionRun`),ii($r,`onTransitionStart`),ii(ei,`onTransitionCancel`),ii(ti,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ed=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Dd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ed));function Od(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ai(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ai(e)}i.currentTarget=null,a=c}}}}function W(e,t){var n=t[bt];n===void 0&&(n=t[bt]=new Set);var r=e+`__bubble`;n.has(r)||(Md(t,e,2,!1),n.add(r))}function kd(e,t,n){var r=0;t&&(r|=4),Md(n,e,r,t)}var Ad=`_reactListening`+Math.random().toString(36).slice(2);function jd(e){if(!e[Ad]){e[Ad]=!0,jt.forEach(function(t){t!==`selectionchange`&&(Dd.has(t)||kd(t,!1,e),kd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ad]||(t[Ad]=!0,kd(`selectionchange`,!1,t))}}function Md(e,t,n,r){switch(Sp(t)){case 2:var i=gp;break;case 8:i=_p;break;default:i=vp}n=i.bind(null,t,n,e),i=void 0,!xn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Nd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Et(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}vn(function(){var r=a,i=pn(n),o=[];a:{var s=ni.get(e);if(s!==void 0){var l=jn,u=e;switch(e){case`keypress`:if(Dn(n)===0)break a;case`keydown`:case`keyup`:l=Jn;break;case`focusin`:u=`focus`,l=zn;break;case`focusout`:u=`blur`,l=zn;break;case`beforeblur`:case`afterblur`:l=zn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Ln;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Rn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Xn;break;case Yr:case Xr:case Zr:l=Bn;break;case ti:l=Zn;break;case`scroll`:case`scrollend`:l=A;break;case`wheel`:l=Qn;break;case`copy`:case`cut`:case`paste`:l=Vn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Yn;break;case`toggle`:case`beforetoggle`:l=$n}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=yn(m,p),g!=null&&d.push(Pd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==fn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[yt]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?Et(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Ln,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Yn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:Ot(l),h=u==null?s:Ot(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Id,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ld(o,s,l,d,!1),u!==null&&f!==null&&Ld(o,f,u,d,!0)}}a:{if(s=r?Ot(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=yr;else if(pr(s))if(br)v=kr;else{v=Dr;var y=Er}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&sn(r.elementType)&&(v=yr):v=Or;if(v&&=v(e,r)){mr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Qt(s,`number`,s.value)}switch(y=r?Ot(r):window,e){case`focusin`:(pr(y)||y.contentEditable===`true`)&&(zr=y,Br=r,Vr=null);break;case`focusout`:Vr=Br=zr=null;break;case`mousedown`:Hr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Hr=!1,Ur(o,n,i);break;case`selectionchange`:if(Rr)break;case`keydown`:case`keyup`:Ur(o,n,i)}var b;if(tr)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else lr?sr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(ir&&n.locale!==`ko`&&(lr||x!==`onCompositionStart`?x===`onCompositionEnd`&&lr&&(b=En()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,lr=!0)),y=Fd(r,x),0<y.length&&(x=new Hn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=cr(n),b!==null&&(x.data=b)))),(b=rr?ur(e,n):dr(e,n))&&(x=Fd(r,`onBeforeInput`),0<x.length&&(y=new Hn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),Cd(o,e,r,n,i)}Od(o,t)})}function Pd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=yn(e,n),i!=null&&r.unshift(Pd(e,i,a)),i=yn(e,t),i!=null&&r.push(Pd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Id(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ld(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=yn(n,a),l!=null&&o.unshift(Pd(n,l,c))):i||(l=yn(n,a),l!=null&&o.push(Pd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Rd=/\r\n?/g,zd=/\u0000|\uFFFD/g;function Bd(e){return(typeof e==`string`?e:``+e).replace(Rd,` 10`).replace(zd,``)}function Vd(e,t){return t=Bd(t),Bd(e)===t}function G(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&nn(e,``+r);break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:on(e,r,o);break;case`data`:if(t!==`object`){Bt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&G(e,t,`name`,i.name,i,null),G(e,t,`formEncType`,i.formEncType,i,null),G(e,t,`formMethod`,i.formMethod,i,null),G(e,t,`formTarget`,i.formTarget,i,null)):(G(e,t,`encType`,i.encType,i,null),G(e,t,`method`,i.method,i,null),G(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`onScroll`:r!=null&&W(`scroll`,e);break;case`onScrollEnd`:r!=null&&W(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=un(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:W(`beforetoggle`,e),W(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=cn.get(n)||n,zt(e,n,r))}}function Hd(e,t,n,r,i,o){switch(n){case`style`:on(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&nn(e,``+r);break;case`onScroll`:r!=null&&W(`scroll`,e);break;case`onScrollEnd`:r!=null&&W(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[vt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}}}function Ud(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:W(`error`,e),W(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:G(e,t,o,s,n,null)}}i&&G(e,t,`srcSet`,n.srcSet,n,null),r&&G(e,t,`src`,n.src,n,null);return;case`input`:W(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:G(e,t,r,d,n,null)}}Zt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in W(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:G(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&$t(e,!!r,n,!0):$t(e,!!r,t,!1);return;case`textarea`:for(s in W(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:G(e,t,s,c,n,null)}tn(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:G(e,t,l,r,n,null)}return;case`dialog`:W(`beforetoggle`,e),W(`toggle`,e),W(`cancel`,e),W(`close`,e);break;case`iframe`:case`object`:W(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ed.length;r++)W(Ed[r],e);break;case`image`:W(`error`,e),W(`load`,e);break;case`details`:W(`toggle`,e);break;case`embed`:case`source`:case`link`:W(`error`,e),W(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:G(e,t,u,r,n,null)}return;default:if(sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Hd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&G(e,t,c,r,n,null))}function Wd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||G(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&G(e,t,p,m,r,f)}}Xt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||G(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&G(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?$t(e,!!n,n?[]:``,!1):$t(e,!!n,t,!0)):$t(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:G(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&G(e,t,s,i,r,o)}en(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:G(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:G(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&G(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:G(e,t,u,p,r,m)}return;default:if(sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Hd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Hd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&G(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||G(e,t,f,p,r,m)}function Gd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Kd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Gd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Gd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var qd=null,Jd=null;function Yd(e){return e.nodeType===9?e:e.ownerDocument}function Xd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Zd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Qd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $d=null;function ef(){var e=window.event;return e&&e.type===`popstate`?e===$d?!1:($d=e,!0):($d=null,!1)}var tf=typeof setTimeout==`function`?setTimeout:void 0,nf=typeof clearTimeout==`function`?clearTimeout:void 0,rf=typeof Promise==`function`?Promise:void 0,af=typeof queueMicrotask==`function`?queueMicrotask:rf===void 0?tf:function(e){return rf.resolve(null).then(e).catch(of)};function of(e){setTimeout(function(){throw e})}function sf(e){return e===`head`}function cf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sf(e.ownerDocument.body);n=i}while(n);Vp(t)}function lf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function uf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:uf(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function df(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[wt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=_f(e.nextSibling),e===null)break}return null}function ff(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_f(e.nextSibling),e===null))return null;return e}function pf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_f(e.nextSibling),e===null))return null;return e}function mf(e){return e.data===`$?`||e.data===`$~`}function hf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function _f(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vf=null;function yf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _f(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xf(e,t,n){switch(t=Yd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var Cf=new Map,wf=new Set;function K(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tf=E.d;E.d={f:Ef,r:Df,D:Af,C:jf,L:Mf,m:Nf,X:Ff,S:Pf,M:If};function Ef(){var e=Tf.f(),t=ku();return e||t}function Df(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?Ps(t):Tf.r(e)}var Of=typeof document>`u`?null:document;function kf(e,t,n){var r=Of;if(r&&typeof t==`string`&&t){var i=Yt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ud(t,`link`,e),At(t),r.head.appendChild(t)))}}function Af(e){Tf.D(e),kf(`dns-prefetch`,e,null)}function jf(e,t){Tf.C(e,t),kf(`preconnect`,e,t)}function Mf(e,t,n){Tf.L(e,t,n);var r=Of;if(r&&e&&t){var i=`link[rel="preload"][as="`+Yt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Yt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Yt(n.imageSizes)+`"]`)):i+=`[href="`+Yt(e)+`"]`;var a=i;switch(t){case`style`:a=Rf(e);break;case`script`:a=Hf(e)}Cf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zf(a))||t===`script`&&r.querySelector(Uf(a))||(t=r.createElement(`link`),Ud(t,`link`,e),At(t),r.head.appendChild(t)))}}function Nf(e,t){Tf.m(e,t);var n=Of;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Yt(r)+`"][href="`+Yt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hf(e)}if(!Cf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Cf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Uf(a)))return}r=n.createElement(`link`),Ud(r,`link`,e),At(r),n.head.appendChild(r)}}}function Pf(e,t,n){Tf.S(e,t,n);var r=Of;if(r&&e){var i=kt(r).hoistableStyles,a=Rf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cf.get(a))&&Kf(e,n);var c=o=r.createElement(`link`);At(c),Ud(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Gf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Ff(e,t){Tf.X(e,t);var n=Of;if(n&&e){var r=kt(n).hoistableScripts,i=Hf(e),a=r.get(i);a||(a=n.querySelector(Uf(i)),a||(e=m({src:e,async:!0},t),(t=Cf.get(i))&&qf(e,t),a=n.createElement(`script`),At(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function If(e,t){Tf.M(e,t);var n=Of;if(n&&e){var r=kt(n).hoistableScripts,i=Hf(e),a=r.get(i);a||(a=n.querySelector(Uf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Cf.get(i))&&qf(e,t),a=n.createElement(`script`),At(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t,n,r){var i=(i=_e.current)?K(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Rf(n.href),n=kt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Rf(n.href);var o=kt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(zf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Cf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cf.set(e,n),o||Vf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Hf(n),n=kt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Rf(e){return`href="`+Yt(e)+`"`}function zf(e){return`link[rel="stylesheet"][`+e+`]`}function Bf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Vf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ud(t,`link`,n),At(t),e.head.appendChild(t))}function Hf(e){return`[src="`+Yt(e)+`"]`}function Uf(e){return`script[async]`+e}function Wf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Yt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),Ud(r,`style`,i),Gf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Rf(n.href);var o=e.querySelector(zf(i));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Bf(n),(i=Cf.get(i))&&Kf(r,i),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ud(o,`link`,r),t.state.loading|=4,Gf(o,n.precedence,e),t.instance=o;case`script`:return o=Hf(n.src),(i=e.querySelector(Uf(o)))?(t.instance=i,At(i),i):(r=n,(i=Cf.get(o))&&(r=m({},n),qf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),At(i),Ud(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Gf(r,n.precedence,e));return t.instance}function Gf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Kf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jf=null;function Yf(e,t,n){if(Jf===null){var r=new Map,i=Jf=new Map;i.set(n,r)}else i=Jf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[wt]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function $f(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Rf(r.href),a=t.querySelector(zf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=np.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Bf(r),(i=Cf.get(i))&&Kf(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ud(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=np.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ep=0;function tp(e,t){return e.stylesheets&&e.count===0&&ip(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ep===0&&(ep=62500*Kd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ep?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function np(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ip(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var rp=null;function ip(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rp=new Map,t.forEach(ap,e),rp=null,np.call(e))}function ap(e,t){if(!(t.state.loading&4)){var n=rp.get(e);if(n)var r=n.get(null);else{n=new Map,rp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=np.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var op={$$typeof:S,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function sp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function cp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new sp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=_i(3,null,null,t),e.current=a,a.stateNode=e,t=ga(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ja(a),e}function lp(e){return e?(e=hi,e):hi}function up(e,t,n,r,i,a){i=lp(i),r.context===null?r.context=i:r.pendingContext=i,r=Xa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Za(e,r,t),n!==null&&(wu(n,e,t),Qa(n,e,t))}function dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fp(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&wu(t,e,67108864),fp(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=Su();t=ft(t);var n=fi(e,t);n!==null&&wu(n,e,t),fp(e,t)}}var hp=!0;function gp(e,t,n,r){var i=w.T;w.T=null;var a=E.p;try{E.p=2,vp(e,t,n,r)}finally{E.p=a,w.T=i}}function _p(e,t,n,r){var i=w.T;w.T=null;var a=E.p;try{E.p=8,vp(e,t,n,r)}finally{E.p=a,w.T=i}}function vp(e,t,n,r){if(hp){var i=yp(r);if(i===null)Nd(e,t,r,bp,n),jp(e,r);else if(Np(i,e,t,n,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}pd(a),!(R&6)&&(du=Ie()+500,md(0,!1))}}break;case 31:case 13:s=fi(a,2),s!==null&&wu(s,a,2),ku(),fp(a,2)}if(a=yp(r),a===null&&Nd(e,t,r,bp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Nd(e,t,r,null,n)}}function yp(e){return e=pn(e),xp(e)}var bp=null;function xp(e){if(bp=null,e=Et(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bp=e,null}function Sp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var Cp=!1,wp=null,Tp=null,Ep=null,Dp=new Map,Op=new Map,kp=[],Ap=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function jp(e,t){switch(e){case`focusin`:case`focusout`:wp=null;break;case`dragenter`:case`dragleave`:Tp=null;break;case`mouseover`:case`mouseout`:Ep=null;break;case`pointerover`:case`pointerout`:Dp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Op.delete(t.pointerId)}}function Mp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Np(e,t,n,r,i){switch(t){case`focusin`:return wp=Mp(wp,e,t,n,r,i),!0;case`dragenter`:return Tp=Mp(Tp,e,t,n,r,i),!0;case`mouseover`:return Ep=Mp(Ep,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Dp.set(a,Mp(Dp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Op.set(a,Mp(Op.get(a)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=Et(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,ht(e.priority,function(){mp(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,ht(e.priority,function(){mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fn=r,n.target.dispatchEvent(r),fn=null}else return t=Dt(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ip(e,t,n){Fp(e)&&n.delete(t)}function Lp(){Cp=!1,wp!==null&&Fp(wp)&&(wp=null),Tp!==null&&Fp(Tp)&&(Tp=null),Ep!==null&&Fp(Ep)&&(Ep=null),Dp.forEach(Ip),Op.forEach(Ip)}function Rp(e,t){e.blockedOn===t&&(e.blockedOn=null,Cp||(Cp=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Lp)))}var zp=null;function Bp(e){zp!==e&&(zp=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(xp(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,Ms(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}wp!==null&&Rp(wp,e),Tp!==null&&Rp(Tp,e),Ep!==null&&Rp(Ep,e),Dp.forEach(t),Op.forEach(t);for(var n=0;n<kp.length;n++){var r=kp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kp.length&&(n=kp[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&kp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(xp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;up(n,Su(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),ku(),t[yt]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kp.length&&t!==0&&t<kp[n].priority;n++);kp.splice(n,0,e),n===0&&Pp(e)}};var Gp=r.version;if(Gp!==`19.2.5`)throw Error(a(527,Gp,`19.2.5`));E.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:w,reconcilerVersion:`19.2.5`};
10if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{Ge=qp.inject(Kp),Ke=qp}catch{}}t.hydrateRoot=function(e,t,n){if(!o(e))throw Error(a(299));var r=!1,i=``,s=tc,c=nc,l=rc,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=cp(e,1,!0,t,n??null,r,i,u,s,c,l,Hp),t.context=lp(null),n=t.current,r=Su(),r=ft(r),i=Xa(r),i.callback=null,Za(n,i,r),n=r,t.current.lanes=n,st(t,n),pd(t),e[yt]=t.current,jd(e),new Wp(t)}})),ke=r(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Oe()})),Ae=`__TSS_CONTEXT`,je=Symbol.for(`TSS_SERVER_FUNCTION`),Me=Symbol.for(`TSS_SERVER_FUNCTION_FACTORY`),Ne=`application/x-tss-framed`,Pe={JSON:0,CHUNK:1,END:2,ERROR:3};`${Ne}`;var Fe=/;\s*v=(\d+)/;function Ie(e){let t=e.match(Fe);return t?parseInt(t[1],10):void 0}function Le(e){let t=Ie(e);if(t!==void 0&&t!==1)throw Error(`Incompatible framed protocol version: server=${t}, client=1. Please ensure client and server are using compatible versions.`)}var Re=()=>window.__TSS_START_OPTIONS__;function ze(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Be(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ve(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Be(r):Array.isArray(t)?t.push(Be(r)):n[e]=[t,Be(r)]}return n}var He=We(JSON.parse),Ue=Ge(JSON.stringify,JSON.parse);function We(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ve(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ge(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=ze(e,r);return t?`?${t}`:``}}var Ke=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},qe=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Je=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Ye=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);
10i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Xe=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Ze=(e,t,n)=>{if(!(!ge(n)&&!D(n)))throw ge(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:ge(n)?`redirected`:D(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Ye(e,t.index),isFetching:!1,error:n})),D(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ge(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Qe=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},$e=(e,t,n)=>{let r=Ye(e,n);e.updateMatch(t,e=>({...e,context:r}))},et=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,Ze(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,Ze(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ge(n)&&!D(n)&&(e.serialError??=n)},tt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Je(e,t)&&(n.options.loader||n.options.beforeLoad||ft(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Ke(e)},i);r._nonReactive.pendingTimeout=t}},nt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;tt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Ze(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},rt=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=l(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&et(e,n,o),s&&et(e,n,s),tt(e,t,r,i);let c=new AbortController,u=!1,d=()=>{u||(u=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},f=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{d(),f()});return}i._nonReactive.beforeLoadPromise=l();let m={...Ye(e,n,!1),...i.__routeContext},{search:h,params:g,cause:_}=i,v=Je(e,t),y={search:h,abortController:c,params:g,preload:v,context:m,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:_,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){e.router.batch(()=>{d(),f()});return}(ge(r)||D(r))&&(d(),et(e,n,r)),e.router.batch(()=>{d(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),f()})},x;try{if(x=r.options.beforeLoad(y),p(x))return d(),x.catch(t=>{et(e,n,t)}).then(b)}catch(t){d(),et(e,n,t)}b(x)},it=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>rt(e,n,t,i),s=()=>{if(Qe(e,n))return;let t=nt(e,n,i);return p(t)?t.then(o):o()};return a()},at=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},ot=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Ye(e,r),d=Je(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},st=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{dt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(ot(e,t,n,r,i)),l=!!s&&p(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Ze(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Ye(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>
10({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Ye(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,D(t)&&await i.options.notFoundComponent?.preload?.(),Ze(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Ze(e,e.router.getMatch(n),t)}!ge(o)&&!D(o)&&await dt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Ye(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Ze(e,r,t)}},ct=async(e,t,n)=>{async function r(r,a,c,l,u){let f=Date.now()-a.updatedAt,p=r?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,m=u.options.shouldReload,h=typeof m==`function`?m(ot(e,t,i,n,u)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&u.options.preload===!1||(o&&!e.sync&&d?(s=!0,(async()=>{try{await st(e,t,i,n,u);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){ge(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await st(e,t,i,n,u):$e(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],u=c.options.loader,d=((typeof u==`function`?void 0:u?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Qe(e,i)){if(!e.router.getMatch(i))return e.matches[n];$e(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,u=Je(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&d)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Ze(e,n,a),n.status===`pending`&&await r(u,t,s,n,c)}else{let n=u&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=l(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(u,t,s,a,c)}}let f=e.router.getMatch(i);s||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,s||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;let p=s?f.isFetching:!1;return p!==f.isFetching||f.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:p,invalid:!1})),e.router.getMatch(i)):f};async function lt(e){let n=e,r=[];qe(n.router)&&Ke(n);let i;for(let e=0;e<n.matches.length;e++){try{let t=it(n,e);p(t)&&await t}catch(e){if(ge(e))throw e;if(D(e))i=e;else if(!n.preload)throw e;break}if(n.serialError||n.firstBadMatchIndex!=null)break}let a=n.firstBadMatchIndex??n.matches.length,o=i&&!n.preload?Xe(n,i):void 0,s=i&&n.preload?0:o===void 0?a:Math.min(o+1,a),c,l;for(let e=0;e<s;e++)r.push(ct(n,r,e));try{await Promise.all(r)}catch{let e=await Promise.allSettled(r);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(ge(e))throw e;D(e)?c??=e:l??=e}if(l!==void 0)throw l}let u=c??(i&&!n.preload?i:void 0),d=n.firstBadMatchIndex===void 0?n.matches.length-1:n.firstBadMatchIndex;if(!u&&i&&n.preload)return n.matches;if(u){let e=Xe(n,u);e===void 0&&t();let r=n.matches[e],i=n.router.looseRoutesById[r.routeId],a=n.router.options?.defaultNotFoundComponent;!i.options.notFoundComponent&&a&&(i.options.notFoundComponent=a),u.routeId=r.routeId;let o=r.routeId===n.router.routeTree.id;n.updateMatch(r.id,e=>({...e,...o?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:u},isFetching:!1})),d=e,await dt(i,[`notFoundComponent`])}else if(!n.preload){let e=n.matches[0];e.globalNotFound||n.router.getMatch(e.id)?.globalNotFound&&n.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(n.serialError&&n.firstBadMatchIndex!==void 0){let e=n.router.looseRoutesById[n.matches[n.firstBadMatchIndex].routeId];await dt(e,[`errorComponent`])}for(let e=0;e<=d;e++){let{id:t,routeId:r}=n.matches[e],i=n.router.looseRoutesById[r];try{let e=at(n,t,i);if(e){let r=await e;n.updateMatch(t,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let f=Ke(n);if(p(f)&&await f,u)throw u;
10if(n.serialError&&!n.preload&&!n.onReady)throw n.serialError;return n.matches}function ut(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function dt(e,t=pt){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===pt?(()=>{if(e._componentsPromise===void 0){let t=ut(e,pt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():ut(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function ft(e){for(let t of pt)if(e.options[t]?.preload)return!0;return!1}var pt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function mt(e){return{input:({url:t})=>{for(let n of e)t=gt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=_t(e[n],t);return t}}}function ht(e){let t=ee(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=S([`/`,t,e.pathname]),e)}}function gt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function _t(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function vt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>yt(o,_.get())),S=r(()=>yt(s,v.get())),ee=r(()=>yt(c,y.get())),C=r(()=>_.get()[0]),te=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),ne=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),re=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),ie=x(64);function ae(e){let t=ie.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),ie.set(e,t)),t}let oe={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:S,cachedMatches:ee,firstId:C,hasPending:te,matchRouteDeps:ne,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:re,getRouteMatchStore:ae,setMatches:se,setPending:ce,setCached:le};se(e.matches),a?.(oe);function se(e){bt(e,o,_,n,i)}function ce(e){bt(e,s,v,n,i)}function le(e){bt(e,c,y,n,i)}return oe}function yt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function bt(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}_(n.get(),a)||n.set(a)})}var xt=`__TSR_index`,St=`popstate`,Ct=`beforeunload`;function wt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Ot(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[xt];i=Tt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[xt];i=Tt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[xt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Tt(e,t){t||={};let n=kt();return{...t,key:n,__TSR_key:n,[xt]:e}}function Et(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ot(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=kt();t.history.replaceState({[xt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(ee._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),ee._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Ot(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),ee.notify({type:e})},x=async()=>
10{if(f){f=!1;return}let e=c(),n=e.state[xt]-l.state[xt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),ee.notify(u);return}}}l=c(),ee.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},ee=wt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ct,S,{capture:!0}),t.removeEventListener(St,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ct,S,{capture:!0}),t.addEventListener(St,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return ee._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return ee._ignoreSubscribers||b(`REPLACE`),n},ee}function Dt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ot(e,t){let n=Dt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=kt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[xt]:0,key:a,__TSR_key:a}}}function kt(){return(Math.random()+1).toString(36).substring(7)}function At(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function jt(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Mt=new WeakMap,Nt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=b(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Et()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=x(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=vt(It(this.latestLocation),e),nn(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=ee(o);t&&t!==`/`&&e.push(ht({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:mt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=me(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&de(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>
10{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:fe(e).path,external:!1,searchStr:o,search:g(t?.search,i),hash:fe(r.slice(1)).path,state:f(t?.state,a)}}let o=new URL(i,this.origin),s=gt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:fe(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:g(t?.search,c),hash:fe(s.hash.slice(1)).path,state:f(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>E({base:e,to:t.includes(`//`)?re(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Rt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,h(t.params,s)),p=this.routesByPath[ce(l)],m;if(p)m=this.getRouteBranch(p);else if(l.includes(`$`))m=[];else{let e=this.getMatchedRoutes(l);m=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(m=[...m,this.options.notFoundRoute])}if(m.length&&ae(u))for(let e of m){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let _=e.leaveParams?l:fe(ue({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,v=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Lt(t.options.validateSearch,{...e,...v}))}catch{}}),v=e}v=zt({search:v,dest:t,destRoutes:m,_includeValidateSearch:e._includeValidateSearch}),v=g(o,v);let y=this.options.stringifySearch(v),b=t.hash===!0?n.hash:t.hash?h(t.hash,n.hash):void 0,x=b?`#${b}`:``,S=t.state===!0?n.state:t.state?h(t.state,n.state):{};S=f(n.state,S);let ee=`${_}${y}${x}`,C,te,ne=!1;if(this.rewrite){let e=new URL(ee,this.origin),t=_t(this.rewrite,e);C=e.href.replace(e.origin,``),t.origin===this.origin?te=t.pathname+t.search+t.hash:(te=t.href,ne=!0)}else C=d(ee),te=C;return{publicHref:te,href:C,pathname:_,search:v,searchStr:y,state:S,hash:b??``,external:ne,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=ne(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,h(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];
10e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=v(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=ce(this.latestLocation.href)===ce(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=l(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Ot(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=gt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(c(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Mt.set(this.latestLocation,t):Mt.delete(this.latestLocation);let n=this.latestLocation,r=jt(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await lt({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){ge(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):D(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(jt(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>
10{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&c(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=dt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await lt({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(ge(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});D(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=y(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!v(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?v(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Ue,parseSearch:e.parseSearch??He,protocolAllowlist:e.protocolAllowlist??pe}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=oe(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParam
10s:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:ce(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Vt(this.options.notFoundMode,a):void 0,c=Array(a.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],d,p,m;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Lt(r.options.validateSearch,{...n})??void 0;d={...n,...e},p={...i,...e},m=void 0}catch(e){let r=e;if(e instanceof Pt||(r=new Pt(e.message,{cause:e})),t?.throwOnError)throw r;d=n,p={},m=r}}let h=r.options.loaderDeps?.({search:d})??``,_=h?JSON.stringify(h):``,{interpolatedPath:v,usedParams:y}=ue({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),b=r.id+v+_,x=this.getMatch(b),S=u.get(r.id),ee=x?._strictParams??y,C;if(!x)try{Ht(r,ee)}catch(e){if(C=D(e)||ge(e)?e:new Ft(e.message,{cause:e}),t?.throwOnError)throw C}Object.assign(i,ee);let te=S?`stay`:`enter`,ne;if(x)ne={...x,cause:te,params:S?.params??i,_strictParams:ee,search:g(S?S.search:x.search,d),_strictSearch:p};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||ft(r)?`pending`:`success`;ne={id:b,ssr:r.options.ssr,index:n,routeId:r.id,params:S?.params??i,_strictParams:ee,pathname:v,updatedAt:Date.now(),search:S?g(S.search,d):d,_strictSearch:p,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:C,__routeContext:void 0,_nonReactive:{loadPromise:l()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:te,loaderDeps:S?f(S.loaderDeps,h):h,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(ne.globalNotFound=s===r.id),ne.searchError=m;let re=this.getParentContext(o);ne.context={...re,...ne.__routeContext,...ne.__beforeLoadContext},c[n]=ne}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?g(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=m(t),i={...e.search};for(let e of t)try{Object.assign(i,Lt(e.options.validateSearch,i))}catch{}let a=m(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Ht(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Pt=class extends Error{},Ft=class extends Error{};function It(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Lt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Pt(`Async validation not supported`);if(n.issues)throw new Pt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Rt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=ce(e),a,o=te(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function zt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Bt(n)(e,t,r??!1)}function Bt(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>
10t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Lt(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=h(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function Vt(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return ve}function Ht(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function Ut(){try{return sessionStorage}catch{return}}var Wt=`tsr-scroll-restoration-v1_3`,Gt=Ut();function Kt(){try{return JSON.parse(Gt?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function qt(){try{Gt?.setItem(Wt,JSON.stringify(Jt))}catch{}}var Jt=Kt(),Yt=`data-scroll-restoration-id`,Xt=e=>e.state.__TSR_key||e.href;function Zt(e){let t=e.getAttribute(Yt);if(t)return`[${Yt}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Qt=!1,$t=`window`;function en(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function tn(e){let t=[];for(let n of e){if(n===$t)continue;let e=en(n);e&&t.push(e)}return t}function nn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Xt,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(Qt||!r.restoring))if(e.target===document)o($t,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=Jt[e]||={};for(let[e,n]of a)e===$t?t[$t]=n:e.isConnected&&(t[Zt(e)]=n)};n&&!r.restoration&&(r.restoration=!0,Qt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),qt()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=Jt[u];if(e){let t=Jt[l];for(let n in e){if(n===$t){if(s)continue}else{let e=en(n);if(!e||s&&o&&(c??=tn(o),c.includes(e)))continue}t||=Jt[l]={},t[n]??=e[n]}}}Qt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=Mt.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?Jt[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===$t){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=en(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=tn(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Qt=!1}}))}var rn=Symbol.for(`TSR_DEFERRED_PROMISE`);function an(e,t){let n=e;return n[rn]?n:(n[rn]={status:`pending`},n.then(e=>{n[rn].status=`success`,n[rn].data=e}).catch(e=>{n[rn].status=`error`,n[rn].error={data:(t?.serializeError??At)(e),__isServerError:!0}}),n)}function on(e,t){if(e)return typeof e==`string`?e:e[t]}function sn(e){return e?.scriptFormat??`module`}function cn(e,t,n){let r=ln(t),i=on(n,`script`)??r.crossOrigin;return{...sn(e)===`iife`?{rel:`preload`,as:`script`}:{rel:`modulepreload`},href:r.href,...i?{crossOrigin:i}:{}}}function ln(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function un(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}let n=new Set;for(let r of t){let t=JSON.stringify(r);n.has(t)||(n.add(t),e.push(r))}}function dn(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}var fn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=ve:this.parentRoute||t();let i=r?ve:n?.path;i&&i!==`/`&&(i=C(i));let a=n?.id||i,o=r?ve:S([this.parentRoute.id===`__root__`?``:this.parentRoute.id,a]);i===`__root__`&&(i=`/`),o!==`__root__`&&(o=S([`/`,o]));let s=o===`__root__`?`/`:S([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=s,this._to=ce(s)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>he({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},pn=class extends fn{constructor(e){super(e)}},mn=(e=>(e[e.AggregateError=1]=`AggregateError`,e[e.ArrowFunction=2]=`ArrowFunction`,e[e.ErrorPrototypeStack=4]=`ErrorPrototypeStack`,e[e.ObjectAssign=8]=`ObjectAssign`,e[e.BigIntTypedArray=16]=`BigIntTypedArray`,e[e.RegExp=32]=`RegExp`,e))(mn||{}),hn=Symbol.asyncIterator,gn=Symbol.hasInstance,_n=Symbol.isConcatSpreadable,vn=Symbol.iterator,yn=Symbol.match,bn=Symbol.matchAll,xn=Symbol.replace,Sn=Symbol.search,Cn=Symbol.species,wn=Symbol.split,Tn=Symbol.toPrimitive,En=Symbol.toStringTag,Dn=Symbol.unscopables,On={[hn]:0,[gn]:1,[_n]:2,[vn]:3,[yn]:4,[bn]:5,[xn]:6,[Sn]:7,[Cn]:8,[wn]:9,[Tn]:10,[En]:11,[Dn]:12},kn={0:hn,1:gn,2:_n,3:vn,4:yn,5:bn,6:xn,7:Sn,8:Cn,9:wn,10:Tn,11:En,12:Dn},k=void 0,An={2:!0,3:!1,1:k,0:null,4:-0,5:1/0,6:-1/0,7:NaN},jn={0:`Error`,1:`EvalError`,2:`RangeError`,3:`ReferenceError`,4:`SyntaxError`,5:`TypeError`,6:`URIError`},Mn={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function A(e,t,n,r,i,a,o,s,c,l,u,d){return{t:e,i:t,s:n,c:r,m:i,p:a,e:o,a:s,f:c,b:l,o:u,l:d}}function Nn(e){return A(2,k,e,k,k,k,k,k,k,k,k,k)}
10var Pn=Nn(2),Fn=Nn(3),In=Nn(1),Ln=Nn(0),Rn=Nn(4),zn=Nn(5),Bn=Nn(6),Vn=Nn(7);function Hn(e){switch(e){case`"`:return`\\"`;case`\\`:return`\\\\`;case` 11`:return`\\n`;case`\r`:return`\\r`;case`\b`:return`\\b`;case` `:return`\\t`;case`\f`:return`\\f`;case`<`:return`\\x3C`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:return k}}function Un(e){let t=``,n=0,r;for(let i=0,a=e.length;i<a;i++)r=Hn(e[i]),r&&(t+=e.slice(n,i)+r,n=i+1);return n===0?t=e:t+=e.slice(n),t}function Wn(e){switch(e){case`\\\\`:return`\\`;case`\\"`:return`"`;case`\\n`:return` 12`;case`\\r`:return`\r`;case`\\b`:return`\b`;case`\\t`:return` `;case`\\f`:return`\f`;case`\\x3C`:return`<`;case`\\u2028`:return`\u2028`;case`\\u2029`:return`\u2029`;default:return e}}function Gn(e){return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,Wn)}var Kn=`__SEROVAL_REFS__`,qn=new Map,Jn=new Map;function Yn(e){return qn.has(e)}function Xn(e){return Jn.has(e)}function Zn(e){if(Yn(e))return qn.get(e);throw new zr(e)}function Qn(e){if(Xn(e))return Jn.get(e);throw new Br(e)}typeof globalThis<`u`?Object.defineProperty(globalThis,Kn,{value:Jn,configurable:!0,writable:!1,enumerable:!1}):typeof window<`u`?Object.defineProperty(window,Kn,{value:Jn,configurable:!0,writable:!1,enumerable:!1}):typeof self<`u`?Object.defineProperty(self,Kn,{value:Jn,configurable:!0,writable:!1,enumerable:!1}):typeof global<`u`&&Object.defineProperty(global,Kn,{value:Jn,configurable:!0,writable:!1,enumerable:!1});function $n(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function er(e){let t=jn[$n(e)];return e.name===t?e.constructor.name===t?{}:{name:e.constructor.name}:{name:e.name}}function tr(e,t){let n=er(e),r=Object.getOwnPropertyNames(e);for(let i=0,a=r.length,o;i<a;i++)o=r[i],o!==`name`&&o!==`message`&&(o===`stack`?t&4&&(n||={},n[o]=e[o]):(n||={},n[o]=e[o]));return n}function nr(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:+!Object.isExtensible(e)}function rr(e){switch(e){case 1/0:return zn;case-1/0:return Bn}return e===e?Object.is(e,-0)?Rn:A(0,k,e,k,k,k,k,k,k,k,k,k):Vn}function ir(e){return A(1,k,Un(e),k,k,k,k,k,k,k,k,k)}function ar(e){return A(3,k,``+e,k,k,k,k,k,k,k,k,k)}function or(e){return A(4,e,k,k,k,k,k,k,k,k,k,k)}function sr(e,t){let n=t.valueOf();return A(5,e,n===n?t.toISOString():``,k,k,k,k,k,k,k,k,k)}function cr(e,t){return A(6,e,k,Un(t.source),t.flags,k,k,k,k,k,k,k)}function lr(e,t){return A(17,e,On[t],k,k,k,k,k,k,k,k,k)}function ur(e,t){return A(18,e,Un(Zn(t)),k,k,k,k,k,k,k,k,k)}function dr(e,t,n){return A(25,e,n,Un(t),k,k,k,k,k,k,k,k)}function fr(e,t,n){return A(9,e,k,k,k,k,k,n,k,k,nr(t),k)}function pr(e,t){return A(21,e,k,k,k,k,k,k,t,k,k,k)}function mr(e,t,n){return A(15,e,k,t.constructor.name,k,k,k,k,n,t.byteOffset,k,t.length)}function hr(e,t,n){return A(16,e,k,t.constructor.name,k,k,k,k,n,t.byteOffset,k,t.byteLength)}function gr(e,t,n){return A(20,e,k,k,k,k,k,k,n,t.byteOffset,k,t.byteLength)}function _r(e,t,n){return A(13,e,$n(t),k,Un(t.message),n,k,k,k,k,k,k)}function vr(e,t,n){return A(14,e,$n(t),k,Un(t.message),n,k,k,k,k,k,k)}function yr(e,t){return A(7,e,k,k,k,k,k,t,k,k,k,k)}function br(e,t){return A(28,k,k,k,k,k,k,[e,t],k,k,k,k)}function xr(e,t){return A(30,k,k,k,k,k,k,[e,t],k,k,k,k)}function Sr(e,t,n){return A(31,e,k,k,k,k,k,n,t,k,k,k)}function Cr(e,t){return A(32,e,k,k,k,k,k,k,t,k,k,k)}function wr(e,t){return A(33,e,k,k,k,k,k,k,t,k,k,k)}function Tr(e,t){return A(34,e,k,k,k,k,k,k,t,k,k,k)}function Er(e,t,n,r){return A(35,e,n,k,k,k,k,t,k,k,k,r)}var{toString:Dr}=Object.prototype,Or={parsing:1,serialization:2,deserialization:3};function kr(e){return`Seroval Error (step: ${Or[e]})`}var Ar=(e,t)=>kr(e),jr=class extends Error{constructor(e,t){super(Ar(e,t)),this.cause=t}},Mr=class extends jr{constructor(e){super(`parsing`,e)}},Nr=class extends jr{constructor(e){super(`deserialization`,e)}};function Pr(e){return`Seroval Error (specific: ${e})`}var Fr=class extends Error{constructor(e){super(Pr(1)),this.value=e}}
12,Ir=class extends Error{constructor(e){super(Pr(2))}},Lr=class extends Error{constructor(e){super(Pr(3))}},Rr=class extends Error{constructor(e){super(Pr(4))}},zr=class extends Error{constructor(e){super(Pr(5)),this.value=e}},Br=class extends Error{constructor(e){super(Pr(6))}},Vr=class extends Error{constructor(e){super(Pr(7))}},Hr=class extends Error{constructor(e){super(Pr(8))}},Ur=class extends Error{constructor(e){super(Pr(9))}},Wr=class{constructor(e,t){this.value=e,this.replacement=t}},Gr=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e};Gr.toString(),((e,t)=>{e.s(t),e.p.s=1,e.p.v=t}).toString(),((e,t)=>{e.f(t),e.p.s=2,e.p.v=t}).toString();var Kr=()=>{let e=[],t=[],n=!0,r=!1,i=0,a=(e,n,r)=>{for(r=0;r<i;r++)t[r]&&t[r][n](e)},o=(t,i,a,o)=>{for(i=0,a=e.length;i<a;i++)o=e[i],!n&&i===a-1?t[r?`return`:`throw`](o):t.next(o)},s=(e,r)=>(n&&(r=i++,t[r]=e),o(e),()=>{n&&(t[r]=t[i],t[i--]=void 0)});return{__SEROVAL_STREAM__:!0,on:e=>s(e),next:t=>{n&&(e.push(t),a(t,`next`))},throw:i=>{n&&(e.push(i),a(i,`throw`),n=!1,r=!1,t.length=0)},return:i=>{n&&(e.push(i),a(i,`return`),n=!1,r=!0,t.length=0)}}};Kr.toString();var qr=e=>t=>()=>{let n=0,r={[e]:()=>r,next:()=>{if(n>t.d)return{done:!0,value:void 0};let e=n++,r=t.v[e];if(e===t.t)throw r;return{done:e===t.d,value:r}}};return r};qr.toString();var Jr=(e,t)=>n=>()=>{let r=0,i=-1,a=!1,o=[],s=[],c=(e=0,t=s.length)=>{for(;e<t;e++)s[e].s({done:!0,value:void 0})};n.on({next:e=>{let t=s.shift();t&&t.s({done:!1,value:e}),o.push(e)},throw:e=>{let t=s.shift();t&&t.f(e),c(),i=o.length,a=!0,o.push(e)},return:e=>{let t=s.shift();t&&t.s({done:!0,value:e}),c(),i=o.length,o.push(e)}});let l={[e]:()=>l,next:()=>{if(i===-1){let e=r++;if(e>=o.length){let e=t();return s.push(e),e.p}return{done:!1,value:o[e]}}if(r>i)return{done:!0,value:void 0};let e=r++,n=o[e];if(e!==i)return{done:!1,value:n};if(a)throw n;return{done:!0,value:n}}};return l};Jr.toString();var Yr=e=>{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer};Yr.toString();function Xr(e){return`__SEROVAL_SEQUENCE__`in e}function Zr(e,t,n){return{__SEROVAL_SEQUENCE__:!0,v:e,t,d:n}}function Qr(e){let t=[],n=-1,r=-1,i=e[vn]();for(;;)try{let e=i.next();if(t.push(e.value),e.done){r=t.length-1;break}}catch(e){n=t.length,t.push(e)}return Zr(t,n,r)}var $r=qr(vn);function ei(e){return $r(e)}var ti={},ni={},ri={0:{},1:{},2:{},3:{},4:{},5:{}};function ii(e){return`__SEROVAL_STREAM__`in e}function ai(){return Kr()}function oi(e){let t=ai(),n=e[hn]();async function r(){try{let e=await n.next();e.done?t.return(e.value):(t.next(e.value),await r())}catch(e){t.throw(e)}}return r().catch(()=>{}),t}var si=Jr(hn,Gr);function ci(e){return si(e)}async function li(e){try{return[1,await e]}catch(e){return[0,e]}}function ui(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function di(e,t){e.marked.add(t)}function fi(e,t){let n=e.refs.size;return e.refs.set(t,n),n}function pi(e,t){let n=e.refs.get(t);return n==null?{type:0,value:fi(e,t)}:(di(e,n),{type:1,value:or(n)})}function mi(e,t){let n=pi(e,t);return n.type===1?n:Yn(t)?{type:2,value:ur(n.value,t)}:n}function hi(e,t){let n=mi(e,t);if(n.type!==0)return n.value;if(t in On)return lr(n.value,t);throw new Fr(t)}function gi(e,t){let n=pi(e,ri[t]);return n.type===1?n.value:A(26,n.value,t,k,k,k,k,k,k,k,k,k)}function _i(e){let t=pi(e,ti);return t.type===1?t.value:A(27,t.value,k,k,k,k,k,k,hi(e,vn),k,k,k)}function vi(e){let t=pi(e,ni);return t.type===1?t.value:A(29,t.value,k,k,k,k,k,[gi(e,1),hi(e,hn)],k,k,k,k)}function yi(e,t,n,r){return A(n?11:10,e,k,k,k,r,k,k,k,k,nr(t),k)}function bi(e,t,n,r){return A(8,t,k,k,k,k,{k:n,v:r},k,gi(e,0),k,k,k)}function xi(e,t,n){let r=new Uint8Array(n),i=``;for(let e=0,t=r.length;e<t;e++)i+=String.fromCharCode(r[e]);return A(19,t,Un(btoa(i)),k,k,k,k,k,gi(e,5),k,k,k)}function Si(e,t){return{base:ui(e,t),child:void 0}}var Ci=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return j(this._p,this.depth,e)}};async function wi(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++)i in n?r[i]=await j(e,t,n[i]):r[i]=0;return r}async function Ti(e,t,n,r){return fr(n,r,await wi(e,t,r))}async function Ei(e,t,n){let r=Object.entries(n),i=[],a=[];for(let n=0,o=r.length;n<o;n++)i.push(Un(r[n][0])),a.push(await j(e,t,r[n][1]));return vn in n&&(i.push(hi(e.base,vn)),a.push(br(_i(e.base),await j(e,t,Qr(n))))),hn in n&&(i.push(hi(e.base,hn)),a.push(xr(vi(e.base),await j(e,t,oi(n))))),En in n&&(i.push(hi(e.base,En)),a.push(ir(n[En]))),_n in n&&(i.push(hi(e.base,_n)),a.push(n[_n]?Pn:Fn)),{k:i,v:a}}async function Di(e,t,n,r,i){return yi(n,r,i,await Ei(e,t,r))}async function Oi(e,t,n,r){return pr(n,await j(e,t,r.valueOf()))}async function ki(e,t,n,r){return mr(n,r,await j(e,t,r.buffer))}async function Ai(e,t,n,r){return hr(n,r,await j(e,t,r.buffer))}async function ji(e,t,n,r){return gr(n,r,await j(e,t,r.buffer))}async function Mi(e,t,n,r){let i=tr(r,e.base.features);return _r(n,r,i?await Ei(e,t,i):k)}async function Ni(e,t,n,r){let i=tr(r,e.base.features);return vr(n,r,i?await Ei(e,t,i):k)}async function Pi(e,t,n,r){let i=[],a=[];
12for(let[n,o]of r.entries())i.push(await j(e,t,n)),a.push(await j(e,t,o));return bi(e.base,n,i,a)}async function Fi(e,t,n,r){let i=[];for(let n of r.keys())i.push(await j(e,t,n));return yr(n,i)}async function Ii(e,t,n,r){let i=e.base.plugins;if(i)for(let a=0,o=i.length;a<o;a++){let o=i[a];if(o.parse.async&&o.test(r))return dr(n,o.tag,await o.parse.async(r,new Ci(e,t),{id:n}))}return k}async function Li(e,t,n,r){let[i,a]=await li(r);return A(12,n,i,k,k,k,k,k,await j(e,t,a),k,k,k)}function Ri(e,t,n,r,i){let a=[],o=n.on({next:n=>{di(this.base,t),j(this,e,n).then(e=>{a.push(Cr(t,e))},e=>{i(e),o()})},throw:n=>{di(this.base,t),j(this,e,n).then(e=>{a.push(wr(t,e)),r(a),o()},e=>{i(e),o()})},return:n=>{di(this.base,t),j(this,e,n).then(e=>{a.push(Tr(t,e)),r(a),o()},e=>{i(e),o()})}})}async function zi(e,t,n,r){return Sr(n,gi(e.base,4),await new Promise(Ri.bind(e,t,n,r)))}async function Bi(e,t,n,r){let i=[];for(let n=0,a=r.v.length;n<a;n++)i[n]=await j(e,t,r.v[n]);return Er(n,i,r.t,r.d)}async function Vi(e,t,n,r){if(Array.isArray(r))return Ti(e,t,n,r);if(ii(r))return zi(e,t,n,r);if(Xr(r))return Bi(e,t,n,r);let i=r.constructor;if(i===Wr)return j(e,t,r.replacement);let a=await Ii(e,t,n,r);if(a)return a;switch(i){case Object:return Di(e,t,n,r,!1);case k:return Di(e,t,n,r,!0);case Date:return sr(n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Mi(e,t,n,r);case Number:case Boolean:case String:case BigInt:return Oi(e,t,n,r);case ArrayBuffer:return xi(e.base,n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return ki(e,t,n,r);case DataView:return ji(e,t,n,r);case Map:return Pi(e,t,n,r);case Set:return Fi(e,t,n,r);default:break}if(i===Promise||r instanceof Promise)return Li(e,t,n,r);let o=e.base.features;if(o&32&&i===RegExp)return cr(n,r);if(o&16)switch(i){case BigInt64Array:case BigUint64Array:return Ai(e,t,n,r);default:break}if(o&1&&typeof AggregateError<`u`&&(i===AggregateError||r instanceof AggregateError))return Ni(e,t,n,r);if(r instanceof Error)return Mi(e,t,n,r);if(vn in r||hn in r)return Di(e,t,n,r,!!i);throw new Fr(r)}async function Hi(e,t,n){let r=mi(e.base,n);if(r.type!==0)return r.value;let i=await Ii(e,t,r.value,n);if(i)return i;throw new Fr(n)}async function j(e,t,n){switch(typeof n){case`boolean`:return n?Pn:Fn;case`undefined`:return In;case`string`:return ir(n);case`number`:return rr(n);case`bigint`:return ar(n);case`object`:if(n){let r=mi(e.base,n);return r.type===0?await Vi(e,t+1,r.value,n):r.value}return Ln;case`symbol`:return hi(e.base,n);case`function`:return Hi(e,t,n);default:throw new Fr(n)}}async function M(e,t){try{return await j(e,0,t)}catch(e){throw e instanceof Mr?e:new Mr(e)}}var Ui=(e=>(e[e.Vanilla=1]=`Vanilla`,e[e.Cross=2]=`Cross`,e))(Ui||{});function Wi(e){return e}function Gi(e,t){for(let n=0,r=t.length;n<r;n++){let r=t[n];e.has(r)||(e.add(r),r.extends&&Gi(e,r.extends))}}function Ki(e){if(e){let t=new Set;return Gi(t,e),[...t]}}function qi(e){switch(e){case`Int8Array`:return Int8Array;case`Int16Array`:return Int16Array;case`Int32Array`:return Int32Array;case`Uint8Array`:return Uint8Array;case`Uint16Array`:return Uint16Array;case`Uint32Array`:return Uint32Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return BigInt64Array;case`BigUint64Array`:return BigUint64Array;default:throw new Vr(e)}}var Ji=1e6,Yi=1e4,Xi=2e4;function Zi(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var Qi=1e3;function $i(e,t){let n=t.refs||new Map;return`types`in n||Object.assign(n,{types:new Map}),{mode:e,plugins:t.plugins,refs:n,features:t.features??63^(t.disabledFeatures||0),depthLimit:t.depthLimit||Qi}}function ea(e){return{mode:2,base:$i(2,e),child:k}}var ta=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return N(this._p,this.depth,e)}};function na(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new Hr({t:4,i:t});if(e.refs.has(t))throw Error(`Conflicted ref id: `+t)}function ra(e,t,n){return na(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,n),n}function ia(e,t,n){return na(e.base,t),e.base.refs.set(t,n),n}
12function aa(e,t,n){return e.mode===1?ra(e,t,n):ia(e,t,n)}function oa(e,t,n){if(Object.hasOwn(t,n))return t[n];throw new Hr(e)}function sa(e,t){return aa(e,t.i,Qn(Gn(t.s)))}function ca(e,t,n){let r=n.a,i=r.length,a=aa(e,n.i,Array(i));for(let n=0,o;n<i;n++)o=r[n],o&&(a[n]=N(e,t,o));return Zi(a,n.o),a}function la(e){switch(e){case`constructor`:case`__proto__`:case`prototype`:case`__defineGetter__`:case`__defineSetter__`:case`__lookupGetter__`:case`__lookupSetter__`:return!1;default:return!0}}function ua(e){switch(e){case hn:case _n:case En:case vn:return!0;default:return!1}}function da(e,t,n){la(t)?e[t]=n:Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function fa(e,t,n,r,i){if(typeof r==`string`)da(n,Gn(r),N(e,t,i));else{let a=N(e,t,r);switch(typeof a){case`string`:da(n,a,N(e,t,i));break;case`symbol`:ua(a)&&(n[a]=N(e,t,i));break;default:throw new Hr(r)}}}function pa(e,t,n){e.base.refs.types.set(t,n)}function ma(e,t,n,r){if(e.base.refs.types.get(n)!==r)throw new Hr(t)}function ha(e,t,n,r){let i=n.k;if(i.length>0)for(let a=0,o=n.v,s=i.length;a<s;a++)fa(e,t,r,i[a],o[a]);return r}function ga(e,t,n){let r=aa(e,n.i,n.t===10?{}:Object.create(null));return ha(e,t,n.p,r),Zi(r,n.o),r}function _a(e,t){return aa(e,t.i,new Date(t.s))}function va(e,t){if(e.base.features&32){let n=Gn(t.c);if(n.length>Xi)throw new Hr(t);return aa(e,t.i,new RegExp(n,t.m))}throw new Ir(t)}function ya(e,t,n){let r=aa(e,n.i,new Set);for(let i=0,a=n.a,o=a.length;i<o;i++)r.add(N(e,t,a[i]));return r}function ba(e,t,n){let r=aa(e,n.i,new Map);for(let i=0,a=n.e.k,o=n.e.v,s=a.length;i<s;i++)r.set(N(e,t,a[i]),N(e,t,o[i]));return r}function xa(e,t){if(t.s.length>Ji)throw new Hr(t);return aa(e,t.i,Yr(Gn(t.s)))}function Sa(e,t,n){let r=qi(n.c),i=N(e,t,n.f),a=n.b??0;if(a<0||a>i.byteLength)throw new Hr(n);return aa(e,n.i,new r(i,a,n.l))}function Ca(e,t,n){let r=N(e,t,n.f),i=n.b??0;if(i<0||i>r.byteLength)throw new Hr(n);return aa(e,n.i,new DataView(r,i,n.l))}function wa(e,t,n,r){if(n.p){let i=ha(e,t,n.p,{});Object.defineProperties(r,Object.getOwnPropertyDescriptors(i))}return r}function Ta(e,t,n){return wa(e,t,n,aa(e,n.i,AggregateError([],Gn(n.m))))}function Ea(e,t,n){let r=oa(n,Mn,n.s);return wa(e,t,n,aa(e,n.i,new r(Gn(n.m))))}function Da(e,t,n){let r=Gr(),i=aa(e,n.i,r.p),a=N(e,t,n.f);return n.s?r.s(a):r.f(a),i}function Oa(e,t,n){return aa(e,n.i,Object(N(e,t,n.f)))}function ka(e,t,n){let r=e.base.plugins;if(r){let i=Gn(n.c);for(let a=0,o=r.length;a<o;a++){let o=r[a];if(o.tag===i)return aa(e,n.i,o.deserialize(n.s,new ta(e,t),{id:n.i}))}}throw new Lr(n.c)}function Aa(e,t){let n=aa(e,t.i,aa(e,t.s,Gr()).p);return pa(e,t.s,22),n}function ja(e,t,n){let r=e.base.refs.get(n.i);if(r)return ma(e,n,n.i,22),r.s(N(e,t,n.a[1])),k;throw new Rr(`Promise`)}function Ma(e,t,n){let r=e.base.refs.get(n.i);if(r)return ma(e,n,n.i,22),r.f(N(e,t,n.a[1])),k;throw new Rr(`Promise`)}function Na(e,t,n){return N(e,t,n.a[0]),ei(N(e,t,n.a[1]))}function Pa(e,t,n){return N(e,t,n.a[0]),ci(N(e,t,n.a[1]))}function Fa(e,t,n){let r=aa(e,n.i,ai());pa(e,n.i,31);let i=n.a,a=i.length;if(a)for(let n=0;n<a;n++)N(e,t,i[n]);return r}function Ia(e,t,n){let r=e.base.refs.get(n.i);if(r)return ma(e,n,n.i,31),r.next(N(e,t,n.f)),k;throw new Rr(`Stream`)}function La(e,t,n){let r=e.base.refs.get(n.i);if(r)return ma(e,n,n.i,31),r.throw(N(e,t,n.f)),k;throw new Rr(`Stream`)}function Ra(e,t,n){let r=e.base.refs.get(n.i);if(r)return ma(e,n,n.i,31),r.return(N(e,t,n.f)),k;throw new Rr(`Stream`)}function za(e,t,n){return N(e,t,n.f),k}function Ba(e,t,n){return N(e,t,n.a[1]),k}function Va(e,t,n){let r=aa(e,n.i,Zr([],n.s,n.l));for(let i=0,a=n.a.length;i<a;i++)r.v[i]=N(e,t,n.a[i]);return r}function N(e,t,n){if(t>e.base.depthLimit)throw new Ur(e.base.depthLimit);switch(t+=1,n.t){case 2:return oa(n,An,n.s);case 0:return Number(n.s);case 1:return Gn(String(n.s));case 3:if(String(n.s).length>Yi)throw new Hr(n);return BigInt(n.s);case 4:return e.base.refs.get(n.i);case 18:return sa(e,n);case 9:return ca(e,t,n);case 10:case 11:return ga(e,t,n);case 5:return _a(e,n);case 6:return va(e,n);case 7:return ya(e,t,n);case 8:return ba(e,t,n);
12case 19:return xa(e,n);case 16:case 15:return Sa(e,t,n);case 20:return Ca(e,t,n);case 14:return Ta(e,t,n);case 13:return Ea(e,t,n);case 12:return Da(e,t,n);case 17:return oa(n,kn,n.s);case 21:return Oa(e,t,n);case 25:return ka(e,t,n);case 22:return Aa(e,n);case 23:return ja(e,t,n);case 24:return Ma(e,t,n);case 28:return Na(e,t,n);case 30:return Pa(e,t,n);case 31:return Fa(e,t,n);case 32:return Ia(e,t,n);case 33:return La(e,t,n);case 34:return Ra(e,t,n);case 27:return za(e,t,n);case 29:return Ba(e,t,n);case 35:return Va(e,t,n);default:throw new Ir(n)}}function Ha(e,t){try{return N(e,0,t)}catch(e){throw new Nr(e)}}var Ua=(()=>T).toString();/=>/.test(Ua);function Wa(e,t){return Ha(ea({plugins:Ki(t.plugins),refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit}),e)}async function Ga(e,t={}){let n=Si(1,{plugins:Ki(t.plugins),disabledFeatures:t.disabledFeatures});return{t:await M(n,e),f:n.base.features,m:Array.from(n.base.marked)}}function Ka(e){return e}function qa(e){return Wi({tag:`$TSR/t/`+e.key,test:e.test,parse:{sync(t,n,r){return{v:n.parse(e.toSerializable(t))}},async async(t,n,r){return{v:await n.parse(e.toSerializable(t))}},stream(t,n,r){return{v:n.parse(e.toSerializable(t))}}},serialize:void 0,deserialize(t,n,r){return e.fromSerializable(n.deserialize(t.v))}})}var Ja=class{constructor(e,t){this.stream=e,this.hint=t?.hint??`binary`}},Ya=globalThis.Buffer,Xa=!!Ya&&typeof Ya.from==`function`;function Za(e){if(e.length===0)return``;if(Xa)return Ya.from(e).toString(`base64`);let t=32768,n=[];for(let r=0;r<e.length;r+=t){let i=e.subarray(r,r+t);n.push(String.fromCharCode.apply(null,i))}return btoa(n.join(``))}function Qa(e){if(e.length===0)return new Uint8Array;
12if(Xa){let t=Ya.from(e,`base64`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var $a=Object.create(null),eo=Object.create(null),to=e=>new ReadableStream({start(t){e.on({next(e){try{t.enqueue(Qa(e))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),no=new TextEncoder,ro=e=>new ReadableStream({start(t){e.on({next(e){try{typeof e==`string`?t.enqueue(no.encode(e)):t.enqueue(Qa(e.$b64))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),io=`(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))`,ao=`(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})`;function oo(e){let t=ai(),n=e.getReader();return(async()=>{try{for(;;){let{done:e,value:r}=await n.read();if(e){t.return(void 0);break}t.next(Za(r))}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}function so(e){let t=ai(),n=e.getReader(),r=new TextDecoder(`utf-8`,{fatal:!0});return(async()=>{try{for(;;){let{done:e,value:i}=await n.read();if(e){try{let e=r.decode();e.length>0&&t.next(e)}catch{}t.return(void 0);break}try{let e=r.decode(i,{stream:!0});e.length>0&&t.next(e)}catch{t.next({$b64:Za(i)})}}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}var co=Wi({tag:`tss/RawStream`,extends:[Wi({tag:`tss/RawStreamFactory`,test(e){return e===$a},parse:{sync(e,t,n){return{}},async async(e,t,n){return{}},stream(e,t,n){return{}}},serialize(e,t,n){return io},deserialize(e,t,n){return $a}}),Wi({tag:`tss/RawStreamFactoryText`,test(e){return e===eo},parse:{sync(e,t,n){return{}},async async(e,t,n){return{}},stream(e,t,n){return{}}},serialize(e,t,n){return ao},deserialize(e,t,n){return eo}})],test(e){return e instanceof Ja},parse:{sync(e,t,n){let r=e.hint===`text`?eo:$a;return{hint:t.parse(e.hint),factory:t.parse(r),stream:t.parse(ai())}},async async(e,t,n){let r=e.hint===`text`?eo:$a,i=e.hint===`text`?so(e.stream):oo(e.stream);return{hint:await t.parse(e.hint),factory:await t.parse(r),stream:await t.parse(i)}},stream(e,t,n){let r=e.hint===`text`?eo:$a,i=e.hint===`text`?so(e.stream):oo(e.stream);return{hint:t.parse(e.hint),factory:t.parse(r),stream:t.parse(i)}}},serialize(e,t,n){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t,n){let r=t.deserialize(e.stream);return t.deserialize(e.hint)===`text`?ro(r):to(r)}});function lo(e){return Wi({tag:`tss/RawStream`,test:()=>!1,parse:{},serialize(){throw Error(`RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.`)},deserialize(t,n,r){return e(typeof n?.deserialize==`function`?n.deserialize(t.streamId):t.streamId)}})}var uo=Wi({tag:`$TSR/Error`,test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return`new Error(`+t.serialize(e.message)+`)`},deserialize(e,t){return Error(t.deserialize(e.message))}}),fo={},po=e=>new ReadableStream({start:t=>{e.on({next:e=>{try{t.enqueue(e)}catch{}},throw:e=>{t.error(e)},return:()=>{try{t.close()}catch{}}})}}),mo=Wi({tag:`seroval-plugins/web/ReadableStreamFactory`,test(e){return e===fo},parse:{sync(){return fo},async async(){return await Promise.resolve(fo)},stream(){return fo}},serialize(){return po.toString()},deserialize(){return fo}});function ho(e){let t=ai(),n=e.getReader();async function r(){try{let e=await n.read();e.done?t.return(e.value):(t.next(e.value),await r())}catch(e){t.throw(e)}}return r().catch(()=>{}),t}var go=[uo,co,Wi({tag:`seroval/plugins/web/ReadableStream`,extends:[mo],test(e){return typeof ReadableStream>`u`?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(fo),stream:t.parse(ai())}},async async(e,t){return{factory:await t.parse(fo),stream:await t.parse(ho(e))}},stream(e,t){return{factory:t.parse(fo),stream:t.parse(ho(e))}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){return po(t.deserialize(e.stream))}})];function _o(){return[...(Re()?.serializationAdapters)?.map(qa)??[],...go]}var vo=new TextDecoder,yo=new Uint8Array,bo=16*1024*1024,P=32*1024*1024,xo=1024,So=1e5;function Co(e){let t=new Map,n=new Map,r=new Set,i=!1,a=null,o=0,s,c=new ReadableStream({start(e){s=e},cancel(){i=!0;try{a?.cancel()}catch{}
12t.forEach(e=>{try{e.error(Error(`Framed response cancelled`))}catch{}}),t.clear(),n.clear(),r.clear()}});function l(e){let i=n.get(e);if(i)return i;if(r.has(e))return new ReadableStream({start(e){e.close()}});if(n.size>=xo)throw Error(`Too many raw streams in framed response (max ${xo})`);let a=new ReadableStream({start(n){t.set(e,n)},cancel(){r.add(e),t.delete(e),n.delete(e)}});return n.set(e,a),a}function u(e){return l(e),t.get(e)}return(async()=>{let n=e.getReader();a=n;let c=[],l=0;function d(){if(l<9)return null;let e=c[0];if(e.length>=9)return{type:e[0],streamId:(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0,length:(e[5]<<24|e[6]<<16|e[7]<<8|e[8])>>>0};let t=new Uint8Array(9),n=0,r=9;for(let e=0;e<c.length&&r>0;e++){let i=c[e],a=Math.min(i.length,r);t.set(i.subarray(0,a),n),n+=a,r-=a}return{type:t[0],streamId:(t[1]<<24|t[2]<<16|t[3]<<8|t[4])>>>0,length:(t[5]<<24|t[6]<<16|t[7]<<8|t[8])>>>0}}function f(e){if(e===0)return yo;let t=new Uint8Array(e),n=0,r=e;for(;r>0&&c.length>0;){let e=c[0];if(!e)break;let i=Math.min(e.length,r);t.set(e.subarray(0,i),n),n+=i,r-=i,i===e.length?c.shift():c[0]=e.subarray(i)}return l-=e,t}try{for(;;){let{done:e,value:a}=await n.read();if(i||e)break;if(a){if(l+a.length>P)throw Error(`Framed response buffer exceeded ${P} bytes`);for(c.push(a),l+=a.length;;){let e=d();if(!e)break;let{type:n,streamId:i,length:a}=e;if(n!==Pe.JSON&&n!==Pe.CHUNK&&n!==Pe.END&&n!==Pe.ERROR)throw Error(`Unknown frame type: ${n}`);if(n===Pe.JSON){if(i!==0)throw Error(`Invalid JSON frame streamId (expected 0)`)}else if(i===0)throw Error(`Invalid raw frame streamId (expected non-zero)`);if(a>bo)throw Error(`Frame payload too large: ${a} bytes (max ${bo})`);let c=9+a;if(l<c)break;if(++o>So)throw Error(`Too many frames in framed response (max ${So})`);f(9);let p=f(a);switch(n){case Pe.JSON:try{s.enqueue(vo.decode(p))}catch{}break;case Pe.CHUNK:{let e=u(i);e&&e.enqueue(p);break}case Pe.END:{let e=u(i);if(r.add(i),e){try{e.close()}catch{}t.delete(i)}break}case Pe.ERROR:{let e=u(i);if(r.add(i),e){let n=vo.decode(p);e.error(Error(n)),t.delete(i)}break}}}}}if(l!==0)throw Error(`Incomplete frame at end of framed response`);try{s.close()}catch{}t.forEach(e=>{try{e.close()}catch{}}),t.clear()}catch(e){try{s.error(e)}catch{}t.forEach(t=>{try{t.error(e)}catch{}}),t.clear()}finally{try{n.releaseLock()}catch{}a=null}})(),{getOrCreateStream:l,jsonChunks:c}}var wo=null;async function To(e){e.length>0&&await Promise.allSettled(e)}var Eo=Object.prototype.hasOwnProperty;function Do(e){for(let t in e)if(Eo.call(e,t))return!0;return!1}async function Oo(e,t,n){wo||=_o();let r=t[0],i=r.fetch??n,a=r.data instanceof FormData?`formData`:`payload`,o=r.headers?new Headers(r.headers):new Headers;if(o.set(`x-tsr-serverFn`,`true`),a===`payload`&&o.set(`accept`,`${Ne}, application/x-ndjson, application/json`),r.method===`GET`){if(a===`formData`)throw Error(`FormData is not supported with GET requests`);let t=await ko(r);if(t!==void 0){let n=ze({payload:t});e.includes(`?`)?e+=`&${n}`:e+=`?${n}`}}let s;if(r.method===`POST`){let e=await jo(r);e?.contentType&&o.set(`content-type`,e.contentType),s=e?.body}return await Mo(async()=>i(e,{method:r.method,headers:o,signal:r.signal,body:s}))}async function ko(e){let t=!1,n={};if(e.data!==void 0&&(t=!0,n.data=e.data),e.context&&Do(e.context)&&(t=!0,n.context=e.context),t)return Ao(n)}async function Ao(e){return JSON.stringify(await Promise.resolve(Ga(e,{plugins:wo})))}async function jo(e){if(e.data instanceof FormData){let t;return e.context&&Do(e.context)&&(t=await Ao(e.context)),t!==void 0&&e.data.set(Ae,t),{body:e.data}}let t=await ko(e);if(t)return{body:t,contentType:`application/json`}}async function Mo(e){let n;try{n=await e()}catch(e){if(e instanceof Response)n=e;else throw console.log(e),e}if(n.headers.get(`x-tss-raw`)===`true`)return n;let r=n.headers.get(`content-type`);if(r||t(),n.headers.get(`x-tss-serialized`)){let e;if(r.includes(`application/x-tss-framed`)){if(Le(r),!n.body)throw Error(`No response body for framed response`);let{getOrCreateStream:t,jsonChunks:i}=Co(n.body),a=[lo(t),...wo||[]],o=new Map;e=await No({jsonStream:i,onMessage:e=>Wa(e,{refs:o,plugins:a}),onError(e,t){console.error(e,t)}})}else if(r.includes(`application/json`)){let t=await n.json(),r=[];try{e=Wa(t,{plugins:wo})}finally{}await To(r)}if(e||t(),e instanceof Error)throw e;return e}if(r.includes(`application/json`)){let e=await n.json(),t=O(e);if(t)throw t;if(D(e))throw e;return e}if(!n.ok)throw Error(await n.text());return n}async function No({jsonStream:e,onMessage:t,onError:n}){let r=e.getReader(),{value:i,done:a}=await r.read();if(a||!i)throw Error(`Stream ended before first object`);let o=JSON.parse(i),s=!1,c=(async()=>{try{for(;;){let{value:e,done:i}=await r.read();if(i)break;if(e)try{let n=[];try{t(JSON.parse(e))}finally{}await To(n)}catch(t){n?.(`Invalid JSON: ${e}`,t)}}}catch(e){s||n?.(`Stream processing error:`,e)}})(),l,u=[];try{l=t(o)}catch(e){throw s=!0,r.cancel().catch(()=>{}),e}return await To(u),Promise.resolve(l).catch(()=>{s=!0,r.cancel().catch(()=>{})}),c.finally(()=>{try{r.releaseLock()}catch{}}),l}function Po(e){let t=`/_serverFn/`+e;return Object.assign((...e)=>{let n=Re()?.serverFns?.fetch;return Oo(t,e,n??fetch)},{url:t,serverFnMeta:{id:e},[je]:!0})}var Fo=Ka({key:`$TSS/serverfn`,test:e=>typeof e!=`function`||!(je in e)?!1:!!e[je],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>Po(e)});function Io(e){if(Array.isArray(e))return e.flatMap(e=>Io(e));if(typeof e!=`string`)return[];let t=[],n=0,r,i,a,o,s,c=()=>{for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length},l=()=>(i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`);for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.slice(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.slice(r))}return t}function Lo(e){return e instanceof Headers?e:Array.isArray(e)||typeof e==`object`?new Headers(e):null}function Ro(...e){return e.reduce((e,t)=>
12{let n=Lo(t);if(!n)return e;for(let[t,r]of n.entries())t===`set-cookie`?Io(r).forEach(t=>e.append(`set-cookie`,t)):e.set(t,r);return e},new Headers)}function zo(e){return e.replaceAll(`\0`,`/`).replaceAll(`�`,`/`)}function Bo(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e,t.g!==void 0&&(e.globalNotFound=t.g)}async function Vo(e){window.$_TSR||t();let n=e.options.serializationAdapters;if(n?.length){let e=new Map;n.forEach(t=>{e.set(t.key,t.fromSerializable)}),window.$_TSR.t=e,window.$_TSR.buffer.forEach(e=>e())}window.$_TSR.initialized=!0,window.$_TSR.router||t();let r=window.$_TSR.router;r.matches.forEach(e=>{e.i=zo(e.i)}),r.lastMatchId&&=zo(r.lastMatchId);let{manifest:i,dehydratedData:a,lastMatchId:o}=r;e.ssr={manifest:i};let s=document.querySelector(`meta[property="csp-nonce"]`)?.content;e.options.ssr={nonce:s},await e.options.hydrate?.(a);let c=e.matchRoutes(e.stores.location.get()),u=Promise.all(c.map(t=>e.loadRouteChunk(e.looseRoutesById[t.routeId])));function d(t){let n=e.looseRoutesById[t.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(n){let r=l();t._nonReactive.minPendingPromise=r,t._forcePending=!0,setTimeout(()=>{r.resolve(),e.updateMatch(t.id,e=>(e._nonReactive.minPendingPromise=void 0,{...e,_forcePending:void 0}))},n)}}function f(t){let n=e.looseRoutesById[t.routeId];n&&(n.options.ssr=t.ssr)}let p;c.forEach(e=>{let t=r.matches.find(t=>t.i===e.id);if(!t){e._nonReactive.dehydrated=!1,e.ssr=!1,f(e);return}Bo(e,t),f(e),e._nonReactive.dehydrated=e.ssr!==!1,(e.ssr===`data-only`||e.ssr===!1)&&p===void 0&&(p=e.index,d(e))}),e.stores.setMatches(c);let m=e.stores.matches.get(),h=e.stores.location.get();await Promise.all(m.map(async t=>{try{let n=e.looseRoutesById[t.routeId],r=m[t.index-1]?.context??e.options.context;if(n.options.context){let i={deps:t.loaderDeps,params:t.params,context:r??{},location:h,navigate:t=>e.navigate({...t,_fromLocation:h}),buildLocation:e.buildLocation,cause:t.cause,abortController:t.abortController,preload:!1,matches:c,routeId:n.id};t.__routeContext=n.options.context(i)??void 0}t.context={...r,...t.__routeContext,...t.__beforeLoadContext};let i={ssr:e.options.ssr,matches:m,match:t,params:t.params,loaderData:t.loaderData},a=await n.options.head?.(i),o=await n.options.scripts?.(i);t.meta=a?.meta,t.links=a?.links,t.headScripts=a?.scripts,t.styles=a?.styles,t.scripts=o}catch(e){if(D(e))t.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${t.routeId}`,e);else throw t.error=e,console.error(`Error during hydration for route ${t.routeId}:`,e),e}}));let g=c[c.length-1].id!==o;if(!c.some(e=>e.ssr===!1)&&!g)return c.forEach(e=>{e._nonReactive.dehydrated=void 0}),e.stores.resolvedLocation.set(e.stores.location.get()),u;let _=Promise.resolve().then(()=>e.load()).catch(e=>{console.error(`Error during router hydration:`,e)});if(g){let n=c[1];n||t(),d(n),n._displayPending=!0,n._nonReactive.displayPendingPromise=_,_.then(()=>{e.batch(()=>{e.stores.status.get()===`pending`&&(e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())),e.updateMatch(n.id,e=>({...e,_displayPending:void 0,displayPendingPromise:void 0}))})})}return u}var F=a(e(),1),I=i();function Ho({promise:e}){if(Ce)return Ce(e);let t=an(e);if(t[rn].status===`pending`)throw t;if(t[rn].status===`error`)throw t[rn].error;return t[rn].data}function Uo(e){let t=(0,I.jsx)(Wo,{...e});return e.fallback?(0,I.jsx)(F.Suspense,{fallback:e.fallback,children:t}):t}function Wo(e){let t=Ho(e);return e.children(t)}function Go(e){let t=e.errorComponent??qo;return(0,I.jsx)(Ko,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?F.createElement(t,{error:n,reset:r}):e.children})}var Ko=class extends F.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function qo({error:e}){let[t,n]=F.useState(!1);return(0,I.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,I.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,I.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,I.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,I.jsx)(`div`,{children:(0,I.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`}
12,children:e.message?(0,I.jsx)(`code`,{children:e.message}):null})}):null]})}var Jo=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Jo||{});function Yo({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Xo(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Zo=[],Qo=0,{link:$o,unlink:es,propagate:ts,checkDirty:ns,shallowPropagate:rs}=Yo({update(e){return e._update()},notify(e){Zo[as++]=e,e.flags&=~Jo.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Jo.Mutable|Jo.Dirty,ls(e))}}),is=0,as=0,os,ss=0;function cs(e){try{++ss,e()}finally{--ss||us()}}function ls(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=es(n,e)}function us(){if(!(ss>0)){for(;is<as;){let e=Zo[is];Zo[is++]=void 0,e.notify()}is=0,as=0}}function ds(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Jo.None:Jo.Mutable,get(){return os!==void 0&&$o(i,os,Qo),i._snapshot},subscribe(e){let t=Xo(e),n={current:!1},r=fs(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=os,o=t?.compare??Object.is;if(n)os=i,++Qo,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Jo.Mutable|Jo.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{os=a,n&&(i.flags&=~Jo.RecursedCheck),ls(i)}}};return n?(i.flags=Jo.Mutable|Jo.Dirty,i.get=function(){let e=i.flags;if(e&Jo.Dirty||e&Jo.Pending&&ns(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&rs(e)}}else e&Jo.Pending&&(i.flags=e&~Jo.Pending);return os!==void 0&&$o(i,os,Qo),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ts(e),rs(e),us())}},i}function fs(e){let t=()=>{let t=os;os=n,++Qo,n.depsTail=void 0,n.flags=Jo.Watching|Jo.RecursedCheck;try{return e()}finally{os=t,n.flags&=~Jo.RecursedCheck,ls(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Jo.Watching|Jo.RecursedCheck,notify(){let e=this.flags;e&Jo.Dirty||e&Jo.Pending&&ns(this.deps,this)?t():this.flags=Jo.Watching},stop(){this.flags=Jo.None,this.depsTail=void 0,ls(this)}};return t(),n}var ps={get(){},subscribe(){return{unsubscribe(){}}}};function ms(e,t){let n=F.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=f(n.current,i):i}}function hs(e){let n=o(),r=F.useContext(e.from?ye:_e),i=e.from?n.stores.getRouteMatchStore(e.from):n.stores.matchStores.get(r),a=ms(e,n),s=w(i??ps,e=>e?a(e):ps);if(s!==ps)return s;(e.shouldThrow??!0)&&t()}function gs(e){return hs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function _s(e){let{select:t,...n}=e;return hs({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function vs(e){return hs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function ys(e){return hs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function bs(e){let t=o();return F.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function xs(e){return hs({...e,select:t=>e.select?e.select(t.context):t.context})}var Ss=class extends fn{constructor(e){super(e),this.useMatch=e=>hs({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>xs({...e,from:this.id}),this.useSearch=e=>ys({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>vs({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>_s({...e,from:this.id}),this.useLoaderData=e=>gs({...e,from:this.id}),this.useNavigate=()=>bs({from:this.fullPath}),this.Link=F.forwardRef((e,t)=>
12(0,I.jsx)(be,{ref:t,from:this.fullPath,...e}))}};function Cs(e){return new Ss(e)}function ws(){return e=>Es(e)}var Ts=class extends pn{constructor(e){super(e),this.useMatch=e=>hs({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>xs({...e,from:this.id}),this.useSearch=e=>ys({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>vs({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>_s({...e,from:this.id}),this.useLoaderData=e=>gs({...e,from:this.id}),this.useNavigate=()=>bs({from:this.fullPath}),this.Link=F.forwardRef((e,t)=>(0,I.jsx)(be,{ref:t,from:this.fullPath,...e}))}};function Es(e){return new Ts(e)}function Ds(e){return new Os(e,{silent:!0}).createRoute}var Os=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Cs(e);return t.isRoot=!1,t},this.silent=t?.silent}};function ks(e,t){let n,r,i,a,o=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,ie(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),s=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(Ce)Ce(o());else throw o();return F.createElement(r,e)};return s.preload=o,s}function As(e){let t=o(),n=`not-found-${w(t.stores.location,e=>e.pathname)}-${w(t.stores.status,e=>e)}`;return(0,I.jsx)(Go,{getResetKey:()=>n,onCatch:(t,n)=>{if(D(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(D(t))return e.fallback?.(t);throw t},children:e.children})}function js(){return(0,I.jsx)(`p`,{children:`Not Found`})}function Ms(e){return(0,I.jsx)(I.Fragment,{children:e.children})}function Ns(e,t,n){return t.options.notFoundComponent?(0,I.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,I.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,I.jsx)(js,{})}var Ps=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,Fs=(e,t)=>e[0]===t[0]&&e[1]===t[1],Is=F.memo(function({matchId:e}){let n=o(),r=n.stores.matchStores.get(e);r||t();let i=w(n.stores.loadedAt,e=>e),a=w(r,e=>e,Ps);return(0,I.jsx)(Ls,{router:n,matchId:e,resetKey:i,matchState:F.useMemo(()=>{let e=a.routeId,t=n.routesById[e].parentRoute?.id;return{routeId:e,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:t}},[a._displayPending,a.routeId,a.ssr,n.routesById])})});function Ls({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,I.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?F.Suspense:Ms,f=s?Go:Ms,p=l?As:Ms;return(0,I.jsxs)(i.isRoot?i.options.shellComponent??Ms:Ms,{children:[(0,I.jsx)(_e.Provider,{value:t,children:(0,I.jsx)(d,{fallback:o,children:(0,I.jsx)(f,{getResetKey:()=>n,errorComponent:s||qo,onCatch:(e,t)=>{if(D(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,I.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return F.createElement(l,e)},children:u||r._displayPending?(0,I.jsx)(se,{fallback:o,children:(0,I.jsx)(zs,{matchId:t})}):(0,I.jsx)(zs,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Rs,{}),(e.options.scrollRestoration,null)]}):null]})}function Rs(){let e=o(),t=F.useRef();return Se(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...jt(e.stores.location.get(),r??n)}),t.current=n},[w(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var zs=F.memo(function({matchId:e}){let n=o(),r=(e,t)=>n.getMatch(e.id)?._nonReactive[t]??e._nonReactive[t],i=n.stores.matchStores.get(e);i||t();let a=w(i,e=>e),s=a.routeId,c=n.routesById[s],u=F.useMemo(()=>{let e=(n.routesById[s].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:s,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return e?JSON.stringify(e):void 0},[s,a.loaderDeps,a._strictParams,a._strictSearch,n.options.defaultRemountDeps,n.routesById]),d=F.useMemo(()=>{let e=c.options.component??n.options.defaultComponent;return e?(0,I.jsx)(e,{},u):(0,I.jsx)(Bs,{})},[u,c.options.component,n.options.defaultComponent]);if(a._displayPending)throw r(a,`displayPendingPromise`);if(a._forcePending)throw r(a,`minPendingPromise`);
12if(a.status===`pending`){let e=c.options.pendingMinMs??n.options.defaultPendingMinMs;if(e){let t=n.getMatch(a.id);if(t&&!t._nonReactive.minPendingPromise){let n=l();t._nonReactive.minPendingPromise=n,setTimeout(()=>{n.resolve(),t._nonReactive.minPendingPromise=void 0},e)}}throw r(a,`loadPromise`)}if(a.status===`notFound`)return D(a.error)||t(),Ns(n,c,a.error);if(a.status===`redirected`)throw ge(a.error)||t(),r(a,`loadPromise`);if(a.status===`error`)throw a.error;return d}),Bs=F.memo(function(){let e=o(),n=F.useContext(_e),r,i=!1,a;{let t=n?e.stores.matchStores.get(n):void 0;[r,i]=w(t,e=>[e?.routeId,e?.globalNotFound??!1],Fs),a=w(e.stores.matchesId,e=>e[e.findIndex(e=>e===n)+1])}let s=r?e.routesById[r]:void 0,c=e.options.defaultPendingComponent?(0,I.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return s||t(),Ns(e,s,void 0);if(!a)return null;let l=(0,I.jsx)(Is,{matchId:a});return r===`__root__`?(0,I.jsx)(F.Suspense,{fallback:c,children:l}):l});function Vs(){let e=o(),t=F.useRef({router:e,mounted:!1}),[n,r]=F.useState(!1),i=w(e.stores.isLoading,e=>e),a=w(e.stores.hasPending,e=>e),s=xe(i),c=i||n||a,l=xe(c),u=i||a,d=xe(u);return e.startTransition=e=>{r(!0),F.startTransition(()=>{e(),r(!1)})},F.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ce(e.latestLocation.publicHref)!==ce(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),Se(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),Se(()=>{s&&!i&&e.emit({type:`onLoad`,...jt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[s,e,i]),Se(()=>{d&&!u&&e.emit({type:`onBeforeRouteMount`,...jt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[u,d,e]),Se(()=>{if(l&&!c){let t=jt(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),cs(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[c,l,e]),null}function Hs(){let e=o(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,I.jsx)(t,{}):null,r=(0,I.jsxs)(typeof document<`u`&&e.ssr?Ms:F.Suspense,{fallback:n,children:[(0,I.jsx)(Vs,{}),(0,I.jsx)(Us,{})]});return e.options.InnerWrap?(0,I.jsx)(e.options.InnerWrap,{children:r}):r}function Us(){let e=o(),t=w(e.stores.firstId,e=>e),n=w(e.stores.loadedAt,e=>e),r=t?(0,I.jsx)(Is,{matchId:t}):null;return(0,I.jsx)(_e.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,I.jsx)(Go,{getResetKey:()=>n,errorComponent:qo,onCatch:void 0,children:r})})}var Ws=e=>({createMutableStore:ds,createReadonlyStore:ds,batch:cs}),Gs=e=>new Ks(e),Ks=class extends Nt{constructor(e){super(e,Ws)}};function qs({router:e,children:t,...r}){ae(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});let i=(0,I.jsx)(n.Provider,{value:e,children:t});return e.options.Wrap?(0,I.jsx)(e.options.Wrap,{children:i}):i}function Js({router:e,...t}){return(0,I.jsx)(qs,{router:e,...t,children:(0,I.jsx)(Hs,{})})}function Ys(e,t){if(t)for(let[n,r]of Object.entries(t))n!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&e.setAttribute(n,typeof r==`boolean`?``:String(r))}function Xs(e){let{attrs:t,children:n,nonce:r,preventScriptHoist:i}=e;switch(e.tag){case`title`:return(0,I.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,I.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,I.jsx)(`link`,{...t,precedence:t?.precedence??(t?.rel===`stylesheet`?`default`:void 0),nonce:r,suppressHydrationWarning:!0});case`style`:return e.inlineCss,(0,I.jsx)(`style`,{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case`script`:return(0,I.jsx)(Zs,{attrs:t,preventScriptHoist:i,children:n});default:return null}}function Zs({attrs:e,children:t,preventScriptHoist:n}){o();let r=le(),i=typeof e?.type==`string`&&e.type!==``&&e.type!==`text/javascript`&&e.type!==`module`;if(F.useEffect(()=>{if(!i){if(e?.src){let t=(()=>{try{let t=document.baseURI||window.location.href;return new URL(e.src,t).href}catch{return e.src}})();for(let e of document.querySelectorAll(`script[src]`))if(e.src===t)return;let n=document.createElement(`script`);return Ys(n,e),document.head.appendChild(n),()=>n.remove()}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;for(let e of document.querySelectorAll(`script:not([src])`)){if(!(e instanceof HTMLScriptElement))continue;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;if(e.textContent===t&&i===n&&a===r)return}let i=document.createElement(`script`);return i.textContent=t,Ys(i,e),document.head.appendChild(i),()=>i.remove()}}},[e,t,i]),i&&typeof t==`string`)return(0,I.jsx)(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!r){if(e?.src)return(0,I.jsx)(`script`,{...e,suppressHydrationWarning:!0});if(typeof t==`string`)return(0,I.jsx)(`script`,{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var Qs=e=>
12{let t=o(),n=t.options.ssr?.nonce,r=w(t.stores.matches,e=>e.map(e=>e.meta).filter(e=>e!==void 0),v),i=F.useMemo(()=>{let e=[],t={},i;for(let a=r.length-1;a>=0;a--){let o=r[a];for(let r=o.length-1;r>=0;r--){let a=o[r];if(a)if(a.title)i||={tag:`title`,children:a.title};else if(`script:ld+json`in a)try{let t=JSON.stringify(a[`script:ld+json`]);e.push({tag:`script`,attrs:{type:`application/ld+json`},children:u(t)})}catch{}else{let r=a.name??a.property;if(r){if(t[r])continue;t[r]=!0}e.push({tag:`meta`,attrs:{...a,nonce:n}})}}}return i&&e.push(i),n&&e.push({tag:`meta`,attrs:{property:`csp-nonce`,content:n}}),e.reverse(),e},[r,n]),a=w(t.stores.matches,e=>e.flatMap(e=>e.links??[]).filter(e=>e!==void 0).map(e=>({tag:`link`,attrs:{...e,nonce:n}})),v),s=w(t.stores.matches,r=>{let i=t.ssr?.manifest,a=[];return i?(r.forEach(t=>{i.routes[t.routeId]?.css?.forEach(t=>{let r=dn(t);a.push({tag:`link`,attrs:{rel:`stylesheet`,...r,crossOrigin:on(e,`stylesheet`)??r.crossOrigin,suppressHydrationWarning:!0,nonce:n}})})}),i.inlineStyle&&a.push({tag:`style`,attrs:{...i.inlineStyle.attrs,nonce:n},children:i.inlineStyle.children,inlineCss:!0}),a):a},v),c=w(t.stores.matches,r=>{let i=[],a=t.ssr?.manifest;return a&&r.forEach(t=>{a.routes[t.routeId]?.preloads?.forEach(t=>{i.push({tag:`link`,attrs:{...cn(a,t,e),nonce:n}})})}),i},v),l=w(t.stores.matches,e=>e.flatMap(e=>e.styles??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`style`,attrs:{...t,nonce:n},children:e})),v),d=w(t.stores.matches,e=>e.flatMap(e=>e.headScripts??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`script`,attrs:{...t,nonce:n},children:e})),v),f=[];return un(f,i),f.push(...c),un(f,a),f.push(...s),un(f,l),un(f,d),f};function $s(e){let t=Qs(e.assetCrossOrigin),n=o().options.ssr?.nonce;return(0,I.jsx)(I.Fragment,{children:t.map(e=>(0,F.createElement)(Xs,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}var ec=()=>{let e=o(),t=e.options.ssr?.nonce,n=n=>{let r=[],i=e.ssr?.manifest;if(!i)return[];for(let e of n){let n=i.routes[e.routeId]?.scripts;if(n)for(let e of n)r.push({tag:`script`,attrs:{...e.attrs,nonce:t},children:e.children,...typeof e.attrs?.src==`string`?{preventScriptHoist:!0}:{}})}return r},r=e=>e.map(e=>e.scripts).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`script`,attrs:{...n,suppressHydrationWarning:!0,nonce:t},children:e})),i=w(e.stores.matches,n,v);return tc(e,w(e.stores.matches,r,v),i)};function tc(e,t,n){let r=[...t,...n];return(0,I.jsx)(I.Fragment,{children:r.map((e,t)=>(0,F.createElement)(Xs,{...e,key:`tsr-scripts-${e.tag}-${t}`}))})}function nc(e){let t=o();return F.useCallback(async(...n)=>{try{let t=await e(...n);if(ge(t))throw t;return t}catch(e){if(ge(e))return e.options._fromLocation=t.stores.location.get(),t.navigate(t.resolveRedirect(e).options);throw e}},[t,e])}function rc(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function ic(e,t){let n=Object.create(null);if(e)for(let t of Object.keys(e))rc(t)&&(n[t]=e[t]);if(t&&typeof t==`object`)for(let e of Object.keys(t))rc(e)&&(n[e]=t[e]);return n}function ac(e){if(!e)return Object.create(null);let t=Object.create(null);for(let n of Object.keys(e))rc(n)&&(t[n]=e[n]);return t}var oc=()=>{throw Error(`createServerOnlyFn() functions can only be called on the server!`)},sc=(e,t)=>{let n=t||e||{};n.method===void 0&&(n.method=`GET`);let r=e=>sc(void 0,{...n,validator:e,inputValidator:e});return Object.assign(e=>sc(void 0,{...n,...e}),{options:n,middleware:e=>{let t=[...n.middleware||[]];e.map(e=>{Me in e?e.options.middleware&&t.push(...e.options.middleware):t.push(e)});let r=sc(void 0,{...n,middleware:t});return r[Me]=!0,r},validator:r,inputValidator:r,handler:(...e)=>{let[t,r]=e,i={...n,extractedFn:t,serverFn:r},a=[...i.middleware||[],dc(i)];return t.method=n.method,Object.assign(async e=>{let n=await cc(a,`client`,{...t,...i,data:e?.data,headers:e?.headers,signal:e?.signal,fetch:e?.fetch,context:ac()}),r=O(n.error);if(r)throw r;if(n.error)throw n.error;return n.result},{...t,method:n.method,__executeServer:async e=>{let n=oc(),r=n.contextAfterGlobalMiddlewares;return await cc(a,`server`,{...t,...e,serverFnMeta:t.serverFnMeta,context:ic(e.context,r),request:n.request}).then(e=>({result:e.result,error:e.error,context:e.sendContext}))}})}})};async function cc(e,t,n){let r=lc([...Re()?.functionMiddleware||[],...e]);if(t===`server`){let e=oc({throwIfNotFound:!1});e?.executedRequestMiddlewares&&(r=r.filter(t=>!e.executedRequestMiddlewares.has(t)))}let i=async e=>{let n=r.shift();if(!n)return e;try{let r=`validator`in n.options?n.options.validator:void 0;!r&&`inputValidator`in n.options&&(r=n.options.inputValidator),r&&t===`server`&&(e.data=await uc(r,e.data));let a;if(t===`client`?`client`in n.options&&(a=n.options.client):`server`in n.options&&(a=n.options.server),a){let t=async(t={})=>{let n=await i({...e,...t,context:ic(e.context,t.context),sendContext:ic(e.sendContext,t.sendContext),headers:Ro(e.headers,t.headers),_callSiteFetch:e._callSiteFetch,fetch:e._callSiteFetch??t.fetch??e.fetch,result:t.result===void 0?t instanceof Response?t:e.result:t.result,error:t.error??e.error});if(n.error)throw n.error;return n},n=await a({...e,next:t});if(ge(n))return{...e,error:n};if(n instanceof Response)return{...e,result:n};if(!n)throw Error(`User middleware returned undefined. You must call next() or return a result in your middlewares.`);return n}return i(e)}catch(t){return{...e,error:t}}};return i({...n,headers:n.headers||{},sendContext:n.sendContext||{},context:n.context||ac(),_callSiteFetch:n.fetch})}function lc(e,t=100){let n=new Set,r=[],i=(e,a)=>{if(a>t)throw Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);
12e.forEach(e=>{e.options.middleware&&i(e.options.middleware,a+1),n.has(e)||(n.add(e),r.push(e))})};return i(e,0),r}async function uc(e,t){if(e==null)return{};if(`~standard`in e){let n=await e[`~standard`].validate(t);if(n.issues)throw Error(JSON.stringify(n.issues,void 0,2));return n.value}if(`parse`in e)return e.parse(t);if(typeof e==`function`)return e(t);throw Error(`Invalid validator type!`)}function dc(e){return{"~types":void 0,options:{inputValidator:e.validator??e.inputValidator,client:async({next:t,sendContext:n,fetch:r,...i})=>{let a={...i,context:n,fetch:r};return t(await e.extractedFn?.(a))},server:async({next:t,...n})=>{let r=await e.serverFn?.(n);return t({...n,result:r})}}}}var fc=(e,t)=>{let n={type:`request`,...t||e},r=e=>fc({},Object.assign(n,{validator:e,inputValidator:e}));return{options:n,middleware:e=>fc({},Object.assign(n,{middleware:e})),validator:r,inputValidator:r,client:e=>fc({},Object.assign(n,{client:e})),server:e=>fc({},Object.assign(n,{server:e}))}};function pc(e,t){for(let n=0,r=t.length;n<r;n++){let r=t[n];e.has(r)||(e.add(r),r.extends&&pc(e,r.extends))}}var mc=e=>({getOptions:async()=>{let t=await e();if(t.serializationAdapters){let e=new Set;pc(e,t.serializationAdapters),t.serializationAdapters=Array.from(e)}return t},createMiddleware:fc}),hc=function(){return hc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},hc.apply(this,arguments)};function gc(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 _c(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())})}function vc(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var yc=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),bc=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}}},xc=class extends bc{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},Sc=class extends bc{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},Cc=class extends bc{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},wc;(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`})(wc||={});var Tc=class{constructor(e,{headers:t={},customFetch:n,region:r=wc.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=yc(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return _c(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 xc(e)}),_=g.headers.get(`x-relay-error`);if(_&&_===`true`)throw new Sc(g);if(!g.ok)throw new Cc(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 Cc||e instanceof Sc?e.context:void 0}}finally{r&&clearTimeout(r),a&&((n=t.signal)==null||n.removeEventListener(`abort`,a))}})}},Ec=3,Dc=e=>Math.min(1e3*2**e,3e4),Oc=[520,503],kc=[`GET`,`HEAD`,`OPTIONS`],Ac=class extends
12Error{constructor(e){super(e.message),this.name=`PostgrestError`,this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function jc(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 Mc(e,t,n,r){return!(!r||n>=Ec||!kc.includes(e)||!Oc.includes(t))}var Nc=class{constructor(e){this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError??!1,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle??!1,this.shouldStripNulls=e.shouldStripNulls??!1,this.urlLengthLimit=e.urlLengthLimit??8e3,this.retryEnabled=e.retry??!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get(`Accept`)===`text/csv`)throw Error(`stripNulls() cannot be used with csv()`);return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||([`GET`,`HEAD`].includes(this.method)?this.headers.set(`Accept-Profile`,this.schema):this.headers.set(`Content-Profile`,this.schema)),this.method!==`GET`&&this.method!==`HEAD`&&this.headers.set(`Content-Type`,`application/json`),this.shouldStripNulls){let e=this.headers.get(`Accept`);e===`application/vnd.pgrst.object+json`?this.headers.set(`Accept`,`application/vnd.pgrst.object+json;nulls=stripped`):(!e||e===`application/json`)&&this.headers.set(`Accept`,`application/vnd.pgrst.array+json;nulls=stripped`)}let r=this.fetch,i=(async()=>{let e=0;for(;;){let t={};n.headers.forEach((e,n)=>{t[n]=e}),e>0&&(t[`X-Retry-Count`]=String(e));let i;try{i=await r(n.url.toString(),{method:n.method,headers:t,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal})}catch(t){if(t?.name===`AbortError`||t?.code===`ABORT_ERR`||!kc.includes(n.method))throw t;if(n.retryEnabled&&e<Ec){let t=Dc(e);e++,await jc(t,n.signal);continue}throw t}if(Mc(n.method,i.status,e,n.retryEnabled)){let t=i.headers?.get(`Retry-After`)??null,r=t===null?Dc(e):Math.max(0,parseInt(t,10)||0)*1e3;await i.text(),e++,await jc(r,n.signal);continue}return await n.processResponse(i)}})();return this.shouldThrowOnError||(i=i.catch(e=>{let t=``,n=``,r=``,i=e?.cause;if(i){let n=i?.message??``,r=i?.code??``;t=`${e?.name??`FetchError`}: ${e?.message}`,t+=`\n\nCaused by: ${i?.name??`Error`}: ${n}`,r&&(t+=` (${r})`),i?.stack&&(t+=`\n${i.stack}`)}else t=e?.stack??``;let a=this.url.toString().length;return e?.name===`AbortError`||e?.code===`ABORT_ERR`?(r=``,n=`Request was aborted (timeout or manual cancellation)`,a>this.urlLengthLimit&&(n+=`. Note: Your request URL is ${a} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(i?.name===`HeadersOverflowError`||i?.code===`UND_ERR_HEADERS_OVERFLOW`)&&(r=``,n=`HTTP headers exceeded server limits (typically 16KB)`,a>this.urlLengthLimit&&(n+=`. Your request URL is ${a} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${e?.name??`FetchError`}: ${e?.message}`,details:t,hint:n,code:r},data:null,count:null,status:0,statusText:``}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,i=null,a=e.status,o=e.statusText;if(e.ok){if(t.method!==`HEAD`){let i=await e.text();if(i!==``)if(t.headers.get(`Accept`)===`text/csv`)r=i;else if(t.headers.get(`Accept`)&&t.headers.get(`Accept`)?.includes(`application/vnd.pgrst.plan+text`))r=i;else try{r=JSON.parse(i)}catch{if(n={message:i},r=null,t.shouldThrowOnError)throw new Ac({message:i,details:``,hint:``,code:``})}}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);s&&c&&c.length>1&&(i=parseInt(c[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:`PGRST116`,details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:`JSON object requested, multiple (or no) rows returned`},r=null,i=null,a=406,o=`Not Acceptable`):r=r.length===1?r[0]:null)}else{let i=await e.text();try{n=JSON.parse(i),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o=`OK`)}
vendor: 10,009 bytes, line 12
12catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new Ac(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},Pc=class extends Nc{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}},Fc=RegExp(`[,()]`),Ic=class extends Pc{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`&&Fc.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`&&Fc.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}},Lc=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 Ic({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 Ic({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 Ic({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 Ic({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 Ic({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Rc(e){"@babel/helpers - typeof";return Rc=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},Rc(e)}function zc(e,t){if(Rc(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Rc(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Bc(e){var t=zc(e,`string`);return Rc(t)==`symbol`?t:t+``}function Vc(e,t,n){return(t=Bc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hc(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 Uc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Hc(Object(n),!0).forEach(function(t){Vc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Wc=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=a;let s=r??globalThis.fetch;i!==void 0&&i>0?this.fetch=(e,t)=>{let n=new AbortController,r=setTimeout(()=>n.abort(),i),a=t?.signal;if(a){if(a.aborted)return clearTimeout(r),s(e,t);let i=()=>{clearTimeout(r),n.abort()};return a.addEventListener(`abort`,i,{once:!0}),s(e,Uc(Uc({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,Uc(Uc({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:this.fetch=s,this.retry=o}from(e){if(!e||typeof e!=`string`||e.trim()===``)throw Error(`Invalid relation name: relation must be a non-empty string.`);return new Lc(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){let a,o=new URL(`${this.url}/rpc/${e}`),s,c=e=>typeof e==`object`&&!!e&&(!Array.isArray(e)||e.some(c)),l=n&&Object.values(t).some(c);l?(a=`POST`,s=t):n||r?(a=n?`HEAD`:`GET`,Object.entries(t).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(`,`)}}`:`${t}
12`]).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 Ic({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},Gc=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}}},Kc=`realtime-js/2.110.9`,qc=`1.0.0`,Jc=`2.0.0`,Yc=Jc,Xc=1e4,Zc={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},Qc={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},$c={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},el=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)))}},L;(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`})(L||={});var tl=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=nl(i,e,t,r),n),{}):{}},nl=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?rl(i,a):il(a)},rl=(e,t)=>
vendor: 30,414 bytes, lines 12-13
12{if(e.charAt(0)===`_`)return cl(t,e.slice(1,e.length));switch(e){case L.bool:return al(t);case L.float4:case L.float8:case L.int2:case L.int4:case L.int8:case L.numeric:case L.oid:return ol(t);case L.json:case L.jsonb:return sl(t);case L.timestamp:return ll(t);case L.abstime:case L.date:case L.daterange:case L.int4range:case L.int8range:case L.money:case L.reltime:case L.text:case L.time:case L.timestamptz:case L.timetz:case L.tsrange:case L.tstzrange:return il(t);default:return il(t)}},il=e=>e,al=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},ol=e=>{if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},sl=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},cl=(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=>rl(t,e))}return e},ll=e=>typeof e==`string`?e.replace(` `,`T`):e,ul=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},dl=e=>typeof e==`function`?e:function(){return e},fl=typeof self<`u`?self:null,pl=typeof window<`u`?window:null,ml=fl||pl||globalThis,hl=`2.0.0`,gl=1e4,_l=1e3,vl=100,yl={connecting:0,open:1,closing:2,closed:3},bl={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},xl={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},Sl={longpoll:`longpoll`,websocket:`websocket`},Cl={complete:4},wl=`base64url.bearer.phx.`,Tl=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})}},El=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))}},Dl=class{constructor(e,t,n){this.state=bl.closed,this.topic=e,this.params=dl(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Tl(this,xl.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new El(()=>{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=bl.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,e=>{this.state=bl.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=bl.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=bl.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 Tl(this,xl.leave,dl({}),this.timeout).send(),this.state=bl.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(xl.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=bl.closed,this.bindings=[]}onClose(e){this.on(xl.close,e)}onError(e){return this.on(xl.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 Tl(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=bl.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(xl.close,`leave`)},n=new Tl(this,xl.leave,dl({}),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=bl.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===bl.closed}isErrored(){return this.state===bl.errored}isJoined(){return this.state===bl.joined}isJoining(){return this.state===bl.joining}isLeaving(){return this.state===bl.leaving}},Ol=class{static request(e,t,n,r,i,a,o){if(ml.XDomainRequest){let n=new ml.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,a,o)}else if(ml.XMLHttpRequest){let s=new ml.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,i,a,o)}else if(ml.fetch&&ml.AbortController)return this.fetchRequest(e,t,n,r,i,a,o);else throw Error(`No suitable XMLHttpRequest implementation found`)}static fetchRequest(e,t,n,r,i,a,o){let s={method:e,headers:n,body:r},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),s.signal=c.signal),ml.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===Cl.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)}`}},kl=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)},Al=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(wl)&&(this.authToken=atob(t[1].slice(wl.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=yl.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+Sl.websocket),`$1/`+Sl.longpoll)}endpointURL(){return Ol.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=yl.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===yl.open||this.readyState===yl.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=yl.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=kl(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+vl,r=e.slice(t,n);this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},r.join(` 13`),()=>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=yl.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=Ol.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)}},jl=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))}},Ml={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:xl.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)}}},Nl=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||gl,this.transport=t.transport||ml.WebSocket||Al,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=ml&&ml.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Ml.encode.bind(Ml),this.defaultDecoder=Ml.decode.bind(Ml),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===Al?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let r=null;pl&&pl.addEventListener&&(pl.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),pl.addEventListener(`pageshow`,e=>{r===this.connectClock&&(r=null,this.connect())}),pl.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=dl(t.params||{}),this.endPoint=`${e}/${Sl.websocket}`,this.vsn=t.vsn||hl,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new El(()=>{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&&dl(t.authToken)}getLongPollTransport(){return Al}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=Ol.appendParams(Ol.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=dl(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Al?this.connectWithFallback(Al,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 Al:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${wl}${btoa(this.authToken()).replace(/=/g,``)}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,a=this.transportName(e),o=t=>{this.log(`transport`,`falling back to ${a}...`,t),this.off([void 0,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o(`memorized`);this.fallbackTimer=setTimeout(o,t),i=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(`transport`,`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks(`open`)}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log(`transport`,`heartbeat timeout. Attempting to re-establish connection`);try{this.heartbeatCallback(`timeout`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.triggerChanError(Error(`heartbeat timeout`)),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),_l,`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===yl.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log(`transport`,`close`,e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks(`close`,e)}onConnError(e){this.hasLogger()&&this.log(`transport`,`error`,e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks(`error`,e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(xl.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case yl.connecting:return`connecting`;case yl.open:return`open`;case yl.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 Dl(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback(`disconnected`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback(`sent`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status===`ok`?`ok`:`error`,e)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`.trim(),r);for(let e=0;e<this.channels.length;e++){let o=this.channels[e];o.isMember(t,n,r,a)&&o.trigger(n,r,i,a)}this.triggerStateCallbacks(`message`,e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(t){this.log(`error`,`error in ${e} callback`,t)}})}catch(t){this.log(`error`,`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},Pl=class e{constructor(t,n){let r=Ll(n);this.presence=new jl(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=Il(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=Fl(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:Rl(t),newPresences:Fl(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:Rl(t),leftPresences:Fl(n)}}};function Fl(e){return e.metas.map(e=>{let t=Object.defineProperties({},Object.getOwnPropertyDescriptors(e));return t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t})}function Il(e){return JSON.parse(JSON.stringify(e))}function Ll(e){return e?.events&&{events:e.events}}function Rl(e){return e?.metas?Fl(e):[]}var zl;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(zl||={});var Bl=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new Pl(this.channel.channelAdapter,t)}};function Vl(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 Hl=class{constructor(e,t,n){let r=Ul(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===Zc.joined}isJoined(){return this.state===Zc.joined}isJoining(){return this.state===Zc.joining}isClosed(){return this.state===Zc.closed}isLeaving(){return this.state===Zc.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function Ul(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var Wl=/[,()"\\]/,Gl=e=>Wl.test(e)||e!==e.trim(),Kl=e=>`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`,ql=e=>{let t=e===null?`null`:String(e);
13return Gl(t)?Kl(t):t},R=e=>e===null?`null`:String(e),Jl=(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=>ql(e)).join(`,`)})`}return e===`is`?`is.${R(t)}`:`${e}.${ql(t)}`},z=class{constructor(){this.filters=[]}add(e,t,n,r=!1){let i=r?`not.`:``;return this.filters.push(`${e}=${i}${Jl(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()}},B;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(B||={});var V;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(V||={});var Yl;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(Yl||={});var Xl=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 Hl(this.socket.socketAdapter,e,this.params),this.presence=new Bl(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=ul(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&this.params.config?.broadcast?.replay)throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:n,presence:r,private:i}}=this.params,a=this.bindings.postgres_changes?.map(e=>e.filter)??[],o=!!this.bindings[V.PRESENCE]&&this.bindings[V.PRESENCE].length>0||this.params.config.presence?.enabled===!0,s={},c={broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:o}),postgres_changes:a,private:i};this.socket.accessTokenValue&&(s.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(Yl.CHANNEL_ERROR,Vl(t))}),this._onClose(()=>e?.(Yl.CLOSED)),this.updateJoinPayload(Object.assign({config:c},s)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(Yl.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=Zc.errored;let n=Object.values(t).join(`, `)||`error`;e?.(Yl.CHANNEL_ERROR,Error(n,{cause:t}))}).receive(`timeout`,()=>{e?.(Yl.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=Zc.errored,n?.(Yl.CHANNEL_ERROR,Error(`mismatch between server and client bindings for postgres changes`));return}}this.bindings.postgres_changes=a,this.state!=Zc.errored&&n&&n(Yl.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===V.PRESENCE||e===V.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
13ime-js/migrations/httpsend-server-version.md`));let c=s.statusText;try{let e=await s.json();c=e.error||e.message||c}catch{}return Promise.reject(Error(c))}async send(e,t={}){if(!this.channelAdapter.canPush()&&e.type===`broadcast`){console.warn(`Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.`);let{event:n,payload:r}=e,i={apikey:this.socket.apiKey?this.socket.apiKey:``,"Content-Type":`application/json`};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a={method:`POST`,headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:r,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,a,t.timeout??this.timeout);return await e.body?.cancel(),e.ok?`ok`:`error`}catch(e){return e instanceof Error&&e.name===`AbortError`?`timed out`:`error`}}else return new Promise(n=>{let r=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type===`broadcast`&&!this.params?.config?.broadcast?.ack&&n(`ok`),r.receive(`ok`,()=>n(`ok`)),r.receive(`error`,()=>n(`error`)),r.receive(`timeout`,()=>n(`timed out`))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive(`ok`,()=>t(`ok`)).receive(`timeout`,()=>t(`timed out`)).receive(`error`,()=>t(`error`))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),a}_on(e,t,n){let r=e.toLocaleLowerCase(),i=t?.filter;(i instanceof z||typeof i==`object`&&i&&typeof i.build==`function`)&&(t=Object.assign(Object.assign({},t),{filter:i.build()}));let a=this.channelAdapter.on(e,n),o={type:r,filter:t,callback:n,ref:a};return this.bindings[r]?this.bindings[r].push(o):this.bindings[r]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{let r=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(r,n))return!1;let i=this.bindings[r]?.find(t=>t.ref===e.ref);if(!i)return!0;if([`broadcast`,`presence`,`postgres_changes`].includes(r))if(`id`in i){let e=i.id,n=i.filter?.event;return e&&t.ids?.includes(e)&&(n===`*`||n?.toLocaleLowerCase()===t.data?.type.toLocaleLowerCase())}else{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}else return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=Qc;return t&&[n,r,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t==`object`&&`ids`in t){let e=t.data,{schema:n,table:r,commit_timestamp:i,type:a,errors:o}=e;return Object.assign(Object.assign({},{schema:n,table:r,commit_timestamp:i,eventType:a,new:{},old:{},errors:o}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error(`cannot copy bindings into joined channel`);for(let t in e.bindings)for(let n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=tl(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=tl(e.columns,e.old_record)),t}},Zl=class{constructor(e,t){this.socket=new Nl(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i(`timeout`),r),this.socket.disconnect(()=>{e(),i(`ok`)},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==$c.connecting}isDisconnecting(){return this.socket.connectionState()==$c.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},Ql={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},$l=[1e3,2e3,5e3,1e4],eu=1e4;function tu(){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 nu(){try{if(typeof globalThis<`u`&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return tu()}var ru=` 14 addEventListener("message", (e) => { 15 if (e.data.event === "start") { 16 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 17 } 18 });`,iu=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={}
18,this.ref=0,this.serializer=new el,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!t?.params?.apikey)throw Error(`API key is required to connect to Realtime`);this.apiKey=t.params.apikey;let n=this._initializeOptions(t);this.socketAdapter=new Zl(e,n),this.httpEndpoint=ul(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(`connect`),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let t=e.message;throw Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?`ok`:await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return t===`ok`&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||$c.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 Xl(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log(`transport`,`no channels remaining, scheduling disconnect`),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log(`transport`,`disconnecting immediately - no channels`),this.disconnect();return}
18this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log(`transport`,`deferred disconnect fired - no channels, disconnecting`),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log(`transport`,`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log(`transport`,`pending disconnect cancelled - channel activity detected`),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let n={access_token:t,version:Kc};t&&e.updateJoinPayload(n),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(Qc.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=`general`){this._isManualToken()||this.setAuth().catch(t=>{this.log(`error`,`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log(`error`,`error waiting for auth on connect`,e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t!==`disconnected`&&(t==`sent`&&this._setAuthSafely(),e&&e(t,n))}}_startWorkerHeartbeat(){this.workerUrl?this.log(`worker`,`starting worker for from ${this.workerUrl}`):this.log(`worker`,`starting default worker`);let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log(`worker`,`worker error`,e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{e.data.event===`keepAlive`&&this.sendHeartbeat()},this.workerRef.postMessage({event:`start`,interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&=(this.log(`worker`,`terminating worker`),this.workerRef.terminate(),void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([ru],{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??Xc,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??Ql.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=e?.disconnectOnEmptyChannelsAfterMs??2*(e?.heartbeatIntervalMs??Ql.HEARTBEAT_INTERVAL),t.transport=e?.transport??Gc.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.sessionStorage=e?.sessionStorage??nu(),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>$l[e-1]||eu);let n,r,i=e?.vsn??Yc;switch(i){case qc:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case Jc: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 18
18,au=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 ou(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 su(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 cu(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=ou(e.baseUrl,r,i),c=await su(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 au(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 lu(e){return e.join(`�`)}var uu=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:lu(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/${lu(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${lu(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${lu(e.namespace)}`}),!0}catch(e){if(e instanceof au&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof au&&e.status===409)return;throw e}}};function du(e){return e.join(`�`)}var fu=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/${du(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/${du(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/${du(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/${du(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/${du(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/${du(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof au&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof au&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},pu=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`);let n=e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`;this.client=cu({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new uu(this.client,t),this.tableOps=new fu(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)}
18async 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 mu(e){"@babel/helpers - typeof";return mu=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},mu(e)}function hu(e,t){if(mu(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(mu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gu(e){var t=hu(e,`string`);return mu(t)==`symbol`?t:t+``}function _u(e,t,n){return(t=gu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vu(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 H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vu(Object(n),!0).forEach(function(t){_u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var yu=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 bu(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var xu=class extends yu{constructor(e,t,n,r=`storage`){super(e,r,t,n),this.name=r===`vectors`?`StorageVectorsApiError`:`StorageApiError`,this.status=t,this.statusCode=n}toJSON(){return H({},super.toJSON())}},Su=class extends yu{constructor(e,t,n=`storage`){super(e,n),this.name=n===`vectors`?`StorageVectorsUnknownError`:`StorageUnknownError`,this.originalError=t}};function Cu(e,t,n){let r=H({},e),i=t.toLowerCase();for(let e of Object.keys(r))e.toLowerCase()===i&&delete r[e];return r[i]=n,r}function wu(e){let t={};for(let[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}var Tu=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Eu=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)},Du=e=>{if(Array.isArray(e))return e.map(e=>Du(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]=Du(n)}),t},Ou=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),ku=e=>e.split(`/`).map(encodeURIComponent).join(`/`),Au=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)},ju=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 xu(Au(e),i,n,r))}).catch(()=>{let e=i+``;t(new xu(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new Su(Au(e),e,r))},Mu=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return H(H({},i),n);if(Eu(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=Cu(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),H(H({},i),n)};async function Nu(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,Mu(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=>ju(e,c,r,o))})}function Pu(e=`storage`){return{get:async(t,n,r,i)=>Nu(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>Nu(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>Nu(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>Nu(t,`HEAD`,n,H(H({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>Nu(t,`DELETE`,n,i,a,r,e)}}var{get:Fu,post:Iu,put:Lu,head:Ru,remove:zu}=Pu(`storage`),Bu=Pu(`vectors`),Vu=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=wu(t),this.fetch=Tu(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Cu(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(bu(e))return{data:null,error:e};throw e}}},Hu=Symbol.toStringTag,Uu=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Hu]=`StreamDownloadBuilder`,this.promise=null}
18then(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(bu(t))return{data:null,error:t};throw t}}},Wu=Symbol.toStringTag,Gu=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Wu]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new Uu(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(bu(t))return{data:null,error:t};throw t}}},Ku={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},qu={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},Ju=class extends Vu{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=H(H({},qu),r),s=H(H({},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=Cu(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?Lu:Iu)(i.fetch,`${i.url}/object/${u}`,a,H({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=H(H({},qu),r),o=H(H({},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=Cu(o,e,t);return{path:a,fullPath:(await Lu(i.fetch,s.toString(),e,H({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=H({},n.headers);t?.upsert&&(i[`x-upsert`]=`true`);let a=await Iu(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 yu(`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 Iu(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
18stinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Iu(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,o=await Iu(r.fetch,`${r.url}/object/sign/${i}`,H({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 Iu(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=>H(H({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${o?`&${o}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new Gu(()=>Fu(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;let n=t._getFinalPath(e);return t.handleOperation(async()=>Du(await Fu(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await Ru(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(bu(e)){let t=e instanceof xu?e.status:e instanceof Su?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 zu(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=ku(r._getFinalPath(e)),a=new URLSearchParams;t?.transformations&&a.set(`transformations`,`true`);let o=a.toString();return await zu(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?H(H({},Ku.sortBy),t.sortBy):Ku.sortBy,a=H(H(H({},Ku),t),{},{sortBy:i,prefix:e||``});return await Iu(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=H({},e);return await Iu(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}},Yu={"X-Client-Info":`storage-js/2.110.9`},Xu=class extends Vu{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=H(H({},Yu),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await Fu(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Fu(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Iu(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Lu(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Iu(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await zu(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 zu(r.fetch,`${r.url}/cdn/${ku(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>
180?`?`+new URLSearchParams(t).toString():``}},Zu=class extends Vu{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=H(H({},Yu),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Iu(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 Fu(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await zu(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!Ou(e))throw new yu(`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 pu({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}})}},Qu=class extends Vu{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=H(H({},Yu),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await Bu.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Bu.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Bu.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Bu.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},$u=class extends Vu{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=H(H({},Yu),{},{"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 Bu.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Bu.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 Bu.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Bu.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 Bu.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},ed=class extends Vu{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=H(H({},Yu),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Bu.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Bu.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Bu.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Bu.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},td=class extends ed{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new nd(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)}},nd=class extends Qu{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,H(H({},e),{},{vectorBucketName:n.vectorBucketName}))}
18async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,H(H({},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 rd(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},rd=class extends $u{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,H(H({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,H(H({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,H(H({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,H(H({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,H(H({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},id=class extends Xu{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Ju(this.url,this.headers,e,this.fetch)}get vectors(){return new td(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new Zu(this.url+`/iceberg`,this.headers,this.fetch)}},ad=`2.110.9`,od=30*1e3,sd=3*od,cd=2*od,ld=`http://localhost:9999`,ud=`supabase.auth.token`,dd={"X-Client-Info":`gotrue-js/${ad}`},fd=`X-Supabase-Api-Version`,pd={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},md=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,hd=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 U(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}var gd=class extends hd{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function _d(e){return U(e)&&e.name===`AuthApiError`}var vd=class extends hd{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},yd=class extends hd{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},bd=class extends yd{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function xd(e){return U(e)&&e.name===`AuthSessionMissingError`}var Sd=class extends yd{constructor(){super(`Auth session or user missing`,`AuthInvalidToken
18ResponseError`,500,void 0)}},Cd=class extends yd{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},wd=class extends yd{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 Td(e){return U(e)&&e.name===`AuthImplicitGrantRedirectError`}var Ed=class extends yd{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})}},Dd=class extends yd{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`)}},Od=class extends yd{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function W(e){return U(e)&&e.name===`AuthRetryableFetchError`}var kd=class extends yd{constructor(e=`Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)`){super(e,`AuthRefreshDiscardedError`,409,void 0)}};function Ad(e){return U(e)&&e.name===`AuthRefreshDiscardedError`}var jd=class extends yd{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},Md=class extends yd{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},Nd=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),Pd=` 19\r=`.split(``),Fd=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Pd.length;t+=1)e[Pd[t].charCodeAt(0)]=-2;for(let t=0;t<Nd.length;t+=1)e[Nd[t].charCodeAt(0)]=t;return e})();function Id(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(Nd[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(Nd[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function Ld(e,t,n){let r=Fd[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 Rd(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{Vd(e,r,n)};for(let t=0;t<e.length;t+=1)Ld(e.charCodeAt(t),i,a);return t.join(``)}function zd(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Bd(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}zd(r,t)}}function Vd(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 G(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)Ld(e.charCodeAt(t),n,r);return new Uint8Array(t)}function Hd(e){let t=[];return Bd(e,e=>t.push(e)),new Uint8Array(t)}function Ud(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>Id(e,n,r)),Id(null,n,r),t.join(``)}function Wd(e){return Math.round(Date.now()/1e3)+e}function Gd(){return Symbol(`auth-callback`)}var Kd=()=>typeof window<`u`&&typeof document<`u`,qd={tested:!1,writable:!1},Jd=()=>
19{if(!Kd())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(qd.tested)return qd.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),qd.tested=!0,qd.writable=!0}catch{qd.tested=!0,qd.writable=!1}return qd.writable};function Yd(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var Xd=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Zd=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,Qd=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},$d=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},ef=async(e,t)=>{await e.removeItem(t)},tf=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};tf.promiseConstructor=Promise;function nf(e){let t=e.split(`.`);if(t.length!==3)throw new Md(`Invalid JWT structure`);for(let e=0;e<t.length;e++)if(!md.test(t[e]))throw new Md(`JWT not in base64url format`);return{header:JSON.parse(Rd(t[0])),payload:JSON.parse(Rd(t[1])),signature:G(t[2]),raw:{header:t[0],payload:t[1]}}}async function rf(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function af(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 of(e){return(`0`+e.toString(16)).substr(-2)}function sf(){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,of).join(``)}async function cf(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 lf(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 cf(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function uf(e,t,n=!1){let r=sf(),i=r;n&&(i+=`/recovery`),await Qd(e,`${t}-code-verifier`,i);let a=await lf(r);return[a,r===a?`plain`:`s256`]}var df=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function ff(e){let t=e.headers.get(fd);if(!t||!t.match(df))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function pf(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function mf(e){switch(e){case`RS256`:return{name:`RSASSA-PKCS1-v1_5`,hash:{name:`SHA-256`}};case`ES256`:return{name:`ECDSA`,namedCurve:`P-256`,hash:{name:`SHA-256`}};default:throw Error(`Invalid alg claim`)}}var hf=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function gf(e){if(!hf.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function _f(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 vf(){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 yf(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;
19if(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 bf(e){return JSON.parse(JSON.stringify(e))}var xf=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)},Sf=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Cf(e){if(!Zd(e))throw new Od(xf(e),0);if(Sf.includes(e.status))throw new Od(xf(e),e.status);let t;try{t=await e.json()}catch(e){throw new vd(xf(e),e)}let n,r=ff(e);if(r&&r.getTime()>=pd[`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 jd(xf(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new jd(xf(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new bd;throw new gd(xf(t),e.status||500,n)}var wf=(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 K(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[fd]=pd[`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 Tf(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 Tf(e,t,n,r,i,a){let o=wf(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw new Od(xf(e),0)}if(s.ok||await Cf(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await Cf(e)}}function Ef(e){let t=null;Mf(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=Wd(e.expires_in)));let n=e.user??(typeof e?.id==`string`?e:null);return{data:{session:t,user:n},error:null}}function Df(e){let t=Ef(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 Of(e){return{data:{user:e.user??e},error:null}}function kf(e){return{data:e,error:null}}function Af(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=gc(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 jf(e){return e}function Mf(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var Nf=[`global`,`local`,`others`],Pf=class{constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=Xd(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=Nf[0]){if(Nf.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${Nf.join(`, `)}`);try{return await K(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(U(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await K(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:Of})}catch(e){if(U(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=gc(e,[`options`]),r=Object.assign(Object.assign({},n),t);
19return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await K(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:Af,redirectTo:t?.redirectTo})}catch(e){if(U(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await K(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Of})}catch(e){if(U(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await K(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:jf});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(U(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){gf(e);try{return await K(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Of})}catch(e){if(U(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){gf(e);try{return await K(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:Of})}catch(e){if(U(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){gf(e);try{return await K(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:Of})}catch(e){if(U(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){gf(e.userId);try{let{data:t,error:n}=await K(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(U(e))return{data:null,error:e};throw e}}async _deleteFactor(e){gf(e.userId),gf(e.id);try{return{data:await K(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(U(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await K(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:jf});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(U(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await K(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(U(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await K(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(U(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await K(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(U(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await K(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(U(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await K(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(U(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await K(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(U(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await K(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(U(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await K(this.fetch,`GET`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(U(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await K(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(U(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await K(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(U(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){_f(this.experimental),gf(e.userId);try{return await K(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(U(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){_f(this.experimental),gf(e.userId),gf(e.passkeyId);try{return await K(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(U(e))return{data:null,error:e};throw e}}};function Ff(e={}){return{getItem:t=>
19e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}globalThis&&Jd()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`);var If=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};function Lf(){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 Rf(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function zf(e){return parseInt(e,16)}function Bf(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function Vf(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(` 20`))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);
20let f=Rf(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=` 21Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}var Hf=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}}},Uf=class extends Hf{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function Wf({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 Hf({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 Hf({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 Hf({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 Hf({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 Hf({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Hf({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 Hf({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Hf({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(!Zf(t))return new Hf({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Hf({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 Hf({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 Hf({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 Hf({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function Gf({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 Hf({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Hf({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!Zf(t))return new Hf({message:`${window.location.hostname}
21 is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Hf({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 Hf({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 Hf({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var Kf=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 qf(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=gc(e,[`challenge`,`user`,`excludeCredentials`]),a=G(t).buffer,o=Object.assign(Object.assign({},n),{id:G(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:G(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return s}function Jf(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=gc(e,[`challenge`,`allowCredentials`]),i=G(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:G(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return a}function Yf(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e;return{id:e.id,rawId:e.id,response:{attestationObject:Ud(new Uint8Array(e.response.attestationObject)),clientDataJSON:Ud(new Uint8Array(e.response.clientDataJSON))},type:`public-key`,clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment??void 0}}function Xf(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:Ud(new Uint8Array(r.authenticatorData)),clientDataJSON:Ud(new Uint8Array(r.clientDataJSON)),signature:Ud(new Uint8Array(r.signature)),userHandle:r.userHandle?Ud(new Uint8Array(r.userHandle)):void 0},type:`public-key`,clientExtensionResults:n,authenticatorAttachment:t.authenticatorAttachment??void 0}}function Zf(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Qf(){return!!(Kd()&&`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 $f(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Uf(`Browser returned unexpected credential type`,t)}:{data:null,error:new Uf(`Empty credential response`,t)}}catch(t){return{data:null,error:Wf({error:t,options:e})}}}async function ep(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Uf(`Browser returned unexpected credential type`,t)}:{data:null,error:new Uf(`Empty credential response`,t)}}
21catch(t){return{data:null,error:Gf({error:t,options:e})}}}var tp={hints:[`security-key`],authenticatorSelection:{authenticatorAttachment:`cross-platform`,requireResidentKey:!1,userVerification:`preferred`,residentKey:`discouraged`},attestation:`direct`},np={userVerification:`preferred`,hints:[`security-key`],attestation:`direct`};function rp(...e){let t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0)if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];t(n)?r[e]=rp(n,a):r[e]=rp(a)}else r[e]=a}return r}function ip(e,t){return rp(tp,e,t||{})}function ap(e,t){return rp(np,e,t||{})}var op=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??Kf.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 $f({publicKey:ip(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=ap(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await ep(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 U(e)?{data:null,error:e}:{data:null,error:new vd(`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 hd(`rpId is required for WebAuthn authentication`)};try{if(!Qf())return{data:null,error:new vd(`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 U(e)?{data:null,error:e}:{data:null,error:new vd(`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 hd(`rpId is required for WebAuthn registration`)};try{if(!Qf())return{data:null,error:new vd(`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 U(e)?{data:null,error:e}:{data:null,error:new vd(`Unexpected error in register`,e)}}}};Lf();var sp={url:ld,storageKey:ud,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:dd,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},cp={},lp=class e{get jwks(){return cp[this.storageKey]?.jwks??{keys:[]}}set jwks(e){cp[this.storageKey]=Object.assign(Object.assign({},cp[this.storageKey]),{jwks:e})}get jwks_cached_at(){return cp[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){cp[this.storageKey]=Object.assign(Object.assign({},cp[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({},sp),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&&Kd()){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 Pf({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=Xd(r.fetch),this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock!=null&&(this.lock=r.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new op(this)}
21,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:Jd()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Ff(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=Ff(this.memoryStorage)),Kd()&&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} (${ad}) ${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(Kd()&&(e=Yd(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),Kd()&&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),Td(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 U(e)?this._returnResult({error:e}):this._returnResult({error:new vd(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await K(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:Ef});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(U(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await uf(this.storage,this.storageKey)),t=await K(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:{email:n,password:r,data:i?.data??{},gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},xform:Ef})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await K(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:n,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Ef})}else throw new Cd(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r||!n)return await ef(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:r});let i=n.session,a=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,i)),this._returnResult({data:{user:a,session:i},error:null})}catch(e){if(await ef(this.storage,`${this.storageKey}-code-verifier`),U(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 K(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:Df})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await K(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:Df})}else throw new Cd(`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 Sd;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(U(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock==null?this._exchangeCodeForSession(e):this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!Kd()){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=Rf(l[0]),d=o?.signInWithEthereum?.chainId;d||=zf(await s.request({method:`eth_chainId`})),t=Vf({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:[Bf(t),u]})}try{let{data:r,error:i}=await K(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:Ef});if(i)throw i;if(!r||!r.session||!r.user){let e=new Sd;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(U(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(!Kd()){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.
21solana&&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(` 22`);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 K(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:Ud(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Ef});if(i)throw i;if(!r||!r.session||!r.user){let e=new Sd;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(U(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await $d(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new Dd;let{data:r,error:i}=await K(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:Ef});if(await ef(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new Sd;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(n===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await ef(this.storage,`${this.storageKey}-code-verifier`),U(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 K(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:Ef});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new Sd;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(U(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await uf(this.storage,this.storageKey));let{error:a}=await K(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await K(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 Cd(`You must provide either an email or phone number.`)}catch(e){if(await ef(this.storage,`${this.storageKey}-code-verifier`),U(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 K(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:Ef});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(U(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await uf(this.storage,this.storageKey));let r=await K(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:kf});return r.data?.url&&Kd()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await ef(this.storage,`${this.storageKey}-code-verifier`),U(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 bd;let{error:r}=await K(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(U(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await uf(this.storage,this.storageKey));let{error:s}=await K(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},redirectTo:i?.emailRedirectTo});return s&&await ef(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:s})}else if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await K(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new Cd(`You must provide either an email or phone number and a type`)}catch(e){if(await ef(this.storage,`${this.storageKey}-code-verifier`),U(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 $d(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
22id`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<sd:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await $d(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=vf()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=yf(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 $d(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 K(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:Of}):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 bd}:await K(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:Of})})}catch(e){if(U(e))return xd(e)&&(await this._removeSession(),await ef(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,this.lock==null?await this._updateUser(e,t):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new bd;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await uf(this.storage,this.storageKey));let{data:c,error:l}=await K(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:Of});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await ef(this.storage,`${this.storageKey}-code-verifier`),U(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 bd;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=nf(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(U(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 bd;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(U(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!Kd())throw new wd(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new wd(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 Ed(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new wd(`Not a valid implicit grant flow url.`);break;default:}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new Ed(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);
22if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new wd(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(U(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){let t=await $d(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,this.lock==null?await this._signOut(e):await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let n=async()=>{await this._removeSession(),await ef(this.storage,`${this.storageKey}-code-verifier`)},{data:r,error:i}=t;if(i&&!xd(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&&!(_d(t)&&(t.status===404||t.status===401||t.status===403)||xd(t)))return e!==`others`&&await n(),this._returnResult({error:t})}return e!==`others`&&await n(),this._returnResult({error:null})})}onAuthStateChange(e){let t=Gd(),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),xd(t)||W(t)||_d(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;this.flowType===`pkce`&&([n,r]=await uf(this.storage,this.storageKey,!0));try{return await K(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await ef(this.storage,`${this.storageKey}-code-verifier`),U(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(U(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await K(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return Kd()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(U(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await K(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:Ef});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 Sd}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await ef(this.storage,`${this.storageKey}-code-verifier`),U(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 K(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(U(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 af(async n=>(n>0&&await rf(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await K(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Ef})),(e,t)=>{let r=200*2**e;return t&&W(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),U(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),Kd()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await $d(this.storage,this.storageKey);if(t&&this.userStorage){let e=await $d(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await Qd(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??vf()}else if(t&&!t.user&&!t.user){let e=await $d(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await ef(this.storage,this.storageKey+`-user`),await Qd(this.storage,this.storageKey,t)):t.user=vf()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not val
22id`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now()<sd;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${sd}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(Ad(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),W(t)?console.warn(t):console.error(t);return}finally{this._debug(e,`end`)}}async _callRefreshToken(e){var t,n;if(!e)throw new bd;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 tf;let t=await $d(this.storage,this.storageKey),{data:n,error:i}=await this._refreshAccessToken(e);if(i)throw i;if(!n.session)throw new bd;let a=await $d(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 kd};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 ef(this.storage,this.storageKey),this.userStorage&&await ef(this.userStorage,this.storageKey+`-user`);let e={data:null,error:new kd};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),U(i)){let n={data:null,error:i};if(!W(i)){let e=await $d(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()+cd},(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 Qd(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=bf(e);await Qd(this.storage,this.storageKey,r)}else{let e=bf(t);await Qd(this.storage,this.storageKey,e)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug(`#_removeSession()`),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await ef(this.storage,this.storageKey),await ef(this.storage,this.storageKey+`-code-verifier`),await ef(this.storage,this.storageKey+`-user`),this.userStorage&&await ef(this.userStorage,this.storageKey+`-user`),await this._notifyAllSubscribers(`SIGNED_OUT`,null)}_removeVisibilityChangedCallback(){this._debug(`#_removeVisibilityChangedCallback()`);let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Kd()&&window!=null&&window.removeEventListener&&window.removeEventListener(`visibilitychange`,e)}
22catch(e){console.error(`removing visibilitychange callback failed`,e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(`#_startAutoRefresh()`);let e=setInterval(()=>this._autoRefreshTokenTick(),od);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)/od);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${od}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 If)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)/od);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${od}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()`),!Kd()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;if(this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==`visible`){this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`);return}await this._recoverAndRefresh()});else{if(document.visibilityState!==`visible`){this._debug(t,`visibilityState is no longer visible, skipping recovery`);return}await this._recoverAndRefresh()}}else document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await uf(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});
22r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await K(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(U(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 K(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(U(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`?Yf(e.webauthn.credential_response):Xf(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await K(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(U(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 K(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:qf(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:Jf(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(U(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}=nf(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(U(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}
22=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}=nf(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 K(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 bd})})}catch(e){if(U(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 bd});let a=await K(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&&Kd()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(U(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 bd});let a=await K(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&&Kd()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(U(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 K(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 bd})})}catch(e){if(U(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 K(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 bd})})}catch(e){if(U(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 K(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}
22=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}}=nf(n);if(!t?.allowExpired)try{pf(i.exp)}catch(e){throw new Md(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=mf(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,Hd(`${o}.${s}`)))throw new Md(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(U(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){_f(this.experimental);try{if(!Qf())return this._returnResult({data:null,error:new vd(`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 ep({publicKey:Jf(t.options),signal:e?.options?.signal??Kf.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new vd(`WebAuthn ceremony failed`,null)});let a=Xf(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(U(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){_f(this.experimental);try{if(!Qf())return this._returnResult({data:null,error:new vd(`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 $f({publicKey:qf(t.options),signal:e?.options?.signal??Kf.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new vd(`WebAuthn ceremony failed`,null)});let a=Yf(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(U(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){_f(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 bd});let{data:r,error:i}=await K(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(U(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){_f(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 bd});let{data:i,error:a}=await K(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(U(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){_f(this.experimental);try{let{data:t,error:n}=await K(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(U(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){_f(this.experimental);try{let{data:t,error:n}=await K(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Ef});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(U(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){_f(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 bd});let{data:r,error:i}=await K(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(U(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){_f(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 bd});let{data:i,error:a}=await K(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(U(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){_f(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 bd});let{error:i}=await K(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(U(e))return this._returnResult({data:null,error:e});throw e}}};lp.nextInstanceID={};var up=lp,dp=`modulepreload`,fp=function(e){return`/`+e},pp={},mp=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=fp(t,n),t in pp)return;pp[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:dp,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n
22)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},hp=`2.110.9`,gp=``,_p;if(typeof Deno<`u`)gp=`deno`,_p=Deno.version?.deno;else if(typeof document<`u`)gp=`web`;else if(typeof navigator<`u`&&navigator.product===`ReactNative`)gp=`react-native`;else{var vp;gp=`node`;let e=globalThis.process;_p=e==null||(vp=e.version)==null?void 0:vp.replace(/^v/,``)}var yp=[`runtime=${gp}`];_p&&yp.push(`runtime-version=${_p}`);var bp={headers:{"X-Client-Info":`supabase-js/${hp}; ${yp.join(`; `)}`}},xp={schema:`public`},Sp={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},Cp={},wp={enabled:!1,respectSamplingDecision:!0};function Tp(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 Ep=null,Dp=`@opentelemetry/api`;function Op(){return Ep===null&&(Ep=mp(()=>import(Dp),[]).catch(()=>null)),Ep}function kp(){return Tp(this,void 0,void 0,function*(){try{let e=yield Op();if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function Ap(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 jp(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(Mp(n.hostname,e))return!0}else 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 Mp(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 Np(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 Pp(e){"@babel/helpers - typeof";return Pp=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},Pp(e)}function Fp(e,t){if(Pp(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Pp(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ip(e){var t=Fp(e,`string`);return Pp(t)==`symbol`?t:t+``}
22function Lp(e,t,n){return(t=Ip(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rp(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 zp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Rp(Object(n),!0).forEach(function(t){Lp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Bp=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),Vp=()=>Headers,Hp=e=>e.startsWith(`sb_publishable_`)||e.startsWith(`sb_secret_`),Up=`sb_temp_`,Wp=new Set,Gp=e=>{if(!e.startsWith(`sb_`)||Hp(e)||e.startsWith(Up))return;let t=e.match(/^sb_[a-zA-Z0-9]+_/)?.[0]??`unknown`;Wp.has(t)||(Wp.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.`))},Kp=(e,t,n,r,i,a)=>{let o=Bp(r),s=Vp(),c=i?.enabled===!0,l=i?.respectSamplingDecision!==!1,u=c?Np(t):null,d=!(a?.omitApiKeyAsBearer&&Hp(e));return async(t,r)=>{let i=await n(),a=new s(r?.headers);if(a.has(`apikey`)||a.set(`apikey`,e),!a.has(`Authorization`)){let t=i??(d?e:null);t&&a.set(`Authorization`,`Bearer ${t}`)}if(u){let e=await qp(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,zp(zp({},r),{},{headers:a}))}};async function qp(e,t,n){if(!jp(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let r=await kp();if(!r||!r.traceparent)return null;if(n){let e=Ap(r.traceparent);if(e&&!e.isSampled)return null}return r}function Jp(e){return typeof e==`boolean`?{enabled:e}:e}function Yp(e){return e.endsWith(`/`)?e:e+`/`}function Xp(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=Jp(e.tracePropagation),d=Jp(t.tracePropagation),f={db:zp(zp({},o),n),auth:zp(zp({},s),r),realtime:zp(zp({},c),i),storage:{},global:zp(zp(zp({},l),a),{},{headers:zp(zp({},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 Zp(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(Yp(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var Qp=class extends up{constructor(e){super(e)}},$p=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=Zp(e);if(!t)throw Error(`supabaseKey is required.`);Gp(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:xp,realtime:Cp,auth:zp(zp({},Sp),{},{storageKey:i}),global:bp,tracePropagation:wp},o=Xp(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=Kp(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation),this.functionsFetch=Kp(t,e,this._getSessionToken.bind(this),o.global.fetch,o.tracePropagation,{omitApiKeyAsBearer
22:!0}),this.realtime=this._initRealtimeClient(zp({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 Wc(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new id(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new Tc(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??null}async _getAccessToken(){var e=this;return await e._getSessionToken()??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Qp({url:this.authUrl.href,headers:zp(zp({},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 iu(this.realtimeUrl.href,zp(zp({},e),{},{params:zp(zp({},{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)}},em=(e,t,n)=>new $p(e,t,n);function tm(){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}tm()&&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`);function nm(){if(typeof window>`u`)return;let e=location.hostname,t=[`lovableproject.com`,`lovableproject-dev.com`,`lovable.app`,`gpt-eng.com`,`gptengineer.run`].some(t=>e===t||e.endsWith(`.`+t))?e.match(RegExp(`^(?:id-preview(?:-[a-z0-9]+)?|project)--([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})(?:-dev)?(?=\\.|$)`,`i`))?.[1]??e.match(RegExp(`^([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})(?=[.-])`,`i`))?.[1]:void 0,n=window.parent&&window.parent!==window;if(!t||!n)return localStorage;let r=e.endsWith(`.lovableproject-dev.com`)||e.endsWith(`.gpt-eng.com`),i=r?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,a=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:``),o=a&&i.test(a)?[a]:r?[`https://lovable.dev`,`http://localhost:3000`]:[`https://lovable.dev`],s=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),c=(e,n,r)=>new Promise(i=>{let a=s(),c=!1,l,u=e=>{c||(c=!0,clearTimeout(l),window.removeEventListener(`message`,d),i(e))},d=e=>{if(o.indexOf(e.origin)<0)return;let t=e.data;t&&t.type===`lovable-preview-auth:result`&&t.requestId===a&&u(t)}
22;window.addEventListener(`message`,d);let f={type:e,requestId:a,projectId:t,key:n};r!==void 0&&(f.value=r);for(let e of o)window.parent.postMessage(f,e);l=setTimeout(()=>u(null),2e3)}),l=!0;return{getItem:async e=>{let t=await c(`lovable-preview-auth:get`,e);return!t&&l&&(await new Promise(e=>setTimeout(e,250)),t=await c(`lovable-preview-auth:get`,e)),l=!1,t&&t.ok&&typeof t.value==`string`?t.value===``?(localStorage.removeItem(e),null):t.value:localStorage.getItem(e)},setItem:(e,t)=>(localStorage.setItem(e,t),c(`lovable-preview-auth:set`,e,t).then(()=>void 0)),removeItem:e=>(localStorage.removeItem(e),c(`lovable-preview-auth:remove`,e).then(()=>void 0))}}function rm(e){return e.startsWith(`sb_publishable_`)||e.startsWith(`sb_secret_`)}function im(e){return(t,n)=>{let r=new Headers(typeof Request<`u`&&t instanceof Request?t.headers:void 0);return n?.headers&&new Headers(n.headers).forEach((e,t)=>r.set(t,e)),rm(e)&&r.get(`Authorization`)===`Bearer ${e}`&&r.delete(`Authorization`),r.set(`apikey`,e),fetch(t,{...n,headers:r})}}function am(){let e=`sb_publishable_CElZYSmLuuCUhRQsRtKgAA_nY9Uh519`;return em(`https://sgkashfldjpgfbjvnohv.supabase.co`,e,{global:{fetch:im(e)},auth:{storage:nm(),persistSession:!0,autoRefreshToken:!0}})}var om,sm=new Proxy({},{get(e,t,n){return om||=am(),Reflect.get(om,t,n)}}),cm=fc({type:`function`}).client(async({next:e})=>{let{data:t}=await sm.auth.getSession(),n=t.session?.access_token;return e({headers:n?{Authorization:`Bearer ${n}`}:{}})}),lm=fc(),um=void 0,dm=mc(()=>({functionMiddleware:[cm],requestMiddleware:[lm,um]})),fm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},pm=new class extends fm{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},mm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hm=new class{#e=mm;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function gm(e){setTimeout(e,0)}var _m=typeof window>`u`||`Deno`in globalThis;function vm(){}function ym(e,t){return typeof e==`function`?e(t):e}function bm(e){return typeof e==`number`&&e>=0&&e!==1/0}function xm(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Sm(e,t){return typeof e==`function`?e(t):e}function Cm(e,t){return typeof e==`function`?e(t):e}function wm(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Em(o,t.options))return!1}else if(!Om(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Tm(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Dm(t.options.mutationKey)!==Dm(a))return!1}else if(!Om(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Em(e,t){return(t?.queryKeyHashFn||Dm)(e)}function Dm(e){return JSON.stringify(e,(e,t)=>Nm(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Om(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>
22Om(e[n],t[n])):!1}var km=Object.prototype.hasOwnProperty;function Am(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Mm(e)&&Mm(t);if(!r&&!(Nm(e)&&Nm(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:km.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Am(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function jm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Mm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Nm(e){if(!Pm(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Pm(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Pm(e){return Object.prototype.toString.call(e)===`[object Object]`}function Fm(e){return new Promise(t=>{hm.setTimeout(t,e)})}function Im(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Am(e,t)}function Lm(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Rm(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zm=Symbol();function Bm(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zm?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Vm(e,t){return typeof e==`function`?e(...t):!!e}function Hm(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Um=(()=>{let e=()=>_m;return{isServer(){return e()},setIsServer(t){e=t}}})();function Wm(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Gm=gm;function Km(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Gm,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var qm=Km(),Jm=new class extends fm{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ym(e){return Math.min(1e3*2**e,3e4)}function Xm(e){return(e??`online`)===`online`?Jm.isOnline():!0}var Zm=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Qm(e){let t=!1,n=0,r,i=Wm(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Zm(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>pm.isFocused()&&(e.networkMode===`always`||Jm.isOnline())&&e.canRun(),u=()=>Xm(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Um.isServer()?0:3),o=e.retryDelay??Ym,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Fm(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var $m=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),bm(this.gcTime)&&(this.#e=hm.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Um.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(hm.clearTimeout(this.#e),this.#e=void 0)}};function eh(e){return{onFetch:(t,n)=>
22{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Hm(e,()=>t.signal,()=>n=!0)},u=Bm(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Rm:Lm;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?nh:th,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:th(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function th(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function nh(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var rh=class extends $m{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=oh(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=oh(this.options);e.data!==void 0&&(this.setState(ah(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Im(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(vm).catch(vm):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Cm(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Sm(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!xm(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)}
22)},i=()=>{let e=Bm(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?eh(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Qm({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Zm&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Zm){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ih(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ah(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),qm.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ih(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xm(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ah(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function oh(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var sh=class extends fm{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Wm(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),lh(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return uh(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return uh(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Cm(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!jm(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&dh(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Cm(this.options.enabled,this.#t)!==Cm(t.enabled,this.#t)||Sm(this.options.staleTime,this.#t)!==Sm(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Cm(this.options.enabled,this.#t)!==Cm(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ph(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pen
22ding`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(vm)),t}#g(){this.#b();let e=Sm(this.options.staleTime,this.#t);if(Um.isServer()||this.#r.isStale||!bm(e))return;let t=xm(this.#r.dataUpdatedAt,e)+1;this.#d=hm.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Um.isServer()||Cm(this.options.enabled,this.#t)===!1||!bm(this.#p)||this.#p===0)&&(this.#f=hm.setInterval(()=>{(this.options.refetchIntervalInBackground||pm.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(hm.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(hm.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&lh(e,t),o=i&&dh(e,n,t,r);(a||o)&&(l={...l,...ih(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Im(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Im(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:fh(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Cm(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=Wm())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!jm(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){qm.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ch(e,t){return Cm(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&Cm(t.retryOn
22Mount,e)===!1)}function lh(e,t){return ch(e,t)||e.state.data!==void 0&&uh(e,t,t.refetchOnMount)}function uh(e,t,n){if(Cm(t.enabled,e)!==!1&&Sm(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&fh(e,t)}return!1}function dh(e,t,n,r){return(e!==t||Cm(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&fh(e,n)}function fh(e,t){return Cm(t.enabled,e)!==!1&&e.isStaleByTime(Sm(t.staleTime,e))}function ph(e,t){return!jm(e.getCurrentResult(),t)}var mh=class extends $m{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||hh(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Qm({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),qm.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function hh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var gh=class extends fm{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new mh({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=_h(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=_h(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=_h(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>
22e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=_h(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){qm.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Tm(t,e))}findAll(e={}){return this.getAll().filter(t=>Tm(e,t))}notify(e){qm.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return qm.batch(()=>Promise.all(e.map(e=>e.continue().catch(vm))))}};function _h(e){return e.options.scope?.id}var vh=class extends fm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Em(r,t),a=this.get(i);return a||(a=new rh({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){qm.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>wm(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>wm(e,t)):t}notify(e){qm.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){qm.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){qm.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},yh=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new vh,this.#t=e.mutationCache||new gh,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=pm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Jm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Sm(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ym(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return qm.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;qm.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return qm.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=qm.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(vm).catch(vm)}invalidateQueries(e,t={}){return qm.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=qm.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(vm)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(vm)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Sm(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vm).catch(vm)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vm).catch(vm)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Jm.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Dm(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Om(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Dm(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Om(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Em(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===zm&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},bh=F.createContext(void 0),xh=e=>{let t=F.useContext(bh);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Sh=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(bh.Provider,{value:e,children:t})),Ch=F.createContext(!1),wh=()=>F.useContext(Ch);Ch.Provider;function Th(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}
22var Eh=F.createContext(Th()),Dh=()=>F.useContext(Eh),Oh=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Vm(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},kh=e=>{F.useEffect(()=>{e.clearReset()},[e])},Ah=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Vm(n,[e.error,r])),jh=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Mh=(e,t)=>e.isLoading&&e.isFetching&&!t,Nh=(e,t)=>e?.suspense&&t.isPending,Ph=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Fh(e,t,n){let r=wh(),i=Dh(),a=xh(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,jh(o),Oh(o,i,s),kh(i);let l=!a.getQueryCache().get(o.queryHash),[u]=F.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(F.useSyncExternalStore(F.useCallback(e=>{let t=f?u.subscribe(qm.batchCalls(e)):vm;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),F.useEffect(()=>{u.setOptions(o)},[o,u]),Nh(o,d))throw Ph(o,u,i);if(Ah({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Um.isServer()&&Mh(d,r)&&(l?Ph(o,u,i):s?.promise)?.catch(vm).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function Ih(e,t){return Fh(e,sh,t)}var Lh=`/assets/styles-2YYatO_2.css`;function Rh(e,t={}){if(typeof window>`u`)return;window.__lovableEvents?.captureException?.(e,{source:`react_error_boundary`,route:window.location.pathname,...t},{mechanism:`react_error_boundary`,handled:!1,severity:`error`});let n=e instanceof Response?`Response ${e.status}${e.url?` at ${e.url}`:``}`:e instanceof Error?e.message:String(e);window.__lovableReportRuntimeError?.({message:n,stack:e instanceof Error?e.stack:void 0,filename:window.location.pathname})}var zh=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Bh=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Vh=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Hh=e=>{let t=Vh(e);return t.charAt(0).toUpperCase()+t.slice(1)},Uh={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Wh=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Gh=(0,F.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,F.createElement)(`svg`,{ref:c,...Uh,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zh(`lucide`,i),...!a&&!Wh(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Kh=(e,t)=>{let n=(0,F.forwardRef)(({className:n,...r},i)=>(0,F.createElement)(Gh,{ref:i,iconNode:t,className:zh(`lucide-${Bh(Hh(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Hh(e),n},qh=Kh(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Jh=Kh(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Yh=Kh(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Xh=Kh(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Zh=Kh(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}
vendor: 4,229 bytes, line 22
22],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Qh=Kh(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),$h=Kh(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),eg=Kh(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),tg=Kh(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ng=Kh(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),rg=Kh(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ig=Kh(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),ag=Kh(`shopping-cart`,[[`circle`,{cx:`8`,cy:`21`,r:`1`,key:`jimo8o`}],[`circle`,{cx:`19`,cy:`21`,r:`1`,key:`13723u`}],[`path`,{d:`M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12`,key:`9zh506`}]]),og=Kh(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),sg=Kh(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function cg(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function lg(...e){return t=>{let n=!1,r=e.map(e=>{let r=cg(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():cg(e[t],null)}}}}function ug(...e){return F.useCallback(lg(...e),e)}var dg=Symbol.for(`react.lazy`),fg=F.use;function pg(e){return typeof e==`object`&&!!e&&`then`in e}function mg(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===dg&&`_payload`in e&&pg(e._payload)}function hg(e){let t=_g(e),n=F.forwardRef((e,n)=>{let{children:r,...i}=e;mg(r)&&typeof fg==`function`&&(r=fg(r._payload));let a=F.Children.toArray(r),o=a.find(yg);if(o){let e=o.props.children,r=a.map(t=>t===o?F.Children.count(e)>1?F.Children.only(null):F.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:F.isValidElement(e)?F.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var gg=hg(`Slot`);function _g(e){let t=F.forwardRef((e,t)=>{let{children:n,...r}=e;if(mg(n)&&typeof fg==`function`&&(n=fg(n._payload)),F.isValidElement(n)){let e=xg(n),i=bg(r,n.props);return n.type!==F.Fragment&&(i.ref=t?lg(t,e):e),F.cloneElement(n,i)}return F.Children.count(n)>1?F.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vg=Symbol(`radix.slottable`);function yg(e){return F.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===vg}function bg(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function xg(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Sg(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Sg(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Cg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Sg(e))&&(r&&(r+=` `),r+=t);return r}var wg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Tg=Cg,Eg=(e,t)=>
vendor: 4,612 bytes, line 22
22n=>{if(t?.variants==null)return Tg(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=wg(t)||wg(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Tg(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Dg=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Og=(e,t)=>({classGroupId:e,validator:t}),kg=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ag=`-`,jg=[],Mg=`arbitrary..`,Ng=e=>{let t=Ig(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Fg(e);let n=e.split(Ag);return Pg(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Dg(i,t):t:i||jg}return n[e]||jg}}},Pg=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Pg(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ag):e.slice(t).join(Ag),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Fg=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Mg+r:void 0})(),Ig=e=>{let{theme:t,classGroups:n}=e;return Lg(n,t)},Lg=(e,t)=>{let n=kg();for(let r in e){let i=e[r];Rg(i,n,r,t)}return n},Rg=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];zg(i,t,n,r)}},zg=(e,t,n,r)=>{if(typeof e==`string`){Bg(e,t,n);return}if(typeof e==`function`){Vg(e,t,n,r);return}Hg(e,t,n,r)},Bg=(e,t,n)=>{let r=e===``?t:Ug(t,e);r.classGroupId=n},Vg=(e,t,n,r)=>{if(Wg(e)){Rg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Og(n,e))},Hg=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Rg(o,Ug(t,a),n,r)}},Ug=(e,t)=>{let n=e,r=t.split(Ag),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=kg(),n.nextPart.set(t,i)),n=i}return n},Wg=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Gg=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Kg=`!`,qg=`:`,Jg=[],Yg=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Xg=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===qg){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Kg)?(c=s.slice(0,-1),l=!0):s.startsWith(Kg)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Yg(t,l,c,u)};if(t){let e=t+qg,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Yg(Jg,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Zg=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Qg=e=>({cache:Gg(e.cacheSize),parseClassName:Xg(e),sortModifiers:Zg(e),...Ng(e)}),$g=/\s+/,e_=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split($g),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+Kg:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},t_=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=n_(n))&&(i&&(i+=` `),i+=r);return i},n_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=n_(e[r]))&&(n&&(n+=` `),n+=t);return n},r_=(e,...t)=>{let n,r,i,a,o=o=>(n=Qg(t.reduce((e,t)=>
vendor: 4,076 bytes, line 22
22t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=e_(e,n);return i(e,a),a};return a=o,(...e)=>a(t_(...e))},i_=[],a_=e=>{let t=t=>t[e]||i_;return t.isThemeGetter=!0,t},o_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,s_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,c_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,l_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,u_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,d_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,f_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,p_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,m_=e=>c_.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),h_=e=>!!e&&Number.isInteger(Number(e)),g_=e=>e.endsWith(`%`)&&q(e.slice(0,-1)),__=e=>l_.test(e),v_=()=>!0,y_=e=>u_.test(e)&&!d_.test(e),b_=()=>!1,x_=e=>f_.test(e),S_=e=>p_.test(e),C_=e=>!J(e)&&!Y(e),w_=e=>z_(e,U_,b_),J=e=>o_.test(e),T_=e=>z_(e,W_,y_),E_=e=>z_(e,G_,q),D_=e=>z_(e,q_,v_),O_=e=>z_(e,K_,b_),k_=e=>z_(e,V_,b_),A_=e=>z_(e,H_,S_),j_=e=>z_(e,J_,x_),Y=e=>s_.test(e),M_=e=>B_(e,W_),N_=e=>B_(e,K_),P_=e=>B_(e,V_),F_=e=>B_(e,U_),I_=e=>B_(e,H_),L_=e=>B_(e,J_,!0),R_=e=>B_(e,q_,!0),z_=(e,t,n)=>{let r=o_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},B_=(e,t,n=!1)=>{let r=s_.exec(e);return r?r[1]?t(r[1]):n:!1},V_=e=>e===`position`||e===`percentage`,H_=e=>e===`image`||e===`url`,U_=e=>e===`length`||e===`size`||e===`bg-size`,W_=e=>e===`length`,G_=e=>e===`number`,K_=e=>e===`family-name`,q_=e=>e===`number`||e===`weight`,J_=e=>e===`shadow`,Y_=r_(()=>{let e=a_(`color`),t=a_(`font`),n=a_(`text`),r=a_(`font-weight`),i=a_(`tracking`),a=a_(`leading`),o=a_(`breakpoint`),s=a_(`container`),c=a_(`spacing`),l=a_(`radius`),u=a_(`shadow`),d=a_(`inset-shadow`),f=a_(`text-shadow`),p=a_(`drop-shadow`),m=a_(`blur`),h=a_(`perspective`),g=a_(`aspect`),_=a_(`ease`),v=a_(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],ee=()=>[`auto`,`contain`,`none`],C=()=>[Y,J,c],te=()=>[m_,`full`,`auto`,...C()],ne=()=>[h_,`none`,`subgrid`,Y,J],re=()=>[`auto`,{span:[`full`,h_,Y,J]},h_,Y,J],ie=()=>[h_,`auto`,Y,J],ae=()=>[`auto`,`min`,`max`,`fr`,Y,J],oe=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],se=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ce=()=>[`auto`,...C()],le=()=>[m_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],ue=()=>[m_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],w=()=>[m_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],E=()=>[e,Y,J],de=()=>[...b(),P_,k_,{position:[Y,J]}],fe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],pe=()=>[`auto`,`cover`,`contain`,F_,w_,{size:[Y,J]}],me=()=>[g_,M_,T_],D=()=>[``,`none`,`full`,l,Y,J],O=()=>[``,q,M_,T_],he=()=>[`solid`,`dashed`,`dotted`,`double`],ge=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],_e=()=>[q,g_,P_,k_],ve=()=>[``,`none`,m,Y,J],ye=()=>[`none`,q,Y,J],be=()=>[`none`,q,Y,J],xe=()=>[q,Y,J],Se=()=>[m_,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[__],breakpoint:[__],color:[v_],container:[__],"drop-shadow":[__],ease:[`in`,`out`,`in-out`],font:[C_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[__],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[__],shadow:[__],spacing:[`px`,q],text:[__],"text-shadow":[__],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,m_,J,Y,g]}
vendor: 6,111 bytes, line 22
22],container:[`container`],columns:[{columns:[q,J,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[h_,`auto`,Y,J]}],basis:[{basis:[m_,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[q,m_,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,q,Y,J]}],shrink:[{shrink:[``,q,Y,J]}],order:[{order:[h_,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...oe(),`normal`]}],"justify-items":[{"justify-items":[...se(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...se()]}],"align-content":[{content:[`normal`,...oe()]}],"align-items":[{items:[...se(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...se(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...se(),`baseline`]}],"place-self":[{"place-self":[`auto`,...se()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mbs:[{mbs:ce()}],mbe:[{mbe:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:le()}],"inline-size":[{inline:[`auto`,...ue()]}],"min-inline-size":[{"min-inline":[`auto`,...ue()]}],"max-inline-size":[{"max-inline":[`none`,...ue()]}],"block-size":[{block:[`auto`,...w()]}],"min-block-size":[{"min-block":[`auto`,...w()]}],"max-block-size":[{"max-block":[`none`,...w()]}],w:[{w:[s,`screen`,...le()]}],"min-w":[{"min-w":[s,`screen`,`none`,...le()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...le()]}],h:[{h:[`screen`,`lh`,...le()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...le()]}],"max-h":[{"max-h":[`screen`,`lh`,...le()]}],"font-size":[{text:[`base`,n,M_,T_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,R_,D_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,g_,J]}],"font-family":[{font:[N_,O_,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,J]}],"line-clamp":[{"line-clamp":[q,`none`,Y,E_]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...he(),`wavy`]}],"text-decoration-thickness":[{decoration:[q,`from-font`,`auto`,Y,T_]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[q,`auto`,Y,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:fe()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},h_,Y,J],radial:[``,Y,J],conic:[h_,Y,J]},I_,A_]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:me()}
vendor: 7,773 bytes, line 22
22],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:O()}],"border-w-x":[{"border-x":O()}],"border-w-y":[{"border-y":O()}],"border-w-s":[{"border-s":O()}],"border-w-e":[{"border-e":O()}],"border-w-bs":[{"border-bs":O()}],"border-w-be":[{"border-be":O()}],"border-w-t":[{"border-t":O()}],"border-w-r":[{"border-r":O()}],"border-w-b":[{"border-b":O()}],"border-w-l":[{"border-l":O()}],"divide-x":[{"divide-x":O()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":O()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...he(),`hidden`,`none`]}],"divide-style":[{divide:[...he(),`hidden`,`none`]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...he(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[q,Y,J]}],"outline-w":[{outline:[``,q,M_,T_]}],"outline-color":[{outline:E()}],shadow:[{shadow:[``,`none`,u,L_,j_]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":[`none`,d,L_,j_]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:O()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[q,T_]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":O()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":[`none`,f,L_,j_]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[q,Y,J]}],"mix-blend":[{"mix-blend":[...ge(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[q]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[q]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:fe()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:ve()}],brightness:[{brightness:[q,Y,J]}],contrast:[{contrast:[q,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,L_,j_]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:[``,q,Y,J]}],"hue-rotate":[{"hue-rotate":[q,Y,J]}],invert:[{invert:[``,q,Y,J]}],saturate:[{saturate:[q,Y,J]}],sepia:[{sepia:[``,q,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[q,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[q,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,q,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,q,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[q,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[q,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,q,Y,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[q,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[q,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":[`scale-3d`],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":[`translate-none`],accent:[{accent:E()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom
22-in`,`zoom-out`,Y,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}
22],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,J]}],fill:[{fill:[`none`,...E()]}],"stroke-w":[{stroke:[q,M_,T_,E_]}],stroke:[{stroke:[`none`,...E()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function X_(...e){return Y_(Cg(e))}var Z_=Eg(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,outline:`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),Q_=F.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,I.jsx)(r?gg:`button`,{className:X_(Z_({variant:t,size:n,className:e})),ref:a,...i}));Q_.displayName=`Button`;var $_=Eg(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function ev({className:e,variant:t,...n}){return(0,I.jsx)(`div`,{className:X_($_({variant:t}),e),...n})}typeof window<`u`&&window.document&&window.document.createElement;function tv(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function nv(e,t){let n=F.createContext(t),r=e=>{let{children:t,...r}=e,i=F.useMemo(()=>r,Object.values(r));return(0,I.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=F.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function rv(e,t=[]){let n=[];function r(t,r){let i=F.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=F.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=F.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>F.createContext(e));return function(n){let r=n?.[e]||t;return F.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,iv(i,...t)]}function iv(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return F.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var av=globalThis?.document?F.useLayoutEffect:()=>{},ov=F.useId||(()=>void 0),sv=0;function cv(e){let[t,n]=F.useState(ov());return av(()=>{e||n(e=>e??String(sv++))},[e]),e||(t?`radix-${t}`:``)}var lv=F.useInsertionEffect||av;function uv({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=dv({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=F.useRef(e!==void 0);F.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,F.useCallback(t=>{if(s){let n=fv(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function dv({defaultProp:e,onChange:t}){let[n,r]=F.useState(e),i=F.useRef(n),a=F.useRef(t);return lv(()=>{a.current=t},[t]),F.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function fv(e){return typeof e==`function`}
vendor: 5,411 bytes, line 22
22function pv(e){let t=mv(e),n=F.forwardRef((e,n)=>{let{children:r,...i}=e,a=F.Children.toArray(r),o=a.find(gv);if(o){let e=o.props.children,r=a.map(t=>t===o?F.Children.count(e)>1?F.Children.only(null):F.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:F.isValidElement(e)?F.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function mv(e){let t=F.forwardRef((e,t)=>{let{children:n,...r}=e;if(F.isValidElement(n)){let e=vv(n),i=_v(r,n.props);return n.type!==F.Fragment&&(i.ref=t?lg(t,e):e),F.cloneElement(n,i)}return F.Children.count(n)>1?F.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hv=Symbol(`radix.slottable`);function gv(e){return F.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===hv}function _v(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function vv(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yv=a(s(),1),bv=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=pv(`Primitive.${t}`),r=F.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xv(e,t){e&&yv.flushSync(()=>e.dispatchEvent(t))}function Sv(e){let t=F.useRef(e);return F.useEffect(()=>{t.current=e}),F.useMemo(()=>(...e)=>t.current?.(...e),[])}function Cv(e,t=globalThis?.document){let n=Sv(e);F.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var wv=`DismissableLayer`,Tv=`dismissableLayer.update`,Ev=`dismissableLayer.pointerDownOutside`,Dv=`dismissableLayer.focusOutside`,Ov,kv=F.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Av=F.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=F.useContext(kv),[u,d]=F.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=F.useState({}),m=ug(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Nv(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Pv(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Cv(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),F.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ov=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Fv(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ov)}},[u,f,n,l]),F.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Fv())},[u,l]),F.useEffect(()=>{let e=()=>p({});return document.addEventListener(Tv,e),()=>document.removeEventListener(Tv,e)},[]),(0,I.jsx)(bv.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:tv(e.onFocusCapture,S.onFocusCapture),onBlurCapture:tv(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:tv(e.onPointerDownCapture,x.onPointerDownCapture)})});Av.displayName=wv;var jv=`DismissableLayerBranch`,Mv=F.forwardRef((e,t)=>{let n=F.useContext(kv),r=F.useRef(null),i=ug(t,r);return F.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,I.jsx)(bv.div,{...e,ref:i})});Mv.displayName=jv;function Nv(e,t=globalThis?.document){let n=Sv(e),r=F.useRef(!1),i=F.useRef(()=>{});return F.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Iv(Ev,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Pv(e,t=globalThis?.document){let n=Sv(e),r=F.useRef(!1);return F.useEffect(()=>{let e=e=>{e.target&&!r.current&&Iv(Dv,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Fv(){let e=new CustomEvent(Tv);document.dispatchEvent(e)}function Iv(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?xv(i,a):i.dispatchEvent(a)}
vendor: 14,649 bytes, lines 22-62
22var Lv=`focusScope.autoFocusOnMount`,Rv=`focusScope.autoFocusOnUnmount`,zv={bubbles:!1,cancelable:!0},Bv=`FocusScope`,Vv=F.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=F.useState(null),l=Sv(i),u=Sv(a),d=F.useRef(null),f=ug(t,e=>c(e)),p=F.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;F.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Jv(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Jv(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Jv(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),F.useEffect(()=>{if(s){Yv.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Lv,zv);s.addEventListener(Lv,l),s.dispatchEvent(t),t.defaultPrevented||(Hv(Qv(Wv(s)),{select:!0}),document.activeElement===e&&Jv(s))}return()=>{s.removeEventListener(Lv,l),setTimeout(()=>{let t=new CustomEvent(Rv,zv);s.addEventListener(Rv,u),s.dispatchEvent(t),t.defaultPrevented||Jv(e??document.body,{select:!0}),s.removeEventListener(Rv,u),Yv.remove(p)},0)}}},[s,l,u,p]);let m=F.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Uv(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Jv(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Jv(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(bv.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Vv.displayName=Bv;function Hv(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Jv(r,{select:t}),document.activeElement!==n)return}function Uv(e){let t=Wv(e);return[Gv(t,e),Gv(t.reverse(),e)]}function Wv(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Gv(e,t){for(let n of e)if(!Kv(n,{upTo:t}))return n}function Kv(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function qv(e){return e instanceof HTMLInputElement&&`select`in e}function Jv(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qv(e)&&t&&e.select()}}var Yv=Xv();function Xv(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Zv(e,t),e.unshift(t)},remove(t){e=Zv(e,t),e[0]?.resume()}}}function Zv(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Qv(e){return e.filter(e=>e.tagName!==`A`)}var $v=`Portal`,ey=F.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=F.useState(!1);av(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?yv.createPortal((0,I.jsx)(bv.div,{...r,ref:t}),o):null});ey.displayName=$v;function ty(e,t){return F.useReducer((e,n)=>t[e][n]??e,e)}var ny=e=>{let{present:t,children:n}=e,r=ry(t),i=typeof n==`function`?n({present:r.isPresent}):F.Children.only(n),a=ug(r.ref,ay(i));return typeof n==`function`||r.isPresent?F.cloneElement(i,{ref:a}):null};ny.displayName=`Presence`;function ry(e){let[t,n]=F.useState(),r=F.useRef(null),i=F.useRef(e),a=F.useRef(`none`),[o,s]=ty(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return F.useEffect(()=>{let e=iy(r.current);a.current=o===`mounted`?e:`none`},[o]),av(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=iy(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),av(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=iy(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=iy(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:F.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function iy(e){return e?.animationName||`none`}function ay(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oy=0;function sy(){F.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??cy()),document.body.insertAdjacentElement(`beforeend`,e[1]??cy()),oy++,()=>{oy===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),oy--}},[])}function cy(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var ly=`right-scroll-bar-position`,uy=`width-before-scroll-bar`,dy=`with-scroll-bars-hidden`,fy=`--removed-body-scroll-bar-size`;function py(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function my(e,t){var n=(0,F.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var hy=typeof window<`u`?F.useLayoutEffect:F.useEffect,gy=new WeakMap;function _y(e,t){var n=my(t||null,function(t){return e.forEach(function(e){return py(e,t)})});return hy(function(){var t=gy.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||py(e,null)}),i.forEach(function(e){r.has(e)||py(e,a)})}gy.set(n,e)},[e]),n}function vy(e){return e}function yy(e,t){t===void 0&&(t=vy);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function by(e){e===void 0&&(e={});var t=yy(null);return t.options=hc({async:!0,ssr:!1},e),t}var xy=function(e){var t=e.sideCar,n=gc(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return F.createElement(r,hc({},n))};xy.isSideCarExport=!0;function Sy(e,t){return e.useMedium(t),xy}var Cy=by(),wy=function(){},Ty=F.forwardRef(function(e,t){var n=F.useRef(null),r=F.useState({onScrollCapture:wy,onWheelCapture:wy,onTouchMoveCapture:wy}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=gc(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=_y([n,t]),ee=hc(hc({},b),i);return F.createElement(F.Fragment,null,u&&F.createElement(x,{sideCar:Cy,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?F.cloneElement(F.Children.only(s),hc(hc({},ee),{ref:S})):F.createElement(v,hc({},ee,{className:c,ref:S}),s))});Ty.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ty.classNames={fullWidth:uy,zeroRight:ly};var Ey,Dy=function(){if(Ey)return Ey;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Oy(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Dy();return t&&e.setAttribute(`nonce`,t),e}function ky(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ay(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var jy=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Oy())&&(ky(t,n),Ay(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},My=function(){var e=jy();return function(t,n){F.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ny=function(){var e=My();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Py={left:0,top:0,right:0,gap:0},Fy=function(e){return parseInt(e||``,10)||0},Iy=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Fy(n),Fy(r),Fy(i)]},Ly=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Py;var t=Iy(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ry=Ny(),zy=`data-scroll-locked`,By=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` 23 .${dy} { 24 overflow: hidden ${r}; 25 padding-right: ${s}px ${r}; 26 } 27 body[${zy}] { 28 overflow: hidden ${r}; 29 overscroll-behavior: contain; 30 ${[t&&`position: relative ${r};`,n===`margin`&&` 31 padding-left: ${i}px; 32 padding-top: ${a}px; 33 padding-right: ${o}px; 34 margin-left:0; 35 margin-top:0; 36 margin-right: ${s}px ${r}; 37 `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)} 38 } 39 40 .${ly} { 41 right: ${s}px ${r}; 42 } 43 44 .${uy} { 45 margin-right: ${s}px ${r}; 46 } 47 48 .${ly} .${ly} { 49 right: 0 ${r}; 50 } 51 52 .${uy} .${uy} { 53 margin-right: 0 ${r}; 54 } 55 56 body[${zy}] { 57 ${fy}: ${s}px; 58 } 59`},Vy=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Hy=function(){F.useEffect(function(){return document.body.setAttribute(zy,(Vy()+1).toString()),function(){var e=Vy()-1;e<=0?document.body.removeAttribute(zy):document.body.setAttribute(zy,e.toString())}},[])},Uy=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Hy();var a=F.useMemo(function(){return Ly(i)},[i]);return F.createElement(Ry,{styles:By(a,!t,i,n?``:`!important`)})},Wy=!1;if(typeof window<`u`)try{var Gy=Object.defineProperty({},"passive",{get:function(){return Wy=!0,!0}});window.addEventListener(`test`,Gy,Gy),window.removeEventListener(`test`,Gy,Gy)}catch{Wy=!1}var Ky=Wy?{passive:!1}:!1,qy=function(e){return e.tagName===`TEXTAREA`},Jy=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!qy(e)&&n[t]===`visible`)},Yy=function(e){return Jy(e,`overflowY`)},Xy=function(e){return Jy(e,`overflowX`)},Zy=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),eb(e,r)){var i=tb(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qy=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},$y=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},eb=function(e,t){return e===`v`?Yy(t):Xy(t)},tb=function(e,t){return e===`v`?Qy(t):$y(t)},nb=function(e,t){return e===`h`&&t===`rtl`?-1:1},rb=function(e,t,n,r,i){var a=nb(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=tb(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&eb(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ib=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ab=function(e){return[e.deltaX,e.deltaY]},ob=function(e){return e&&`current`in e?e.current:e},sb=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cb=function(e){return` 60 .block-interactivity-${e} {pointer-events: none;} 61 .allow-interactivity-${e} {pointer-events: all;} 62`},lb=0,ub=[];function db(e){var t=F.useRef([]),n=F.useRef([0,0]),r=F.useRef(),i=F.useState(lb++)[0],a=F.useState(Ny)[0],o=F.useRef(e);F.useEffect(function(){o.current=e},[e]),F.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=vc([e.lockRef.current],(e.shards||[]).map(ob),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=F.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ib(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Zy(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Zy(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return rb(h,t,e,h===`h`?s:c,!0)},[]),c=F.useCallback(function(e){var n=e;if(!(!ub.length||ub[ub.length-1]!==a)){var r=`deltaY`in n?ab(n):ib(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&sb(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}
vendor: 8,566 bytes, line 62
62if(!i){var c=(o.current.shards||[]).map(ob).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=F.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:fb(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=F.useCallback(function(e){n.current=ib(e),r.current=void 0},[]),d=F.useCallback(function(t){l(t.type,ab(t),t.target,s(t,e.lockRef.current))},[]),f=F.useCallback(function(t){l(t.type,ib(t),t.target,s(t,e.lockRef.current))},[]);F.useEffect(function(){return ub.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ky),document.addEventListener(`touchmove`,c,Ky),document.addEventListener(`touchstart`,u,Ky),function(){ub=ub.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ky),document.removeEventListener(`touchmove`,c,Ky),document.removeEventListener(`touchstart`,u,Ky)}},[]);var p=e.removeScrollBar,m=e.inert;return F.createElement(F.Fragment,null,m?F.createElement(a,{styles:cb(i)}):null,p?F.createElement(Uy,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fb(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var pb=Sy(Cy,db),mb=F.forwardRef(function(e,t){return F.createElement(Ty,hc({},e,{ref:t,sideCar:pb}))});mb.classNames=Ty.classNames;var hb=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},gb=new WeakMap,_b=new WeakMap,vb={},yb=0,bb=function(e){return e&&(e.host||bb(e.parentNode))},xb=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=bb(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Sb=function(e,t,n,r){var i=xb(t,Array.isArray(e)?e:[e]);vb[n]||(vb[n]=new WeakMap);var a=vb[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(gb.get(e)||0)+1,l=(a.get(e)||0)+1;gb.set(e,c),a.set(e,l),o.push(e),c===1&&i&&_b.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),yb++,function(){o.forEach(function(e){var t=gb.get(e)-1,i=a.get(e)-1;gb.set(e,t),a.set(e,i),t||(_b.has(e)||e.removeAttribute(r),_b.delete(e)),i||e.removeAttribute(n)}),yb--,yb||(gb=new WeakMap,gb=new WeakMap,_b=new WeakMap,vb={})}},Cb=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||hb(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Sb(r,i,n,`aria-hidden`)):function(){return null}};function wb(e){let t=Tb(e),n=F.forwardRef((e,n)=>{let{children:r,...i}=e,a=F.Children.toArray(r),o=a.find(Db);if(o){let e=o.props.children,r=a.map(t=>t===o?F.Children.count(e)>1?F.Children.only(null):F.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:F.isValidElement(e)?F.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Tb(e){let t=F.forwardRef((e,t)=>{let{children:n,...r}=e;if(F.isValidElement(n)){let e=kb(n),i=Ob(r,n.props);return n.type!==F.Fragment&&(i.ref=t?lg(t,e):e),F.cloneElement(n,i)}return F.Children.count(n)>1?F.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Eb=Symbol(`radix.slottable`);function Db(e){return F.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Eb}function Ob(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function kb(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ab=`Dialog`,[jb,Mb]=rv(Ab),[Nb,Pb]=jb(Ab),Fb=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=F.useRef(null),c=F.useRef(null),[l,u]=uv({prop:r,defaultProp:i??!1,onChange:a,caller:Ab});return(0,I.jsx)(Nb,{scope:t,triggerRef:s,contentRef:c,contentId:cv(),titleId:cv(),descriptionId:cv(),open:l,onOpenChange:u,onOpenToggle:F.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Fb.displayName=Ab;var Ib=`DialogTrigger`,Lb=F.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Pb(Ib,n),a=ug(t,i.triggerRef);return(0,I.jsx)(bv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":rx(i.open),...r,ref:a,onClick:tv(e.onClick,i.onOpenToggle)})});Lb.displayName=Ib;var Rb=`DialogPortal`,[zb,Bb]=jb(Rb,{forceMount:void 0}),Vb=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Pb(Rb,t);return(0,I.jsx)(zb,{scope:t,forceMount:n,children:F.Children.map(r,e=>(0,I.jsx)(ny,{present:n||a.open,children:(0,I.jsx)(ey,{asChild:!0,container:i,children:e})}))})};Vb.displayName=Rb;var Hb=`DialogOverlay`,Ub=F.forwardRef((e,t)=>{let n=Bb(Hb,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Pb(Hb,e.__scopeDialog);return a.modal?(0,I.jsx)(ny,{present:r||a.open,children:(0,I.jsx)(Gb,{...i,ref:t})}):null});Ub.displayName=Hb;var Wb=wb(`DialogOverlay.RemoveScroll`),Gb=F.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Pb(Hb,n);return(0,I.jsx)(mb,{as:Wb,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(bv.div,{"data-state":rx(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Kb=`DialogContent`,qb=F.forwardRef((e,t)=>{let n=Bb(Kb,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Pb(Kb,e.__scopeDialog);return(0,I.jsx)(ny,{present:r||a.open,children:a.modal?(0,I.jsx)(Jb,{...i,ref:t}):(0,I.jsx)(Yb,{...i,ref:t})})});qb.displayName=Kb;var Jb=F.forwardRef((e,t)=>{let n=Pb(Kb,e.__scopeDialog),r=F.useRef(null),i=ug(t,n.contentRef,r);return F.useEffect(()=>{let e=r.current;if(e)return Cb(e)},[]),(0,I.jsx)(Xb,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tv(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:tv(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:tv(e.onFocusOutside,e=>e.preventDefault())})}),Yb=F.forwardRef((e,t)=>{let n=Pb(Kb,e.__scopeDialog),r=F.useRef(!1),i=F.useRef(!1);return(0,I.jsx)(Xb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Xb=F.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Pb(Kb,n),c=F.useRef(null),l=ug(t,c);return sy(),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Vv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(Av,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":rx(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(sx,{titleId:s.titleId}),(0,I.jsx)(lx,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Zb=`DialogTitle`,Qb=F.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Pb(Zb,n);return(0,I.jsx)(bv.h2,{id:i.titleId,...r,ref:t})});Qb.displayName=Zb;var $b=`DialogDescription`,ex=F.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Pb($b,n);return(0,I.jsx)(bv.p,{id:i.descriptionId,...r,ref:t})});ex.displayName=$b;var tx=`DialogClose`,nx=F.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Pb(tx,n);return(0,I.jsx)(bv.button,{type:`button`,...r,ref:t,onClick:tv(e.onClick,()=>i.onOpenChange(!1))})});nx.displayName=tx;function rx(e){return e?`open`:`closed`}var ix=`DialogTitleWarning`,[ax,ox]=nv(ix,{contentName:Kb,titleName:Zb,docsSlug:`dialog`}),sx=({titleId:e})=>
62{let t=ox(ix),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 63 64If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 65 66For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return F.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},cx=`DialogDescriptionWarning`,lx=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ox(cx).contentName}}.`;return F.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},ux=Fb,dx=Lb,fx=Vb,px=Ub,mx=qb,hx=Qb,gx=ex,_x=nx,vx=ux,yx=dx,bx=fx,xx=F.forwardRef(({className:e,...t},n)=>(0,I.jsx)(px,{className:X_(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));xx.displayName=px.displayName;var Sx=Eg(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),Cx=F.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,I.jsxs)(bx,{children:[(0,I.jsx)(xx,{}),(0,I.jsxs)(mx,{ref:i,className:X_(Sx({side:e}),t),...r,children:[(0,I.jsxs)(_x,{className:`absolute right-4 top-4 roun
66ded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,I.jsx)(sg,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),n]})]}));Cx.displayName=mx.displayName;var wx=({className:e,...t})=>(0,I.jsx)(`div`,{className:X_(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});wx.displayName=`SheetHeader`;var Tx=({className:e,...t})=>(0,I.jsx)(`div`,{className:X_(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Tx.displayName=`SheetFooter`;var Ex=F.forwardRef(({className:e,...t},n)=>(0,I.jsx)(hx,{ref:n,className:X_(`text-lg font-semibold text-foreground`,e),...t}));Ex.displayName=hx.displayName;var Dx=F.forwardRef(({className:e,...t},n)=>(0,I.jsx)(gx,{ref:n,className:X_(`text-sm text-muted-foreground`,e),...t}));Dx.displayName=gx.displayName;var Ox=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},kx=(e=>e?Ox(e):Ox),Ax=e=>e;function jx(e,t=Ax){let n=F.useSyncExternalStore(e.subscribe,F.useCallback(()=>t(e.getState()),[e,t]),F.useCallback(()=>t(e.getInitialState()),[e,t]));return F.useDebugValue(n),n}var Mx=e=>{let t=kx(e),n=e=>jx(t,e);return Object.assign(n,t),n},Nx=(e=>e?Mx(e):Mx);function Px(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var Fx=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return Fx(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return Fx(t)(e)}}}},Ix=(e,t)=>(n,r,i)=>{let a={storage:Px(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return Fx(u.getItem.bind(u))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},Lx=`https://saxon-site-refresh-70c4a-651qiuiu.myshopify.com/api/2025-07/graphql.json`,Rx=`b6692609f37fdc95ba023e42ab539888`,zx=` 67 id 68 title 69 description 70 handle 71 priceRange { minVariantPrice { amount currencyCode } } 72 images(first: 5) { edges { node { url altText } } } 73 variants(first: 20) { 74 edges { 75 node { 76 id 77 title 78 price { amount currencyCode } 79 availableForSale 80 selectedOptions { name value } 81 } 82 } 83 } 84 options { name values } 85`,Bx=` 86 query GetProducts($first: Int!, $query: String) { 87 products(first: $first, query: $query) { 88 edges { node { ${zx} } } 89 } 90 } 91`,Vx=` 92 query GetProduct($handle: String!) { 93 product(handle: $handle) { ${zx} } 94 } 95`;async function Hx(e,t={}){let n=await fetch(Lx,{method:`POST`,headers:{"Content-Type":`application/json`,"X-Shopify-Storefront-Access-Token":Rx},body:JSON.stringify({query:e,variables:t})});if(n.status===402){we.error(`Shopify: Payment required`,{description:`Shopify API access requires an active Shopify billing plan. Visit https://admin.shopify.com to upgrade.`});return}if(!n.ok)throw Error(`HTTP error! status: ${n.status}`);let r=await n.json();if(r.errors)throw Error(`Error calling Shopify: ${r.errors.map(e=>e.message).join(`, `)}`);return r}async function Ux(e=50){return(await Hx(Bx,{first:e}))?.data?.products?.edges??[]}async function Wx(e){let t=(await Hx(Vx,{handle:e}))?.data?.product;return t?{node:t}:null}function Gx(e,t=`GBP`){return new Intl.NumberFormat(`en-GB`,{style:`currency`,currency:t}).format(typeof e==`string`?parseFloat(e):e)}var Kx=` 96 query cart($id: ID!) { 97 cart(id: $id) { id totalQuantity } 98 } 99`,qx=` 100 mutation cartCreate($input: CartInput!) { 101 cartCreate(input: $input) { 102 cart { 103 id 104 checkoutUrl 105 lines(first: 100) { edges { node { id merchandise { ... on ProductVariant { id } } } } } 106 } 107 userErrors { field message } 108 } 109 } 110`,Jx=` 111 mutation cartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) { 112 cartLinesAdd(cartId: $cartId, lines: $lines) { 113 cart { 114 id 115 lines(first: 100) { edges { node { id merchandise { ... on ProductVariant { id } } } } } 116 } 117 userErrors { field message } 118 } 119 } 120`,Yx=` 121 mutation cartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) { 122 cartLinesUpdate(cartId: $cartId, lines: $lines) { 123 cart { id } 124 userErrors { field message } 125 } 126 } 127`,Xx=` 128 mutation cartLinesRemove($cartId: ID!, $lineIds: [ID!]!) { 129 cartLinesRemove(cartId: $cartId, lineIds: $lineIds) { 130 cart { id } 131 userErrors { field message } 132 } 133 } 134`;function Zx(e){try{let t=new URL(e);return t.searchParams.set(`channel`,`online_store`),t.toString()}catch{return e}}function Qx(e){return e.some(e=>e.message.toLowerCase().includes(`cart not found`)||e.message.toLowerCase().includes(`does not exist`))}async function $x(e){let t=await Hx(qx,{input:{lines:[{quantity:e.quantity,merchandiseId:e.variantId}]}});if(t?.data?.cartCreate?.userErrors?.length>0)return console.error(`Cart creation failed:`,t.data.cartCreate.userErrors),null;let n=t?.data?.cartCreate?.cart;if(!n?.checkoutUrl)return null;let r=n.lines.edges[0]?.node?.id;return r?{cartId:n.id,checkoutUrl:Zx(n.checkoutUrl),lineId:r}:null}async function eS(e,t){let n=await Hx(Jx,{cartId:e,lines:[{quantity:t.quantity,merchandiseId:t.variantId}]}),r=n?.data?.cartLinesAdd?.userErrors||[];return Qx(r)?{success:!1,cartNotFound:!0}:r.length>0?(console.error(`Add line failed:`,r),{success:!1}):{success:!0,lineId:(n?.data?.cartLinesAdd?.cart?.lines?.edges||[]).find(e=>e.node.merchandise.id===t.variantId)?.node?.id}}async function tS(e,t,n){let r=(await Hx(Yx,{cartId:e,lines:[{id:t,quantity:n}]}))?.data?.cartLinesUpdate?.userErrors||[];return Qx(r)?{success:!1,cartNotFound:!0}:r.length>0?(console.error(`Update line failed:`,r),{success:!1}):{success:!0}}async function nS(e,t){let n=(await Hx(Xx,{cartId:e,lineIds:[t]}))?.data?.cartLinesRemove?.userErrors||[];return Qx(n)?{success:!1,cartNotFound:!0}:n.length>0?(console.error(`Remove line failed:`,n),{success:!1}):{success:!0}}var rS=Nx()(Ix((e,t)=>({items:[],cartId:null,checkoutUrl:null,isLoading:!1,isSyncing:!1,addItem:async n=>{let{items:r,cartId:i,clearCart:a}=t(),o=r.find(e=>e.variantId===n.variantId);e({isLoading:!0});try{if(!i){let t=await $x({...n,lineId:null});t&&e({cartId:t.cartId,checkoutUrl:t.checkoutUrl,items:[{...n,lineId:t.lineId}]})}else if(o){let r=o.quantity+n.quantity;if(!o.lineId)return;let s=await tS(i,o.lineId,r);if(s.success){let i=t().items;e({items:i.map(e=>e.variantId===n.variantId?{...e,quantity:r}:e)})}else s.cartNotFound&&a()}else{let r=await eS(i,{...n,lineId:null});if(r.success){let i=t().items;e({items:[...i,{...n,lineId:r.lineId??null}]})}else r.cartNotFound&&a()}}catch(e){console.error(`Failed to add item:`,e)}finally{e({isLoading:!1})}},updateQuantity:async(n,r)=>{if(r<=0){await t().removeItem(n);return}let{items:i,cartId:a,clearCart:o}=t(),s=i.find(e=>e.variantId===n);if(!(!s?.lineId||!a)){e({isLoading:!0});try{let i=await tS(a,s.lineId,r);if(i.success){let i=t().items;e({items:i.map(e=>e.variantId===n?{...e,quantity:r}:e)})}else i.cartNotFound&&o()}catch(e){console.error(`Failed to update quantity:`,e)}finally{e({isLoading:!1})}}},removeItem:async n=>{let{items:r,cartId:i,clearCart:a}=t(),o=r.find(e=>e.variantId===n);if(!(!o?.lineId||!i)){e({isLoading:!0});try{let r=await nS(i,o.lineId);if(r.success){let r=t().items.filter(e=>e.variantId!==n);r.length===0?a():e({items:r})}else r.cartNotFound&&a()}catch(e){console.error(`Failed to remove item:`,e)}finally{e({isLoading:!1})}}},clearCart:()=>e({items:[],cartId:null,checkoutUrl:null}),getCheckoutUrl:()=>t().checkoutUrl,syncCart:async()=>{let{cartId:n,isSyncing:r,clearCart:i}=t();if(!(!n||r)){e({isSyncing:!0});try{let e=await Hx(Kx,{id:n});if(!e)return;let t=e?.data?.cart;(!t||t.totalQuantity===0)&&i()}catch(e){console.error(`Failed to sync cart with Shopify:`,e)}finally{e({isSyncing:!1})}}}}),{name:`shopify-cart`,storage:Px(()=>localStorage),partialize:e=>({items:e.items,cartId:e.cartId,checkoutUrl:e.checkoutUrl})})),iS=()=>{let[e,t]=(0,F.useState)(!1),{items:n,isLoading:r,isSyncing:i,updateQuantity:a,removeItem:o,getCheckoutUrl:s,syncCart:c}=rS(),l=n.reduce((e,t)=>
134e+t.quantity,0),u=n.reduce((e,t)=>e+parseFloat(t.price.amount)*t.quantity,0),d=n[0]?.price.currencyCode??`GBP`;return(0,F.useEffect)(()=>{e&&c()},[e,c]),(0,I.jsxs)(vx,{open:e,onOpenChange:t,children:[(0,I.jsx)(yx,{asChild:!0,children:(0,I.jsxs)(Q_,{variant:`outline`,size:`icon`,className:`relative shrink-0`,"aria-label":`Open cart`,children:[(0,I.jsx)(ag,{className:`h-5 w-5`}),l>0&&(0,I.jsx)(ev,{className:`absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full p-0 text-xs`,children:l})]})}),(0,I.jsxs)(Cx,{className:`flex h-full w-full flex-col sm:max-w-lg`,children:[(0,I.jsxs)(wx,{className:`flex-shrink-0`,children:[(0,I.jsx)(Ex,{children:`Your bag`}),(0,I.jsx)(Dx,{children:l===0?`Your bag is empty`:`${l} item${l===1?``:`s`} in your bag`})]}),(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-4 pt-6 pb-4`,children:n.length===0?(0,I.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,I.jsxs)(`div`,{className:`text-center`,children:[(0,I.jsx)(ag,{className:`text-muted-foreground mx-auto mb-4 h-12 w-12`}),(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`Your bag is empty`})]})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,I.jsx)(`div`,{className:`space-y-4`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`flex gap-4 py-2`,children:[(0,I.jsx)(`div`,{className:`bg-secondary h-16 w-16 flex-shrink-0 overflow-hidden`,children:e.product.node.images?.edges?.[0]?.node&&(0,I.jsx)(`img`,{src:e.product.node.images.edges[0].node.url,alt:e.product.node.title,className:`h-full w-full object-cover`,loading:`lazy`})}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`h4`,{className:`truncate text-sm font-semibold`,children:e.product.node.title}),(0,I.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e.selectedOptions.map(e=>e.value).join(` ⢠`)}),(0,I.jsx)(`p`,{className:`font-semibold`,children:Gx(e.price.amount,e.price.currencyCode)})]}),(0,I.jsxs)(`div`,{className:`flex flex-shrink-0 flex-col items-end gap-2`,children:[(0,I.jsx)(Q_,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>o(e.variantId),"aria-label":`Remove item`,children:(0,I.jsx)(og,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(Q_,{variant:`outline`,size:`icon`,className:`h-6 w-6`,onClick:()=>a(e.variantId,e.quantity-1),"aria-label":`Decrease quantity`,children:(0,I.jsx)(tg,{className:`h-3 w-3`})}),(0,I.jsx)(`span`,{className:`w-8 text-center text-sm`,children:e.quantity}),(0,I.jsx)(Q_,{variant:`outline`,size:`icon`,className:`h-6 w-6`,onClick:()=>a(e.variantId,e.quantity+1),"aria-label":`Increase quantity`,children:(0,I.jsx)(rg,{className:`h-3 w-3`})})]})]})]},e.variantId))})}),(0,I.jsxs)(`div`,{className:`bg-background flex-shrink-0 space-y-4 border-t pt-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-lg font-semibold`,children:`Total`}),(0,I.jsx)(`span`,{className:`text-xl font-bold`,children:Gx(u,d)})]}),(0,I.jsx)(Q_,{onClick:()=>{let e=s();e&&(window.open(e,`_blank`),t(!1))},className:`w-full`,size:`lg`,disabled:n.length===0||r||i,children:r||i?(0,I.jsx)(Yh,{className:`h-4 w-4 animate-spin`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qh,{className:`mr-2 h-4 w-4`}),`Checkout`]})})]})]})})]})]})},aS={name:`Saxon CrossFit`,tagline:`Wymondham's home of strength, fitness and community.`,address:`Wymondham Business Centre, Unit 7, Eleven Mile Lane, Suton, NR18 9JL`,phone:`01953 438538`,phoneHref:`tel:+441953438538`,email:`[email protected]`,teamup:{book:`https://goteamup.com/p/165980-saxon-crossfit/`,timetable:`https://goteamup.com/p/165980-saxon-fitness/`},socials:{facebook:`https://www.facebook.com/saxoncrossfit`,instagram:`https://www.instagram.com/saxoncrossfit`,youtube:`https://www.youtube.com/@SaxonCrossFit`}},oS=[{name:`3 x Fitter`,price:`£85`,period:`per month`,features:[`3 sessions per week`,`Access to coached sessions`,`No contract`,`No joining fee`],url:`https://goteamup.com/p/165980-saxon-fitness/memberships/plans/3161/`},{name:`Unlimited Fitness`,price:`£99`,period:`per month`,features:[`Unlimited sessions per week`,`Acce
134ss to coached sessions`,`No contract`,`No joining fee`],url:`https://goteamup.com/p/165980-saxon-fitness/memberships/plans/3160/`,featured:!0},{name:`Ultimate`,price:`£159`,period:`per month`,features:[`Unlimited coached sessions`,`Nutrition coaching`,`Accountability sessions`,`No contract, no joining fee`],url:`https://goteamup.com/p/165980-saxon-crossfit/memberships/222816/`}],sS=[{title:`Structure`,body:`A one hour coach led session focusing on constantly varied functional movement performed at a high intensity. Each session includes a warm up, a breakdown of the workout, a strength or skill element and a metabolic conditioning piece. Every day is different.`},{title:`Weightlifting`,body:`Powerlifting (deadlift, squat and bench press) alongside Olympic lifting (clean and jerk, snatch) to build strength and power. A strong body moves better, lives longer and burns fat.`},{title:`Gymnastics`,body:`Moving your bodyweight is one of the safest ways to get fit. From pull ups and push ups to handstands and rope climbs, we build strength and body awareness efficiently.`},{title:`Mobility`,body:`We mobilise before every session to increase active range of motion in every joint â protecting against injury and preventing stiffness in later life.`},{title:`Cardio`,body:`A large part of what we do is increasing your heart and lungs' ability to power your body. We use rowers, bikes, running and skipping to get the engine working hard.`},{title:`Scaled for you`,body:`Every workout can be scaled. Whether it's your first week or your tenth year, the coach adjusts the session so it challenges you at the right level.`}],cS={version:1,asset_id:`d951fdad-8399-44aa-9e25-87fb000ca24e`,project_id:`5f98ed70-b4ad-4e07-a6a4-35fbff87b4a2`,url:`/__l5e/assets-v1/d951fdad-8399-44aa-9e25-87fb000ca24e/saxon-helmet-red.png`,r2_key:`a/v1/5f98ed70-b4ad-4e07-a6a4-35fbff87b4a2/d951fdad-8399-44aa-9e25-87fb000ca24e/saxon-helmet-red.png`,original_filename:`saxon-helmet-red.png`,size:37040,content_type:`image/png`,created_at:`2026-07-28T21:45:54Z`},lS=fc({type:`function`}),uS=sc({method:`POST`}).handler(Po(`90802dada3e3abd94910b2d206a0941c3619e873fd29fa0ef5c768796ebe7044`)),dS=sc({method:`GET`}).middleware([lS]).handler(Po(`8ab1e2cca40116ca3126c6821f43d39d56ac8ca98eb8c914adb9a3d11500e5ca`)),fS=sc({method:`POST`}).middleware([lS]).handler(Po(`61398aacfc187161d1ebb0f2ea0b4e59c21fb3755a5b639c9cca46de4025e627`)),pS=sc({method:`GET`}).middleware([lS]).handler(Po(`9ae16f1d6e70ee9e0a33ce46aa195dcd59a908e01aa2209b2b44f4f23653dbf8`)),mS=[{to:`/`,label:`Home`},{to:`/classes`,label:`Training`},{to:`/academy`,label:`Academy`},{to:`/memberships`,label:`Memberships`},{to:`/coaches`,label:`Coaches`},{to:`/blog`,label:`Blog`},{to:`/shop`,label:`Shop`},{to:`/contact`,label:`Contact`}];function hS(){let[e,t]=(0,F.useState)(!1),[n,r]=(0,F.useState)(null),i=bs(),a=xh(),o=nc(pS);(0,F.useEffect)(()=>{sm.auth.getUser().then(({data:e})=>{r(e.user)});let{data:e}=sm.auth.onAuthStateChange((e,t)=>{r(t?.user??null),e===`SIGNED_OUT`&&(a.cancelQueries(),a.clear())});return()=>{e.subscription.unsubscribe()}},[a]);let{data:s=0}=Ih({queryKey:[`unread-enquiry-count`],queryFn:()=>o(),enabled:!!n,refetchInterval:6e4}),c=async()=>{await a.cancelQueries(),a.clear(),await sm.auth.signOut(),i({to:`/`,replace:!0})};return(0,I.jsxs)(`header`,{className:`border-border/70 bg-background/90 sticky top-0 z-50 border-b backdrop-blur`,children:[(0,I.jsxs)(`div`,{className:`mx-auto grid max-w-7xl grid-cols-[minmax(0,1fr)_auto] items-center gap-4 px-4 py-3 lg:px-8`,children:[(0,I.jsxs)(be,{to:`/`,className:`flex min-w-0 items-center gap-3`,onClick:()=>t(!1),children:[(0,I.jsx)(`img`,{src:cS.url,alt:`Saxon CrossFit helmet logo`,className:`h-10 w-auto shrink-0`,width:80,height:87}),(0,I.jsxs)(`span`,{className:`font-display truncate text-2xl tracking-wide sm:text-3xl`,children:[`Saxon `,(0,I.jsx)(`span`,{className:`text-primary`,children:`CrossFit`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`nav`,{className:`hidden items-center gap-6 lg:flex`,children:[mS.map(e=>(0,I.jsx)(be,{to:e.to,className:`text-muted-foreground hover:text-foreground [&.active]:text-primary text-xs font-semibold tracking-[0.18em] uppercase transition-colors`,children:e.label},e.to)),n&&(0,I.jsxs)(be,{to:`/admin/enquiries`,className:`text-muted-foreground hover:text-foreground [&.active]:text-primary relative text-xs font-semibold tracking-[0.18em] uppercase transition-colors`,children:[(0,I.jsx)(Jh,{className:`inline h-4 w-4`}),(0,I.jsx)(`span`,{className:`ml-1`,children:`Enquiries`}),s>0&&(0,I.jsx)(`span`,{className:`bg-saxon-red absolute -right-2.5 -top-1.5 flex h-4 w-4 items-center justify-center rounded-full text-[10px] text-white`,children:s})]}),n&&(0,I.jsx)(be,{to:`/write`,className:`text-muted-foreground hover:text-foreground [&.active]:text-primary text-xs font-semibold tracking-[0.18em] uppercase transition-colors`,children:`Write`})]}),n?(0,I.jsxs)(Q_,{variant:`outline`,size:`sm`,onClick:c,className:`hidden sm:inline-flex`,children:[(0,I.jsx)(Xh,{
134className:`mr-1 h-4 w-4`}),`Sign out`]}):(0,I.jsx)(Q_,{asChild:!0,size:`sm`,className:`hidden sm:inline-flex`,children:(0,I.jsx)(`a`,{href:aS.teamup.book,target:`_blank`,rel:`noopener noreferrer`,children:`Book a session`})}),(0,I.jsx)(iS,{}),(0,I.jsx)(Q_,{variant:`outline`,size:`icon`,className:`lg:hidden`,onClick:()=>t(e=>!e),"aria-label":`Toggle menu`,children:e?(0,I.jsx)(sg,{className:`h-5 w-5`}):(0,I.jsx)($h,{className:`h-5 w-5`})})]})]}),e&&(0,I.jsx)(`nav`,{className:`border-border bg-surface border-t lg:hidden`,children:(0,I.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col px-4 py-2`,children:[mS.map(e=>(0,I.jsx)(be,{to:e.to,onClick:()=>t(!1),className:`border-border/60 hover:text-primary border-b py-3 text-sm font-semibold tracking-[0.18em] uppercase last:border-0`,children:e.label},e.to)),n&&(0,I.jsxs)(be,{to:`/admin/enquiries`,onClick:()=>t(!1),className:`border-border/60 hover:text-primary border-b py-3 text-sm font-semibold tracking-[0.18em] uppercase`,children:[`Enquiries`,s>0&&(0,I.jsx)(`span`,{className:`bg-saxon-red ml-2 inline-flex h-5 w-5 items-center justify-center rounded-full text-xs text-white`,children:s})]}),n&&(0,I.jsx)(be,{to:`/write`,onClick:()=>t(!1),className:`border-border/60 hover:text-primary border-b py-3 text-sm font-semibold tracking-[0.18em] uppercase`,children:`Write a post`}),n?(0,I.jsx)(Q_,{onClick:c,className:`my-3`,children:`Sign out`}):(0,I.jsx)(Q_,{asChild:!0,className:`my-3`,children:(0,I.jsx)(`a`,{href:aS.teamup.book,target:`_blank`,rel:`noopener noreferrer`,children:`Book a session`})})]})})]})}function gS({className:e}){return(0,I.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:e,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`})})}function _S({className:e}){return(0,I.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:e,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z`})})}function vS({className:e}){return(0,I.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,className:e,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`})})}function yS(){return(0,I.jsxs)(`footer`,{className:`border-border bg-surface mt-24 border-t`,children:[(0,I.jsxs)(`div`,{className:`mx-auto grid max-w-7xl gap-10 px-4 py-14 lg:grid-cols-4 lg:px-8`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`img`,{src:cS.url,alt:`Saxon CrossFit helmet logo`,className:`mb-4 h-14 w-auto`,width:110,height:120,loading:`lazy`}),(0,I.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:aS.tagline})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`mb-4 text-sm tracking-[0.2em]`,children:`Explore`}),(0,I.jsx)(`ul`,{className:`text-muted-foreground space-y-2 text-sm`,children:[{to:`/classes`,label:`Training Sessions`},{to:`/memberships`,label:`Memberships`},{to:`/coaches`,label:`Coaches`},{to:`/blog`,label:`Blog`},{to:`/shop`,label:`Shop`}].map(e=>(0,I.jsx)(`li`,{children:(0,I.jsx)(be,{to:e.to,className:`hover:text-primary transition-colors`,children:e.label})},e.to))})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`mb-4 text-sm tracking-[0.2em]`,children:`Train with us`}),(0,I.jsxs)(`ul`,{className:`text-muted-foreground space-y-2 text-sm`,children:[(0,I.jsx)(`li`,{children:(0,I.jsx)(`a`,{href:aS.teamup.book,target:`_blank`,rel:`noopener noreferrer`,className:`hover:text-primary transition-colors`,children:`Book a session`})}),(0,I.jsx)(`li`,{children:(0,I.jsx)(`a`,{href:aS.teamup.timetable,target:`_blank`,rel:`noopener noreferrer`,className:`hover:text-primary transition-colors`,children:`See the timetable`})}),(0,I.jsx)(`li`,{children:(0,I.jsx)(be,{to:`/contact`,className:`hover:text-primary transition-colors`,children:`Book a free taster`})})]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`mb-4 text-sm tracking-[0.2em]`,children:`Find us`}),(0,I.jsxs)(`ul`,{className:`text-muted-foreground space-y-3 text-sm`,children:[(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(Qh,{className:`text-primary mt-0.5 h-4 w-4 shrink-0`}),(0,I.jsx)(`span`,{children:aS.address})]}),(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(ng,{className:`text-primary mt-0.5 h-4 w-4 shrink-0`}),(0,I.jsx)(`a`,{href:aS.phoneHref,className:`hover:text-primary transition-colors`,children:aS.phone})]}),(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(Zh,{className:`text-primary mt-0.5 h-4 w-4 shrink-0`}),(0,I.jsx)(`a`,{href:`mailto:${aS.email}`,className:`hover:text-primary transition-colors`,children:aS.email})]})]}),(0,I.jsxs)(`div`,{className:`mt-6`,children:[(0,I.jsx)(`h4`,{className:`mb-3 text-xs tracking-[0.15em] text-muted-foreground`,children:`Follow us`}),(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`a`,{href:aS.socials.facebook,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Saxon CrossFit on Facebook`,className:`bg-background hover:bg-primary hover:text-primary-foreground text-muted-foreground inline-flex h-10 w-10 items-center justify-center rounded-full transition-colors`,children:(0,I.jsx)(gS,{className:`h-5 w-5`})}),(0,I.jsx)(`a`,{href:aS.socials.instagram,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Saxon CrossFit on Instagram`,className:`bg-background hover:bg-primary hover:text-primary-foreground text-muted-foreground inline-flex h-10 w-10 items-center justify-center rounded-full transition-colors`,children:(0,I.jsx)(_S,{className:`h-5 w-5`})}),(0,I.jsx)(`a`,{href:aS.socials.youtube,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Saxon CrossFit on YouTube`,className:`bg-background hover:bg-primary hover:text-primary-foreground text-muted-foreground inline-flex h-10 w-10 items-center justify-center rounded-full transition-colors`,children:(0,I.jsx)(vS,{className:`h-5 w-5`})})]})]})]})]}),(0,I.jsxs)(`div`,{className:`border-border text-muted-foreground flex flex-col items-center gap-2 border-t px-4 py-6 text-center text-xs sm:flex-row sm:justify-between lg:px-8`,children:[(0,I.jsxs)(`span`,{children:[`© `,new Date().getFullYear(),` Saxon CrossFit. All rights reserved.`]}),(0,I.jsxs)(`span`,{children:[`Saxon Fitness Ltd · Company no. 11292693 ·`,` `,(0,I.jsx)(be,{to:`/privacy`,className:`hover:text-primary transition-colors`,children:`Privacy`}),` · `,(0,I.jsx)(be,{to:`/terms`,className:`hover:text-primary transition-colors`,children:`Terms`}),` · `,(0,I.jsx)(be,{to:`/refund`,className:`hover:text-primary transition-colors`,children:`Refunds`})]})]})]})}var bS=`vercel.ai.error`,xS=Symbol.for(bS),SS,CS,wS=class e extends (CS=Error,SS=xS,CS){constructor({name:e,message:t,cause:n}){super(t),this[SS]=!0,this.name=e,this.cause=n}
134static isInstance(t){return e.hasMarker(t,bS)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};function TS(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var ES=`AI_InvalidArgumentError`,DS=`vercel.ai.error.${ES}`,OS=Symbol.for(DS),kS,AS,jS=class extends (AS=wS,kS=OS,AS){constructor({message:e,cause:t,argument:n}){super({name:ES,message:e,cause:t}),this[kS]=!0,this.argument=n}static isInstance(e){return wS.hasMarker(e,DS)}},MS=`AI_JSONParseError`,NS=`vercel.ai.error.${MS}`,PS=Symbol.for(NS),FS,IS,LS=class extends (IS=wS,FS=PS,IS){constructor({text:e,cause:t}){super({name:MS,message:`JSON parsing failed: Text: ${e}. 135Error message: ${TS(t)}`,cause:t}),this[FS]=!0,this.text=e}static isInstance(e){return wS.hasMarker(e,NS)}},RS=`AI_TypeValidationError`,zS=`vercel.ai.error.${RS}`,BS=Symbol.for(zS),VS,HS,US=class e extends (HS=wS,VS=BS,HS){constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:RS,message:`${r}: Value: ${JSON.stringify(e)}. 136Error message: ${TS(t)}`,cause:t}),this[VS]=!0,this.value=e,this.context=n}static isInstance(e){return wS.hasMarker(e,zS)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}};Object.freeze({status:`aborted`});function X(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var WS=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},GS={};function KS(e){return e&&Object.assign(GS,e),GS}function qS(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function JS(e,t){return typeof t==`bigint`?t.toString():t}function YS(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function XS(e){return e==null}function ZS(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function QS(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}function $S(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw Error(`cached value already set`)},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function eC(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function tC(e){return JSON.stringify(e)}var nC=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function rC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var iC=YS(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function aC(e){if(rC(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(rC(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}var oC=new Set([`string`,`number`,`symbol`]);function sC(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function cC(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function lC(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var uC={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function dC(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return cC(e,{...e._zod.def,shape:n,checks:[]})}function fC(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return cC(e,{...e._zod.def,shape:n,checks:[]})}function pC(e,t){if(!aC(t))throw Error(`Invalid input to extend: expected a plain object`);return cC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return eC(this,`shape`,n),n},checks:[]})}function mC(e,t){return cC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return eC(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function hC(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return cC(t,{...t._zod.def,shape:i,checks:[]})}
136function gC(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return cC(t,{...t._zod.def,shape:i,checks:[]})}function _C(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function vC(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function yC(e){return typeof e==`string`?e:e?.message}function bC(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=yC(e.inst?._zod.def?.error?.(e))??yC(t?.error?.(e))??yC(n.customError?.(e))??yC(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function xC(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function SC(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var CC=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,JS,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},wC=X(`$ZodError`,CC),TC=X(`$ZodError`,CC,{Parent:Error});function EC(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function DC(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}var OC=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new WS;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>bC(e,a,KS())));throw nC(t,i?.callee),t}return o.value},kC=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>bC(e,a,KS())));throw nC(t,i?.callee),t}return o.value},AC=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new WS;return a.issues.length?{success:!1,error:new(e??wC)(a.issues.map(e=>bC(e,i,KS())))}:{success:!0,data:a.value}},jC=AC(TC),MC=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>bC(e,i,KS())))}:{success:!0,data:a.value}},NC=MC(TC),PC=/^[cC][^\s-]{8,}$/,FC=/^[0-9a-z]+$/,IC=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,LC=/^[0-9a-vA-V]{20}$/,RC=/^[A-Za-z0-9]{27}$/,zC=/^[a-zA-Z0-9_-]{21}$/,BC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VC=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,HC=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,UC=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WC=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function GC(){return new RegExp(WC,`u`)}var KC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,JC=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,YC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,XC=/^$|^(?:[0-9a-zA-Z+/]{4}
vendor: 11,218 bytes, lines 136-138
136)*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ZC=/^[A-Za-z0-9_-]*$/,QC=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,$C=/^\+(?:[0-9]){6,14}[0-9]$/,ew=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,tw=RegExp(`^${ew}$`);function nw(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rw(e){return RegExp(`^${nw(e)}$`)}function iw(e){let t=nw({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-]\\d{2}:\\d{2})`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${ew}T(?:${r})$`)}var aw=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ow=/^\d+$/,sw=/^-?\d+(?:\.\d+)?/i,cw=/true|false/i,lw=/null/i,uw=/^[^A-Z]*$/,dw=/^[^a-z]*$/,fw=X(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),pw={number:`number`,bigint:`bigint`,object:`date`},mw=X(`$ZodCheckLessThan`,(e,t)=>{fw.init(e,t);let n=pw[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hw=X(`$ZodCheckGreaterThan`,(e,t)=>{fw.init(e,t);let n=pw[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gw=X(`$ZodCheckMultipleOf`,(e,t)=>{fw.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):QS(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),_w=X(`$ZodCheckNumberFormat`,(e,t)=>{fw.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=uC[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=ow)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),vw=X(`$ZodCheckMaxLength`,(e,t)=>{var n;fw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!XS(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=xC(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yw=X(`$ZodCheckMinLength`,(e,t)=>{var n;fw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!XS(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=xC(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bw=X(`$ZodCheckLengthEquals`,(e,t)=>{var n;fw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!XS(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=xC(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xw=X(`$ZodCheckStringFormat`,(e,t)=>{var n,r;fw.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Sw=X(`$ZodCheckRegex`,(e,t)=>{xw.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Cw=X(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=uw,xw.init(e,t)}),ww=X(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=dw,xw.init(e,t)}),Tw=X(`$ZodCheckIncludes`,(e,t)=>{fw.init(e,t);let n=sC(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ew=X(`$ZodCheckStartsWith`,(e,t)=>{fw.init(e,t);let n=RegExp(`^${sC(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Dw=X(`$ZodCheckEndsWith`,(e,t)=>{fw.init(e,t);let n=RegExp(`.*${sC(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ow=X(`$ZodCheckOverwrite`,(e,t)=>{fw.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),kw=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` 137`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(` 138`))}},Aw={major:4,minor:0,patch:0},jw=X(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Aw;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=_C(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new WS;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=_C(e,t))});else{if(e.issues.length===t)continue;r||=_C(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new WS;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=jC(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return NC(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Mw=X(`$ZodString`,(e,t)=>{jw.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??aw(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Nw=X(`$ZodStringFormat`,(e,t)=>{xw.init(e,t),Mw.init(e,t)}),Pw=X(`$ZodGUID`,(e,t)=>{t.pattern??=VC,Nw.init(e,t)}),Fw=X(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=HC(e)}else t.pattern??=HC();Nw.init(e,t)}),Iw=X(`$ZodEmail`,(e,t)=>{t.pattern??=UC,Nw.init(e,t)}),Lw=X(`$ZodURL`,(e,t)=>{Nw.init(e,t),e._zod.check=n=>{try{let r=n.value,i=new URL(r),a=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:QC.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith(`/`)&&a.endsWith(`/`)?n.value=a.slice(0,-1):n.value=a;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Rw=X(`$ZodEmoji`,(e,t)=>{t.pattern??=GC(),Nw.init(e,t)}),zw=X(`$ZodNanoID`,(e,t)=>{t.pattern??=zC,Nw.init(e,t)}),Bw=X(`$ZodCUID`,(e,t)=>{t.pattern??=PC,Nw.init(e,t)}),Vw=X(`$ZodCUID2`,(e,t)=>{t.pattern??=FC,Nw.init(e,t)}),Hw=X(`$ZodULID`,(e,t)=>{t.pattern??=IC,Nw.init(e,t)}),Uw=X(`$ZodXID`,(e,t)=>{t.pattern??=LC,Nw.init(e,t)}),Ww=X(`$ZodKSUID`,(e,t)=>{t.pattern??=RC,Nw.init(e,t)}),Gw=X(`$ZodISODateTime`,(e,t)=>{t.pattern??=iw(t),Nw.init(e,t)}),Kw=X(`$ZodISODate`,(e,t)=>{t.pattern??=tw,Nw.init(e,t)}),qw=X(`$ZodISOTime`,(e,t)=>{t.pattern??=rw(t),Nw.init(e,t)}),Jw=X(`$ZodISODuration`,(e,t)=>{t.pattern??=BC,Nw.init(e,t)}),Yw=X(`$ZodIPv4`,(e,t)=>{t.pattern??=KC,Nw.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),Xw=X(`$ZodIPv6`,(e,t)=>{t.pattern??=qC,Nw.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Zw=X(`$ZodCIDRv4`,(e,t)=>{t.pattern??=JC,Nw.init(e,t)}),Qw=X(`$ZodCIDRv6`,(e,t)=>{t.pattern??=YC,Nw.init(e,t),e._zod.check=n=>{let[r,i]=n.value.split(`/`);try{if(!i)throw Error();let e=Number(i);if(`${e}`!==i||e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function $w(e){if(e===``)return!0;
138if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var eT=X(`$ZodBase64`,(e,t)=>{t.pattern??=XC,Nw.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{$w(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function tT(e){if(!ZC.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $w(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var nT=X(`$ZodBase64URL`,(e,t)=>{t.pattern??=ZC,Nw.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{tT(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rT=X(`$ZodE164`,(e,t)=>{t.pattern??=$C,Nw.init(e,t)});function iT(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var aT=X(`$ZodJWT`,(e,t)=>{Nw.init(e,t),e._zod.check=n=>{iT(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),oT=X(`$ZodNumber`,(e,t)=>{jw.init(e,t),e._zod.pattern=e._zod.bag.pattern??sw,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),sT=X(`$ZodNumber`,(e,t)=>{_w.init(e,t),oT.init(e,t)}),cT=X(`$ZodBoolean`,(e,t)=>{jw.init(e,t),e._zod.pattern=cw,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),lT=X(`$ZodNull`,(e,t)=>{jw.init(e,t),e._zod.pattern=lw,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),uT=X(`$ZodUnknown`,(e,t)=>{jw.init(e,t),e._zod.parse=e=>e}),dT=X(`$ZodNever`,(e,t)=>{jw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function fT(e,t,n){e.issues.length&&t.issues.push(...vC(n,e.issues)),t.value[n]=e.value}var pT=X(`$ZodArray`,(e,t)=>{jw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>fT(t,n,e))):fT(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function mT(e,t,n){e.issues.length&&t.issues.push(...vC(n,e.issues)),t.value[n]=e.value}function hT(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...vC(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}var gT=X(`$ZodObject`,(e,t)=>{jw.init(e,t);let n=YS(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof jw))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=lC(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});$S(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new kw([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=tC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=tC(e);t.write(` 139 if (${n}.issues.length) { 140 if (input[${r}] === undefined) { 141 if (${r} in input) { 142 newResult[${r}] = undefined; 143 } 144 } else { 145 payload.issues = payload.issues.concat( 146 ${n}.issues.map((iss) => ({ 147 ...iss, 148 path: iss.path ? [${r}, ...iss.path] : [${r}], 149 })) 150 ); 151 } 152 } else if (${n}.value === undefined) { 153 if (${r} in input) newResult[${r}] = undefined; 154 } else { 155 newResult[${r}] = ${n}.value; 156 } 157 `)}else{let n=a[e];t.write(`const ${n} = ${i(e)};`),t.write(` 158 if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ 159 ...iss, 160 path: iss.path ? [${tC(e)}, ...iss.path] : [${tC(e)}] 161 })));`),t.write(`newResult[${tC(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=rC,o=!GS.jitless,s=o&&iC.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?hT(e,u,t,f):mT(e,u,t))):i?hT(r,u,t,f):mT(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;
vendor: 16,054 bytes, line 161
161let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>mT(t,u,e))):mT(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function _T(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>bC(e,r,KS())))}),t}var vT=X(`$ZodUnion`,(e,t)=>{jw.init(e,t),$S(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),$S(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),$S(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),$S(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ZS(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>_T(t,n,e,r)):_T(a,n,e,r)}}),yT=X(`$ZodDiscriminatedUnion`,(e,t)=>{vT.init(e,t);let n=e._zod.parse;$S(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=YS(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!rC(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,input:o,path:[t.discriminator],inst:e}),i)}}),bT=X(`$ZodIntersection`,(e,t)=>{jw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ST(e,t,n)):ST(e,i,a)}});function xT(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(aC(e)&&aC(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=xT(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=xT(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ST(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),_C(e))return e;let r=xT(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var CT=X(`$ZodRecord`,(e,t)=>{jw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!aC(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...vC(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...vC(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>bC(e,r,KS())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...vC(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...vC(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),wT=X(`$ZodEnum`,(e,t)=>{jw.init(e,t);let n=qS(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>oC.has(typeof e)).map(e=>typeof e==`string`?sC(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),TT=X(`$ZodLiteral`,(e,t)=>{jw.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?sC(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),ET=X(`$ZodTransform`,(e,t)=>{jw.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new WS;return e.value=r,e}}),DT=X(`$ZodOptional`,(e,t)=>{jw.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,$S(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),$S(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ZS(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),OT=X(`$ZodNullable`,(e,t)=>{jw.init(e,t),$S(e._zod,`optin`,()=>t.innerType._zod.optin),$S(e._zod,`optout`,()=>t.innerType._zod.optout),$S(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ZS(e.source)}|null)$`):void 0}),$S(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),kT=X(`$ZodDefault`,(e,t)=>{jw.init(e,t),e._zod.optin=`optional`,$S(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>AT(e,t)):AT(r,t)}});function AT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var jT=X(`$ZodPrefault`,(e,t)=>{jw.init(e,t),e._zod.optin=`optional`,$S(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),MT=X(`$ZodNonOptional`,(e,t)=>{jw.init(e,t),$S(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>NT(t,e)):NT(i,e)}});function NT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var PT=X(`$ZodCatch`,(e,t)=>{jw.init(e,t),e._zod.optin=`optional`,$S(e._zod,`optout`,()=>t.innerType._zod.optout),$S(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>bC(e,n,KS()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>bC(e,n,KS()))},input:e.value}),e.issues=[]),e)}}),FT=X(`$ZodPipe`,(e,t)=>{jw.init(e,t),$S(e._zod,`values`,()=>t.in._zod.values),$S(e._zod,`optin`,()=>t.in._zod.optin),$S(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>IT(e,t,n)):IT(r,t,n)}});function IT(e,t,n){return _C(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var LT=X(`$ZodReadonly`,(e,t)=>{jw.init(e,t),$S(e._zod,`propValues`,()=>t.innerType._zod.propValues),$S(e._zod,`values`,()=>t.innerType._zod.values),$S(e._zod,`optin`,()=>t.innerType._zod.optin),$S(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(RT):RT(r)}});function RT(e){return e.value=Object.freeze(e.value),e}var zT=X(`$ZodLazy`,(e,t)=>{jw.init(e,t),$S(e._zod,`innerType`,()=>t.getter()),$S(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),$S(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),$S(e._zod,`optin`,()=>e._zod.innerType._zod.optin),$S(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),BT=X(`$ZodCustom`,(e,t)=>{fw.init(e,t),jw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>VT(t,n,r,e));VT(i,n,r,e)}});function VT(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(SC(e))}}var HT=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function UT(){return new HT}var WT=UT();function GT(e,t){return new e({type:`string`,...Z(t)})}function KT(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Z(t)})}function qT(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Z(t)})}function JT(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Z(t)})}function YT(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Z(t)})}function XT(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Z(t)})}function ZT(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Z(t)})}function QT(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Z(t)})}function $T(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Z(t)})}function eE(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Z(t)})}function tE(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Z(t)})}function nE(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Z(t)})}function rE(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Z(t)})}function iE(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Z(t)})}function aE(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Z(t)})}function oE(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Z(t)})}function sE(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Z(t)})}function cE(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Z(t)})}function lE(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Z(t)})}function uE(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Z(t)})}function dE(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Z(t)})}function fE(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Z(t)})}function pE(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Z(t)})}function mE(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Z(t)})}function hE(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Z(t)})}function gE(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Z(t)})}function _E(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Z(t)})}function vE(e,t){return new e({type:`number`,checks:[],...Z(t)})}function yE(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Z(t)})}function bE(e,t){return new e({type:`boolean`,...Z(t)})}function xE(e,t){return new e({type:`null`,...Z(t)})}function SE(e){return new e({type:`unknown`})}function CE(e,t){return new e({type:`never`,...Z(t)})}function wE(e,t){return new mw({check:`less_than`,...Z(t),value:e,inclusive:!1})}function TE(e,t){return new mw({check:`less_than`,...Z(t),value:e,inclusive:!0})}function EE(e,t){return new hw({check:`greater_than`,...Z(t),value:e,inclusive:!1})}function DE(e,t){return new hw({check:`greater_than`,...Z(t),value:e,inclusive:!0})}function OE(e,t){return new gw({check:`multiple_of`,...Z(t),value:e})}function kE(e,t){return new vw({check:`max_length`,...Z(t),maximum:e})}function AE(e,t){return new yw({check:`min_length`,...Z(t),minimum:e})}function jE(e,t){return new bw({check:`length_equals`,...Z(t),length:e})}function ME(e,t){return new Sw({check:`string_format`,format:`regex`,...Z(t),pattern:e})}function NE(e){return new Cw({check:`string_format`,format:`lowercase`,...Z(e)})}function PE(e){return new ww({check:`string_format`,format:`uppercase`,...Z(e)})}function FE(e,t){return new Tw({check:`string_format`,format:`includes`,...Z(t),includes:e})}function IE(e,t){return new Ew({check:`string_format`,format:`starts_with`,...Z(t),prefix:e})}function LE(e,t){return new Dw({check:`string_format`,format:`ends_with`,...Z(t),suffix:e})}function RE(e){return new Ow({check:`overwrite`,tx:e})}function zE(e){return RE(t=>t.normalize(e))}function BE(){return RE(e=>e.trim())}function VE(){return RE(e=>e.toLowerCase())}function HE(){return RE(e=>e.toUpperCase())}function UE(e,t,n){return new e({type:`array`,element:t,...Z(n)})}function WE(e,t,n){let r=Z(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function GE(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Z(n)})}var KE=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??WT,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>
161({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;typeof a==`string`&&a.includes(`int`)?n.type=`integer`:n.type=`number`,typeof c==`number`&&(n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:t.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:t.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?i.prefixItems=a:i.items=a,r.rest){let e=this.process(r.rest,{...n,path:[...n.path,`items`]});this.target===`draft-2020-12`?i.items=e:i.additionalItems=e}r.rest&&(i.items=this.process(r.rest,{...n,path:[...n.path,`items`]}));let{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s);break}case`record`:{let e=t;e.type=`object`,e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]}),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=qS(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0)if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n;break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:t.anyOf=[this.process(r.innerType,n),{type:`null`}];break;case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&JE(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>
vendor: 2,203 bytes, lines 161-163
161{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/<root> 162 163Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function qE(e,t){if(e instanceof HT){let n=new KE(t),r={};
163for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new KE(t);return n.process(e),n.emit(e,t)}function JE(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return JE(r.element,n);case`object`:for(let e in r.shape)if(JE(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(JE(e,n))return!0;return!1;case`intersection`:return JE(r.left,n)||JE(r.right,n);case`tuple`:for(let e of r.items)if(JE(e,n))return!0;return!!(r.rest&&JE(r.rest,n));case`record`:return JE(r.keyType,n)||JE(r.valueType,n);case`map`:return JE(r.keyType,n)||JE(r.valueType,n);case`set`:return JE(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return JE(r.innerType,n);case`lazy`:return JE(r.getter(),n);case`default`:return JE(r.innerType,n);case`prefault`:return JE(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return JE(r.in,n)||JE(r.out,n);case`success`:return!1;case`catch`:return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var YE=X(`ZodISODateTime`,(e,t)=>{Gw.init(e,t),pD.init(e,t)});function XE(e){return mE(YE,e)}var ZE=X(`ZodISODate`,(e,t)=>{Kw.init(e,t),pD.init(e,t)});function QE(e){return hE(ZE,e)}var $E=X(`ZodISOTime`,(e,t)=>{qw.init(e,t),pD.init(e,t)});function eD(e){return gE($E,e)}var tD=X(`ZodISODuration`,(e,t)=>{Jw.init(e,t),pD.init(e,t)});function nD(e){return _E(tD,e)}var rD=(e,t)=>{wC.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>DC(e,t)},flatten:{value:t=>EC(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})};X(`ZodError`,rD);var iD=X(`ZodError`,rD,{Parent:Error}),aD=OC(iD),oD=kC(iD),sD=AC(iD),cD=MC(iD),lD=X(`ZodType`,(e,t)=>(jw.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>cC(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>aD(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>sD(e,t,n),e.parseAsync=async(t,n)=>oD(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>cD(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(jO(t,n)),e.superRefine=t=>e.check(MO(t)),e.overwrite=t=>e.check(RE(t)),e.optional=()=>dO(e),e.nullable=()=>pO(e),e.nullish=()=>dO(pO(e)),e.nonoptional=t=>yO(e,t),e.array=()=>KD(e),e.or=t=>ZD([e,t]),e.and=t=>tO(e,t),e.transform=t=>CO(e,lO(t)),e.default=t=>hO(e,t),e.prefault=t=>_O(e,t),e.catch=t=>xO(e,t),e.pipe=t=>CO(e,t),e.readonly=()=>TO(e),e.describe=t=>{let n=e.clone();return WT.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return WT.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return WT.get(e);let n=e.clone();return WT.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),uD=X(`_ZodString`,(e,t)=>{Mw.init(e,t),lD.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(ME(...t)),e.includes=(...t)=>e.check(FE(...t)),e.startsWith=(...t)=>e.check(IE(...t)),e.endsWith=(...t)=>e.check(LE(...t)),e.min=(...t)=>e.check(AE(...t)),e.max=(...t)=>e.check(kE(...t)),e.length=(...t)=>e.check(jE(...t)),e.nonempty=(...t)=>e.check(AE(1,...t)),e.lowercase=t=>e.check(NE(t)),e.uppercase=t=>e.check(PE(t)),e.trim=()=>e.check(BE()),e.normalize=(...t)=>e.check(zE(...t)),e.toLowerCase=()=>e.check(VE()),e.toUpperCase=()=>e.check(HE())}),dD=X(`ZodString`,(e,t)=>{Mw.init(e,t),uD.init(e,t),e.email=t=>e.check(KT(mD,t)),e.url=t=>e.check(QT(_D,t)),e.jwt=t=>e.check(pE(MD,t)),e.emoji=t=>e.check($T(vD,t)),e.guid=t=>e.check(qT(hD,t)),e.uuid=t=>e.check(JT(gD,t)),e.uuidv4=t=>e.check(YT(gD,t)),e.uuidv6=t=>e.check(XT(gD,t)),e.uuidv7=t=>e.check(ZT(gD,t)),e.nanoid=t=>e.check(eE(yD,t)),e.guid=t=>e.check(qT(hD,t)),e.cuid=t=>e.check(tE(bD,t)),e.cuid2=t=>e.check(nE(xD,t)),e.ulid=t=>e.check(rE(SD,t)),e.base64=t=>e.check(uE(kD,t)),e.base64url=t=>e.check(dE(AD,t)),e.xid=t=>e.check(iE(CD,t)),e.ksuid=t=>e.check(aE(wD,t)),e.ipv4=t=>e.check(oE(TD,t)),e.ipv6=t=>e.check(sE(ED,t)),e.cidrv4=t=>e.check(cE(DD,t)),e.cidrv6=t=>e.check(lE(OD,t)),e.e164=t=>e.check(fE(jD,t)),e.datetime=t=>e.check(XE(t)),e.date=t=>e.check(QE(t)),e.time=t=>e.check(eD(t)),e.duration=t=>e.check(nD(t))});function fD(e){return GT(dD,e)}var pD=X(`ZodStringFormat`,(e,t)=>{Nw.init(e,t),uD.init(e,t)}),mD=X(`ZodEmail`,(e,t)=>{Iw.init(e,t),pD.init(e,t)}),hD=X(`ZodGUID`,(e,t)=>{Pw.init(e,t),pD.init(e,t)}),gD=X(`ZodUUID`,(e,t)=>{Fw.init(e,t),pD.init(e,t)}),_D=X(`ZodURL`,(e,t)=>{Lw.init(e,t),pD.init(e,t)}),vD=X(`ZodEmoji`,(e,t)=>{Rw.init(e,t),pD.init(e,t)}),yD=X(`ZodNanoID`,(e,t)=>{zw.init(e,t),pD.init(e,t)}),bD=X(`ZodCUID`,(e,t)=>{Bw.init(e,t),pD.init(e,t)}),xD=X(`ZodCUID2`,(e,t)=>{Vw.init(e,t),pD.init(e,t)}),SD=X(`ZodULID`,(e,t)=>{Hw.init(e,t),pD.init(e,t)}),CD=X(`ZodXID`,(e,t)=>{Uw.init(e,t),pD.init(e,t)}),wD=X(`ZodKSUID`,(e,t)=>{Ww.init(e,t),pD.init(e,t)}),TD=X(`ZodIPv4`,(e,t)=>{Yw.init(e,t),pD.init(e,t)}),ED=X(`ZodIPv6`,(e,t)=>{Xw.init(e,t),pD.init(e,t)}),DD=X(`ZodCIDRv4`,(e,t)=>{Zw.init(e,t),pD.init(e,t)}),OD=X(`ZodCIDRv6`,(e,t)=>{Qw.init(e,t),pD.init(e,t)}),kD=X(`ZodBase64`,(e,t)=>{eT.init(e,t),pD.init(e,t)}),AD=X(`ZodBase64URL`,(e,t)=>{nT.init(e,t),pD.init(e,t)}),jD=X(`ZodE164`,(e,t)=>{rT.init(e,t),pD.init(e,t)}),MD=X(`ZodJWT`,(e,t)=>{aT.init(e,t),pD.init(e,t)}),ND=X(`ZodNumber`,(e,t)=>{oT.init(e,t),lD.init(e,t),e.gt=(t,n)=>e.check(EE(t,n)),e.gte=(t,n)=>e.check(DE(t,n)),e.min=(t,n)=>e.check(DE(t,n)),e.lt=(t,n)=>e.check(wE(t,n)),e.lte=(t,n)=>e.check(TE(t,n)),e.max=(t,n)=>e.check(TE(t,n)),e.int=t=>e.check(ID(t)),e.safe=t=>e.check(ID(t)),e.positive=t=>e.check(EE(0,t)),e.nonnegative=t=>e.check(DE(0,t)),e.negative=t=>e.check(wE(0,t)),e.nonpositive=t=>e.check(TE(0,t)),e.multipleOf=(t,n)=>e.check(OE(t,n)),e.step=(t,n)=>e.check(OE(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function PD(e){return vE(ND,e)}var FD=X(`ZodNumberFormat`,(e,t)=>{sT.init(e,t),ND.init(e,t)});
163function ID(e){return yE(FD,e)}var LD=X(`ZodBoolean`,(e,t)=>{cT.init(e,t),lD.init(e,t)});function RD(e){return bE(LD,e)}var zD=X(`ZodNull`,(e,t)=>{lT.init(e,t),lD.init(e,t)});function BD(e){return xE(zD,e)}var VD=X(`ZodUnknown`,(e,t)=>{uT.init(e,t),lD.init(e,t)});function HD(){return SE(VD)}var UD=X(`ZodNever`,(e,t)=>{dT.init(e,t),lD.init(e,t)});function WD(e){return CE(UD,e)}var GD=X(`ZodArray`,(e,t)=>{pT.init(e,t),lD.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(AE(t,n)),e.nonempty=t=>e.check(AE(1,t)),e.max=(t,n)=>e.check(kE(t,n)),e.length=(t,n)=>e.check(jE(t,n)),e.unwrap=()=>e.element});function KD(e,t){return UE(GD,e,t)}var qD=X(`ZodObject`,(e,t)=>{gT.init(e,t),lD.init(e,t),$S(e,`shape`,()=>t.shape),e.keyof=()=>aO(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:HD()}),e.loose=()=>e.clone({...e._zod.def,catchall:HD()}),e.strict=()=>e.clone({...e._zod.def,catchall:WD()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>pC(e,t),e.merge=t=>mC(e,t),e.pick=t=>dC(e,t),e.omit=t=>fC(e,t),e.partial=(...t)=>hC(uO,e,t[0]),e.required=(...t)=>gC(vO,e,t[0])});function JD(e,t){return new qD({type:`object`,get shape(){return eC(this,`shape`,{...e}),this.shape},...Z(t)})}function YD(e,t){return new qD({type:`object`,get shape(){return eC(this,`shape`,{...e}),this.shape},catchall:HD(),...Z(t)})}var XD=X(`ZodUnion`,(e,t)=>{vT.init(e,t),lD.init(e,t),e.options=t.options});function ZD(e,t){return new XD({type:`union`,options:e,...Z(t)})}var QD=X(`ZodDiscriminatedUnion`,(e,t)=>{XD.init(e,t),yT.init(e,t)});function $D(e,t,n){return new QD({type:`union`,options:t,discriminator:e,...Z(n)})}var eO=X(`ZodIntersection`,(e,t)=>{bT.init(e,t),lD.init(e,t)});function tO(e,t){return new eO({type:`intersection`,left:e,right:t})}var nO=X(`ZodRecord`,(e,t)=>{CT.init(e,t),lD.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function rO(e,t,n){return new nO({type:`record`,keyType:e,valueType:t,...Z(n)})}var iO=X(`ZodEnum`,(e,t)=>{wT.init(e,t),lD.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new iO({...t,checks:[],...Z(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new iO({...t,checks:[],...Z(r),entries:i})}});function aO(e,t){return new iO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Z(t)})}var oO=X(`ZodLiteral`,(e,t)=>{TT.init(e,t),lD.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if
163(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function sO(e,t){return new oO({type:`literal`,values:Array.isArray(e)?e:[e],...Z(t)})}var cO=X(`ZodTransform`,(e,t)=>{ET.init(e,t),lD.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(SC(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(SC(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function lO(e){return new cO({type:`transform`,transform:e})}var uO=X(`ZodOptional`,(e,t)=>{DT.init(e,t),lD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dO(e){return new uO({type:`optional`,innerType:e})}var fO=X(`ZodNullable`,(e,t)=>{OT.init(e,t),lD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pO(e){return new fO({type:`nullable`,innerType:e})}var mO=X(`ZodDefault`,(e,t)=>{kT.init(e,t),lD.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hO(e,t){return new mO({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var gO=X(`ZodPrefault`,(e,t)=>{jT.init(e,t),lD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function _O(e,t){return new gO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var vO=X(`ZodNonOptional`,(e,t)=>{MT.init(e,t),lD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function yO(e,t){return new vO({type:`nonoptional`,innerType:e,...Z(t)})}var bO=X(`ZodCatch`,(e,t)=>{PT.init(e,t),lD.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xO(e,t){return new bO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var SO=X(`ZodPipe`,(e,t)=>{FT.init(e,t),lD.init(e,t),e.in=t.in,e.out=t.out});function CO(e,t){return new SO({type:`pipe`,in:e,out:t})}var wO=X(`ZodReadonly`,(e,t)=>{LT.init(e,t),lD.init(e,t)});function TO(e){return new wO({type:`readonly`,innerType:e})}var EO=X(`ZodLazy`,(e,t)=>{zT.init(e,t),lD.init(e,t),e.unwrap=()=>e._zod.def.getter()});function DO(e){return new EO({type:`lazy`,getter:e})}var OO=X(`ZodCustom`,(e,t)=>{BT.init(e,t),lD.init(e,t)});function kO(e){let t=new fw({check:`custom`});return t._zod.check=e,t}function AO(e,t){return WE(OO,e??(()=>!0),t)}function jO(e,t={}){return GE(OO,e,t)}function MO(e){let t=kO(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(SC(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(SC(r))}},e(n.value,n)));return t}function NO(e,t={error:`Input not instance of ${e.name}`}){let n=new OO({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...Z(t)});return n._zod.bag.Class=e,n}var PO=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},FO=10,IO=13,LO=32;function RO(e){}function zO(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=RO,onError:n=RO,onRetry:r=RO,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(` 164`)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new PO(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(` 165`,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(` 166`,n);continue}let i=e.charCodeAt(n);if(BO(e,n,i)){let i=e.charCodeAt(n+5)===LO?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===FO){t({id:l,event:f,data:a}),l=void 0,u=``,f=void 0,n=r+2,r=e.indexOf(` 167`,n);continue}u=d===0?a:`${u} 168${a}`,d++}else VO(e,n,i)?f=e.slice(e.charCodeAt(n+6)===LO?n+7:n+6,r)||void 0:_(e,n,r);n=r+1,r=e.indexOf(` 169`,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(` 170`,n),i=-1;if(t!==-1&&r!==-1?i=t<r?t:r:t===-1?r!==-1&&(i=r):i=t===e.length-1?-1:t,i===-1)break;_(e,n,i),n=i+1,e.charCodeAt(n-1)===IO&&e.charCodeAt(n)===FO&&n++}return e.slice(n)}function _(e,t,n){if(t===n){y();return}let r=e.charCodeAt(t);if(BO(e,t,r)){let r=e.charCodeAt(t+5)===LO?t+6:t+5,i=e.slice(r,n);u=d===0?i:`${u} 171${i}`,d++;return}if(VO(e,t,r)){f=e.slice(e.charCodeAt(t+6)===LO?t+7:t+6,n)||void 0;return}if(r===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let r=e.slice(e.charCodeAt(t+3)===LO?t+4:t+3,n);r.includes(`\0`)||(l=r);return}if(r===58){i&&i(e.slice(t,n).slice(e.charCodeAt(t+1)===LO?2:1));return}let a=e.slice(t,n),o=a.indexOf(`:`);
vendor: 4,992 bytes, lines 171-172
171if(o===-1){v(a,``,a);return}let s=a.slice(0,o),c=a.charCodeAt(o+1)===LO?2:1;v(s,a.slice(o+c),a)}function v(e,t,i){switch(e){case`event`:f=t||void 0;break;case`data`:u=d===0?t:`${u} 172${t}`,d++;break;case`id`:t.includes(`\0`)||(l=t);break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new PO(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new PO(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function BO(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function VO(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var HO=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=zO({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}};new TextDecoder;var{btoa:UO,atob:WO}=globalThis,GO=globalThis.fetch;KO(GO);function KO(e){if(typeof e!=`function`)return!1;let t=Function.prototype.toString.call(e);return t.includes(`internal/deps/undici`)||t.includes(`lazy loading of undici`)}function qO(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error(`Capture current module path`);Error.captureStackTrace(e,qO);let[t]=e.stack,n=t?.getFileName();if(n==null)throw Error(`Unable to determine the current module path`);return n}finally{Error.prepareStackTrace=e}}var JO=({prefix:e,size:t=16,alphabet:n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,separator:r=`-`}={})=>{let i=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join(``)};if(e==null)return i;if(n.includes(r))throw new jS({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},YO=JO();function XO(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}function ZO(e){return globalThis.Buffer?.isBuffer(e)??!1}var QO=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,$O=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function ek(e){let t=JSON.parse(e);return typeof t!=`object`||!t||QO.test(e)===!1&&$O.test(e)===!1?t:tk(t)}function tk(e){let t=[e];for(;t.length;){let e=t;t=[];for(let n of e){if(Object.prototype.hasOwnProperty.call(n,`__proto__`)||Object.prototype.hasOwnProperty.call(n,`constructor`)&&n.constructor!==null&&typeof n.constructor==`object`&&Object.prototype.hasOwnProperty.call(n.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(let e in n){let r=n[e];r&&typeof r==`object`&&t.push(r)}}}return e}function nk(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return ek(e)}try{return ek(e)}finally{Error.stackTraceLimit=t}}function rk(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){e.additionalProperties=!1;let{properties:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=ik(t[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(ik):ik(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(ik)),e.allOf!=null&&(e.allOf=e.allOf.map(ik)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(ik));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=ik(t[e]);return e}function ik(e){return typeof e==`boolean`?e:rk(e)}var ak=Symbol(`Let zodToJsonSchema decide on which parser to use`),ok={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},sk=e=>typeof e==`string`?{...ok,name:e}:{...ok,...e};function ck(){return{}}function lk(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==`ZodAny`&&(n.items=eA(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,
vendor: 10,182 bytes, lines 172-176
172n.maxItems=e.exactLength.value),n}function uk(e){let t={type:`integer`,format:`int64`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value;break}return t}function dk(){return{type:`boolean`}}function fk(e,t){return eA(e.type._def,t)}var pk=(e,t)=>eA(e.innerType._def,t);function mk(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(n=>mk(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return hk(e)}}var hk=e=>{let t={type:`integer`,format:`unix-time`};for(let n of e.checks)switch(n.kind){case`min`:t.minimum=n.value;break;case`max`:t.maximum=n.value;break}return t};function gk(e,t){return{...eA(e.innerType._def,t),default:e.defaultValue()}}function _k(e,t){return t.effectStrategy===`input`?eA(e.schema._def,t):ck()}function vk(e){return{type:`string`,enum:Array.from(e.values)}}var yk=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function bk(e,t){let n=[eA(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),eA(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(yk(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}function xk(e){let t=typeof e.value;return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}var Sk=void 0,Ck={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Sk===void 0&&(Sk=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),Sk),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function wk(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`email`:switch(t.emailStrategy){case`format:email`:Ok(n,`email`,r.message,t);break;case`format:idn-email`:Ok(n,`idn-email`,r.message,t);break;case`pattern:zod`:kk(n,Ck.email,r.message,t);break}break;case`url`:Ok(n,`uri`,r.message,t);break;case`uuid`:Ok(n,`uuid`,r.message,t);break;case`regex`:kk(n,r.regex,r.message,t);break;case`cuid`:kk(n,Ck.cuid,r.message,t);break;case`cuid2`:kk(n,Ck.cuid2,r.message,t);break;case`startsWith`:kk(n,RegExp(`^${Tk(r.value,t)}`),r.message,t);break;case`endsWith`:kk(n,RegExp(`${Tk(r.value,t)}$`),r.message,t);break;case`datetime`:Ok(n,`date-time`,r.message,t);break;case`date`:Ok(n,`date`,r.message,t);break;case`time`:Ok(n,`time`,r.message,t);break;case`duration`:Ok(n,`duration`,r.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`includes`:kk(n,RegExp(Tk(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&Ok(n,`ipv4`,r.message,t),r.version!==`v4`&&Ok(n,`ipv6`,r.message,t);break;case`base64url`:kk(n,Ck.base64url,r.message,t);break;case`jwt`:kk(n,Ck.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&kk(n,Ck.ipv4Cidr,r.message,t),r.version!==`v4`&&kk(n,Ck.ipv6Cidr,r.message,t);break;case`emoji`:kk(n,Ck.emoji(),r.message,t);break;case`ulid`:kk(n,Ck.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:Ok(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:kk(n,Ck.base64,r.message,t);break}break;case`nanoid`:kk(n,Ck.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function Tk(e,t){return t.patternStrategy===`escape`?Dk(e):e}var Ek=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function Dk(e){let t=``;for(let n=0;n<e.length;n++)Ek.has(e[n])||(t+=`\\`),t+=e[n];return t}function Ok(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function kk(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Ak(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=Ak(t,r)}function Ak(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++){if(a){i+=r[e],a=!1;continue}if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r 173]))`;continue}else if(r[e]===`$`){i+=`($|(?=[\r 174]))`;continue}}if(n.s&&r[e]===`.`){i+=o?`${r[e]}\r 175`:`[${r[e]}\r 176]`;continue}i+=r[e],r[e]===`\\`?a=!0:o&&r[e]===`]`?o=!1:!o&&r[e]===`[`&&(o=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function jk(e,t){let n={type:`object`,additionalProperties:eA(e.valueType._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]})??t.allowedAdditionalProperties};if(e.keyType?._def.typeName===`ZodString`&&e.keyType._def.checks?.length){let{type:r,...i}=wk(e.keyType._def,t);return{...n,propertyNames:i}}else if(e.keyType?._def.typeName===`ZodEnum`)return{...n,propertyNames:{enum:e.keyType._def.values}};else if(e.keyType?._def.typeName===`ZodBranded`&&e.keyType._def.type._def.typeName===`ZodString`&&e.keyType._def.type._def.checks?.length){let{type:r,...i}=fk(e.keyType._def,t);return{...n,propertyNames:i}}return n}function Mk(e,t){return t.mapStrategy===`record`?jk(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[eA(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||ck(),eA(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||ck()],minItems:2,maxItems:2}}}function Nk(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:r.length===1?r[0]===`string`?`string`:`number`:[`string`,`number`],enum:n}}function Pk(){return{not:ck()}}function Fk(){return{type:`null`}}var Ik={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function Lk(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in Ik&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=Ik[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}else if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return Rk(e,t)}var Rk=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>eA(e._def,{...t,currentPath:[...t.currentPath,`anyOf`,`${n}`]})).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function zk(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Ik[e.innerType._def.typeName],`null`]};let n=eA(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});
vendor: 18,115 bytes, line 176
176return n&&{anyOf:[n,{type:`null`}]}}function Bk(e){let t={type:`number`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`int`:t.type=`integer`;break;case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value;break}return t}function Vk(e,t){let n={type:`object`,properties:{}},r=[],i=e.shape();for(let e in i){let a=i[e];if(a===void 0||a._def===void 0)continue;let o=Uk(a),s=eA(a._def,{...t,currentPath:[...t.currentPath,`properties`,e],propertyPath:[...t.currentPath,`properties`,e]});s!==void 0&&(n.properties[e]=s,o||r.push(e))}r.length&&(n.required=r);let a=Hk(e,t);return a!==void 0&&(n.additionalProperties=a),n}function Hk(e,t){if(e.catchall._def.typeName!==`ZodNever`)return eA(e.catchall._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]});switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function Uk(e){try{return e.isOptional()}catch{return!0}}var Wk=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return eA(e.innerType._def,t);let n=eA(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return n?{anyOf:[{not:ck()},n]}:ck()},Gk=(e,t)=>{if(t.pipeStrategy===`input`)return eA(e.in._def,t);if(t.pipeStrategy===`output`)return eA(e.out._def,t);let n=eA(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]});return{allOf:[n,eA(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]})].filter(e=>e!==void 0)}};function Kk(e,t){return eA(e.type._def,t)}function qk(e,t){let n={type:`array`,uniqueItems:!0,items:eA(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function Jk(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>eA(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:eA(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>eA(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function Yk(){return{not:ck()}}function Xk(){return ck()}var Zk=(e,t)=>eA(e.innerType._def,t),Qk=(e,t,n)=>{switch(t){case`ZodString`:return wk(e,n);case`ZodNumber`:return Bk(e);case`ZodObject`:return Vk(e,n);case`ZodBigInt`:return uk(e);case`ZodBoolean`:return dk();case`ZodDate`:return mk(e,n);case`ZodUndefined`:return Yk();case`ZodNull`:return Fk();case`ZodArray`:return lk(e,n);case`ZodUnion`:case`ZodDiscriminatedUnion`:return Lk(e,n);case`ZodIntersection`:return bk(e,n);case`ZodTuple`:return Jk(e,n);case`ZodRecord`:return jk(e,n);case`ZodLiteral`:return xk(e);case`ZodEnum`:return vk(e);case`ZodNativeEnum`:return Nk(e);case`ZodNullable`:return zk(e,n);case`ZodOptional`:return Wk(e,n);case`ZodMap`:return Mk(e,n);case`ZodSet`:return qk(e,n);case`ZodLazy`:return()=>e.getter()._def;case`ZodPromise`:return Kk(e,n);case`ZodNaN`:case`ZodNever`:return Pk();case`ZodEffects`:return _k(e,n);case`ZodAny`:return ck();case`ZodUnknown`:return Xk();case`ZodDefault`:return gk(e,n);case`ZodBranded`:return fk(e,n);case`ZodReadonly`:return Zk(e,n);case`ZodCatch`:return pk(e,n);case`ZodPipeline`:return Gk(e,n);case`ZodFunction`:case`ZodVoid`:case`ZodSymbol`:return;default:return(e=>void 0)(t)}},$k=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)};function eA(e,t,n=!1){let r=t.seen.get(e);if(t.override){let i=t.override?.call(t,e,t,r,n);if(i!==ak)return i}if(r&&!n){let e=tA(r,t);if(e!==void 0)return e}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=Qk(e,e.typeName,t),o=typeof a==`function`?eA(a(),t):a;if(o&&nA(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var tA=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:$k(t.currentPath,e.path)};case`none`:case`seen`:return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),ck()):t.$refStrategy===`seen`?ck():void 0}},nA=(e,t,n)=>(e.description&&(n.description=e.description),n),rA=e=>{let t=sk(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}},iA=(e,t)=>{let n=rA(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:eA(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??ck()}),{}):void 0,i=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,a=eA(e._def,i===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1)??ck(),o=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;o!==void 0&&(a.title=o);let s=i===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy===`relative`?[]:n.basePath,n.definitionPath,i].join(`/`),[n.definitionPath]:{...r,[i]:a}};return s.$schema=`http://json-schema.org/draft-07/schema#`,s},aA=Symbol.for(`vercel.ai.schema`);function oA(e){let t;return()=>(t??=e(),t)}function sA(e,{validate:t}={}){return{[aA]:!0,_type:void 0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function cA(e){return typeof e==`object`&&!!e&&aA in e&&e[aA]===!0&&`jsonSchema`in e&&`validate`in e}function lA(e){return e==null?sA({type:`object`,properties:{},additionalProperties:!1}):cA(e)?e:`~standard`in e?e[`~standard`].vendor===`zod`?hA(e):uA(e):e()}function uA(e){return sA(()=>{if(!dA(e))throw Error(`Standard schema vendor '${e[`~standard`].vendor}' does not support JSON Schema conversion.`);return rk(e[`~standard`].jsonSchema.input({target:`draft-07`}))},{validate:async t=>{let n=await e[`~standard`].validate(t);return`value`in n?{success:!0,value:n.value}:{success:!1,error:new US({value:t,cause:n.issues})}}})}function dA(e){return e[`~standard`].jsonSchema!=null}function fA(e,t){let n=t?.useReferences??!1;return sA(()=>iA(e,{$refStrategy:n?`root`:`none`}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function pA(e,t){let n=t?.useReferences??!1;return sA(()=>rk(qE(e,{target:`draft-7`,io:`input`,reused:n?`ref`:`inline`})),{validate:async t=>{let n=await cD(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function mA(e){return`_zod`in e}function hA(e,t){return mA(e)?pA(e,t):fA(e,t)}async function gA({value:e,schema:t,context:n}){let r=await _A({value:e,schema:t,context:n});if(!r.success)throw US.wrap({value:e,cause:r.error,context:n});return r.value}async function _A({value:e,schema:t,context:n}){let r=lA(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:US.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:US.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function vA({text:e,schema:t}){try{let n=nk(e);return t==null?{success:!0,value:n,rawValue:n}:await _A({value:n,schema:t})}catch(t){return{success:!1,error:LS.isInstance(t)?t:new LS({text:e,cause:t}),rawValue:void 0}}}function yA({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new HO).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await vA({text:e,schema:t}))}}))}async function bA(e){return typeof e==`function`&&(e=e()),Promise.resolve(e)}new TextDecoder;var xA=Object.defineProperty,SA=(e,t)=>{for(var n in t)xA(e,n,{get:t[n],enumerable:!0})},CA=`AI_NoObjectGeneratedError`,wA=`vercel.ai.error.${CA}`,TA=Symbol.for(wA),EA,DA=class extends wS{constructor({message:e=`No object generated.`,cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:CA,message:e,cause:t}),this[EA]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return wS.hasMarker(e,wA)}};EA=TA;var OA=`AI_UIMessageStreamError`,kA=`vercel.ai.error.${OA}`,AA=Symbol.for(kA),jA,MA=class extends wS{constructor({chunkType:e,chunkId:t,message:n}){super({name:OA,message:n}),this[jA]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return wS.hasMarker(e,kA)}};jA=AA;function NA(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let r in t)if(!(r===`__proto__`||r===`constructor`||r===`prototype`)&&Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];if(i===void 0)continue;let a=r in e?e[r]:void 0,o=typeof i==`object`&&!!i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),s=typeof a==`object`&&!!a&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);o&&s?n[r]=NA(a,i):n[r]=i}return n}var Q={array:KD,boolean:RD,custom:AO,discriminatedUnion:$D,enum:aO,instanceof:NO,lazy:DO,literal:sO,looseObject:YD,never:WD,null:BD,number:PD,object:JD,record:rO,string:fD,union:ZD,unknown:HD},PA=Q.lazy(()=>Q.union([Q.null(),Q.string(),Q.number(),Q.boolean(),Q.record(Q.string(),PA.optional()),Q.array(PA)])),$=Q.record(Q.string(),Q.record(Q.string(),PA.optional())),FA=Q.union([Q.string(),Q.instanceof(Uint8Array),Q.instanceof(ArrayBuffer),Q.custom(ZO,{message:`Must be a Buffer`})]),IA=Q.record(Q.string(),Q.string()),LA=Q.object({type:Q.literal(`text`),text:Q.string(),providerOptions:$.optional()}),RA=Q.object({type:Q.literal(`image`),image:Q.union([FA,Q.instanceof(URL),IA]),mediaType:Q.string().optional(),providerOptions:$.optional()}),zA=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`data`),data:FA}),Q.object({type:Q.literal(`url`),url:Q.instanceof(URL)}),Q.object({type:Q.literal(`reference`),reference:IA}),Q.object({type:Q.literal(`text`),text:Q.string()})]),BA=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`data`),data:FA}),Q.object({type:Q.literal(`url`),url:Q.instanceof(URL)})]),VA=Q.object({type:Q.literal(`file`),data:Q.union([zA,FA,Q.instanceof(URL),IA]),filename:Q.string().optional(),mediaType:Q.string(),providerOptions:$.optional()}),HA=Q.object({type:Q.literal(`reasoning`),text:Q.string(),providerOptions:$.optional()}),UA=Q.object({type:Q.literal(`custom`),kind:Q.string().transform(e=>e),providerOptions:$.optional()}),WA=Q.object({type:Q.literal(`reasoning-file`),data:Q.union([BA,FA,Q.instanceof(URL)]),mediaType:Q.string(),providerOptions:$.optional()}),GA=Q.object({type:Q.literal(`tool-call`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerOptions:$.optional(),providerExecuted:Q.boolean().optional()}),KA=Q.discriminatedUnion(`type`,[Q.object({type:Q.literal(`text`),value:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`json`),value:PA,providerOptions:$.optional()}),Q.object({type:Q.literal(`execution-denied`),reason:Q.string().optional(),providerOptions:$.optional()}),Q.object({type:Q.literal(`error-text`),value:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`error-json`),value:PA,providerOptions:$.optional()}),Q.object({type:Q.literal(`content`),value:Q.array(Q.union([Q.object({type:Q.literal(`text`),text:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`file`),data:zA,mediaType:Q.string(),filename:Q.string().optional(),providerOptions:$.optional()}),Q.object({type:Q.literal(`file-data`),data:Q.string(),mediaType:Q.string(),filename:Q.string().optional(),providerOptions:$.optional()}),Q.object({type:Q.literal(`file-url`),url:Q.string(),mediaType:Q.string().optional(),providerOptions:$.optional()}),Q.object({type:Q.literal(`file-id`),fileId:Q.union([Q.string(),Q.record(Q.string(),Q.string())]),providerOptions:$.optional()}),Q.object({type:Q.literal(`file-reference`),providerReference:Q.record(Q.string(),Q.string()),providerOptions:$.optional()}),Q.object({type:Q.literal(`image-data`),data:Q.string(),mediaType:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`image-url`),url:Q.string(),providerOptions:$.optional()}),Q.object({type:Q.literal(`image-file-id`),fileId:Q.union([Q.string(),Q.record(Q.string(),Q.string())]),providerOptions:$.optional()}),Q.object({type:Q.literal(`image-file-reference`),providerReference:Q.record(Q.string(),Q.string()),providerOptions:$.optional()}),Q.object({type:Q.literal(`custom`),providerOptions:$.optional()})]))})]),qA=Q.object({type:Q.literal(`tool-result`),toolCallId:Q.string(),toolName:Q.string(),output:KA,providerOptions:$.optional()}),JA=Q.object({type:Q.literal(`tool-approval-request`),approvalId:Q.string(),toolCallId:Q.string()}),YA=Q.object({type:Q.literal(`tool-approval-response`),approvalId:Q.string(),approved:Q.boolean(),reason:Q.string().optional()}),XA=Q.object({role:Q.literal(`system`),content:Q.string(),providerOptions:$.optional()}),ZA=Q.object({role:Q.literal(`user`),content:Q.union([Q.string(),Q.array(Q.union([LA,RA,VA]))]),providerOptions:$.optional()}),QA=Q.object({role:Q.literal(`assistant`),content:Q.union([Q.string(),Q.array(Q.union([LA,UA,VA,HA,WA,GA,qA,JA]))]),providerOptions:$.optional()}),$A=Q.object({role:Q.literal(`tool`),content:Q.array(Q.union([qA,YA])),providerOptions:$.optional()});Q.union([XA,ZA,QA,$A]),SA({},{array:()=>ij,choice:()=>aj,json:()=>oj,object:()=>rj,text:()=>nj});function ej(e){let t=[`ROOT`],n=-1,r=null,i=0;function a(e){return e>=`0`&&e<=`9`||e>=`A`&&e<=`F`||e>=`a`&&e<=`f`}function o(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`);break}}function s(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop();break}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop();break}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case`ROOT`:o(u,l,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=l,t.pop();break}break;case`INSIDE_OBJECT_AFTER_COMMA`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break}break;case`INSIDE_OBJECT_KEY`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`);break}break;case`INSIDE_OBJECT_AFTER_KEY`:switch(u){case`:`:t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`);break}break;case`INSIDE_OBJECT_BEFORE_VALUE`:o(u,l,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:s(u,l);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=l;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=l}break;case`INSIDE_ARRAY_START`:switch(u){case`]`:n=l,t.pop();break;default:n=l,o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=l,t.pop();break;default:n=l;break}break;case`INSIDE_ARRAY_AFTER_COMMA`:o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),u===`u`?(i=0,t.push(`INSIDE_STRING_UNICODE_ESCAPE`)):n=l;break;case`INSIDE_STRING_UNICODE_ESCAPE`:a(u)&&(i++,i===4&&(t.pop(),n=l));break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=l;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l);break;default:t.pop();break}break;case`INSIDE_LITERAL`:{let i=e.substring(r,l+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?s(u,l):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l)):n=l;break}}}let l=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:l+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:l+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:l+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?l+=`true`.slice(t.length):`false`.startsWith(t)?l+=`false`.slice(t.length):`null`.startsWith(t)&&(l+=`null`.slice(t.length))}}return l}async function tj(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await vA({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await vA({text:ej(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}var nj=()=>({name:`text`,responseFormat:Promise.resolve({type:`text`}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),rj=({schema:e,name:t,description:n})=>{let r=lA(e);return{name:`object`,responseFormat:bA(r.jsonSchema).then(e=>({type:`json`,schema:e,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:e},t){let n=await vA({text:e});if(!n.success)throw new DA({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=await _A({value:n.value,schema:r});if(!i.success)throw new DA({message:`No object generated: response did not match sc
176hema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return i.value},async parsePartialOutput({text:e}){let t=await tj(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return{partial:t.value}}},createElementStreamTransform(){}}},ij=({element:e,name:t,description:n})=>{let r=lA(e);return{name:`array`,responseFormat:bA(r.jsonSchema).then(e=>{let{$schema:r,definitions:i,$defs:a,...o}=e;return{type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,...i!=null&&{definitions:i},...a!=null&&{$defs:a},type:`object`,properties:{elements:{type:`array`,items:o}},required:[`elements`],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:e},t){let n=await vA({text:e});if(!n.success)throw new DA({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=n.value;if(typeof i!=`object`||!i||!(`elements`in i)||!Array.isArray(i.elements))throw new DA({message:`No object generated: response did not match schema.`,cause:new US({value:i,cause:`response must be an object with an elements array`}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=[];for(let n of i.elements){let i=await _A({value:n,schema:r});if(!i.success)throw new DA({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});a.push(i.value)}return a},async parsePartialOutput({text:e}){let t=await tj(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let e=t.value;if(typeof e!=`object`||!e||!(`elements`in e)||!Array.isArray(e.elements))return;let n=t.state===`repaired-parse`&&e.elements.length>0?e.elements.slice(0,-1):e.elements,i=[];for(let e of n){let t=await _A({value:e,schema:r});t.success&&i.push(t.value)}return{partial:i}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(t!=null)for(;e<t.length;e++)n.enqueue(t[e])}})}}},aj=({options:e,name:t,description:n})=>({name:`choice`,responseFormat:Promise.resolve({type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{result:{type:`string`,enum:e}},required:[`result`],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:t},n){let r=await vA({text:t});if(!r.success)throw new DA({message:`No object generated: could not parse the response.`,cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=r.value;if(typeof i!=`object`||!i||!(`result`in i)||typeof i.result!=`string`||!e.includes(i.result))throw new DA({message:`No object generated: response did not match schema.`,cause:new US({value:i,cause:`response must be an object that contains a choice value.`}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.result},async parsePartialOutput({text:t}){let n=await tj(t);switch(n.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let t=n.value;if(typeof t!=`object`||!t||!(`result`in t)||typeof t.result!=`string`)return;let r=e.filter(e=>e.startsWith(t.result));return n.state===`successful-parse`?r.includes(t.result)?{partial:t.result}:void 0:r.length===1?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),oj=({name:e,description:t}={})=>({name:`json`,responseFormat:Promise.resolve({type:`json`,...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:e},t){let n=await vA({text:e});if(!n.success)throw new DA({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await tj(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return t.value===void 0?void 0:{partial:t.value}}},createElementStreamTransform(){}});new TextEncoder,new TextEncoder,JO({prefix:`aitxt`,size:24}),JO({prefix:`call`,size:24}),TransformStream;
176var sj=Q.record(Q.string(),PA.optional()),cj=oA(()=>hA(Q.union([Q.looseObject({type:Q.literal(`text-start`),id:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`text-delta`),id:Q.string(),delta:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`text-end`),id:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`error`),errorText:Q.string()}),Q.looseObject({type:Q.literal(`tool-input-start`),toolCallId:Q.string(),toolName:Q.string(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:sj.optional(),dynamic:Q.boolean().optional(),title:Q.string().optional()}),Q.looseObject({type:Q.literal(`tool-input-delta`),toolCallId:Q.string(),inputTextDelta:Q.string()}),Q.looseObject({type:Q.literal(`tool-input-available`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:sj.optional(),dynamic:Q.boolean().optional(),title:Q.string().optional()}),Q.looseObject({type:Q.literal(`tool-input-error`),toolCallId:Q.string(),toolName:Q.string(),input:Q.unknown(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:sj.optional(),dynamic:Q.boolean().optional(),errorText:Q.string(),title:Q.string().optional()}),Q.looseObject({type:Q.literal(`tool-approval-request`),approvalId:Q.string(),toolCallId:Q.string(),isAutomatic:Q.boolean().optional(),signature:Q.string().optional()}),Q.looseObject({type:Q.literal(`tool-approval-response`),approvalId:Q.string(),approved:Q.boolean(),reason:Q.string().optional(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`tool-output-available`),toolCallId:Q.string(),output:Q.unknown(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:sj.optional(),dynamic:Q.boolean().optional(),preliminary:Q.boolean().optional()}),Q.looseObject({type:Q.literal(`tool-output-error`),toolCallId:Q.string(),errorText:Q.string(),providerExecuted:Q.boolean().optional(),providerMetadata:$.optional(),toolMetadata:sj.optional(),dynamic:Q.boolean().optional()}),Q.looseObject({type:Q.literal(`tool-output-denied`),toolCallId:Q.string()}
vendor: 11,080 bytes, line 176
176),Q.looseObject({type:Q.literal(`reasoning-start`),id:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`reasoning-delta`),id:Q.string(),delta:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`reasoning-end`),id:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`custom`),kind:Q.string().transform(e=>e),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`source-url`),sourceId:Q.string(),url:Q.string(),title:Q.string().optional(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`source-document`),sourceId:Q.string(),mediaType:Q.string(),title:Q.string(),filename:Q.string().optional(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`file`),url:Q.string(),mediaType:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.literal(`reasoning-file`),url:Q.string(),mediaType:Q.string(),providerMetadata:$.optional()}),Q.looseObject({type:Q.custom(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:Q.string().optional(),data:Q.unknown(),transient:Q.boolean().optional()}),Q.looseObject({type:Q.literal(`start-step`)}),Q.looseObject({type:Q.literal(`finish-step`)}),Q.looseObject({type:Q.literal(`start`),messageId:Q.string().optional(),messageMetadata:Q.unknown().optional()}),Q.looseObject({type:Q.literal(`finish`),finishReason:Q.enum([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`other`]).optional(),messageMetadata:Q.unknown().optional()}),Q.looseObject({type:Q.literal(`abort`),reason:Q.string().optional()}),Q.looseObject({type:Q.literal(`message-metadata`),messageMetadata:Q.unknown()})])));function lj(e){return e.type.startsWith(`data-`)}function uj(){return Object.create(null)}function dj(e){return e.type.startsWith(`tool-`)}function fj(e){return e.type===`dynamic-tool`}function pj(e){return dj(e)||fj(e)}function mj(e){return e.type.split(`-`).slice(1).join(`-`)}function hj({lastMessage:e,messageId:t}){return{message:e?.role===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},activeTextParts:uj(),activeReasoningParts:uj(),partialToolCalls:uj()}}function gj({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:o}){return e.pipeThrough(new TransformStream({async transform(e,s){await r(async({state:r,write:c})=>{function l(){let e=r.message.parts,t=e.length-1;for(;t>=0&&e[t].type!==`step-start`;)t--;return e.slice(t+1)}function u(){return l().filter(pj)}function d(e){let t=u().find(t=>t.toolCallId===e);if(t==null){let n=r.message.parts;for(let r=n.length-1;r>=0;r--){let i=n[r];if(pj(i)&&i.toolCallId===e){t=i;break}}}if(t==null)throw new MA({chunkType:`tool-invocation`,chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function f(e){let t=r.message.parts.filter(pj).find(t=>t.approval?.id===e);if(t==null)throw new MA({chunkType:`tool-approval-response`,chunkId:e,message:`No tool invocation found for approval ID "${e}".`});return t}function p(e,t){let n=t??l().find(t=>dj(t)&&t.toolCallId===e.toolCallId),i=e,a=n;if(n!=null){n.state=e.state,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput,a.preliminary=i.preliminary,e.title!==void 0&&(a.title=e.title),e.toolMetadata!==void 0&&(a.toolMetadata=e.toolMetadata),a.providerExecuted=i.providerExecuted??n.providerExecuted;let t=i.providerMetadata;if(t!=null)if(e.state===`output-available`||e.state===`output-error`){let e=n;e.resultProviderMetadata=t}else n.callProviderMetadata=t}else r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,...e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata},input:i.input,output:i.output,rawInput:i.rawInput,errorText:i.errorText,providerExecuted:i.providerExecuted,preliminary:i.preliminary,...i.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:i.providerMetadata}:{},...i.providerMetadata!=null&&!(e.state===`output-available`||e.state===`output-error`)?{callProviderMetadata:i.providerMetadata}:{}})}function m(e,t){let n=t??l().find(t=>t.type===`dynamic-tool`&&t.toolCallId===e.toolCallId),i=e,a=n;if(n!=null){n.state=e.state,a.toolName=e.toolName,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput??a.rawInput,a.preliminary=i.preliminary,e.title!==void 0&&(a.title=e.title),e.toolMetadata!==void 0&&(a.toolMetadata=e.toolMetadata),a.providerExecuted=i.providerExecuted??n.providerExecuted;let t=i.providerMetadata;if(t!=null)if(e.state===`output-available`||e.state===`output-error`){let e=n;e.resultProviderMetadata=t}else n.callProviderMetadata=t}else r.message.parts.push({type:`dynamic-tool`,toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:i.input,output:i.output,errorText:i.errorText,preliminary:i.preliminary,providerExecuted:i.providerExecuted,title:e.title,...e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata},...i.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:i.providerMetadata}:{},...i.providerMetadata!=null&&!(e.state===`output-available`||e.state===`output-error`)?{callProviderMetadata:i.providerMetadata}:{}})}async function h(e){if(e!=null){let n=r.message.metadata==null?e:NA(r.message.metadata,e);t!=null&&await gA({value:n,schema:t,context:{field:`message.metadata`,entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case`text-start`:{let t={type:`text`,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeTextParts[e.id]=t,r.message.parts.push(t),c();break}case`text-delta`:{let t=r.activeTextParts[e.id];if(t==null)throw new MA({chunkType:`text-delta`,chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,c();break}case`text-end`:{let t=r.activeTextParts[e.id];if(t==null)throw new MA({chunkType:`text-end`,chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state=`done`,t.providerMetadata=e.providerMetadata??t.providerMetadata,delete r.activeTextParts[e.id],c();break}case`custom`:{let t={type:`custom`,kind:e.kind,providerMetadata:e.providerMetadata};r.message.parts.push(t),c();break}case`reasoning-start`:{let t={type:`reasoning`,id:e.id,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),c();break}case`reasoning-delta`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new MA({chunkType:`reasoning-delta`,chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,c();break}case`reasoning-end`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new MA({chunkType:`reasoning-end`,chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=e.providerMetadata??t.providerMetadata,t.state=`done`,delete r.activeReasoningParts[e.id],c();break}case`file`:case`reasoning-file`:r.message.parts.push({type:e.type,mediaType:e.mediaType,url:e.url,...e.providerMetadata==null?{}:{providerMetadata:e.providerMetadata}}),c();break;case`source-url`:r.message.parts.push({type:`source-url`,sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),c();break;case`source-document`:r.message.parts.push({type:`source-document`,sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),c();break;case`tool-input-start`:{let t=l().filter(dj);r.partialToolCalls[e.toolCallId]={text:``,toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title,toolMetadata:e.toolMetadata},e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}):p({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}),c();break}case`tool-input-delta`:{let t=r.partialToolCalls[e.toolCallId];if(t==null)throw new MA({chunkType:`tool-input-delta`,chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let{value:n}=await tj(t.text);t.dynamic?m({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n,title:t.title,toolMetadata:t.toolMetadata}):p({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n,title:t.title,toolMetadata:t.toolMetadata}),c();break}case`tool-input-available`:e.dynamic?m({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}):p({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}),c(),a&&!e.providerExecuted&&await a({toolCall:e});break;case`tool-input-error`:{let t=l().filter(pj).find(t=>t.toolCallId===e.toolCallId);(t==null?e.dynamic:t.type===`dynamic-tool`)?m({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}):p({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}),c();break}case`tool-approval-request`:{let t=d(e.toolCallId);t.state=`approval-requested`,t.approval={id:e.approvalId,...e.isAutomatic===!0?{isAutomatic:!0}:{},...e.signature==null?{}:{signature:e.signature}},c();break}case`tool-approval-response`:{let t=f(e.approvalId),n=t.approval==null?{id:e.approvalId}:t.approval;t.state=`approval-responded`,t.approval={id:e.approvalId,approved:e.approved,...e.reason==null?{}:{reason:e.reason},...n.isAutomatic===!0?{isAutomatic:!0}:{},...n.signature==null?{}:{signature:n.signature}},e.providerExecuted!=null&&(t.providerExecuted=e.providerExecuted),e.providerMetadata!=null&&(t.callProviderMetadata=e.providerMetadata),c();break}case`tool-output-denied`:{let t=d(e.toolCallId);t.state=`output-denied`,c();break}case`tool-output-available`:{let t=d(e.toolCallId);t.type===`dynamic-tool`?m({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-
176available`,input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t):p({toolCallId:e.toolCallId,toolName:mj(t),state:`output-available`,input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t),c();break}case`tool-output-error`:{let t=d(e.toolCallId);t.type===`dynamic-tool`?m({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-error`,input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t):p({toolCallId:e.toolCallId,toolName:mj(t),state:`output-error`,input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t),c();break}case`start-step`:r.message.parts.push({type:`step-start`});break;case`finish-step`:r.activeTextParts=uj(),r.activeReasoningParts=uj();break;case`start`:e.messageId!=null&&(r.message.id=e.messageId),await h(e.messageMetadata),(e.messageId!=null||e.messageMetadata!=null)&&c({updateStatus:!1});break;case`finish`:e.finishReason!=null&&(r.finishReason=e.finishReason),await h(e.messageMetadata),e.messageMetadata!=null&&c();break;case`message-metadata`:await h(e.messageMetadata),e.messageMetadata!=null&&c();break;case`error`:i?.(Error(e.errorText));break;default:if(lj(e)){if(n?.[e.type]!=null){let t=r.message.parts.findIndex(t=>`id`in t&&`data`in t&&t.id===e.id&&t.type===e.type),i=t>=0?t:r.message.parts.length;await gA({value:e.data,schema:n[e.type],context:{field:`message.parts[${i}].data`,entityName:e.type,entityId:e.id}})}let t=e;if(t.transient){o?.(t);break}let i=t.id==null?void 0:r.message.parts.find(e=>t.type===e.type&&t.id===e.id);i==null?r.message.parts.push(t):i.data=t.data,o?.(t),c()}}s.enqueue(e)})}}))}async function _j({stream:e,onError:t,abortSignal:n}){let r=e.getReader(),i=()=>{r.cancel().catch(()=>{})};n?.aborted?i():n?.addEventListener(`abort`,i,{once:!0});try{for(;;){let{done:e}=await r.read();if(e)break}}catch(e){t?.(e)}finally{n?.removeEventListener(`abort`,i),r.releaseLock()}}JO({prefix:`aitxt`,size:24}),JO({prefix:`call`,size:24}),JO({prefix:`aitxt`,size:24}),JO({prefix:`call`,size:24}),Q.record(Q.string(),PA.optional()),Q.record(Q.string(),Q.string()),JO({prefix:`call`,size:24}),JO({prefix:`call`,size:24}),JO({prefix:`aiobj`,size:24});var vj=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}};JO({prefix:`aiobj`,size:24}),JO({prefix:`call`,size:24});async function yj(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw Error(`FileList is not supported in the current environment`);return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:`file`,mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}var bj=class{constructor({api:e=`/api/chat`,credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=o}async sendMessages({abortSignal:e,...t}){let n=await bA(this.body),r=await bA(this.headers),i=await bA(this.credentials),a={...XO(r),...XO(t.headers)},o=await this.prepareSendMessagesRequest?.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...n,...t.body},headers:a,credentials:i,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId}),s=o?.api??this.api,c=o?.headers===void 0?a:XO(o.headers),l=o?.body===void 0?{...n,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId}:o.body,u=o?.credentials??i,d=await(this.fetch??globalThis.fetch)(s,{method:`POST`,headers:{"Content-Type":`application/json`,...c},body:JSON.stringify(l),credentials:u,signal:e});if(!d.ok)throw Error(await d.text()??`Failed to fetch the chat response.`);if(!d.body)throw Error(`The response body is empty.`);return this.processResponseStream(d.body)}async reconnectToStream(e){let t=await bA(this.body),n=await bA(this.headers),r=await bA(this.credentials),i={...XO(n),...XO(e.headers)},a=await this.prepareReconnectToStreamRequest?.call(this,{api:this.api,id:e.chatId,body:{...t,...e.body},headers:i,credentials:r,requestMetadata:e.metadata}),o=a?.api??`${this.api}/${e.chatId}/stream`,s=a?.headers===void 0?i:XO(a.headers),c=a?.credentials??r,l=await(this.fetch??globalThis.fetch)(o,{method:`GET`,headers:s,credentials:c,signal:e.abortSignal});if(l.status===204)return null;if(!l.ok)throw Error(await l.text()??`Failed to fetch the chat response.`);if(!l.body)throw Error(`The response body is empty.`);return this.processResponseStream(l.body)}},xj=class extends bj{constructor(e={}){super(e)}
vendor: 8,414 bytes, line 176
176processResponseStream(e){return yA({stream:e,schema:cj}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},Sj=class{constructor({generateId:e=YO,id:t=e(),transport:n=new xj,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:o,onToolCall:s,onFinish:c,onData:l,sendAutomaticallyWhen:u}){this.pendingMessagePreparations=new Set,this.activeResponse=void 0,this.activeResumeRequest=void 0,this.jobExecutor=new vj,this.sendMessage=async(e,t)=>{if(e==null){await this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,...t});return}let n;if(`text`in e||`files`in e){let t=new AbortController;this.pendingMessagePreparations.add(t);let r;try{r=Array.isArray(e.files)?e.files:await yj(e.files)}finally{this.pendingMessagePreparations.delete(t)}if(t.signal.aborted)return;n={parts:[...r,...`text`in e&&e.text!=null?[{type:`text`,text:e.text}]:[]]}}else n=e;if(e.messageId!=null){let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(t===-1)throw Error(`message with id ${e.messageId} not found`);if(this.state.messages[t].role!==`user`)throw Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...n,id:e.messageId,role:n.role??`user`,metadata:e.metadata})}else this.state.pushMessage({...n,id:n.id??this.generateId(),role:n.role??`user`,metadata:e.metadata});await this.makeRequest({trigger:`submit-message`,messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{let n=e==null?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(n===-1)throw Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,this.messages[n].role===`assistant`?n:n+1),await this.makeRequest({trigger:`regenerate-message`,messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:`resume-stream`,...e})},this.clearError=()=>{this.status===`error`&&(this.state.error=void 0,this.setStatus({status:`ready`}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n,options:r})=>this.jobExecutor.run(async()=>{let i=this.state.messages,a=i[i.length-1],o=r=>pj(r)&&r.state===`approval-requested`&&r.approval.id===e?{...r,state:`approval-responded`,approval:{...r.approval,id:e,approved:t,reason:n}}:r;this.state.replaceMessage(i.length-1,{...a,parts:a.parts.map(o)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(o)),this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{e&&this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,...r})})}),this.addToolOutput=async({state:e=`output-available`,toolCallId:t,output:n,errorText:r,options:i})=>this.jobExecutor.run(async()=>{let a=this.state.messages,o=a[a.length-1],s=i=>pj(i)&&i.toolCallId===t?{...i,state:e,output:n,errorText:r}:i;this.state.replaceMessage(a.length-1,{...o,parts:o.parts.map(s)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{e&&this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,...i})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e,t;for(let e of this.pendingMessagePreparations)e.abort();(e=this.activeResumeRequest)==null||e.abortController.abort(),(t=this.activeResponse)==null||t.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=o,this.onToolCall=s,this.onFinish=c,this.onData=l,this.sendAutomaticallyWhen=u}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e==`object`&&`then`in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var a,o;let s=new AbortController,c=e===`resume-stream`?{abortController:s}:void 0;c&&((a=this.activeResumeRequest)==null||a.abortController.abort(),this.activeResumeRequest=c);let l=()=>c==null||this.activeResumeRequest===c,u=()=>{this.activeResumeRequest===c&&(this.activeResumeRequest=void 0)},d;if(e===`resume-stream`)try{let e=await this.transport.reconnectToStream({chatId:this.id,abortSignal:s.signal,metadata:t,headers:n,body:r});if(s.signal.aborted||!l()){await e?.cancel().catch(()=>{}),l()&&this.setStatus({status:`ready`}),u();return}if(e==null){this.setStatus({status:`ready`}),u();return}d=e}catch(e){if(s.signal.aborted||e.name===`AbortError`){l()&&this.setStatus({status:`ready`}),u();return}if(!l())return;this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e}),u();return}this.setStatus({status:`submitted`,error:void 0});let f=this.lastMessage,p=!1,m=!1,h=!1,g;try{let a={state:hj({lastMessage:e===`resume-stream`||e===`regenerate-message`?void 0:this.state.snapshot(f),messageId:this.generateId()}),abortController:s};g=a,a.abortController.signal.addEventListener(`abort`,()=>{p=!0}),this.activeResponse=a;let o;if(o=e===`resume-stream`?d:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:a.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i}),await _j({stream:gj({stream:o,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:e=>this.jobExecutor.run(()=>a.abortController.signal.aborted?Promise.resolve():e({state:a.state,write:({updateStatus:e=!0}={})=>{a.abortController.signal.aborted||(e&&this.setStatus({status:`streaming`}),a.state.message.id===this.lastMessage?.id?this.state.replaceMessage(this.state.messages.length-1,a.state.message):this.state.pushMessage(a.state.message))}})),onError:e=>{throw e}}),abortSignal:a.abortController.signal,onError:e=>{throw e}}),p)return l()&&this.setStatus({status:`ready`}),null;l()&&this.setStatus({status:`ready`})}catch(e){if(p||e.name===`AbortError`)return p=!0,l()&&this.setStatus({status:`ready`}),null;if(!l())return null;h=!0,e instanceof TypeError&&(e.message.toLowerCase().includes(`fetch`)||e.message.toLowerCase().includes(`network`))&&(m=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e})}finally{try{g&&((o=this.onFinish)==null||o.call(this,{message:g.state.message,messages:this.state.messages,isAbort:p,isDisconnect:m,isError:h,finishReason:g.state.finishReason}))}finally{this.activeResponse===g&&(this.activeResponse=void 0),u()}}!h&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,metadata:t,headers:n,body:r})}},Cj=a(r(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n}))(),1),wj=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Tj=(e,t,n)=>(wj(e,t,`read from private field`),n?n.call(e):t.get(e)),Ej=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Dj=(e,t,n,r)=>(wj(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function Oj(e,t){return t==null?e:(0,Cj.default)(e,t)}function kj(e){return Array.isArray(e)?[...e]:typeof e==`object`&&e&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)?{...e}:e}var Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj=class{constructor(e=[]){Ej(this,Aj,void 0),Ej(this,jj,`ready`),Ej(this,Mj,void 0),Ej(this,Nj,new Set),Ej(this,Pj,new Set),Ej(this,Fj,new Set),this.pushMessage=e=>{Dj(this,Aj,Tj(this,Aj).concat(e)),Tj(this,Ij).call(this)},this.popMessage=()=>{Dj(this,Aj,Tj(this,Aj).slice(0,-1)),Tj(this,Ij).call(this)},this.replaceMessage=(e,t)=>
176{Dj(this,Aj,[...Tj(this,Aj).slice(0,e),this.snapshot(t),...Tj(this,Aj).slice(e+1)]),Tj(this,Ij).call(this)},this.snapshot=e=>{if(typeof e!=`object`||!e||!(`parts`in e)||!Array.isArray(e.parts))return e;let t=e,n={...t,parts:t.parts.map(e=>({...e}))};return`metadata`in t&&(n.metadata=kj(t.metadata)),n},this[`~registerMessagesCallback`]=(e,t)=>{let n=t?Oj(e,t):e;return Tj(this,Nj).add(n),()=>{Tj(this,Nj).delete(n)}},this[`~registerStatusCallback`]=e=>(Tj(this,Pj).add(e),()=>{Tj(this,Pj).delete(e)}),this[`~registerErrorCallback`]=e=>(Tj(this,Fj).add(e),()=>{Tj(this,Fj).delete(e)}),Ej(this,Ij,()=>{Tj(this,Nj).forEach(e=>e())}),Ej(this,Lj,()=>{Tj(this,Pj).forEach(e=>e())}),Ej(this,Rj,()=>{Tj(this,Fj).forEach(e=>e())}),Dj(this,Aj,e)}get status(){return Tj(this,jj)}set status(e){Dj(this,jj,e),Tj(this,Lj).call(this)}get error(){return Tj(this,Mj)}set error(e){Dj(this,Mj,e),Tj(this,Rj).call(this)}get messages(){return Tj(this,Aj)}set messages(e){Dj(this,Aj,[...e]),Tj(this,Ij).call(this)}};Aj=new WeakMap,jj=new WeakMap,Mj=new WeakMap,Nj=new WeakMap,Pj=new WeakMap,Fj=new WeakMap,Ij=new WeakMap,Lj=new WeakMap,Rj=new WeakMap;var Bj,Vj=class extends Sj{constructor({messages:e,...t}){let n=new zj(e);super({...t,state:n}),Ej(this,Bj,void 0),this[`~registerMessagesCallback`]=(e,t)=>Tj(this,Bj)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>Tj(this,Bj)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>Tj(this,Bj)[`~registerErrorCallback`](e),Dj(this,Bj,n)}};Bj=new WeakMap;function Hj({throttle:e,experimental_throttle:t,resume:n=!1,...r}={}){let i=e??t,a=(0,F.useRef)({});`chat`in r||(a.current={onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen,transport:r.transport});let o,s=()=>a.current.transport??(o??=new xj),c={...r,transport:{sendMessages:e=>s().sendMessages(e),reconnectToStream:e=>s().reconnectToStream(e)},onToolCall:e=>{var t;return(t=a.current).onToolCall?.call(t,e)},onData:e=>{var t;return(t=a.current).onData?.call(t,e)},onFinish:e=>{var t;return(t=a.current).onFinish?.call(t,e)},onError:e=>{var t;return(t=a.current).onError?.call(t,e)},sendAutomaticallyWhen:e=>{var t;return(t=a.current).sendAutomaticallyWhen?.call(t,e)??!1}},l=(0,F.useRef)(`chat`in r?r.chat:new Vj(c));(`chat`in r&&r.chat!==l.current||`id`in r&&r.id!=null&&l.current.id!==r.id)&&(l.current=`chat`in r?r.chat:new Vj(c));let u=l.current,d=(0,F.useRef)({chat:u,messages:u.messages});d.current.chat!==u&&(d.current={chat:u,messages:u.messages});let f=(0,F.useCallback)(e=>{let t=!0,n=u[`~registerMessagesCallback`](()=>{!t||d.current.chat!==u||(d.current={chat:u,messages:u.messages},e())},i);return d.current={chat:u,messages:u.messages},()=>{t=!1,n()}},[u,i]),p=(0,F.useCallback)(()=>d.current.messages,[]),m=(0,F.useSyncExternalStore)(f,p,p),h=(0,F.useCallback)(e=>u[`~registerStatusCallback`](()=>{d.current.chat===u&&((u.status===`ready`||u.status===`error`)&&(d.current={chat:u,messages:u.messages}),e())}),[u]),g=(0,F.useCallback)(()=>u.status,[u]),_=(0,F.useSyncExternalStore)(h,g,g),v=(0,F.useSyncExternalStore)(l.current[`~registerErrorCallback`],()=>l.current.error,()=>l.current.error),y=(0,F.useCallback)(e=>{typeof e==`function`&&(e=e(l.current.messages)),l.current.messages=e},[l]);return(0,F.useEffect)(()=>{n&&l.current.resumeStream()},[n,l]),{id:l.current.id,messages:m,setMessages:y,sendMessage:l.current.sendMessage,regenerate:l.current.regenerate,clearError:l.current.clearError,stop:l.current.stop,error:v,resumeStream:l.current.resumeStream,status:_,addToolResult:l.current.addToolOutput,addToolOutput:l.current.addToolOutput,addToolApprovalResponse:l.current.addToolApprovalResponse}}var Uj=`saxon-chat-conversation-id`;function Wj(){if(typeof window>`u`)return``;let e=window.localStorage.getItem(Uj);return e||(e=crypto.randomUUID(),window.localStorage.setItem(Uj,e)),e}var Gj={id:`greeting`,role:`assistant`,parts:[{type:`text`,text:`Hi! I'm Thane, the digital coach at Saxon CrossFit. Ask me about training sessions, memberships or coaches â or I can get you booked in for a free taster.`}]};function Kj(e){return(e.parts??[]).map(e=>e.type===`text`?e.text:``).join(``)}function qj(){let[e,t]=(0,F.useState)(!1),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(``),o=(0,F.useRef)(null);(0,F.useEffect)(()=>{a(Wj())},[]);let{messages:s,sendMessage:c,status:l,error:u}=Hj({transport:(0,F.useMemo)(()=>new xj({api:`/api/chat`,prepareSendMessagesRequest:({messages:e})=>({body:{messages:e,conversationId:i,path:typeof window<`u`?window.location.pathname:``}})}),[i])}
176),d=l===`submitted`||l===`streaming`;(0,F.useEffect)(()=>{o.current?.scrollTo({top:o.current.scrollHeight,behavior:`smooth`})},[s,d]);let f=s.length>0?s:[Gj];return(0,I.jsxs)(I.Fragment,{children:[e&&(0,I.jsxs)(`div`,{className:`bg-card border-border fixed right-4 bottom-20 z-50 flex h-[min(560px,75vh)] w-[min(380px,calc(100vw-2rem))] flex-col border shadow-2xl`,children:[(0,I.jsxs)(`div`,{className:`bg-primary text-primary-foreground flex items-center justify-between px-4 py-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm font-semibold tracking-wide uppercase`,children:`Chat with Saxon`}),(0,I.jsx)(`p`,{className:`text-primary-foreground/80 text-xs`,children:`Usually replies instantly`})]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>t(!1),"aria-label":`Close chat`,className:`hover:opacity-80`,children:(0,I.jsx)(sg,{className:`h-5 w-5`})})]}),(0,I.jsxs)(`div`,{ref:o,className:`flex-1 space-y-3 overflow-y-auto px-4 py-4`,children:[f.map(e=>{let t=Kj(e);if(!t)return null;let n=e.role===`user`;return(0,I.jsx)(`div`,{className:n?`flex justify-end`:`flex justify-start`,children:(0,I.jsx)(`div`,{className:n?`bg-primary text-primary-foreground max-w-[85%] px-3 py-2 text-sm`:`bg-muted text-foreground max-w-[85%] px-3 py-2 text-sm whitespace-pre-wrap`,children:t})},e.id)}),d&&(0,I.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 text-xs`,children:[(0,I.jsx)(Yh,{className:`h-3 w-3 animate-spin`}),` Thane is typingâ¦`]}),u&&(0,I.jsx)(`p`,{className:`text-destructive text-xs`,children:`Sorry â the chat dropped out. Please try again or email us.`})]}),(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=n.trim();!t||d||(r(``),c({text:t}))},className:`border-border flex items-center gap-2 border-t p-3`,children:[(0,I.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),maxLength:1e3,placeholder:`Ask about training sessions, prices, tasterâ¦`,"aria-label":`Your message`,className:`bg-background border-input text-foreground placeholder:text-muted-foreground flex-1 border px-3 py-2 text-sm outline-none focus:border-primary`}),(0,I.jsx)(`button`,{type:`submit`,disabled:d||!n.trim(),"aria-label":`Send message`,className:`bg-primary text-primary-foreground hover:bg-primary/90 inline-flex h-9 w-9 items-center justify-center disabled:opacity-50`,children:(0,I.jsx)(ig,{className:`h-4 w-4`})})]})]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>t(e=>!e),"aria-label":e?`Close chat`:`Open chat`,className:`bg-primary text-primary-foreground hover:bg-primary/90 fixed right-4 bottom-4 z-50 inline-flex h-14 w-14 items-center justify-center rounded-full shadow-xl transition-transform hover:scale-105`,children:e?(0,I.jsx)(sg,{className:`h-6 w-6`}):(0,I.jsx)(eg,{className:`h-6 w-6`})})]})}function Jj(){let e=rS(e=>e.syncCart);(0,F.useEffect)(()=>{e();let t=()=>{document.visibilityState===`visible`&&e()};return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)},[e])}function Yj(){return(0,I.jsx)(`div`,{className:`bg-background flex min-h-screen items-center justify-center px-4`,children:(0,I.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,I.jsx)(`h1`,{className:`text-primary text-7xl`,children:`404`}),(0,I.jsx)(`h2`,{className:`text-foreground mt-4 text-xl`,children:`Page not found`}),(0,I.jsx)(`p`,{className:`text-muted-foreground mt-2 text-sm`,children:`The page you're looking for doesn't exist or has been moved.`}),(0,I.jsx)(`div`,{className:`mt-6`,children:(0,I.jsx)(be,{to:`/`,className:`bg-primary text-primary-foreground hover:bg-primary/90 inline-flex items-center justify-center px-4 py-2 text-sm font-medium transition-colors`,children:`Go home`})})]})})}function Xj({error:e,reset:t}){console.error(e);let n=o();return(0,F.useEffect)(()=>{Rh(e,{boundary:`tanstack_root_error_component`})},[e]),(0,I.jsx)(`div`,{className:`bg-background flex min-h-screen items-center justify-center px-4`,children:(0,I.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,I.jsx)(`h1`,{className:`text-foreground text-xl`,children:`This page didn't load`}),(0,I.jsx)(`p`,{className:`text-muted-foreground mt-2 text-sm`,children:`Something went wrong on our end. You can try refreshing or head back home.`}),(0,I.jsxs)(`div`,{className:`mt-6 flex flex-wrap justify-center gap-2`,children:[(0,I.jsx)(`button`,{onClick:()=>{n.invalidate(),t()},className:`bg-primary text-primary-foreground hover:bg-primary/90 inline-flex items-center justify-center px-4 py-2 text-sm font-medium transition-colors`,children:`Try again`}),(0,I.jsx)(`a`,{href:`/`,className:`border-input bg-background text-foreground hover:bg-accent inline-flex items-center justify-center border px-4 py-2 text-sm font-medium transition-colors`,children:`Go home`})]})]})})}var Zj=ws()({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`Saxon CrossFit | Wymondham Gym & CrossFit Classes`},{name:`description`,content:`Coach-led CrossFit classes in Wymondham, Norfolk. Strength, conditioning and a community that knows your name. Book a free taster today.`},{name:`author`,content:`Saxon CrossFit`},{property:`og:title`,content:`Saxon CrossFit | Wymondham Gym & CrossFit Classes`},{property:`og:description`,content:`Coach-led CrossFit classes in Wymondham, Norfolk. Strength, conditioning and a community that knows your name.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}
176,{name:`google-site-verification`,content:`K-Ju7U1tRFG_CT51WZGCYU81E4JKrJgnnRrW8soZT1Y`}],links:[{rel:`stylesheet`,href:Lh},{rel:`preconnect`,href:`https://fonts.googleapis.com`},{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossOrigin:`anonymous`},{rel:`stylesheet`,href:`https://fonts.googleapis.com/css2?family=Anton&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap`},{rel:`icon`,href:`/favicon.ico`,sizes:`any`},{rel:`icon`,type:`image/png`,sizes:`32x32`,href:`/favicon-32x32.png`},{rel:`icon`,type:`image/png`,sizes:`16x16`,href:`/favicon-16x16.png`},{rel:`apple-touch-icon`,sizes:`180x180`,href:`/apple-touch-icon.png`},{rel:`manifest`,href:`/site.webmanifest`}]}),shellComponent:Qj,component:eM,notFoundComponent:Yj,errorComponent:Xj});function Qj({children:e}){return(0,I.jsxs)(`html`,{lang:`en`,children:[(0,I.jsxs)(`head`,{children:[(0,I.jsx)($s,{}),(0,I.jsx)(`meta`,{name:`google-site-verification`,content:`VwLPYw_XEBz2n0n6ugeplCvd-oudOiFGJKNSXWmAd1M`})]}),(0,I.jsxs)(`body`,{children:[e,(0,I.jsx)(ec,{})]})]})}function $j(){return Jj(),(0,I.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,I.jsx)(hS,{}),(0,I.jsx)(`main`,{className:`flex-1`,children:(0,I.jsx)(Bs,{})}),(0,I.jsx)(yS,{}),(0,I.jsx)(qj,{}),(0,I.jsx)(Te,{position:`top-center`,richColors:!0})]})}function eM(){let{queryClient:e}=Zj.useRouteContext();return(0,I.jsx)(Sh,{client:e,children:(0,I.jsx)($j,{})})}var tM=Ds(`/terms`)({head:()=>({meta:[{title:`Terms & Conditions | Saxon CrossFit`},{name:`description`,content:`Terms and conditions for using Saxon CrossFit website, memberships, classes and online shop.`},{property:`og:title`,content:`Terms & Conditions | Saxon CrossFit`},{property:`og:description`,content:`Terms and conditions for using Saxon CrossFit website, memberships, classes and online shop.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:ks(()=>mp(()=>import(`./terms-CNvBhaTO.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`component`)}),nM=Ds(`/shop`)({head:()=>({meta:[{title:`Shop | Saxon CrossFit Merchandise`},{name:`description`,content:`Saxon CrossFit kit and merchandise â tees, hoodies and training gear, shipped straight to your door.`},{property:`og:title`,content:`Shop | Saxon CrossFit Merchandise`},{property:`og:description`,content:`Saxon CrossFit kit and merchandise, shipped straight to your door.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`},{property:`og:url`,content:`https://saxoncrossfit.com/shop`}],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/shop`}]}),component:ks(()=>mp(()=>import(`./shop-BoNLUgXg.js`),__vite__mapDeps([7,1,3,4,5,6,8,9,2])),`component`)}),rM=Ds(`/refund`)({head:()=>({meta:[{title:`Refund & Cancellation Policy | Saxon CrossFit`},{name:`description`,content:`Saxon CrossFit refund and cancellation policy for memberships, class bookings and online shop purchases.`},{property:`og:title`,content:`Refund & Cancellation Policy | Saxon CrossFit`},{property:`og:description`,content:`Saxon CrossFit refund and cancellation policy for memberships, class bookings and online shop purchases.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:ks(()=>mp(()=>import(`./refund-C-1ePvpL.js`),__vite__mapDeps([10,1,2,3,4,5,6])),`component`)}),iM=Ds(`/privacy`)({head:()=>({meta:[{title:`Privacy Policy | Saxon CrossFit`},{name:`description`,content:`How Saxon Fitness Ltd collects, uses, shares and protects your personal data when you train with or enquire at Saxon CrossFit in Wymondham.`},{property:`og:title`,content:`Privacy Policy | Saxon CrossFit`},{property:`og:description`,content:`How Saxon Fitness Ltd handles your personal data, your rights under UK GDPR, and who we share data with.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`},{property:`og:url`,content:`https://saxoncrossfit.com/privacy`}],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/privacy`}]}),component:ks(()=>mp(()=>import(`./privacy-Bxmg10uq.js`),__vite__mapDeps([11,1,2,3,4,5,6])),`component`)}),aM=Ds(`/memberships`)({head:()=>({meta:[{title:`Gym Memberships & Prices | Saxon CrossFit Wymondham`},{name:`description`,content:`Saxon CrossFit memberships from £85 per month. No contract, no joining fee â 3x weekly, unlimited and ultimate plans with
176nutrition coaching.`},{property:`og:title`,content:`Gym Memberships & Prices | Saxon CrossFit Wymondham`},{property:`og:description`,content:`No contract, no joining fee. Plans from £85 per month.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`},{property:`og:url`,content:`https://saxoncrossfit.com/memberships`}],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/memberships`}]}),component:ks(()=>mp(()=>import(`./memberships-DhsHOSzj.js`),__vite__mapDeps([12,1,9,2,3,4,5,6])),`component`)}),oM=Ds(`/get-started`)({head:()=>({meta:[{title:`Start Where You Are | Free Intro Session | Saxon CrossFit`},{name:`description`,content:`Book your free intro session at Saxon CrossFit in Wymondham. Speak with a coach, talk through your goals, and find the best way to get started â no experience needed.`},{property:`og:title`,content:`Start Where You Are | Free Intro Session | Saxon CrossFit`},{property:`og:description`,content:`Book your free intro session at Saxon CrossFit in Wymondham. No experience needed â every session is scaled to your level.`},{property:`og:type`,content:`website`},{property:`og:url`,content:`https://saxoncrossfit.com/get-started`},{name:`twitter:card`,content:`summary_large_image`}],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/get-started`}]}),component:ks(()=>mp(()=>import(`./get-started-DyTbrSoV.js`),__vite__mapDeps([13,1,14,15,6,16,17,18,19])),`component`)}),sM=Ds(`/contact`)({validateSearch:e=>typeof e.enquiry==`string`?{enquiry:e.enquiry}:{},head:()=>({meta:[{title:`Contact & Free Taster | Saxon CrossFit Wymondham`},{name:`description`,content:`Book a free taster session or ask us anything. Saxon CrossFit, Wymondham Business Centre, Suton NR18 9JL. Call 01953 438538.`},{property:`og:title`,content:`Contact & Free Taster | Saxon CrossFit Wymondham`},{property:`og:description`,content:`Book a free taster session at Saxon CrossFit in Wymondham, Norfolk.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:ks(()=>mp(()=>import(`./contact-DY5CXM1D.js`),__vite__mapDeps([20,1,14,15,6,16,21,2,3,4,5,18,19,22])),`component`)}),cM=Ds(`/coaches`)({head:()=>({meta:[{title:`Meet the Coaches | Saxon CrossFit Wymondham`},{name:`description`,content:`Meet the qualified coaching team at Saxon CrossFit in Wymondham â CrossFit Level 1 and 2 coaches, weightlifting and gymnastics specialists.`},{property:`og:title`,content:`Meet the Coaches | Saxon CrossFit Wymondham`},{property:`og:description`,content:`Qualified coaches with a genuine interest in your progress.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:ks(()=>mp(()=>import(`./coaches-BnfkLpsh.js`),__vite__mapDeps([23,1,4,21,2,3,5,6])),`component`)}),lM=Ds(`/classes`)({head:()=>({meta:[{title:`CrossFit Training Sessions in Wymondham | Saxon CrossFit`},{name:`description`,content:`One hour coach-led CrossFit training sessions covering weightlifting, gymnastics, mobility and conditioning â scaled for every ability at Saxon CrossFit, Wymondham.`},{property:`og:title`,content:`CrossFit Training Sessions in Wymondham | Saxon CrossFit`},{property:`og:description`,content:`Coach-led training sessions covering weightlifting, gymnastics, mobility and conditioning, scaled for every ability.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`},{property:`og:url`,content:`https://saxoncrossfit.com/classes`}],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/classes`}]}),component:ks(()=>mp(()=>import(`./classes-DphJ3FdK.js`),__vite__mapDeps([24,1,17,2,3,4,5,6])),`component`)}),uM=Ds(`/auth`)({head:()=>({meta:[{title:`Admin sign in | Saxon CrossFit`},{name:`description`,content:`Sign in to manage Saxon CrossFit enquiries.`}]}),component:ks(()=>mp(()=>import(`./auth-Dr04Unvz.js`),__vite__mapDeps([25,1,16,6,8,19])),`component`)}),dM=Ds(`/academy`)({head:()=>({meta:[{title:`Saxon Academy | CrossFit Kids in Wymondham, Norfolk`},{name:`description`,content:`Saxon Academy is CrossFit Kids at Saxon CrossFit, Wymondham. Fun, coach-led fitness for children that builds strength, confidence and a lifelong love of movement.`},{property:`og:title`,content:`Saxon Academy | CrossFit Kids in Wymondham, Norfolk`},{property:`og:description`,content:`Fun, coach-led fitness for children that builds strength, confidence and a lifelong love of movement.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`},{property:`og:url`,content:`https://saxoncrossfit.com/academy`}],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/academy`}]}),component:ks(()=>mp(()=>import(`./academy-Dg67BUBf.js`),__vite__mapDeps([26,1,3,4,5,6,27,2])),`component`)}),fM={"/2015-at-saxon-crossfit/":`/blog/2015-at-saxon-crossfit`,"/2017-crossfit-games/":`/blog/2017-crossfit-games`,"/2020-member-
176awards/":`/blog/2020-member-awards`,"/a-calorie-is-just-a-calorie-right/":`/blog/a-calorie-is-just-a-calorie-right`,"/actually-eating-right/":`/blog/actually-eating-right`,"/alex-winter/":`/coaches/alex-winter`,"/all-the-small-things/":`/blog/all-the-small-things`,"/annual-review-2023/":`/blog/annual-review-2023`,"/apparently-not-everyone-loves-burpees/":`/blog/apparently-not-everyone-loves-burpees`,"/atychiphobia/":`/blog/atychiphobia`,"/author/alex/":`/blog`,"/author/gary/":`/blog`,"/author/karen/":`/blog`,"/barbell-is-king/":`/blog/barbell-is-king`,"/basic-science-nutrition/":`/blog/basic-science-nutrition`,"/battle-of-wymondham-21022015/":`/blog/battle-of-wymondham-21022015`,"/be-an-instrument-not-an-ornament/":`/blog/be-an-instrument-not-an-ornament`,"/blog/":`/blog`,"/blog3/":`/blog`,"/boosting-your-immune-system/":`/blog/boosting-your-immune-system`,"/bring-a-buddy-session-13032016-saxon-crossfit-wymondham-norfolk/":`/blog/bring-a-buddy-session-13032016-saxon-crossfit-wymondham-norfolk`,"/burpees/":`/blog/burpees`,"/can-i-increase-my-exercise-capacity-with-efficient-breathing/":`/blog/can-i-increase-my-exercise-capacity-with-efficient-breathing`,"/category/coaches/":`/blog`,"/category/getting-started/":`/blog`,"/category/saxon-blog/":`/blog`,"/category/saxon-crossfit-chronicles/":`/blog`,"/cheaters-never-prosper/":`/blog/cheaters-never-prosper`,"/chocolate-protein-and-blueberry-muffins/":`/blog/chocolate-protein-and-blueberry-muffins`,"/christmas-eve-saxon-crossfit-wymondham-norfolk/":`/blog/christmas-eve-saxon-crossfit-wymondham-norfolk`,"/coach-els-suffolk-games/":`/blog/coach-els-suffolk-games`,"/coach-heidi/":`/blog/coach-heidi`,"/coach-jordan/":`/blog/coach-jordan`,"/coach-sam/":`/blog/coach-sam`,"/coach-steph/":`/blog/coach-steph`,"/coach-tim-crossfit/":`/blog/coach-tim-crossfit`,"/community/":`/`,"/competition-nerves-dealing-with-the-jitters/":`/blog/competition-nerves-dealing-with-the-jitters`,"/constantly-varied-programming/":`/blog/constantly-varied-programming`,"/crossfit-cult-community/":`/blog/crossfit-cult-community`,"/crossfit-glossary/":`/blog/crossfit-glossary`,"/crossfit-lifestyles/":`/blog/crossfit-lifestyles`,"/crossfit-mental-health/":`/blog/crossfit-mental-health`,"/crossfit-open-2022/":`/blog/crossfit-open-2022`,"/crossfit-postpartum/":`/blog/crossfit-postpartum`,"/crossfit-pregnancy/":`/blog/crossfit-pregnancy`,"/crossfit-vs-the-games/":`/blog/crossfit-vs-the-games`,"/demonstrating-your-hard-work/":`/blog/demonstrating-your-hard-work`,"/diet-not-eat/":`/blog/diet-not-eat`,"/do-you-recover/":`/blog/do-you-recover`,"/doesnt-love-shoes/":`/blog/doesnt-love-shoes`,"/dont-change-your-game-just-yet/":`/blog/dont-change-your-game-just-yet`,"/dont-necessarily-want-lose-weight/":`/blog/dont-necessarily-want-lose-weight`,"/effort-is-impressive/":`/blog/effort-is-impressive`,"/effort-makes-difference/":`/blog/effort-makes-difference`,"/eleanor-perllman/":`/blog/eleanor-perllman`,"/embracing-life-skills-at-saxon-crossfit/":`/blog/embracing-life-skills-at-saxon-crossfit`,"/envira/saxon-community/":`/`,"/everyone-loves-burpees-right/":`/blog/everyone-loves-burpees-right`,"/fallen-off-your-horse-lately/":`/blog/fallen-off-your-horse-lately`,"/family-work-fitness/":`/blog/family-work-fitness`,"/far-side-hard-work/":`/blog/far-side-hard-work`,"/fight-flight-fitness/":`/blog/fight-flight-fitness`,"/first-competition-prep/":`/blog/first-competition-prep`,"/first-months-crossfit/":`/blog/first-months-crossfit`,"/fitness-fears/":`/blog/fitness-fears`,"/fitness-in-100-words/":`/blog/fitness-in-100-words`,"/five-things-learned-coach/":`/blog/five-things-learned-coach`,"/five-things-learned-competitor/":`/blog/five-things-learned-competitor`,"/five-things-learned-member-2/":`/blog/five-things-learned-member-2`,"/frances-peters-my-crossfit-journey-saxon-crossfit-chronicles/":`/blog/frances-peters-my-crossfit-journey-saxon-crossfit-chronicles`,"/frustrated-with-your-fitness-progress-this-year/":`/blog/frustrated-with-your-fitness-progress-this-year`,"/fuck-my-legs/":`/blog/fuck-my-legs`,"/gary-winter/":`/coaches/gary-winter`,"/goal-setting/":`/blog/goal-setting`,"/good-movement-is-more-impressive/":`/blog/good-movement-is-more-impressive`,"/guys-vs-girls-all-you-need-to-know/":`/blog/guys-v
176s-girls-all-you-need-to-know`,"/guys-vs-girls-lowdown/":`/blog/guys-vs-girls-lowdown`,"/guys-vs-girls-who-is-the-fittest-sex/":`/blog/guys-vs-girls-who-is-the-fittest-sex`,"/habit/":`/blog/habit`,"/ham-and-new-potato-omelette/":`/blog/ham-and-new-potato-omelette`,"/harder-to-kill/":`/blog/harder-to-kill`,"/healthy-is-happy/":`/blog/healthy-is-happy`,"/heidi-mills-member-year/":`/blog/heidi-mills-member-year`,"/holiday-fitness-option/":`/blog/holiday-fitness-option`,"/holiday-fitness-revisited/":`/blog/holiday-fitness-revisited`,"/holiday-fitness-workouts/":`/blog/holiday-fitness-workouts`,"/holiday-fitness/":`/blog/holiday-fitness`,"/how-do-we-program/":`/blog/how-do-we-program`,"/how-to-scale-murph/":`/blog/how-to-scale-murph`,"/how-to-stay-warm-at-the-gym-this-winter/":`/blog/how-to-stay-warm-at-the-gym-this-winter`,"/ice-cream-cup-the-day/":`/blog/ice-cream-cup-the-day`,"/in-2019-be-you/":`/blog/in-2019-be-you`,"/isolation-motivation/":`/blog/isolation-motivation`,"/isolation-training/":`/blog/isolation-training`,"/january-member-of-the-month/":`/blog/january-member-of-the-month`,"/jordan-burrell/":`/blog/jordan-burrell`,"/keeping-warm-winter/":`/blog/keeping-warm-winter`,"/kettlebell-workouts/":`/blog/kettlebell-workouts`,"/lets-talk-chalk/":`/blog/lets-talk-chalk`,"/makes-saxon-crossfit-different-effective-popular/":`/blog/makes-saxon-crossfit-different-effective-popular`,"/making-a-comeback/":`/blog/making-a-comeback`,"/mans-not-hot-training-in-the-heat/":`/blog/mans-not-hot-training-in-the-heat`,"/meet-saxon-member-frances-quarter-finalist-crossfit-games-2022/":`/blog/meet-saxon-member-frances-quarter-finalist-crossfit-games-2022`,"/member-awards/":`/blog/member-awards`,"/member-month-amy-gilmour/":`/blog/member-month-amy-gilmour`,"/member-month-bart-kosmalski/":`/blog/member-month-bart-kosmalski`,"/member-month-becky-willett/":`/blog/member-month-becky-willett`,"/member-month-dave-allum/":`/blog/member-month-dave-allum`,"/member-month-eleanor-perllman/":`/blog/member-month-eleanor-perllman`,"/member-month-gav/":`/blog/member-month-gav`,"/member-month-heidi-mills/":`/blog/member-month-heidi-mills`,"/member-month-james/":`/blog/member-month-james`,"/member-month-lindsey-imeson/":`/blog/member-month-lindsey-imeson`,"/member-month-matt/":`/blog/member-month-matt`,"/member-month-rob-breen/":`/blog/member-month-rob-breen`,"/member-month-sam-hunt/":`/blog/member-month-sam-hunt`,"/member-of-the-month-abi-brett-williams/":`/blog/member-of-the-month-abi-brett-williams`,"/member-of-the-month-amelia-gray/":`/blog/member-of-the-month-amelia-gray`,"/member-of-the-month-april-2015/":`/blog/member-of-the-month-april-2015`,"/member-of-the-month-carina-west/":`/blog/member-of-the-month-carina-west`,"/member-of-the-month-caroline-baines/":`/blog/member-of-the-month-caroline-baines`,"/member-of-the-month-darren-brooks/":`/blog/member-of-the-month-darren-brooks`,"/member-of-the-month-greg-jones/":`/blog/member-of-the-month-greg-jones`,"/member-of-the-month-jordan-burrell/":`/blog/member-of-the-month-jordan-burrell`,"/member-of-the-month-june-2015/":`/blog/member-of-the-month-june-2015`,"/member-of-the-month-june/":`/blog/member-of-the-month-june`,"/member-of-the-month-luke-cadby-gledhill/":`/blog/member-of-the-month-luke-cadby-gledhill`,"/member-of-the-month-luke-pickford/":`/blog/member-of-the-month-luke-pickford`,"/member-of-the-month-mark-ayliffe/":`/blog/member-of-the-month-mark-ayliffe`,"/member-of-the-month-may-2015/":`/blog/member-of-the-month-may-2015`,"/member-of-the-month-natasha-mowser/":`/blog/member-of-the-month-natasha-mowser`,"/member-of-the-month-nicola-brooks/":`/blog/member-of-the-month-nicola-brooks`,"/member-of-the-month-pam/":`/blog/member-of-the-month-pam`,"/member-of-the-month-robyn/":`/blog/member-of-the-month-robyn`,"/member-of-the-month-sammie/":`/blog/member-of-the-month-sammie`,"/member-of-the-month-saxon-teens/":`/blog/member-of-the-month-saxon-teens`,"/member-of-the-month-scott/":`/blog/member-of-the-month-scott`,"/member-of-the-month-steve-walsh/":`/blog/member-of-the-month-steve-walsh`,"/member-of-the-month-tim/":`/blog/member-of-the-month-tim`,"/member-of-the-month-toni-clancy/":`/blog/member-of-the-month-toni-clancy`,"/member-of-the-month-vicki-swann/":`/blog/member-of-the-month-vicki-swann`,"/member-of-the-month/":`/blog/member-of-the-month`,"/member-of-the-year-jordan-burrell/":`/blog/member-of-the-year-jordan-burrell`,"/member-year-chris-booker/":`/blog/member-year-chris-booker`,"/more-than-just-fitness-what-crossfit-does-for-you/":`/blog/more-than-just-fitness-what-crossfit-does-for-you`,"/more-than-you-think/":`/blog/more-than-you-think`,"/moving-the-goal-posts/":`/blog/moving-the-goal-posts`,"/n-ways-wellbeing/":`/blog/n-ways-wellbeing`,"/new-defibrillator/":`/blog/new-defibrillator`,"/news-from-the-coaching-team/":`/blog/news-from-the-coaching-team`,"/nutrition-faq/":`/blog/nutrition-faq`,"/nutrition-our-mindset/":`/blog/nutrition-our-mindset`,"/off-the-carbs-off-the-couch/":`/blog/off-the-carbs-off-the-couch`,"/one-drug-taking/":`/blog/one-drug-taking`,"/open-gym-and-open-workout-15-2/":`/blog/open-gym-and-open-workout-15-2`,"/open-struggles/":`/blog/open-struggles`,"/peace-and-goodwill/":`/blog/peace-and-goodwill`,"/peanut-butter-porridge/":`/blog/peanut-butter-porridge`,"/peanut-butter-post-workout-smoothie/":`/blog/peanut-butter-post-workout-smoothie`,"/positive-mindset-hack/":`/blog/positive-mindset-hack`,"/pre-workout-blues/":`/blog/pre-workout-blues`,"/privacy-policy/":`/privacy`,"/progress/":`/blog/progress`,"/progression-is-lifelong/":`/blog/progression-is-lifelong`,"/real-fitness-hurts/":`/blog/real-fitness-hurts`,"/reasons-to-crossfit/":`/blog/reasons-to-crossfit`,"/recovery-deep-tissue-massage/":`/blog/recovery-deep-tissue-massage`,"/recovery-sleep/":`/blog/recovery-sleep`,"/rest-and-recovery/":`/blog/rest-and-recovery`,"/roger-birchall-my-crossfit-journey/":`/blog/roger-birchall-my-crossfit-journey`,"/rowing-tims-favourite/":`/blog/rowing-tims-favourite`,"/sam-hunt/":`/blog/sam-hunt`,"/saxon-academy-class-structure-and-rulebook/":`/classes`,"/saxon-athlete-at-the-uk-obstacle-course-racing-championships/":`/blog/saxon-athlete-at-the-uk-obstacle-course-racing-championships`,"/saxon-athlete-makes-county-team/":`/blog/saxon-athlete-makes-county-team`,"/saxon-clean-eating-challenge-the-review/":`/blog/saxon-clean-eating-challenge-the-review`,"/saxon-crossfit-2021-member-
176awards/":`/blog/saxon-crossfit-2021-member-awards`,"/saxon-crossfit-2022-member-awards/":`/blog/saxon-crossfit-2022-member-awards`,"/saxon-crossfit-2023-member-awards/":`/blog/saxon-crossfit-2023-member-awards`,"/saxon-crossfit-2024-member-awards-celebrating-our-champions/":`/blog/saxon-crossfit-2024-member-awards-celebrating-our-champions`,"/saxon-crossfit-2025-member-awards/":`/blog/saxon-crossfit-2025-member-awards`,"/saxon-crossfit-clean-eating-challenge-the-what-and-the-why/":`/blog/saxon-crossfit-clean-eating-challenge-the-what-and-the-why`,"/saxon-crossfit-member-survey/":`/blog/saxon-crossfit-member-survey`,"/saxon-million/":`/blog/saxon-million`,"/sell-all-your-chairs/":`/blog/sell-all-your-chairs`,"/september-member-of-the-month/":`/blog/september-member-of-the-month`,"/sheila-greenacre/":`/blog/sheila-greenacre`,"/someone-froze-my-mojo/":`/blog/someone-froze-my-mojo`,"/sometimes-simple-route-will/":`/blog/sometimes-simple-route-will`,"/spend-christmas-eve/":`/blog/spend-christmas-eve`,"/sports-massage-and-crossfit/":`/blog/sports-massage-and-crossfit`,"/start-training-summer-body/":`/blog/start-training-summer-body`,"/stay-track-festive-season/":`/blog/stay-track-festive-season`,"/steak-night/":`/blog/steak-night`,"/stimulus-scaling/":`/blog/stimulus-scaling`,"/stop-limiting-yourself/":`/blog/stop-l
176imiting-yourself`,"/strength-over-shortcut/":`/blog/strength-over-shortcut`,"/style_category/christmas-style/":`/blog`,"/style_category/custom-style/":`/blog`,"/style_category/simple-pattern-style/":`/blog`,"/style_category/valentines-day-style/":`/blog`,"/supplements-what-the-fuck/":`/blog/supplements-what-the-fuck`,"/tag/crossfit/":`/blog`,"/tag/fitness/":`/blog`,"/tag/fitter/":`/blog`,"/tag/goals/":`/blog`,"/tag/healthier/":`/blog`,"/tag/saxon-crossfit/":`/blog`,"/tag/sports-massage/":`/blog`,"/tag/stronger/":`/blog`,"/take-care-hands/":`/blog/take-care-hands`,"/take-control-fitness/":`/blog/take-control-fitness`,"/the-cherry-pick/":`/blog/the-cherry-pick`,"/the-christmas-wishlist/":`/blog/the-christmas-wishlist`,"/the-cost-of-our-goals/":`/blog/the-cost-of-our-goals`,"/the-future-of-fitness/":`/blog/the-future-of-fitness`,"/the-ice-cream-cup/":`/blog/the-ice-cream-cup`,"/the-ideal-athlete/":`/blog/the-ideal-athlete`,"/the-man-the-legend/":`/blog/the-man-the-legend`,"/the-other-side-of-the-whiteboard/":`/blog/the-other-side-of-the-whiteboard`,"/the-weekend-matters/":`/blog/the-weekend-matters`,"/theamrapmindset/":`/blog/theamrapmindset`,"/theoretical-hierarchy-physical-development/":`/blog/theoretical-hierarchy-physical-development`,"/things-will-never-hear-coach-tim-say/":`/blog/things-will-never-hear-coach-tim-say`,"/three-biggest-things-holding-back/":`/blog/three-biggest-things-holding-back`,"/three-simple-things/":`/blog/three-simple-things`,"/time-change-growth/":`/blog/time-change-growth`,"/timetable/":`/classes`,"/tips-seasoned-crossfitters/":`/blog/tips-seasoned-crossfitters`,"/to-compete-or-not-to-compete-that-is-the-question/":`/blog/to-compete-or-not-to-compete-that-is-the-question`,"/top-recommended-podcasts/":`/blog/top-recommended-podcasts`,"/tracking-my-goal-continued/":`/blog/tracking-my-goal-continued`,"/tracking-my-goal-sheila/":`/blog/tracking-my-goal-sheila`,"/training-in-the-a-m/":`/blog/training-in-the-a-m`,"/training-injury-wall-road/":`/blog/training-injury-wall-road`,"/tribal-clash-2015-saxon-crossfit/":`/blog/tribal-clash-2015-saxon-crossfit`,"/tribal-clash-2017-rundown/":`/blog/tribal-clash-2017-rundown`,"/tribal-clash-mouth-frances/":`/blog/tribal-clash-mouth-frances`,"/tribal-clash-portugal-wow/":`/blog/tribal-clash-portugal-wow`,"/twenty-five-tips-new-crossfitter-veterans/":`/blog/twenty-five-tips-new-crossfitter-veterans`,"/virtuosity-performing-the-common-uncommonly-well/":`/blog/virtuosity-performing-the-common-uncommonly-well`,"/what-is-soph-doing/":`/blog/what-is-soph-doing`,"/whats-crossfit-affiliate/":`/blog/whats-crossfit-affiliate`,"/whats-in-a-workout/":`/blog/whats-in-a-workout`,"/whats-in-your-kit-bag/":`/blog/whats-in-your-kit-bag`,"/whats-your-purpose/":`/blog/whats-your-purpose`,"/when-to-go-rx/":`/blog/when-to-go-rx`,"/who-is-saxon-crossfit-for/":`/blog/who-is-saxon-crossfit-for`,"/why-all-the-dumbbells/":`/blog/why-all-the-dumbbells`,"/why-do-we-record-our-scores/":`/blog/why-do-we-record-our-scores`,"/why-wait/":`/blog/why-wait`,"/why-we-love-crossfit/":`/blog/why-we-love-crossfit`,"/why-you-should-scale/":`/blog/why-you-should-scale`,"/will-crossfit-make-bulky/":`/blog/will-crossfit-make-bulky`,"/will-kill-first/":`/blog/will-kill-first`,"/winter-is-coming/":`/blog/winter-is-coming`,"/winter-training-motivation/":`/blog/winter-training-motivation`,"/your-first-pull-up/":`/blog/your-first-pull-up`,"/youtube-insta-just-ask-coach/":`/blog/youtube-insta-just-ask-coach`};function pM(e){let t=e.toLowerCase();return[t,t.endsWith(`/`)?t:t+`/`,t.replace(/\/+$/,``)||`/`]}function mM(e){for(let t of pM(e))if(fM[t])return fM[t];return null}var hM=Ds(`/$`)({beforeLoad:({location:e})=>{let t=mM(e.pathname);if(t)throw he({href:t,replace:!0})},head:()=>({meta:[{title:`Page Not Found | Saxon CrossFit Wymondham`},{name:`description`,content:`The page you are looking for has moved or no longer exists. Head back to Saxon CrossFit to find classes, memberships and coaching.`},{name:`robots`,content:`noindex`}]}),component:ks(()=>mp(()=>import(`./_-DLZuIlmx.js`),__vite__mapDeps([28,1,3,4,5,6])),`component`)}),gM=Ds(`/_authenticated`)({beforeLoad:async()=>{let{data:e,error:t}=await sm.auth.getUser();if(t||!e.user)throw he({to:`/auth`});return{user:e.user}},component:ks(()=>mp(()=>import(`./route-CT20GCnY.js`),__vite__mapDeps([29,1])),`component`)}),_M=Ds(`/`)({head:()=>({meta:[{title:`Saxon CrossFit | CrossFit Gym in Wymondham, Norfolk`},{name:`description`,content:`Saxon CrossFit is Wymondham's coach-led CrossFit gym. Constantly varied functional fitness, scaled for every ability. Book your free taster.`},{property:`og:title`,content:`Saxon CrossFit | CrossFit Gym in Wymondham, Norfolk`},{property:`og:description`,content:`Coach-led CrossFit training sessions, memberships with no contract and a community that knows your name.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`},{property:`og:url`,content:`https://saxoncrossfit.com/`}],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/`}],scripts:[{type:`application/ld+json`,children:JSON.stringify({"@context":`https://schema.org`,"@type":`ExerciseGym`,name:aS.name,description:`Coach-led CrossFit gym in Wymondham, Norfolk. Constantly varied functional fitness, scaled for every ability.`,url:`https://saxoncrossfit.com/`,telephone:`+441953438538`,email:aS.email,address:{"@type":`PostalAddress`,streetAddress:`Wymondham Business Centre, Unit 7, Eleven Mile Lane`,addressLocality:`Suton, Wymondham`,addressRegion:`Norfolk`,postalCode:`NR18 9JL`,addressCountry:`GB`},sameAs:[aS.socials.facebook,aS.socials.instagram,aS.socials.youtube]})}]}),component:ks(()=>mp(()=>import(`./routes-CA6dEDm4.js`),__vite__mapDeps([30,1,3,4,5,6,31,27,32,9,21,17,2,33,34])),`component`)}),vM=Ds(`/blog/`)({head:()=>({meta:[{title:`Blog | Saxon CrossFit Wymondham`},{name:`description`,content:`News, member stories, training advice and nutrition guidance from the coaches and community at Saxon CrossFit in Wymondham, Norfolk.`},{property:`og:title`,content:`Blog | Saxon CrossFit Wymondham`},{property:`og:description`,content:`Member stories, training advice and news from Saxon CrossFit.`},{property:`og:type`,content:`website`},{name:`twitter:card`,content:`summary_large_image`}]}),component:ks(()=>mp(()=>import(`./blog.index-DrvN1VpA.js`),__vite__mapDeps([35,1,3,4,5,6,32,2,19,33,34])),`component`)}),yM=Ds(`/product/$handle`)({loader:async({params:e})=>{try{return await Wx(e.handle)}catch{return null}},head:({params:e,loaderData:t})=>{let n=t?.node,r=n?`${n.title}
176 | Saxon CrossFit Shop`:`Product | Saxon CrossFit Shop`,i=n?.description?n.description.replace(/\s+/g,` `).trim().slice(0,155):`Saxon CrossFit kit and merchandise, shipped straight to your door.`;return{meta:[{title:r},{name:`description`,content:i},{property:`og:title`,content:r},{property:`og:description`,content:i},{property:`og:type`,content:`product`},{property:`og:url`,content:`https://saxoncrossfit.com/product/${e.handle}`},{name:`twitter:card`,content:`summary_large_image`},...n?.images.edges[0]?.node.url?[{property:`og:image`,content:n.images.edges[0].node.url},{name:`twitter:image`,content:n.images.edges[0].node.url}]:[]],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/product/${e.handle}`}],scripts:n?[{type:`application/ld+json`,children:JSON.stringify({"@context":`https://schema.org`,"@type":`Product`,name:n.title,description:n.description?n.description.replace(/\s+/g,` `).trim():void 0,image:n.images.edges[0]?.node.url,offers:{"@type":`Offer`,price:Number(n.priceRange.minVariantPrice.amount).toFixed(2),priceCurrency:n.priceRange.minVariantPrice.currencyCode,availability:n.variants.edges.some(e=>e.node.availableForSale)?`https://schema.org/InStock`:`https://schema.org/OutOfStock`,url:`https://saxoncrossfit.com/product/${e.handle}`}})}]:[]}},component:ks(()=>mp(()=>import(`./product._handle-BosyKLRh.js`),__vite__mapDeps([36,1,3,4,5,6,37,8])),`component`)}),bM=Ds(`/blog/$slug`)({loader:async({params:e})=>({meta:(await mp(async()=>{let{default:e}=await import(`./posts-index-B09dRoOj.js`);return{default:e}},[])).default.find(t=>t.slug===e.slug)??null}),head:({params:e,loaderData:t})=>{let n=t?.meta,r=n?`${n.title} | Saxon CrossFit`:`Blog | Saxon CrossFit`,i=n?n.excerpt.replace(/\s+/g,` `).slice(0,155):`News, workouts and community updates from Saxon CrossFit in Wymondham.`;return{meta:[{title:r},{name:`description`,content:i},{property:`og:title`,content:r},{property:`og:description`,content:i},{property:`og:type`,content:`article`},{name:`twitter:card`,content:`summary_large_image`},{property:`og:url`,content:`https://saxoncrossfit.com/blog/${e.slug}`},...n?.image?[{property:`og:image`,content:`https://saxoncrossfit.com${n.image}`},{name:`twitter:image`,content:`https://saxoncrossfit.com${n.image}`}]:[]],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/blog/${e.slug}`}],scripts:n?[{type:`application/ld+json`,children:JSON.stringify({"@context":`https://schema.org`,"@type":`BlogPosting`,headline:n.title,description:i,datePublished:n.date,mainEntityOfPage:`https://saxoncrossfit.com/blog/${e.slug}`,author:{"@type":`Organization`,name:`Saxon CrossFit`},publisher:{"@type":`Organization`,name:`Saxon CrossFit`,url:`https://saxoncrossfit.com/`}})}]:[]}},component:ks(()=>mp(()=>import(`./blog._slug-BgDkXAk5.js`),__vite__mapDeps([38,1,3,4,5,6,37,2,33,34])),`component`)}),xM=Ds(`/coaches/`)({component:ks(()=>mp(()=>import(`./coaches.index-CzPIoDFC.js`),__vite__mapDeps([39,1,3,4,5,6,31])),`component`)}),SM=[{name:`Alex Winter`,slug:`alex-winter`,role:`Coach`,image:`/__l5e/assets-v1/406e1c4c-b6fd-4e5d-a043-ca9c2035d923/alex-winter-coach.jpg`,bio:`Barbell obsessive with a sharp eye for technique â Alex will get your lifts moving properly.`,fullBio:`Alex is a barbell obsessive with a sharp eye for technique. He specialises in helping members move better under load, whether they are learning their first deadlift or refining an Olympic lift. His sessions are detailed, patient and built around solid foundations.`,quals:[`CrossFit Level 2`,`British Weightlifting Level 2`],specialties:[`Olympic lifting`,`Barbell technique`,`Strength development`],yearsExperience:`8`,philosophy:`Move well first, then move heavy.`}
176,{name:`Jasmine Turner`,slug:`jasmine-turner`,role:`Academy Coach`,image:`/__l5e/assets-v1/6595e871-be58-4a83-9185-9c11c7489093/jasmine-turner-coach.jpg`,bio:`Academy coach who believes movement is medicine â making fitness accessible to people of all abilities.`,fullBio:`Jasmine believes movement is medicine. It's a powerful force that branches further than physical ability into self-esteem, resilience, mood, drive and focus. She strives to make fitness accessible to people of all abilities, taking people as she finds them to help improve their health and wellbeing.`,quals:[`Level 2 Gym Instructing`,`Level 3 Personal Training`,`Level 4 Advanced Personal Training`,`Level 2 Group Indoor Cycling Instructor`,`Level 2 Pre and Post Natal Fitness`,`Level 2 Kettlebell Instructor`,`Level 2 Children's Fitness Instructing`],specialties:[`Personal training`,`Pre and post natal fitness`,`Group indoor cycling`,`Kettlebell training`,`Children's fitness`],yearsExperience:``,philosophy:`I believe movement is medicine. It's a powerful force that branches further than physical ability into self-esteem, resilience, mood, drive and focus. I strive to make fitness accessible to people of all abilities. This means taking people as I find them to help improve their health and wellbeing.`},{name:`Maddie Brooks`,slug:`maddie-brooks`,role:`Coach`,image:`/__l5e/assets-v1/ba21555a-e5ac-4c22-933c-897ff002a396/maddie-brooks-coach.jpg`,bio:`CrossFit Level 1 coach and GB Olympic weightlifter who brings elite lifting experience, a karate black belt and a ballroom dancer's discipline to every session.`,fullBio:`Maddie is a CrossFit Level 1 coach and a member of the GB Olympic Weightlifting Team, so the barbell is never far from her hands. Her sporting background is unusually broad: a karate black belt and a competitive ballroom dancer, she understands how discipline, timing and body awareness translate across completely different disciplines. 177 178That range shapes her coaching. She teaches movement with patience and precision, whether someone is learning their first snatch or refining lockout strength overhead. Maddie believes strength is built deliberately, one clean rep at a time, and that everyone â whatever their starting point â can move better and lift more than they think.`,quals:[`CrossFit Level 1`],specialties:[`Olympic weightlifting`,`Strength development`,`Movement & technique`,`Saxon Academy`],yearsExperience:``,philosophy:`Strength is built deliberately, one clean rep at a time.`},{name:`Rachel Wilkinson`,slug:`rachel-wilkinson`,role:`Coach`,image:`/__l5e/assets-v1/8d5c863d-2f76-45ef-97c8-f1630143b2ea/IMG_6366.jpeg`,bio:`Former county swimmer turned CrossFit coach, passionate about making fitness accessible to everyone â from adaptive athletes to those rebuilding strength after cancer.`,fullBio:`Rachel grew up in a sporting family and competed in swimming at county and national levels before discovering CrossFit in 2017. She was drawn to its constant challenge, variety, and the way it helps her switch off after a long day at work. 179 180Working as an Occupational Therapist for the NHS, Rachel quickly saw how accessible CrossFit can be for people who want to improve their mental and physical health â including those with disabilities. That realisation led her to complete her coaching qualifications so she could bring her professional expertise into the gym. 181 182Over the years she has coached adaptive athletes with a wide range of disabilities, as well as general CrossFit classes. More recently her focus has been on the Battle Cancer programme, supporting people post-treatment with structured CrossFit sessions to rebuild strength, confidence and wellbeing.`,quals:[`CrossFit Level 2 Trainer`,`CrossFit Adaptive certificate`,`The Battle Cancer Level 1 Certification`],specialties:[`Adaptive / inclusive coaching`,`Battle Cancer programme`,`General CrossFit classes`,`Mental health & wellbeing through fitness`],yearsExperience:`6+`,philosophy:`Fitness is for everyone. There is no better feeling than helping someone achieve what they never thought they could.`,socials:[{platform:`Instagram`,url:`https://www.instagram.com/coached.by.rach?igsh=ZzM5azUybXpxZHVr`}]},{name:`Sam Smith`,slug:`sam-smith`,role:`Coach`,image:`/__l5e/assets-v1/51481c32-4279-41b1-a835-80cd9d132ca4/sam-smith-coach.jpg`,bio:`CrossFit Level 1 coach and British Weightlifting Level 2 lifter â keen to share how rout
182ine, community and movement can change your life on and off the gym floor.`,fullBio:`CrossFit gave me an avenue to better movement, physical capability, and more sustainable mental health. 183 184I was instantly very keen to share with others how the routine, community and knowledge can change your life and make one better outside of the gym. 185 186There is a huge reward in seeing someone achieve things they never thought possible.`,quals:[`British Weightlifting Level 2`,`CrossFit Level 1`,`Level 3 Personal Training`],specialties:[`Weightlifting`,`Movement & technique`,`Mental health through fitness`],yearsExperience:``,philosophy:`There is a huge reward in seeing someone achieve things they never thought possible.`}],CM=Ds(`/coaches/$slug`)({loader:({params:e})=>({coach:SM.find(t=>t.slug===e.slug)??null}),head:({params:e,loaderData:t})=>{let n=t?.coach,r=n?`${n.name} | Saxon CrossFit Coaches`:`Coach | Saxon CrossFit`,i=n?n.bio??`Meet ${n.name}, ${n.role} at Saxon CrossFit.`:`Meet the coaching team at Saxon CrossFit.`;return{meta:[{title:r},{name:`description`,content:i},{property:`og:title`,content:r},{property:`og:description`,content:i},{property:`og:type`,content:`profile`},{property:`og:url`,content:`https://saxoncrossfit.com/coaches/${e.slug}`},{name:`twitter:card`,content:`summary_large_image`},...n?.image?[{property:`og:image`,content:`https://saxoncrossfit.com${n.image}`},{name:`twitter:image`,content:`https://saxoncrossfit.com${n.image}`}]:[]],links:[{rel:`canonical`,href:`https://saxoncrossfit.com/coaches/${e.slug}`}]}},component:ks(()=>mp(()=>import(`./coaches._slug-Dc9-gQ0C.js`),__vite__mapDeps([40,1,3,4,5,6,37])),`component`)}),wM=Ds(`/auth/confirm`)({head:()=>({meta:[{title:`Confirming your account | Saxon CrossFit`},{name:`robots`,content:`noindex`}]}),validateSearch:e=>({token_hash:e.token_hash||void 0,type:e.type||void 0}),component:ks(()=>mp(()=>import(`./auth.confirm-CjGDHb7v.js`),__vite__mapDeps([41,1,3,4,5,6])),`component`)}),TM=Ds(`/_authenticated/write`)({head:()=>({meta:[{title:`Write a post | Saxon CrossFit`},{name:`description`,content:`Write and submit a blog post for approval.`}]}),component:ks(()=>mp(()=>import(`./write-QLKUOMx8.js`),__vite__mapDeps([42,1,16,6,3,4,5,43,8,19,22,34])),`component`)}),EM=Ds(`/_authenticated/admin/posts`)({head:()=>({meta:[{title:`Blog approvals | Saxon CrossFit`},{name:`description`,content:`Review and approve blog posts submitted by writers.`}]}),component:ks(()=>mp(()=>import(`./admin.posts-DEBedZVe.js`),__vite__mapDeps([44,1,16,6,3,4,5,43,15,45,8,19,34])),`component`)}),DM=Ds(`/_authenticated/admin/enquiries`)({head:()=>({meta:[{title:`Enquiries Dashboard | Saxon CrossFit`},{name:`description`,content:`Manage incoming enquiries from the Saxon CrossFit website.`}]}),component:ks(()=>mp(()=>import(`./admin.enquiries-BFPIXw0n.js`),__vite__mapDeps([46,1,14,15,6,43,45])),`component`)}),OM=Ds(`/_authenticated/admin/chats`)({component:ks(()=>mp(()=>import(`./admin.chats-C3mqsPj0.js`),__vite__mapDeps([47,1])),`component`),head:()=>({meta:[{title:`Chatbot transcripts | Saxon CrossFit admin`},{name:`robots`,content:`noindex`},{name:`description`,content:`Review conversations from the Saxon CrossFit website chatbot.`}]})}),kM=tM.update({id:`/terms`,path:`/terms`,getParentRoute:()=>Zj}),AM=nM.update({id:`/shop`,path:`/shop`,getParentRoute:()=>Zj}),jM=rM.update({id:`/refund`,path:`/refund`,getParentRoute:()=>Zj}),MM=iM.update({id:`/privacy`,path:`/privacy`,getParentRoute:()=>Zj}),NM=aM.update({id:`/memberships`,path:`/memberships`,getParentRoute:()=>Zj}),PM=oM.update({id:`/get-started`,path:`/get-started`,getParentRoute:()=>Zj}),FM=sM.update({id:`/contact`,path:`/contact`,getParentRoute:()=>Zj}),IM=cM.update({id:`/coaches`,path:`/coaches`,getParentRoute:()=>Zj}),LM=lM.update({id:`/classes`,path:`/classes`,getParentRoute:()=>Zj}),RM=uM.update({id:`/auth`,path:`/auth`,getParentRoute:()=>Zj}),zM=dM.update({id:`/academy`,path:`/academy`,getParentRoute:()=>Zj}),BM=hM.update({id:`/$`,path:`/$`,getParentRoute:()=>Zj}),VM=gM.update({id:`/_authenticated`,getParentRoute:()=>Zj}),HM=_M.update({id:`/`,path:`/`,getParentRoute:()=>Zj}),UM=vM.update({id:`/blog/`,path:`/blog/`,getParentRoute:()=>Zj}),WM=yM.update({id:`/product/$handle`,path:`/product/$handle`,getParentRoute:()=>Zj}),GM=bM.update({id:`/blog/$slug`,path:`/blog/$slug`,getParentRoute:()=>Zj}),KM=xM.update({id:`/`,path:`/`,getParentRoute:()=>IM}),qM=CM.update({id:`/$slug`,path:`/$slug`,getParentRoute:()=>IM}),JM=wM.update({id:`/confirm`,path:`/confirm`,getParentRoute:()=>RM}),YM=TM.update({id:`/write`,path:`/write`,getParentRoute:()=>VM}),XM=EM.update({id:`/admin/posts`,path:`/admin/posts`,getParentRoute:()=>VM}),ZM=DM.update({id:`/admin/enquiries`,path:`/admin/enquiries`,getParentRoute:()=>VM}),QM={AuthenticatedWriteRoute:YM,AuthenticatedAdminChatsRoute:OM.update({id:`/admin/chats`,path:`/admin/chats`,getParentRoute:()=>VM}
186),AuthenticatedAdminEnquiriesRoute:ZM,AuthenticatedAdminPostsRoute:XM},$M=VM._addFileChildren(QM),eN={AuthConfirmRoute:JM},tN=RM._addFileChildren(eN),nN={CoachesSlugRoute:qM,CoachesIndexRoute:KM},rN={IndexRoute:HM,AuthenticatedRouteRoute:$M,SplatRoute:BM,AcademyRoute:zM,AuthRoute:tN,ClassesRoute:LM,CoachesRoute:IM._addFileChildren(nN),ContactRoute:FM,GetStartedRoute:PM,MembershipsRoute:NM,PrivacyRoute:MM,RefundRoute:jM,ShopRoute:AM,TermsRoute:kM,BlogSlugRoute:GM,ProductHandleRoute:WM,BlogIndexRoute:UM},iN=Zj._addFileChildren(rN),aN=()=>Gs({routeTree:iN,context:{queryClient:new yh},scrollRestoration:!0,defaultPreloadStaleTime:0});async function oN(){let e=await aN(),t;if(dm){let n=await dm.getOptions();n.serializationAdapters=n.serializationAdapters??[],window.__TSS_START_OPTIONS__=n,t=n.serializationAdapters,e.options.defaultSsr=n.defaultSsr}else t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t};return t.push(Fo),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await Vo(e),e}var sN=oN;async function cN(){let e=await sN();return window.$_TSR?.h(),e}var lN;function uN(){return lN||=cN(),(0,I.jsx)(Uo,{promise:lN,children:e=>(0,I.jsx)(Js,{router:e})})}var dN=ke();(0,F.startTransition)(()=>{(0,dN.hydrateRoot)(document,(0,I.jsx)(F.StrictMode,{children:(0,I.jsx)(uN,{})}))});export{ms as $,rv as A,og as B,Vv as C,uv as D,bv as E,Eg as F,Kh as G,Qh as H,hg as I,sm as J,Ih as K,lg as L,ev as M,Q_ as N,cv as O,X_ as P,bs as Q,ug as R,ey as S,Sv as T,Zh as U,ng as V,Yh as W,nc as X,sc as Y,Bs as Z,Ux as _,yM as a,mb as b,uS as c,cS as d,Po as et,sS as f,Wx as g,rS as h,bM as i,tv as j,av as k,fS as l,aS as m,CM as n,sM as o,oS as p,xh as q,SM as r,dS as s,wM as t,lS as u,Gx as v,Av as w,sy as x,Cb as y,sg as z};
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.