const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Index-D-x4SilX.js","assets/Footer-CFVJtkiU.js","assets/switch-Dec0dc-Y.js","assets/index-DCwwLzkC.js","assets/chevron-down-DmXcZc77.js","assets/shield-BXff2IHA.js","assets/arrow-left-CmY9fSR6.js","assets/circle-check-big-CY6jw0jF.js","assets/circle-x-D_vS_ZBP.js","assets/building-2-B2VH4pvR.js","assets/database-wM5cXMFe.js","assets/file-text-Ck9bd0E1.js","assets/FAQSection-Cbgkb-s8.js","assets/index-CwBYy7p4.js","assets/index-8qesBWc6.js","assets/index-RaTzh9Fu.js","assets/calendar-days-DfcgYsfY.js","assets/ContactForm-hESlSQ3j.js","assets/CookieBanner-CN0QtvK-.js","assets/SEOHead-LI61eC1n.js","assets/Experts-Cel5CujM.js","assets/Breadcrumbs-DFRCFM_K.js","assets/users-Df4A3MHI.js","assets/clock-B5ADzzQg.js","assets/Articles-CZGV0QIS.js","assets/FinesTable-B1iLLLwQ.js","assets/table-CySGlFiO.js","assets/badge-9jrv0-3i.js","assets/select-CwqORcvZ.js","assets/Combination-1HtR08Yv.js","assets/check-BxxUrAqS.js","assets/skeleton-BLPKzRWe.js","assets/circle-alert-BOgwLfcP.js","assets/refresh-cw-DCeqTAi3.js","assets/scale-tPKZZYlP.js","assets/external-link-HQTM5FIR.js","assets/calendar-B548cL3d.js","assets/CamerasInWorkplace-ClpFJCNE.js","assets/RelatedArticles-CIM9pIdF.js","assets/eye-YLFstmrt.js","assets/arrow-right-DjiIPjsU.js","assets/DpoRequirement-B7EPFlie.js","assets/circle-check-DpQWgz9o.js","assets/triangle-alert-CqKfrnsO.js","assets/BoardResponsibilities-DKqZ4pJX.js","assets/GeneratedArticle-Bct9WU_S.js","assets/purify.es-DZKeO-Ao.js","assets/Organizations-CYvWKKtM.js","assets/list-checks-xkD1bozn.js","assets/Webinar-DOcdrWxm.js","assets/shield-alert-DmMaChtW.js","assets/Fines-C3hKDAOp.js","assets/Pricing-DX2mi7Bn.js","assets/crown-Bqr-0GLe.js","assets/PreviewSMB-DCbRPgqv.js","assets/trash-2-BY28HLL0.js","assets/sparkles-DeowR8kk.js","assets/Telegram-C0iAcRrb.js","assets/content-admin-client-KtXy_mXL.js","assets/tabs-Cg3THYx2.js","assets/plus-CH4ew0--.js","assets/refresh-ccw-DjaShJH2.js","assets/ThankYou-X8-7__dm.js","assets/Videos-BAulUT_-.js","assets/textarea-D10Cc72V.js","assets/ArticlesAdmin-tRXPsotK.js","assets/EnforcementAdmin-t0WJG-bc.js","assets/Breaches-DTYSJRY5.js","assets/NotFound-DprAVNiK.js"])))=>i.map(i=>d[i]); var r0=Object.defineProperty;var Lh=e=>{throw TypeError(e)};var n0=(e,t,r)=>t in e?r0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var nr=(e,t,r)=>n0(e,typeof t!="symbol"?t+"":t,r),Wl=(e,t,r)=>t.has(e)||Lh("Cannot "+r);var C=(e,t,r)=>(Wl(e,t,"read from private field"),r?r.call(e):t.get(e)),te=(e,t,r)=>t.has(e)?Lh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),q=(e,t,r,n)=>(Wl(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Me=(e,t,r)=>(Wl(e,t,"access private method"),r);var To=(e,t,r,n)=>({set _(s){q(e,t,s,r)},get _(){return C(e,t,n)}});function s0(e,t){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function ho(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ym={exports:{}},ol={},wm={exports:{}},X={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var fo=Symbol.for("react.element"),i0=Symbol.for("react.portal"),o0=Symbol.for("react.fragment"),a0=Symbol.for("react.strict_mode"),l0=Symbol.for("react.profiler"),u0=Symbol.for("react.provider"),c0=Symbol.for("react.context"),d0=Symbol.for("react.forward_ref"),h0=Symbol.for("react.suspense"),f0=Symbol.for("react.memo"),p0=Symbol.for("react.lazy"),Dh=Symbol.iterator;function m0(e){return e===null||typeof e!="object"?null:(e=Dh&&e[Dh]||e["@@iterator"],typeof e=="function"?e:null)}var _m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bm=Object.assign,xm={};function Qs(e,t,r){this.props=e,this.context=t,this.refs=xm,this.updater=r||_m}Qs.prototype.isReactComponent={};Qs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Qs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Em(){}Em.prototype=Qs.prototype;function ld(e,t,r){this.props=e,this.context=t,this.refs=xm,this.updater=r||_m}var ud=ld.prototype=new Em;ud.constructor=ld;bm(ud,Qs.prototype);ud.isPureReactComponent=!0;var Mh=Array.isArray,Sm=Object.prototype.hasOwnProperty,cd={current:null},km={key:!0,ref:!0,__self:!0,__source:!0};function Tm(e,t,r){var n,s={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Sm.call(t,n)&&!km.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1>>1,U=P[G];if(0>>1;Gs(be,$))Des(re,be)?(P[G]=re,P[De]=$,G=De):(P[G]=be,P[Z]=$,G=Z);else if(Des(re,$))P[G]=re,P[De]=$,G=De;else break e}}return O}function s(P,O){var $=P.sortIndex-O.sortIndex;return $!==0?$:P.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,y=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(P){for(var O=r(u);O!==null;){if(O.callback===null)n(u);else if(O.startTime<=P)n(u),O.sortIndex=O.expirationTime,t(l,O);else break;O=r(u)}}function b(P){if(g=!1,v(P),!y)if(r(l)!==null)y=!0,V(x);else{var O=r(u);O!==null&&K(b,O.startTime-P)}}function x(P,O){y=!1,g&&(g=!1,m(T),T=-1),h=!0;var $=f;try{for(v(O),d=r(l);d!==null&&(!(d.expirationTime>O)||P&&!F());){var G=d.callback;if(typeof G=="function"){d.callback=null,f=d.priorityLevel;var U=G(d.expirationTime<=O);O=e.unstable_now(),typeof U=="function"?d.callback=U:d===r(l)&&n(l),v(O)}else n(l);d=r(l)}if(d!==null)var Y=!0;else{var Z=r(u);Z!==null&&K(b,Z.startTime-O),Y=!1}return Y}finally{d=null,f=$,h=!1}}var E=!1,S=null,T=-1,I=5,j=-1;function F(){return!(e.unstable_now()-jP||125G?(P.sortIndex=$,t(u,P),r(l)===null&&P===r(u)&&(g?(m(T),T=-1):g=!0,K(b,$-G))):(P.sortIndex=U,t(l,P),y||h||(y=!0,V(x))),P},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(P){var O=f;return function(){var $=f;f=O;try{return P.apply(this,arguments)}finally{f=$}}}})(Im);Am.exports=Im;var T0=Am.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var C0=_,ht=T0;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uu=Object.prototype.hasOwnProperty,P0=/^[: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]*$/,Fh={},zh={};function R0(e){return Uu.call(zh,e)?!0:Uu.call(Fh,e)?!1:P0.test(e)?zh[e]=!0:(Fh[e]=!0,!1)}function O0(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function A0(e,t,r,n){if(t===null||typeof t>"u"||O0(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Je(e,t,r,n,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Le={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Le[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Le[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Le[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Le[e]=new Je(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Le[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Le[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Le[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Le[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Le[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var hd=/[\-:]([a-z])/g;function fd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(hd,fd);Le[t]=new Je(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(hd,fd);Le[t]=new Je(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(hd,fd);Le[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Le[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});Le.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Le[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function pd(e,t,r,n){var s=Le.hasOwnProperty(t)?Le[t]:null;(s!==null?s.type!==0:n||!(2a||s[o]!==i[a]){var l=` `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Kl=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?vi(e):""}function I0(e){switch(e.tag){case 5:return vi(e.type);case 16:return vi("Lazy");case 13:return vi("Suspense");case 19:return vi("SuspenseList");case 0:case 2:case 15:return e=Gl(e.type,!1),e;case 11:return e=Gl(e.type.render,!1),e;case 1:return e=Gl(e.type,!0),e;default:return""}}function Vu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ls:return"Fragment";case as:return"Portal";case Fu:return"Profiler";case md:return"StrictMode";case zu:return"Suspense";case Bu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $m:return(e.displayName||"Context")+".Consumer";case Nm:return(e._context.displayName||"Context")+".Provider";case gd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vd:return t=e.displayName||null,t!==null?t:Vu(e.type)||"Memo";case Ar:t=e._payload,e=e._init;try{return Vu(e(t))}catch{}}return null}function j0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Vu(t);case 8:return t===md?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function en(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function N0(e){var t=Dm(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ro(e){e._valueTracker||(e._valueTracker=N0(e))}function Mm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Dm(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function _a(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Wu(e,t){var r=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Vh(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=en(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Um(e,t){t=t.checked,t!=null&&pd(e,"checked",t,!1)}function Hu(e,t){Um(e,t);var r=en(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?qu(e,t.type,r):t.hasOwnProperty("defaultValue")&&qu(e,t.type,en(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wh(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function qu(e,t,r){(t!=="number"||_a(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var yi=Array.isArray;function _s(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Oo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $i(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$0=["Webkit","ms","Moz","O"];Object.keys(xi).forEach(function(e){$0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xi[t]=xi[e]})});function Vm(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xi.hasOwnProperty(e)&&xi[e]?(""+t).trim():t+"px"}function Wm(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Vm(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var L0=me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Qu(e,t){if(t){if(L0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(A(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(t.style!=null&&typeof t.style!="object")throw Error(A(62))}}function Ju(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Yu=null;function yd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xu=null,bs=null,xs=null;function Kh(e){if(e=go(e)){if(typeof Xu!="function")throw Error(A(280));var t=e.stateNode;t&&(t=dl(t),Xu(e.stateNode,e.type,t))}}function Hm(e){bs?xs?xs.push(e):xs=[e]:bs=e}function qm(){if(bs){var e=bs,t=xs;if(xs=bs=null,Kh(e),t)for(e=0;e>>=0,e===0?32:31-(K0(e)/G0|0)|0}var Ao=64,Io=4194304;function wi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sa(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var a=o&~s;a!==0?n=wi(a):(i&=o,i!==0&&(n=wi(i)))}else o=r&~s,o!==0?n=wi(o):i!==0&&(n=wi(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function po(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ut(t),e[t]=r}function X0(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Si),rf=" ",nf=!1;function hg(e,t){switch(e){case"keyup":return T_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var us=!1;function P_(e,t){switch(e){case"compositionend":return fg(t);case"keypress":return t.which!==32?null:(nf=!0,rf);case"textInput":return e=t.data,e===rf&&nf?null:e;default:return null}}function R_(e,t){if(us)return e==="compositionend"||!Td&&hg(e,t)?(e=cg(),ia=Ed=Br=null,us=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=lf(r)}}function vg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yg(){for(var e=window,t=_a();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=_a(e.document)}return t}function Cd(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")}function M_(e){var t=yg(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&vg(r.ownerDocument.documentElement,r)){if(n!==null&&Cd(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=uf(r,i);var o=uf(r,n);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,cs=null,sc=null,Ti=null,ic=!1;function cf(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;ic||cs==null||cs!==_a(n)||(n=cs,"selectionStart"in n&&Cd(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ti&&zi(Ti,n)||(Ti=n,n=Ca(sc,"onSelect"),0fs||(e.current=dc[fs],dc[fs]=null,fs--)}function oe(e,t){fs++,dc[fs]=e.current,e.current=t}var tn={},Ve=ln(tn),tt=ln(!1),Ln=tn;function Fs(e,t){var r=e.type.contextTypes;if(!r)return tn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function rt(e){return e=e.childContextTypes,e!=null}function Ra(){ue(tt),ue(Ve)}function vf(e,t,r){if(Ve.current!==tn)throw Error(A(168));oe(Ve,t),oe(tt,r)}function Cg(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(A(108,j0(e)||"Unknown",s));return me({},r,n)}function Oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,Ln=Ve.current,oe(Ve,e),oe(tt,tt.current),!0}function yf(e,t,r){var n=e.stateNode;if(!n)throw Error(A(169));r?(e=Cg(e,t,Ln),n.__reactInternalMemoizedMergedChildContext=e,ue(tt),ue(Ve),oe(Ve,e)):ue(tt),oe(tt,r)}var lr=null,hl=!1,lu=!1;function Pg(e){lr===null?lr=[e]:lr.push(e)}function J_(e){hl=!0,Pg(e)}function un(){if(!lu&&lr!==null){lu=!0;var e=0,t=ne;try{var r=lr;for(ne=1;e>=o,s-=o,cr=1<<32-Ut(t)+s|r<T?(I=S,S=null):I=S.sibling;var j=f(m,S,v[T],b);if(j===null){S===null&&(S=I);break}e&&S&&j.alternate===null&&t(m,S),p=i(j,p,T),E===null?x=j:E.sibling=j,E=j,S=I}if(T===v.length)return r(m,S),de&&yn(m,T),x;if(S===null){for(;TT?(I=S,S=null):I=S.sibling;var F=f(m,S,j.value,b);if(F===null){S===null&&(S=I);break}e&&S&&F.alternate===null&&t(m,S),p=i(F,p,T),E===null?x=F:E.sibling=F,E=F,S=I}if(j.done)return r(m,S),de&&yn(m,T),x;if(S===null){for(;!j.done;T++,j=v.next())j=d(m,j.value,b),j!==null&&(p=i(j,p,T),E===null?x=j:E.sibling=j,E=j);return de&&yn(m,T),x}for(S=n(m,S);!j.done;T++,j=v.next())j=h(S,m,T,j.value,b),j!==null&&(e&&j.alternate!==null&&S.delete(j.key===null?T:j.key),p=i(j,p,T),E===null?x=j:E.sibling=j,E=j);return e&&S.forEach(function(L){return t(m,L)}),de&&yn(m,T),x}function w(m,p,v,b){if(typeof v=="object"&&v!==null&&v.type===ls&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Po:e:{for(var x=v.key,E=p;E!==null;){if(E.key===x){if(x=v.type,x===ls){if(E.tag===7){r(m,E.sibling),p=s(E,v.props.children),p.return=m,m=p;break e}}else if(E.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Ar&&bf(x)===E.type){r(m,E.sibling),p=s(E,v.props),p.ref=ci(m,E,v),p.return=m,m=p;break e}r(m,E);break}else t(m,E);E=E.sibling}v.type===ls?(p=$n(v.props.children,m.mode,b,v.key),p.return=m,m=p):(b=fa(v.type,v.key,v.props,null,m.mode,b),b.ref=ci(m,p,v),b.return=m,m=b)}return o(m);case as:e:{for(E=v.key;p!==null;){if(p.key===E)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){r(m,p.sibling),p=s(p,v.children||[]),p.return=m,m=p;break e}else{r(m,p);break}else t(m,p);p=p.sibling}p=gu(v,m.mode,b),p.return=m,m=p}return o(m);case Ar:return E=v._init,w(m,p,E(v._payload),b)}if(yi(v))return y(m,p,v,b);if(ii(v))return g(m,p,v,b);Uo(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,p!==null&&p.tag===6?(r(m,p.sibling),p=s(p,v),p.return=m,m=p):(r(m,p),p=mu(v,m.mode,b),p.return=m,m=p),o(m)):r(m,p)}return w}var Bs=Ig(!0),jg=Ig(!1),ja=ln(null),Na=null,gs=null,Ad=null;function Id(){Ad=gs=Na=null}function jd(e){var t=ja.current;ue(ja),e._currentValue=t}function pc(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Ss(e,t){Na=e,Ad=gs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(et=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(Ad!==e)if(e={context:e,memoizedValue:t,next:null},gs===null){if(Na===null)throw Error(A(308));gs=e,Na.dependencies={lanes:0,firstContext:e}}else gs=gs.next=e;return t}var Sn=null;function Nd(e){Sn===null?Sn=[e]:Sn.push(e)}function Ng(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Nd(t)):(r.next=s.next,s.next=r),t.interleaved=r,mr(e,n)}function mr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ir=!1;function $d(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $g(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function hr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ee&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,mr(e,r)}return s=n.interleaved,s===null?(t.next=t,Nd(n)):(t.next=s.next,s.next=t),n.interleaved=t,mr(e,r)}function aa(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,_d(e,r)}}function xf(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function $a(e,t,r,n){var s=e.updateQueue;Ir=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,c=u=l=null,a=i;do{var f=a.lane,h=a.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,g=a;switch(f=t,h=r,g.tag){case 1:if(y=g.payload,typeof y=="function"){d=y.call(h,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,f=typeof y=="function"?y.call(h,d,f):y,f==null)break e;d=me({},d,f);break e;case 2:Ir=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(c===null&&(l=d),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=c,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Un|=o,e.lanes=o,e.memoizedState=d}}function Ef(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=cu.transition;cu.transition={};try{e(!1),t()}finally{ne=r,cu.transition=n}}function Xg(){return Et().memoizedState}function eb(e,t,r){var n=Yr(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Zg(e))ev(t,r);else if(r=Ng(e,t,r,n),r!==null){var s=Ge();Ft(r,e,n,s),tv(r,t,n)}}function tb(e,t,r){var n=Yr(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Zg(e))ev(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,r);if(s.hasEagerState=!0,s.eagerState=a,zt(a,o)){var l=t.interleaved;l===null?(s.next=s,Nd(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=Ng(e,t,s,n),r!==null&&(s=Ge(),Ft(r,e,n,s),tv(r,t,n))}}function Zg(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function ev(e,t){Ci=Da=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function tv(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,_d(e,r)}}var Ma={readContext:xt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},rb={readContext:xt,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:kf,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ua(4194308,4,Kg.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ua(4194308,4,e,t)},useInsertionEffect:function(e,t){return ua(4,2,e,t)},useMemo:function(e,t){var r=qt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=qt();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=eb.bind(null,pe,e),[n.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:Sf,useDebugValue:Vd,useDeferredValue:function(e){return qt().memoizedState=e},useTransition:function(){var e=Sf(!1),t=e[0];return e=Z_.bind(null,e[1]),qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=pe,s=qt();if(de){if(r===void 0)throw Error(A(407));r=r()}else{if(r=t(),Ae===null)throw Error(A(349));Mn&30||Ug(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,kf(zg.bind(null,n,i,e),[e]),n.flags|=2048,Qi(9,Fg.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=qt(),t=Ae.identifierPrefix;if(de){var r=dr,n=cr;r=(n&~(1<<32-Ut(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ki++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Jt]=t,e[Wi]=n,dv(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ju(r,n),r){case"dialog":le("cancel",e),le("close",e),s=n;break;case"iframe":case"object":case"embed":le("load",e),s=n;break;case"video":case"audio":for(s=0;s<_i.length;s++)le(_i[s],e);s=n;break;case"source":le("error",e),s=n;break;case"img":case"image":case"link":le("error",e),le("load",e),s=n;break;case"details":le("toggle",e),s=n;break;case"input":Vh(e,n),s=Wu(e,n),le("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=me({},n,{value:void 0}),le("invalid",e);break;case"textarea":Hh(e,n),s=Ku(e,n),le("invalid",e);break;default:s=n}Qu(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Wm(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Bm(e,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&$i(e,l):typeof l=="number"&&$i(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ni.hasOwnProperty(i)?l!=null&&i==="onScroll"&&le("scroll",e):l!=null&&pd(e,i,l,o))}switch(r){case"input":Ro(e),Wh(e,n,!1);break;case"textarea":Ro(e),qh(e);break;case"option":n.value!=null&&e.setAttribute("value",""+en(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?_s(e,!!n.multiple,i,!1):n.defaultValue!=null&&_s(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Pa)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Fe(t),null;case 6:if(e&&t.stateNode!=null)fv(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(A(166));if(r=kn(qi.current),kn(Zt.current),Mo(t)){if(n=t.stateNode,r=t.memoizedProps,n[Jt]=t,(i=n.nodeValue!==r)&&(e=ct,e!==null))switch(e.tag){case 3:Do(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Do(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Jt]=t,t.stateNode=n}return Fe(t),null;case 13:if(ue(fe),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(de&&ut!==null&&t.mode&1&&!(t.flags&128))Ag(),zs(),t.flags|=98560,i=!1;else if(i=Mo(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(A(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(A(317));i[Jt]=t}else zs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fe(t),i=!1}else Dt!==null&&(Oc(Dt),Dt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||fe.current&1?Pe===0&&(Pe=3):Jd())),t.updateQueue!==null&&(t.flags|=4),Fe(t),null);case 4:return Vs(),xc(e,t),e===null&&Bi(t.stateNode.containerInfo),Fe(t),null;case 10:return jd(t.type._context),Fe(t),null;case 17:return rt(t.type)&&Ra(),Fe(t),null;case 19:if(ue(fe),i=t.memoizedState,i===null)return Fe(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)di(i,!1);else{if(Pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=La(e),o!==null){for(t.flags|=128,di(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return oe(fe,fe.current&1|2),t.child}e=e.sibling}i.tail!==null&&_e()>Hs&&(t.flags|=128,n=!0,di(i,!1),t.lanes=4194304)}else{if(!n)if(e=La(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),di(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!de)return Fe(t),null}else 2*_e()-i.renderingStartTime>Hs&&r!==1073741824&&(t.flags|=128,n=!0,di(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=_e(),t.sibling=null,r=fe.current,oe(fe,n?r&1|2:r&1),t):(Fe(t),null);case 22:case 23:return Qd(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?it&1073741824&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),null;case 24:return null;case 25:return null}throw Error(A(156,t.tag))}function cb(e,t){switch(Rd(t),t.tag){case 1:return rt(t.type)&&Ra(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vs(),ue(tt),ue(Ve),Md(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Dd(t),null;case 13:if(ue(fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));zs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(fe),null;case 4:return Vs(),null;case 10:return jd(t.type._context),null;case 22:case 23:return Qd(),null;case 24:return null;default:return null}}var zo=!1,Be=!1,db=typeof WeakSet=="function"?WeakSet:Set,D=null;function vs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ye(e,t,n)}else r.current=null}function Ec(e,t,r){try{r()}catch(n){ye(e,t,n)}}var Lf=!1;function hb(e,t){if(oc=ka,e=yg(),Cd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==r||s!==0&&d.nodeType!==3||(a=o+s),d!==i||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===r&&++u===s&&(a=o),f===i&&++c===n&&(l=o),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ac={focusedElem:e,selectionRange:r},ka=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,w=y.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ot(t.type,g),w);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(b){ye(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return y=Lf,Lf=!1,y}function Pi(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Ec(t,r,i)}s=s.next}while(s!==n)}}function ml(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Sc(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function pv(e){var t=e.alternate;t!==null&&(e.alternate=null,pv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jt],delete t[Wi],delete t[cc],delete t[G_],delete t[Q_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function mv(e){return e.tag===5||e.tag===3||e.tag===4}function Df(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mv(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kc(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Pa));else if(n!==4&&(e=e.child,e!==null))for(kc(e,t,r),e=e.sibling;e!==null;)kc(e,t,r),e=e.sibling}function Tc(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Tc(e,t,r),e=e.sibling;e!==null;)Tc(e,t,r),e=e.sibling}var Ne=null,$t=!1;function Cr(e,t,r){for(r=r.child;r!==null;)gv(e,t,r),r=r.sibling}function gv(e,t,r){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(al,r)}catch{}switch(r.tag){case 5:Be||vs(r,t);case 6:var n=Ne,s=$t;Ne=null,Cr(e,t,r),Ne=n,$t=s,Ne!==null&&($t?(e=Ne,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ne.removeChild(r.stateNode));break;case 18:Ne!==null&&($t?(e=Ne,r=r.stateNode,e.nodeType===8?au(e.parentNode,r):e.nodeType===1&&au(e,r),Ui(e)):au(Ne,r.stateNode));break;case 4:n=Ne,s=$t,Ne=r.stateNode.containerInfo,$t=!0,Cr(e,t,r),Ne=n,$t=s;break;case 0:case 11:case 14:case 15:if(!Be&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Ec(r,t,o),s=s.next}while(s!==n)}Cr(e,t,r);break;case 1:if(!Be&&(vs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){ye(r,t,a)}Cr(e,t,r);break;case 21:Cr(e,t,r);break;case 22:r.mode&1?(Be=(n=Be)||r.memoizedState!==null,Cr(e,t,r),Be=n):Cr(e,t,r);break;default:Cr(e,t,r)}}function Mf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new db),t.forEach(function(n){var s=bb.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Ct(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=o),n&=~i}if(n=s,n=_e()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*pb(n/1960))-n,10e?16:e,Vr===null)var n=!1;else{if(e=Vr,Vr=null,za=0,ee&6)throw Error(A(331));var s=ee;for(ee|=4,D=e.current;D!==null;){var i=D,o=i.child;if(D.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l_e()-Kd?Nn(e,0):qd|=r),nt(e,t)}function Sv(e,t){t===0&&(e.mode&1?(t=Io,Io<<=1,!(Io&130023424)&&(Io=4194304)):t=1);var r=Ge();e=mr(e,t),e!==null&&(po(e,t,r),nt(e,r))}function _b(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Sv(e,r)}function bb(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(A(314))}n!==null&&n.delete(t),Sv(e,r)}var kv;kv=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||tt.current)et=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return et=!1,lb(e,t,r);et=!!(e.flags&131072)}else et=!1,de&&t.flags&1048576&&Rg(t,Ia,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;ca(e,t),e=t.pendingProps;var s=Fs(t,Ve.current);Ss(t,r),s=Fd(null,t,n,e,s,r);var i=zd();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(n)?(i=!0,Oa(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,$d(t),s.updater=pl,t.stateNode=s,s._reactInternals=t,gc(t,n,e,r),t=wc(null,t,n,!0,i,r)):(t.tag=0,de&&i&&Pd(t),qe(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(ca(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=Eb(n),e=Ot(n,e),s){case 0:t=yc(null,t,n,e,r);break e;case 1:t=jf(null,t,n,e,r);break e;case 11:t=Af(null,t,n,e,r);break e;case 14:t=If(null,t,n,Ot(n.type,e),r);break e}throw Error(A(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Ot(n,s),yc(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Ot(n,s),jf(e,t,n,s,r);case 3:e:{if(lv(t),e===null)throw Error(A(387));n=t.pendingProps,i=t.memoizedState,s=i.element,$g(e,t),$a(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Ws(Error(A(423)),t),t=Nf(e,t,n,r,s);break e}else if(n!==s){s=Ws(Error(A(424)),t),t=Nf(e,t,n,r,s);break e}else for(ut=Gr(t.stateNode.containerInfo.firstChild),ct=t,de=!0,Dt=null,r=jg(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(zs(),n===s){t=gr(e,t,r);break e}qe(e,t,n,r)}t=t.child}return t;case 5:return Lg(t),e===null&&fc(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,lc(n,s)?o=null:i!==null&&lc(n,i)&&(t.flags|=32),av(e,t),qe(e,t,o,r),t.child;case 6:return e===null&&fc(t),null;case 13:return uv(e,t,r);case 4:return Ld(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Bs(t,null,n,r):qe(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Ot(n,s),Af(e,t,n,s,r);case 7:return qe(e,t,t.pendingProps,r),t.child;case 8:return qe(e,t,t.pendingProps.children,r),t.child;case 12:return qe(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,oe(ja,n._currentValue),n._currentValue=o,i!==null)if(zt(i.value,o)){if(i.children===s.children&&!tt.current){t=gr(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=hr(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),pc(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(A(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),pc(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}qe(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Ss(t,r),s=xt(s),n=n(s),t.flags|=1,qe(e,t,n,r),t.child;case 14:return n=t.type,s=Ot(n,t.pendingProps),s=Ot(n.type,s),If(e,t,n,s,r);case 15:return iv(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Ot(n,s),ca(e,t),t.tag=1,rt(n)?(e=!0,Oa(t)):e=!1,Ss(t,r),rv(t,n,s),gc(t,n,s,r),wc(null,t,n,!0,e,r);case 19:return cv(e,t,r);case 22:return ov(e,t,r)}throw Error(A(156,t.tag))};function Tv(e,t){return Zm(e,t)}function xb(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,r,n){return new xb(e,t,r,n)}function Yd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Eb(e){if(typeof e=="function")return Yd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gd)return 11;if(e===vd)return 14}return 2}function Xr(e,t){var r=e.alternate;return r===null?(r=_t(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function fa(e,t,r,n,s,i){var o=2;if(n=e,typeof e=="function")Yd(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ls:return $n(r.children,s,i,t);case md:o=8,s|=8;break;case Fu:return e=_t(12,r,t,s|2),e.elementType=Fu,e.lanes=i,e;case zu:return e=_t(13,r,t,s),e.elementType=zu,e.lanes=i,e;case Bu:return e=_t(19,r,t,s),e.elementType=Bu,e.lanes=i,e;case Lm:return vl(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nm:o=10;break e;case $m:o=9;break e;case gd:o=11;break e;case vd:o=14;break e;case Ar:o=16,n=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return t=_t(o,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function $n(e,t,r,n){return e=_t(7,e,n,t),e.lanes=r,e}function vl(e,t,r,n){return e=_t(22,e,n,t),e.elementType=Lm,e.lanes=r,e.stateNode={isHidden:!1},e}function mu(e,t,r){return e=_t(6,e,null,t),e.lanes=r,e}function gu(e,t,r){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Sb(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jl(0),this.expirationTimes=Jl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jl(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Xd(e,t,r,n,s,i,o,a,l){return e=new Sb(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=_t(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},$d(i),e}function kb(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ov)}catch(e){console.error(e)}}Ov(),Om.exports=ft;var yo=Om.exports;const Av=ho(yo);var Iv,qf=yo;Iv=qf.createRoot,qf.hydrateRoot;var Ob=typeof Element<"u",Ab=typeof Map=="function",Ib=typeof Set=="function",jb=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function pa(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!pa(e[n],t[n]))return!1;return!0}var i;if(Ab&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;for(i=e.entries();!(n=i.next()).done;)if(!pa(n.value[1],t.get(n.value[0])))return!1;return!0}if(Ib&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(jb&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(Ob&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!pa(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Nb=function(t,r){try{return pa(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const $b=ho(Nb);var Lb=function(e,t,r,n,s,i,o,a){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,s,i,o,a],c=0;l=new Error(t.replace(/%s/g,function(){return u[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},Db=Lb;const Kf=ho(Db);var Mb=function(t,r,n,s){var i=n?n.call(s,t,r):void 0;if(i!==void 0)return!!i;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var o=Object.keys(t),a=Object.keys(r);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),u=0;u(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(jv||{}),vu={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},Gf=Object.values(jv),xl={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Nv=Object.entries(xl).reduce((e,[t,r])=>(e[r]=t,e),{}),Mt="data-rh",Ts={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Cs=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Fb=e=>{let t=Cs(e,"title");const r=Cs(e,Ts.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Cs(e,Ts.DEFAULT_TITLE);return t||n||void 0},zb=e=>Cs(e,Ts.ON_CHANGE_CLIENT_STATE)||(()=>{}),yu=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Bb=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let i=0;iconsole&&typeof console.warn=="function"&&console.warn(e),fi=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&Vb(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,i)=>{const o={};i.filter(l=>{let u;const c=Object.keys(l);for(let f=0;fs.push(l));const a=Object.keys(o);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:Bb(["href"],e),bodyAttributes:yu("bodyAttributes",e),defer:Cs(e,Ts.DEFER),encode:Cs(e,Ts.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:yu("htmlAttributes",e),linkTags:fi("link",["rel","href"],e),metaTags:fi("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:fi("noscript",["innerHTML"],e),onChangeClientState:zb(e),scriptTags:fi("script",["src","innerHTML"],e),styleTags:fi("style",["cssText"],e),title:Fb(e),titleAttributes:yu("titleAttributes",e),prioritizeSeoTags:Wb(e,Ts.PRIORITIZE_SEO_TAGS)}),$v=e=>Array.isArray(e)?e.join(""):e,qb=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(qb(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Qf=(e,t)=>({...e,[t]:void 0}),Kb=["noscript","script","style"],Ac=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),Lv=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),Gb=(e,t,r,n)=>{const s=Lv(r),i=$v(t);return s?`<${e} ${Mt}="true" ${s}>${Ac(i,n)}`:`<${e} ${Mt}="true">${Ac(i,n)}`},Qb=(e,t,r=!0)=>t.reduce((n,s)=>{const i=s,o=Object.keys(i).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,c)=>{const d=typeof i[c]>"u"?c:`${c}="${Ac(i[c],r)}"`;return u?`${u} ${d}`:d},""),a=i.innerHTML||i.cssText||"",l=Kb.indexOf(e)===-1;return`${n}<${e} ${Mt}="true" ${o}${l?"/>":`>${a}`}`},""),Dv=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=xl[n];return r[s||n]=e[n],r},t),Jb=(e,t,r)=>{const n={key:t,[Mt]:!0},s=Dv(r,n);return[R.createElement("title",s,t)]},ma=(e,t)=>t.map((r,n)=>{const s={key:n,[Mt]:!0};return Object.keys(r).forEach(i=>{const a=xl[i]||i;if(a==="innerHTML"||a==="cssText"){const l=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[a]=r[i]}),R.createElement(e,s)}),gt=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Jb(e,t.title,t.titleAttributes),toString:()=>Gb(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Dv(t),toString:()=>Lv(t)};default:return{toComponent:()=>ma(e,t),toString:()=>Qb(e,t,r)}}},Yb=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=wu(e,vu.meta),i=wu(t,vu.link),o=wu(r,vu.script);return{priorityMethods:{toComponent:()=>[...ma("meta",s.priority),...ma("link",i.priority),...ma("script",o.priority)],toString:()=>`${gt("meta",s.priority,n)} ${gt("link",i.priority,n)} ${gt("script",o.priority,n)}`},metaTags:s.default,linkTags:i.default,scriptTags:o.default}},Xb=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:i,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:c,metaTags:d,scriptTags:f}=e,h={toComponent:()=>[],toString:()=>""};return u&&({priorityMethods:h,linkTags:c,metaTags:d,scriptTags:f}=Yb(e)),{priority:h,base:gt("base",t,n),bodyAttributes:gt("bodyAttributes",r,n),htmlAttributes:gt("htmlAttributes",s,n),link:gt("link",c,n),meta:gt("meta",d,n),noscript:gt("noscript",i,n),script:gt("script",f,n),style:gt("style",o,n),title:gt("title",{title:a,titleAttributes:l},n)}},Ic=Xb,Wo=[],rh=!!(typeof window<"u"&&window.document&&window.document.createElement),jc=class{constructor(e,t){nr(this,"instances",[]);nr(this,"canUseDOM",rh);nr(this,"context");nr(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Wo:this.instances,add:e=>{(this.canUseDOM?Wo:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Wo:this.instances).indexOf(e);(this.canUseDOM?Wo:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Ic({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Zb=parseInt(R.version.split(".")[0],10),Nc=Zb>=19,ex={},Mv=R.createContext(ex),Cn,Uv=(Cn=class extends _.Component{constructor(r){super(r);nr(this,"helmetData");Nc?this.helmetData=null:this.helmetData=new jc(this.props.context||{},Cn.canUseDOM)}render(){return Nc?R.createElement(R.Fragment,null,this.props.children):R.createElement(Mv.Provider,{value:this.helmetData.value},this.props.children)}},nr(Cn,"canUseDOM",rh),Cn),Yn=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Mt}]`),s=[].slice.call(n),i=[];let o;return t&&t.length&&t.forEach(a=>{const l=document.createElement(e);for(const u in a)if(Object.prototype.hasOwnProperty.call(a,u))if(u==="innerHTML")l.innerHTML=a.innerHTML;else if(u==="cssText"){const c=a.cssText;l.appendChild(document.createTextNode(c))}else{const c=u,d=typeof a[c]>"u"?"":a[c];l.setAttribute(u,d)}l.setAttribute(Mt,"true"),s.some((u,c)=>(o=c,l.isEqualNode(u)))?s.splice(o,1):i.push(l)}),s.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),i.forEach(a=>r.appendChild(a)),{oldTags:s,newTags:i}},$c=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Mt),s=n?n.split(","):[],i=[...s],o=Object.keys(t);for(const a of o){const l=t[a]||"";r.getAttribute(a)!==l&&r.setAttribute(a,l),s.indexOf(a)===-1&&s.push(a);const u=i.indexOf(a);u!==-1&&i.splice(u,1)}for(let a=i.length-1;a>=0;a-=1)r.removeAttribute(i[a]);s.length===i.length?r.removeAttribute(Mt):r.getAttribute(Mt)!==o.join(",")&&r.setAttribute(Mt,o.join(","))},tx=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=$v(e)),$c("title",t)},Jf=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:i,metaTags:o,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:c,title:d,titleAttributes:f}=e;$c("body",n),$c("html",s),tx(d,f);const h={baseTag:Yn("base",r),linkTags:Yn("link",i),metaTags:Yn("meta",o),noscriptTags:Yn("noscript",a),scriptTags:Yn("script",u),styleTags:Yn("style",c)},y={},g={};Object.keys(h).forEach(w=>{const{newTags:m,oldTags:p}=h[w];m.length&&(y[w]=m),p.length&&(g[w]=h[w].oldTags)}),t&&t(),l(e,y,g)},pi=null,rx=e=>{pi&&cancelAnimationFrame(pi),e.defer?pi=requestAnimationFrame(()=>{Jf(e,()=>{pi=null})}):(Jf(e),pi=null)},nx=rx,Yf=class extends _.Component{constructor(){super(...arguments);nr(this,"rendered",!1)}shouldComponentUpdate(t){return!Ub(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=Hb(t.get().map(i=>{const{context:o,...a}=i.props;return a}));Uv.canUseDOM?nx(s):Ic&&(n=Ic(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},ga=[],Xf=e=>{const t={};for(const r of Object.keys(e))t[Nv[r]||r]=e[r];return t},mn=e=>{const t={};for(const r of Object.keys(e)){const n=xl[r];t[n||r]=e[r]}return t},Zf=(e,t)=>{if(!rh)return;const r=document.getElementsByTagName(e)[0];if(!r)return;const n="data-rh-managed",s=r.getAttribute(n),i=s?s.split(","):[],o=Object.keys(t);for(const a of i)o.includes(a)||r.removeAttribute(a);for(const a of o){const l=t[a];l==null||l===!1?r.removeAttribute(a):l===!0?r.setAttribute(a,""):r.setAttribute(a,String(l))}o.length>0?r.setAttribute(n,o.join(",")):r.removeAttribute(n)},_u=()=>{const e={},t={};for(const r of ga){const{htmlAttributes:n,bodyAttributes:s}=r.props;n&&Object.assign(e,Xf(n)),s&&Object.assign(t,Xf(s))}Zf("html",e),Zf("body",t)},sx=class extends _.Component{componentDidMount(){ga.push(this),_u()}componentDidUpdate(){_u()}componentWillUnmount(){const e=ga.indexOf(this);e!==-1&&ga.splice(e,1),_u()}resolveTitle(){const{title:e,titleTemplate:t,defaultTitle:r}=this.props;return e&&t?t.replace(/%s/g,()=>Array.isArray(e)?e.join(""):e):e||r||void 0}renderTitle(){const e=this.resolveTitle();if(e===void 0)return null;const t=this.props.titleAttributes||{};return R.createElement("title",mn(t),e)}renderBase(){const{base:e}=this.props;return e?R.createElement("base",mn(e)):null}renderMeta(){const{meta:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>R.createElement("meta",{key:r,...mn(t)}))}renderLink(){const{link:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>R.createElement("link",{key:r,...mn(t)}))}renderScript(){const{script:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>{const{innerHTML:n,...s}=t,i=mn(s);return n&&(i.dangerouslySetInnerHTML={__html:n}),R.createElement("script",{key:r,...i})})}renderStyle(){const{style:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>{const{cssText:n,...s}=t,i=mn(s);return n&&(i.dangerouslySetInnerHTML={__html:n}),R.createElement("style",{key:r,...i})})}renderNoscript(){const{noscript:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,r)=>{const{innerHTML:n,...s}=t,i=mn(s);return n&&(i.dangerouslySetInnerHTML={__html:n}),R.createElement("noscript",{key:r,...i})})}render(){return R.createElement(R.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},Mu,uO=(Mu=class extends _.Component{shouldComponentUpdate(e){return!$b(Qf(this.props,"helmetData"),Qf(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return Kf(Gf.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${Gf.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),Kf(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return R.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...i}=n.props,o=Object.keys(i).reduce((l,u)=>(l[Nv[u]||u]=i[u],l),{});let{type:a}=n;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(n,s),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,o,s);break;default:t=this.mapObjectTypeChildren(n,t,o,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof jc)){const s=n;n=new jc(s.context,!0),delete r.helmetData}return Nc?R.createElement(sx,{...r}):n?R.createElement(Yf,{...r,context:n.value}):R.createElement(Mv.Consumer,null,s=>R.createElement(Yf,{...r,context:s}))}},nr(Mu,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Mu);const ix="modulepreload",ox=function(e){return"/"+e},ep={},Re=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(r.map(l=>{if(l=ox(l),l in ep)return;ep[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":ix,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},ax=1,lx=1e6;let bu=0;function ux(){return bu=(bu+1)%Number.MAX_SAFE_INTEGER,bu.toString()}const xu=new Map,tp=e=>{if(xu.has(e))return;const t=setTimeout(()=>{xu.delete(e),Ai({type:"REMOVE_TOAST",toastId:e})},lx);xu.set(e,t)},cx=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ax)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?tp(r):e.toasts.forEach(n=>{tp(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},va=[];let ya={toasts:[]};function Ai(e){ya=cx(ya,e),va.forEach(t=>{t(ya)})}function dx({...e}){const t=ux(),r=s=>Ai({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Ai({type:"DISMISS_TOAST",toastId:t});return Ai({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function hx(){const[e,t]=_.useState(ya);return _.useEffect(()=>(va.push(t),()=>{const r=va.indexOf(t);r>-1&&va.splice(r,1)}),[e]),{...e,toast:dx,dismiss:r=>Ai({type:"DISMISS_TOAST",toastId:r})}}function Ce(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function rp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fv(...e){return t=>{let r=!1;const n=e.map(s=>{const i=rp(s,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s{const{children:o,...a}=i,l=_.useMemo(()=>a,Object.values(a));return k.jsx(r.Provider,{value:l,children:o})};n.displayName=e+"Provider";function s(i){const o=_.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,s]}function El(e,t=[]){let r=[];function n(i,o){const a=_.createContext(o),l=r.length;r=[...r,o];const u=d=>{var m;const{scope:f,children:h,...y}=d,g=((m=f==null?void 0:f[e])==null?void 0:m[l])||a,w=_.useMemo(()=>y,Object.values(y));return k.jsx(g.Provider,{value:w,children:h})};u.displayName=i+"Provider";function c(d,f){var g;const h=((g=f==null?void 0:f[e])==null?void 0:g[l])||a,y=_.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=r.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[e])||i;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,fx(s,...t)]}function fx(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Wa(e){const t=mx(e),r=_.forwardRef((n,s)=>{const{children:i,...o}=n,a=_.Children.toArray(i),l=a.find(vx);if(l){const u=l.props.children,c=a.map(d=>d===l?_.Children.count(u)>1?_.Children.only(null):_.isValidElement(u)?u.props.children:null:d);return k.jsx(t,{...o,ref:s,children:_.isValidElement(u)?_.cloneElement(u,void 0,c):null})}return k.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}var px=Wa("Slot");function mx(e){const t=_.forwardRef((r,n)=>{const{children:s,...i}=r;if(_.isValidElement(s)){const o=wx(s),a=yx(i,s.props);return s.type!==_.Fragment&&(a.ref=n?Fv(n,o):o),_.cloneElement(s,a)}return _.Children.count(s)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zv=Symbol("radix.slottable");function gx(e){const t=({children:r})=>k.jsx(k.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=zv,t}function vx(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zv}function yx(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function wx(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function _x(e){const t=e+"CollectionProvider",[r,n]=El(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:w,children:m}=g,p=R.useRef(null),v=R.useRef(new Map).current;return k.jsx(s,{scope:w,itemMap:v,collectionRef:p,children:m})};o.displayName=t;const a=e+"CollectionSlot",l=Wa(a),u=R.forwardRef((g,w)=>{const{scope:m,children:p}=g,v=i(a,m),b=Bt(w,v.collectionRef);return k.jsx(l,{ref:b,children:p})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=Wa(c),h=R.forwardRef((g,w)=>{const{scope:m,children:p,...v}=g,b=R.useRef(null),x=Bt(w,b),E=i(c,m);return R.useEffect(()=>(E.itemMap.set(b,{ref:b,...v}),()=>void E.itemMap.delete(b))),k.jsx(f,{[d]:"",ref:x,children:p})});h.displayName=c;function y(g){const w=i(e+"CollectionConsumer",g);return R.useCallback(()=>{const p=w.collectionRef.current;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((E,S)=>v.indexOf(E.ref.current)-v.indexOf(S.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:o,Slot:u,ItemSlot:h},y,n]}var bx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=bx.reduce((e,t)=>{const r=Wa(`Primitive.${t}`),n=_.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Bv(e,t){e&&yo.flushSync(()=>e.dispatchEvent(t))}function rn(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function xx(e,t=globalThis==null?void 0:globalThis.document){const r=rn(e);_.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Ex="DismissableLayer",Lc="dismissableLayer.update",Sx="dismissableLayer.pointerDownOutside",kx="dismissableLayer.focusOutside",np,Vv=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),nh=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=e,u=_.useContext(Vv),[c,d]=_.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=_.useState({}),y=Bt(t,S=>d(S)),g=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=g.indexOf(w),p=c?g.indexOf(c):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,b=p>=m,x=Cx(S=>{const T=S.target,I=[...u.branches].some(j=>j.contains(T));!b||I||(s==null||s(S),o==null||o(S),S.defaultPrevented||a==null||a())},f),E=Px(S=>{const T=S.target;[...u.branches].some(j=>j.contains(T))||(i==null||i(S),o==null||o(S),S.defaultPrevented||a==null||a())},f);return xx(S=>{p===u.layers.size-1&&(n==null||n(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},f),_.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(np=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),sp(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=np)}},[c,f,r,u]),_.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),sp())},[c,u]),_.useEffect(()=>{const S=()=>h({});return document.addEventListener(Lc,S),()=>document.removeEventListener(Lc,S)},[]),k.jsx(Ye.div,{...l,ref:y,style:{pointerEvents:v?b?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,x.onPointerDownCapture)})});nh.displayName=Ex;var Tx="DismissableLayerBranch",Wv=_.forwardRef((e,t)=>{const r=_.useContext(Vv),n=_.useRef(null),s=Bt(t,n);return _.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),k.jsx(Ye.div,{...e,ref:s})});Wv.displayName=Tx;function Cx(e,t=globalThis==null?void 0:globalThis.document){const r=rn(e),n=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){Hv(Sx,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Px(e,t=globalThis==null?void 0:globalThis.document){const r=rn(e),n=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!n.current&&Hv(kx,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function sp(){const e=new CustomEvent(Lc);document.dispatchEvent(e)}function Hv(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Bv(s,i):s.dispatchEvent(i)}var Rx=nh,Ox=Wv,nn=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},Ax="Portal",qv=_.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,i]=_.useState(!1);nn(()=>i(!0),[]);const o=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Av.createPortal(k.jsx(Ye.div,{...n,ref:t}),o):null});qv.displayName=Ax;function Ix(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var sh=e=>{const{present:t,children:r}=e,n=jx(t),s=typeof r=="function"?r({present:n.isPresent}):_.Children.only(r),i=Bt(n.ref,Nx(s));return typeof r=="function"||n.isPresent?_.cloneElement(s,{ref:i}):null};sh.displayName="Presence";function jx(e){const[t,r]=_.useState(),n=_.useRef(null),s=_.useRef(e),i=_.useRef("none"),o=e?"mounted":"unmounted",[a,l]=Ix(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=Ho(n.current);i.current=a==="mounted"?u:"none"},[a]),nn(()=>{const u=n.current,c=s.current;if(c!==e){const f=i.current,h=Ho(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),nn(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=h=>{const g=Ho(n.current).includes(h.animationName);if(h.target===t&&g&&(l("ANIMATION_END"),!s.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},f=h=>{h.target===t&&(i.current=Ho(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Ho(e){return(e==null?void 0:e.animationName)||"none"}function Nx(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var $x=Pm[" useInsertionEffect ".trim().toString()]||nn;function Lx({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,o]=Dx({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:s;{const c=_.useRef(e!==void 0);_.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"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.`),c.current=a},[a,n])}const u=_.useCallback(c=>{var d;if(a){const f=Mx(c)?c(e):c;f!==e&&((d=o.current)==null||d.call(o,f))}else i(c)},[a,e,i,o]);return[l,u]}function Dx({defaultProp:e,onChange:t}){const[r,n]=_.useState(e),s=_.useRef(r),i=_.useRef(t);return $x(()=>{i.current=t},[t]),_.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function Mx(e){return typeof e=="function"}var Ux=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Fx="VisuallyHidden",Sl=_.forwardRef((e,t)=>k.jsx(Ye.span,{...e,ref:t,style:{...Ux,...e.style}}));Sl.displayName=Fx;var zx=Sl,ih="ToastProvider",[oh,Bx,Vx]=_x("Toast"),[Kv,dO]=El("Toast",[Vx]),[Wx,kl]=Kv(ih),Gv=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[a,l]=_.useState(null),[u,c]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${ih}\`. Expected non-empty \`string\`.`),k.jsx(oh.Provider,{scope:t,children:k.jsx(Wx,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:_.useCallback(()=>c(h=>h+1),[]),onToastRemove:_.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};Gv.displayName=ih;var Qv="ToastViewport",Hx=["F8"],Dc="toast.viewportPause",Mc="toast.viewportResume",Jv=_.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=Hx,label:s="Notifications ({hotkey})",...i}=e,o=kl(Qv,r),a=Bx(r),l=_.useRef(null),u=_.useRef(null),c=_.useRef(null),d=_.useRef(null),f=Bt(t,d,o.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;_.useEffect(()=>{const w=m=>{var v;n.length!==0&&n.every(b=>m[b]||m.code===b)&&((v=d.current)==null||v.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),_.useEffect(()=>{const w=l.current,m=d.current;if(y&&w&&m){const p=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(Dc);m.dispatchEvent(E),o.isClosePausedRef.current=!0}},v=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(Mc);m.dispatchEvent(E),o.isClosePausedRef.current=!1}},b=E=>{!w.contains(E.relatedTarget)&&v()},x=()=>{w.contains(document.activeElement)||v()};return w.addEventListener("focusin",p),w.addEventListener("focusout",b),w.addEventListener("pointermove",p),w.addEventListener("pointerleave",x),window.addEventListener("blur",p),window.addEventListener("focus",v),()=>{w.removeEventListener("focusin",p),w.removeEventListener("focusout",b),w.removeEventListener("pointermove",p),w.removeEventListener("pointerleave",x),window.removeEventListener("blur",p),window.removeEventListener("focus",v)}}},[y,o.isClosePausedRef]);const g=_.useCallback(({tabbingDirection:w})=>{const p=a().map(v=>{const b=v.ref.current,x=[b,...sE(b)];return w==="forwards"?x:x.reverse()});return(w==="forwards"?p.reverse():p).flat()},[a]);return _.useEffect(()=>{const w=d.current;if(w){const m=p=>{var x,E,S;const v=p.altKey||p.ctrlKey||p.metaKey;if(p.key==="Tab"&&!v){const T=document.activeElement,I=p.shiftKey;if(p.target===w&&I){(x=u.current)==null||x.focus();return}const L=g({tabbingDirection:I?"backwards":"forwards"}),J=L.findIndex(N=>N===T);Eu(L.slice(J+1))?p.preventDefault():I?(E=u.current)==null||E.focus():(S=c.current)==null||S.focus()}};return w.addEventListener("keydown",m),()=>w.removeEventListener("keydown",m)}},[a,g]),k.jsxs(Ox,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&k.jsx(Uc,{ref:u,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});Eu(w)}}),k.jsx(oh.Slot,{scope:r,children:k.jsx(Ye.ol,{tabIndex:-1,...i,ref:f})}),y&&k.jsx(Uc,{ref:c,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});Eu(w)}})]})});Jv.displayName=Qv;var Yv="ToastFocusProxy",Uc=_.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,i=kl(Yv,r);return k.jsx(Sl,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&n()}})});Uc.displayName=Yv;var wo="Toast",qx="toast.swipeStart",Kx="toast.swipeMove",Gx="toast.swipeCancel",Qx="toast.swipeEnd",Xv=_.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=e,[a,l]=Lx({prop:n,defaultProp:s??!0,onChange:i,caller:wo});return k.jsx(sh,{present:r||a,children:k.jsx(Xx,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:rn(e.onPause),onResume:rn(e.onResume),onSwipeStart:Ce(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ce(e.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Ce(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ce(e.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Xv.displayName=wo;var[Jx,Yx]=Kv(wo,{onClose(){}}),Xx=_.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...y}=e,g=kl(wo,r),[w,m]=_.useState(null),p=Bt(t,N=>m(N)),v=_.useRef(null),b=_.useRef(null),x=s||g.duration,E=_.useRef(0),S=_.useRef(x),T=_.useRef(0),{onToastAdd:I,onToastRemove:j}=g,F=rn(()=>{var W;(w==null?void 0:w.contains(document.activeElement))&&((W=g.viewport)==null||W.focus()),o()}),L=_.useCallback(N=>{!N||N===1/0||(window.clearTimeout(T.current),E.current=new Date().getTime(),T.current=window.setTimeout(F,N))},[F]);_.useEffect(()=>{const N=g.viewport;if(N){const W=()=>{L(S.current),u==null||u()},V=()=>{const K=new Date().getTime()-E.current;S.current=S.current-K,window.clearTimeout(T.current),l==null||l()};return N.addEventListener(Dc,V),N.addEventListener(Mc,W),()=>{N.removeEventListener(Dc,V),N.removeEventListener(Mc,W)}}},[g.viewport,x,l,u,L]),_.useEffect(()=>{i&&!g.isClosePausedRef.current&&L(x)},[i,x,g.isClosePausedRef,L]),_.useEffect(()=>(I(),()=>j()),[I,j]);const J=_.useMemo(()=>w?iy(w):null,[w]);return g.viewport?k.jsxs(k.Fragment,{children:[J&&k.jsx(Zx,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:J}),k.jsx(Jx,{scope:r,onClose:F,children:yo.createPortal(k.jsx(oh.ItemSlot,{scope:r,children:k.jsx(Rx,{asChild:!0,onEscapeKeyDown:Ce(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||F(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:k.jsx(Ye.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:p,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ce(e.onKeyDown,N=>{N.key==="Escape"&&(a==null||a(N.nativeEvent),N.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:Ce(e.onPointerDown,N=>{N.button===0&&(v.current={x:N.clientX,y:N.clientY})}),onPointerMove:Ce(e.onPointerMove,N=>{if(!v.current)return;const W=N.clientX-v.current.x,V=N.clientY-v.current.y,K=!!b.current,P=["left","right"].includes(g.swipeDirection),O=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,$=P?O(0,W):0,G=P?0:O(0,V),U=N.pointerType==="touch"?10:2,Y={x:$,y:G},Z={originalEvent:N,delta:Y};K?(b.current=Y,qo(Kx,d,Z,{discrete:!1})):ip(Y,g.swipeDirection,U)?(b.current=Y,qo(qx,c,Z,{discrete:!1}),N.target.setPointerCapture(N.pointerId)):(Math.abs(W)>U||Math.abs(V)>U)&&(v.current=null)}),onPointerUp:Ce(e.onPointerUp,N=>{const W=b.current,V=N.target;if(V.hasPointerCapture(N.pointerId)&&V.releasePointerCapture(N.pointerId),b.current=null,v.current=null,W){const K=N.currentTarget,P={originalEvent:N,delta:W};ip(W,g.swipeDirection,g.swipeThreshold)?qo(Qx,h,P,{discrete:!0}):qo(Gx,f,P,{discrete:!0}),K.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),Zx=e=>{const{__scopeToast:t,children:r,...n}=e,s=kl(wo,t),[i,o]=_.useState(!1),[a,l]=_.useState(!1);return rE(()=>o(!0)),_.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:k.jsx(qv,{asChild:!0,children:k.jsx(Sl,{...n,children:i&&k.jsxs(k.Fragment,{children:[s.label," ",r]})})})},eE="ToastTitle",Zv=_.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return k.jsx(Ye.div,{...n,ref:t})});Zv.displayName=eE;var tE="ToastDescription",ey=_.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return k.jsx(Ye.div,{...n,ref:t})});ey.displayName=tE;var ty="ToastAction",ry=_.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?k.jsx(sy,{altText:r,asChild:!0,children:k.jsx(ah,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ty}\`. Expected non-empty \`string\`.`),null)});ry.displayName=ty;var ny="ToastClose",ah=_.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=Yx(ny,r);return k.jsx(sy,{asChild:!0,children:k.jsx(Ye.button,{type:"button",...n,ref:t,onClick:Ce(e.onClick,s.onClose)})})});ah.displayName=ny;var sy=_.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return k.jsx(Ye.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function iy(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),nE(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...iy(n))}}),t}function qo(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Bv(s,i):s.dispatchEvent(i)}var ip=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),i=n>s;return t==="left"||t==="right"?i&&n>r:!i&&s>r};function rE(e=()=>{}){const t=rn(e);nn(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function nE(e){return e.nodeType===e.ELEMENT_NODE}function sE(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Eu(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var iE=Gv,oy=Jv,ay=Xv,ly=Zv,uy=ey,cy=ry,dy=ah;function hy(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,ap=fy,lh=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return ap(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const c=r==null?void 0:r[u],d=i==null?void 0:i[u];if(c===null)return null;const f=op(c)||op(d);return s[u][f]}),a=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(y=>{let[g,w]=y;return Array.isArray(w)?w.includes({...i,...a}[g]):{...i,...a}[g]===w})?[...u,d,f]:u},[]);return ap(e,o,l,r==null?void 0:r.class,r==null?void 0:r.className)};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),py=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var aE={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"};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lE=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},l)=>_.createElement("svg",{ref:l,...aE,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:py("lucide",s),...a},[...o.map(([u,c])=>_.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tl=(e,t)=>{const r=_.forwardRef(({className:n,...s},i)=>_.createElement(lE,{ref:i,iconNode:t,className:py(`lucide-${oE(e)}`,n),...s}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lp=Tl("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uE=Tl("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cE=Tl("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dE=Tl("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),uh="-",hE=e=>{const t=pE(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const a=o.split(uh);return a[0]===""&&a.length!==1&&a.shift(),my(a,t)||fE(o)},getConflictingClassGroupIds:(o,a)=>{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},my=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?my(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(uh);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},up=/^\[(.+)\]$/,fE=e=>{if(up.test(e)){const t=up.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},pE=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return gE(Object.entries(e.classGroups),r).forEach(([i,o])=>{Fc(o,n,i,t)}),n},Fc=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:cp(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(mE(s)){Fc(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Fc(o,cp(t,i),r,n)})})},cp=(e,t)=>{let r=e;return t.split(uh).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},mE=e=>e.isThemeGetter,gE=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[r,s]}):e,vE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},gy="!",yE=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let u=0,c=0,d;for(let w=0;wc?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:g}};return r?a=>r({className:a,parseClassName:o}):o},wE=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},_E=e=>({cache:vE(e.cacheSize),parseClassName:yE(e),...hE(e)}),bE=/\s+/,xE=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(bE);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=r(u);let y=!!h,g=n(y?f.substring(0,h):f);if(!g){if(!y){a=u+(a.length>0?" "+a:a);continue}if(g=n(f),!g){a=u+(a.length>0?" "+a:a);continue}y=!1}const w=wE(c).join(":"),m=d?w+gy:w,p=m+g;if(i.includes(p))continue;i.push(p);const v=s(g,y);for(let b=0;b0?" "+a:a)}return a};function EE(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nd(c),e());return r=_E(u),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const u=n(l);if(u)return u;const c=xE(l,r);return s(l,c),c}return function(){return i(EE.apply(null,arguments))}}const ae=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},yy=/^\[(?:([a-z-]+):)?(.+)\]$/i,kE=/^\d+\/\d+$/,TE=new Set(["px","full","screen"]),CE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PE=/\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$/,RE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,OE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sr=e=>Ps(e)||TE.has(e)||kE.test(e),Pr=e=>Xs(e,"length",UE),Ps=e=>!!e&&!Number.isNaN(Number(e)),Su=e=>Xs(e,"number",Ps),mi=e=>!!e&&Number.isInteger(Number(e)),IE=e=>e.endsWith("%")&&Ps(e.slice(0,-1)),Q=e=>yy.test(e),Rr=e=>CE.test(e),jE=new Set(["length","size","percentage"]),NE=e=>Xs(e,jE,wy),$E=e=>Xs(e,"position",wy),LE=new Set(["image","url"]),DE=e=>Xs(e,LE,zE),ME=e=>Xs(e,"",FE),gi=()=>!0,Xs=(e,t,r)=>{const n=yy.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},UE=e=>PE.test(e)&&!RE.test(e),wy=()=>!1,FE=e=>OE.test(e),zE=e=>AE.test(e),BE=()=>{const e=ae("colors"),t=ae("spacing"),r=ae("blur"),n=ae("brightness"),s=ae("borderColor"),i=ae("borderRadius"),o=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),u=ae("grayscale"),c=ae("hueRotate"),d=ae("invert"),f=ae("gap"),h=ae("gradientColorStops"),y=ae("gradientColorStopPositions"),g=ae("inset"),w=ae("margin"),m=ae("opacity"),p=ae("padding"),v=ae("saturate"),b=ae("scale"),x=ae("sepia"),E=ae("skew"),S=ae("space"),T=ae("translate"),I=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",Q,t],L=()=>[Q,t],J=()=>["",sr,Pr],N=()=>["auto",Ps,Q],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",Q],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[Ps,Q];return{cacheSize:500,separator:":",theme:{colors:[gi],spacing:[sr,Pr],blur:["none","",Rr,Q],brightness:G(),borderColor:[e],borderRadius:["none","","full",Rr,Q],borderSpacing:L(),borderWidth:J(),contrast:G(),grayscale:O(),hueRotate:G(),invert:O(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[IE,Pr],inset:F(),margin:F(),opacity:G(),padding:L(),saturate:G(),scale:G(),sepia:O(),skew:G(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[Rr]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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"],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:[...W(),Q]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mi,Q]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",mi,Q]}],"grid-cols":[{"grid-cols":[gi]}],"col-start-end":[{col:["auto",{span:["full",mi,Q]},Q]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[gi]}],"row-start-end":[{row:["auto",{span:[mi,Q]},Q]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,t]}],"min-w":[{"min-w":[Q,t,"min","max","fit"]}],"max-w":[{"max-w":[Q,t,"none","full","min","max","fit","prose",{screen:[Rr]},Rr]}],h:[{h:[Q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Rr,Pr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Su]}],"font-family":[{font:[gi]}],"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:["tighter","tight","normal","wide","wider","widest",Q]}],"line-clamp":[{"line-clamp":["none",Ps,Su]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",sr,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",sr,Pr]}],"underline-offset":[{"underline-offset":["auto",sr,Q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),$E]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",NE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},DE]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:V()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[sr,Q]}],"outline-w":[{outline:[sr,Pr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[sr,Pr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Rr,ME]}],"shadow-color":[{shadow:[gi]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Rr,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Q]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[mi,Q]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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-in","zoom-out",Q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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"]}],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",Q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[sr,Pr,Su]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},VE=SE(BE);function We(...e){return VE(fy(e))}const WE=iE,_y=_.forwardRef(({className:e,...t},r)=>k.jsx(oy,{ref:r,className:We("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));_y.displayName=oy.displayName;const HE=lh("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),by=_.forwardRef(({className:e,variant:t,...r},n)=>k.jsx(ay,{ref:n,className:We(HE({variant:t}),e),...r}));by.displayName=ay.displayName;const qE=_.forwardRef(({className:e,...t},r)=>k.jsx(cy,{ref:r,className:We("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));qE.displayName=cy.displayName;const xy=_.forwardRef(({className:e,...t},r)=>k.jsx(dy,{ref:r,className:We("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:k.jsx(dE,{className:"h-4 w-4"})}));xy.displayName=dy.displayName;const Ey=_.forwardRef(({className:e,...t},r)=>k.jsx(ly,{ref:r,className:We("text-sm font-semibold",e),...t}));Ey.displayName=ly.displayName;const Sy=_.forwardRef(({className:e,...t},r)=>k.jsx(uy,{ref:r,className:We("text-sm opacity-90",e),...t}));Sy.displayName=uy.displayName;function KE(){const{toasts:e}=hx();return k.jsxs(WE,{children:[e.map(function({id:t,title:r,description:n,action:s,...i}){return k.jsxs(by,{...i,children:[k.jsxs("div",{className:"grid gap-1",children:[r&&k.jsx(Ey,{children:r}),n&&k.jsx(Sy,{children:n})]}),s,k.jsx(xy,{})]},t)}),k.jsx(_y,{})]})}var Ha=["light","dark"],ch="(prefers-color-scheme: dark)",GE=typeof window>"u",dh=_.createContext(void 0),QE={setTheme:e=>{},themes:[]},JE=()=>{var e;return(e=_.useContext(dh))!=null?e:QE},YE=e=>_.useContext(dh)?e.children:_.createElement(ZE,{...e}),XE=["light","dark"],ZE=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:i=XE,defaultTheme:o=r?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,f]=_.useState(()=>dp(s,o)),[h,y]=_.useState(()=>dp(s)),g=l?Object.values(l):i,w=_.useCallback(b=>{let x=b;if(!x)return;b==="system"&&r&&(x=hp());let E=l?l[x]:x,S=t?tS():null,T=document.documentElement;if(a==="class"?(T.classList.remove(...g),E&&T.classList.add(E)):E?T.setAttribute(a,E):T.removeAttribute(a),n){let I=Ha.includes(o)?o:null,j=Ha.includes(x)?x:I;T.style.colorScheme=j}S==null||S()},[]),m=_.useCallback(b=>{let x=typeof b=="function"?b(b):b;f(x);try{localStorage.setItem(s,x)}catch{}},[e]),p=_.useCallback(b=>{let x=hp(b);y(x),d==="system"&&r&&!e&&w("system")},[d,e]);_.useEffect(()=>{let b=window.matchMedia(ch);return b.addListener(p),p(b),()=>b.removeListener(p)},[p]),_.useEffect(()=>{let b=x=>{if(x.key!==s)return;let E=x.newValue||o;m(E)};return window.addEventListener("storage",b),()=>window.removeEventListener("storage",b)},[m]),_.useEffect(()=>{w(e??d)},[e,d]);let v=_.useMemo(()=>({theme:d,setTheme:m,forcedTheme:e,resolvedTheme:d==="system"?h:d,themes:r?[...i,"system"]:i,systemTheme:r?h:void 0}),[d,m,e,h,r,i]);return _.createElement(dh.Provider,{value:v},_.createElement(eS,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:r,enableColorScheme:n,storageKey:s,themes:i,defaultTheme:o,attribute:a,value:l,children:u,attrs:g,nonce:c}),u)},eS=_.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let u=i==="system",c=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,d=s?Ha.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(y,g=!1,w=!0)=>{let m=o?o[y]:y,p=g?y+"|| ''":`'${m}'`,v="";return s&&w&&!g&&Ha.includes(y)&&(v+=`d.style.colorScheme = '${y}';`),r==="class"?g||m?v+=`c.add(${p})`:v+="null":m&&(v+=`d[s](n,${p})`),v},h=e?`!function(){${c}${f(e)}}()`:n?`!function(){try{${c}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${ch}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${d}}catch(t){}}();`;return _.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})}),dp=(e,t)=>{if(GE)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},tS=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},hp=e=>(e||(e=window.matchMedia(ch)),e.matches?"dark":"light"),rS=e=>{switch(e){case"success":return iS;case"info":return aS;case"warning":return oS;case"error":return lS;default:return null}},nS=Array(12).fill(0),sS=({visible:e,className:t})=>R.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},R.createElement("div",{className:"sonner-spinner"},nS.map((r,n)=>R.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),iS=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),oS=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),aS=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),lS=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),uS=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},R.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),R.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),cS=()=>{let[e,t]=R.useState(document.hidden);return R.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},zc=1,dS=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:zc++,i=this.toasts.find(a=>a.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...e,id:s,title:r}),{...a,...e,id:s,dismissible:o,title:r}):a):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,o=n.then(async l=>{if(i=["resolve",l],R.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(fS(l)&&!l.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:r,type:"error",message:u,description:c})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(l):t.success,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:r,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:r,type:"error",message:u,description:c})}}).finally(()=>{var l;s&&(this.dismiss(r),r=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>o.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||zc++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Xe=new dS,hS=(e,t)=>{let r=(t==null?void 0:t.id)||zc++;return Xe.addToast({title:e,...t,id:r}),r},fS=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",pS=hS,mS=()=>Xe.toasts,gS=()=>Xe.getActiveToasts(),hO=Object.assign(pS,{success:Xe.success,info:Xe.info,warning:Xe.warning,error:Xe.error,custom:Xe.custom,message:Xe.message,promise:Xe.promise,dismiss:Xe.dismiss,loading:Xe.loading},{getHistory:mS,getToasts:gS});function vS(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}vS(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} `);function Ko(e){return e.label!==void 0}var yS=3,wS="32px",_S="16px",fp=4e3,bS=356,xS=14,ES=20,SS=200;function Pt(...e){return e.filter(Boolean).join(" ")}function kS(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var TS=e=>{var t,r,n,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:y,interacting:g,setHeights:w,visibleToasts:m,heights:p,index:v,toasts:b,expanded:x,removeToast:E,defaultRichColors:S,closeButton:T,style:I,cancelButtonStyle:j,actionButtonStyle:F,className:L="",descriptionClassName:J="",duration:N,position:W,gap:V,loadingIcon:K,expandByDefault:P,classNames:O,icons:$,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:U}=e,[Y,Z]=R.useState(null),[be,De]=R.useState(null),[re,Wn]=R.useState(!1),[br,hn]=R.useState(!1),[xr,Hn]=R.useState(!1),[Er,Eo]=R.useState(!1),[Fl,So]=R.useState(!1),[zl,ni]=R.useState(0),[qn,Oh]=R.useState(0),si=R.useRef(h.duration||N||fp),Ah=R.useRef(null),fn=R.useRef(null),Kw=v===0,Gw=v+1<=m,mt=h.type,Kn=h.dismissible!==!1,Qw=h.className||"",Jw=h.descriptionClassName||"",ko=R.useMemo(()=>p.findIndex(H=>H.toastId===h.id)||0,[p,h.id]),Yw=R.useMemo(()=>{var H;return(H=h.closeButton)!=null?H:T},[h.closeButton,T]),Ih=R.useMemo(()=>h.duration||N||fp,[h.duration,N]),Bl=R.useRef(0),Gn=R.useRef(0),jh=R.useRef(0),Qn=R.useRef(null),[Xw,Zw]=W.split("-"),Nh=R.useMemo(()=>p.reduce((H,se,ce)=>ce>=ko?H:H+se.height,0),[p,ko]),$h=cS(),e0=h.invert||f,Vl=mt==="loading";Gn.current=R.useMemo(()=>ko*V+Nh,[ko,Nh]),R.useEffect(()=>{si.current=Ih},[Ih]),R.useEffect(()=>{Wn(!0)},[]),R.useEffect(()=>{let H=fn.current;if(H){let se=H.getBoundingClientRect().height;return Oh(se),w(ce=>[{toastId:h.id,height:se,position:h.position},...ce]),()=>w(ce=>ce.filter(St=>St.toastId!==h.id))}},[w,h.id]),R.useLayoutEffect(()=>{if(!re)return;let H=fn.current,se=H.style.height;H.style.height="auto";let ce=H.getBoundingClientRect().height;H.style.height=se,Oh(ce),w(St=>St.find(kt=>kt.toastId===h.id)?St.map(kt=>kt.toastId===h.id?{...kt,height:ce}:kt):[{toastId:h.id,height:ce,position:h.position},...St])},[re,h.title,h.description,w,h.id]);let Sr=R.useCallback(()=>{hn(!0),ni(Gn.current),w(H=>H.filter(se=>se.toastId!==h.id)),setTimeout(()=>{E(h)},SS)},[h,E,w,Gn]);R.useEffect(()=>{if(h.promise&&mt==="loading"||h.duration===1/0||h.type==="loading")return;let H;return x||g||U&&$h?(()=>{if(jh.current{var se;(se=h.onAutoClose)==null||se.call(h,h),Sr()},si.current)),()=>clearTimeout(H)},[x,g,h,mt,U,$h,Sr]),R.useEffect(()=>{h.delete&&Sr()},[Sr,h.delete]);function t0(){var H,se,ce;return $!=null&&$.loading?R.createElement("div",{className:Pt(O==null?void 0:O.loader,(H=h==null?void 0:h.classNames)==null?void 0:H.loader,"sonner-loader"),"data-visible":mt==="loading"},$.loading):K?R.createElement("div",{className:Pt(O==null?void 0:O.loader,(se=h==null?void 0:h.classNames)==null?void 0:se.loader,"sonner-loader"),"data-visible":mt==="loading"},K):R.createElement(sS,{className:Pt(O==null?void 0:O.loader,(ce=h==null?void 0:h.classNames)==null?void 0:ce.loader),visible:mt==="loading"})}return R.createElement("li",{tabIndex:0,ref:fn,className:Pt(L,Qw,O==null?void 0:O.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[mt],(r=h==null?void 0:h.classNames)==null?void 0:r[mt]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:S,"data-styled":!(h.jsx||h.unstyled||y),"data-mounted":re,"data-promise":!!h.promise,"data-swiped":Fl,"data-removed":br,"data-visible":Gw,"data-y-position":Xw,"data-x-position":Zw,"data-index":v,"data-front":Kw,"data-swiping":xr,"data-dismissible":Kn,"data-type":mt,"data-invert":e0,"data-swipe-out":Er,"data-swipe-direction":be,"data-expanded":!!(x||P&&re),style:{"--index":v,"--toasts-before":v,"--z-index":b.length-v,"--offset":`${br?zl:Gn.current}px`,"--initial-height":P?"auto":`${qn}px`,...I,...h.style},onDragEnd:()=>{Hn(!1),Z(null),Qn.current=null},onPointerDown:H=>{Vl||!Kn||(Ah.current=new Date,ni(Gn.current),H.target.setPointerCapture(H.pointerId),H.target.tagName!=="BUTTON"&&(Hn(!0),Qn.current={x:H.clientX,y:H.clientY}))},onPointerUp:()=>{var H,se,ce,St;if(Er||!Kn)return;Qn.current=null;let kt=Number(((H=fn.current)==null?void 0:H.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),kr=Number(((se=fn.current)==null?void 0:se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),pn=new Date().getTime()-((ce=Ah.current)==null?void 0:ce.getTime()),Tt=Y==="x"?kt:kr,Tr=Math.abs(Tt)/pn;if(Math.abs(Tt)>=ES||Tr>.11){ni(Gn.current),(St=h.onDismiss)==null||St.call(h,h),De(Y==="x"?kt>0?"right":"left":kr>0?"down":"up"),Sr(),Eo(!0),So(!1);return}Hn(!1),Z(null)},onPointerMove:H=>{var se,ce,St,kt;if(!Qn.current||!Kn||((se=window.getSelection())==null?void 0:se.toString().length)>0)return;let kr=H.clientY-Qn.current.y,pn=H.clientX-Qn.current.x,Tt=(ce=e.swipeDirections)!=null?ce:kS(W);!Y&&(Math.abs(pn)>1||Math.abs(kr)>1)&&Z(Math.abs(pn)>Math.abs(kr)?"x":"y");let Tr={x:0,y:0};Y==="y"?(Tt.includes("top")||Tt.includes("bottom"))&&(Tt.includes("top")&&kr<0||Tt.includes("bottom")&&kr>0)&&(Tr.y=kr):Y==="x"&&(Tt.includes("left")||Tt.includes("right"))&&(Tt.includes("left")&&pn<0||Tt.includes("right")&&pn>0)&&(Tr.x=pn),(Math.abs(Tr.x)>0||Math.abs(Tr.y)>0)&&So(!0),(St=fn.current)==null||St.style.setProperty("--swipe-amount-x",`${Tr.x}px`),(kt=fn.current)==null||kt.style.setProperty("--swipe-amount-y",`${Tr.y}px`)}},Yw&&!h.jsx?R.createElement("button",{"aria-label":G,"data-disabled":Vl,"data-close-button":!0,onClick:Vl||!Kn?()=>{}:()=>{var H;Sr(),(H=h.onDismiss)==null||H.call(h,h)},className:Pt(O==null?void 0:O.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=$==null?void 0:$.close)!=null?i:uS):null,h.jsx||_.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:R.createElement(R.Fragment,null,mt||h.icon||h.promise?R.createElement("div",{"data-icon":"",className:Pt(O==null?void 0:O.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||t0():null,h.type!=="loading"?h.icon||($==null?void 0:$[mt])||rS(mt):null):null,R.createElement("div",{"data-content":"",className:Pt(O==null?void 0:O.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},R.createElement("div",{"data-title":"",className:Pt(O==null?void 0:O.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?R.createElement("div",{"data-description":"",className:Pt(J,Jw,O==null?void 0:O.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),_.isValidElement(h.cancel)?h.cancel:h.cancel&&Ko(h.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||j,onClick:H=>{var se,ce;Ko(h.cancel)&&Kn&&((ce=(se=h.cancel).onClick)==null||ce.call(se,H),Sr())},className:Pt(O==null?void 0:O.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,_.isValidElement(h.action)?h.action:h.action&&Ko(h.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||F,onClick:H=>{var se,ce;Ko(h.action)&&((ce=(se=h.action).onClick)==null||ce.call(se,H),!H.defaultPrevented&&Sr())},className:Pt(O==null?void 0:O.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function pp(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function CS(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?_S:wS;function l(u){["top","right","bottom","left"].forEach(c=>{r[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=a:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(a)}),r}var PS=_.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:f,style:h,visibleToasts:y=yS,toastOptions:g,dir:w=pp(),gap:m=xS,loadingIcon:p,icons:v,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:x}=e,[E,S]=R.useState([]),T=R.useMemo(()=>Array.from(new Set([n].concat(E.filter(U=>U.position).map(U=>U.position)))),[E,n]),[I,j]=R.useState([]),[F,L]=R.useState(!1),[J,N]=R.useState(!1),[W,V]=R.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=R.useRef(null),P=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=R.useRef(null),$=R.useRef(!1),G=R.useCallback(U=>{S(Y=>{var Z;return(Z=Y.find(be=>be.id===U.id))!=null&&Z.delete||Xe.dismiss(U.id),Y.filter(({id:be})=>be!==U.id)})},[]);return R.useEffect(()=>Xe.subscribe(U=>{if(U.dismiss){S(Y=>Y.map(Z=>Z.id===U.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{Av.flushSync(()=>{S(Y=>{let Z=Y.findIndex(be=>be.id===U.id);return Z!==-1?[...Y.slice(0,Z),{...Y[Z],...U},...Y.slice(Z+1)]:[U,...Y]})})})}),[]),R.useEffect(()=>{if(c!=="system"){V(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:Y})=>{V(Y?"dark":"light")})}catch{U.addListener(({matches:Z})=>{try{V(Z?"dark":"light")}catch(be){console.error(be)}})}},[c]),R.useEffect(()=>{E.length<=1&&L(!1)},[E]),R.useEffect(()=>{let U=Y=>{var Z,be;s.every(De=>Y[De]||Y.code===De)&&(L(!0),(Z=K.current)==null||Z.focus()),Y.code==="Escape"&&(document.activeElement===K.current||(be=K.current)!=null&&be.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[s]),R.useEffect(()=>{if(K.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,$.current=!1)}},[K.current]),R.createElement("section",{ref:t,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((U,Y)=>{var Z;let[be,De]=U.split("-");return E.length?R.createElement("ol",{key:U,dir:w==="auto"?pp():w,tabIndex:-1,ref:K,className:a,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":be,"data-lifted":F&&E.length>1&&!i,"data-x-position":De,style:{"--front-toast-height":`${((Z=I[0])==null?void 0:Z.height)||0}px`,"--width":`${bS}px`,"--gap":`${m}px`,...h,...CS(l,u)},onBlur:re=>{$.current&&!re.currentTarget.contains(re.relatedTarget)&&($.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||$.current||($.current=!0,O.current=re.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{J||L(!1)},onDragEnd:()=>L(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||N(!0)},onPointerUp:()=>N(!1)},E.filter(re=>!re.position&&Y===0||re.position===U).map((re,Wn)=>{var br,hn;return R.createElement(TS,{key:re.id,icons:v,index:Wn,toast:re,defaultRichColors:d,duration:(br=g==null?void 0:g.duration)!=null?br:f,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:y,closeButton:(hn=g==null?void 0:g.closeButton)!=null?hn:o,interacting:J,position:U,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:G,toasts:E.filter(xr=>xr.position==re.position),heights:I.filter(xr=>xr.position==re.position),setHeights:j,expandByDefault:i,gap:m,loadingIcon:p,expanded:F,pauseWhenPageIsHidden:x,swipeDirections:e.swipeDirections})})):null}))});const RS=({...e})=>{const{theme:t="system"}=JE();return k.jsx(PS,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},OS=["top","right","bottom","left"],sn=Math.min,ot=Math.max,qa=Math.round,Go=Math.floor,er=e=>({x:e,y:e}),AS={left:"right",right:"left",bottom:"top",top:"bottom"},IS={start:"end",end:"start"};function Bc(e,t,r){return ot(e,sn(t,r))}function vr(e,t){return typeof e=="function"?e(t):e}function yr(e){return e.split("-")[0]}function Zs(e){return e.split("-")[1]}function hh(e){return e==="x"?"y":"x"}function fh(e){return e==="y"?"height":"width"}const jS=new Set(["top","bottom"]);function Yt(e){return jS.has(yr(e))?"y":"x"}function ph(e){return hh(Yt(e))}function NS(e,t,r){r===void 0&&(r=!1);const n=Zs(e),s=ph(e),i=fh(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Ka(o)),[o,Ka(o)]}function $S(e){const t=Ka(e);return[Vc(e),t,Vc(t)]}function Vc(e){return e.replace(/start|end/g,t=>IS[t])}const mp=["left","right"],gp=["right","left"],LS=["top","bottom"],DS=["bottom","top"];function MS(e,t,r){switch(e){case"top":case"bottom":return r?t?gp:mp:t?mp:gp;case"left":case"right":return t?LS:DS;default:return[]}}function US(e,t,r,n){const s=Zs(e);let i=MS(yr(e),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(Vc)))),i}function Ka(e){return e.replace(/left|right|bottom|top/g,t=>AS[t])}function FS(e){return{top:0,right:0,bottom:0,left:0,...e}}function ky(e){return typeof e!="number"?FS(e):{top:e,right:e,bottom:e,left:e}}function Ga(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function vp(e,t,r){let{reference:n,floating:s}=e;const i=Yt(t),o=ph(t),a=fh(o),l=yr(t),u=i==="y",c=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2;let h;switch(l){case"top":h={x:c,y:n.y-s.height};break;case"bottom":h={x:c,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-s.width,y:d};break;default:h={x:n.x,y:n.y}}switch(Zs(t)){case"start":h[o]-=f*(r&&u?-1:1);break;case"end":h[o]+=f*(r&&u?-1:1);break}return h}const zS=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:o}=r,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:d}=vp(u,n,l),f=n,h={},y=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=vr(e,t)||{};if(u==null)return{};const d=ky(c),f={x:r,y:n},h=ph(s),y=fh(h),g=await o.getDimensions(u),w=h==="y",m=w?"top":"left",p=w?"bottom":"right",v=w?"clientHeight":"clientWidth",b=i.reference[y]+i.reference[h]-f[h]-i.floating[y],x=f[h]-i.reference[h],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let S=E?E[v]:0;(!S||!await(o.isElement==null?void 0:o.isElement(E)))&&(S=a.floating[v]||i.floating[y]);const T=b/2-x/2,I=S/2-g[y]/2-1,j=sn(d[m],I),F=sn(d[p],I),L=j,J=S-g[y]-F,N=S/2-g[y]/2+T,W=Bc(L,N,J),V=!l.arrow&&Zs(s)!=null&&N!==W&&i.reference[y]/2-(NN<=0)){var F,L;const N=(((F=i.flip)==null?void 0:F.index)||0)+1,W=S[N];if(W&&(!(d==="alignment"?p!==Yt(W):!1)||j.every(P=>P.overflows[0]>0&&Yt(P.placement)===p)))return{data:{index:N,overflows:j},reset:{placement:W}};let V=(L=j.filter(K=>K.overflows[0]<=0).sort((K,P)=>K.overflows[1]-P.overflows[1])[0])==null?void 0:L.placement;if(!V)switch(h){case"bestFit":{var J;const K=(J=j.filter(P=>{if(E){const O=Yt(P.placement);return O===p||O==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(O=>O>0).reduce((O,$)=>O+$,0)]).sort((P,O)=>P[1]-O[1])[0])==null?void 0:J[0];K&&(V=K);break}case"initialPlacement":V=a;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function yp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wp(e){return OS.some(t=>e[t]>=0)}const WS=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=vr(e,t);switch(n){case"referenceHidden":{const i=await Yi(t,{...s,elementContext:"reference"}),o=yp(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:wp(o)}}}case"escaped":{const i=await Yi(t,{...s,altBoundary:!0}),o=yp(i,r.floating);return{data:{escapedOffsets:o,escaped:wp(o)}}}default:return{}}}}},Ty=new Set(["left","top"]);async function HS(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=yr(r),a=Zs(r),l=Yt(r)==="y",u=Ty.has(o)?-1:1,c=i&&l?-1:1,d=vr(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const qS=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:o,middlewareData:a}=t,l=await HS(t,e);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},KS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x:m,y:p}=w;return{x:m,y:p}}},...l}=vr(e,t),u={x:r,y:n},c=await Yi(t,l),d=Yt(yr(s)),f=hh(d);let h=u[f],y=u[d];if(i){const w=f==="y"?"top":"left",m=f==="y"?"bottom":"right",p=h+c[w],v=h-c[m];h=Bc(p,h,v)}if(o){const w=d==="y"?"top":"left",m=d==="y"?"bottom":"right",p=y+c[w],v=y-c[m];y=Bc(p,y,v)}const g=a.fn({...t,[f]:h,[d]:y});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[f]:i,[d]:o}}}}}},GS=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=vr(e,t),c={x:r,y:n},d=Yt(s),f=hh(d);let h=c[f],y=c[d];const g=vr(a,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const v=f==="y"?"height":"width",b=i.reference[f]-i.floating[v]+w.mainAxis,x=i.reference[f]+i.reference[v]-w.mainAxis;hx&&(h=x)}if(u){var m,p;const v=f==="y"?"width":"height",b=Ty.has(yr(s)),x=i.reference[d]-i.floating[v]+(b&&((m=o.offset)==null?void 0:m[d])||0)+(b?0:w.crossAxis),E=i.reference[d]+i.reference[v]+(b?0:((p=o.offset)==null?void 0:p[d])||0)-(b?w.crossAxis:0);yE&&(y=E)}return{[f]:h,[d]:y}}}},QS=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:i,platform:o,elements:a}=t,{apply:l=()=>{},...u}=vr(e,t),c=await Yi(t,u),d=yr(s),f=Zs(s),h=Yt(s)==="y",{width:y,height:g}=i.floating;let w,m;d==="top"||d==="bottom"?(w=d,m=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(m=d,w=f==="end"?"top":"bottom");const p=g-c.top-c.bottom,v=y-c.left-c.right,b=sn(g-c[w],p),x=sn(y-c[m],v),E=!t.middlewareData.shift;let S=b,T=x;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(T=v),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=p),E&&!f){const j=ot(c.left,0),F=ot(c.right,0),L=ot(c.top,0),J=ot(c.bottom,0);h?T=y-2*(j!==0||F!==0?j+F:ot(c.left,c.right)):S=g-2*(L!==0||J!==0?L+J:ot(c.top,c.bottom))}await l({...t,availableWidth:T,availableHeight:S});const I=await o.getDimensions(a.floating);return y!==I.width||g!==I.height?{reset:{rects:!0}}:{}}}};function Cl(){return typeof window<"u"}function ei(e){return Cy(e)?(e.nodeName||"").toLowerCase():"#document"}function dt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rr(e){var t;return(t=(Cy(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Cy(e){return Cl()?e instanceof Node||e instanceof dt(e).Node:!1}function Vt(e){return Cl()?e instanceof Element||e instanceof dt(e).Element:!1}function tr(e){return Cl()?e instanceof HTMLElement||e instanceof dt(e).HTMLElement:!1}function _p(e){return!Cl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dt(e).ShadowRoot}const JS=new Set(["inline","contents"]);function _o(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!JS.has(s)}const YS=new Set(["table","td","th"]);function XS(e){return YS.has(ei(e))}const ZS=[":popover-open",":modal"];function Pl(e){return ZS.some(t=>{try{return e.matches(t)}catch{return!1}})}const e1=["transform","translate","scale","rotate","perspective"],t1=["transform","translate","scale","rotate","perspective","filter"],r1=["paint","layout","strict","content"];function mh(e){const t=gh(),r=Vt(e)?Wt(e):e;return e1.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||t1.some(n=>(r.willChange||"").includes(n))||r1.some(n=>(r.contain||"").includes(n))}function n1(e){let t=on(e);for(;tr(t)&&!qs(t);){if(mh(t))return t;if(Pl(t))return null;t=on(t)}return null}function gh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const s1=new Set(["html","body","#document"]);function qs(e){return s1.has(ei(e))}function Wt(e){return dt(e).getComputedStyle(e)}function Rl(e){return Vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function on(e){if(ei(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_p(e)&&e.host||rr(e);return _p(t)?t.host:t}function Py(e){const t=on(e);return qs(t)?e.ownerDocument?e.ownerDocument.body:e.body:tr(t)&&_o(t)?t:Py(t)}function Xi(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Py(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),o=dt(s);if(i){const a=Wc(o);return t.concat(o,o.visualViewport||[],_o(s)?s:[],a&&r?Xi(a):[])}return t.concat(s,Xi(s,[],r))}function Wc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ry(e){const t=Wt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=tr(e),i=s?e.offsetWidth:r,o=s?e.offsetHeight:n,a=qa(r)!==i||qa(n)!==o;return a&&(r=i,n=o),{width:r,height:n,$:a}}function vh(e){return Vt(e)?e:e.contextElement}function Rs(e){const t=vh(e);if(!tr(t))return er(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=Ry(t);let o=(i?qa(r.width):r.width)/n,a=(i?qa(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const i1=er(0);function Oy(e){const t=dt(e);return!gh()||!t.visualViewport?i1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function o1(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==dt(e)?!1:t}function zn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=vh(e);let o=er(1);t&&(n?Vt(n)&&(o=Rs(n)):o=Rs(e));const a=o1(i,r,n)?Oy(i):er(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,c=s.width/o.x,d=s.height/o.y;if(i){const f=dt(i),h=n&&Vt(n)?dt(n):n;let y=f,g=Wc(y);for(;g&&n&&h!==y;){const w=Rs(g),m=g.getBoundingClientRect(),p=Wt(g),v=m.left+(g.clientLeft+parseFloat(p.paddingLeft))*w.x,b=m.top+(g.clientTop+parseFloat(p.paddingTop))*w.y;l*=w.x,u*=w.y,c*=w.x,d*=w.y,l+=v,u+=b,y=dt(g),g=Wc(y)}}return Ga({width:c,height:d,x:l,y:u})}function yh(e,t){const r=Rl(e).scrollLeft;return t?t.left+r:zn(rr(e)).left+r}function Ay(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:yh(e,n)),i=n.top+t.scrollTop;return{x:s,y:i}}function a1(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",o=rr(n),a=t?Pl(t.floating):!1;if(n===o||a&&i)return r;let l={scrollLeft:0,scrollTop:0},u=er(1);const c=er(0),d=tr(n);if((d||!d&&!i)&&((ei(n)!=="body"||_o(o))&&(l=Rl(n)),tr(n))){const h=zn(n);u=Rs(n),c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}const f=o&&!d&&!i?Ay(o,l,!0):er(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}}function l1(e){return Array.from(e.getClientRects())}function u1(e){const t=rr(e),r=Rl(e),n=e.ownerDocument.body,s=ot(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ot(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+yh(e);const a=-r.scrollTop;return Wt(n).direction==="rtl"&&(o+=ot(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:a}}function c1(e,t){const r=dt(e),n=rr(e),s=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const u=gh();(!u||u&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}const d1=new Set(["absolute","fixed"]);function h1(e,t){const r=zn(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=tr(e)?Rs(e):er(1),o=e.clientWidth*i.x,a=e.clientHeight*i.y,l=s*i.x,u=n*i.y;return{width:o,height:a,x:l,y:u}}function bp(e,t,r){let n;if(t==="viewport")n=c1(e,r);else if(t==="document")n=u1(rr(e));else if(Vt(t))n=h1(t,r);else{const s=Oy(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ga(n)}function Iy(e,t){const r=on(e);return r===t||!Vt(r)||qs(r)?!1:Wt(r).position==="fixed"||Iy(r,t)}function f1(e,t){const r=t.get(e);if(r)return r;let n=Xi(e,[],!1).filter(a=>Vt(a)&&ei(a)!=="body"),s=null;const i=Wt(e).position==="fixed";let o=i?on(e):e;for(;Vt(o)&&!qs(o);){const a=Wt(o),l=mh(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&d1.has(s.position)||_o(o)&&!l&&Iy(e,o))?n=n.filter(c=>c!==o):s=a,o=on(o)}return t.set(e,n),n}function p1(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const o=[...r==="clippingAncestors"?Pl(t)?[]:f1(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((u,c)=>{const d=bp(t,c,s);return u.top=ot(d.top,u.top),u.right=sn(d.right,u.right),u.bottom=sn(d.bottom,u.bottom),u.left=ot(d.left,u.left),u},bp(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function m1(e){const{width:t,height:r}=Ry(e);return{width:t,height:r}}function g1(e,t,r){const n=tr(t),s=rr(t),i=r==="fixed",o=zn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=er(0);function u(){l.x=yh(s)}if(n||!n&&!i)if((ei(t)!=="body"||_o(s))&&(a=Rl(t)),n){const h=zn(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else s&&u();i&&!n&&s&&u();const c=s&&!n&&!i?Ay(s,a):er(0),d=o.left+a.scrollLeft-l.x-c.x,f=o.top+a.scrollTop-l.y-c.y;return{x:d,y:f,width:o.width,height:o.height}}function ku(e){return Wt(e).position==="static"}function xp(e,t){if(!tr(e)||Wt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return rr(e)===r&&(r=r.ownerDocument.body),r}function jy(e,t){const r=dt(e);if(Pl(e))return r;if(!tr(e)){let s=on(e);for(;s&&!qs(s);){if(Vt(s)&&!ku(s))return s;s=on(s)}return r}let n=xp(e,t);for(;n&&XS(n)&&ku(n);)n=xp(n,t);return n&&qs(n)&&ku(n)&&!mh(n)?r:n||n1(e)||r}const v1=async function(e){const t=this.getOffsetParent||jy,r=this.getDimensions,n=await r(e.floating);return{reference:g1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function y1(e){return Wt(e).direction==="rtl"}const w1={convertOffsetParentRelativeRectToViewportRelativeRect:a1,getDocumentElement:rr,getClippingRect:p1,getOffsetParent:jy,getElementRects:v1,getClientRects:l1,getDimensions:m1,getScale:Rs,isElement:Vt,isRTL:y1};function Ny(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _1(e,t){let r=null,n;const s=rr(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(a||t(),!f||!h)return;const y=Go(d),g=Go(s.clientWidth-(c+f)),w=Go(s.clientHeight-(d+h)),m=Go(c),v={rootMargin:-y+"px "+-g+"px "+-w+"px "+-m+"px",threshold:ot(0,sn(1,l))||1};let b=!0;function x(E){const S=E[0].intersectionRatio;if(S!==l){if(!b)return o();S?o(!1,S):n=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!Ny(u,e.getBoundingClientRect())&&o(),b=!1}try{r=new IntersectionObserver(x,{...v,root:s.ownerDocument})}catch{r=new IntersectionObserver(x,v)}r.observe(e)}return o(!0),i}function b1(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=vh(e),c=s||i?[...u?Xi(u):[],...Xi(t)]:[];c.forEach(m=>{s&&m.addEventListener("scroll",r,{passive:!0}),i&&m.addEventListener("resize",r)});const d=u&&a?_1(u,r):null;let f=-1,h=null;o&&(h=new ResizeObserver(m=>{let[p]=m;p&&p.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),r()}),u&&!l&&h.observe(u),h.observe(t));let y,g=l?zn(e):null;l&&w();function w(){const m=zn(e);g&&!Ny(g,m)&&r(),g=m,y=requestAnimationFrame(w)}return r(),()=>{var m;c.forEach(p=>{s&&p.removeEventListener("scroll",r),i&&p.removeEventListener("resize",r)}),d==null||d(),(m=h)==null||m.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const x1=qS,E1=KS,S1=VS,k1=QS,T1=WS,Ep=BS,C1=GS,P1=(e,t,r)=>{const n=new Map,s={platform:w1,...r},i={...s.platform,_c:n};return zS(e,t,{...s,platform:i})};var R1=typeof document<"u",O1=function(){},wa=R1?_.useLayoutEffect:O1;function Qa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Qa(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&e.$$typeof)&&!Qa(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function $y(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sp(e,t){const r=$y(e);return Math.round(t*r)/r}function Tu(e){const t=_.useRef(e);return wa(()=>{t.current=e}),t}function A1(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=_.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=_.useState(n);Qa(f,n)||h(n);const[y,g]=_.useState(null),[w,m]=_.useState(null),p=_.useCallback(P=>{P!==E.current&&(E.current=P,g(P))},[]),v=_.useCallback(P=>{P!==S.current&&(S.current=P,m(P))},[]),b=i||y,x=o||w,E=_.useRef(null),S=_.useRef(null),T=_.useRef(c),I=l!=null,j=Tu(l),F=Tu(s),L=Tu(u),J=_.useCallback(()=>{if(!E.current||!S.current)return;const P={placement:t,strategy:r,middleware:f};F.current&&(P.platform=F.current),P1(E.current,S.current,P).then(O=>{const $={...O,isPositioned:L.current!==!1};N.current&&!Qa(T.current,$)&&(T.current=$,yo.flushSync(()=>{d($)}))})},[f,t,r,F,L]);wa(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[u]);const N=_.useRef(!1);wa(()=>(N.current=!0,()=>{N.current=!1}),[]),wa(()=>{if(b&&(E.current=b),x&&(S.current=x),b&&x){if(j.current)return j.current(b,x,J);J()}},[b,x,J,j,I]);const W=_.useMemo(()=>({reference:E,floating:S,setReference:p,setFloating:v}),[p,v]),V=_.useMemo(()=>({reference:b,floating:x}),[b,x]),K=_.useMemo(()=>{const P={position:r,left:0,top:0};if(!V.floating)return P;const O=Sp(V.floating,c.x),$=Sp(V.floating,c.y);return a?{...P,transform:"translate("+O+"px, "+$+"px)",...$y(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:O,top:$}},[r,a,V.floating,c.x,c.y]);return _.useMemo(()=>({...c,update:J,refs:W,elements:V,floatingStyles:K}),[c,J,W,V,K])}const I1=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ep({element:n.current,padding:s}).fn(r):{}:n?Ep({element:n,padding:s}).fn(r):{}}}},j1=(e,t)=>({...x1(e),options:[e,t]}),N1=(e,t)=>({...E1(e),options:[e,t]}),$1=(e,t)=>({...C1(e),options:[e,t]}),L1=(e,t)=>({...S1(e),options:[e,t]}),D1=(e,t)=>({...k1(e),options:[e,t]}),M1=(e,t)=>({...T1(e),options:[e,t]}),U1=(e,t)=>({...I1(e),options:[e,t]});var F1="Arrow",Ly=_.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return k.jsx(Ye.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:k.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ly.displayName=F1;var z1=Ly;function B1(e){const[t,r]=_.useState(void 0);return nn(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var wh="Popper",[Dy,My]=El(wh),[V1,Uy]=Dy(wh),Fy=e=>{const{__scopePopper:t,children:r}=e,[n,s]=_.useState(null);return k.jsx(V1,{scope:t,anchor:n,onAnchorChange:s,children:r})};Fy.displayName=wh;var zy="PopperAnchor",By=_.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=Uy(zy,r),o=_.useRef(null),a=Bt(t,o);return _.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:k.jsx(Ye.div,{...s,ref:a})});By.displayName=zy;var _h="PopperContent",[W1,H1]=Dy(_h),Vy=_.forwardRef((e,t)=>{var re,Wn,br,hn,xr,Hn;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:y,...g}=e,w=Uy(_h,r),[m,p]=_.useState(null),v=Bt(t,Er=>p(Er)),[b,x]=_.useState(null),E=B1(b),S=(E==null?void 0:E.width)??0,T=(E==null?void 0:E.height)??0,I=n+(i!=="center"?"-"+i:""),j=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},F=Array.isArray(u)?u:[u],L=F.length>0,J={padding:j,boundary:F.filter(K1),altBoundary:L},{refs:N,floatingStyles:W,placement:V,isPositioned:K,middlewareData:P}=A1({strategy:"fixed",placement:I,whileElementsMounted:(...Er)=>b1(...Er,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[j1({mainAxis:s+T,alignmentAxis:o}),l&&N1({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?$1():void 0,...J}),l&&L1({...J}),D1({...J,apply:({elements:Er,rects:Eo,availableWidth:Fl,availableHeight:So})=>{const{width:zl,height:ni}=Eo.reference,qn=Er.floating.style;qn.setProperty("--radix-popper-available-width",`${Fl}px`),qn.setProperty("--radix-popper-available-height",`${So}px`),qn.setProperty("--radix-popper-anchor-width",`${zl}px`),qn.setProperty("--radix-popper-anchor-height",`${ni}px`)}}),b&&U1({element:b,padding:a}),G1({arrowWidth:S,arrowHeight:T}),f&&M1({strategy:"referenceHidden",...J})]}),[O,$]=qy(V),G=rn(y);nn(()=>{K&&(G==null||G())},[K,G]);const U=(re=P.arrow)==null?void 0:re.x,Y=(Wn=P.arrow)==null?void 0:Wn.y,Z=((br=P.arrow)==null?void 0:br.centerOffset)!==0,[be,De]=_.useState();return nn(()=>{m&&De(window.getComputedStyle(m).zIndex)},[m]),k.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:K?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(hn=P.transformOrigin)==null?void 0:hn.x,(xr=P.transformOrigin)==null?void 0:xr.y].join(" "),...((Hn=P.hide)==null?void 0:Hn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:k.jsx(W1,{scope:r,placedSide:O,onArrowChange:x,arrowX:U,arrowY:Y,shouldHideArrow:Z,children:k.jsx(Ye.div,{"data-side":O,"data-align":$,...g,ref:v,style:{...g.style,animation:K?void 0:"none"}})})})});Vy.displayName=_h;var Wy="PopperArrow",q1={top:"bottom",right:"left",bottom:"top",left:"right"},Hy=_.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=H1(Wy,n),o=q1[i.placedSide];return k.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:k.jsx(z1,{...s,ref:r,style:{...s.style,display:"block"}})})});Hy.displayName=Wy;function K1(e){return e!==null}var G1=e=>({name:"transformOrigin",options:e,fn(t){var w,m,p;const{placement:r,rects:n,middlewareData:s}=t,o=((w=s.arrow)==null?void 0:w.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,c]=qy(r),d={start:"0%",center:"50%",end:"100%"}[c],f=(((m=s.arrow)==null?void 0:m.x)??0)+a/2,h=(((p=s.arrow)==null?void 0:p.y)??0)+l/2;let y="",g="";return u==="bottom"?(y=o?d:`${f}px`,g=`${-l}px`):u==="top"?(y=o?d:`${f}px`,g=`${n.floating.height+l}px`):u==="right"?(y=`${-l}px`,g=o?d:`${h}px`):u==="left"&&(y=`${n.floating.width+l}px`,g=o?d:`${h}px`),{data:{x:y,y:g}}}});function qy(e){const[t,r="center"]=e.split("-");return[t,r]}var fO=Fy,Q1=By,J1=Vy,Y1=Hy,[Ol,pO]=El("Tooltip",[My]),bh=My(),Ky="TooltipProvider",X1=700,kp="tooltip.open",[Z1,Gy]=Ol(Ky),Qy=e=>{const{__scopeTooltip:t,delayDuration:r=X1,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,o=_.useRef(!0),a=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),k.jsx(Z1,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:_.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};Qy.displayName=Ky;var Jy="Tooltip",[mO,Al]=Ol(Jy),Hc="TooltipTrigger",ek=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Al(Hc,r),i=Gy(Hc,r),o=bh(r),a=_.useRef(null),l=Bt(t,a,s.onTriggerChange),u=_.useRef(!1),c=_.useRef(!1),d=_.useCallback(()=>u.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),k.jsx(Q1,{asChild:!0,...o,children:k.jsx(Ye.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:Ce(e.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ce(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:Ce(e.onBlur,s.onClose),onClick:Ce(e.onClick,s.onClose)})})});ek.displayName=Hc;var tk="TooltipPortal",[gO,rk]=Ol(tk,{forceMount:void 0}),Ks="TooltipContent",Yy=_.forwardRef((e,t)=>{const r=rk(Ks,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,o=Al(Ks,e.__scopeTooltip);return k.jsx(sh,{present:n||o.open,children:o.disableHoverableContent?k.jsx(Xy,{side:s,...i,ref:t}):k.jsx(nk,{side:s,...i,ref:t})})}),nk=_.forwardRef((e,t)=>{const r=Al(Ks,e.__scopeTooltip),n=Gy(Ks,e.__scopeTooltip),s=_.useRef(null),i=Bt(t,s),[o,a]=_.useState(null),{trigger:l,onClose:u}=r,c=s.current,{onPointerInTransitChange:d}=n,f=_.useCallback(()=>{a(null),d(!1)},[d]),h=_.useCallback((y,g)=>{const w=y.currentTarget,m={x:y.clientX,y:y.clientY},p=lk(m,w.getBoundingClientRect()),v=uk(m,p),b=ck(g.getBoundingClientRect()),x=hk([...v,...b]);a(x),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(l&&c){const y=w=>h(w,c),g=w=>h(w,l);return l.addEventListener("pointerleave",y),c.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",y),c.removeEventListener("pointerleave",g)}}},[l,c,h,f]),_.useEffect(()=>{if(o){const y=g=>{const w=g.target,m={x:g.clientX,y:g.clientY},p=(l==null?void 0:l.contains(w))||(c==null?void 0:c.contains(w)),v=!dk(m,o);p?f():v&&(f(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,c,o,u,f]),k.jsx(Xy,{...e,ref:i})}),[sk,ik]=Ol(Jy,{isInside:!1}),ok=gx("TooltipContent"),Xy=_.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=e,l=Al(Ks,r),u=bh(r),{onClose:c}=l;return _.useEffect(()=>(document.addEventListener(kp,c),()=>document.removeEventListener(kp,c)),[c]),_.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),k.jsx(nh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:k.jsxs(J1,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[k.jsx(ok,{children:n}),k.jsx(sk,{scope:r,isInside:!0,children:k.jsx(zx,{id:l.contentId,role:"tooltip",children:s||n})})]})})});Yy.displayName=Ks;var Zy="TooltipArrow",ak=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=bh(r);return ik(Zy,r).isInside?null:k.jsx(Y1,{...s,...n,ref:t})});ak.displayName=Zy;function lk(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function uk(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function ck(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function dk(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,o=t.length-1;in!=f>n&&r<(d-u)*(n-c)/(f-c)+u&&(s=!s)}return s}function hk(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),fk(t)}function fk(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var pk=Qy,ew=Yy;const mk=pk,gk=_.forwardRef(({className:e,sideOffset:t=4,...r},n)=>k.jsx(ew,{ref:n,sideOffset:t,className:We("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));gk.displayName=ew.displayName;var Il=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(){}},jl=typeof window>"u"||"Deno"in globalThis;function At(){}function vk(e,t){return typeof e=="function"?e(t):e}function yk(e){return typeof e=="number"&&e>=0&&e!==1/0}function wk(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qc(e,t){return typeof e=="function"?e(t):e}function _k(e,t){return typeof e=="function"?e(t):e}function Tp(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==xh(o,t.options))return!1}else if(!eo(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function Cp(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Zi(t.options.mutationKey)!==Zi(i))return!1}else if(!eo(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function xh(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zi)(e)}function Zi(e){return JSON.stringify(e,(t,r)=>Kc(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function eo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>eo(e[r],t[r])):!1}function tw(e,t){if(e===t)return e;const r=Pp(e)&&Pp(t);if(r||Kc(e)&&Kc(t)){const n=r?e:Object.keys(e),s=n.length,i=r?t:Object.keys(t),o=i.length,a=r?[]:{},l=new Set(n);let u=0;for(let c=0;c{setTimeout(t,e)})}function xk(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?tw(e,t):t}function Ek(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Sk(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Eh=Symbol();function rw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Eh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Pn,Dr,As,cm,kk=(cm=class extends Il{constructor(){super();te(this,Pn);te(this,Dr);te(this,As);q(this,As,t=>{if(!jl&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){C(this,Dr)||this.setEventListener(C(this,As))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Dr))==null||t.call(this),q(this,Dr,void 0))}setEventListener(t){var r;q(this,As,t),(r=C(this,Dr))==null||r.call(this),q(this,Dr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){C(this,Pn)!==t&&(q(this,Pn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof C(this,Pn)=="boolean"?C(this,Pn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pn=new WeakMap,Dr=new WeakMap,As=new WeakMap,cm),nw=new kk,Is,Mr,js,dm,Tk=(dm=class extends Il{constructor(){super();te(this,Is,!0);te(this,Mr);te(this,js);q(this,js,t=>{if(!jl&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){C(this,Mr)||this.setEventListener(C(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Mr))==null||t.call(this),q(this,Mr,void 0))}setEventListener(t){var r;q(this,js,t),(r=C(this,Mr))==null||r.call(this),q(this,Mr,t(this.setOnline.bind(this)))}setOnline(t){C(this,Is)!==t&&(q(this,Is,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return C(this,Is)}},Is=new WeakMap,Mr=new WeakMap,js=new WeakMap,dm),Ja=new Tk;function Ck(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function Pk(e){return Math.min(1e3*2**e,3e4)}function sw(e){return(e??"online")==="online"?Ja.isOnline():!0}var iw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Cu(e){return e instanceof iw}function ow(e){let t=!1,r=0,n=!1,s;const i=Ck(),o=g=>{var w;n||(f(new iw(g)),(w=e.abort)==null||w.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>nw.isFocused()&&(e.networkMode==="always"||Ja.isOnline())&&e.canRun(),c=()=>sw(e.networkMode)&&e.canRun(),d=g=>{var w;n||(n=!0,(w=e.onSuccess)==null||w.call(e,g),s==null||s(),i.resolve(g))},f=g=>{var w;n||(n=!0,(w=e.onError)==null||w.call(e,g),s==null||s(),i.reject(g))},h=()=>new Promise(g=>{var w;s=m=>{(n||u())&&g(m)},(w=e.onPause)==null||w.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(n)return;let g;const w=r===0?e.initialPromise:void 0;try{g=w??e.fn()}catch(m){g=Promise.reject(m)}Promise.resolve(g).then(d).catch(m=>{var E;if(n)return;const p=e.retry??(jl?0:3),v=e.retryDelay??Pk,b=typeof v=="function"?v(r,m):v,x=p===!0||typeof p=="number"&&ru()?void 0:h()).then(()=>{t?f(m):y()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?y():h().then(y),i)}}var Rk=e=>setTimeout(e,0);function Ok(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=Rk;const i=a=>{t?e.push(a):s(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(l=>{r(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var Ke=Ok(),Rn,hm,aw=(hm=class{constructor(){te(this,Rn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yk(this.gcTime)&&q(this,Rn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(jl?1/0:5*60*1e3))}clearGcTimeout(){C(this,Rn)&&(clearTimeout(C(this,Rn)),q(this,Rn,void 0))}},Rn=new WeakMap,hm),Ns,On,vt,An,ze,uo,In,jt,ir,fm,Ak=(fm=class extends aw{constructor(t){super();te(this,jt);te(this,Ns);te(this,On);te(this,vt);te(this,An);te(this,ze);te(this,uo);te(this,In);q(this,In,!1),q(this,uo,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,An,t.client),q(this,vt,C(this,An).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Ns,jk(this.options)),this.state=t.state??C(this,Ns),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,ze))==null?void 0:t.promise}setOptions(t){this.options={...C(this,uo),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,vt).remove(this)}setData(t,r){const n=xk(this.state.data,t,this.options);return Me(this,jt,ir).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Me(this,jt,ir).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=C(this,ze))==null?void 0:n.promise;return(s=C(this,ze))==null||s.cancel(t),r?r.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,Ns))}isActive(){return this.observers.some(t=>_k(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Eh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>qc(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!wk(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=C(this,ze))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=C(this,ze))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,vt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(C(this,ze)&&(C(this,In)?C(this,ze).cancel({revert:!0}):C(this,ze).cancelRetry()),this.scheduleGc()),C(this,vt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Me(this,jt,ir).call(this,{type:"invalidate"})}fetch(t,r){var u,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(C(this,ze))return C(this,ze).continueRetry(),C(this,ze).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(q(this,In,!0),n.signal)})},i=()=>{const f=rw(this.options,r),y=(()=>{const g={client:C(this,An),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return q(this,In,!1),this.options.persister?this.options.persister(f,y,this):f(y)},a=(()=>{const f={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:C(this,An),state:this.state,fetchFn:i};return s(f),f})();(u=this.options.behavior)==null||u.onFetch(a,this),q(this,On,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Me(this,jt,ir).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,y,g,w;Cu(f)&&f.silent||Me(this,jt,ir).call(this,{type:"error",error:f}),Cu(f)||((y=(h=C(this,vt).config).onError)==null||y.call(h,f,this),(w=(g=C(this,vt).config).onSettled)==null||w.call(g,this.state.data,f,this)),this.scheduleGc()};return q(this,ze,ow({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var h,y,g,w;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(m){l(m);return}(y=(h=C(this,vt).config).onSuccess)==null||y.call(h,f,this),(w=(g=C(this,vt).config).onSettled)==null||w.call(g,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Me(this,jt,ir).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Me(this,jt,ir).call(this,{type:"pause"})},onContinue:()=>{Me(this,jt,ir).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,ze).start()}},Ns=new WeakMap,On=new WeakMap,vt=new WeakMap,An=new WeakMap,ze=new WeakMap,uo=new WeakMap,In=new WeakMap,jt=new WeakSet,ir=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ik(n.data,this.options),fetchMeta:t.meta??null};case"success":return q(this,On,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Cu(s)&&s.revert&&C(this,On)?{...C(this,On),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),C(this,vt).notify({query:this,type:"updated",action:t})})},fm);function Ik(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function jk(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Kt,pm,Nk=(pm=class extends Il{constructor(t={}){super();te(this,Kt);this.config=t,q(this,Kt,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??xh(s,r);let o=this.get(i);return o||(o=new Ak({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){C(this,Kt).has(t.queryHash)||(C(this,Kt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=C(this,Kt).get(t.queryHash);r&&(t.destroy(),r===t&&C(this,Kt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Kt).get(t)}getAll(){return[...C(this,Kt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Tp(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Tp(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Kt=new WeakMap,pm),Gt,He,jn,Qt,Or,mm,$k=(mm=class extends aw{constructor(t){super();te(this,Qt);te(this,Gt);te(this,He);te(this,jn);this.mutationId=t.mutationId,q(this,He,t.mutationCache),q(this,Gt,[]),this.state=t.state||Lk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Gt).includes(t)||(C(this,Gt).push(t),this.clearGcTimeout(),C(this,He).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,Gt,C(this,Gt).filter(r=>r!==t)),this.scheduleGc(),C(this,He).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Gt).length||(this.state.status==="pending"?this.scheduleGc():C(this,He).remove(this))}continue(){var t;return((t=C(this,jn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,l,u,c,d,f,h,y,g,w,m,p,v,b,x,E,S,T;const r=()=>{Me(this,Qt,Or).call(this,{type:"continue"})};q(this,jn,ow({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,j)=>{Me(this,Qt,Or).call(this,{type:"failed",failureCount:I,error:j})},onPause:()=>{Me(this,Qt,Or).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,He).canRun(this)}));const n=this.state.status==="pending",s=!C(this,jn).canStart();try{if(n)r();else{Me(this,Qt,Or).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(i=C(this,He).config).onMutate)==null?void 0:o.call(i,t,this));const j=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));j!==this.state.context&&Me(this,Qt,Or).call(this,{type:"pending",context:j,variables:t,isPaused:s})}const I=await C(this,jn).start();return await((c=(u=C(this,He).config).onSuccess)==null?void 0:c.call(u,I,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,I,t,this.state.context)),await((y=(h=C(this,He).config).onSettled)==null?void 0:y.call(h,I,null,this.state.variables,this.state.context,this)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,I,null,t,this.state.context)),Me(this,Qt,Or).call(this,{type:"success",data:I}),I}catch(I){try{throw await((p=(m=C(this,He).config).onError)==null?void 0:p.call(m,I,t,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,I,t,this.state.context)),await((E=(x=C(this,He).config).onSettled)==null?void 0:E.call(x,void 0,I,this.state.variables,this.state.context,this)),await((T=(S=this.options).onSettled)==null?void 0:T.call(S,void 0,I,t,this.state.context)),I}finally{Me(this,Qt,Or).call(this,{type:"error",error:I})}}finally{C(this,He).runNext(this)}}},Gt=new WeakMap,He=new WeakMap,jn=new WeakMap,Qt=new WeakSet,Or=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{C(this,Gt).forEach(n=>{n.onMutationUpdate(t)}),C(this,He).notify({mutation:this,type:"updated",action:t})})},mm);function Lk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ur,Nt,co,gm,Dk=(gm=class extends Il{constructor(t={}){super();te(this,ur);te(this,Nt);te(this,co);this.config=t,q(this,ur,new Set),q(this,Nt,new Map),q(this,co,0)}build(t,r,n){const s=new $k({mutationCache:this,mutationId:++To(this,co)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){C(this,ur).add(t);const r=Qo(t);if(typeof r=="string"){const n=C(this,Nt).get(r);n?n.push(t):C(this,Nt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,ur).delete(t)){const r=Qo(t);if(typeof r=="string"){const n=C(this,Nt).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&C(this,Nt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Qo(t);if(typeof r=="string"){const n=C(this,Nt).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Qo(t);if(typeof r=="string"){const s=(n=C(this,Nt).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ke.batch(()=>{C(this,ur).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,ur).clear(),C(this,Nt).clear()})}getAll(){return Array.from(C(this,ur))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Cp(r,n))}findAll(t={}){return this.getAll().filter(r=>Cp(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ke.batch(()=>Promise.all(t.map(r=>r.continue().catch(At))))}},ur=new WeakMap,Nt=new WeakMap,co=new WeakMap,gm);function Qo(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Op(e){return{onFetch:(t,r)=>{var c,d,f,h,y;const n=t.options,s=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let g=!1;const w=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},m=rw(t.options,t.fetchOptions),p=async(v,b,x)=>{if(g)return Promise.reject();if(b==null&&v.pages.length)return Promise.resolve(v);const S=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:b,direction:x?"backward":"forward",meta:t.options.meta};return w(F),F})(),T=await m(S),{maxPages:I}=t.options,j=x?Sk:Ek;return{pages:j(v.pages,T,I),pageParams:j(v.pageParams,b,I)}};if(s&&i.length){const v=s==="backward",b=v?Mk:Ap,x={pages:i,pageParams:o},E=b(n,x);a=await p(x,E,v)}else{const v=e??i.length;do{const b=l===0?o[0]??n.initialPageParam:Ap(n,a);if(l>0&&b==null)break;a=await p(a,b),l++}while(l{var g,w;return(w=(g=t.options).persister)==null?void 0:w.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Ap(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Mk(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ge,Ur,Fr,$s,Ls,zr,Ds,Ms,vm,Uk=(vm=class{constructor(e={}){te(this,ge);te(this,Ur);te(this,Fr);te(this,$s);te(this,Ls);te(this,zr);te(this,Ds);te(this,Ms);q(this,ge,e.queryCache||new Nk),q(this,Ur,e.mutationCache||new Dk),q(this,Fr,e.defaultOptions||{}),q(this,$s,new Map),q(this,Ls,new Map),q(this,zr,0)}mount(){To(this,zr)._++,C(this,zr)===1&&(q(this,Ds,nw.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,ge).onFocus())})),q(this,Ms,Ja.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,ge).onOnline())})))}unmount(){var e,t;To(this,zr)._--,C(this,zr)===0&&((e=C(this,Ds))==null||e.call(this),q(this,Ds,void 0),(t=C(this,Ms))==null||t.call(this),q(this,Ms,void 0))}isFetching(e){return C(this,ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,Ur).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=C(this,ge).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=C(this,ge).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(qc(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return C(this,ge).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=C(this,ge).get(n.queryHash),i=s==null?void 0:s.state.data,o=vk(t,i);if(o!==void 0)return C(this,ge).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>C(this,ge).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=C(this,ge).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=C(this,ge);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=C(this,ge);return Ke.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ke.batch(()=>C(this,ge).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(At).catch(At)}invalidateQueries(e,t={}){return Ke.batch(()=>(C(this,ge).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ke.batch(()=>C(this,ge).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(At)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(At)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=C(this,ge).build(this,t);return r.isStaleByTime(qc(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(At).catch(At)}fetchInfiniteQuery(e){return e.behavior=Op(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(At).catch(At)}ensureInfiniteQueryData(e){return e.behavior=Op(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ja.isOnline()?C(this,Ur).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,ge)}getMutationCache(){return C(this,Ur)}getDefaultOptions(){return C(this,Fr)}setDefaultOptions(e){q(this,Fr,e)}setQueryDefaults(e,t){C(this,$s).set(Zi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,$s).values()],r={};return t.forEach(n=>{eo(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){C(this,Ls).set(Zi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,Ls).values()],r={};return t.forEach(n=>{eo(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,Fr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=xh(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===Eh&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,Fr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,ge).clear(),C(this,Ur).clear()}},ge=new WeakMap,Ur=new WeakMap,Fr=new WeakMap,$s=new WeakMap,Ls=new WeakMap,zr=new WeakMap,Ds=new WeakMap,Ms=new WeakMap,vm),Fk=_.createContext(void 0),zk=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),k.jsx(Fk.Provider,{value:e,children:t}));/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function to(){return to=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function lw(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Vk(){return Math.random().toString(36).substr(2,8)}function jp(e,t){return{usr:e.state,key:e.key,idx:t}}function Gc(e,t,r,n){return r===void 0&&(r=null),to({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ti(t):t,{state:r,key:t&&t.key||n||Vk()})}function Ya(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ti(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Wk(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,a=Wr.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(to({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=Wr.Pop;let w=c(),m=w==null?null:w-u;u=w,l&&l({action:a,location:g.location,delta:m})}function f(w,m){a=Wr.Push;let p=Gc(g.location,w,m);u=c()+1;let v=jp(p,u),b=g.createHref(p);try{o.pushState(v,"",b)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;s.location.assign(b)}i&&l&&l({action:a,location:g.location,delta:1})}function h(w,m){a=Wr.Replace;let p=Gc(g.location,w,m);u=c();let v=jp(p,u),b=g.createHref(p);o.replaceState(v,"",b),i&&l&&l({action:a,location:g.location,delta:0})}function y(w){let m=s.location.origin!=="null"?s.location.origin:s.location.href,p=typeof w=="string"?w:Ya(w);return p=p.replace(/ $/,"%20"),we(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let g={get action(){return a},get location(){return e(s,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Ip,d),l=w,()=>{s.removeEventListener(Ip,d),l=null}},createHref(w){return t(s,w)},createURL:y,encodeLocation(w){let m=y(w);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:h,go(w){return o.go(w)}};return g}var Np;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Np||(Np={}));function Hk(e,t,r){return r===void 0&&(r="/"),qk(e,t,r,!1)}function qk(e,t,r,n){let s=typeof t=="string"?ti(t):t,i=Gs(s.pathname||"/",r);if(i==null)return null;let o=uw(e);Kk(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(we(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Zr([n,l.relativePath]),c=r.concat(l);i.children&&i.children.length>0&&(we(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),uw(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:eT(u,i.index),routesMeta:c})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of cw(i.path))s(i,o,l)}),t}function cw(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=cw(n.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function Kk(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:tT(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Gk=/^:[\w-]+$/,Qk=3,Jk=2,Yk=1,Xk=10,Zk=-2,$p=e=>e==="*";function eT(e,t){let r=e.split("/"),n=r.length;return r.some($p)&&(n+=Zk),t&&(n+=Jk),r.filter(s=>!$p(s)).reduce((s,i)=>s+(Gk.test(i)?Qk:i===""?Yk:Xk),n)}function tT(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function rT(e,t,r){let{routesMeta:n}=e,s={},i="/",o=[];for(let a=0;a{let{paramName:f,isOptional:h}=c;if(f==="*"){let g=a[d]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const y=a[d];return h&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function nT(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),lw(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function sT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return lw(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Gs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function iT(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?ti(e):e;return{pathname:r?r.startsWith("/")?r:oT(r,t):t,search:uT(n),hash:cT(s)}}function oT(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Pu(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function aT(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function dw(e,t){let r=aT(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function hw(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=ti(e):(s=to({},e),we(!s.pathname||!s.pathname.includes("?"),Pu("?","pathname","search",s)),we(!s.pathname||!s.pathname.includes("#"),Pu("#","pathname","hash",s)),we(!s.search||!s.search.includes("#"),Pu("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=iT(s,a),u=o&&o!=="/"&&o.endsWith("/"),c=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Zr=e=>e.join("/").replace(/\/\/+/g,"/"),lT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function dT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const fw=["post","put","patch","delete"];new Set(fw);const hT=["get",...fw];new Set(hT);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function ro(){return ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),_.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let d=hw(u,JSON.parse(o),i,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Zr([t,d.pathname])),(c.replace?n.replace:n.push)(d,c.state,c)},[t,n,o,i,e])}function vO(){let{matches:e}=_.useContext(dn),t=e[e.length-1];return t?t.params:{}}function Ll(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=_.useContext(cn),{matches:s}=_.useContext(dn),{pathname:i}=ri(),o=JSON.stringify(dw(s,n.v7_relativeSplatPath));return _.useMemo(()=>hw(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function gT(e,t){return vT(e,t)}function vT(e,t,r,n){bo()||we(!1);let{navigator:s}=_.useContext(cn),{matches:i}=_.useContext(dn),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=ri(),c;if(t){var d;let w=typeof t=="string"?ti(t):t;l==="/"||(d=w.pathname)!=null&&d.startsWith(l)||we(!1),c=w}else c=u;let f=c.pathname||"/",h=f;if(l!=="/"){let w=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=Hk(e,{pathname:h}),g=xT(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:Zr([l,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:Zr([l,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,r,n);return t&&g?_.createElement($l.Provider,{value:{location:ro({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Wr.Pop}},g):g}function yT(){let e=TT(),t=dT(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},t),r?_.createElement("pre",{style:s},r):null,null)}const wT=_.createElement(yT,null);class _T extends _.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?_.createElement(dn.Provider,{value:this.props.routeContext},_.createElement(mw.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function bT(e){let{routeContext:t,match:r,children:n}=e,s=_.useContext(Nl);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),_.createElement(dn.Provider,{value:t},n)}function xT(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,a=(s=r)==null?void 0:s.errors;if(a!=null){let c=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||we(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,f)=>{let h,y=!1,g=null,w=null;r&&(h=a&&d.route.id?a[d.route.id]:void 0,g=d.route.errorElement||wT,l&&(u<0&&f===0?(y=!0,w=null):u===f&&(y=!0,w=d.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,f+1)),p=()=>{let v;return h?v=g:y?v=w:d.route.Component?v=_.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=c,_.createElement(bT,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:r!=null},children:v})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(_T,{location:r.location,revalidation:r.revalidation,component:g,error:h,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}var vw=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(vw||{}),Za=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Za||{});function ET(e){let t=_.useContext(Nl);return t||we(!1),t}function ST(e){let t=_.useContext(pw);return t||we(!1),t}function kT(e){let t=_.useContext(dn);return t||we(!1),t}function yw(e){let t=kT(),r=t.matches[t.matches.length-1];return r.route.id||we(!1),r.route.id}function TT(){var e;let t=_.useContext(mw),r=ST(Za.UseRouteError),n=yw(Za.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function CT(){let{router:e}=ET(vw.UseNavigateStable),t=yw(Za.UseNavigateStable),r=_.useRef(!1);return gw(()=>{r.current=!0}),_.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,ro({fromRouteId:t},i)))},[e,t])}function PT(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function xe(e){we(!1)}function RT(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Wr.Pop,navigator:i,static:o=!1,future:a}=e;bo()&&we(!1);let l=t.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:l,navigator:i,static:o,future:ro({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof n=="string"&&(n=ti(n));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:y="default"}=n,g=_.useMemo(()=>{let w=Gs(c,l);return w==null?null:{location:{pathname:w,search:d,hash:f,state:h,key:y},navigationType:s}},[l,c,d,f,h,y,s]);return g==null?null:_.createElement(cn.Provider,{value:u},_.createElement($l.Provider,{children:r,value:g}))}function OT(e){let{children:t,location:r}=e;return gT(Qc(t),r)}new Promise(()=>{});function Qc(e,t){t===void 0&&(t=[]);let r=[];return _.Children.forEach(e,(n,s)=>{if(!_.isValidElement(n))return;let i=[...t,s];if(n.type===_.Fragment){r.push.apply(r,Qc(n.props.children,i));return}n.type!==xe&&we(!1),!n.props.index||!n.props.children||we(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Qc(n.props.children,i)),r.push(o)}),r}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function el(){return el=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function AT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function IT(e,t){return e.button===0&&(!t||t==="_self")&&!AT(e)}const jT=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],NT=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],$T="6";try{window.__reactRouterVersion=$T}catch{}const LT=_.createContext({isTransitioning:!1}),DT="startTransition",Lp=Pm[DT];function MT(e){let{basename:t,children:r,future:n,window:s}=e,i=_.useRef();i.current==null&&(i.current=Bk({window:s,v5Compat:!0}));let o=i.current,[a,l]=_.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=_.useCallback(d=>{u&&Lp?Lp(()=>l(d)):l(d)},[l,u]);return _.useLayoutEffect(()=>o.listen(c),[o,c]),_.useEffect(()=>PT(n),[n]),_.createElement(RT,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const UT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",FT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zT=_.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,f=ww(t,jT),{basename:h}=_.useContext(cn),y,g=!1;if(typeof u=="string"&&FT.test(u)&&(y=u,UT))try{let v=new URL(window.location.href),b=u.startsWith("//")?new URL(v.protocol+u):new URL(u),x=Gs(b.pathname,h);b.origin===v.origin&&x!=null?u=x+b.search+b.hash:g=!0}catch{}let w=fT(u,{relative:s}),m=WT(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:s,viewTransition:d});function p(v){n&&n(v),v.defaultPrevented||m(v)}return _.createElement("a",el({},f,{href:y||w,onClick:g||i?n:p,ref:r,target:l}))}),BT=_.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:u,children:c}=t,d=ww(t,NT),f=Ll(l,{relative:d.relative}),h=ri(),y=_.useContext(pw),{navigator:g,basename:w}=_.useContext(cn),m=y!=null&&HT(f)&&u===!0,p=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,v=h.pathname,b=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;s||(v=v.toLowerCase(),b=b?b.toLowerCase():null,p=p.toLowerCase()),b&&w&&(b=Gs(b,w)||b);const x=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let E=v===p||!o&&v.startsWith(p)&&v.charAt(x)==="/",S=b!=null&&(b===p||!o&&b.startsWith(p)&&b.charAt(p.length)==="/"),T={isActive:E,isPending:S,isTransitioning:m},I=E?n:void 0,j;typeof i=="function"?j=i(T):j=[i,E?"active":null,S?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let F=typeof a=="function"?a(T):a;return _.createElement(zT,el({},d,{"aria-current":I,className:j,ref:r,style:F,to:l,viewTransition:u}),typeof c=="function"?c(T):c)});var Jc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Jc||(Jc={}));var Dp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Dp||(Dp={}));function VT(e){let t=_.useContext(Nl);return t||we(!1),t}function WT(e,t){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,l=pT(),u=ri(),c=Ll(e,{relative:o});return _.useCallback(d=>{if(IT(d,r)){d.preventDefault();let f=n!==void 0?n:Ya(u)===Ya(c);l(e,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,c,n,s,r,e,i,o,a])}function HT(e,t){t===void 0&&(t={});let r=_.useContext(LT);r==null&&we(!1);let{basename:n}=VT(Jc.useViewTransitionState),s=Ll(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Gs(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Gs(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Xa(s.pathname,o)!=null||Xa(s.pathname,i)!=null}const qT="3167929",Mp="G-WTK13JEF7F",KT="AW-18249417998",GT=()=>(_.useEffect(()=>{{window._linkedin_data_partner_ids=window._linkedin_data_partner_ids||[],window._linkedin_data_partner_ids.push(qT);const e=document.createElement("script");e.async=!0,e.src="https://snap.licdn.com/li.lms-analytics/insight.min.js",document.head.appendChild(e)}{const e=document.createElement("script");e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${Mp}`,document.head.appendChild(e),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",Mp),window.gtag("config",KT)}},[]),null),yO=e=>{window.lintrk&&window.lintrk("track",{conversion_id:e})},wO=(e,t)=>{window.gtag&&window.gtag("event",e,t)},_O=(e,t)=>{window.fbq&&window.fbq("track",e,t)},_w=_.forwardRef(({className:e,...t},r)=>k.jsx("div",{ref:r,className:We("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));_w.displayName="Card";const bw=_.forwardRef(({className:e,...t},r)=>k.jsx("div",{ref:r,className:We("flex flex-col space-y-1.5 p-6",e),...t}));bw.displayName="CardHeader";const xw=_.forwardRef(({className:e,...t},r)=>k.jsx("h3",{ref:r,className:We("text-2xl font-semibold leading-none tracking-tight",e),...t}));xw.displayName="CardTitle";const Ew=_.forwardRef(({className:e,...t},r)=>k.jsx("p",{ref:r,className:We("text-sm text-muted-foreground",e),...t}));Ew.displayName="CardDescription";const Sw=_.forwardRef(({className:e,...t},r)=>k.jsx("div",{ref:r,className:We("p-6 pt-0",e),...t}));Sw.displayName="CardContent";const QT=_.forwardRef(({className:e,...t},r)=>k.jsx("div",{ref:r,className:We("flex items-center p-6 pt-0",e),...t}));QT.displayName="CardFooter";const kw=_.forwardRef(({className:e,type:t,...r},n)=>k.jsx("input",{type:t,className:We("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));kw.displayName="Input";var JT="Label",Tw=_.forwardRef((e,t)=>k.jsx(Ye.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Tw.displayName=JT;var Cw=Tw;const YT=lh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pw=_.forwardRef(({className:e,...t},r)=>k.jsx(Cw,{ref:r,className:We(YT(),e),...t}));Pw.displayName=Cw.displayName;const XT=lh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),tl=_.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?px:"button";return k.jsx(o,{className:We(XT({variant:t,size:r,className:e})),ref:i,...s})});tl.displayName="Button";var Up=function(){return Up=Object.assign||function(t){for(var r,n=1,s=arguments.length;ne?(...t)=>e(...t):(...t)=>fetch(...t);class Sh extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class tC extends Sh{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Fp extends Sh{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class zp extends Sh{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Yc;(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"})(Yc||(Yc={}));class rC{constructor(t,{headers:r={},customFetch:n,region:s=Yc.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=eC(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return ZT(this,arguments,void 0,function*(r,n={}){var s;let i,o;try{const{headers:a,method:l,body:u,signal:c,timeout:d}=n;let f={},{region:h}=n;h||(h=this.region);const y=new URL(`${this.url}/${r}`);h&&h!=="any"&&(f["x-region"]=h,y.searchParams.set("forceFunctionRegion",h));let g;u&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(f["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(f["Content-Type"]="application/json",g=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?g=JSON.stringify(u):g=u;let w=c;d&&(o=new AbortController,i=setTimeout(()=>o.abort(),d),c?(w=o.signal,c.addEventListener("abort",()=>o.abort())):w=o.signal);const m=yield this.fetch(y.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),a),body:g,signal:w}).catch(x=>{throw new tC(x)}),p=m.headers.get("x-relay-error");if(p&&p==="true")throw new Fp(m);if(!m.ok)throw new zp(m);let v=((s=m.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),b;return v==="application/json"?b=yield m.json():v==="application/octet-stream"||v==="application/pdf"?b=yield m.blob():v==="text/event-stream"?b=m:v==="multipart/form-data"?b=yield m.formData():b=yield m.text(),{data:b,error:null,response:m}}catch(a){return{data:null,error:a,response:a instanceof zp||a instanceof Fp?a.context:void 0}}finally{i&&clearTimeout(i)}})}}var nC=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},sC=class{constructor(e){var t,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;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");const n=this.fetch;let s=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{let o=null,a=null,l=null,u=i.status,c=i.statusText;if(i.ok){var d,f;if(r.method!=="HEAD"){var h;const m=await i.text();m===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((h=r.headers.get("Accept"))===null||h===void 0)&&h.includes("application/vnd.pgrst.plan+text"))?a=m:a=JSON.parse(m))}const g=(d=r.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),w=(f=i.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");g&&w&&w.length>1&&(l=parseInt(w[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(a)&&(a.length>1?(o={code:"PGRST116",details:`Results contain ${a.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},a=null,l=null,u=406,c="Not Acceptable"):a.length===1?a=a[0]:a=null)}else{var y;const g=await i.text();try{o=JSON.parse(g),Array.isArray(o)&&i.status===404&&(a=[],o=null,u=200,c="OK")}catch{i.status===404&&g===""?(u=204,c="No Content"):o={message:g}}if(o&&r.isMaybeSingle&&(!(o==null||(y=o.details)===null||y===void 0)&&y.includes("0 rows"))&&(o=null,u=200,c="OK"),o&&r.shouldThrowOnError)throw new nC(o)}return{error:o,data:a,count:l,status:u,statusText:c}});return this.shouldThrowOnError||(s=s.catch(i=>{var o;let a="";const l=i==null?void 0:i.cause;if(l){var u,c,d,f;const y=(u=l==null?void 0:l.message)!==null&&u!==void 0?u:"",g=(c=l==null?void 0:l.code)!==null&&c!==void 0?c:"";a=`${(d=i==null?void 0:i.name)!==null&&d!==void 0?d:"FetchError"}: ${i==null?void 0:i.message}`,a+=` Caused by: ${(f=l==null?void 0:l.name)!==null&&f!==void 0?f:"Error"}: ${y}`,g&&(a+=` (${g})`),l!=null&&l.stack&&(a+=` ${l.stack}`)}else{var h;a=(h=i==null?void 0:i.stack)!==null&&h!==void 0?h:""}return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:a,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}returns(){return this}overrideTypes(){return this}},iC=class extends sC{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),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:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const Bp=new RegExp("[,()]");var ss=class extends iC{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&Bp.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&Bp.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),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:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},oC=class{constructor(e,{headers:t={},schema:r,fetch:n}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},s=r?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),n&&l.append("Prefer",`count=${n}`),new ss({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),r||o.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(a.length>0){const l=[...new Set(a)].map(u=>`"${u}"`);i.searchParams.set("columns",l.join(","))}}return new ss({method:s,url:i,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;const o="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&a.searchParams.set("on_conflict",t),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){const c=[...new Set(u)].map(d=>`"${d}"`);a.searchParams.set("columns",c.join(","))}}return new ss({method:o,url:a,headers:l,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}update(e,{count:t}={}){var r;const n="PATCH",{url:s,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new ss({method:n,url:s,headers:i,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new ss({method:r,url:n,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},aC=class Rw{constructor(t,{headers:r={},schema:n,fetch:s}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.fetch=s}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new oC(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new Rw(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:n=!1,get:s=!1,count:i}={}){var o;let a;const l=new URL(`${this.url}/rpc/${t}`);let u;const c=h=>h!==null&&typeof h=="object"&&(!Array.isArray(h)||h.some(c)),d=n&&Object.values(r).some(c);d?(a="POST",u=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([h,y])=>y!==void 0).map(([h,y])=>[h,Array.isArray(y)?`{${y.join(",")}}`:`${y}`]).forEach(([h,y])=>{l.searchParams.append(h,y)})):(a="POST",u=r);const f=new Headers(this.headers);return d?f.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&f.set("Prefer",`count=${i}`),new ss({method:a,url:l,headers:f,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};class lC{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const s=n.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: import ws from "ws" new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const uC="2.90.1",cC=`realtime-js/${uC}`,Ow="1.0.0",dC="2.0.0",Vp=Ow,Xc=1e4,hC=1e3,fC=100;var jr;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(jr||(jr={}));var ke;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(ke||(ke={}));var Lt;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Lt||(Lt={}));var Zc;(function(e){e.websocket="websocket"})(Zc||(Zc={}));var bn;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(bn||(bn={}));class pC{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,r,n){var s,i;const o=t.topic,a=(s=t.ref)!==null&&s!==void 0?s:"",l=(i=t.join_ref)!==null&&i!==void 0?i:"",u=t.payload.event,c=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},d=Object.keys(c).length===0?"":JSON.stringify(c);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+u.length+d.length,h=new ArrayBuffer(this.HEADER_LENGTH+f);let y=new DataView(h),g=0;y.setUint8(g++,this.KINDS.userBroadcastPush),y.setUint8(g++,l.length),y.setUint8(g++,a.length),y.setUint8(g++,o.length),y.setUint8(g++,u.length),y.setUint8(g++,d.length),y.setUint8(g++,r),Array.from(l,m=>y.setUint8(g++,m.charCodeAt(0))),Array.from(a,m=>y.setUint8(g++,m.charCodeAt(0))),Array.from(o,m=>y.setUint8(g++,m.charCodeAt(0))),Array.from(u,m=>y.setUint8(g++,m.charCodeAt(0))),Array.from(d,m=>y.setUint8(g++,m.charCodeAt(0)));var w=new Uint8Array(h.byteLength+n.byteLength);return w.set(new Uint8Array(h),0),w.set(new Uint8Array(n),h.byteLength),w.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[s,i,o,a,l]=n;return r({join_ref:s,ref:i,topic:o,event:a,payload:l})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,s)}}_decodeUserBroadcast(t,r,n){const s=r.getUint8(1),i=r.getUint8(2),o=r.getUint8(3),a=r.getUint8(4);let l=this.HEADER_LENGTH+4;const u=n.decode(t.slice(l,l+s));l=l+s;const c=n.decode(t.slice(l,l+i));l=l+i;const d=n.decode(t.slice(l,l+o));l=l+o;const f=t.slice(l,t.byteLength),h=a===this.JSON_ENCODING?JSON.parse(n.decode(f)):f,y={type:this.BROADCAST_EVENT,event:c,payload:h};return o>0&&(y.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:y}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}class Aw{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var ie;(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"})(ie||(ie={}));const Wp=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=mC(o,e,t,s),i),{}):{}},mC=(e,t,r,n)=>{const s=t.find(a=>a.name===e),i=s==null?void 0:s.type,o=r[e];return i&&!n.includes(i)?Iw(i,o):ed(o)},Iw=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return wC(t,r)}switch(e){case ie.bool:return gC(t);case ie.float4:case ie.float8:case ie.int2:case ie.int4:case ie.int8:case ie.numeric:case ie.oid:return vC(t);case ie.json:case ie.jsonb:return yC(t);case ie.timestamp:return _C(t);case ie.abstime:case ie.date:case ie.daterange:case ie.int4range:case ie.int8range:case ie.money:case ie.reltime:case ie.text:case ie.time:case ie.timestamptz:case ie.timetz:case ie.tsrange:case ie.tstzrange:return ed(t);default:return ed(t)}},ed=e=>e,gC=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},vC=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},yC=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},wC=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let i;const o=e.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>Iw(t,a))}return e},_C=e=>typeof e=="string"?e.replace(" ","T"):e,jw=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class Ru{constructor(t,r,n={},s=Xc){this.channel=t,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var Hp;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Hp||(Hp={}));class Ii{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Ii.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=Ii.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(n.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Ii.syncDiff(this.state,s,i,o),a())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,s){const i=this.cloneDeep(t),o=this.transformState(r),a={},l={};return this.map(i,(u,c)=>{o[u]||(l[u]=c)}),this.map(o,(u,c)=>{const d=i[u];if(d){const f=c.map(w=>w.presence_ref),h=d.map(w=>w.presence_ref),y=c.filter(w=>h.indexOf(w.presence_ref)<0),g=d.filter(w=>f.indexOf(w.presence_ref)<0);y.length>0&&(a[u]=y),g.length>0&&(l[u]=g)}else a[u]=c}),this.syncDiff(i,{joins:a,leaves:l},n,s)}static syncDiff(t,r,n,s){const{joins:i,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(i,(a,l)=>{var u;const c=(u=t[a])!==null&&u!==void 0?u:[];if(t[a]=this.cloneDeep(l),c.length>0){const d=t[a].map(h=>h.presence_ref),f=c.filter(h=>d.indexOf(h.presence_ref)<0);t[a].unshift(...f)}n(a,c,l)}),this.map(o,(a,l)=>{let u=t[a];if(!u)return;const c=l.map(d=>d.presence_ref);u=u.filter(d=>c.indexOf(d.presence_ref)<0),t[a]=u,s(a,u,l),u.length===0&&delete t[a]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return"metas"in s?r[n]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):r[n]=s,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var qp;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(qp||(qp={}));var ji;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ji||(ji={}));var ar;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(ar||(ar={}));class ws{constructor(t,r={config:{}},n){var s,i;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=ke.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new Ru(this,Lt.join,this.params,this.timeout),this.rejoinTimer=new Aw(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ke.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=ke.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=ke.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ke.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=ke.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Lt.reply,{},(o,a)=>{this._trigger(this._replyEventName(a),o)}),this.presence=new Ii(this),this.broadcastEndpointURL=jw(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==ke.closed){const{config:{broadcast:o,presence:a,private:l}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(h=>h.filter))!==null&&s!==void 0?s:[],c=!!this.bindings[ji.PRESENCE]&&this.bindings[ji.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,d={},f={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(h=>t==null?void 0:t(ar.CHANNEL_ERROR,h)),this._onClose(()=>t==null?void 0:t(ar.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var y;if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){t==null||t(ar.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,w=(y=g==null?void 0:g.length)!==null&&y!==void 0?y:0,m=[];for(let p=0;p{this.state=ke.errored,t==null||t(ar.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(ar.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===ke.joined&&t===ji.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,r,n)}async httpSend(t,r,n={}){var s;if(r==null)return Promise.reject("Payload is required for httpSend()");const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;try{const u=await a.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(t,r={}){var n,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=t,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=ke.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Lt.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new Ru(this,Lt.leave,{},t),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=ke.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(i),o}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Ru(this,t,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>fC){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var s,i;const o=t.toLocaleLowerCase(),{close:a,error:l,leave:u,join:c}=Lt;if(n&&[a,l,u,c].indexOf(o)>=0&&n!==this._joinRef())return;let f=this._onMessage(o,r,n);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(h=>{var y,g,w;return((y=h.filter)===null||y===void 0?void 0:y.event)==="*"||((w=(g=h.filter)===null||g===void 0?void 0:g.event)===null||w===void 0?void 0:w.toLocaleLowerCase())===o}).map(h=>h.callback(f,n)):(i=this.bindings[o])===null||i===void 0||i.filter(h=>{var y,g,w,m,p,v,b,x;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in h){const E=h.id,S=(y=h.filter)===null||y===void 0?void 0:y.event;return E&&((g=r.ids)===null||g===void 0?void 0:g.includes(E))&&(S==="*"||(S==null?void 0:S.toLocaleLowerCase())===((w=r.data)===null||w===void 0?void 0:w.type.toLocaleLowerCase()))&&(!(!((m=h.filter)===null||m===void 0)&&m.table)||h.filter.table===((p=r.data)===null||p===void 0?void 0:p.table))}else{const E=(b=(v=h==null?void 0:h.filter)===null||v===void 0?void 0:v.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return E==="*"||E===((x=r==null?void 0:r.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===o}).map(h=>{if(typeof f=="object"&&"ids"in f){const y=f.data,{schema:g,table:w,commit_timestamp:m,type:p,errors:v}=y;f=Object.assign(Object.assign({},{schema:g,table:w,commit_timestamp:m,eventType:p,new:{},old:{},errors:v}),this._getPayloadRecords(y))}h.callback(f,n)})}_isClosed(){return this.state===ke.closed}_isJoined(){return this.state===ke.joined}_isJoining(){return this.state===ke.joining}_isLeaving(){return this.state===ke.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const s=t.toLocaleLowerCase(),i={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===n&&ws.isEqual(s.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Lt.close,{},t)}_onError(t){this._on(Lt.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ke.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=Wp(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=Wp(t.columns,t.old_record)),r}}const Ou=()=>{},Jo={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},bC=[1e3,2e3,5e3,1e4],xC=1e4,EC=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`;class SC{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Xc,this.transport=null,this.heartbeatIntervalMs=Jo.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Ou,this.ref=0,this.reconnectTimer=null,this.vsn=Vp,this.logger=Ou,this.conn=null,this.sendBuffer=[],this.serializer=new pC,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=s=>s?(...i)=>s(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${Zc.websocket}`,this.httpEndpoint=jw(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=lC.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r} To use Realtime in Node.js, you need to provide a WebSocket implementation: Option 1: Use Node.js 22+ which has native WebSocket support Option 2: Install and provide the "ws" package: npm install ws import ws from "ws" const client = new RealtimeClient(url, { ...options, transport: ws })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case jr.connecting:return bn.Connecting;case jr.open:return bn.Open;case jr.closing:return bn.Closing;default:return bn.Closed}}isConnected(){return this.connectionState()===bn.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new ws(`realtime:${t}`,r,this);return this.channels.push(i),i}}push(t){const{topic:r,event:n,payload:s,ref:i}=t,o=()=>{this.encode(t,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${r} ${n} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(hC,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Jo.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply"&&r.ref&&r.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",u)}catch(c){this.log("error","error in heartbeat callback",c)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:n,event:s,payload:i,ref:o}=r,a=o?`(${o})`:"",l=i.status||"";this.log("receive",`${l} ${n} ${s} ${a}`.trim(),i),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(s,i,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===jr.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===jr.open||this.conn.readyState===jr.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(Lt.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${t}${n}${s}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([EC],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const i={access_token:r,version:cC};r&&s.updateJoinPayload(i),s.joinedOnce&&s._isJoined()&&s._push(Lt.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new Aw(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Jo.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,s,i,o,a,l,u,c,d,f,h;switch(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:Xc,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:Jo.HEARTBEAT_INTERVAL,this.worker=(i=t==null?void 0:t.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(a=t==null?void 0:t.heartbeatCallback)!==null&&a!==void 0?a:Ou,this.vsn=(l=t==null?void 0:t.vsn)!==null&&l!==void 0?l:Vp,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:y=>bC[y-1]||xC,this.vsn){case Ow:this.encode=(c=t==null?void 0:t.encode)!==null&&c!==void 0?c:(y,g)=>g(JSON.stringify(y)),this.decode=(d=t==null?void 0:t.decode)!==null&&d!==void 0?d:(y,g)=>g(JSON.parse(y));break;case dC:this.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var no=class extends Error{constructor(e,t){var r;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)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function kC(e,t,r){const n=new URL(t,e);if(r)for(const[s,i]of Object.entries(r))i!==void 0&&n.searchParams.set(s,i);return n.toString()}async function TC(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 CC(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:o}){const a=kC(e.baseUrl,n,s),l=await TC(e.auth),u=await t(a,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):void 0}),c=await u.text(),d=(u.headers.get("content-type")||"").includes("application/json"),f=d&&c?JSON.parse(c):c;if(!u.ok){const h=d?f:void 0,y=h==null?void 0:h.error;throw new no((y==null?void 0:y.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:y==null?void 0:y.type,icebergCode:y==null?void 0:y.code,details:h})}return{status:u.status,headers:u.headers,data:f}}}}function Yo(e){return e.join("")}var PC=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Yo(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Yo(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Yo(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Yo(e.namespace)}`}),!0}catch(t){if(t instanceof no&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof no&&r.status===409)return;throw r}}};function Xn(e){return e.join("")}var RC=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof no&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof no&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},OC=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=CC({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new PC(this.client,t),this.tableOps=new RC(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},Ml=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function he(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var AC=class extends Ml{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},td=class extends Ml{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}};const kh=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),IC=()=>Response,rd=e=>{if(Array.isArray(e))return e.map(r=>rd(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[s]=rd(n)}),t},jC=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},NC=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function so(e){"@babel/helpers - typeof";return so=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},so(e)}function $C(e,t){if(so(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(so(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LC(e){var t=$C(e,"string");return so(t)=="symbol"?t:t+""}function DC(e,t,r){return(t=LC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function B(e){for(var t=1;t{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},MC=async(e,t,r)=>{e instanceof await IC()&&!(r!=null&&r.noResolveJson)?e.json().then(n=>{const s=e.status||500,i=(n==null?void 0:n.statusCode)||s+"";t(new AC(Au(n),s,i))}).catch(n=>{t(new td(Au(n),n))}):t(new td(Au(e),e))},UC=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?s:(jC(n)?(s.headers=B({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,t!=null&&t.duplex&&(s.duplex=t.duplex),B(B({},s),r))};async function xo(e,t,r,n,s,i){return new Promise((o,a)=>{e(r,UC(t,n,s,i)).then(l=>{if(!l.ok)throw l;return n!=null&&n.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>MC(l,a,n))})}async function io(e,t,r,n){return xo(e,"GET",t,r,n)}async function It(e,t,r,n,s){return xo(e,"POST",t,n,s,r)}async function nd(e,t,r,n,s){return xo(e,"PUT",t,n,s,r)}async function FC(e,t,r,n){return xo(e,"HEAD",t,B(B({},r),{},{noResolveJson:!0}),n)}async function Th(e,t,r,n,s){return xo(e,"DELETE",t,n,s,r)}var zC=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(he(t))return{data:null,error:t};throw t}}};let Nw;Nw=Symbol.toStringTag;var BC=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Nw]="BlobDownloadBuilder",this.promise=null}asStream(){return new zC(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(he(t))return{data:null,error:t};throw t}}};const VC={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Gp={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var WC=class{constructor(e,t={},r,n){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=kh(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,r,n){var s=this;try{let i;const o=B(B({},Gp),n);let a=B(B({},s.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers&&(a=B(B({},a),n.headers));const u=s._removeEmptyFolders(t),c=s._getFinalPath(u),d=await(e=="PUT"?nd:It)(s.fetch,`${s.url}/object/${c}`,i,B({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:u,id:d.Id,fullPath:d.Key},error:null}}catch(i){if(s.shouldThrowOnError)throw i;if(he(i))return{data:null,error:i};throw i}}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;const i=s._removeEmptyFolders(e),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let l;const u=B({upsert:Gp.upsert},n),c=B(B({},s.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType),{data:{path:i,fullPath:(await nd(s.fetch,a.toString(),l,{headers:c})).Key},error:null}}catch(l){if(s.shouldThrowOnError)throw l;if(he(l))return{data:null,error:l};throw l}}async createSignedUploadUrl(e,t){var r=this;try{let n=r._getFinalPath(e);const s=B({},r.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const i=await It(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(r.url+i.url),a=o.searchParams.get("token");if(!a)throw new Ml("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;try{return{data:await It(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}}async copy(e,t,r){var n=this;try{return{data:{path:(await It(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key},error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}}async createSignedUrl(e,t,r){var n=this;try{let s=n._getFinalPath(e),i=await It(n.fetch,`${n.url}/object/sign/${s}`,B({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:n.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${n.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}}async createSignedUrls(e,t,r){var n=this;try{const s=await It(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:s.map(o=>B(B({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${i}`):null})),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}}download(e,t){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),s=n?`?${n}`:"",i=this._getFinalPath(e),o=()=>io(this.fetch,`${this.url}/${r}/${i}${s}`,{headers:this.headers,noResolveJson:!0});return new BC(o,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);try{return{data:rd(await io(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await FC(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(he(n)&&n instanceof td){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],s=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";s!==""&&n.push(s);const i=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",o=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});o!==""&&n.push(o);let a=n.join("&");return a!==""&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}${a}`)}}}async remove(e){var t=this;try{return{data:await Th(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}}async list(e,t,r){var n=this;try{const s=B(B(B({},VC),t),{},{prefix:e||""});return{data:await It(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r),error:null}}catch(s){if(n.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}}async listV2(e,t){var r=this;try{const n=B({},e);return{data:await It(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}}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,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const $w="2.90.1",Lw={"X-Client-Info":`storage-js/${$w}`};var HC=class{constructor(e,t={},r,n){this.shouldThrowOnError=!1;const s=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),this.url=s.href.replace(/\/$/,""),this.headers=B(B({},Lw),t),this.fetch=kh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{const r=t.listBucketOptionsToQueryString(e);return{data:await io(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await io(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}}async createBucket(e,t={public:!1}){var r=this;try{return{data:await It(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}}async updateBucket(e,t){var r=this;try{return{data:await nd(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}}async emptyBucket(e){var t=this;try{return{data:await It(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await Th(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},qC=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=B(B({},Lw),t),this.fetch=kh(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await It(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}}async listBuckets(e){var t=this;try{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return{data:await io(t.fetch,s,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await Th(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}}from(e){var t=this;if(!NC(e))throw new Ml("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new OC({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}};const Ch={"X-Client-Info":`storage-js/${$w}`,"Content-Type":"application/json"};var Dw=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function at(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var Iu=class extends Dw{constructor(e,t,r){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},KC=class extends Dw{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};const Ph=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),GC=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Qp=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),QC=async(e,t,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(r!=null&&r.noResolveJson)){const n=e.status||500,s=e;if(typeof s.json=="function")s.json().then(i=>{const o=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||n+"";t(new Iu(Qp(i),n,o))}).catch(()=>{const i=n+"";t(new Iu(s.statusText||`HTTP ${n} error`,n,i))});else{const i=n+"";t(new Iu(s.statusText||`HTTP ${n} error`,n,i))}}else t(new KC(Qp(e),e))},JC=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return n?(GC(n)?(s.headers=B({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,B(B({},s),r)):s};async function YC(e,t,r,n,s,i){return new Promise((o,a)=>{e(r,JC(t,n,s,i)).then(l=>{if(!l.ok)throw l;if(n!=null&&n.noResolveJson)return l;const u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>o(l)).catch(l=>QC(l,a,n))})}async function lt(e,t,r,n,s){return YC(e,"POST",t,n,s,r)}var XC=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=B(B({},Ch),t),this.fetch=Ph(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await lt(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async getIndex(e,t){var r=this;try{return{data:await lt(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(at(n))return{data:null,error:n};throw n}}async listIndexes(e){var t=this;try{return{data:await lt(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async deleteIndex(e,t){var r=this;try{return{data:await lt(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{},error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(at(n))return{data:null,error:n};throw n}}},ZC=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=B(B({},Ch),t),this.fetch=Ph(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(e){var t=this;try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await lt(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async getVectors(e){var t=this;try{return{data:await lt(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async listVectors(e){var t=this;try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:await lt(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async queryVectors(e){var t=this;try{return{data:await lt(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async deleteVectors(e){var t=this;try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await lt(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}},eP=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=B(B({},Ch),t),this.fetch=Ph(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await lt(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await lt(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async listBuckets(e={}){var t=this;try{return{data:await lt(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await lt(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(at(r))return{data:null,error:r};throw r}}},tP=class extends eP{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new rP(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},rP=class extends XC{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,B(B({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,B(B({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new nP(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},nP=class extends ZC{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,B(B({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,B(B({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,B(B({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,B(B({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,B(B({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},sP=class extends HC{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new WC(this.url,this.headers,e,this.fetch)}get vectors(){return new tP(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new qC(this.url+"/iceberg",this.headers,this.fetch)}};const Mw="2.90.1",is=30*1e3,sd=3,ju=sd*is,iP="http://localhost:9999",oP="supabase.auth.token",aP={"X-Client-Info":`gotrue-js/${Mw}`},id="X-Supabase-Api-Version",Uw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},lP=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,uP=10*60*1e3;class oo extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function M(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class cP extends oo{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function dP(e){return M(e)&&e.name==="AuthApiError"}class xn extends oo{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class _r extends oo{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class st extends _r{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function hP(e){return M(e)&&e.name==="AuthSessionMissingError"}class Zn extends _r{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Xo extends _r{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Zo extends _r{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function fP(e){return M(e)&&e.name==="AuthImplicitGrantRedirectError"}class Jp extends _r{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class pP extends _r{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class od extends _r{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Nu(e){return M(e)&&e.name==="AuthRetryableFetchError"}class Yp extends _r{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class ad extends _r{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const rl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Xp=` \r=`.split(""),mP=(()=>{const e=new Array(128);for(let t=0;t=6;){const n=t.queue>>t.queuedBits-6&63;r(rl[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(rl[n]),t.queuedBits-=6}}function Fw(e,t,r){const n=mP[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function em(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{yP(o,n,r)};for(let o=0;o>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function vP(e,t){for(let r=0;r55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}gP(n,t)}}function yP(e,t,r){if(t.utf8seq===0){if(e<=127){r(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 new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function Os(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;st.push(r)),new Uint8Array(t)}function Tn(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>Zp(s,r,n)),Zp(null,r,n),t.join("")}function _P(e){return Math.round(Date.now()/1e3)+e}function bP(){return Symbol("auth-callback")}const je=()=>typeof window<"u"&&typeof document<"u",gn={tested:!1,writable:!1},zw=()=>{if(!je())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(gn.tested)return gn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),gn.tested=!0,gn.writable=!0}catch{gn.tested=!0,gn.writable=!1}return gn.writable};function xP(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,i)=>{t[i]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const Bw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),EP=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",os=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},vn=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Ie=async(e,t)=>{await e.removeItem(t)};class Ul{constructor(){this.promise=new Ul.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Ul.promiseConstructor=Promise;function $u(e){const t=e.split(".");if(t.length!==3)throw new ad("Invalid JWT structure");for(let n=0;n{setTimeout(()=>t(null),e)})}function kP(e,t){return new Promise((n,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){n(o);return}}catch(o){if(!t(i,o)){s(o);return}}})()})}function TP(e){return("0"+e.toString(16)).substr(-2)}function CP(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let i=0;i<56;i++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,TP).join("")}async function PP(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function RP(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await PP(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function es(e,t,r=!1){const n=CP();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await os(e,`${t}-code-verifier`,s);const i=await RP(n);return[i,n===i?"plain":"s256"]}const OP=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function AP(e){const t=e.headers.get(id);if(!t||!t.match(OP))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function IP(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function jP(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const NP=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ts(e){if(!NP.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Lu(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function $P(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}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(r,n,s)}})}function tm(e){return JSON.parse(JSON.stringify(e))}const _n=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),LP=[502,503,504];async function rm(e){var t;if(!EP(e))throw new od(_n(e),0);if(LP.includes(e.status))throw new od(_n(e),e.status);let r;try{r=await e.json()}catch(i){throw new xn(_n(i),i)}let n;const s=AP(e);if(s&&s.getTime()>=Uw["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Yp(_n(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new st}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new Yp(_n(r),e.status,r.weak_password.reasons);throw new cP(_n(r),e.status||500,n)}const DP=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function z(e,t,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[id]||(i[id]=Uw["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const o=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await MP(e,t,r+a,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function MP(e,t,r,n,s,i){const o=DP(t,n,s,i);let a;try{a=await e(r,Object.assign({},o))}catch(l){throw console.error(l),new od(_n(l),0)}if(a.ok||await rm(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await rm(l)}}function Rt(e){var t;let r=null;zP(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=_P(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function nm(e){const t=Rt(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((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Lr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function UP(e){return{data:e,error:null}}function FP(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=e,o=Dl(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function sm(e){return e}function zP(e){return e.access_token&&e.refresh_token&&e.expires_in}const Du=["global","local","others"];class BP{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=Bw(n),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)}}async signOut(t,r=Du[0]){if(Du.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Du.join(", ")}`);try{return await z(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(M(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await z(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Lr})}catch(n){if(M(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=Dl(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await z(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:FP,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(M(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await z(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Lr})}catch(r){if(M(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,i,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},c=await z(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:sm});if(c.error)throw c.error;const d=await c.json(),f=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(y.split(";")[1].split("=")[1]);u[`${w}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(M(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){ts(t);try{return await z(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Lr})}catch(r){if(M(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){ts(t);try{return await z(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Lr})}catch(n){if(M(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){ts(t);try{return await z(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Lr})}catch(n){if(M(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){ts(t.userId);try{const{data:r,error:n}=await z(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(M(r))return{data:null,error:r};throw r}}async _deleteFactor(t){ts(t.userId),ts(t.id);try{return{data:await z(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(M(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,s,i,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},c=await z(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:sm});if(c.error)throw c.error;const d=await c.json(),f=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(y.split(";")[1].split("=")[1]);u[`${w}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(M(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await z(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(M(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await z(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(M(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await z(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(M(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await z(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(M(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await z(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(M(r))return{data:null,error:r};throw r}}}function im(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const rs={debug:!!(globalThis&&zw()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Vw extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class VP extends Vw{}async function WP(e,t,r){rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),rs.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await r()}finally{rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new VP(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(rs.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function HP(){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 Ww(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function qP(e){return parseInt(e,16)}function KP(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function GP(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:u,scheme:c,uri:d,version:f}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const h=Ww(e.address),y=c?`${c}://${n}`:n,g=e.statement?`${e.statement} `:"",w=`${y} wants you to sign in with your Ethereum account: ${h} ${g}`;let m=`URI: ${d} Version: ${f} Chain ID: ${r}${o?` Nonce: ${o}`:""} Issued At: ${i.toISOString()}`;if(s&&(m+=` Expiration Time: ${s.toISOString()}`),a&&(m+=` Not Before: ${a.toISOString()}`),l&&(m+=` Request ID: ${l}`),u){let p=` Resources:`;for(const v of u){if(!v||typeof v!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${v}`);p+=` - ${v}`}m+=p}return`${w} ${m}`}class Ee extends Error{constructor({message:t,code:r,cause:n,name:s}){var i;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=s??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}}class nl extends Ee{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function QP({error:e,options:t}){var r,n,s;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ee({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Ee({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=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Ee({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Ee({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 Ee({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ee({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new Ee({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ee({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(Hw(o)){if(i.rp.id!==o)return new Ee({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ee({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Ee({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 Ee({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 Ee({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function JP({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ee({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ee({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(Hw(n)){if(r.rpId!==n)return new Ee({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ee({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ee({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 Ee({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class YP{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const XP=new YP;function ZP(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,s=Dl(e,["challenge","user","excludeCredentials"]),i=Os(t).buffer,o=Object.assign(Object.assign({},r),{id:Os(r.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(n&&n.length>0){a.excludeCredentials=new Array(n.length);for(let l=0;l0){i.allowCredentials=new Array(r.length);for(let o=0;os!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of e)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))n[i]=o;else if(r(o))n[i]=o;else if(t(o)){const a=n[i];t(a)?n[i]=sl(a,o):n[i]=sl(o)}else n[i]=o}return n}function aR(e,t){return sl(iR,e,t||{})}function lR(e,t){return sl(oR,e,t||{})}class uR{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:s},i){try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!o)return{data:null,error:a};const l=s??XP.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${n}`),u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=aR(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:c,error:d}=await nR({publicKey:u,signal:l});return c?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}case"request":{const u=lR(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:c,error:d}=await sR(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:l}));return c?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}}}catch(o){return M(o)?{data:null,error:o}:{data:null,error:new xn("Unexpected error in challenge",o)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new oo("rpId is required for WebAuthn authentication")};try{if(!om())return{data:null,error:new xn("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:i});if(!o)return{data:null,error:a};const{webauthn:l}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(o){return M(o)?{data:null,error:o}:{data:null,error:new xn("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new oo("rpId is required for WebAuthn registration")};try{if(!om())return{data:null,error:new xn("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(c=>{var d;return(d=c.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c==null?void 0:c.id}):void 0),{data:null,error:a};const{data:l,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:i});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(o){return M(o)?{data:null,error:o}:{data:null,error:new xn("Unexpected error in register",o)}}}}HP();const cR={url:iP,storageKey:oP,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:aP,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function am(e,t,r){return await r()}const ns={};class ao{get jwks(){var t,r;return(r=(t=ns[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){ns[this.storageKey]=Object.assign(Object.assign({},ns[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=ns[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){ns[this.storageKey]=Object.assign(Object.assign({},ns[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},cR),t);if(this.storageKey=i.storageKey,this.instanceID=(r=ao.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,ao.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&je()){const o=`${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(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new BP({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=Bw(i.fetch),this.lock=i.lock||am,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&je()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=WP:this.lock=am,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new uR(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:zw()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=im(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=im(this.memoryStorage)),je()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Mw}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(je()&&(r=xP(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),je()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),fP(i)){const l=(t=i.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return M(r)?this._returnResult({error:r}):this._returnResult({error:new xn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const i=await z(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:Rt}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(M(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var r,n,s;try{let i;if("email"in t){const{email:c,password:d,options:f}=t;let h=null,y=null;this.flowType==="pkce"&&([h,y]=await es(this.storage,this.storageKey)),i=await z(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:c,password:d,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:h,code_challenge_method:y},xform:Rt})}else if("phone"in t){const{phone:c,password:d,options:f}=t;i=await z(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},channel:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Rt})}else throw new Xo("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await Ie(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(await Ie(this.storage,`${this.storageKey}-code-verifier`),M(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let r;if("email"in t){const{email:i,password:o,options:a}=t;r=await z(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:nm})}else if("phone"in t){const{phone:i,password:o,options:a}=t;r=await z(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:nm})}else throw new Xo("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const i=new Zn;return this._returnResult({data:{user:null,session:null},error:i})}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:s})}catch(r){if(M(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,s,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,i,o,a,l,u,c,d,f;let h,y;if("message"in t)h=t.message,y=t.signature;else{const{chain:g,wallet:w,statement:m,options:p}=t;let v;if(je())if(typeof w=="object")v=w;else{const I=window;if("ethereum"in I&&typeof I.ethereum=="object"&&"request"in I.ethereum&&typeof I.ethereum.request=="function")v=I.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof w!="object"||!(p!=null&&p.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");v=w}const b=new URL((r=p==null?void 0:p.url)!==null&&r!==void 0?r:window.location.href),x=await v.request({method:"eth_requestAccounts"}).then(I=>I).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!x||x.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const E=Ww(x[0]);let S=(n=p==null?void 0:p.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!S){const I=await v.request({method:"eth_chainId"});S=qP(I)}const T={domain:b.host,address:E,statement:m,uri:b.href,version:"1",chainId:S,nonce:(s=p==null?void 0:p.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=p==null?void 0:p.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=p==null?void 0:p.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=p==null?void 0:p.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=p==null?void 0:p.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=p==null?void 0:p.signInWithEthereum)===null||c===void 0?void 0:c.resources};h=GP(T),y=await v.request({method:"personal_sign",params:[KP(h),E]})}try{const{data:g,error:w}=await z(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:y},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Rt});if(w)throw w;if(!g||!g.session||!g.user){const m=new Zn;return this._returnResult({data:{user:null,session:null},error:m})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:w})}catch(g){if(M(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,s,i,o,a,l,u,c,d,f,h;let y,g;if("message"in t)y=t.message,g=t.signature;else{const{chain:w,wallet:m,statement:p,options:v}=t;let b;if(je())if(typeof m=="object")b=m;else{const E=window;if("solana"in E&&typeof E.solana=="object"&&("signIn"in E.solana&&typeof E.solana.signIn=="function"||"signMessage"in E.solana&&typeof E.solana.signMessage=="function"))b=E.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof m!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=m}const x=new URL((r=v==null?void 0:v.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in b&&b.signIn){const E=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},v==null?void 0:v.signInWithSolana),{version:"1",domain:x.host,uri:x.href}),p?{statement:p}:null));let S;if(Array.isArray(E)&&E[0]&&typeof E[0]=="object")S=E[0];else if(E&&typeof E=="object"&&"signedMessage"in E&&"signature"in E)S=E;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in S&&"signature"in S&&(typeof S.signedMessage=="string"||S.signedMessage instanceof Uint8Array)&&S.signature instanceof Uint8Array)y=typeof S.signedMessage=="string"?S.signedMessage:new TextDecoder().decode(S.signedMessage),g=S.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in b)||typeof b.signMessage!="function"||!("publicKey"in b)||typeof b!="object"||!b.publicKey||!("toBase58"in b.publicKey)||typeof b.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${x.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...p?["",p,""]:[""],"Version: 1",`URI: ${x.href}`,`Issued At: ${(s=(n=v==null?void 0:v.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=v==null?void 0:v.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${v.signInWithSolana.notBefore}`]:[],...!((o=v==null?void 0:v.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${v.signInWithSolana.expirationTime}`]:[],...!((a=v==null?void 0:v.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${v.signInWithSolana.chainId}`]:[],...!((l=v==null?void 0:v.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${v.signInWithSolana.nonce}`]:[],...!((u=v==null?void 0:v.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${v.signInWithSolana.requestId}`]:[],...!((d=(c=v==null?void 0:v.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...v.signInWithSolana.resources.map(S=>`- ${S}`)]:[]].join(` `);const E=await b.signMessage(new TextEncoder().encode(y),"utf8");if(!E||!(E instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=E}}try{const{data:w,error:m}=await z(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:Tn(g)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Rt});if(m)throw m;if(!w||!w.session||!w.user){const p=new Zn;return this._returnResult({data:{user:null,session:null},error:p})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:m})}catch(w){if(M(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async _exchangeCodeForSession(t){const r=await vn(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new pP;const{data:i,error:o}=await z(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Rt});if(await Ie(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new Zn;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(await Ie(this.storage,`${this.storageKey}-code-verifier`),M(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:i,nonce:o}=t,a=await z(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Rt}),{data:l,error:u}=a;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const c=new Zn;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if(M(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,i,o;try{if("email"in t){const{email:a,options:l}=t;let u=null,c=null;this.flowType==="pkce"&&([u,c]=await es(this.storage,this.storageKey));const{error:d}=await z(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){const{phone:a,options:l}=t,{data:u,error:c}=await z(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:c})}throw new Xo("You must provide either an email or phone number.")}catch(a){if(await Ie(this.storage,`${this.storageKey}-code-verifier`),M(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(t){var r,n;try{let s,i;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,i=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:a}=await z(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Rt});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,u=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(M(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,i,o;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await es(this.storage,this.storageKey));const u=await z(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:l}),headers:this.headers,xform:UP});return!((i=u.data)===null||i===void 0)&&i.url&&je()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(a){if(await Ie(this.storage,`${this.storageKey}-code-verifier`),M(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new st;const{error:s}=await z(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(M(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:s,options:i}=t,{error:o}=await z(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:n,type:s,options:i}=t,{data:o,error:a}=await z(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a})}throw new Xo("You must provide either an email or phone number and a type")}catch(r){if(M(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await vn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await z(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Lr}):await this._useSession(async r=>{var n,s,i;const{data:o,error:a}=r;if(a)throw a;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new st}:await z(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:Lr})})}catch(r){if(M(r))return hP(r)&&(await this._removeSession(),await Ie(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:i}=n;if(i)throw i;if(!s.session)throw new st;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await es(this.storage,this.storageKey));const{data:u,error:c}=await z(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:Lr});if(c)throw c;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await Ie(this.storage,`${this.storageKey}-code-verifier`),M(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new st;const r=Date.now()/1e3;let n=r,s=!0,i=null;const{payload:o}=$u(t.access_token);if(o.exp&&(n=o.exp,s=n<=r),s){const{data:a,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(t.access_token);if(l)throw l;i={access_token:t.access_token,refresh_token:t.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,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(r){if(M(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:o,error:a}=r;if(a)throw a;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new st;const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(M(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!je())throw new Zo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Zo(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Jp("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Zo("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Jp("No code detected.");const{data:p,error:v}=await this._exchangeCodeForSession(t.code);if(v)throw v;const b=new URL(window.location.href);return b.searchParams.delete("code"),window.history.replaceState(window.history.state,"",b.toString()),{data:{session:p.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=t;if(!i||!a||!o||!u)throw new Zo("No session defined in URL");const c=Math.round(Date.now()/1e3),d=parseInt(a);let f=c+d;l&&(f=parseInt(l));const h=f-c;h*1e3<=is&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${d}s`);const y=f-d;c-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,f,c):c-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,f,c);const{data:g,error:w}=await this._getUser(i);if(w)throw w;const m={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:d,expires_at:f,refresh_token:o,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:m,redirectType:t.type},error:null})}catch(n){if(M(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await vn(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({error:i});const o=(n=s.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:a}=await this.admin.signOut(o,t);if(a&&!(dP(a)&&(a.status===404||a.status===401||a.status===403)))return this._returnResult({error:a})}return t!=="others"&&(await this._removeSession(),await Ie(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=bP(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await es(this.storage,this.storageKey,!0));try{return await z(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(await Ie(this.storage,`${this.storageKey}-code-verifier`),M(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:s}=await this._useSession(async i=>{var o,a,l,u,c;const{data:d,error:f}=i;if(f)throw f;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await z(this.fetch,"GET",h,{headers:this.headers,jwt:(c=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(s)throw s;return je()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(M(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:i}}=r;if(s)throw s;const{options:o,provider:a,token:l,access_token:u,nonce:c}=t,d=await z(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Rt}),{data:f,error:h}=d;return h?this._returnResult({data:{user:null,session:null},error:h}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Zn}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:h}))}catch(s){if(await Ie(this.storage,`${this.storageKey}-code-verifier`),M(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)throw o;return await z(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await kP(async s=>(s>0&&await SP(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await z(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Rt})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Nu(i)&&Date.now()+o-n{try{await a.callback(t,r)}catch(l){i.push(l)}});if(await Promise.all(o),i.length>0){for(let a=0;athis._autoRefreshTokenTick(),is);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/is);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${is}ms, refresh threshold is ${sd} ticks`),s<=sd&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Vw)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!je()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,o]=await es(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);s.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;return i?this._returnResult({data:null,error:i}):await z(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)return this._returnResult({data:null,error:o});const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:u}=await z(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?tR(t.webauthn.credential_response):rR(t.webauthn.credential_response)})}:{code:t.code}),{data:a,error:l}=await z(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=await z(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:ZP(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:eR(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){var t,r;const{data:{session:n},error:s}=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=$u(n.access_token);let o=null;i.aal&&(o=i.aal);let a=o;((r=(t=n.user.factors)===null||t===void 0?void 0:t.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(a="aal2");const u=i.amr||[];return{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await z(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new st})})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new st});const o=await z(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&je()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(M(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new st});const o=await z(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&je()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(M(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await z(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new st})})}catch(t){if(M(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await z(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new st})})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(a=>a.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(a=>a.kid===t),n&&this.jwks_cached_at+uP>s)return n;const{data:i,error:o}=await z(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,n=i.keys.find(a=>a.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:h,error:y}=await this.getSession();if(y||!h.session)return this._returnResult({data:null,error:y});n=h.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=$u(n);r!=null&&r.allowExpired||IP(i.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:h}=await this.getUser(n);if(h)throw h;return{data:{claims:i,header:s,signature:o},error:null}}const c=jP(s.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,o,wP(`${a}.${l}`)))throw new ad("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(n){if(M(n))return this._returnResult({data:null,error:n});throw n}}}ao.nextInstanceID={};const dR=ao,hR="2.90.1";let bi="";typeof Deno<"u"?bi="deno":typeof document<"u"?bi="web":typeof navigator<"u"&&navigator.product==="ReactNative"?bi="react-native":bi="node";const fR={"X-Client-Info":`supabase-js-${bi}/${hR}`},pR={headers:fR},mR={schema:"public"},gR={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},vR={};function lo(e){"@babel/helpers - typeof";return lo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lo(e)}function yR(e,t){if(lo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(lo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wR(e){var t=yR(e,"string");return lo(t)=="symbol"?t:t+""}function _R(e,t,r){return(t=wR(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ve(e){for(var t=1;te?(...t)=>e(...t):(...t)=>fetch(...t),xR=()=>Headers,ER=(e,t,r)=>{const n=bR(r),s=xR();return async(i,o)=>{var a;const l=(a=await t())!==null&&a!==void 0?a:e;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),n(i,ve(ve({},o),{},{headers:u}))}};function SR(e){return e.endsWith("/")?e:e+"/"}function kR(e,t){var r,n;const{db:s,auth:i,realtime:o,global:a}=e,{db:l,auth:u,realtime:c,global:d}=t,f={db:ve(ve({},l),s),auth:ve(ve({},u),i),realtime:ve(ve({},c),o),storage:{},global:ve(ve(ve({},d),a),{},{headers:ve(ve({},(r=d==null?void 0:d.headers)!==null&&r!==void 0?r:{}),(n=a==null?void 0:a.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function TR(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(SR(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var CR=class extends dR{constructor(e){super(e)}},PR=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const i=TR(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:mR,realtime:vR,auth:ve(ve({},gR),{},{storageKey:o}),global:pR},l=kR(r??{},a);if(this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(c,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=ER(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(ve({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&this.accessToken().then(c=>this.realtime.setAuth(c)).catch(c=>console.warn("Failed to set initial Realtime auth token:",c)),this.rest=new aC(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new sP(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new rC(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:o,lock:a,debug:l,throwOnError:u},c,d){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new CR({url:this.authUrl.href,headers:ve(ve({},f),c),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new SC(this.realtimeUrl.href,ve(ve({},e),{},{params:ve(ve({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const RR=(e,t,r)=>new PR(e,t,r);function OR(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}OR()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const AR="lovable-preview-auth:result";function IR(e,t){return typeof e!="object"||e===null||!("type"in e)||e.type!==AR||!("requestId"in e)||e.requestId!==t?null:{ok:"ok"in e&&!!e.ok,value:"value"in e&&typeof e.value=="string"?e.value:null}}function jR(){try{const e=localStorage;return e.getItem("__lovable_storage_probe__"),e}catch{return}}function NR(){var p,v,b;if(typeof window>"u")return;const e=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(x=>e===x||e.endsWith("."+x)),n="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",s=r?((p=new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i").exec(e))==null?void 0:p[1])??((v=new RegExp("^live--("+n+")(?:-thr_[a-z0-9]+)?(?=\\.|$)","i").exec(e))==null?void 0:v[1])??((b=new RegExp("^("+n+")(?=[.-])","i").exec(e))==null?void 0:b[1]):void 0,i=window.parent;if(!s||!(i!==null&&i!==window))return jR();const a=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=a?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,u=location.ancestorOrigins,c=(u==null?void 0:u[0])??(document.referrer?new URL(document.referrer).origin:""),d=c&&l.test(c)?[c]:a?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],f=2e3,h=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),y=(x,E,S)=>new Promise(T=>{const I=h();let j=!1;const F=W=>{j||(j=!0,clearTimeout(J),window.removeEventListener("message",L),T(W))},L=W=>{if(!d.includes(W.origin))return;const V=IR(W.data,I);V&&F(V)};window.addEventListener("message",L);const J=setTimeout(()=>{F(null)},f),N={type:x,requestId:I,projectId:s,key:E};S!==void 0&&(N.value=S);for(const W of d)window.parent.postMessage(N,W)});let g=!0;const w=250,m=x=>{try{return localStorage.getItem(x)}catch{return}};return{getItem:async x=>{const E=m(x);let S=await y("lovable-preview-auth:get",x,E??void 0);if(!S&&g&&(await new Promise(T=>setTimeout(T,w)),S=await y("lovable-preview-auth:get",x,E??void 0)),g=!1,S!=null&&S.ok&&S.value!==null){if(S.value===""){if(E!==void 0&&m(x)===E)try{localStorage.removeItem(x)}catch{}return null}if(E===null&&m(x)===null)try{localStorage.setItem(x,S.value)}catch{}return S.value}return m(x)??null},setItem:(x,E)=>{try{localStorage.setItem(x,E)}catch{}return y("lovable-preview-auth:set",x,E).then(S=>{if(S!=null&&S.ok&&S.value!==null&&m(x)===E)try{S.value===""?localStorage.removeItem(x):localStorage.setItem(x,S.value)}catch{}})},removeItem:x=>{const E=m(x);try{localStorage.removeItem(x)}catch{}return y("lovable-preview-auth:remove",x,E??void 0).then(()=>{})}}}const $R="https://falvykzbpvelbidliptt.supabase.co",LR="sb_publishable_9U8FVLpxnCOJF9riG89vxg_eJ7CtiZd",um=RR($R,LR,{auth:{storage:NR(),persistSession:!0,autoRefreshToken:!0}}),Rh="content-admin-session",il="content-admin-session-changed";function DR(){try{const e=JSON.parse(sessionStorage.getItem(Rh)??"null");return typeof(e==null?void 0:e.token)!="string"||typeof(e==null?void 0:e.expiresAt)!="number"||e.expiresAt<=Date.now()?null:e}catch{return null}}function MR(e){sessionStorage.setItem(Rh,JSON.stringify(e)),sessionStorage.removeItem("admin-gate"),window.dispatchEvent(new Event(il))}function qw(){sessionStorage.removeItem(Rh),sessionStorage.removeItem("admin-gate"),window.dispatchEvent(new Event(il))}const ea=({title:e="ניהול תוכן",children:t})=>{const[r,n]=_.useState(!1),[s,i]=_.useState(""),[o,a]=_.useState(""),[l,u]=_.useState(!0),[c,d]=_.useState(!1);_.useEffect(()=>{let h=!0,y;const g=async()=>{y&&clearTimeout(y);const w=DR();if(!w){h&&(n(!1),u(!1));return}const{data:m,error:p}=await um.functions.invoke("content-admin",{body:{action:"check"},headers:{"x-admin-session":w.token}});h&&(n(!p&&(m==null?void 0:m.ok)===!0),u(!1),!p&&(m==null?void 0:m.ok)===!0&&(y=setTimeout(qw,Math.max(0,w.expiresAt-Date.now()))))};return g(),window.addEventListener(il,g),()=>{h=!1,y&&clearTimeout(y),window.removeEventListener(il,g)}},[]);const f=async h=>{h.preventDefault(),d(!0),a("");try{const{data:y,error:g}=await um.functions.invoke("content-admin",{body:{action:"login",password:s}});if(g){const w=g.context,m=w instanceof Response?await w.json().catch(()=>null):null;throw new Error(typeof(m==null?void 0:m.error)=="string"?m.error:"הכניסה נכשלה. נסו שוב.")}if(typeof(y==null?void 0:y.token)!="string"||typeof(y==null?void 0:y.expiresAt)!="number")throw new Error("הכניסה נכשלה");MR({token:y.token,expiresAt:y.expiresAt}),i(""),n(!0)}catch(y){a(y instanceof Error?y.message:"הכניסה נכשלה")}finally{d(!1)}};return l?k.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:k.jsx(lp,{"aria-label":"בודק גישה",className:"size-6 animate-spin text-primary"})}):r?k.jsx(k.Fragment,{children:t}):k.jsx("div",{dir:"rtl",className:"min-h-screen bg-background flex items-center justify-center p-4",children:k.jsxs(_w,{className:"w-full max-w-md",children:[k.jsxs(bw,{className:"text-center",children:[k.jsx("div",{className:"mx-auto mb-3 w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:k.jsx(uE,{className:"w-6 h-6 text-primary"})}),k.jsx(xw,{children:e}),k.jsx(Ew,{children:"נדרשת סיסמה לצפייה בעמוד זה"})]}),k.jsx(Sw,{children:k.jsxs("form",{onSubmit:f,className:"space-y-4",children:[k.jsxs("div",{className:"space-y-2",children:[k.jsx(Pw,{htmlFor:"gate-password",children:"סיסמה"}),k.jsx(kw,{id:"gate-password",type:"password",value:s,onChange:h=>{i(h.target.value),a("")},required:!0,autoComplete:"current-password",disabled:c,autoFocus:!0,dir:"ltr"}),o&&k.jsx("p",{role:"alert",className:"text-sm text-destructive",children:o})]}),k.jsxs(tl,{type:"submit",className:"w-full",disabled:c,children:[c&&k.jsx(lp,{className:"size-4 animate-spin"}),"כניסה"]})]})})]})})},UR=[{to:"/articles-admin",label:"ניהול מאמרים"},{to:"/enforcement-admin",label:"סורק אכיפה"},{to:"/videos",label:"סרטונים"},{to:"/telegram",label:"טלגרם"},{to:"/",label:"לאתר"}],ta=()=>{const{pathname:e}=ri();return k.jsx("nav",{dir:"rtl",className:"sticky top-0 z-50 bg-card/95 backdrop-blur border-b border-border",children:k.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-2 flex flex-wrap gap-1",children:[UR.map(t=>k.jsx(tl,{variant:e===t.to?"default":"ghost",size:"sm",className:e===t.to?"":"text-foreground",asChild:!0,children:k.jsx(BT,{to:t.to,end:!0,children:t.label})},t.to)),k.jsxs(tl,{variant:"ghost",size:"sm",className:"mr-auto",onClick:qw,children:[k.jsx(cE,{className:"size-4"}),"יציאה"]})]})})},FR=_.lazy(()=>Re(()=>import("./Index-D-x4SilX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),zR=_.lazy(()=>Re(()=>import("./Experts-Cel5CujM.js"),__vite__mapDeps([20,1,2,3,4,18,21,19,6,22,23,11,5,10]))),BR=_.lazy(()=>Re(()=>import("./Articles-CZGV0QIS.js"),__vite__mapDeps([24,1,2,3,4,18,21,25,26,27,28,15,29,14,30,31,32,33,34,35,9,36,19,11,23,6]))),VR=_.lazy(()=>Re(()=>import("./CamerasInWorkplace-ClpFJCNE.js"),__vite__mapDeps([37,1,2,3,4,18,26,21,38,6,19,36,23,11,7,5,8,39,35,40]))),WR=_.lazy(()=>Re(()=>import("./DpoRequirement-B7EPFlie.js"),__vite__mapDeps([41,1,2,3,4,21,38,6,19,42,22,5,35,43]))),HR=_.lazy(()=>Re(()=>import("./BoardResponsibilities-DKqZ4pJX.js"),__vite__mapDeps([44,1,2,3,4,18,21,38,6,19,36,23,11,34,42,22,43,5,35,40]))),qR=_.lazy(()=>Re(()=>import("./GeneratedArticle-Bct9WU_S.js"),__vite__mapDeps([45,1,2,3,4,18,21,19,38,6,46,36,23,35,43,8,7]))),KR=_.lazy(()=>Re(()=>import("./Organizations-CYvWKKtM.js"),__vite__mapDeps([47,1,2,3,4,18,17,21,19,6,48,39,11,22]))),GR=_.lazy(()=>Re(()=>import("./Webinar-DOcdrWxm.js"),__vite__mapDeps([49,1,2,3,4,28,15,29,14,30,19,16,23,42,50,22]))),QR=_.lazy(()=>Re(()=>import("./Fines-C3hKDAOp.js"),__vite__mapDeps([51,1,2,3,4,21,25,26,27,28,15,29,14,30,31,32,33,34,35,9,36,19,40]))),JR=_.lazy(()=>Re(()=>import("./Pricing-DX2mi7Bn.js"),__vite__mapDeps([52,1,2,3,4,18,21,19,53,30]))),YR=_.lazy(()=>Re(()=>import("./PreviewSMB-DCbRPgqv.js"),__vite__mapDeps([54,1,2,3,4,18,19,12,13,14,15,17,5,6,42,43,11,22,9,55,48,56,30,53,34]))),XR=_.lazy(()=>Re(()=>import("./Telegram-C0iAcRrb.js"),__vite__mapDeps([57,58,27,59,14,15,26,13,28,29,3,4,30,35,11,56,39,60,55,61,50,23,32]))),ZR=_.lazy(()=>Re(()=>import("./ThankYou-X8-7__dm.js"),__vite__mapDeps([62,1,2,3,4,42,6]))),eO=_.lazy(()=>Re(()=>import("./Videos-BAulUT_-.js"),__vite__mapDeps([63,58,64,27,59,14,15,28,29,3,4,30,26,61,32,60]))),tO=_.lazy(()=>Re(()=>import("./ArticlesAdmin-tRXPsotK.js"),__vite__mapDeps([65,58,64,27,26,14,29,2,3,46,11,56,61,35,6]))),rO=_.lazy(()=>Re(()=>import("./EnforcementAdmin-t0WJG-bc.js"),__vite__mapDeps([66,58,27,59,14,15,33,35,42,8,11]))),nO=_.lazy(()=>Re(()=>import("./Breaches-DTYSJRY5.js"),__vite__mapDeps([67,1,2,3,4,27,59,14,15,31,50,33,43,36,35]))),sO=_.lazy(()=>Re(()=>import("./NotFound-DprAVNiK.js"),__vite__mapDeps([68,19]))),iO=new Uk,oO=()=>k.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:k.jsx("div",{className:"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin"})}),aO=()=>k.jsx(zk,{client:iO,children:k.jsxs(YE,{attribute:"class",defaultTheme:"dark",enableSystem:!1,children:[k.jsx(GT,{}),k.jsxs(mk,{children:[k.jsx(KE,{}),k.jsx(RS,{}),k.jsx(MT,{children:k.jsx(_.Suspense,{fallback:k.jsx(oO,{}),children:k.jsxs(OT,{children:[k.jsx(xe,{path:"/",element:k.jsx(FR,{})}),k.jsx(xe,{path:"/experts",element:k.jsx(zR,{})}),k.jsx(xe,{path:"/articles",element:k.jsx(BR,{})}),k.jsx(xe,{path:"/articles/cameras-in-workplace",element:k.jsx(VR,{})}),k.jsx(xe,{path:"/articles/dpo-requirement",element:k.jsx(WR,{})}),k.jsx(xe,{path:"/articles/board-responsibilities",element:k.jsx(HR,{})}),k.jsx(xe,{path:"/articles/:slug",element:k.jsx(qR,{})}),k.jsx(xe,{path:"/organizations",element:k.jsx(KR,{})}),k.jsx(xe,{path:"/webinar",element:k.jsx(GR,{})}),k.jsx(xe,{path:"/fines",element:k.jsx(QR,{})}),k.jsx(xe,{path:"/pricing",element:k.jsx(JR,{})}),k.jsx(xe,{path:"/preview-smb",element:k.jsx(YR,{})}),k.jsx(xe,{path:"/thank-you",element:k.jsx(ZR,{})}),k.jsx(xe,{path:"/telegram",element:k.jsxs(ea,{children:[k.jsx(ta,{}),k.jsx(XR,{})]})}),k.jsx(xe,{path:"/videos",element:k.jsxs(ea,{children:[k.jsx(ta,{}),k.jsx(eO,{})]})}),k.jsx(xe,{path:"/articles-admin",element:k.jsxs(ea,{children:[k.jsx(ta,{}),k.jsx(tO,{})]})}),k.jsx(xe,{path:"/enforcement-admin",element:k.jsxs(ea,{children:[k.jsx(ta,{}),k.jsx(rO,{})]})}),k.jsx(xe,{path:"/breaches",element:k.jsx(nO,{})}),k.jsx(xe,{path:"*",element:k.jsx(sO,{})})]})})})]})]})});Iv(document.getElementById("root")).render(k.jsx(Uv,{children:k.jsx(aO,{})}));export{uO as $,nn as A,tl as B,_w as C,B1 as D,My as E,Q1 as F,yo as G,nh as H,kw as I,J1 as J,Y1 as K,uE as L,rn as M,fO as N,qv as O,Ye as P,Wa as Q,R,cO as S,Av as T,Dl as U,Ux as V,bO as W,dE as X,DR as Y,qw as Z,Up as _,_O as a,JE as a0,ri as a1,Pm as a2,yO as b,Tl as c,Sw as d,zT as e,hx as f,Pw as g,bw as h,xw as i,k as j,_x as k,El as l,Lx as m,Bt as n,Ce as o,We as p,pT as q,_ as r,um as s,wO as t,vO as u,hO as v,lh as w,lp as x,Ew as y,sh as z};