vendor: 6,672 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PodcastProcessor-Cnfi5M7T.js","assets/textarea-C_VLKFoe.js","assets/tabs-B5Cf0Dlf.js","assets/progress-BmlObRjf.js","assets/index-CNTLcjq1.js","assets/scroll-area-DPKQdmBO.js","assets/send-C1QLCXIU.js","assets/PodbitesLogo-uaubAC_G.js","assets/Dashboard-LcRdtOKC.js","assets/Social-DG2Wt2Ek.js","assets/PostCard-BMJOfP20.js","assets/select-DIAclx9l.js","assets/target-BGpPpgJy.js","assets/UserProfile-CpdOuwVQ.js","assets/MessageThread-Nnjn1fT8.js","assets/arrow-left-CQTIRMbM.js","assets/Settings-BxECdJvg.js","assets/YouTubeAnalyzer-2LEvL1DO.js","assets/calendar-NPomsjoX.js","assets/Growth-D2X2e7Dx.js","assets/Manifesto-1F7vlDVS.js"])))=>i.map(i=>d[i]); 2var aS=Object.defineProperty;var lS=(e,t,r)=>t in e?aS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Fn=(e,t,r)=>lS(e,typeof t!="symbol"?t+"":t,r);function cS(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>n[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 o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var M$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ds(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tv={exports:{}},$l={},rv={exports:{}},te={};/** 3 * @license React 4 * react.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var gi=Symbol.for("react.element"),uS=Symbol.for("react.portal"),dS=Symbol.for("react.fragment"),fS=Symbol.for("react.strict_mode"),hS=Symbol.for("react.profiler"),pS=Symbol.for("react.provider"),mS=Symbol.for("react.context"),gS=Symbol.for("react.forward_ref"),vS=Symbol.for("react.suspense"),yS=Symbol.for("react.memo"),wS=Symbol.for("react.lazy"),ip=Symbol.iterator;function bS(e){return e===null||typeof e!="object"?null:(e=ip&&e[ip]||e["@@iterator"],typeof e=="function"?e:null)}var nv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sv=Object.assign,ov={};function Ms(e,t,r){this.props=e,this.context=t,this.refs=ov,this.updater=r||nv}Ms.prototype.isReactComponent={};Ms.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")};Ms.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function iv(){}iv.prototype=Ms.prototype;function vf(e,t,r){this.props=e,this.context=t,this.refs=ov,this.updater=r||nv}var yf=vf.prototype=new iv;yf.constructor=vf;sv(yf,Ms.prototype);yf.isPureReactComponent=!0;var ap=Array.isArray,av=Object.prototype.hasOwnProperty,wf={current:null},lv={key:!0,ref:!0,__self:!0,__source:!0};function cv(e,t,r){var n,s={},o=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)av.call(t,n)&&!lv.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return{$$typeof:gi,type:e,key:o,ref:i,props:s,_owner:wf.current}}function xS(e,t){return{$$typeof:gi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function bf(e){return typeof e=="object"&&e!==null&&e.$$typeof===gi}function _S(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var lp=/\/+/g;function $c(e,t){return typeof e=="object"&&e!==null&&e.key!=null?_S(""+e.key):t.toString(36)}function _a(e,t,r,n,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case gi:case uS:i=!0}}if(i)return i=e,s=s(i),e=n===""?"."+$c(i,0):n,ap(s)?(r="",e!=null&&(r=e.replace(lp,"$&/")+"/"),_a(s,t,r,"",function(c){return c})):s!=null&&(bf(s)&&(s=xS(s,r+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(lp,"$&/")+"/")+e)),t.push(s)),1;if(i=0,n=n===""?".":n+":",ap(e))for(var a=0;a<e.length;a++){o=e[a];var l=n+$c(o,a);i+=_a(o,t,r,l,s)}else if(l=bS(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=n+$c(o,a++),i+=_a(o,t,r,l,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Li(e,t,r){if(e==null)return e;var n=[],s=0;return _a(e,n,"","",function(o){return t.call(r,o,s++)}),n}function SS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Qe={current:null},Sa={transition:null},ES={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:Sa,ReactCurrentOwner:wf};function uv(){throw Error("act(...) is not supported in production builds of React.")}te.Children={map:Li,forEach:function(e,t,r){Li(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Li(e,function(){t++}),t},toArray:function(e){return Li(e,function(t){return t})||[]},only:function(e){if(!bf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};te.Component=Ms;te.Fragment=dS;te.Profiler=hS;te.PureComponent=vf;te.StrictMode=fS;te.Suspense=vS;
vendor: 5,221 bytes, lines 10-26
10te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ES;te.act=uv;te.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=sv({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=wf.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)av.call(t,l)&&!lv.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];n.children=a}return{$$typeof:gi,type:e.type,key:s,ref:o,props:n,_owner:i}};te.createContext=function(e){return e={$$typeof:mS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:pS,_context:e},e.Consumer=e};te.createElement=cv;te.createFactory=function(e){var t=cv.bind(null,e);return t.type=e,t};te.createRef=function(){return{current:null}};te.forwardRef=function(e){return{$$typeof:gS,render:e}};te.isValidElement=bf;te.lazy=function(e){return{$$typeof:wS,_payload:{_status:-1,_result:e},_init:SS}};te.memo=function(e,t){return{$$typeof:yS,type:e,compare:t===void 0?null:t}};te.startTransition=function(e){var t=Sa.transition;Sa.transition={};try{e()}finally{Sa.transition=t}};te.unstable_act=uv;te.useCallback=function(e,t){return Qe.current.useCallback(e,t)};te.useContext=function(e){return Qe.current.useContext(e)};te.useDebugValue=function(){};te.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};te.useEffect=function(e,t){return Qe.current.useEffect(e,t)};te.useId=function(){return Qe.current.useId()};te.useImperativeHandle=function(e,t,r){return Qe.current.useImperativeHandle(e,t,r)};te.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};te.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};te.useMemo=function(e,t){return Qe.current.useMemo(e,t)};te.useReducer=function(e,t,r){return Qe.current.useReducer(e,t,r)};te.useRef=function(e){return Qe.current.useRef(e)};te.useState=function(e){return Qe.current.useState(e)};te.useSyncExternalStore=function(e,t,r){return Qe.current.useSyncExternalStore(e,t,r)};te.useTransition=function(){return Qe.current.useTransition()};te.version="18.3.1";rv.exports=te;var h=rv.exports;const I=Ds(h),kS=cS({__proto__:null,default:I},[h]);/** 11 * @license React 12 * react-jsx-runtime.production.min.js 13 * 14 * Copyright (c) Facebook, Inc. and its affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var CS=h,TS=Symbol.for("react.element"),RS=Symbol.for("react.fragment"),PS=Object.prototype.hasOwnProperty,AS=CS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,NS={key:!0,ref:!0,__self:!0,__source:!0};function dv(e,t,r){var n,s={},o=null,i=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)PS.call(t,n)&&!NS.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:TS,type:e,key:o,ref:i,props:s,_owner:AS.current}}$l.Fragment=RS;$l.jsx=dv;$l.jsxs=dv;tv.exports=$l;var p=tv.exports,fv={exports:{}},vt={},hv={exports:{}},pv={};/** 19 * @license React 20 * scheduler.production.min.js 21 * 22 * Copyright (c) Facebook, Inc. and its affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */(function(e){function t(C,R){var $=C.length;C.push(R);e:for(;0<$;){var D=$-1>>>1,A=C[D];if(0<s(A,R))C[D]=R,C[$]=A,$=D;else break e}}function r(C){return C.length===0?null:C[0]}function n(C){if(C.length===0)return null;var R=C[0],$=C.pop();if($!==R){C[0]=$;e:for(var D=0,A=C.length,J=A>>>1;D<J;){var ie=2*(D+1)-1,Be=C[ie],re=ie+1,Ne=C[re];if(0>s(Be,$))re<A&&0>s(Ne,Be)?(C[D]=Ne,C[re]=$,D=re):(C[D]=Be,C[ie]=$,D=ie);else if(re<A&&0>s(Ne,$))C[D]=Ne,C[re]=$,D=re;else break e}}return R}function s(C,R){var $=C.sortIndex-R.sortIndex;return $!==0?$:C.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],c=[],u=1,f=null,d=3,m=!1,v=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(C){for(var R=r(c);R!==null;){if(R.callback===null)n(c);else if(R.startTime<=C)n(c),R.sortIndex=R.expirationTime,t(l,R);else break;R=r(c)}}function _(C){if(g=!1,b(C),!v)if(r(l)!==null)v=!0,H(S);else{var R=r(c);R!==null&&X(_,R.startTime-C)}}function S(C,R){v=!1,g&&(g=!1,y(T),T=-1),m=!0;var $=d;try{for(b(R),f=r(l);f!==null&&(!(f.expirationTime>R)||C&&!O());){var D=f.callback;if(typeof D=="function"){f.callback=null,d=f.priorityLevel;var A=D(f.expirationTime<=R);R=e.unstable_now(),typeof A=="function"?f.callback=A:f===r(l)&&n(l),b(R
vendor: 7,795 bytes, lines 26-34
26)}else n(l);f=r(l)}if(f!==null)var J=!0;else{var ie=r(c);ie!==null&&X(_,ie.startTime-R),J=!1}return J}finally{f=null,d=$,m=!1}}var k=!1,E=null,T=-1,N=5,P=-1;function O(){return!(e.unstable_now()-P<N)}function F(){if(E!==null){var C=e.unstable_now();P=C;var R=!0;try{R=E(!0,C)}finally{R?K():(k=!1,E=null)}}else k=!1}var K;if(typeof w=="function")K=function(){w(F)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,V=L.port2;L.port1.onmessage=F,K=function(){V.postMessage(null)}}else K=function(){x(F,0)};function H(C){E=C,k||(k=!0,K())}function X(C,R){T=x(function(){C(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,H(S))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(C){switch(d){case 1:case 2:case 3:var R=3;break;default:R=d}var $=d;d=R;try{return C()}finally{d=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,R){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var $=d;d=C;try{return R()}finally{d=$}},e.unstable_scheduleCallback=function(C,R,$){var D=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?D+$:D):$=D,C){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=$+A,C={id:u++,callback:R,priorityLevel:C,startTime:$,expirationTime:A,sortIndex:-1},$>D?(C.sortIndex=$,t(c,C),r(l)===null&&C===r(c)&&(g?(y(T),T=-1):g=!0,X(_,$-D))):(C.sortIndex=A,t(l,C),v||m||(v=!0,H(S))),C},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(C){var R=d;return function(){var $=d;d=R;try{return C.apply(this,arguments)}finally{d=$}}}})(pv);hv.exports=pv;var OS=hv.exports;/** 27 * @license React 28 * react-dom.production.min.js 29 * 30 * Copyright (c) Facebook, Inc. and its affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var jS=h,gt=OS;function j(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var mv=new Set,Fo={};function Pn(e,t){Cs(e,t),Cs(e+"Capture",t)}function Cs(e,t){for(Fo[e]=t,e=0;e<t.length;e++)mv.add(t[e])}var wr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wu=Object.prototype.hasOwnProperty,IS=/^[: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]*$/,cp={},up={};function LS(e){return Wu.call(up,e)?!0:Wu.call(cp,e)?!1:IS.test(e)?up[e]=!0:(cp[e]=!0,!1)}function DS(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 MS(e,t,r,n){if(t===null||typeof t>"u"||DS(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 Ze(e,t,r,n,s,o,i){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=o,this.removeEmptyString=i}var Fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fe[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fe[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fe[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fe[e]=new Ze(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){Fe[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fe[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fe[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fe[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fe[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var xf=/[\-:]([a-z])/g;function _f(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(xf,_f);Fe[t]=new Ze(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(xf,_f);Fe[t]=new Ze(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(xf,_f);Fe[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fe[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Fe.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fe[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Sf(e,t,r,n){var s=Fe.hasOwnProperty(t)?Fe[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(MS(t,r,s,n)&&(r=null),n||s===null?LS(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}
vendor: 15,291 bytes, lines 34-38
34var Cr=jS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Di=Symbol.for("react.element"),ts=Symbol.for("react.portal"),rs=Symbol.for("react.fragment"),Ef=Symbol.for("react.strict_mode"),Hu=Symbol.for("react.profiler"),gv=Symbol.for("react.provider"),vv=Symbol.for("react.context"),kf=Symbol.for("react.forward_ref"),Vu=Symbol.for("react.suspense"),Ku=Symbol.for("react.suspense_list"),Cf=Symbol.for("react.memo"),Ir=Symbol.for("react.lazy"),yv=Symbol.for("react.offscreen"),dp=Symbol.iterator;function eo(e){return e===null||typeof e!="object"?null:(e=dp&&e[dp]||e["@@iterator"],typeof e=="function"?e:null)}var we=Object.assign,Uc;function vo(e){if(Uc===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Uc=t&&t[1]||""}return` 35`+Uc+e}var Fc=!1;function zc(e,t){if(!e||Fc)return"";Fc=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var s=c.stack.split(` 36`),o=n.stack.split(` 37`),i=s.length-1,a=o.length-1;1<=i&&0<=a&&s[i]!==o[a];)a--;for(;1<=i&&0<=a;i--,a--)if(s[i]!==o[a]){if(i!==1||a!==1)do if(i--,a--,0>a||s[i]!==o[a]){var l=` 38`+s[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{Fc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?vo(e):""}function $S(e){switch(e.tag){case 5:return vo(e.type);case 16:return vo("Lazy");case 13:return vo("Suspense");case 19:return vo("SuspenseList");case 0:case 2:case 15:return e=zc(e.type,!1),e;case 11:return e=zc(e.type.render,!1),e;case 1:return e=zc(e.type,!0),e;default:return""}}function qu(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 rs:return"Fragment";case ts:return"Portal";case Hu:return"Profiler";case Ef:return"StrictMode";case Vu:return"Suspense";case Ku:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case vv:return(e.displayName||"Context")+".Consumer";case gv:return(e._context.displayName||"Context")+".Provider";case kf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cf:return t=e.displayName||null,t!==null?t:qu(e.type)||"Memo";case Ir:t=e._payload,e=e._init;try{return qu(e(t))}catch{}}return null}function US(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 qu(t);case 8:return t===Ef?"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 Qr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function FS(e){var t=wv(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,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mi(e){e._valueTracker||(e._valueTracker=FS(e))}function bv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=wv(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Ka(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 Gu(e,t){var r=t.checked;return we({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function fp(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Qr(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 xv(e,t){t=t.checked,t!=null&&Sf(e,"checked",t,!1)}function Yu(e,t){xv(e,t);var r=Qr(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")?Ju(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ju(e,t.type,Qr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hp(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 Ju(e,t,r){(t!=="number"||Ka(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var yo=Array.isArray;function ms(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Qr(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Xu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(j(91));return we({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pp(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(j(92));if(yo(r)){if(1<r.length)throw Error(j(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Qr(r)}}function _v(e,t){var r=Qr(t.value),n=Qr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function mp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Sv(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Sv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var $i,Ev=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for($i=$i||document.createElement("div"),$i.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=$i.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function zo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ko={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},zS=["Webkit","ms","Moz","O"];Object.keys(ko).forEach(function(e){zS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ko[t]=ko[e]})});function kv(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ko.hasOwnProperty(e)&&ko[e]?(""+t).trim():t+"px"}function Cv(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=kv(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var BS=we({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 Zu(e,t){if(t){if(BS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function ed(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 td=null;function Tf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rd=null,gs=null,vs=null;function gp(e){if(e=wi(e)){if(typeof rd!="function")throw Error(j(280));var t=e.stateNode;t&&(t=Wl(t),rd(e.stateNode,e.type,t))}}function Tv(e){gs?vs?vs.push(e):vs=[e]:gs=e}function Rv(){if(gs){var e=gs,t=vs;if(vs=gs=null,gp(e),t)for(e=0;e<t.length;e++)gp(t[e])}}function Pv(e,t){return e(t)}function Av(){}var Bc=!1;function Nv(e,t,r){if(Bc)return e(t,r);Bc=!0;try{return Pv(e,t,r)}finally{Bc=!1,(gs!==null||vs!==null)&&(Av(),Rv())}}function Bo(e,t){var r=e.stateNode;if(r===null)return null;var n=Wl(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(j(231,t,typeof r));return r}var nd=!1;if(wr)try{var to={};Object.defineProperty(to,"passive",{get:function(){nd=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{nd=!1}function WS(e,t,r,n,s,o,i,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(u){this.onError(u)}}var Co=!1,qa=null,Ga=!1,sd=null,HS={onError:function(e){Co=!0,qa=e}};function VS(e,t,r,n,s,o,i,a,l){Co=!1,qa=null,WS.apply(HS,arguments)}function KS(e,t,r,n,s,o,i,a,l){if(VS.apply(this,arguments),Co){if(Co){var c=qa;Co=!1,qa=null}else throw Error(j(198));Ga||(Ga=!0,sd=c)}}function An(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Ov(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function vp(e){if(An(e)!==e)throw Error(j(188))}function qS(e){var t=e.alternate;if(!t){if(t=An(e),t===null)throw Error(j(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var o=s.alternate;if(o===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===r)return vp(s),e;if(o===n)return vp(s),t;o=o.sibling}throw Error(j(188))}if(r.return!==n.return)r=s,n=o;else{for(var i=!1,a=s.child;a;){if(a===r){i=!0,r=s,n=o;break}if(a===n){i=!0,n=s,r=o;break}a=a.sibling}if(!i){for(a=o.child;a;){if(a===r){i=!0,r=o,n=s;break}if(a===n){i=!0,n=o,r=s;break}a=a.sibling}if(!i)throw Error(j(189))}}if(r.alternate!==n)throw Error(j(190))}if(r.tag!==3)throw Error(j(188));return r.stateNode.current===r?e:t}function jv(e){return e=qS(e),e!==null?Iv(e):null}function Iv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Iv(e);if(t!==null)return t;e=e.sibling}return null}var Lv=gt.unstable_scheduleCallback,yp=gt.unstable_cancelCallback,GS=gt.unstable_shouldYield,YS=gt.unstable_requestPaint,ke=gt.unstable_now,JS=gt.unstable_getCurrentPriorityLevel,Rf=gt.unstable_ImmediatePriority,Dv=gt.unstable_UserBlockingPriority,Ya=gt.unstable_NormalPriority,XS=gt.unstable_LowPriority,Mv=gt.unstable_IdlePriority,Ul=null,nr=null;function QS(e){if(nr&&typeof nr.onCommitFiberRoot=="function")try{nr.onCommitFiberRoot(Ul,e,void 0,(e.current.flags&128)===128)}catch{}}var zt=Math.clz32?Math.clz32:tE,ZS=Math.log,eE=Math.LN2;function tE(e){return e>>>=0,e===0?32:31-(ZS(e)/eE|0)|0}var Ui=64,Fi=4194304;function wo(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 Ja(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,i=r&268435455;if(i!==0){var a=i&~s;a!==0?n=wo(a):(o&=i,o!==0&&(n=wo(o)))}else i=r&~s,i!==0?n=wo(i):o!==0&&(n=wo(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-zt(t),s=1<<r,n|=e[r],t&=~s;return n}function rE(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nE(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-zt(o),a=1<<i,l=s[i];l===-1?(!(a&r)||a&n)&&(s[i]=rE(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function od(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $v(){var e=Ui;return Ui<<=1,!(Ui&4194240)&&(Ui=64),e}function Wc(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 3,030 bytes, line 38
38function vi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=r}function sE(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<r;){var s=31-zt(r),o=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~o}}function Pf(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-zt(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var oe=0;function Uv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Fv,Af,zv,Bv,Wv,id=!1,zi=[],Hr=null,Vr=null,Kr=null,Wo=new Map,Ho=new Map,Dr=[],oE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function wp(e,t){switch(e){case"focusin":case"focusout":Hr=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":Kr=null;break;case"pointerover":case"pointerout":Wo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ho.delete(t.pointerId)}}function ro(e,t,r,n,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:o,targetContainers:[s]},t!==null&&(t=wi(t),t!==null&&Af(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function iE(e,t,r,n,s){switch(t){case"focusin":return Hr=ro(Hr,e,t,r,n,s),!0;case"dragenter":return Vr=ro(Vr,e,t,r,n,s),!0;case"mouseover":return Kr=ro(Kr,e,t,r,n,s),!0;case"pointerover":var o=s.pointerId;return Wo.set(o,ro(Wo.get(o)||null,e,t,r,n,s)),!0;case"gotpointercapture":return o=s.pointerId,Ho.set(o,ro(Ho.get(o)||null,e,t,r,n,s)),!0}return!1}function Hv(e){var t=pn(e.target);if(t!==null){var r=An(t);if(r!==null){if(t=r.tag,t===13){if(t=Ov(r),t!==null){e.blockedOn=t,Wv(e.priority,function(){zv(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ea(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ad(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);td=n,r.target.dispatchEvent(n),td=null}else return t=wi(r),t!==null&&Af(t),e.blockedOn=r,!1;t.shift()}return!0}function bp(e,t,r){Ea(e)&&r.delete(t)}function aE(){id=!1,Hr!==null&&Ea(Hr)&&(Hr=null),Vr!==null&&Ea(Vr)&&(Vr=null),Kr!==null&&Ea(Kr)&&(Kr=null),Wo.forEach(bp),Ho.forEach(bp)}function no(e,t){e.blockedOn===t&&(e.blockedOn=null,id||(id=!0,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,aE)))}function Vo(e){function t(s){return no(s,e)}if(0<zi.length){no(zi[0],e);for(var r=1;r<zi.length;r++){var n=zi[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Hr!==null&&no(Hr,e),Vr!==null&&no(Vr,e),Kr!==null&&no(Kr,e),Wo.forEach(t),Ho.forEac
vendor: 13,235 bytes, line 38
38h(t),r=0;r<Dr.length;r++)n=Dr[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Dr.length&&(r=Dr[0],r.blockedOn===null);)Hv(r),r.blockedOn===null&&Dr.shift()}var ys=Cr.ReactCurrentBatchConfig,Xa=!0;function lE(e,t,r,n){var s=oe,o=ys.transition;ys.transition=null;try{oe=1,Nf(e,t,r,n)}finally{oe=s,ys.transition=o}}function cE(e,t,r,n){var s=oe,o=ys.transition;ys.transition=null;try{oe=4,Nf(e,t,r,n)}finally{oe=s,ys.transition=o}}function Nf(e,t,r,n){if(Xa){var s=ad(e,t,r,n);if(s===null)Zc(e,t,n,Qa,r),wp(e,n);else if(iE(s,e,t,r,n))n.stopPropagation();else if(wp(e,n),t&4&&-1<oE.indexOf(e)){for(;s!==null;){var o=wi(s);if(o!==null&&Fv(o),o=ad(e,t,r,n),o===null&&Zc(e,t,n,Qa,r),o===s)break;s=o}s!==null&&n.stopPropagation()}else Zc(e,t,n,null,r)}}var Qa=null;function ad(e,t,r,n){if(Qa=null,e=Tf(n),e=pn(e),e!==null)if(t=An(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Ov(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Qa=e,null}function Vv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(JS()){case Rf:return 1;case Dv:return 4;case Ya:case XS:return 16;case Mv:return 536870912;default:return 16}default:return 16}}var Br=null,Of=null,ka=null;function Kv(){if(ka)return ka;var e,t=Of,r=t.length,n,s="value"in Br?Br.value:Br.textContent,o=s.length;for(e=0;e<r&&t[e]===s[e];e++);var i=r-e;for(n=1;n<=i&&t[r-n]===s[o-n];n++);return ka=s.slice(e,1<n?1-n:void 0)}function Ca(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Bi(){return!0}function xp(){return!1}function yt(e){function t(r,n,s,o,i){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Bi:xp,this.isPropagationStopped=xp,this}return we(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Bi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Bi)},persist:function(){},isPersistent:Bi}),t}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jf=yt($s),yi=we({},$s,{view:0,detail:0}),uE=yt(yi),Hc,Vc,so,Fl=we({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:If,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==so&&(so&&e.type==="mousemove"?(Hc=e.screenX-so.screenX,Vc=e.screenY-so.screenY):Vc=Hc=0,so=e),Hc)},movementY:function(e){return"movementY"in e?e.movementY:Vc}}),_p=yt(Fl),dE=we({},Fl,{dataTransfer:0}),fE=yt(dE),hE=we({},yi,{relatedTarget:0}),Kc=yt(hE),pE=we({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),mE=yt(pE),gE=we({},$s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vE=yt(gE),yE=we({},$s,{data:0}),Sp=yt(yE),wE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _E(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xE[e])?!!t[e]:!1}function If(){return _E}var SE=we({},yi,{key:function(e){if(e.key){var t=wE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ca(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:If,charCode:function(e){return e.type==="keypress"?Ca(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ca(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),EE=yt(SE),kE=we({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ep=yt(kE),CE=we({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:If}),TE=yt(CE),RE=we({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),PE=yt(RE),AE=we({},Fl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),NE=yt(AE),OE=[9,13,27,32],Lf=wr&&"CompositionEvent"in window,To=null;wr&&"documentMode"in document&&(To=document.documentMode);var jE=wr&&"TextEvent"in window&&!To,qv=wr&&(!Lf||To&&8<To&&11>=To),kp=" ",Cp=!1;function Gv(e,t){switch(e){case"keyup":return OE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ns=!1;function IE(e,t){switch(e){case"compositionend":return Yv(t);case"keypress":return t.which!==32?null:(Cp=!0,kp);case"textInput":return e=t.data,e===kp&&Cp?null:e;default:return null}}function LE(e,t){if(ns)return e==="compositionend"||!Lf&&Gv(e,t)?(e=Kv(),ka=Of=Br=null,ns=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return qv&&t.locale!=="ko"?null:t.data;default:return null}}var DE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Tp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!DE[e.type]:t==="textarea"}function Jv(e,t,r,n){Tv(n),t=Za(t,"onChange"),0<t.length&&(r=new jf("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ro=null,Ko=null;function ME(e){ay(e,0)}function zl(e){var t=is(e);if(bv(t))return e}function $E(e,t){if(e==="change")return t}var Xv=!1;if(wr){var qc;if(wr){var Gc="oninput"in document;if(!Gc){var Rp=document.createElement("div");Rp.setAttribute("oninput","return;"),Gc=typeof Rp.oninput=="function"}qc=Gc}else qc=!1;Xv=qc&&(!document.documentMode||9<document.documentMode)}function Pp(){Ro&&(Ro.detachEvent("onpropertychange",Qv),Ko=Ro=null)}function Qv(e){if(e.propertyName==="value"&&zl(Ko)){var t=[];Jv(t,Ko,e,Tf(e)),Nv(ME,t)}}function UE(e,t,r){e==="focusin"?(Pp(),Ro=t,Ko=r,Ro.attachEvent("onpropertychange",Qv)):e==="focusout"&&Pp()}function FE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zl(Ko)}function zE(e,t){if(e==="click")return zl(t)}function BE(e,t){if(e==="input"||e==="change")return zl(t)}function WE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ht=typeof Object.is=="function"?Object.is:WE;function qo(e,t){if(Ht(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Wu.call(t,s)||!Ht(e[s],t[s]))return!1}return!0}function Ap(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Np(e,t){var r=Ap(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=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=Ap(r)}}function Zv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ey(){for(var e=window,t=Ka();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ka(e.document)}return t}function Df(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 HE(e){var t=ey(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Zv(r.ownerDocument.documentElement,r)){if(n!==null&&Df(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,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=Np(r,o);var i=Np(r,n);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var VE=wr&&"documentMode"in document&&11>=document.documentMode,ss=null,ld=null,Po=null,cd=!1;function Op(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;cd||ss==null||ss!==Ka(n)||(n=ss,"selectionStart"in n&&Df(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}),Po&&qo(Po,n)||(Po=n,n=Za(ld,"onSelect"),0<n.length&&(t=new jf("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=ss)))}function Wi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var os={animationend:Wi("Animation","AnimationEnd"),animationiteration:Wi("Animation","AnimationIteration"),animationstart:Wi("Animation","AnimationStart"),transitionend:Wi("Transition","TransitionEnd")},Yc={},ty={};wr&&(ty=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function Bl(e){if(Yc[e])return Yc[e];if(!os[e])return e;var t=os[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in ty)return Yc[e]=t[r];return e}var ry=Bl("animationend"),ny=Bl("animationiteration"),sy=Bl("animationstart"),oy=Bl("transitionend"),iy=new Map,jp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function sn(e,t){iy.set(e,t),Pn(t,[e])}for(var Jc=0;Jc<jp.length;Jc++){var Xc=jp[Jc],KE=Xc.toLowerCase(),qE=Xc[0].toUpperCase()+Xc.slice(1);
vendor: 5,251 bytes, line 38
38sn(KE,"on"+qE)}sn(ry,"onAnimationEnd");sn(ny,"onAnimationIteration");sn(sy,"onAnimationStart");sn("dblclick","onDoubleClick");sn("focusin","onFocus");sn("focusout","onBlur");sn(oy,"onTransitionEnd");Cs("onMouseEnter",["mouseout","mouseover"]);Cs("onMouseLeave",["mouseout","mouseover"]);Cs("onPointerEnter",["pointerout","pointerover"]);Cs("onPointerLeave",["pointerout","pointerover"]);Pn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Pn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Pn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Pn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Pn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Pn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),GE=new Set("cancel close invalid load scroll toggle".split(" ").concat(bo));function Ip(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,KS(n,t,void 0,e),e.currentTarget=null}function ay(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var i=n.length-1;0<=i;i--){var a=n[i],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&s.isPropagationStopped())break e;Ip(s,a,c),o=l}else for(i=0;i<n.length;i++){if(a=n[i],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&s.isPropagationStopped())break e;Ip(s,a,c),o=l}}}if(Ga)throw e=sd,Ga=!1,sd=null,e}function he(e,t){var r=t[pd];r===void 0&&(r=t[pd]=new Set);var n=e+"__bubble";r.has(n)||(ly(t,e,2,!1),r.add(n))}function Qc(e,t,r){var n=0;t&&(n|=4),ly(r,e,n,t)}var Hi="_reactListening"+Math.random().toString(36).slice(2);function Go(e){if(!e[Hi]){e[Hi]=!0,mv.forEach(function(r){r!=="selectionchange"&&(GE.has(r)||Qc(r,!1,e),Qc(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hi]||(t[Hi]=!0,Qc("selectionchange",!1,t))}}function ly(e,t,r,n){switch(Vv(t)){case 1:var s=lE;break;case 4:s=cE;break;default:s=Nf}r=s.bind(null,t,r,e),s=void 0,!nd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Zc(e,t,r,n,s){var o=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var a=n.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(i===4)for(i=n.return;i!==null;){var l=i.tag;if((l===3||l===4)&&(l=i.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;i=i.return}for(;a!==null;){if(i=pn(a),i===null)return;if(l=i.tag,l===5||l===6){n=o=i;continue e}a=a.parentNode}}n=n.return}Nv(function(){var c=o,u=Tf(r),f=[];e:{var d=iy.get(e);if(d!==void 0){var m=jf,v=e;switch(e){case"keypress":if(Ca(r)===0)break e;case"keydown":case"keyup":m=EE;break;case"focusin":v="focus",m=Kc;break;case"focusout":v="blur",m=Kc;break;case"beforeblur":case"afterblur":m=Kc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=_p;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=fE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=TE;break;case ry:case ny:case sy:m=mE;break;case oy:m=PE;break;case"scroll":m=uE;break;case"wheel":m=NE;break;case"copy":case"cut":case"paste":m=vE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Ep}var g=(t&4)!==0,x=!g&&e==="scroll",y=g?d!==null?d+"Capture":null:d;g=[];for(var w=c,b;w!==null;){b=w;var _=b.stateNode;if(b.tag===5&&_!==null&&(b=_,y!==null&&(_=Bo(w,y),_!=null&&g.push(Yo(w,_,b)))),x)break;w=w.return}0<g.length&&(d=new m(d,v,null,r,u),f.push({event:d,listeners:g}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",d&&r!==td&&(v=r.relatedTarget||r.fromElement)&&(pn(v)||v[br]))break e;if((m||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,m?(v=r.relatedTarget||r.toElement,m=c,v=v?pn(v):null,v!==null&&(x=An(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=c),m!==v)){if(g=_p,_="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(g=Ep,_="onPointerLeave",y="onPointerEnter",w="pointer"),x=m==null?d:is(m),b=v==null?d:is(v),d=new g(_,w+"leave",m,r,u),d.target=x,d.relatedTarget=b,_=null,pn(u)===c&&(g=new g(y,w+"enter",v,r,u),g.target=b,g.relatedTarget=x,_=g),x=_,m&&v)t:{for(g=m,y=v,w=0,b=g;b;b=zn(b))w++;for(b=0,_=y;_;_=zn(_))b++;for(;0<w-b;)g=zn(g),w--;for(;0<b-w;)y=zn(y),b--;for(;w--;){if(g===y||y!==null&&g===y.alternate)break t;g=zn(g),y=zn(y)}g=null}else g=null;m!==null&&Lp(f,d,m,g,!1),v!==null&&x!==null&&Lp(f,x,v,g,!0)}}
vendor: 6,000 bytes, lines 38-39
38e:{if(d=c?is(c):window,m=d.nodeName&&d.nodeName.toLowerCase(),m==="select"||m==="input"&&d.type==="file")var S=$E;else if(Tp(d))if(Xv)S=BE;else{S=FE;var k=UE}else(m=d.nodeName)&&m.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(S=zE);if(S&&(S=S(e,c))){Jv(f,S,r,u);break e}k&&k(e,d,c),e==="focusout"&&(k=d._wrapperState)&&k.controlled&&d.type==="number"&&Ju(d,"number",d.value)}switch(k=c?is(c):window,e){case"focusin":(Tp(k)||k.contentEditable==="true")&&(ss=k,ld=c,Po=null);break;case"focusout":Po=ld=ss=null;break;case"mousedown":cd=!0;break;case"contextmenu":case"mouseup":case"dragend":cd=!1,Op(f,r,u);break;case"selectionchange":if(VE)break;case"keydown":case"keyup":Op(f,r,u)}var E;if(Lf)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else ns?Gv(e,r)&&(T="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(qv&&r.locale!=="ko"&&(ns||T!=="onCompositionStart"?T==="onCompositionEnd"&&ns&&(E=Kv()):(Br=u,Of="value"in Br?Br.value:Br.textContent,ns=!0)),k=Za(c,T),0<k.length&&(T=new Sp(T,e,null,r,u),f.push({event:T,listeners:k}),E?T.data=E:(E=Yv(r),E!==null&&(T.data=E)))),(E=jE?IE(e,r):LE(e,r))&&(c=Za(c,"onBeforeInput"),0<c.length&&(u=new Sp("onBeforeInput","beforeinput",null,r,u),f.push({event:u,listeners:c}),u.data=E))}ay(f,t)})}function Yo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Za(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Bo(e,r),o!=null&&n.unshift(Yo(e,o,s)),o=Bo(e,t),o!=null&&n.push(Yo(e,o,s))),e=e.return}return n}function zn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lp(e,t,r,n,s){for(var o=t._reactName,i=[];r!==null&&r!==n;){var a=r,l=a.alternate,c=a.stateNode;if(l!==null&&l===n)break;a.tag===5&&c!==null&&(a=c,s?(l=Bo(r,o),l!=null&&i.unshift(Yo(r,l,a))):s||(l=Bo(r,o),l!=null&&i.push(Yo(r,l,a)))),r=r.return}i.length!==0&&e.push({event:t,listeners:i})}var YE=/\r\n?/g,JE=/\u0000|\uFFFD/g;function Dp(e){return(typeof e=="string"?e:""+e).replace(YE,` 39`).replace(JE,"")}function Vi(e,t,r){if(t=Dp(t),Dp(e)!==t&&r)throw Error(j(425))}function el(){}var ud=null,dd=null;function fd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var hd=typeof setTimeout=="function"?setTimeout:void 0,XE=typeof clearTimeout=="function"?clearTimeout:void 0,Mp=typeof Promise=="function"?Promise:void 0,QE=typeof queueMicrotask=="function"?queueMicrotask:typeof Mp<"u"?function(e){return Mp.resolve(null).then(e).catch(ZE)}:hd;function ZE(e){setTimeout(function(){throw e})}function eu(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Vo(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Vo(t)}function qr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $p(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Us=Math.random().toString(36).slice(2),rr="__reactFiber$"+Us,Jo="__reactProps$"+Us,br="__reactContainer$"+Us,pd="__reactEvents$"+Us,e1="__reactListeners$"+Us,t1="__reactHandles$"+Us;function pn(e){var t=e[rr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[br]||r[rr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=$p(e);e!==null;){if(r=e[rr])return r;e=$p(e)}return t}e=r,r=e.parentNode}return null}function wi(e){return e=e[rr]||e[br],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function is(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(j(33))}function Wl(e){return e[Jo]||null}var md=[],as=-1;function on(e){return{current:e}}function pe(e){0>as||(e.current=md[as],md[as]=null,as--)}function ue(e,t){as++,md[as]=e.current,e.current=t}var Zr={},Ge=on(Zr),ot=on(!1),_n=Zr;function Ts(e,t){var r=e.type.contextTypes;if(!r)return Zr;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function it(e){return e=e.childContextTypes,e!=null}function tl(){pe(ot),pe(Ge)}function Up(e,t,r){if(Ge.current!==Zr)throw Error(j(168));ue(Ge,t),ue(ot,r)}function cy(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(j(108,US(e)||"Unknown",s));return we({},r,n)}function rl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zr,_n=Ge.current,ue(Ge,e),ue(ot,ot.current),!0}function Fp(e,t,r){var n=e.stateNode;if(!n)throw Error(j(169));r?(e=cy(e,t,_n),n.__reactInternalMemoizedMergedChildContext=e,pe(ot),pe(Ge),ue(Ge,e)):pe(ot),ue(ot,r)}var pr=null,Hl=!1,tu=!1;function uy(e){pr===null?pr=[e]:pr.push(e)}function r1(e){Hl=!0,uy(e)}function an(){if(!tu&&pr!==null){tu=!0;var e=0,t=oe;try{var r=pr;for(oe=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}pr=null,Hl=!1}catch(s){throw pr!==null&&(pr=pr.slice(e+1)),Lv(Rf,an),s}finally{oe=t,tu=!1}}return null}var ls=[],cs=0,nl=null,sl=0,_t=[],St=0,Sn=null,mr=1,gr="";function dn(e,t){ls[cs++]=sl,ls[cs++]=nl,nl=e,sl=t}function dy(e,t,r){_t[St++]=mr,_t[St++]=gr,_t[St++]=Sn,Sn=e;var n=mr;e=gr;var s=32-zt(n)-1;n&=~(1<<s),r+=1;var o=32-zt(t)+s;if(30<o){var i=s-s%5;o=(n&(1<<i)-1).toString(32),n>>=i,s-=i,mr=1<<32-zt(t)+s|r<<s|n,gr=o+e}else mr=1<<o|r<<s|n,gr=e}function Mf(e){e.return!==null&&(dn(e,1),dy(e,1,0))}function $f(e){for(;e===nl;
vendor: 13,186 bytes, line 39
39)nl=ls[--cs],ls[cs]=null,sl=ls[--cs],ls[cs]=null;for(;e===Sn;)Sn=_t[--St],_t[St]=null,gr=_t[--St],_t[St]=null,mr=_t[--St],_t[St]=null}var pt=null,ht=null,me=!1,Ut=null;function fy(e,t){var r=Et(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function zp(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,pt=e,ht=qr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Sn!==null?{id:mr,overflow:gr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Et(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,pt=e,ht=null,!0):!1;default:return!1}}function gd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function vd(e){if(me){var t=ht;if(t){var r=t;if(!zp(e,t)){if(gd(e))throw Error(j(418));t=qr(r.nextSibling);var n=pt;t&&zp(e,t)?fy(n,r):(e.flags=e.flags&-4097|2,me=!1,pt=e)}}else{if(gd(e))throw Error(j(418));e.flags=e.flags&-4097|2,me=!1,pt=e}}}function Bp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pt=e}function Ki(e){if(e!==pt)return!1;if(!me)return Bp(e),me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fd(e.type,e.memoizedProps)),t&&(t=ht)){if(gd(e))throw hy(),Error(j(418));for(;t;)fy(e,t),t=qr(t.nextSibling)}if(Bp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){ht=qr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=pt?qr(e.stateNode.nextSibling):null;return!0}function hy(){for(var e=ht;e;)e=qr(e.nextSibling)}function Rs(){ht=pt=null,me=!1}function Uf(e){Ut===null?Ut=[e]:Ut.push(e)}var n1=Cr.ReactCurrentBatchConfig;function oo(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(j(309));var n=r.stateNode}if(!n)throw Error(j(147,e));var s=n,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var a=s.refs;i===null?delete a[o]:a[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(j(284));if(!r._owner)throw Error(j(290,e))}return e}function qi(e,t){throw e=Object.prototype.toString.call(t),Error(j(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wp(e){var t=e._init;return t(e._payload)}function py(e){function t(y,w){if(e){var b=y.deletions;b===null?(y.deletions=[w],y.flags|=16):b.push(w)}}function r(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function n(y,w){for(y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function s(y,w){return y=Xr(y,w),y.index=0,y.sibling=null,y}function o(y,w,b){return y.index=b,e?(b=y.alternate,b!==null?(b=b.index,b<w?(y.flags|=2,w):b):(y.flags|=2,w)):(y.flags|=1048576,w)}function i(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,w,b,_){return w===null||w.tag!==6?(w=lu(b,y.mode,_),w.return=y,w):(w=s(w,b),w.return=y,w)}function l(y,w,b,_){var S=b.type;return S===rs?u(y,w,b.props.children,_,b.key):w!==null&&(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ir&&Wp(S)===w.type)?(_=s(w,b.props),_.ref=oo(y,w,b),_.return=y,_):(_=ja(b.type,b.key,b.props,null,y.mode,_),_.ref=oo(y,w,b),_.return=y,_)}function c(y,w,b,_){return w===null||w.tag!==4||w.stateNode.containerInfo!==b.containerInfo||w.stateNode.implementation!==b.implementation?(w=cu(b,y.mode,_),w.return=y,w):(w=s(w,b.children||[]),w.return=y,w)}function u(y,w,b,_,S){return w===null||w.tag!==7?(w=wn(b,y.mode,_,S),w.return=y,w):(w=s(w,b),w.return=y,w)}function f(y,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return w=lu(""+w,y.mode,b),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Di:return b=ja(w.type,w.key,w.props,null,y.mode,b),b.ref=oo(y,null,w),b.return=y,b;case ts:return w=cu(w,y.mode,b),w.return=y,w;case Ir:var _=w._init;return f(y,_(w._payload),b)}if(yo(w)||eo(w))return w=wn(w,y.mode,b,null),w.return=y,w;qi(y,w)}return null}function d(y,w,b,_){var S=w!==null?w.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return S!==null?null:a(y,w,""+b,_);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Di:return b.key===S?l(y,w,b,_):null;case ts:return b.key===S?c(y,w,b,_):null;case Ir:return S=b._init,d(y,w,S(b._payload),_)}if(yo(b)||eo(b))return S!==null?null:u(y,w,b,_,null);qi(y,b)}return null}function m(y,w,b,_,S){if(typeof _=="string"&&_!==""||typeof _=="number")return y=y.get(b)||null,a(w,y,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Di:return y=y.get(_.key===null?b:_.key)||null,l(w,y,_,S);case ts:return y=y.get(_.key===null?b:_.key)||null,c(w,y,_,S);case Ir:var k=_._init;return m(y,w,b,k(_._payload),S)}if(yo(_)||eo(_))return y=y.get(b)||null,u(w,y,_,S,null);qi(w,_)}return null}function v(y,w,b,_){for(var S=null,k=null,E=w,T=w=0,N=null;E!==null&&T<b.length;T++){E.index>T?(N=E,E=null):N=E.sibling;var P=d(y,E,b[T],_);if(P===null){E===null&&(E=N);break}e&&E&&P.alternate===null&&t(y,E),w=o(P,w,T),k===null?S=P:k.sibling=P,k=P,E=N}if(T===b.length)return r(y,E),me&&dn(y,T),S;if(E===null){for(;T<b.length;T++)E=f(y,b[T],_),E!==null&&(w=o(E,w,T),k===null?S=E:k.sibling=E,k=E);return me&&dn(y,T),S}for(E=n(y,E);T<b.length;T++)N=m(E,y,T,b[T],_),N!==null&&(e&&N.alternate!==null&&E.delete(N.key===null?T:N.key),w=o(N,w,T),k===null?S=N:k.sibling=N,k=N);return e&&E.forEach(function(O){return t(y,O)}),me&&dn(y,T),S}function g(y,w,b,_){var S=eo(b);if(typeof S!="function")throw Error(j(150));if(b=S.call(b),b==null)throw Error(j(151));for(var k=S=null,E=w,T=w=0,N=null,P=b.next();E!==null&&!P.done;T++,P=b.next()){E.index>T?(N=E,E=null):N=E.sibling;var O=d(y,E,P.value,_);if(O===null){E===null&&(E=N);break}e&&E&&O.alternate===null&&t(y,E),w=o(O,w,T),k===null?S=O:k.sibling=O,k=O,E=N}if(P.done)return r(y,E),me&&dn(y,T),S;if(E===null){for(;!P.done;T++,P=b.next())P=f(y,P.value,_),P!==null&&(w=o(P,w,T),k===null?S=P:k.sibling=P,k=P);return me&&dn(y,T),S}for(E=n(y,E);!P.done;T++,P=b.next())P=m(E,y,T,P.value,_),P!==null&&(e&&P.alternate!==null&&E.delete(P.key===null?T:P.key),w=o(P,w,T),k===null?S=P:k.sibling=P,k=P);return e&&E.forEach(function(F){return t(y,F)}),me&&dn(y,T),S}function x(y,w,b,_){if(typeof b=="object"&&b!==null&&b.type===rs&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Di:e:{for(var S=b.key,k=w;k!==null;){if(k.key===S){if(S=b.type,S===rs){if(k.tag===7){r(y,k.sibling),w=s(k,b.props.children),w.return=y,y=w;break e}}else if(k.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ir&&Wp(S)===k.type){r(y,k.sibling),w=s(k,b.props),w.ref=oo(y,k,b),w.return=y,y=w;break e}r(y,k);break}else t(y,k);k=k.sibling}b.type===rs?(w=wn(b.props.children,y.mode,_,b.key),w.return=y,y=w):(_=ja(b.type,b.key,b.props,null,y.mode,_),_.ref=oo(y,w,b),_.return=y,y=_)}return i(y);case ts:e:{for(k=b.key;w!==null;){if(w.key===k)if(w.tag===4&&w.stateNode.containerInfo===b.containerInfo&&w.stateNode.implementation===b.implementation){r(y,w.sibling),w=s(w,b.children||[]),w.return=y,y=w;break e}else{r(y,w);break}else t(y,w);w=w.sibling}w=cu(b,y.mode,_),w.return=y,y=w}return i(y);case Ir:return k=b._init,x(y,w,k(b._payload),_)}if(yo(b))return v(y,w,b,_);if(eo(b))return g(y,w,b,_);qi(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,w!==null&&w.tag===6?(r(y,w.sibling),w=s(w,b),w.return=y,y=w):(r(y,w),w=lu(b,y.mode,_),w.return=y,y=w),i(y)):r(y,w)}return x}var Ps=py(!0),my=py(!1),ol=on(null),il=null,us=null,Ff=null;function zf(){Ff=us=il=null}function Bf(e){var t=ol.current;pe(ol),e._currentValue=t}function yd(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 ws(e,t){il=e,Ff=us=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(st=!0),e.firstContext=null)}function Tt(e){var t=e._currentValue;if(Ff!==e)if(e={context:e,memoizedValue:t,next:null},us===null){if(il===null)throw Error(j(308));us=e,il.dependencies={lanes:0,firstContext:e}}else us=us.next=e;return t}var mn=null;function Wf(e){mn===null?mn=[e]:mn.push(e)}function gy(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Wf(t)):(r.next=s.next,s.next=r),t.interleaved=r,xr(e,n)}function xr(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 Lr=!1;function Hf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vy(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 yr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,se&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,xr(e,r)}return s=n.interleaved,s===null?(t.next=t,Wf(n)):(t.next=s.next,s.next=t),n.interleaved=t,xr(e,r)}function Ta(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,Pf(e,r)}}function Hp(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,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 al(e,t,r,n){var s=e.updateQueue;Lr=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?o=c:i.next=c,i=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==i&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=s.baseState;i=0,u=c=l=null,a=o;do{var d=a.lane,m=a.eventTime;if((n&d)===d){u!==null&&(u=u.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,g=a;switch(d=t,m=r,g.tag){case 1:if(v=g.payload,typeof v=="function"){f=v.call(m,f,d);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,d=typeof v=="function"?v.call(m,f,d):v,d==null)break e;f=we({},f,d);break e;case 2:Lr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=s.effects,d===null?s.effects=[a]:d.push(a))}else m={eventTime:m,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=m,l=f):u=u.next=m,i|=d;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;d=a,a=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(u===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);kn|=i,e.lanes=i,e.memoizedState=f}}function Vp(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(j(191,s));s.call(n)}}}var bi={},sr=on(bi),Xo=on(bi),Qo=on(bi);function gn(e){if(e===bi)throw Error(j(174));return e}function Vf(e,t){switch(ue(Qo,t),ue(Xo,e),ue(sr,bi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qu(t,e)}pe(sr),ue(sr,t)}function As(){pe(sr),pe(Xo),pe(Qo)}function yy(e){gn(Qo.current);var t=gn(sr.current),r=Qu(t,e.type);t!==r&&(ue(Xo,e),ue(sr,r))}function Kf(e){Xo.current===e&&(pe(sr),pe(Xo))}var ve=on(0);function ll(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ru=[];function qf(){for(var e=0;e<ru.length;e++)ru[e]._workInProgressVersionPrimary=null;ru.length=0}var Ra=Cr.ReactCurrentDispatcher,nu=Cr.ReactCurrentBatchConfig,En=0,ye=null,Pe=null,Ie=null,cl=!1,Ao=!1,Zo=0,s1=0;function We(){throw Error(j(321))}function Gf(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ht(e[r],t[r]))return!1;return!0}function Yf(e,t,r,n,s,o){if(En=o,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ra.current=e===null||e.memoizedState===null?l1:c1,e=r(n,s),Ao){o=0;
vendor: 4,635 bytes, line 39
39do{if(Ao=!1,Zo=0,25<=o)throw Error(j(301));o+=1,Ie=Pe=null,t.updateQueue=null,Ra.current=u1,e=r(n,s)}while(Ao)}if(Ra.current=ul,t=Pe!==null&&Pe.next!==null,En=0,Ie=Pe=ye=null,cl=!1,t)throw Error(j(300));return e}function Jf(){var e=Zo!==0;return Zo=0,e}function Zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?ye.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function Rt(){if(Pe===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var t=Ie===null?ye.memoizedState:Ie.next;if(t!==null)Ie=t,Pe=e;else{if(e===null)throw Error(j(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},Ie===null?ye.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function ei(e,t){return typeof t=="function"?t(e):t}function su(e){var t=Rt(),r=t.queue;if(r===null)throw Error(j(311));r.lastRenderedReducer=e;var n=Pe,s=n.baseQueue,o=r.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}n.baseQueue=s=o,r.pending=null}if(s!==null){o=s.next,n=n.baseState;var a=i=null,l=null,c=o;do{var u=c.lane;if((En&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,i=n):l=l.next=f,ye.lanes|=u,kn|=u}c=c.next}while(c!==null&&c!==o);l===null?i=n:l.next=a,Ht(n,t.memoizedState)||(st=!0),t.memoizedState=n,t.baseState=i,t.baseQueue=l,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do o=s.lane,ye.lanes|=o,kn|=o,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ou(e){var t=Rt(),r=t.queue;if(r===null)throw Error(j(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,o=t.memoizedState;if(s!==null){r.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);Ht(o,t.memoizedState)||(st=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function wy(){}function by(e,t){var r=ye,n=Rt(),s=t(),o=!Ht(n.memoizedState,s);if(o&&(n.memoizedState=s,st=!0),n=n.queue,Xf(Sy.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||Ie!==null&&Ie.memoizedState.tag&1){if(r.flags|=2048,ti(9,_y.bind(null,r,n,s,t),void 0,null),Le===null)throw Error(j(349));En&30||xy(r,t,s)}return s}function xy(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function _y(e,t,r,n){t.value=r,t.getSnapshot=n,Ey(t)&&ky(e)}function Sy(e,t,r){return r(function(){Ey(t)&&ky(e)})}function Ey(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ht(e,r)}catch{return!0}}function ky(e){var t=xr(e,1);t!==null&&Bt(t,e,1,-1)}function Kp(e){var t=Zt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ei,lastRenderedState:e},t.queue=e,e=e.dispatch=a1.bind(null,ye,e),[t.memoizedState,e]}function ti(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Cy(){return Rt().memoizedState}function Pa(e,t,r,n){var s=Zt();ye.flags|=e,s.memoizedState=ti(1|t,r,void 0,n===void 0?null:n)}function Vl(e,t,r,n){var s=Rt();n=n===void 0?null:n;var o=void 0;if(Pe!==null){var i=Pe.memoizedState;if(o=i.destroy,n!==null&&Gf(n,i.deps)){s.memoizedState=ti(t,r,o,n);return}}ye.flags|=e,s.memoizedState=ti(1|t,r,o,n)}function qp(e,t){return Pa(8390656,8,e,t)}function Xf(e,t){return Vl(2048,8,e,t)}function Ty(e,t){return Vl(4,2,e,t)}function Ry(e,t){return Vl(4,4,e,t)}function Py(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ay(e,t,r){return r=r!=null?r.concat([e]):null,Vl(4,4,Py.bind(null,t,e),r)}function Qf(){}function Ny(e,t){var r=Rt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Gf(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Oy(e,t){var r=Rt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Gf(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function jy(e,t,r){return En&21?(Ht(r,t)||(r=$v(),ye.lanes|=r,kn|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,st=!0),e.memoizedState=r)}function o1(e,t){var r=oe;oe=r!==0&&4>r?r:4,e(!0);var n=nu.transition;nu.transition={};try{e(!1),t()}
vendor: 7,879 bytes, lines 39-41
39finally{oe=r,nu.transition=n}}function Iy(){return Rt().memoizedState}function i1(e,t,r){var n=Jr(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Ly(e))Dy(t,r);else if(r=gy(e,t,r,n),r!==null){var s=Xe();Bt(r,e,n,s),My(r,t,n)}}function a1(e,t,r){var n=Jr(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ly(e))Dy(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,r);if(s.hasEagerState=!0,s.eagerState=a,Ht(a,i)){var l=t.interleaved;l===null?(s.next=s,Wf(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=gy(e,t,s,n),r!==null&&(s=Xe(),Bt(r,e,n,s),My(r,t,n))}}function Ly(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Dy(e,t){Ao=cl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function My(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Pf(e,r)}}var ul={readContext:Tt,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},l1={readContext:Tt,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:qp,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Pa(4194308,4,Py.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Pa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pa(4,2,e,t)},useMemo:function(e,t){var r=Zt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Zt();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=i1.bind(null,ye,e),[n.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:Kp,useDebugValue:Qf,useDeferredValue:function(e){return Zt().memoizedState=e},useTransition:function(){var e=Kp(!1),t=e[0];return e=o1.bind(null,e[1]),Zt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ye,s=Zt();if(me){if(r===void 0)throw Error(j(407));r=r()}else{if(r=t(),Le===null)throw Error(j(349));En&30||xy(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,qp(Sy.bind(null,n,o,e),[e]),n.flags|=2048,ti(9,_y.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=Zt(),t=Le.identifierPrefix;if(me){var r=gr,n=mr;r=(n&~(1<<32-zt(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Zo++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=s1++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},c1={readContext:Tt,useCallback:Ny,useContext:Tt,useEffect:Xf,useImperativeHandle:Ay,useInsertionEffect:Ty,useLayoutEffect:Ry,useMemo:Oy,useReducer:su,useRef:Cy,useState:function(){return su(ei)},useDebugValue:Qf,useDeferredValue:function(e){var t=Rt();return jy(t,Pe.memoizedState,e)},useTransition:function(){var e=su(ei)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:wy,useSyncExternalStore:by,useId:Iy,unstable_isNewReconciler:!1},u1={readContext:Tt,useCallback:Ny,useContext:Tt,useEffect:Xf,useImperativeHandle:Ay,useInsertionEffect:Ty,useLayoutEffect:Ry,useMemo:Oy,useReducer:ou,useRef:Cy,useState:function(){return ou(ei)},useDebugValue:Qf,useDeferredValue:function(e){var t=Rt();return Pe===null?t.memoizedState=e:jy(t,Pe.memoizedState,e)},useTransition:function(){var e=ou(ei)[0],t=Rt().memoizedState;return[e,t]},useMutableSource:wy,useSyncExternalStore:by,useId:Iy,unstable_isNewReconciler:!1};function Dt(e,t){if(e&&e.defaultProps){t=we({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function wd(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:we({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Kl={isMounted:function(e){return(e=e._reactInternals)?An(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Xe(),s=Jr(e),o=yr(n,s);o.payload=t,r!=null&&(o.callback=r),t=Gr(e,o,s),t!==null&&(Bt(t,e,s,n),Ta(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Xe(),s=Jr(e),o=yr(n,s);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=Gr(e,o,s),t!==null&&(Bt(t,e,s,n),Ta(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Xe(),n=Jr(e),s=yr(r,n);s.tag=2,t!=null&&(s.callback=t),t=Gr(e,s,n),t!==null&&(Bt(t,e,n,r),Ta(t,e,n))}};function Gp(e,t,r,n,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,i):t.prototype&&t.prototype.isPureReactComponent?!qo(r,n)||!qo(s,o):!0}function $y(e,t,r){var n=!1,s=Zr,o=t.contextType;return typeof o=="object"&&o!==null?o=Tt(o):(s=it(t)?_n:Ge.current,n=t.contextTypes,o=(n=n!=null)?Ts(e,s):Zr),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Kl,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Yp(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Kl.enqueueReplaceState(t,t.state,null)}function bd(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Hf(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=Tt(o):(o=it(t)?_n:Ge.current,s.context=Ts(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(wd(e,t,o,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Kl.enqueueReplaceState(s,s.state,null),al(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Ns(e,t){try{var r="",n=t;do r+=$S(n),n=n.return;while(n);var s=r}catch(o){s=` 40Error generating stack: `+o.message+` 41`+o.stack}return{value:e,source:t,stack:s,digest:null}}function iu(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function xd(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var d1=typeof WeakMap=="function"?WeakMap:Map;function Uy(e,t,r){r=yr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){fl||(fl=!0,Nd=n),xd(e,t)},r}function Fy(e,t,r){r=yr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){xd(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){xd(e,t),typeof n!="function"&&(Yr===null?Yr=new Set([this]):Yr.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function Jp(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new d1;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=k1.bind(null,e,t,r),t.then(e,e))}function Xp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qp(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=yr(-1,1),t.tag=2,Gr(r,t,1))),r.lanes|=1),e)}var f1=Cr.ReactCurrentOwner,st=!1;function Je(e,t,r,n){t.child=e===null?my(t,null,r,n):Ps(t,e.child,r,n)}function Zp(e,t,r,n,s){r=r.render;var o=t.ref;
vendor: 9,687 bytes, line 41
41return ws(t,s),n=Yf(e,t,r,n,o,s),r=Jf(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,_r(e,t,s)):(me&&r&&Mf(t),t.flags|=1,Je(e,t,n,s),t.child)}function em(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!ih(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,zy(e,t,o,n,s)):(e=ja(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(r=r.compare,r=r!==null?r:qo,r(i,n)&&e.ref===t.ref)return _r(e,t,s)}return t.flags|=1,e=Xr(o,n),e.ref=t.ref,e.return=t,t.child=e}function zy(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(qo(o,n)&&e.ref===t.ref)if(st=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(st=!0);else return t.lanes=e.lanes,_r(e,t,s)}return _d(e,t,r,n,s)}function By(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ue(fs,ut),ut|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ue(fs,ut),ut|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,ue(fs,ut),ut|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,ue(fs,ut),ut|=n;return Je(e,t,s,r),t.child}function Wy(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function _d(e,t,r,n,s){var o=it(r)?_n:Ge.current;return o=Ts(t,o),ws(t,s),r=Yf(e,t,r,n,o,s),n=Jf(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,_r(e,t,s)):(me&&n&&Mf(t),t.flags|=1,Je(e,t,r,s),t.child)}function tm(e,t,r,n,s){if(it(r)){var o=!0;rl(t)}else o=!1;if(ws(t,s),t.stateNode===null)Aa(e,t),$y(t,r,n),bd(t,r,n,s),n=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,c=r.contextType;typeof c=="object"&&c!==null?c=Tt(c):(c=it(r)?_n:Ge.current,c=Ts(t,c));var u=r.getDerivedStateFromProps,f=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==n||l!==c)&&Yp(t,i,n,c),Lr=!1;var d=t.memoizedState;i.state=d,al(t,n,i,s),l=t.memoizedState,a!==n||d!==l||ot.current||Lr?(typeof u=="function"&&(wd(t,r,u,n),l=t.memoizedState),(a=Lr||Gp(t,r,a,n,d,l,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),i.props=n,i.state=l,i.context=c,n=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,vy(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Dt(t.type,a),i.props=c,f=t.pendingProps,d=i.context,l=r.contextType,typeof l=="object"&&l!==null?l=Tt(l):(l=it(r)?_n:Ge.current,l=Ts(t,l));var m=r.getDerivedStateFromProps;(u=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||d!==l)&&Yp(t,i,n,l),Lr=!1,d=t.memoizedState,i.state=d,al(t,n,i,s);var v=t.memoizedState;a!==f||d!==v||ot.current||Lr?(typeof m=="function"&&(wd(t,r,m,n),v=t.memoizedState),(c=Lr||Gp(t,r,c,n,d,v,l)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,v,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,v,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),i.props=n,i.state=v,i.context=l,n=c):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),n=!1)}return Sd(e,t,r,n,o,s)}function Sd(e,t,r,n,s,o){Wy(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return s&&Fp(t,r,!1),_r(e,t,o);n=t.stateNode,f1.current=t;var a=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=Ps(t,e.child,null,o),t.child=Ps(t,null,a,o)):Je(e,t,a,o),t.memoizedState=n.state,s&&Fp(t,r,!0),t.child}function Hy(e){var t=e.stateNode;t.pendingContext?Up(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Up(e,t.context,!1),Vf(e,t.containerInfo)}function rm(e,t,r,n,s){return Rs(),Uf(s),t.flags|=256,Je(e,t,r,n),t.child}var Ed={dehydrated:null,treeContext:null,retryLane:0};function kd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vy(e,t,r){var n=t.pendingProps,s=ve.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ue(ve,s&1),e===null)return vd(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=n.children,e=n.fallback,o?(n=t.mode,o=t.child,i={mode:"hidden",children:i},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=Yl(i,n,0,null),e=wn(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=kd(r),t.memoizedState=Ed,e):Zf(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return h1(e,t,i,n,a,s,r);if(o){o=n.fallback,i=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:n.children};return!(i&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=Xr(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=Xr(a,o):(o=wn(o,i,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,i=e.child.memoizedState,i=i===null?kd(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~r,t.memoizedState=Ed,n}return o=e.child,e=o.sibling,n=Xr(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Zf(e,t){return t=Yl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Gi(e,t,r,n){return n!==null&&Uf(n),Ps(t,e.child,null,r),e=Zf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function h1(e,t,r,n,s,o,i){if(r)return t.flags&256?(t.flags&=-257,n=iu(Error(j(422))),Gi(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=Yl({mode:"visible",children:n.children},s,0,null),o=wn(o,s,i,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&Ps(t,e.child,null,i),t.child.memoizedState=kd(i),t.memoizedState=Ed,o);if(!(t.mode&1))return Gi(e,t,i,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,o=Error(j(419)),n=iu(o,n,void 0),Gi(e,t,i,n)}if(a=(i&e.childLanes)!==0,st||a){if(n=Le,n!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,xr(e,s),Bt(n,e,s,-1))}return oh(),n=iu(Error(j(421))),Gi(e,t,i,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=C1.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ht=qr(s.nextSibling),pt=t,me=!0,Ut=null,e!==null&&(_t[St++]=mr,_t[St++]=gr,_t[St++]=Sn,mr=e.id,gr=e.overflow,Sn=t),t=Zf(t,n.children),t.flags|=4096,t)}function nm(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),yd(e.return,t,r)}function au(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function Ky(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(Je(e,t,n.children,r),n=ve.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nm(e,r,t);else if(e.tag===19)nm(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ue(ve,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&ll(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),au(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ll(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}au(t,!0,r,null,o);break;case"together":au(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Aa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function _r(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),kn|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(j(153));
vendor: 4,174 bytes, line 41
41if(t.child!==null){for(e=t.child,r=Xr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Xr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function p1(e,t,r){switch(t.tag){case 3:Hy(t),Rs();break;case 5:yy(t);break;case 1:it(t.type)&&rl(t);break;case 4:Vf(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;ue(ol,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(ue(ve,ve.current&1),t.flags|=128,null):r&t.child.childLanes?Vy(e,t,r):(ue(ve,ve.current&1),e=_r(e,t,r),e!==null?e.sibling:null);ue(ve,ve.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Ky(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ue(ve,ve.current),n)break;return null;case 22:case 23:return t.lanes=0,By(e,t,r)}return _r(e,t,r)}var qy,Cd,Gy,Yy;qy=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Cd=function(){};Gy=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,gn(sr.current);var o=null;switch(r){case"input":s=Gu(e,s),n=Gu(e,n),o=[];break;case"select":s=we({},s,{value:void 0}),n=we({},n,{value:void 0}),o=[];break;case"textarea":s=Xu(e,s),n=Xu(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=el)}Zu(r,n);var i;r=null;for(c in s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(i in a)a.hasOwnProperty(i)&&(r||(r={}),r[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Fo.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var l=n[c];if(a=s!=null?s[c]:void 0,n.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(r||(r={}),r[i]="");for(i in l)l.hasOwnProperty(i)&&a[i]!==l[i]&&(r||(r={}),r[i]=l[i])}else r||(o||(o=[]),o.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Fo.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&he("scroll",e),o||a===l||(o=[])):(o=o||[]).push(c,l))}r&&(o=o||[]).push("style",r);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};Yy=function(e,t,r,n){r!==n&&(t.flags|=4)};function io(e,t){if(!me)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function m1(e,t,r){var n=t.pendingProps;switch($f(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return it(t.type)&&tl(),He(t),null;case 3:return n=t.stateNode,As(),pe(ot),pe(Ge),qf(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ki(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ut!==null&&(Id(Ut),Ut=null))),Cd(e,t),He(t),null;case 5:Kf(t);var s=gn(Qo.current);if(r=t.type,e!==null&&t.stateNode!=null)Gy(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(j(166));return He(t),null}if(e=gn(sr.current),Ki(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;
vendor: 30,418 bytes, line 41
41switch(n[rr]=t,n[Jo]=o,e=(t.mode&1)!==0,r){case"dialog":he("cancel",n),he("close",n);break;case"iframe":case"object":case"embed":he("load",n);break;case"video":case"audio":for(s=0;s<bo.length;s++)he(bo[s],n);break;case"source":he("error",n);break;case"img":case"image":case"link":he("error",n),he("load",n);break;case"details":he("toggle",n);break;case"input":fp(n,o),he("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},he("invalid",n);break;case"textarea":pp(n,o),he("invalid",n)}Zu(r,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];i==="children"?typeof a=="string"?n.textContent!==a&&(o.suppressHydrationWarning!==!0&&Vi(n.textContent,a,e),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Vi(n.textContent,a,e),s=["children",""+a]):Fo.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&he("scroll",n)}switch(r){case"input":Mi(n),hp(n,o,!0);break;case"textarea":Mi(n),mp(n);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(n.onclick=el)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Sv(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[rr]=t,e[Jo]=n,qy(e,t,!1,!1),t.stateNode=e;e:{switch(i=ed(r,n),r){case"dialog":he("cancel",e),he("close",e),s=n;break;case"iframe":case"object":case"embed":he("load",e),s=n;break;case"video":case"audio":for(s=0;s<bo.length;s++)he(bo[s],e);s=n;break;case"source":he("error",e),s=n;break;case"img":case"image":case"link":he("error",e),he("load",e),s=n;break;case"details":he("toggle",e),s=n;break;case"input":fp(e,n),s=Gu(e,n),he("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=we({},n,{value:void 0}),he("invalid",e);break;case"textarea":pp(e,n),s=Xu(e,n),he("invalid",e);break;default:s=n}Zu(r,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?Cv(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ev(e,l)):o==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&zo(e,l):typeof l=="number"&&zo(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Fo.hasOwnProperty(o)?l!=null&&o==="onScroll"&&he("scroll",e):l!=null&&Sf(e,o,l,i))}switch(r){case"input":Mi(e),hp(e,n,!1);break;case"textarea":Mi(e),mp(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Qr(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?ms(e,!!n.multiple,o,!1):n.defaultValue!=null&&ms(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=el)}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 He(t),null;case 6:if(e&&t.stateNode!=null)Yy(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(j(166));if(r=gn(Qo.current),gn(sr.current),Ki(t)){if(n=t.stateNode,r=t.memoizedProps,n[rr]=t,(o=n.nodeValue!==r)&&(e=pt,e!==null))switch(e.tag){case 3:Vi(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vi(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[rr]=t,t.stateNode=n}return He(t),null;case 13:if(pe(ve),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(me&&ht!==null&&t.mode&1&&!(t.flags&128))hy(),Rs(),t.flags|=98560,o=!1;else if(o=Ki(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(j(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(j(317));o[rr]=t}else Rs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;He(t),o=!1}else Ut!==null&&(Id(Ut),Ut=null),o=!0;if(!o)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||ve.current&1?Ae===0&&(Ae=3):oh())),t.updateQueue!==null&&(t.flags|=4),He(t),null);case 4:return As(),Cd(e,t),e===null&&Go(t.stateNode.containerInfo),He(t),null;case 10:return Bf(t.type._context),He(t),null;case 17:return it(t.type)&&tl(),He(t),null;case 19:if(pe(ve),o=t.memoizedState,o===null)return He(t),null;if(n=(t.flags&128)!==0,i=o.rendering,i===null)if(n)io(o,!1);else{if(Ae!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=ll(e),i!==null){for(t.flags|=128,io(o,!1),n=i.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)o=r,e=n,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ue(ve,ve.current&1|2),t.child}e=e.sibling}o.tail!==null&&ke()>Os&&(t.flags|=128,n=!0,io(o,!1),t.lanes=4194304)}else{if(!n)if(e=ll(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),io(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!me)return He(t),null}else 2*ke()-o.renderingStartTime>Os&&r!==1073741824&&(t.flags|=128,n=!0,io(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ke(),t.sibling=null,r=ve.current,ue(ve,n?r&1|2:r&1),t):(He(t),null);case 22:case 23:return sh(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?ut&1073741824&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function g1(e,t){switch($f(t),t.tag){case 1:return it(t.type)&&tl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return As(),pe(ot),pe(Ge),qf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Kf(t),null;case 13:if(pe(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));Rs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ve),null;case 4:return As(),null;case 10:return Bf(t.type._context),null;case 22:case 23:return sh(),null;case 24:return null;default:return null}}var Yi=!1,qe=!1,v1=typeof WeakSet=="function"?WeakSet:Set,z=null;function ds(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){xe(e,t,n)}else r.current=null}function Td(e,t,r){try{r()}catch(n){xe(e,t,n)}}var sm=!1;function y1(e,t){if(ud=Xa,e=ey(),Df(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,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,a=-1,l=-1,c=0,u=0,f=e,d=null;t:for(;;){for(var m;f!==r||s!==0&&f.nodeType!==3||(a=i+s),f!==o||n!==0&&f.nodeType!==3||(l=i+n),f.nodeType===3&&(i+=f.nodeValue.length),(m=f.firstChild)!==null;)d=f,f=m;for(;;){if(f===e)break t;if(d===r&&++c===s&&(a=i),d===o&&++u===n&&(l=i),(m=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=m}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(dd={focusedElem:e,selectionRange:r},Xa=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,x=v.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Dt(t.type,g),x);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(_){xe(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return v=sm,sm=!1,v}function No(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 o=s.destroy;s.destroy=void 0,o!==void 0&&Td(t,r,o)}s=s.next}while(s!==n)}}function ql(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 Rd(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 Jy(e){var t=e.alternate;t!==null&&(e.alternate=null,Jy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[rr],delete t[Jo],delete t[pd],delete t[e1],delete t[t1])),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 Xy(e){return e.tag===5||e.tag===3||e.tag===4}function om(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xy(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 Pd(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=el));else if(n!==4&&(e=e.child,e!==null))for(Pd(e,t,r),e=e.sibling;e!==null;)Pd(e,t,r),e=e.sibling}function Ad(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(Ad(e,t,r),e=e.sibling;e!==null;)Ad(e,t,r),e=e.sibling}var Me=null,$t=!1;function Pr(e,t,r){for(r=r.child;r!==null;)Qy(e,t,r),r=r.sibling}function Qy(e,t,r){if(nr&&typeof nr.onCommitFiberUnmount=="function")try{nr.onCommitFiberUnmount(Ul,r)}catch{}switch(r.tag){case 5:qe||ds(r,t);case 6:var n=Me,s=$t;Me=null,Pr(e,t,r),Me=n,$t=s,Me!==null&&($t?(e=Me,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Me.removeChild(r.stateNode));break;case 18:Me!==null&&($t?(e=Me,r=r.stateNode,e.nodeType===8?eu(e.parentNode,r):e.nodeType===1&&eu(e,r),Vo(e)):eu(Me,r.stateNode));break;case 4:n=Me,s=$t,Me=r.stateNode.containerInfo,$t=!0,Pr(e,t,r),Me=n,$t=s;break;case 0:case 11:case 14:case 15:if(!qe&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Td(r,t,i),s=s.next}while(s!==n)}Pr(e,t,r);break;case 1:if(!qe&&(ds(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){xe(r,t,a)}Pr(e,t,r);break;case 21:Pr(e,t,r);break;case 22:r.mode&1?(qe=(n=qe)||r.memoizedState!==null,Pr(e,t,r),qe=n):Pr(e,t,r);break;default:Pr(e,t,r)}}function im(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new v1),t.forEach(function(n){var s=T1.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function jt(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var o=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:Me=a.stateNode,$t=!1;break e;case 3:Me=a.stateNode.containerInfo,$t=!0;break e;case 4:Me=a.stateNode.containerInfo,$t=!0;break e}a=a.return}if(Me===null)throw Error(j(160));Qy(o,i,s),Me=null,$t=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){xe(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Zy(t,e),t=t.sibling}function Zy(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jt(t,e),Xt(e),n&4){try{No(3,e,e.return),ql(3,e)}catch(g){xe(e,e.return,g)}try{No(5,e,e.return)}catch(g){xe(e,e.return,g)}}break;case 1:jt(t,e),Xt(e),n&512&&r!==null&&ds(r,r.return);break;case 5:if(jt(t,e),Xt(e),n&512&&r!==null&&ds(r,r.return),e.flags&32){var s=e.stateNode;try{zo(s,"")}catch(g){xe(e,e.return,g)}}if(n&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=r!==null?r.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&xv(s,o),ed(a,i);var c=ed(a,o);for(i=0;i<l.length;i+=2){var u=l[i],f=l[i+1];u==="style"?Cv(s,f):u==="dangerouslySetInnerHTML"?Ev(s,f):u==="children"?zo(s,f):Sf(s,u,f,c)}switch(a){case"input":Yu(s,o);break;case"textarea":_v(s,o);break;case"select":var d=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m!=null?ms(s,!!o.multiple,m,!1):d!==!!o.multiple&&(o.defaultValue!=null?ms(s,!!o.multiple,o.defaultValue,!0):ms(s,!!o.multiple,o.multiple?[]:"",!1))}s[Jo]=o}catch(g){xe(e,e.return,g)}}break;case 6:if(jt(t,e),Xt(e),n&4){if(e.stateNode===null)throw Error(j(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(g){xe(e,e.return,g)}}break;case 3:if(jt(t,e),Xt(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Vo(t.containerInfo)}catch(g){xe(e,e.return,g)}break;case 4:jt(t,e),Xt(e);break;case 13:jt(t,e),Xt(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(rh=ke())),n&4&&im(e);break;case 22:if(u=r!==null&&r.memoizedState!==null,e.mode&1?(qe=(c=qe)||u,jt(t,e),qe=c):jt(t,e),Xt(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(z=e,u=e.child;u!==null;){for(f=z=u;z!==null;){switch(d=z,m=d.child,d.tag){case 0:case 11:case 14:case 15:No(4,d,d.return);break;case 1:ds(d,d.return);var v=d.stateNode;if(typeof v.componentWillUnmount=="function"){n=d,r=d.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){xe(n,r,g)}}break;case 5:ds(d,d.return);break;case 22:if(d.memoizedState!==null){lm(f);continue}}m!==null?(m.return=d,z=m):lm(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,i=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=kv("display",i))}catch(g){xe(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){xe(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:jt(t,e),Xt(e),n&4&&im(e);break;case 21:break;default:jt(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Xy(r)){var n=r;break e}r=r.return}throw Error(j(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(zo(s,""),n.flags&=-33);var o=om(e);Ad(e,o,s);break;case 3:case 4:var i=n.stateNode.containerInfo,a=om(e);Pd(e,a,i);break;default:throw Error(j(161))}}catch(l){xe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function w1(e,t,r){z=e,ew(e)}function ew(e,t,r){for(var n=(e.mode&1)!==0;z!==null;){var s=z,o=s.child;if(s.tag===22&&n){var i=s.memoizedState!==null||Yi;if(!i){var a=s.alternate,l=a!==null&&a.memoizedState!==null||qe;a=Yi;var c=qe;if(Yi=i,(qe=l)&&!c)for(z=s;z!==null;)i=z,l=i.child,i.tag===22&&i.memoizedState!==null?cm(s):l!==null?(l.return=i,z=l):cm(s);for(;o!==null;)z=o,ew(o),o=o.sibling;z=s,Yi=a,qe=c}am(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,z=o):am(e)}}function am(e){for(;z!==null;){var t=z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:qe||ql(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!qe)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Dt(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Vp(t,o,n);break;case 3:var i=t.updateQueue;if(i!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Vp(t,i,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Vo(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(j(163))}qe||t.flags&512&&Rd(t)}catch(d){xe(t,t.return,d)}}if(t===e){z=null;break}if(r=t.sibling,r!==null){r.return=t.return,z=r;break}z=t.return}}function lm(e){for(;z!==null;){var t=z;if(t===e){z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,z=r;break}z=t.return}}function cm(e){for(;z!==null;){var t=z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ql(4,t)}catch(l){xe(t,r,l)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(l){xe(t,s,l)}}var o=t.return;try{Rd(t)}catch(l){xe(t,o,l)}break;case 5:var i=t.return;try{Rd(t)}catch(l){xe(t,i,l)}}}catch(l){xe(t,t.return,l)}if(t===e){z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,z=a;break}z=t.return}}var b1=Math.ceil,dl=Cr.ReactCurrentDispatcher,eh=Cr.ReactCurrentOwner,kt=Cr.ReactCurrentBatchConfig,se=0,Le=null,Te=null,Ue=0,ut=0,fs=on(0),Ae=0,ri=null,kn=0,Gl=0,th=0,Oo=null,nt=null,rh=0,Os=1/0,ur=null,fl=!1,Nd=null,Yr=null,Ji=!1,Wr=null,hl=0,jo=0,Od=null,Na=-1,Oa=0;function Xe(){return se&6?ke():Na!==-1?Na:Na=ke()}function Jr(e){return e.mode&1?se&2&&Ue!==0?Ue&-Ue:n1.transition!==null?(Oa===0&&(Oa=$v()),Oa):(e=oe,e!==0||(e=window.event,e=e===void 0?16:Vv(e.type)),e):1}function Bt(e,t,r,n){if(50<jo)throw jo=0,Od=null,Error(j(185));vi(e,r,n),(!(se&2)||e!==Le)&&(e===Le&&(!(se&2)&&(Gl|=r),Ae===4&&Mr(e,Ue)),at(e,n),r===1&&se===0&&!(t.mode&1)&&(Os=ke()+500,Hl&&an()))}function at(e,t){var r=e.callbackNode;nE(e,t);var n=Ja(e,e===Le?Ue:0);if(n===0)r!==null&&yp(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&yp(r),t===1)e.tag===0?r1(um.bind(null,e)):uy(um.bind(null,e)),QE(function(){!(se&6)&&an()}),r=null;else{switch(Uv(n)){case 1:r=Rf;break;case 4:r=Dv;break;case 16:r=Ya;break;case 536870912:r=Mv;break;default:r=Ya}r=lw(r,tw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function tw(e,t){if(Na=-1,Oa=0,se&6)throw Error(j(327));var r=e.callbackNode;if(bs()&&e.callbackNode!==r)return null;var n=Ja(e,e===Le?Ue:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=pl(e,n);else{t=n;var s=se;se|=2;var o=nw();(Le!==e||Ue!==t)&&(ur=null,Os=ke()+500,yn(e,t));do try{S1();break}catch(a){rw(e,a)}while(!0);zf(),dl.current=o,se=s,Te!==null?t=0:(Le=null,Ue=0,t=Ae)}if(t!==0){if(t===2&&(s=od(e),s!==0&&(n=s,t=jd(e,s))),t===1)throw r=ri,yn(e,0),Mr(e,n),at(e,ke()),r;if(t===6)Mr(e,n);else{if(s=e.current.alternate,!(n&30)&&!x1(s)&&(t=pl(e,n),t===2&&(o=od(e),o!==0&&(n=o,t=jd(e,o))),t===1))throw r=ri,yn(e,0),Mr(e,n),at(e,ke()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(j(345));case 2:fn(e,nt,ur);break;case 3:if(Mr(e,n),(n&130023424)===n&&(t=rh+500-ke(),10<t)){if(Ja(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Xe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=hd(fn.bind(null,e,nt,ur),t);break}fn(e,nt,ur);break;case 4:if(Mr(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var i=31-zt(n);o=1<<i,i=t[i],i>s&&(s=i),n&=~o}if(n=s,n=ke()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*b1(n/1960))-n,10<n){e.timeoutHandle=hd(fn.bind(null,e,nt,ur),n);break}fn(e,nt,ur);break;case 5:fn(e,nt,ur);break;default:throw Error(j(329))}}}return at(e,ke()),e.callbackNode===r?tw.bind(null,e):null}function jd(e,t){var r=Oo;return e.current.memoizedState.isDehydrated&&(yn(e,t).flags|=256),e=pl(e,t),e!==2&&(t=nt,nt=r,t!==null&&Id(t)),e}function Id(e){nt===null?nt=e:nt.push.apply(nt,e)}function x1(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],o=s.getSnapshot;s=s.value;try{if(!Ht(o(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mr(e,t){for(t&=~th,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-zt(t),n=1<<r;e[r]=-1,t&=~n}}function um(e){if(se&6)throw Error(j(327));bs();var t=Ja(e,0);if(!(t&1))return at(e,ke()),null;var r=pl(e,t);if(e.tag!==0&&r===2){var n=od(e);n!==0&&(t=n,r=jd(e,n))}if(r===1)throw r=ri,yn(e,0),Mr(e,t),at(e,ke()),r;if(r===6)throw Error(j(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fn(e,nt,ur),at(e,ke()),null}function nh(e,t){var r=se;se|=1;try{return e(t)}finally{se=r,se===0&&(Os=ke()+500,Hl&&an())}}function Cn(e){Wr!==null&&Wr.tag===0&&!(se&6)&&bs();var t=se;se|=1;var r=kt.transition,n=oe;try{if(kt.transition=null,oe=1,e)return e()}finally{oe=n,kt.transition=r,se=t,!(se&6)&&an()}}function sh(){ut=fs.current,pe(fs)}function yn(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,XE(r)),Te!==null)for(r=Te.return;r!==null;){var n=r;switch($f(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&tl();break;case 3:As(),pe(ot),pe(Ge),qf();break;case 5:Kf(n);break;case 4:As();break;case 13:pe(ve);break;case 19:pe(ve);break;case 10:Bf(n.type._context);break;case 22:case 23:sh()}r=r.return}if(Le=e,Te=e=Xr(e.current,null),Ue=ut=t,Ae=0,ri=null,th=Gl=kn=0,nt=Oo=null,mn!==null){for(t=0;t<mn.length;t++)if(r=mn[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,o=r.pending;if(o!==null){var i=o.next;o.next=s,n.next=i}r.pending=n}mn=null}return e}function rw(e,t){do{var r=Te;try{if(zf(),Ra.current=ul,cl){for(var n=ye.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}cl=!1}if(En=0,Ie=Pe=ye=null,Ao=!1,Zo=0,eh.current=null,r===null||r.return===null){Ae=1,ri=t,Te=null;break}e:{var o=e,i=r.return,a=r,l=t;if(t=Ue,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var d=u.alternate;d?(u.updateQueue=d.updateQueue,u.memoizedState=d.memoizedState,u.lanes=d.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=Xp(i);if(m!==null){m.flags&=-257,Qp(m,i,a,o,t),m.mode&1&&Jp(o,c,t),t=m,l=c;var v=t.updateQueue;if(v===null){var g=new Set;g.add(l),t.updateQueue=g}else v.add(l);break e}else{if(!(t&1)){Jp(o,c,t),oh();break e}l=Error(j(426))}}else if(me&&a.mode&1){var x=Xp(i);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Qp(x,i,a,o,t),Uf(Ns(l,a));break e}}o=l=Ns(l,a),Ae!==4&&(Ae=2),Oo===null?Oo=[o]:Oo.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var y=Uy(o,l,t);Hp(o,y);break e;case 1:a=l;var w=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Yr===null||!Yr.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var _=Fy(o,a,t);Hp(o,_);break e}}o=o.return}while(o!==null)}ow(r)}catch(S){t=S,Te===r&&r!==null&&(Te=r=r.return);continue}break}while(!0)}function nw(){var e=dl.current;return dl.current=ul,e===null?ul:e}function oh(){(Ae===0||Ae===3||Ae===2)&&(Ae=4),Le===null||!(kn&268435455)&&!(Gl&268435455)||Mr(Le,Ue)}function pl(e,t){var r=se;se|=2;var n=nw();(Le!==e||Ue!==t)&&(ur=null,yn(e,t));do try{_1();break}catch(s){rw(e,s)}while(!0);if(zf(),se=r,dl.current=n,Te!==null)throw Error(j(261));return Le=null,Ue=0,Ae}function _1(){for(;Te!==null;)sw(Te)}function S1(){for(;Te!==null&&!GS();)sw(Te)}function sw(e){var t=aw(e.alternate,e,ut);e.memoizedProps=e.pendingProps,t===null?ow(e):Te=t,eh.current=null}function ow(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=g1(r,t),r!==null){r.flags&=32767,Te=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ae=6,Te=null;return}}else if(r=m1(r,t,ut),r!==null){Te=r;return}if(t=t.sibling,t!==null){Te=t;return}Te=t=e}while(t!==null);Ae===0&&(Ae=5)}function fn(e,t,r){var n=oe,s=kt.transition;try{kt.transition=null,oe=1,E1(e,t,r,n)}finally{kt.transition=s,oe=n}return null}function E1(e,t,r,n){do bs();while(Wr!==null);if(se&6)throw Error(j(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(j(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(sE(e,o),e===Le&&(Te=Le=null,Ue=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ji||(Ji=!0,lw(Ya,function(){return bs(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=kt.transition,kt.transition=null;var i=oe;oe=1;var a=se;se|=4,eh.current=null,y1(e,r),Zy(r,e),HE(dd),Xa=!!ud,dd=ud=null,e.current=r,w1(r),YS(),se=a,oe=i,kt.transition=o}else e.current=r;if(Ji&&(Ji=!1,Wr=e,hl=s),o=e.pendingLanes,o===0&&(Yr=null),QS(r.stateNode),at(e,ke()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(fl)throw fl=!1,e=Nd,Nd=null,e;return hl&1&&e.tag!==0&&bs(),o=e.pendingLanes,o&1?e===Od?jo++:(jo=0,Od=e):jo=0,an(),null}function bs(){if(Wr!==null){var e=Uv(hl),t=kt.transition,r=oe;try{if(kt.transition=null,oe=16>e?16:e,Wr===null)var n=!1;else{if(e=Wr,Wr=null,hl=0,se&6)throw Error(j(331));var s=se;for(se|=4,z=e.current;z!==null;){var o=z,i=o.child;if(z.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(z=c;z!==null;){var u=z;switch(u.tag){case 0:case 11:case 15:No(8,u,o)}var f=u.child;if(f!==null)f.return=u,z=f;else for(;z!==null;){u=z;var d=u.sibling,m=u.return;if(Jy(u),u===c){z=null;break}if(d!==null){d.return=m,z=d;break}z=m}}}var v=o.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}z=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,z=i;else e:for(;z!==null;){if(o=z,o.flags&2048)switch(o.tag){case 0:case 11:case 15:No(9,o,o.return)}var y=o.sibling;if(y!==null){y.return=o.return,z=y;break e}z=o.return}}var w=e.current;for(z=w;z!==null;){i=z;var b=i.child;if(i.subtreeFlags&2064&&b!==null)b.return=i,z=b;else e:for(i=w;z!==null;){if(a=z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ql(9,a)}}catch(S){xe(a,a.return,S)}if(a===i){z=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,z=_;break e}z=a.return}}if(se=s,an(),nr&&typeof nr.onPostCommitFiberRoot=="function")try{nr.onPostCommitFiberRoot(Ul,e)}catch{}n=!0}return n}finally{oe=r,kt.transition=t}}return!1}function dm(e,t,r){t=Ns(r,t),t=Uy(e,t,1),e=Gr(e,t,1),t=Xe(),e!==null&&(vi(e,1,t),at(e,t))}function xe(e,t,r){if(e.tag===3)dm(e,e,r);else for(;t!==null;){if(t.tag===3){dm(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Yr===null||!Yr.has(n))){e=Ns(r,e),e=Fy(t,e,1),t=Gr(t,e,1),e=Xe(),t!==null&&(vi(t,1,e),at(t,e));break}}t=t.return}}function k1(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&r,Le===e&&(Ue&r)===r&&(Ae===4||Ae===3&&(Ue&130023424)===Ue&&500>ke()-rh?yn(e,0):th|=r),at(e,t)}function iw(e,t){t===0&&(e.mode&1?(t=Fi,Fi<<=1,!(Fi&130023424)&&(Fi=4194304)):t=1);var r=Xe();e=xr(e,t),e!==null&&(vi(e,t,r),at(e,r))}function C1(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),iw(e,r)}function T1(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(j(314))}n!==null&&n.delete(t),iw(e,r)}var aw;aw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)st=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return st=!1,p1(e,t,r);st=!!(e.flags&131072)}else st=!1,me&&t.flags&1048576&&dy(t,sl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Aa(e,t),e=t.pendingProps;var s=Ts(t,Ge.current);ws(t,r),s=Yf(null,t,n,e,s,r);var o=Jf();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,it(n)?(o=!0,rl(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Hf(t),s.updater=Kl,t.stateNode=s,s._reactInternals=t,bd(t,n,e,r),t=Sd(null,t,n,!0,o,r)):(t.tag=0,me&&o&&Mf(t),Je(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Aa(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=P1(n),e=Dt(n,e),s){case 0:t=_d(null,t,n,e,r);break e;case 1:t=tm(null,t,n,e,r);break e;case 11:t=Zp(null,t,n,e,r);break e;case 14:t=em(null,t,n,Dt(n.type,e),r);break e}throw Error(j(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Dt(n,s),_d(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Dt(n,s),tm(e,t,n,s,r);case 3:e:{if(Hy(t),e===null)throw Error(j(387));n=t.pendingProps,o=t.memoizedState,s=o.element,vy(e,t),al(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Ns(Error(j(423)),t),t=rm(e,t,n,r,s);break e}else if(n!==s){s=Ns(Error(j(424)),t),t=rm(e,t,n,r,s);break e}else for(ht=qr(t.stateNode.containerInfo.firstChild),pt=t,me=!0,Ut=null,r=my(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Rs(),n===s){t=_r(e,t,r);break e}Je(e,t,n,r)}t=t.child}return t;case 5:return yy(t),e===null&&vd(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,fd(n,s)?i=null:o!==null&&fd(n,o)&&(t.flags|=32),Wy(e,t),Je(e,t,i,r),t.child;case 6:return e===null&&vd(t),null;case 13:return Vy(e,t,r);case 4:return Vf(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ps(t,
vendor: 4,824 bytes, line 41
41null,n,r):Je(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Dt(n,s),Zp(e,t,n,s,r);case 7:return Je(e,t,t.pendingProps,r),t.child;case 8:return Je(e,t,t.pendingProps.children,r),t.child;case 12:return Je(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,ue(ol,n._currentValue),n._currentValue=i,o!==null)if(Ht(o.value,i)){if(o.children===s.children&&!ot.current){t=_r(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=yr(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),yd(o.return,r,t),a.lanes|=r;break}l=l.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(j(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),yd(i,r,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Je(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,ws(t,r),s=Tt(s),n=n(s),t.flags|=1,Je(e,t,n,r),t.child;case 14:return n=t.type,s=Dt(n,t.pendingProps),s=Dt(n.type,s),em(e,t,n,s,r);case 15:return zy(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Dt(n,s),Aa(e,t),t.tag=1,it(n)?(e=!0,rl(t)):e=!1,ws(t,r),$y(t,n,s),bd(t,n,s,r),Sd(null,t,n,!0,e,r);case 19:return Ky(e,t,r);case 22:return By(e,t,r)}throw Error(j(156,t.tag))};function lw(e,t){return Lv(e,t)}function R1(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 Et(e,t,r,n){return new R1(e,t,r,n)}function ih(e){return e=e.prototype,!(!e||!e.isReactComponent)}function P1(e){if(typeof e=="function")return ih(e)?1:0;if(e!=null){if(e=e.$$typeof,e===kf)return 11;if(e===Cf)return 14}return 2}function Xr(e,t){var r=e.alternate;return r===null?(r=Et(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 ja(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")ih(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case rs:return wn(r.children,s,o,t);case Ef:i=8,s|=8;break;case Hu:return e=Et(12,r,t,s|2),e.elementType=Hu,e.lanes=o,e;case Vu:return e=Et(13,r,t,s),e.elementType=Vu,e.lanes=o,e;case Ku:return e=Et(19,r,t,s),e.elementType=Ku,e.lanes=o,e;case yv:return Yl(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gv:i=10;break e;case vv:i=9;break e;case kf:i=11;break e;case Cf:i=14;break e;case Ir:i=16,n=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=Et(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function wn(e,t,r,n){return e=Et(7,e,n,t),e.lanes=r,e}function Yl(e,t,r,n){return e=Et(22,e,n,t),e.elementType=yv,e.lanes=r,e.stateNode={isHidden:!1},e}function lu(e,t,r){return e=Et(6,e,null,t),e.lanes=r,e}function cu(e,t,r){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function A1(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=Wc(0),this.expirationTimes=Wc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wc(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ah(e,t,r,n,s,o,i,a,l){return e=new A1(e,t,r,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Et(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hf(o),e}function N1(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;
vendor: 4,591 bytes, line 41
41return{$$typeof:ts,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function cw(e){if(!e)return Zr;e=e._reactInternals;e:{if(An(e)!==e||e.tag!==1)throw Error(j(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(it(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(j(171))}if(e.tag===1){var r=e.type;if(it(r))return cy(e,r,t)}return t}function uw(e,t,r,n,s,o,i,a,l){return e=ah(r,n,!0,e,s,o,i,a,l),e.context=cw(null),r=e.current,n=Xe(),s=Jr(r),o=yr(n,s),o.callback=t??null,Gr(r,o,s),e.current.lanes=s,vi(e,s,n),at(e,n),e}function Jl(e,t,r,n){var s=t.current,o=Xe(),i=Jr(s);return r=cw(r),t.context===null?t.context=r:t.pendingContext=r,t=yr(o,i),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Gr(s,t,i),e!==null&&(Bt(e,s,i,o),Ta(e,s,i)),i}function ml(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function lh(e,t){fm(e,t),(e=e.alternate)&&fm(e,t)}function O1(){return null}var dw=typeof reportError=="function"?reportError:function(e){console.error(e)};function ch(e){this._internalRoot=e}Xl.prototype.render=ch.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(j(409));Jl(e,t,null,null)};Xl.prototype.unmount=ch.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cn(function(){Jl(null,e,null,null)}),t[br]=null}};function Xl(e){this._internalRoot=e}Xl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bv();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Dr.length&&t!==0&&t<Dr[r].priority;r++);Dr.splice(r,0,e),r===0&&Hv(e)}};function uh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ql(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hm(){}function j1(e,t,r,n,s){if(s){if(typeof n=="function"){var o=n;n=function(){var c=ml(i);o.call(c)}}var i=uw(t,n,e,0,null,!1,!1,"",hm);return e._reactRootContainer=i,e[br]=i.current,Go(e.nodeType===8?e.parentNode:e),Cn(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var c=ml(l);a.call(c)}}var l=ah(e,0,!1,null,null,!1,!1,"",hm);return e._reactRootContainer=l,e[br]=l.current,Go(e.nodeType===8?e.parentNode:e),Cn(function(){Jl(t,l,r,n)}),l}function Zl(e,t,r,n,s){var o=r._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var a=s;s=function(){var l=ml(i);a.call(l)}}Jl(t,i,e,s)}else i=j1(r,t,e,s,n);return ml(i)}Fv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=wo(t.pendingLanes);r!==0&&(Pf(t,r|1),at(t,ke()),!(se&6)&&(Os=ke()+500,an()))}break;case 13:Cn(function(){var n=xr(e,1);if(n!==null){var s=Xe();Bt(n,e,1,s)}}),lh(e,1)}};Af=function(e){if(e.tag===13){var t=xr(e,134217728);if(t!==null){var r=Xe();Bt(t,e,134217728,r)}lh(e,134217728)}};zv=function(e){if(e.tag===13){var t=Jr(e),r=xr(e,t);if(r!==null){var n=Xe();Bt(r,e,t,n)}lh(e,t)}};Bv=function(){return oe};Wv=function(e,t){var r=oe;try{return oe=e,t()}finally{oe=r}};rd=function(e,t,r){switch(t){case"input":if(Yu(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=Wl(n);if(!s)throw Error(j(90));bv(n),Yu(n,s)}}}break;case"textarea":_v(e,r);break;case"select":t=r.value,t!=null&&ms(e,!!r.multiple,t,!1)}};Pv=nh;Av=Cn;var I1={usingClientEntryPoint:!1,Events:[wi,is,Wl,Tv,Rv,nh]},ao={findFiberByHostInstance:pn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},L1={bundleType:ao.bundleType,version:ao.version,rendererPackageName:ao.rendererPackageName,rendererConfig:ao.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Cr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jv(e),e===null?null:e.stateNode},findFiberByHostInstance:ao.findFiberByHostInstance||O1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
41if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xi.isDisabled&&Xi.supportsFiber)try{Ul=Xi.inject(L1),nr=Xi}catch{}}vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I1;vt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uh(t))throw Error(j(200));return N1(e,t,null,r)};vt.createRoot=function(e,t){if(!uh(e))throw Error(j(299));var r=!1,n="",s=dw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=ah(e,1,!1,null,null,r,!1,n,s),e[br]=t.current,Go(e.nodeType===8?e.parentNode:e),new ch(t)};vt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(j(188)):(e=Object.keys(e).join(","),Error(j(268,e)));return e=jv(t),e=e===null?null:e.stateNode,e};vt.flushSync=function(e){return Cn(e)};vt.hydrate=function(e,t,r){if(!Ql(t))throw Error(j(200));return Zl(null,e,t,!0,r)};vt.hydrateRoot=function(e,t,r){if(!uh(e))throw Error(j(405));var n=r!=null&&r.hydratedSources||null,s=!1,o="",i=dw;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(i=r.onRecoverableError)),t=uw(t,null,e,1,r??null,s,!1,o,i),e[br]=t.current,Go(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Xl(t)};vt.render=function(e,t,r){if(!Ql(t))throw Error(j(200));return Zl(null,e,t,!1,r)};vt.unmountComponentAtNode=function(e){if(!Ql(e))throw Error(j(40));return e._reactRootContainer?(Cn(function(){Zl(null,null,e,!1,function(){e._reactRootContainer=null,e[br]=null})}),!0):!1};vt.unstable_batchedUpdates=nh;vt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Ql(r))throw Error(j(200));if(e==null||e._reactInternals===void 0)throw Error(j(38));return Zl(e,t,r,!1,n)};vt.version="18.3.1-next-f1338f8080-20240426";function fw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fw)}catch(e){console.error(e)}}fw(),fv.exports=vt;var Fs=fv.exports;const ec=Ds(Fs);var hw,pm=Fs;hw=pm.createRoot,pm.hydrateRoot;const D1="modulepreload",M1=function(e){return"/"+e},mm={},lt=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(r.map(l=>{if(l=M1(l),l in mm)return;mm[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":D1,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((d,m)=>{f.addEventListener("load",d),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},$1=1,U1=1e6;let uu=0;function F1(){return uu=(uu+1)%Number.MAX_SAFE_INTEGER,uu.toString()}const du=new Map,gm=e=>{if(du.has(e))return;const t=setTimeout(()=>{du.delete(e),Io({type:"REMOVE_TOAST",toastId:e})},U1);du.set(e,t)},z1=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,$1)};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?gm(r):e.toasts.forEach(n=>{gm(n.id)}),{...e,toasts:e.toasts.map(n=>
41n.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)}}},Ia=[];let La={toasts:[]};function Io(e){La=z1(La,e),Ia.forEach(t=>{t(La)})}function B1({...e}){const t=F1(),r=s=>Io({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Io({type:"DISMISS_TOAST",toastId:t});return Io({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function zs(){const[e,t]=h.useState(La);return h.useEffect(()=>(Ia.push(t),()=>{const r=Ia.indexOf(t);r>-1&&Ia.splice(r,1)}),[e]),{...e,toast:B1,dismiss:r=>Io({type:"DISMISS_TOAST",toastId:r})}}function W(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 W1(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tc(...e){return t=>e.forEach(r=>W1(r,t))}function ae(...e){return h.useCallback(tc(...e),e)}function Nn(e,t=[]){let r=[];function n(o,i){const a=h.createContext(i),l=r.length;r=[...r,i];function c(f){const{scope:d,children:m,...v}=f,g=(d==null?void 0:d[e][l])||a,x=h.useMemo(()=>v,Object.values(v));return p.jsx(g.Provider,{value:x,children:m})}function u(f,d){const m=(d==null?void 0:d[e][l])||a,v=h.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const s=()=>{const o=r.map(i=>h.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,H1(s,...t)]}function H1(...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(o){const i=n.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Pt=h.forwardRef((e,t)=>{const{children:r,...n}=e,s=h.Children.toArray(r),o=s.find(V1);if(o){const i=o.props.children,a=s.map(l=>l===o?h.Children.count(i)>1?h.Children.only(null):h.isValidElement(i)?i.props.children:null:l);return p.jsx(Ld,{...n,ref:t,children:h.isValidElement(i)?h.cloneElement(i,void 0,a):null})}return p.jsx(Ld,{...n,ref:t,children:r})});Pt.displayName="Slot";var Ld=h.forwardRef((e,t)=>{const{children:r,...n}=e;if(h.isValidElement(r)){const s=q1(r);return h.cloneElement(r,{...K1(n,r.props),ref:t?tc(t,s):s})}return h.Children.count(r)>1?h.Children.only(null):null});Ld.displayName="SlotClone";var pw=({children:e})=>p.jsx(p.Fragment,{children:e});function V1(e){return h.isValidElement(e)&&e.type===pw}function K1(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{o(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function q1(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 dh(e){const t=e+"CollectionProvider",[r,n]=Nn(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:v,children:g}=m,x=I.useRef(null),y=I.useRef(new Map).current;return p.jsx(s,{scope:v,itemMap:y,collectionRef:x,children:g})};i.displayName=t;const a=e+"CollectionSlot",l=I.forwardRef((m,v)=>{const{scope:g,children:x}=m,y=o(a,g),w=ae(v,y.collectionRef);return p.jsx(Pt,{ref:w,children:x})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",f=I.forwardRef((m,v)=>{const{scope:g,children:x,...y}=m,w=I.useRef(null),b=ae(v,w),_=o(c,g);return I.useEffect(()=>(_.itemMap.set(w,{ref:w,...y}),()=>void _.itemMap.delete(w))),p.jsx(Pt,{[u]:"",ref:b,children:x})});f.displayName=c;function d(m){const v=o(e+"CollectionConsumer",m);return I.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((_,S)=>y.indexOf(_.ref.current)-y.indexOf(S.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},d,n]}var G1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ee=G1.reduce((e,t)=>
vendor: 4,232 bytes, line 41
41{const r=h.forwardRef((n,s)=>{const{asChild:o,...i}=n,a=o?Pt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(a,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xi(e,t){e&&Fs.flushSync(()=>e.dispatchEvent(t))}function Re(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function fh(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e);h.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 Y1="DismissableLayer",Dd="dismissableLayer.update",J1="dismissableLayer.pointerDownOutside",X1="dismissableLayer.focusOutside",vm,mw=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gw=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=h.useContext(mw),[u,f]=h.useState(null),d=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),v=ae(t,E=>f(E)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(x),w=u?g.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,_=w>=y,S=Z1(E=>{const T=E.target,N=[...c.branches].some(P=>P.contains(T));!_||N||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},d),k=ek(E=>{const T=E.target;[...c.branches].some(P=>P.contains(T))||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},d);return fh(E=>{w===c.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},d),h.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(vm=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ym(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=vm)}},[u,d,r,c]),h.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ym())},[u,c]),h.useEffect(()=>{const E=()=>m({});return document.addEventListener(Dd,E),()=>document.removeEventListener(Dd,E)},[]),p.jsx(ee.div,{...l,ref:v,style:{pointerEvents:b?_?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,k.onFocusCapture),onBlurCapture:W(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,S.onPointerDownCapture)})});gw.displayName=Y1;var Q1="DismissableLayerBranch",vw=h.forwardRef((e,t)=>{const r=h.useContext(mw),n=h.useRef(null),s=ae(t,n);return h.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),p.jsx(ee.div,{...e,ref:s})});vw.displayName=Q1;function Z1(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){yw(J1,r,c,{discrete:!0})};const c={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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function ek(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e),n=h.useRef(!1);return h.useEffect(()=>{const s=o=>{o.target&&!n.current&&yw(X1,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ym(){const e=new CustomEvent(Dd);document.dispatchEvent(e)}function yw(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?xi(s,o):s.dispatchEvent(o)}var tk=gw,rk=vw,Ye=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},nk="Portal",ww=h.forwardRef((e,t)=>
41{var a;const{container:r,...n}=e,[s,o]=h.useState(!1);Ye(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?ec.createPortal(p.jsx(ee.div,{...n,ref:t}),i):null});ww.displayName=nk;function sk(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var Bs=e=>{const{present:t,children:r}=e,n=ok(t),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),o=ae(n.ref,ik(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:o}):null};Bs.displayName="Presence";function ok(e){const[t,r]=h.useState(),n=h.useRef({}),s=h.useRef(e),o=h.useRef("none"),i=e?"mounted":"unmounted",[a,l]=sk(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=Qi(n.current);o.current=a==="mounted"?c:"none"},[a]),Ye(()=>{const c=n.current,u=s.current;if(u!==e){const d=o.current,m=Qi(c);e?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),Ye(()=>{if(t){const c=f=>{const m=Qi(n.current).includes(f.animationName);f.target===t&&m&&Fs.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(o.current=Qi(n.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function Qi(e){return(e==null?void 0:e.animationName)||"none"}function ik(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 _i({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=ak({defaultProp:t,onChange:r}),o=e!==void 0,i=o?e:n,a=Re(r),l=h.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else s(c)},[o,e,s,a]);return[i,l]}function ak({defaultProp:e,onChange:t}){const r=h.useState(e),[n]=r,s=h.useRef(n),o=Re(t);return h.useEffect(()=>{s.current!==n&&(o(n),s.current=n)},[n,s,o]),r}var lk="VisuallyHidden",rc=h.forwardRef((e,t)=>p.jsx(ee.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));rc.displayName=lk;var ck=rc,hh="ToastProvider",[ph,uk,dk]=dh("Toast"),[bw,$$]=Nn("Toast",[dk]),[fk,nc]=bw(hh),xw=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,l]=h.useState(null),[c,u]=h.useState(0),f=h.useRef(!1),d=h.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${hh}\`. Expected non-empty \`string\`.`),p.jsx(ph.Provider,{scope:t,children:p.jsx(fk,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:h.useCallback(()=>u(m=>m+1),[]),onToastRemove:h.useCallback(()=>u(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d,children:i})})};xw.displayName=hh;var _w="ToastViewport",hk=["F8"],Md="toast.viewportPause",$d="toast.viewportResume",Sw=h.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=hk,label:s="Notifications ({hotkey})",...o}=e,i=nc(_w,r),a=uk(r),l=h.useRef(null),c=h.useRef(null),u=h.useRef(null),f=h.useRef(null),d=ae(t,f,i.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;h.useEffect(()=>{const x=y=>{var b;n.every(_=>y[_]||y.code===_)&&((b=f.current)==null||b.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[n]),h.useEffect(()=>{const x=l.current,y=f.current;if(v&&x&&y){const w=()=>{if(!i.isClosePausedRef.current){const k=new CustomEvent(Md);y.dispatchEvent(k),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const k=new CustomEvent($d);y.dispatchEvent(k),i.isClosePausedRef.current=!1}},_=k=>{!x.contains(k.relatedTarget)&&b()},S=()=>{x.contains(document.activeElement)||b()};return x.addEventListener("focusin",w),x.addEventListener("focusout",_),x.addEventListener("pointermove",w),x.addEventListener("pointerleave",S),window.addEventListener("blur",w),window.addEventListener("focus",b),()=>{x.removeEventListener("focusin",w),x.removeEventListener("focusout",_),x.removeEventListener("pointermove",w),x.removeEventListener("pointerleave",S),window.removeEventListener("blur",w),window.removeEventListener("focus",b)}}},[v,i.isClosePausedRef]);const g=h.useCallback(({tabbingDirection:x})=>{const w=a().map(b=>{const _=b.ref.current,S=[_,...Ck(_)];return x==="forwards"?S:S.reverse()});return(x==="forwards"?w.reverse():w).flat()},[a]);return h.useEffect(()=>{const x=f.current;if(x){const y=w=>{var S,k,E;const b=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!b){const T=document.activeElement,N=w.shiftKey;if(w.target===x&&N){(S=c.current)==null||S.focus();return}const F=g({tabbingDirection:N?"backwards":"forwards"}),K=F.findIndex(L=>L===T);fu(F.slice(K+1))?w.preventDefault():N?(k=c.current)==null||k.focus():(E=u.current)==null||E.focus()}};return x.addEventListener("keydown",y),()=>x.removeEventListener("keydown",y)}},[a,g]),p.jsxs(rk,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&p.jsx(Ud,{ref:c,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});fu(x)}}),p.jsx(ph.Slot,{scope:r,children:p.jsx(ee.ol,{tabIndex:-1,...o,ref:d})}),v&&p.jsx(Ud,{ref:u,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});fu(x)}})]})});Sw.displayName=_w;var Ew="ToastFocusProxy",Ud=h.forwardRef((e,t)=>
41{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=nc(Ew,r);return p.jsx(rc,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=o.viewport)!=null&&c.contains(a))&&n()}})});Ud.displayName=Ew;var sc="Toast",pk="toast.swipeStart",mk="toast.swipeMove",gk="toast.swipeCancel",vk="toast.swipeEnd",kw=h.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[a=!0,l]=_i({prop:n,defaultProp:s,onChange:o});return p.jsx(Bs,{present:r||a,children:p.jsx(bk,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:Re(e.onPause),onResume:Re(e.onResume),onSwipeStart:W(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:W(e.onSwipeMove,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:W(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:W(e.onSwipeEnd,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});kw.displayName=sc;var[yk,wk]=bw(sc,{onClose(){}}),bk=h.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:m,...v}=e,g=nc(sc,r),[x,y]=h.useState(null),w=ae(t,L=>y(L)),b=h.useRef(null),_=h.useRef(null),S=s||g.duration,k=h.useRef(0),E=h.useRef(S),T=h.useRef(0),{onToastAdd:N,onToastRemove:P}=g,O=Re(()=>{var V;(x==null?void 0:x.contains(document.activeElement))&&((V=g.viewport)==null||V.focus()),i()}),F=h.useCallback(L=>{!L||L===1/0||(window.clearTimeout(T.current),k.current=new Date().getTime(),T.current=window.setTimeout(O,L))},[O]);h.useEffect(()=>{const L=g.viewport;if(L){const V=()=>{F(E.current),c==null||c()},H=()=>{const X=new Date().getTime()-k.current;E.current=E.current-X,window.clearTimeout(T.current),l==null||l()};return L.addEventListener(Md,H),L.addEventListener($d,V),()=>{L.removeEventListener(Md,H),L.removeEventListener($d,V)}}},[g.viewport,S,l,c,F]),h.useEffect(()=>{o&&!g.isClosePausedRef.current&&F(S)},[o,S,g.isClosePausedRef,F]),h.useEffect(()=>(N(),()=>P()),[N,P]);const K=h.useMemo(()=>x?Ow(x):null,[x]);return g.viewport?p.jsxs(p.Fragment,{children:[K&&p.jsx(xk,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:K}),p.jsx(yk,{scope:r,onClose:O,children:Fs.createPortal(p.jsx(ph.ItemSlot,{scope:r,children:p.jsx(tk,{asChild:!0,onEscapeKeyDown:W(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||O(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:p.jsx(ee.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:W(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:W(e.onPointerDown,L=>{L.button===0&&(b.current={x:L.clientX,y:L.clientY})}),onPointerMove:W(e.onPointerMove,L=>{if(!b.current)return;const V=L.clientX-b.current.x,H=L.clientY-b.current.y,X=!!_.current,C=["left","right"].includes(g.swipeDirection),R=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,$=C?R(0,V):0,D=C?0:R(0,H),A=L.pointerType==="touch"?10:2,J={x:$,y:D},ie={originalEvent:L,delta:J};X?(_.current=J,Zi(mk,f,ie,{discrete:!1})):wm(J,g.swipeDirection,A)?(_.current=J,Zi(pk,u,ie,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(V)>A||Math.abs(H)>A)&&(b.current=null)}),onPointerUp:W(e.onPointerUp,L=>{const V=_.current,H=L.target;if(H.hasPointerCapture(L.pointerId)&&H.releasePointerCapture(L.pointerId),_.current=null,b.current=null,V){const X=L.currentTarget,C={originalEvent:L,delta:V};wm(V,g.swipeDirection,g.swipeThreshold)?Zi(vk,m,C,{discrete:!0}):Zi(gk,d,C,{discrete:!0}),X.addEventListener("click",R=>R.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),xk=e=>{const{__scopeToast:t,children:r,...n}=e,s=nc(sc,t),[o,i]=h.useState(!1),[a,l]=h.useState(!1);return Ek(()=>i(!0)),h.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:p.jsx(ww,{asChild:!0,children:p.jsx(rc,{...n,children:o&&p.jsxs(p.Fragment,{children:[s.label," ",r]})})})},_k="ToastTitle",Cw=h.forwardRef((e,t)=>
vendor: 4,741 bytes, lines 41-61
41{const{__scopeToast:r,...n}=e;return p.jsx(ee.div,{...n,ref:t})});Cw.displayName=_k;var Sk="ToastDescription",Tw=h.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return p.jsx(ee.div,{...n,ref:t})});Tw.displayName=Sk;var Rw="ToastAction",Pw=h.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?p.jsx(Nw,{altText:r,asChild:!0,children:p.jsx(mh,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Rw}\`. Expected non-empty \`string\`.`),null)});Pw.displayName=Rw;var Aw="ToastClose",mh=h.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=wk(Aw,r);return p.jsx(Nw,{asChild:!0,children:p.jsx(ee.button,{type:"button",...n,ref:t,onClick:W(e.onClick,s.onClose)})})});mh.displayName=Aw;var Nw=h.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return p.jsx(ee.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function Ow(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),kk(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Ow(n))}}),t}function Zi(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?xi(s,o):s.dispatchEvent(o)}var wm=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function Ek(e=()=>{}){const t=Re(e);Ye(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function kk(e){return e.nodeType===e.ELEMENT_NODE}function Ck(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 fu(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Tk=xw,jw=Sw,Iw=kw,Lw=Cw,Dw=Tw,Mw=Pw,$w=mh;function Uw(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;t<s;t++)e[t]&&(r=Uw(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Fw(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Uw(e))&&(n&&(n+=" "),n+=t);return n}const bm=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xm=Fw,Ws=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return xm(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const u=r==null?void 0:r[c],f=o==null?void 0:o[c];if(u===null)return null;const d=bm(u)||bm(f);return s[c][d]}),a=r&&Object.entries(r).reduce((c,u)=>{let[f,d]=u;return d===void 0||(c[f]=d),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:f,className:d,...m}=u;return Object.entries(m).every(v=>{let[g,x]=v;return Array.isArray(x)?x.includes({...o,...a}[g]):{...o,...a}[g]===x})?[...c,f,d]:c},[]);return xm(e,i,l,r==null?void 0:r.class,r==null?void 0:r.className)};/** 42 * @license lucide-react v0.462.0 - ISC 43 * 44 * This source code is licensed under the ISC license. 45 * See the LICENSE file in the root directory of this source tree. 46 */const Rk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zw=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** 47 * @license lucide-react v0.462.0 - ISC 48 * 49 * This source code is licensed under the ISC license. 50 * See the LICENSE file in the root directory of this source tree. 51 */var Pk={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"};/** 52 * @license lucide-react v0.462.0 - ISC 53 * 54 * This source code is licensed under the ISC license. 55 * See the LICENSE file in the root directory of this source tree. 56 */const Ak=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},l)=>h.createElement("svg",{ref:l,...Pk,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:zw("lucide",s),...a},[...i.map(([c,u])=>h.createElement(c,u)),...Array.isArray(o)?o:[o]]));/** 57 * @license lucide-react v0.462.0 - ISC 58 * 59 * This source code is licensed under the ISC license. 60 * See the LICENSE file in the root directory of this source tree. 61 */const _e=(e,t)=>
61{const r=h.forwardRef(({className:n,...s},o)=>h.createElement(Ak,{ref:o,iconNode:t,className:zw(`lucide-${Rk(e)}`,n),...s}));return r.displayName=`${e}`,r};/** 62 * @license lucide-react v0.462.0 - ISC 63 * 64 * This source code is licensed under the ISC license. 65 * See the LICENSE file in the root directory of this source tree. 66 */const Nk=_e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 67 * @license lucide-react v0.462.0 - ISC 68 * 69 * This source code is licensed under the ISC license. 70 * See the LICENSE file in the root directory of this source tree. 71 */const Ok=_e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 72 * @license lucide-react v0.462.0 - ISC 73 * 74 * This source code is licensed under the ISC license. 75 * See the LICENSE file in the root directory of this source tree. 76 */const jk=_e("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 77 * @license lucide-react v0.462.0 - ISC 78 * 79 * This source code is licensed under the ISC license. 80 * See the LICENSE file in the root directory of this source tree. 81 */const Ik=_e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 82 * @license lucide-react v0.462.0 - ISC 83 * 84 * This source code is licensed under the ISC license. 85 * See the LICENSE file in the root directory of this source tree. 86 */const Lk=_e("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 87 * @license lucide-react v0.462.0 - ISC 88 * 89 * This source code is licensed under the ISC license. 90 * See the LICENSE file in the root directory of this source tree. 91 */const Dk=_e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 92 * @license lucide-react v0.462.0 - ISC 93 * 94 * This source code is licensed under the ISC license. 95 * See the LICENSE file in the root directory of this source tree. 96 */const Mk=_e("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 97 * @license lucide-react v0.462.0 - ISC 98 * 99 * This source code is licensed under the ISC license. 100 * See the LICENSE file in the root directory of this source tree. 101 */const $k=_e("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 102 * @license lucide-react v0.462.0 - ISC 103 * 104 * This source code is licensed under the ISC license. 105 * See the LICENSE file in the root directory of this source tree. 106 */const Uk=_e("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 107 * @license lucide-react v0.462.0 - ISC 108 * 109 * This source code is licensed under the ISC license. 110 * See the LICENSE file in the root directory of this source tree. 111 */const Bw=_e("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** 112 * @license lucide-react v0.462.0 - ISC 113 * 114 * This source code is licensed under the ISC license. 115 * See the LICENSE file in the root directory of this source tree. 116 */const _m=_e("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/** 117 * @license lucide-react v0.462.0 - ISC 118 * 119 * This source code is licensed under the ISC license. 120 * See the LICENSE file in the root directory of this source tree. 121 */const Fk=_e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 122 * @license lucide-react v0.462.0 - ISC 123 * 124 * This source code is licensed under the ISC license. 125 * See the LICENSE file in the root directory of this source tree. 126 */const zk=_e("Repeat2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]]);/** 127 * @license lucide-react v0.462.0 - ISC 128 * 129 * This source code is licensed under the ISC license. 130 * See the LICENSE file in the root directory of this source tree. 131 */const Bk=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 132 * @license lucide-react v0.462.0 - ISC 133 * 134 * This source code is licensed under the ISC license. 135 * See the LICENSE file in the root directory of this source tree. 136 */const Wk=_e("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 137 * @license lucide-react v0.462.0 - ISC 138 * 139 * This source code is licensed under the ISC license. 140 * See the LICENSE file in the root directory of this source tree. 141 */const Hk=_e("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 142 * @license lucide-react v0.462.0 - ISC 143 * 144 * This source code is licensed under the ISC license. 145 * See the LICENSE file in the root directory of this source tree. 146 */const Vk=_e("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 147 * @license lucide-react v0.462.0 - ISC 148 * 149 * This source code is licensed under the ISC license. 150 * See the LICENSE file in the root directory of this source tree. 151 */const Kk=_e("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 152 * @license lucide-react v0.462.0 - ISC 153 * 154 * This source code is licensed under the ISC license. 155 * See the LICENSE file in the root directory of this source tree. 156 */const qk=_e("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 157 * @license lucide-react v0.462.0 - ISC 158 * 159 * This source code is licensed under the ISC license. 160 * See the LICENSE file in the root directory of this source tree. 161 */const Gk=_e("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 162 * @license lucide-react v0.462.0 - ISC 163 * 164 * This source code is licensed under the ISC license. 165 * See the LICENSE file in the root directory of this source tree. 166 */const gh=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 12,665 bytes, lines 166-171
166],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 167 * @license lucide-react v0.462.0 - ISC 168 * 169 * This source code is licensed under the ISC license. 170 * See the LICENSE file in the root directory of this source tree. 171 */const Yk=_e("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),vh="-",Jk=e=>{const t=Qk(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const a=i.split(vh);return a[0]===""&&a.length!==1&&a.shift(),Ww(a,t)||Xk(i)},getConflictingClassGroupIds:(i,a)=>{const l=r[i]||[];return a&&n[i]?[...l,...n[i]]:l}}},Ww=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?Ww(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(vh);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},Sm=/^\[(.+)\]$/,Xk=e=>{if(Sm.test(e)){const t=Sm.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Qk=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return eC(Object.entries(e.classGroups),r).forEach(([o,i])=>{Fd(i,n,o,t)}),n},Fd=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Em(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(Zk(s)){Fd(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{Fd(i,Em(t,o),r,n)})})},Em=(e,t)=>{let r=e;return t.split(vh).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Zk=e=>e.isThemeGetter,eC=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[t+i,a])):o);return[r,s]}):e,tC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,i)=>{r.set(o,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let i=r.get(o);if(i!==void 0)return i;if((i=n.get(o))!==void 0)return s(o,i),i},set(o,i){r.has(o)?r.set(o,i):s(o,i)}}},Hw="!",rC=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,i=a=>{const l=[];let c=0,u=0,f;for(let x=0;x<a.length;x++){let y=a[x];if(c===0){if(y===s&&(n||a.slice(x,x+o)===t)){l.push(a.slice(u,x)),u=x+o;continue}if(y==="/"){f=x;continue}}y==="["?c++:y==="]"&&c--}const d=l.length===0?a:a.substring(u),m=d.startsWith(Hw),v=m?d.substring(1):d,g=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:g}};return r?a=>r({className:a,parseClassName:i}):i},nC=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},sC=e=>({cache:tC(e.cacheSize),parseClassName:rC(e),...Jk(e)}),oC=/\s+/,iC=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],i=e.trim().split(oC);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:m}=r(c);let v=!!m,g=n(v?d.substring(0,m):d);if(!g){if(!v){a=c+(a.length>0?" "+a:a);continue}if(g=n(d),!g){a=c+(a.length>0?" "+a:a);continue}v=!1}const x=nC(u).join(":"),y=f?x+Hw:x,w=y+g;if(o.includes(w))continue;o.push(w);const b=s(g,v);for(let _=0;_<b.length;++_){const S=b[_];o.push(y+S)}a=c+(a.length>0?" "+a:a)}return a};function aC(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Vw(t))&&(n&&(n+=" "),n+=r);return n}const Vw=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Vw(e[n]))&&(r&&(r+=" "),r+=t);return r};function lC(e,...t){let r,n,s,o=i;function i(l){const c=t.reduce((u,f)=>f(u),e());return r=sC(c),n=r.cache.get,s=r.cache.set,o=a,a(l)}function a(l){const c=n(l);if(c)return c;const u=iC(l,r);return s(l,u),u}return function(){return o(aC.apply(null,arguments))}}const fe=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Kw=/^\[(?:([a-z-]+):)?(.+)\]$/i,cC=/^\d+\/\d+$/,uC=new Set(["px","full","screen"]),dC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fC=/\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$/,hC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lr=e=>xs(e)||uC.has(e)||cC.test(e),Ar=e=>Hs(e,"length",SC),xs=e=>!!e&&!Number.isNaN(Number(e)),hu=e=>Hs(e,"number",xs),lo=e=>!!e&&Number.isInteger(Number(e)),gC=e=>e.endsWith("%")&&xs(e.slice(0,-1)),Z=e=>Kw.test(e),Nr=e=>dC.test(e),vC=new Set(["length","size","percentage"]),yC=e=>Hs(e,vC,qw),wC=e=>Hs(e,"position",qw),bC=new Set(["image","url"]),xC=e=>Hs(e,bC,kC),_C=e=>Hs(e,"",EC),co=()=>!0,Hs=(e,t,r)=>{const n=Kw.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},SC=e=>fC.test(e)&&!hC.test(e),qw=()=>!1,EC=e=>pC.test(e),kC=e=>mC.test(e),CC=()=>{const e=fe("colors"),t=fe("spacing"),r=fe("blur"),n=fe("brightness"),s=fe("borderColor"),o=fe("borderRadius"),i=fe("borderSpacing"),a=fe("borderWidth"),l=fe("contrast"),c=fe("grayscale"),u=fe("hueRotate"),f=fe("invert"),d=fe("gap"),m=fe("gradientColorStops"),v=fe("gradientColorStopPositions"),g=fe("inset"),x=fe("margin"),y=fe("opacity"),w=fe("padding"),b=fe("saturate"),_=fe("scale"),S=fe("sepia"),k=fe("skew"),E=fe("space"),T=fe("translate"),N=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Z,t],F=()=>[Z,t],K=()=>["",lr,Ar],L=()=>["auto",xs,Z],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],R=()=>["","0",Z],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[xs,Z];return{cacheSize:500,separator:":",theme:{colors:[co],spacing:[lr,Ar],blur:["none","",Nr,Z],brightness:D(),borderColor:[e],borderRadius:["none","","full",Nr,Z],borderSpacing:F(),borderWidth:K(),contrast:D(),grayscale:R(),hueRotate:D(),invert:R(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[gC,Ar],inset:O(),margin:O(),opacity:D(),padding:F(),saturate:D(),scale:D(),sepia:R(),skew:D(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Z]}],container:["container"],columns:[{columns:[Nr]}],"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:[...V(),Z]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],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",lo,Z]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Z]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",lo,Z]}],"grid-cols":[{"grid-cols":[co]}],"col-start-end":[{col:["auto",{span:["full",lo,Z]},Z]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[co]}],"row-start-end":[{row:["auto",{span:[lo,Z]},Z]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Z]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Z,t]}],"min-w":[{"min-w":[Z,t,"min","max","fit"]}],"max-w":[{"max-w":[Z,t,"none","full","min","max","fit","prose",{screen:[Nr]},Nr]}],h:[{h:[Z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Z,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Nr,Ar]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hu]}],"font-family":[{font:[co]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Z]}],"line-clamp":[{"line-clamp":["none",xs,hu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",lr,Z]}],"list-image":[{"list-image":["none",Z]}],"list-style-type":[{list:["none","disc","decimal",Z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",lr,Ar]}],"underline-offset":[{"underline-offset":["auto",lr,Z]}],"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:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Z]}],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",Z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),wC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}
171],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"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":[y]}],"border-style":[{border:[...H(),"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":[y]}
vendor: 4,386 bytes, line 171
171],"divide-style":[{divide:H()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[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:["",...H()]}],"outline-offset":[{"outline-offset":[lr,Z]}],"outline-w":[{outline:[lr,Ar]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[lr,Ar]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Nr,_C]}],"shadow-color":[{shadow:[co]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Nr,Z]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Z]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",Z]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",Z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[lo,Z]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Z]}],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",Z]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[lr,Ar,hu]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
171none"]}]},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-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"]}}},TC=lC(CC);function U(...e){return TC(Fw(e))}const RC=Tk,Gw=h.forwardRef(({className:e,...t},r)=>p.jsx(jw,{ref:r,className:U("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}));Gw.displayName=jw.displayName;const PC=Ws("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"}}),Yw=h.forwardRef(({className:e,variant:t,...r},n)=>p.jsx(Iw,{ref:n,className:U(PC({variant:t}),e),...r}));Yw.displayName=Iw.displayName;const AC=h.forwardRef(({className:e,...t},r)=>p.jsx(Mw,{ref:r,className:U("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));AC.displayName=Mw.displayName;const Jw=h.forwardRef(({className:e,...t},r)=>p.jsx($w,{ref:r,className:U("absolute right-2 top-2 rounded-md p-1 text-foreground
171/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:p.jsx(gh,{className:"h-4 w-4"})}));Jw.displayName=$w.displayName;const Xw=h.forwardRef(({className:e,...t},r)=>p.jsx(Lw,{ref:r,className:U("text-sm font-semibold",e),...t}));Xw.displayName=Lw.displayName;const Qw=h.forwardRef(({className:e,...t},r)=>p.jsx(Dw,{ref:r,className:U("text-sm opacity-90",e),...t}));Qw.displayName=Dw.displayName;function NC(){const{toasts:e}=zs();return p.jsxs(RC,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return p.jsxs(Yw,{...o,children:[p.jsxs("div",{className:"grid gap-1",children:[r&&p.jsx(Xw,{children:r}),n&&p.jsx(Qw,{children:n})]}),s,p.jsx(Jw,{})]},t)}),p.jsx(Gw,{})]})}var km=["light","dark"],OC="(prefers-color-scheme: dark)",jC=h.createContext(void 0),IC={setTheme:e=>{},themes:[]},LC=()=>{var e;return(e=h.useContext(jC))!=null?e:IC};h.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:i,attrs:a,nonce:l})=>{let c=o==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;
171${`c.remove(${a.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=s?km.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",d=(v,g=!1,x=!0)=>{let y=i?i[v]:v,w=g?v+"|| ''":`'${y}'`,b="";return s&&x&&!g&&km.includes(v)&&(b+=`d.style.colorScheme = '${v}';`),r==="class"?g||y?b+=`c.add(${w})`:b+="null":y&&(b+=`d[s](n,${w})`),b},m=e?`!function(){${u}${d(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${OC}',m=window.matchMedia(t);if(m.media!==t||m.matches){${d("dark")}}else{${d("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${d(i?"x[e]":"e",!0)}}${c?"":"else{"+d(o,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${d(i?"x[e]":"e",!0)}}else{${d(o,!1,!1)};}${f}}catch(t){}}();`;return h.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})});var DC=e=>{switch(e){case"success":return UC;case"info":return zC;case"warning":return FC;case"error":return BC;default:return null}},MC=Array(12).fill(0),$C=({visible:e})=>I.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},I.createElement("div",{className:"sonner-spinner"},MC.map((t,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),UC=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),FC=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.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"})),zC=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),BC=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),WC=()=>
171{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},zd=1,HC=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:zd++,o=this.toasts.find(a=>a.id===s),i=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...e,id:s,title:r}),{...a,...e,id:s,dismissible:i,title:r}):a):this.addToast({title:r,...n,dismissible:i,id:s}),s},this.dismiss=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)=>
171this.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;return n.then(async o=>{if(KC(o)&&!o.ok){s=!1;let i=typeof t.error=="function"?await t.error(`HTTP error! status: ${o.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${o.status}`):t.description;this.create({id:r,type:"error",message:i,description:a})}else if(t.success!==void 0){s=!1;let i=typeof t.success=="function"?await t.success(o):t.success,a=typeof t.description=="function"?await t.description(o):t.description;this.create({id:r,type:"success",message:i,description:a})}}).catch(async o=>{if(t.error!==void 0){s=!1;let i=typeof t.error=="function"?await t.error(o):t.error,a=typeof t.description=="function"?await t.description(o):t.description;this.create({id:r,type:"error",message:i,description:a})}}).finally(()=>{var o;s&&(this.dismiss(r),r=void 0),(o=t.finally)==null||o.call(t)}),r},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||zd++;return this.create({jsx:e(r),id:r,...t}),r},this.subscribers=[],this.toasts=[]}},ct=new HC,VC=(e,t)=>{let r=(t==null?void 0:t.id)||zd++;return ct.addToast({title:e,...t,id:r}),r},KC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",qC=VC,GC=()=>ct.toasts;Object.assign(qC,{success:ct.success,info:ct.info,warning:ct.warning,error:ct.error,custom:ct.custom,message:ct.message,promise:ct.promise,dismiss:ct.dismiss,loading:ct.loading},{getHistory:GC});function YC(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))}YC(`: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}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-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;
171left: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;background:var(--gray1);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}: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:0;right:0;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}
171: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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);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-border: hsl(0, 0%, 20%);--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-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%)} 172`);function ea(e){return e.label!==void 0}var JC=3,XC="32px",QC=4e3,ZC=356,eT=14,tT=20,rT=200;function nT(...e){return e.filter(Boolean).join(" ")}var sT=e=>{var t,r,n,s,o,i,a,l,c,u;let{invert:f,toast:d,unstyled:m,interacting:v,setHeights:g,visibleToasts:x,heights:y,index:w,toasts:b,expanded:_,removeToast:S,defaultRichColors:k,closeButton:E,style:T,cancelButtonStyle:N,actionButtonStyle:P,className:O="",descriptionClassName:F="",duration:K,position:L,gap:V,loadingIcon:H,expandByDefault:X,classNames:C,icons:R,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:D,cn:A}
172=e,[J,ie]=I.useState(!1),[Be,re]=I.useState(!1),[Ne,Nt]=I.useState(!1),[Oe,Ot]=I.useState(!1),[Ni,Dn]=I.useState(0),[ln,Zs]=I.useState(0),Oi=I.useRef(null),Tr=I.useRef(null),Ic=w===0,Lc=w+1<=x,De=d.type,Mn=d.dismissible!==!1,eS=d.className||"",tS=d.descriptionClassName||"",ji=I.useMemo(()=>y.findIndex(Q=>Q.toastId===d.id)||0,[y,d.id]),rS=I.useMemo(()=>{var Q;return(Q=d.closeButton)!=null?Q:E},[d.closeButton,E]),tp=I.useMemo(()=>d.duration||K||QC,[d.duration,K]),Dc=I.useRef(0),$n=I.useRef(0),rp=I.useRef(0),Un=I.useRef(null),[np,nS]=L.split("-"),sp=I.useMemo(()=>y.reduce((Q,de,le)=>le>=ji?Q:Q+de.height,0),[y,ji]),op=WC(),sS=d.invert||f,Mc=De==="loading";$n.current=I.useMemo(()=>ji*V+sp,[ji,sp]),I.useEffect(()=>{ie(!0)},[]),I.useLayoutEffect(()=>{if(!J)return;let Q=Tr.current,de=Q.style.height;Q.style.height="auto";let le=Q.getBoundingClientRect().height;Q.style.height=de,Zs(le),g(Yt=>Yt.find(Jt=>Jt.toastId===d.id)?Yt.map(Jt=>Jt.toastId===d.id?{...Jt,height:le}:Jt):[{toastId:d.id,height:le,position:d.position},...Yt])},[J,d.title,d.description,g,d.id]);let Rr=I.useCallback(()=>{re(!0),Dn($n.current),g(Q=>Q.filter(de=>de.toastId!==d.id)),setTimeout(()=>{S(d)},rT)},[d,S,g,$n]);I.useEffect(()=>{if(d.promise&&De==="loading"||d.duration===1/0||d.type==="loading")return;let Q,de=tp;return _||v||D&&op?(()=>{if(rp.current<Dc.current){let le=new Date().getTime()-Dc.current;de=de-le}rp.current=new Date().getTime()})():de!==1/0&&(Dc.current=new Date().getTime(),Q=setTimeout(()=>{var le;(le=d.onAutoClose)==null||le.call(d,d),Rr()},de)),()=>clearTimeout(Q)},[_,v,X,d,tp,Rr,d.promise,De,D,op]),I.useEffect(()=>{let Q=Tr.current;if(Q){let de=Q.getBoundingClientRect().height;return Zs(de),g(le=>[{toastId:d.id,height:de,position:d.position},...le]),()=>g(le=>le.filter(Yt=>Yt.toastId!==d.id))}},[g,d.id]),I.useEffect(()=>{d.delete&&Rr()},[Rr,d.delete]);function oS(){return R!=null&&R.loading?I.createElement("div",{className:"sonner-loader","data-visible":De==="loading"},R.loading):H?I.createElement("div",{className:"sonner-loader","data-visible":De==="loading"},H):I.createElement($C,{visible:De==="loading"})}return I.createElement("li",{"aria-live":d.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Tr,className:A(O,eS,C==null?void 0:C.toast,(t=d==null?void 0:d.classNames)==null?void 0:t.toast,C==null?void 0:C.default,C==null?void 0:C[De],(r=d==null?void 0:d.classNames)==null?void 0:r[De]),"data-sonner-toast":"","data-rich-colors":(n=d.richColors)!=null?n:k,"data-styled":!(d.jsx||d.unstyled||m),"data-mounted":J,"data-promise":!!d.promise,"data-removed":Be,"data-visible":Lc,"data-y-position":np,"data-x-position":nS,"data-index":w,"data-front":Ic,"data-swiping":Ne,"data-dismissible":Mn,"data-type":De,"data-invert":sS,"data-swipe-out":Oe,"data-expanded":!!(_||X&&J),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${Be?Ni:$n.current}px`,"--initial-height":X?"auto":`${ln}px`,...T,...d.style},onPointerDown:Q=>{Mc||!Mn||(Oi.current=new Date,Dn($n.current),Q.target.setPointerCapture(Q.pointerId),Q.target.tagName!=="BUTTON"&&(Nt(!0),Un.current={x:Q.clientX,y:Q.clientY}))},onPointerUp:()=>{var Q,de,le,Yt;if(Oe||!Mn)return;Un.current=null;let Jt=Number(((Q=Tr.current)==null?void 0:Q.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Ii=new Date().getTime()-((de=Oi.current)==null?void 0:de.getTime()),iS=Math.abs(Jt)/Ii;if(Math.abs(Jt)>=tT||iS>.11){Dn($n.current),(le=d.onDismiss)==null||le.call(d,d),Rr(),Ot(!0);return}(Yt=Tr.current)==null||Yt.style.setProperty("--swipe-amount","0px"),Nt(!1)},onPointerMove:Q=>{var de;if(!Un.current||!Mn)return;let le=Q.clientY-Un.current.y,Yt=Q.clientX-Un.current.x,Jt=(np==="top"?Math.min:Math.max)(0,le),Ii=Q.pointerType==="touch"?10:2;Math.abs(Jt)>Ii?(de=Tr.current)==null||de.style.setProperty("--swipe-amount",`${le}px`):Math.abs(Yt)>Ii&&(Un.current=null)}},rS&&!d.jsx?I.createElement("button",{"aria-label":$,"data-disabled":Mc,"data-close-button":!0,onClick:Mc||!Mn?()=>{}:()=>{var Q;Rr(),(Q=d.onDismiss)==null||Q.call(d,d)},className:A(C==null?void 0:C.closeButton,(s=d==null?void 0:d.classNames)==null?void 0:s.closeButton)},I.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"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,d.jsx||I.isValidElement(d.title)?d.jsx||d.title:I.createElement(I.Fragment,null,De||d.icon||d.promise?I.createElement("div",{"data-icon":"",className:A(C==null?void 0:C.icon,(o=d==null?void 0:d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||oS():null,d.type!=="loading"?d.icon||(
172R==null?void 0:R[De])||DC(De):null):null,I.createElement("div",{"data-content":"",className:A(C==null?void 0:C.content,(i=d==null?void 0:d.classNames)==null?void 0:i.content)},I.createElement("div",{"data-title":"",className:A(C==null?void 0:C.title,(a=d==null?void 0:d.classNames)==null?void 0:a.title)},d.title),d.description?I.createElement("div",{"data-description":"",className:A(F,tS,C==null?void 0:C.description,(l=d==null?void 0:d.classNames)==null?void 0:l.description)},d.description):null),I.isValidElement(d.cancel)?d.cancel:d.cancel&&ea(d.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||N,onClick:Q=>{var de,le;ea(d.cancel)&&Mn&&((le=(de=d.cancel).onClick)==null||le.call(de,Q),Rr())},className:A(C==null?void 0:C.cancelButton,(c=d==null?void 0:d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,I.isValidElement(d.action)?d.action:d.action&&ea(d.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||P,onClick:Q=>{var de,le;ea(d.action)&&(Q.defaultPrevented||((le=(de=d.action).onClick)==null||le.call(de,Q),Rr()))},className:A(C==null?void 0:C.actionButton,(u=d==null?void 0:d.classNames)==null?void 0:u.actionButton)},d.action.label):null))};function Cm(){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}var oT=e=>{let{invert:t,position:r="bottom-right",hotkey:n=["altKey","KeyT"],expand:s,closeButton:o,className:i,offset:a,theme:l="light",richColors:c,duration:u,style:f,visibleToasts:d=JC,toastOptions:m,dir:v=Cm(),gap:g=eT,loadingIcon:x,icons:y,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:b,cn:_=nT}=e,[S,k]=I.useState([]),E=I.useMemo(()=>Array.from(new Set([r].concat(S.filter(D=>D.position).map(D=>D.position)))),[S,r]),[T,N]=I.useState([]),[P,O]=I.useState(!1),[F,K]=I.useState(!1),[L,V]=I.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=I.useRef(null),X=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=I.useRef(null),R=I.useRef(!1),$=I.useCallback(D=>{var A;(A=S.find(J=>J.id===D.id))!=null&&A.delete||ct.dismiss(D.id),k(J=>J.filter(({id:ie})=>ie!==D.id))},[S]);return I.useEffect(()=>ct.subscribe(D=>{if(D.dismiss){k(A=>A.map(J=>J.id===D.id?{...J,delete:!0}:J));return}setTimeout(()=>{ec.flushSync(()=>{k(A=>{let J=A.findIndex(ie=>ie.id===D.id);return J!==-1?[...A.slice(0,J),{...A[J],...D},...A.slice(J+1)]:[D,...A]})})})}),[]),I.useEffect(()=>{if(l!=="system"){V(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:D})=>{V(D?"dark":"light")})},[l]),I.useEffect(()=>{S.length<=1&&O(!1)},[S]),I.useEffect(()=>{let D=A=>{var J,ie;n.every(Be=>A[Be]||A.code===Be)&&(O(!0),(J=H.current)==null||J.focus()),A.code==="Escape"&&(document.activeElement===H.current||(ie=H.current)!=null&&ie.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[n]),I.useEffect(()=>{if(H.current)return()=>{C.current&&(C.current.focus({preventScroll:!0}),C.current=null,R.current=!1)}},[H.current]),S.length?I.createElement("section",{"aria-label":`${w} ${X}`,tabIndex:-1},E.map((D,A)=>{var J;let[ie,Be]=D.split("-");return I.createElement("ol",{key:D,dir:v==="auto"?Cm():v,tabIndex:-1,ref:H,className:i,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":ie,"data-x-position":Be,style:{"--front-toast-height":`${((J=T[0])==null?void 0:J.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||XC,"--width":`${ZC}px`,"--gap":`${g}px`,...f},onBlur:re=>{R.current&&!re.currentTarget.contains(re.relatedTarget)&&(R.current=!1,C.current&&(C.current.focus({preventScroll:!0}),C.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||R.current||(R.current=!0,C.current=re.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{F||O(!1)},onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},S.filter(re=>!re.position&&A===0||re.position===D).map((re,Ne)=>{var Nt,Oe;return I.createElement(sT,{key:re.id,icons:y,index:Ne,toast:re,defaultRichColors:c,duration:(Nt=m==null?void 0:m.duration)!=null?Nt:u,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:t,visibleToasts:d,closeButton:(Oe=m==null?void 0:m.closeButton)!=null?Oe:o,interacting:F,position:D,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:$,toasts:S.filter(Ot=>Ot.position==re.position),heights:T.filter(Ot=>Ot.position==re.position),setHeights:N,expandByDefault:s,gap:g,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:b,cn:_})}))})):null};const iT=({...e})=>{const{theme:t="system"}=LC();return p.jsx(oT,{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})};/** 173 * react-router v7.18.1 174 * 175 * Copyright (c) Remix Software Inc. 176 * 177 * This source code is licensed under the MIT license found in the 178 * LICENSE.md file in the root directory of this source tree. 179 * 180 * @license MIT 181 */var yh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Zw=/^[\\/]{2}/;function aT(e,t){return t+e.replace(/\\/g,"/")}var Tm="popstate";function Rm(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function lT(e={}){function t(s,o){let{pathname:i="/",search:a="",hash:l=""}=On(s.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),Bd("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(s,o){let i=s.document.querySelector("base"),a="";if(i&&i.getAttribute("href")){let l=s.location.href,c=l.indexOf("#");a=c===-1?l:l.slice(0,c)}
181return a+"#"+(typeof o=="string"?o:ni(o))}function n(s,o){At(s.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return uT(t,r,n,e)}function ge(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function At(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function cT(){return Math.random().toString(36).substring(2,10)}function Pm(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Bd(e,t,r=null,n,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?On(t):t,state:r,key:t&&t.key||n||cT(),mask:s}}function ni({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function On(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function uT(e,t,r,n={}){let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,a="POP",l=null,c=u();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function u(){return(i.state||{idx:null}).idx}function f(){a="POP";let x=u(),y=x==null?null:x-c;c=x,l&&l({action:a,location:g.location,delta:y})}function d(x,y){a="PUSH";let w=Rm(x)?x:Bd(g.location,x,y);r&&r(w,x),c=u()+1;let b=Pm(w,c),_=g.createHref(w.mask||w);try{i.pushState(b,"",_)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(_)}o&&l&&l({action:a,location:g.location,delta:1})}function m(x,y){a="REPLACE";let w=Rm(x)?x:Bd(g.location,x,y);r&&r(w,x),c=u();let b=Pm(w,c),_=g.createHref(w.mask||w);i.replaceState(b,"",_),o&&l&&l({action:a,location:g.location,delta:0})}function v(x){return dT(s,x)}let g={get action(){return a},get location(){return e(s,i)}
181,listen(x){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Tm,f),l=x,()=>{s.removeEventListener(Tm,f),l=null}},createHref(x){return t(s,x)},createURL:v,encodeLocation(x){let y=v(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:d,replace:m,go(x){return i.go(x)}};return g}function dT(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),ge(n,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:ni(t);return s=s.replace(/ $/,"%20"),!r&&Zw.test(s)&&(s=n+s),new URL(s,n)}function e0(e,t,r="/"){return fT(e,t,r,!1)}function fT(e,t,r,n,s){let o=typeof t=="string"?On(t):t,i=Sr(o.pathname||"/",r);if(i==null)return null;let a=hT(e),l=null,c=ET(i);for(let u=0;l==null&&u<a.length;++u)l=ST(a[u],c,n);return l}function hT(e){let t=t0(e);return pT(t),t}function t0(e,t=[],r=[],n="",s=!1){let o=(i,a,l=s,c)=>{let u={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(n)&&l)return;ge(u.relativePath.startsWith(n),`Absolute route path "${u.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(n.length)}let f=Wt([n,u.relativePath]),d=r.concat(u);i.children&&i.children.length>0&&(ge(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),t0(i.children,t,d,f,l)),!(i.path==null&&!i.index)&&t.push({path:f,score:xT(f,i.index),routesMeta:d.map((m,v)=>{let[g,x]=s0(m.relativePath,m.caseSensitive,v===d.length-1);return{...m,matcher:g,compiledParams:x}})})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let c of r0(i.path))o(i,a,!0,c)}),t}function r0(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let i=r0(n.join("/")),a=[];return a.push(...i.map(l=>l===""?o:[o,l].join("/"))),s&&a.push(...i),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function pT(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:_T(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var mT=/^:[\w-]+$/,gT=3,vT=2,yT=1,wT=10,bT=-2,Am=e=>e==="*";function xT(e,t){let r=e.split("/"),n=r.length;
181return r.some(Am)&&(n+=bT),t&&(n+=vT),r.filter(s=>!Am(s)).reduce((s,o)=>s+(mT.test(o)?gT:o===""?yT:wT),n)}function _T(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 ST(e,t,r=!1){let{routesMeta:n}=e,s={},o="/",i=[];for(let a=0;a<n.length;++a){let l=n[a],c=a===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",f={path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d=l.matcher&&l.compiledParams?n0(f,u,l.matcher,l.compiledParams):gl(f,u),m=l.route;if(!d&&c&&r&&!n[n.length-1].route.index&&(d=gl({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(s,d.params),i.push({params:s,pathname:Wt([o,d.pathname]),pathnameBase:TT(Wt([o,d.pathnameBase])),route:m}),d.pathnameBase!=="/"&&(o=Wt([o,d.pathnameBase]))}return i}function gl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=s0(e.path,e.caseSensitive,e.end);return n0(e,t,r,n)}function n0(e,t,r,n){let s=t.match(r);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:n.reduce((c,{paramName:u,isOptional:f},d)=>{if(u==="*"){let v=a[d]||"";i=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const m=a[d];return f&&!m?c[u]=void 0:c[u]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function s0(e,t=!1,r=!0){At(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,(i,a,l,c,u)=>{if(n.push({paramName:a,isOptional:l!=null}),l){let f=u.charAt(c+i.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function ET(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return At(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Sr(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 kT(e,t="/"){let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?On(e):e,o;return r?(r=o0(r),r.startsWith("/")?o=Nm(r.substring(1),"/"):o=Nm(r,t)):o=t,{pathname:o,search:RT(n),hash:PT(s)}}function Nm(e,t){let r=vl(t).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 <Link to="..."> and the router will parse it for you.`}function CT(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function wh(e){let t=CT(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function oc(e,t,r,n=!1){let s;typeof e=="string"?s=On(e):(s={...e},ge(!s.pathname||!s.pathname.includes("?"),pu("?","pathname","search",s)),ge(!s.pathname||!s.pathname.includes("#"),pu("#","pathname","hash",s)),ge(!s.search||!s.search.includes("#"),pu("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let d=i.split("/");for(;d[0]==="..";)d.shift(),f-=1;s.pathname=d.join("/")}a=f>=0?t[f]:"/"}let l=kT(s,a),c=i&&i!=="/"&&i.endsWith("/"),u=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var o0=e=>e.replace(/[\\/]{2,}/g,"/"),Wt=e=>o0(e.join("/")),vl=e=>e.replace(/\/+$/,""),TT=e=>vl(e).replace(/^\/*/,"/"),RT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,PT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,AT=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function NT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function OT(e){let t=e.map(r=>
181r.route.path).filter(Boolean);return Wt(t)||"/"}var i0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function a0(e,t){let r=e;if(typeof r!="string"||!yh.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,s=!1;if(i0)try{let o=new URL(window.location.href),i=Zw.test(r)?new URL(aT(r,o.protocol)):new URL(r),a=Sr(i.pathname,t);i.origin===o.origin&&a!=null?r=a+i.search+i.hash:s=!0}catch{At(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:s,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var l0=["POST","PUT","PATCH","DELETE"];new Set(l0);var jT=["GET",...l0];new Set(jT);var IT=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function LT(e){try{return IT.includes(new URL(e).protocol)}catch{return!1}}var Vs=h.createContext(null);Vs.displayName="DataRouter";var ic=h.createContext(null);ic.displayName="DataRouterState";var c0=h.createContext(!1);function DT(){return h.useContext(c0)}var u0=h.createContext({isTransitioning:!1});u0.displayName="ViewTransition";var MT=h.createContext(new Map);MT.displayName="Fetchers";var $T=h.createContext(null);$T.displayName="Await";var wt=h.createContext(null);wt.displayName="Navigation";var Si=h.createContext(null);Si.displayName="Location";var qt=h.createContext({outlet:null,matches:[],isDataRoute:!1});qt.displayName="Route";var bh=h.createContext(null);bh.displayName="RouteError";var d0="REACT_ROUTER_ERROR",UT="REDIRECT",FT="ROUTE_ERROR_RESPONSE";function zT(e){if(e.startsWith(`${d0}:${UT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function BT(e){if(e.startsWith(`${d0}:${FT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new AT(t.status,t.statusText,t.data)}catch{}}function WT(e,{relative:t}={}){ge(Ks(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=h.useContext(wt),{hash:s,pathname:o,search:i}=Ei(e,{relative:t}),a=o;return r!=="/"&&(a=o==="/"?r:Wt([r,o])),n.createHref({pathname:a,search:i,hash:s})}function Ks(){return h.useContext(Si)!=null}function et(){return ge(Ks(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Si).location}var f0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function h0(e){h.useContext(wt).static||h.useLayoutEffect(e)}function jn(){let{isDataRoute:e}=h.useContext(qt);return e?rR():HT()}function HT(){ge(Ks(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Vs),{basename:t,navigator:r}=h.useContext(wt),{matches:n}=h.useContext(qt),{pathname:s}=et(),o=JSON.stringify(wh(n)),i=h.useRef(!1);return h0(()=>{i.current=!0}),h.useCallback((l,c={})=>{if(At(i.current,f0),!i.current)return;if(typeof l=="number"){r.go(l);return}let u=oc(l,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Wt([t,u.pathname])),(c.replace?r.replace:r.push)(u,c.state,c)},[t,r,o,s,e])}h.createContext(null);function U$(){let{matches:e}=h.useContext(qt),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function Ei(e,{relative:t}={}){let{matches:r}=h.useContext(qt),{pathname:n}=et(),s=JSON.stringify(wh(r));return h.useMemo(()=>oc(e,JSON.parse(s),n,t==="path"),[e,s,n,t])}function VT(e,t){return p0(e,t)}function p0(e,t,r){var x;ge(Ks(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=h.useContext(wt),{matches:s}=h.useContext(qt),o=s[s.length-1],i=o?o.params:{},a=o?o.pathname:"/",l=o?o.pathnameBase:"/",c=o&&o.route;{let y=c&&c.path||"";g0(a,!c||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (under <Route path="${y}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 182 183Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let u=et(),f;if(t){let y=typeof t=="string"?On(t):t;ge(l==="/"||((x=y.pathname)==null?void 0:x.startsWith(l)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${y.pathname}" was given in the \`location\` prop.`),f=y}else f=u;let d=f.pathname||"/",m=d;if(l!=="/"){let y=l.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=r&&r.state.matches.length?r.state.matches.map(y=>Object.assign(y,{route:r.manifest[y.route.id]||y.route})):e0(e,{pathname:m});At(c||v!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),At(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=JT(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},i,y.params),pathname:Wt([l,n.encodeLocation?n.encodeLocation(y.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Wt([l,n.encodeLocation?n.encodeLocation(y.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),s,r);return t&&g?h.createElement(Si.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},g):g}function KT(){let e=tR(),t=NT(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"ð¿ Hey developer ð"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application
183Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:s},r):null,i)}var qT=h.createElement(KT,null),m0=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=BT(e.digest);r&&(e=r)}let t=e!==void 0?h.createElement(qt.Provider,{value:this.props.routeContext},h.createElement(bh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(GT,{error:e},t):t}};m0.contextType=c0;var mu=new WeakMap;function GT({children:e,error:t}){let{basename:r}=h.useContext(wt);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=zT(t.digest);if(n){let s=mu.get(t);if(s)throw s;let o=a0(n.location,r),i=o.absoluteURL||o.to;if(LT(i))throw new Error("Invalid redirect location");if(i0&&!mu.get(t))if(o.isExternal||n.reloadDocument)window.location.href=i;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw mu.set(t,a),a}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i}`})}}return e}function YT({routeContext:e,match:t,children:r}){let n=h.useContext(Vs);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(qt.Provider,{value:e},r)}function JT(e,t=[],r){let n=r==null?void 0:r.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,o=n==null?void 0:n.errors;if(o!=null){let u=s.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);ge(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let i=!1,a=-1;if(r&&n){i=n.renderFallback;for(let u=0;u<s.length;u++){let f=s[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(a=u),f.route.id){let{loaderData:d,errors:m}=n,v=f.route.loader&&!d.hasOwnProperty(f.route.id)&&(!m||m[f.route.id]===void 0);if(f.route.lazy||v){r.isStatic&&(i=!0),a>=0?s=s.slice(0,a+1):s=[s[0]];break}}}}let l=r==null?void 0:r.onError,c=n&&l?(u,f)=>{var d,m;l(u,{location:n.location,params:((m=(d=n.matches)==null?void 0:d[0])==null?void 0:m.params)??{},pattern:OT(n.matches),errorInfo:f})}:void 0;return s.reduceRight((u,f,d)=>{let m,v=!1,g=null,x=null;n&&(m=o&&f.route.id?o[f.route.id]:void 0,g=f.route.errorElement||qT,i&&(a<0&&d===0?(g0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,x=null):a===d&&(v=!0,x=f.route.hydrateFallbackElement||null)));let y=t.concat(s.slice(0,d+1)),w=()=>{let b;return m?b=g:v?b=x:f.route.Component?b=h.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=u,h.createElement(YT,{match:f,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:b})};return n&&(f.route.ErrorBoundary||f.route.errorElement||d===0)?h.createElement(m0,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:c}):w()},null)}function xh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XT(e){let t=h.useContext(Vs);return ge(t,xh(e)),t}function QT(e){let t=h.useContext(ic);return ge(t,xh(e)),t}function ZT(e){let t=h.useContext(qt);return ge(t,xh(e)),t}function _h(e){let t=ZT(e),r=t.matches[t.matches.length-1];return ge(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function eR(){return _h("useRouteId")}function tR(){var n;let e=h.useContext(bh),t=QT("useRouteError"),r=_h("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function rR(){let{router:e}=XT("useNavigate"),t=_h("useNavigate"),r=h.useRef(!1);return h0(()=>{r.current=!0}),h.useCallback(async(s,o={})=>{At(r.current,f0),r.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Om={};function g0(e,t,r){!t&&!Om[e]&&(Om[e]=!0,At(!1,r))}h.memo(nR);function nR({routes:e,manifest:t,future:r,state:n,isStatic:s,onError:o}){return p0(e,void 0,{manifest:t,state:n,isStatic:s,onError:o,future:r})}function sR({to:e,replace:t,state:r,relative:n}){ge(Ks(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=h.useContext(wt);At(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=h.useContext(qt),{pathname:i}=et(),a=jn(),l=oc(e,wh(o),i,n==="path"),c=JSON.stringify(l);return h.useEffect(()=>{a(JSON.parse(c),{replace:t,state:r,relative:n})},[a,c,n,t,r]),null}function Ve(e){ge(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function oR({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:s,static:o=!1,useTransitions:i}){ge(!Ks(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=h.useMemo(()=>({basename:a,navigator:s,static:o,useTransitions:i,future:{}}),[a,s,o,i]);typeof r=="string"&&(r=On(r));let{pathname:c="/",search:u="",hash:f="",state:d=null,key:m="default",mask:v}=r,g=h.useMemo(()=>{let x=Sr(c,a);
183return x==null?null:{location:{pathname:x,search:u,hash:f,state:d,key:m,mask:v},navigationType:n}},[a,c,u,f,d,m,n,v]);return At(g!=null,`<Router basename="${a}"> is not able to match the URL "${c}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:h.createElement(wt.Provider,{value:l},h.createElement(Si.Provider,{children:t,value:g}))}function iR({children:e,location:t}){return VT(Wd(e),t)}function Wd(e,t=[]){let r=[];return h.Children.forEach(e,(n,s)=>{if(!h.isValidElement(n))return;let o=[...t,s];if(n.type===h.Fragment){r.push.apply(r,Wd(n.props.children,o));return}ge(n.type===Ve,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ge(!n.props.index||!n.props.children,"An index route cannot have child routes.");let i={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=Wd(n.props.children,o)),r.push(i)}),r}var Da="get",Ma="application/x-www-form-urlencoded";function ac(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function aR(e){return ac(e)&&e.tagName.toLowerCase()==="button"}function lR(e){return ac(e)&&e.tagName.toLowerCase()==="form"}function cR(e){return ac(e)&&e.tagName.toLowerCase()==="input"}function uR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dR(e,t){return e.button===0&&(!t||t==="_self")&&!uR(e)}var ta=null;function fR(){if(ta===null)try{new FormData(document.createElement("form"),0),ta=!1}catch{ta=!0}return ta}var hR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function gu(e){return e!=null&&!hR.has(e)?(At(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ma}"`),null):e}function pR(e,t){let r,n,s,o,i;if(lR(e)){let a=e.getAttribute("action");n=a?Sr(a,t):null,r=e.getAttribute("method")||Da,s=gu(e.getAttribute("enctype"))||Ma,o=new FormData(e)}else if(aR(e)||cR(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(n=l?Sr(l,t):null,r=e.getAttribute("formmethod")||a.getAttribute("method")||Da,s=gu(e.getAttribute("formenctype"))||gu(a.getAttribute("enctype"))||Ma,o=new FormData(a,e),!fR()){let{name:c,type:u,value:f}=e;if(u==="image"){let d=c?`${c}.`:"";o.append(`${d}x`,"0"),o.append(`${d}y`,"0")}else c&&o.append(c,f)}}else{if(ac(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Da,n=null,s=Ma,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:s,formData:o,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function v0(e,t,r,n){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${n}`:s.pathname=`${s.pathname}.${n}`:s.pathname==="/"?s.pathname=`_root.${n}`:t&&Sr(s.pathname,t)==="/"?s.pathname=`${vl(t)}/_root.${n}`:s.pathname=`${vl(s.pathname)}.${n}`,s}async function mR(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gR(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function vR(e,t,r){let n=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let i=await mR(o,r);return i.links?i.links():[]}return[]}));return xR(n.flat(1).filter(gR).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function jm(e,t,r,n,s,o){let i=(l,c)=>r[c]?l.route.id!==r[c].route.id:!0,a=(l,c)=>{var u;return r[c].pathname!==l.pathname||((u=r[c].route.path)==null?void 0:u.endsWith("*"))&&r[c].params["*"]!==l.params["*"]};return o==="assets"?t.filter((l,c)=>i(l,c)||a(l,c)):o==="data"?t.filter((l,c)=>{var f;let u=n.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(i(l,c)||a(l,c))return!0;
183if(l.route.shouldRevalidate){let d=l.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((f=r[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function yR(e,t,{includeHydrateFallback:r}={}){return wR(e.map(n=>{let s=t.routes[n.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),r&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function wR(e){return[...new Set(e)]}function bR(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function xR(e,t){let r=new Set;return new Set(t),e.reduce((n,s)=>{let o=JSON.stringify(bR(s));return r.has(o)||(r.add(o),n.push({key:o,link:s})),n},[])}function Eh(){let e=h.useContext(Vs);return Sh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function _R(){let e=h.useContext(ic);return Sh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var kh=h.createContext(void 0);kh.displayName="FrameworkContext";function lc(){let e=h.useContext(kh);return Sh(e,"You must render this element inside a <HydratedRouter> element"),e}function SR(e,t){let r=h.useContext(kh),[n,s]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:f}=t,d=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let g=y=>{y.forEach(w=>{i(w.isIntersecting)})},x=new IntersectionObserver(g,{threshold:.5});return d.current&&x.observe(d.current),()=>{x.disconnect()}}},[e]),h.useEffect(()=>{if(n){let g=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(g)}}},[n]);let m=()=>{s(!0)},v=()=>{s(!1),i(!1)};return r?e!=="intent"?[o,d,{}]:[o,d,{onFocus:uo(a,m),onBlur:uo(l,v),onMouseEnter:uo(c,m),onMouseLeave:uo(u,v),onTouchStart:uo(f,m)}]:[!1,d,{}]}function uo(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function ER({page:e,...t}){let r=DT(),{nonce:n}=lc(),{router:s}=Eh(),o=h.useMemo(()=>e0(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?(t.nonce==null&&n&&(t={...t,nonce:n}),r?h.createElement(CR,{page:e,matches:o,...t}):h.createElement(TR,{page:e,matches:o,...t})):null}function kR(e){let{manifest:t,routeModules:r}=lc(),[n,s]=h.useState([]);return h.useEffect(()=>{let o=!1;return vR(e,t,r).then(i=>{o||s(i)}),()=>{o=!0}},[e,t,r]),n}function CR({page:e,matches:t,...r}){let n=et(),{future:s}=lc(),{basename:o}=Eh(),i=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let a=v0(e,o,s.v8_trailingSlashAwareDataRequests,"rsc"),l=!1,c=[];for(let u of t)typeof u.route.shouldRevalidate=="function"?l=!0:c.push(u.route.id);return l&&c.length>0&&a.searchParams.set("_routes",c.join(",")),[a.pathname+a.search]},[o,s.v8_trailingSlashAwareDataRequests,e,n,t]);return h.createElement(h.Fragment,null,i.map(a=>h.createElement("link",{key:a,rel:"prefetch",as:"fetch",href:a,...r})))}function TR({page:e,matches:t,...r}){let n=et(),{future:s,manifest:o,routeModules:i}=lc(),{basename:a}=Eh(),{loaderData:l,matches:c}=_R(),u=h.useMemo(()=>jm(e,t,c,o,n,"data"),[e,t,c,o,n]),f=h.useMemo(()=>jm(e,t,c,o,n,"assets"),[e,t,c,o,n]),d=h.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let g=new Set,x=!1;if(t.forEach(w=>{var _;let b=o.routes[w.route.id];!b||!b.hasLoader||(!u.some(S=>S.route.id===w.route.id)&&w.route.id in l&&((_=i[w.route.id])!=null&&_.shouldRevalidate)||b.hasClientLoader?x=!0:g.add(w.route.id))}),g.size===0)return[];let y=v0(e,a,s.v8_trailingSlashAwareDataRequests,"data");return x&&g.size>0&&y.searchParams.set("_routes",t.filter(w=>g.has(w.route.id)).map(w=>w.route.id).join(",")),[y.pathname+y.search]},[a,s.v8_trailingSlashAwareDataRequests,l,n,o,u,t,e,i]),m=h.useMemo(()=>yR(f,o),[f,o]),v=kR(f);return h.createElement(h.Fragment,null,d.map(g=>h.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...r})),m.map(g=>h.createElement("link",{key:g,rel:"modulepreload",href:g,...r})),v.map(({key:g,link:x})=>h.createElement("link",{key:g,nonce:r.nonce,...x,crossOrigin:x.crossOrigin??r.crossOrigin})))}function RR(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var PR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{PR&&(window.__reactRouterVersion="7.18.1")}catch{}
183function AR({basename:e,children:t,useTransitions:r,window:n}){let s=h.useRef();s.current==null&&(s.current=lT({window:n,v5Compat:!0}));let o=s.current,[i,a]=h.useState({action:o.action,location:o.location}),l=h.useCallback(c=>{r===!1?a(c):h.startTransition(()=>a(c))},[r]);return h.useLayoutEffect(()=>o.listen(l),[o,l]),h.createElement(oR,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}var vr=h.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:s,reloadDocument:o,replace:i,mask:a,state:l,target:c,to:u,preventScrollReset:f,viewTransition:d,defaultShouldRevalidate:m,...v},g){let{basename:x,navigator:y,useTransitions:w}=h.useContext(wt),b=typeof u=="string"&&yh.test(u),_=a0(u,x);u=_.to;let S=WT(u,{relative:s}),k=et(),E=null;if(a){let V=oc(a,[],k.mask?k.mask.pathname:"/",!0);x!=="/"&&(V.pathname=V.pathname==="/"?x:Wt([x,V.pathname])),E=y.createHref(V)}let[T,N,P]=SR(n,v),O=jR(u,{replace:i,mask:a,state:l,target:c,preventScrollReset:f,relative:s,viewTransition:d,defaultShouldRevalidate:m,useTransitions:w});function F(V){t&&t(V),V.defaultPrevented||O(V)}let K=!(_.isExternal||o),L=h.createElement("a",{...v,...P,href:(K?E:void 0)||_.absoluteURL||S,onClick:K?F:t,ref:RR(g,N),target:c,"data-discover":!b&&r==="render"?"true":void 0});return T&&!b?h.createElement(h.Fragment,null,L,h.createElement(ER,{page:S})):L});vr.displayName="Link";var y0=h.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:s=!1,style:o,to:i,viewTransition:a,children:l,...c},u){let f=Ei(i,{relative:c.relative}),d=et(),m=h.useContext(ic),{navigator:v,basename:g}=h.useContext(wt),x=m!=null&&$R(f)&&a===!0,y=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,w=d.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;r||(w=w.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&g&&(b=Sr(b,g)||b);const _=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let S=w===y||!s&&w.startsWith(y)&&w.charAt(_)==="/",k=b!=null&&(b===y||!s&&b.startsWith(y)&&b.charAt(y.length)==="/"),E={isActive:S,isPending:k,isTransitioning:x},T=S?t:void 0,N;typeof n=="function"?N=n(E):N=[n,S?"active":null,k?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let P=typeof o=="function"?o(E):o;return h.createElement(vr,{...c,"aria-current":T,className:N,ref:u,style:P,to:i,viewTransition:a},typeof l=="function"?l(E):l)});y0.displayName="NavLink";var NR=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:s,state:o,method:i=Da,action:a,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:d,...m},v)=>{let{useTransitions:g}=h.useContext(wt),x=DR(),y=MR(a,{relative:c}
183),w=i.toLowerCase()==="get"?"get":"post",b=typeof a=="string"&&yh.test(a),_=S=>{if(l&&l(S),S.defaultPrevented)return;S.preventDefault();let k=S.nativeEvent.submitter,E=(k==null?void 0:k.getAttribute("formmethod"))||i,T=()=>x(k||S.currentTarget,{fetcherKey:t,method:E,navigate:r,replace:s,state:o,relative:c,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:d});g&&r!==!1?h.startTransition(()=>T()):T()};return h.createElement("form",{ref:v,method:w,action:y,onSubmit:n?l:_,...m,"data-discover":!b&&e==="render"?"true":void 0})});NR.displayName="Form";function OR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function w0(e){let t=h.useContext(Vs);return ge(t,OR(e)),t}function jR(e,{target:t,replace:r,mask:n,state:s,preventScrollReset:o,relative:i,viewTransition:a,defaultShouldRevalidate:l,useTransitions:c}={}){let u=jn(),f=et(),d=Ei(e,{relative:i});return h.useCallback(m=>{if(dR(m,t)){m.preventDefault();let v=r!==void 0?r:ni(f)===ni(d),g=()=>u(e,{replace:v,mask:n,state:s,preventScrollReset:o,relative:i,viewTransition:a,defaultShouldRevalidate:l});c?h.startTransition(()=>g()):g()}},[f,u,d,r,n,s,t,e,o,i,a,l,c])}var IR=0,LR=()=>`__${String(++IR)}__`;function DR(){let{router:e}=w0("useSubmit"),{basename:t}=h.useContext(wt),r=eR(),n=e.fetch,s=e.navigate;return h.useCallback(async(o,i={})=>{let{action:a,method:l,encType:c,formData:u,body:f}=pR(o,t);if(i.navigate===!1){let d=i.fetcherKey||LR();await n(d,r,i.action||a,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:u,body:f,formMethod:i.method||l,formEncType:i.encType||c,flushSync:i.flushSync})}else await s(i.action||a,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:u,body:f,formMethod:i.method||l,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,s,t,r])}function MR(e,{relative:t}={}){let{basename:r}=h.useContext(wt),n=h.useContext(qt);ge(n,"useFormAction must be used inside a RouteContext");let[s]=n.matches.slice(-1),o={...Ei(e||".",{relative:t})},i=et();if(e==null){o.search=i.search;let a=new URLSearchParams(o.search),l=a.getAll("index");if(l.some(u=>u==="")){a.delete("index"),l.filter(f=>f).forEach(f=>a.append("index",f));let u=a.toString();o.search=u?`?${u}
183`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Wt([r,o.pathname])),ni(o)}function $R(e,{relative:t}={}){let r=h.useContext(u0);ge(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=w0("useViewTransitionState"),s=Ei(e,{relative:t});if(!r.isTransitioning)return!1;let o=Sr(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Sr(r.nextLocation.pathname,n)||r.nextLocation.pathname;return gl(s.pathname,i)!=null||gl(s.pathname,o)!=null}function cc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function UR(e,t,r,n){function s(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function a(u){try{c(n.next(u))}catch(f){i(f)}}function l(u){try{c(n.throw(u))}catch(f){i(f)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((n=n.apply(e,t||[])).next())})}const FR=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Ch extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class zR extends Ch{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Im extends Ch{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Lm extends Ch{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Hd;(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"})(Hd||(Hd={}));class BR{constructor(t,{headers:r={},customFetch:n,region:s=Hd.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=FR(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return UR(this,arguments,void 0,function*(r,n={}){var s;let o,i;try{const{headers:a,method:l,body:c,signal:u,timeout:f}=n;let d={},{region:m}=n;m||(m=this.region);const v=new URL(`${this.url}/${r}`);m&&m!=="any"&&(d["x-region"]=m,v.searchParams.set("forceFunctionRegion",m));let g;const x=!!a&&Object.keys(a).some(k=>k.toLowerCase()==="content-type");c&&!x?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",g=c):typeof c=="string"?(d["Content-Type"]="text/plain",g=c):typeof FormData<"u"&&c instanceof FormData?g=c:(d["Content-Type"]="application/json",g=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?g=JSON.stringify(c):g=c;let y=u;f&&(i=new AbortController,o=setTimeout(()=>i.abort(),f),u?(y=i.signal,u.addEventListener("abort",()=>i.abort())):y=i.signal);const w=yield this.fetch(v.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),a),body:g,signal:y}).catch(k=>{throw new zR(k)}),b=w.headers.get("x-relay-error");if(b&&b==="true")throw new Im(w);if(!w.ok)throw new Lm(w);let _=((s=w.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),S;return _==="application/json"?S=yield w.json():_==="application/octet-stream"||_==="application/pdf"?S=yield w.blob():_==="text/event-stream"?S=w:_==="multipart/form-data"?S=yield w.formData():S=yield w.text(),{data:S,error:null,response:w}}catch(a){return{data:null,error:a,response:a instanceof Lm||a instanceof Im?a.context:void 0}}finally{o&&clearTimeout(o)}})}}const b0=3,Dm=e=>Math.min(1e3*2**e,3e4),WR=[520,503],x0=["GET","HEAD","OPTIONS"];
183var Mm=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function $m(e,t){return new Promise(r=>{if(t!=null&&t.aborted){r();return}const n=setTimeout(()=>{t==null||t.removeEventListener("abort",s),r()},e);function s(){clearTimeout(n),r()}t==null||t.addEventListener("abort",s)})}function HR(e,t,r,n){return!(!n||r>=b0||!x0.includes(e)||!WR.includes(t))}var VR=class{constructor(e){var t,r,n,s,o;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=e.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(o=e.retry)!==null&&o!==void 0?o:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const i=this.headers.get("Accept");i==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!i||i==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let o=(async()=>{let i=0;for(;;){const c={};r.headers.forEach((f,d)=>{c[d]=f}),i>0&&(c["X-Retry-Count"]=String(i));let u;try{u=await n(r.url.toString(),{method:r.method,headers:c,body:JSON.stringify(r.body,(f,d)=>typeof d=="bigint"?d.toString():d),signal:r.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!x0.includes(r.method))throw f;if(r.retryEnabled&&i<b0){const d=Dm(i);i++,await $m(d,r.signal);continue}throw f}if(HR(r.method,u.status,i,r.retryEnabled)){var a,l;const f=(a=(l=u.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,d=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:Dm(i);await u.text(),i++,await $m(d,r.signal);continue}return await r.processResponse(u)}})();return this.shouldThrowOnError||(o=o.catch(i=>{var a;let l="",c="",u="";const f=i==null?void 0:i.cause;if(f){var d,m,v,g;const w=(d=f==null?void 0:f.message)!==null&&d!==void 0?d:"",b=(m=f==null?void 0:f.code)!==null&&m!==void 0?m:"";l=`${(v=i==null?void 0:i.name)!==null&&v!==void 0?v:"FetchError"}: ${i==null?void 0:i.message}`,l+=` 184 185Caused by: ${(g=f==null?void 0:f.name)!==null&&g!==void 0?g:"Error"}: ${w}`,b&&(l+=` (${b})`),f!=null&&f.stack&&(l+=` 186${f.stack}`)}else{var x;l=(x=i==null?void 0:i.stack)!==null&&x!==void 0?x:""}const y=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",y>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${y} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",y>this.urlLengthLimit&&(c+=`. Your request URL is ${y} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=i==null?void 0:i.name)!==null&&a!==void 0?a:"FetchError"}: ${i==null?void 0:i.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}}
186)),o.then(e,t)}async processResponse(e){var t=this;let r=null,n=null,s=null,o=e.status,i=e.statusText;if(e.ok){var a,l;if(t.method!=="HEAD"){var c;const d=await e.text();if(d!=="")if(t.headers.get("Accept")==="text/csv")n=d;else if(t.headers.get("Accept")&&(!((c=t.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text")))n=d;else try{n=JSON.parse(d)}catch{if(r={message:d},n=null,t.shouldThrowOnError)throw new Mm({message:d,details:"",hint:"",code:""})}}const u=(a=t.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),f=(l=e.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");u&&f&&f.length>1&&(s=parseInt(f[1])),t.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,o=406,i="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const u=await e.text();try{r=JSON.parse(u),Array.isArray(r)&&e.status===404&&(n=[],r=null,o=200,i="OK")}catch{e.status===404&&u===""?(o=204,i="No Content"):r={message:u}}if(r&&t.shouldThrowOnError)throw new Mm(r)}return{success:r===null,error:r,data:n,count:s,status:o,statusText:i}}returns(){return this}overrideTypes(){return this}},KR=class extends VR{throwOnError(){return super.throwOnError()}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 o=s?`${s}.order`:"order",i=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${i?`${i},`:""}${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`,o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:o="text"}={}){var i;const a=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${l}"; options=${a};`),o==="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 Um=new RegExp("[,()]");var Qn=class extends KR{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&Um.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"&&Um.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 o=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${o}.${t}`),this}match(e){return Object.entries(e).filter(([t,r])=>
186r!==void 0).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}},qR=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:o}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=o}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 o=!1;const i=(e??"*").split("").map(c=>/\s/.test(c)&&!o?"":(c==='"'&&(o=!o),c)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",i),n&&l.append("Prefer",`count=${n}`),new Qn({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const s="POST",{url:o,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),r||i.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(a.length>
1860){const l=[...new Set(a)].map(c=>`"${c}"`);o.searchParams.set("columns",l.join(","))}}return new Qn({method:s,url:o,headers:i,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var o;const i="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 c=e.reduce((u,f)=>u.concat(Object.keys(f)),[]);if(c.length>0){const u=[...new Set(c)].map(f=>`"${f}"`);a.searchParams.set("columns",u.join(","))}}return new Qn({method:i,url:a,headers:l,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;const n="PATCH",{url:s,headers:o}=this.cloneRequestState();return t&&o.append("Prefer",`count=${t}`),new Qn({method:n,url:s,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Qn({method:r,url:n,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function si(e){"@babel/helpers - typeof";return si=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},si(e)}function GR(e,t){if(si(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(si(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YR(e){var t=GR(e,"string");return si(t)=="symbol"?t:t+""}function JR(e,t,r){return(t=YR(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fm(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 ra(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fm(Object(r),!0).forEach(function(n){JR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var XR=class _0{constructor(t,{headers:r={},schema:n,fetch:s,timeout:o,urlLengthLimit:i=8e3,retry:a}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=i;const l=s??globalThis.fetch;o!==void 0&&o>0?this.fetch=(c,u)=>{const f=new AbortController,d=setTimeout(()=>f.abort(),o),m=u==null?void 0:u.signal;if(m){if(m.aborted)return clearTimeout(d),l(c,u);const v=()=>{clearTimeout(d),f.abort()};return m.addEventListener("abort",v,{once:!0}),l(c,ra(ra({},u),{},{signal:f.signal})).finally(()=>{clearTimeout(d),m.removeEventListener("abort",v)})}return l(c,ra(ra({},u),{},{signal:f.signal})).finally(()=>clearTimeout(d))}:this.fetch=l,this.retry=a}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new qR(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new _0(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,r={},{head:n=!1,get:s=!1,count:o}={}){var i;let a;const l=new URL(`${this.url}/rpc/${t}`);let c;const u=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(u)),f=n&&Object.values(r).some(u);f?(a="POST",c=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([m,v])=>v!==void 0).map(([m,v])=>[m,Array.isArray(v)?`{${v.join(",")}}`:`${v}
186`]).forEach(([m,v])=>{l.searchParams.append(m,v)})):(a="POST",c=r);const d=new Headers(this.headers);return f?d.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&d.set("Prefer",`count=${o}`),new Qn({method:a,url:l,headers:d,schema:this.schemaName,body:c,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class QR{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.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"&&r.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const o=s.versions;if(o&&o.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 187 188Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const ZR="2.110.0",eP=`realtime-js/${ZR}`,tP="1.0.0",S0="2.0.0",rP=S0,nP=1e4,sP=100,$r={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},E0={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},Vd={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class oP{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:{},i=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(t,r,n){var s,o;const i=t.topic,a=(s=t.ref)!==null&&s!==void 0?s:"",l=(o=t.join_ref)!==null&&o!==void 0?o:"",c=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(u).length===0?"":JSON.stringify(u);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const d=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+i.length+c.length+f.length,m=new ArrayBuffer(this.HEADER_LENGTH+d);let v=new DataView(m),g=0;v.setUint8(g++,this.KINDS.userBroadcastPush),v.setUint8(g++,l.length),v.setUint8(g++,a.length),v.setUint8(g++,i.length),v.setUint8(g++,c.length),v.setUint8(g++,f.length),v.setUint8(g++,r),Array.from(l,y=>
188v.setUint8(g++,y.charCodeAt(0))),Array.from(a,y=>v.setUint8(g++,y.charCodeAt(0))),Array.from(i,y=>v.setUint8(g++,y.charCodeAt(0))),Array.from(c,y=>v.setUint8(g++,y.charCodeAt(0))),Array.from(f,y=>v.setUint8(g++,y.charCodeAt(0)));var x=new Uint8Array(m.byteLength+n.byteLength);return x.set(new Uint8Array(m),0),x.set(new Uint8Array(n),m.byteLength),x.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,o,i,a,l]=n;return r({join_ref:s,ref:o,topic:i,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),o=r.getUint8(2),i=r.getUint8(3),a=r.getUint8(4);let l=this.HEADER_LENGTH+4;const c=n.decode(t.slice(l,l+s));l=l+s;const u=n.decode(t.slice(l,l+o));l=l+o;const f=n.decode(t.slice(l,l+i));l=l+i;const d=t.slice(l,t.byteLength),m=a===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,v={type:this.BROADCAST_EVENT,event:u,payload:m};return i>0&&(v.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:v}}_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)))}}var ce;(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"})(ce||(ce={}));const zm=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((o,i)=>(o[i]=iP(i,e,t,s),o),{}):{}},iP=(e,t,r,n)=>{const s=t.find(a=>a.name===e),o=s==null?void 0:s.type,i=r[e];return o&&!n.includes(o)?k0(o,i):Kd(i)},k0=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return uP(t,r)}switch(e){case ce.bool:return aP(t);case ce.float4:case ce.float8:case ce.int2:case ce.int4:case ce.int8:case ce.numeric:case ce.oid:return lP(t);case ce.json:case ce.jsonb:return cP(t);case ce.timestamp:return dP(t);case ce.abstime:case ce.date:case ce.daterange:case ce.int4range:case ce.int8range:case ce.money:case ce.reltime:case ce.text:case ce.time:case ce.timestamptz:case ce.timetz:case ce.tsrange:case ce.tstzrange:return Kd(t);default:return Kd(t)}},Kd=e=>e,aP=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},lP=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},cP=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},uP=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let o;const i=e.slice(1,r);try{o=JSON.parse("["+i+"]")}catch{o=i?i.split(","):[]}return o.map(a=>k0(t,a))}return e},dP=e=>typeof e=="string"?e.replace(" ","T"):e,C0=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var Lo=e=>typeof e=="function"?e:function(){return e},fP=typeof self<"u"?self:null,Zn=typeof window<"u"?window:null,er=fP||Zn||globalThis,hP="2.0.0",pP=1e4,mP=1e3,tr={connecting:0,open:1,closing:2,closed:3},rt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},dr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},qd={longpoll:"longpoll",websocket:"websocket"},gP={complete:4},Gd="base64url.bearer.phx.",na=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHo
vendor: 8,700 bytes, line 188
188oks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},T0=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},vP=class{constructor(e,t,r){this.state=rt.closed,this.topic=e,this.params=Lo(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new na(this,dr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new T0(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=rt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=rt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=rt.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=rt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new na(this,dr.leave,Lo({}),this.timeout).send(),this.state=rt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(dr.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=rt.closed,this.bindings=[]}onClose(e){this.on(dr.close,e)}onError(e){return this.on(dr.error,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>!(r.event===e&&(typeof t>"u"||t===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new na(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=rt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(dr.close,"leave")},r=new na(this,dr.leave,Lo({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=rt.joining,this.joinPush.resend(e))}trigger(e,t,r,n){let s=this.onMessage(e,t,r,n);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(i=>i.event===e&&this.filterBindings(i,t,r));for(let i=0;i<o.length;i++)o[i].callback(s,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===rt.closed}isErrored(){return this.state===rt.errored}isJoined(){return this.state===rt.joined}isJoining(){return this.state===rt.joining}isLeaving(){return this.state===rt.leaving}},yl=class{static request(e,t,r,n,s,o,i){if(er.XDomainRequest){let a=new er.XDomainRequest;return this.xdomainRequest(a,e,t,n,s,o,i)}else if(er.XMLHttpRequest){let a=new er.XMLHttpRequest;return this.xhrRequest(a,e,t,r,n,s,o,i)}else{if(er.fetch&&er.AbortController)return this.fetchRequest(e,t,r,n,s,o,i);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,r,n,s,o,i){let a={method:e,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),a.signal=l.signal),er.fetch(t,a).then(c=>c.text()).then(c=>this.parseJSON(c)).then(c=>i&&i(c)).catch(c=>{c.name==="AbortError"&&o?o():i&&i(null)}),l}static xdomainRequest(e,t,r,n,s,o,i){return e.timeout=s,e.open(t,r),e.onload=()=>{let a=this.parseJSON(e.responseText);i&&i(a)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,s,o,i,a){e.open(t,r,!0),e.timeout=o;for(let[l,c]of Object.entries(n))e.setRequestHeader(l,c);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===gP.complete&&a){let l=this.parseJSON(e.responseText);a(l)}},i&&(e.ontimeout=i),e.send(s),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=t?`${t}[${n}]`:n,o=e[n];typeof o=="object"?r.push(this.serialize(o,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(o))}return r.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},yP=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let s=0;s<n;s++)t+=String.fromCharCode(r[s]);return btoa(t)},Bn=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Gd)&&(this.authToken=atob(t[1].slice(Gd.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=tr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+qd.websocket),"$1/"+qd.longpoll)}endpointURL(){return yl.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=tr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===tr.open||this.readyState===tr.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:r,token:n,messages:s}=t;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(o=>{setTimeout(()=>this.onmessage({data:o}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=tr.open,this.onopen({}),this.poll();break;
188case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(e){typeof e!="string"&&(e=yP(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(` 189`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,r){for(let s of this.reqs)s.abort();this.readyState=tr.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,s){let o,i=()=>{this.reqs.delete(o),n()};o=yl.request(e,this.endpointURL(),t,r,this.timeout,i,a=>{this.reqs.delete(o),this.isActive()&&s(a)}),this.reqs.add(o)}},wP=class xo{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:o,onLeave:i,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=xo.syncState(this.state,s,o,i),this.pendingDiffs.forEach(l=>{this.state=xo.syncDiff(this.state,l,o,i)}),this.pendingDiffs=[],a()}),this.channel.on(n.diff,s=>{let{onJoin:o,onLeave:i,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=xo.syncDiff(this.state,s,o,i),a())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return xo.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,r,n,s){let o=this.clone(t),i={},a={};return this.map(o,(l,c)=>{r[l]||(a[l]=c)}),this.map(r,(l,c)=>{let u=o[l];if(u){let f=c.metas.map(g=>g.phx_ref),d=u.metas.map(g=>g.phx_ref),m=c.metas.filter(g=>d.indexOf(g.phx_ref)<0),v=u.metas.filter(g=>f.indexOf(g.phx_ref)<0);m.length>0&&(i[l]=c,i[l].metas=m),v.length>0&&(a[l]=this.clone(u),a[l].metas=v)}else i[l]=c}),this.syncDiff(o,{joins:i,leaves:a},n,s)}static syncDiff(t,r,n,s){let{joins:o,leaves:i}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(o,(a,l)=>{let c=t[a];if(t[a]=this.clone(l),c){let u=t[a].metas.map(d=>d.phx_ref),f=c.metas.filter(d=>u.indexOf(d.phx_ref)<0);t[a].metas.unshift(...f)}n(a,c,l)}),this.map(i,(a,l)=>{let c=t[a];if(!c)return;let u=l.metas.map(f=>f.phx_ref);c.metas=c.metas.filter(f=>u.indexOf(f.phx_ref)<0),s(a,c,l),c.metas.length===0&&delete t[a]}),t}static list(t,r){return r||(r=function(n,s){return s}),this.map(t,(n,s)=>r(n,s))}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static clone(t){return JSON.parse(JSON.stringify(t))}},sa={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,s,o,i]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:o,payload:i})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:s,payload:o}=e,i=this.META_LENGTH+t.length+r.length+s.length+n.length,a=new ArrayBuffer(this.HEADER_LENGTH+i),l=new DataView(a),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,t.length),l.setUint8(c++,r.length),l.setUint8(c++,s.length),l.setUint8(c++,n.length),Array.from(t,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(r,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(s,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(n,f=>l.setUint8(c++,f.charCodeAt(0)));var u=new Uint8Array(a.byteLength+o.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(o),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;
vendor: 8,661 bytes, line 189
189switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(e.slice(i,i+n));i=i+n;let l=r.decode(e.slice(i,i+s));i=i+s;let c=r.decode(e.slice(i,i+o));i=i+o;let u=e.slice(i,e.byteLength);return{join_ref:a,ref:null,topic:l,event:c,payload:u}},decodeReply(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),i=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(e.slice(a,a+n));a=a+n;let c=r.decode(e.slice(a,a+s));a=a+s;let u=r.decode(e.slice(a,a+o));a=a+o;let f=r.decode(e.slice(a,a+i));a=a+i;let d=e.slice(a,e.byteLength),m={status:f,response:d};return{join_ref:l,ref:c,topic:u,event:dr.reply,payload:m}},decodeBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),o=this.HEADER_LENGTH+2,i=r.decode(e.slice(o,o+n));o=o+n;let a=r.decode(e.slice(o,o+s));o=o+s;let l=e.slice(o,e.byteLength);return{join_ref:null,ref:null,topic:i,event:a,payload:l}}},bP=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||pP,this.transport=t.transport||er.WebSocket||Bn,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=er&&er.sessionStorage}catch{}this.sessionStore=t.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=sa.encode.bind(sa),this.defaultDecoder=sa.decode.bind(sa),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Bn?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Zn&&Zn.addEventListener&&(Zn.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Zn.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())}),Zn.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,o,i)=>{console.log(`${s}: ${o}`,i)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Lo(t.params||{}),this.endPoint=`${e}/${qd.websocket}`,this.vsn=t.vsn||hP,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new T0(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Bn}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=yl.appendParams(yl.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Lo(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Bn?this.connectWithFallback(Bn,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(s=>{s.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){switch(e){case Bn:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Gd}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,o,i=this.transportName(e),a=l=>{this.log("transport",`falling back to ${i}...`,l),this.off([s,o]),n=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),o=this.onError(l=>{this.log("transport","error",l),n&&!r&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let l=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),mP,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();const n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){if(r===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r)}waitForSocketClosed(e,t,r=1){if(r===5||e.readyState===tr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError(e)}
vendor: 4,126 bytes, line 189
189triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(dr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case tr.connecting:return"connecting";case tr.open:return"open";case tr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([r])=>e.indexOf(r)===-1)}channel(e,t={}){let r=new vP(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:s,join_ref:o}=e;this.log("push",`${t} ${r} (${o}, ${s})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:n,payload:s,ref:o,join_ref:i}=t;if(o&&o===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",a)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${o&&"("+o+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(r,n,s,i)&&l.trigger(n,s,o,i)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r.isJoined()||r.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class Do{constructor(t,r){const n=_P(r);this.presence=new wP(t.getChannel(),n),this.presence.onJoin((s,o,i)=>{const a=Do.onJoinPayload(s,o,i);t.getChannel().trigger("presence",a)}),this.presence.onLeave((s,o,i)=>{const a=Do.onLeavePayload(s,o,i);t.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return Do.transformState(this.presence.state)}static transformState(t){return t=xP(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return r[n]=$a(s),r},{})}static onJoinPayload(t,r,n){const s=Bm(r),o=$a(n);return{event:"join",key:t,currentPresences:s,newPresences:o}}static onLeavePayload(t,r,n){const s=Bm(r),o=$a(n);return{event:"leave",key:t,currentPresences:s,leftPresences:o}}}function $a(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function xP(e){return JSON.parse(JSON.stringify(e))}function _P(e){return(e==null?void 0:e.events)&&{events:e.events}}function Bm(e){return e!=null&&e.metas?$a(e):[]}var Wm;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Wm||(Wm={}));class SP{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new Do(this.channel.channelAdapter,r)}}function EP(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
189if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const r=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${r}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class kP{constructor(t,r,n){const s=CP(n);this.channel=t.getSocket().channel(r,s),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,r){return this.channel.on(t,r)}off(t,r){this.channel.off(t,r)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,r,n){let s;try{s=this.channel.push(t,r,n)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>sP){const o=this.channel.pushBuffer.shift();o.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${o.event}`,o.payload())}return s}updateJoinPayload(t){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),t)}canPush(){return this.socket.isConnected()&&this.state===$r.joined}isJoined(){return this.state===$r.joined}isJoining(){return this.state===$r.joining}isClosed(){return this.state===$r.closed}isLeaving(){return this.state===$r.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function CP(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}const TP=/[,()"\\]/,RP=e=>TP.test(e)||e!==e.trim(),PP=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,Hm=e=>{const t=e===null?"null":String(e);return RP(t)?PP(t):t},AP=e=>e===null?"null":String(e),NP=(e,t)=>{if(e==="in"){const r=Array.isArray(t)?t:[t];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(s=>Hm(s)).join(",")})`}return e==="is"?`is.${AP(t)}`:`${e}.${Hm(t)}`};class OP{constructor(){this.filters=[]}add(t,r,n,s=!1){const o=s?"not.":"";return this.filters.push(`${t}=${o}${NP(r,n)}`),this}eq(t,r){return this.add(t,"eq",r)}neq(t,r){return this.add(t,"neq",r)}gt(t,r){return this.add(t,"gt",r)}gte(t,r){return this.add(t,"gte",r)}lt(t,r){return this.add(t,"lt",r)}lte(t,r){return this.add(t,"lte",r)}in(t,r){return this.add(t,"in",r)}like(t,r){return this.add(t,"like",r)}ilike(t,r){return this.add(t,"ilike",r)}match(t,r){return this.add(t,"match",r)}imatch(t,r){return this.add(t,"imatch",r)}is(t,r){return this.add(t,"is",r)}isDistinct(t,r){return this.add(t,"isdistinct",r)}not(t,r,n){return this.add(t,r,n,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var Vm;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Vm||(Vm={}));var hs;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(hs||(hs={}));var fr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(fr||(fr={}));class Mo{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,r={config:{}},n){var s,o;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},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.channelAdapter=new kP(this.socket.socketAdapter,t,this.params),this.presence=new SP(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=C0(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,r=this.timeout){var n,s,o;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:i,presence:a,private:l}}=this.params,c=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(m=>m.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[hs.PRESENCE]&&this.bindings[hs.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,f={},d={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(m=>{t==null||t(fr.CHANNEL_ERROR,EP(m))}),this._onClose(()=>t==null?void 0:t(fr.CLOSED)),this.updateJoinPayload(Object.assign({config:d},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:m})=>
189{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){t==null||t(fr.SUBSCRIBED);return}this._updatePostgresBindings(m,t)}).receive("error",m=>{this.state=$r.errored;const v=Object.values(m).join(", ")||"error";t==null||t(fr.CHANNEL_ERROR,new Error(v,{cause:m}))}).receive("timeout",()=>{t==null||t(fr.TIMED_OUT)})}return this}_updatePostgresBindings(t,r){var n;const s=this.bindings.postgres_changes,o=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,i=[];for(let a=0;a<o;a++){const l=s[a],{filter:{event:c,schema:u,table:f,filter:d}}=l,m=t&&t[a];if(m&&m.event===c&&Mo.isFilterValueEqual(m.schema,u)&&Mo.isFilterValueEqual(m.table,f)&&Mo.isFilterValueEqual(m.filter,d))i.push(Object.assign(Object.assign({},l),{id:m.id}));else{this.unsubscribe(),this.state=$r.errored,r==null||r(fr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=$r.errored&&r&&r(fr.SUBSCRIBED)}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){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),o=t===hs.PRESENCE||t===hs.POSTGRES_CHANGES;if(s&&o)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,r,n)}async httpSend(t,r,n={}){var s;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const o=r instanceof ArrayBuffer||ArrayBuffer.isView(r),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":o?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(t)}`,this.private&&a.searchParams.set("private","true");const l={method:"POST",headers:i,body:o?r:JSON.stringify(r)},c=await this._fetchWithTimeout(a.toString(),l,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(c.status===202)return{success:!0};if(c.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let u=c.statusText;try{const f=await c.json();u=f.error||f.message||u}catch{}return Promise.reject(new Error(u))}async send(t,r={}){var n,s;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
189in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:i}=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:o,payload:i,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c instanceof Error&&c.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var i,a,l;const c=this.channelAdapter.push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(a=(i=this.params)===null||i===void 0?void 0:i.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&o("ok"),c.receive("ok",()=>o("ok")),c.receive("error",()=>o("error")),c.receive("timeout",()=>o("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,r,n){const s=new AbortController,o=setTimeout(()=>s.abort(),n),i=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(o),i}_on(t,r,n){const s=t.toLocaleLowerCase(),o=r==null?void 0:r.filter;(o instanceof OP||typeof o=="object"&&o!==null&&typeof o.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:o.build()}));const i=this.channelAdapter.on(t,n),a={type:s,filter:r,callback:n,ref:i};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,r,n)=>{var s,o,i,a,l,c,u;const f=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const d=(s=this.bindings[f])===null||s===void 0?void 0:s.find(m=>m.ref===t.ref);if(!d)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in d){const m=d.id,v=(o=d.filter)===null||o===void 0?void 0:o.event;return m&&((i=r.ids)===null||i===void 0?void 0:i.includes(m))&&(v==="*"||(v==null?void 0:v.toLocaleLowerCase())===((a=r.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const m=(c=(l=d==null?void 0:d.filter)===null||l===void 0?void 0:l.event)===null||c===void 0?void 0:c.toLocaleLowerCase();return m==="*"||m===((u=r==null?void 0:r.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return d.type.toLocaleLowerCase()===f})}_notThisChannelEvent(t,r){const{close:n,error:s,leave:o,join:i}=E0;return r&&[n,s,o,i].includes(t)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:o,table:i,commit_timestamp:a,type:l,errors:c}=s;return Object.assign(Object.assign({},{schema:o,table:i,commit_timestamp:a,eventType:l,new:{},old:{},errors:c}),this._getPayloadRecords(s))}return r})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in t.bindings)for(const n of t.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=zm(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=zm(t.columns,t.old_record)),r}}class jP{constructor(t,r){this.socket=new bP(t,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,r,n,s=1e4){return new Promise(o=>{setTimeout(()=>
189o("timeout"),s),this.socket.disconnect(()=>{t(),o("ok")},r,n)})}push(t){this.socket.push(t)}log(t,r,n){this.socket.log(t,r,n)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Vd.connecting}isDisconnecting(){return this.socket.connectionState()==Vd.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Km={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},IP=[1e3,2e3,5e3,1e4],LP=1e4;function DP(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var r;return(r=Array.from(e.keys())[t])!==null&&r!==void 0?r:null},removeItem(t){e.delete(t)},setItem(t,r){e.set(t,String(r))}}}function MP(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return DP()}const $P=` 190 addEventListener("message", (e) => { 191 if (e.data.event === "start") { 192 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 193 } 194 });`;class UP{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new oP,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=o=>o?(...i)=>o(...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;const s=this._initializeOptions(r);this.socketAdapter=new jP(t,s),this.httpEndpoint=C0(t),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const r=t.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,r)}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&t.teardown(),r}async removeAllChannels(){const t=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(t);return await this.disconnect(),r}log(t,r,n){this.socketAdapter.log(t,r,n)}connectionState(){return this.socketAdapter.connectionState()||Vd.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(o=>o.topic===n);if(s)return s;{const o=new Mo(`realtime:${t}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(o),o}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
194this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let 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 o={access_token:r,version:eP};r&&s.updateJoinPayload(o),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(E0.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)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(r,n)=>{r=="sent"&&this._setAuthSafely(),t&&t(r,n)}}_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.disconnect()},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)}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([$P],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(t){var r,n,s,o,i,a,l,c,u,f,d,m;this.worker=(r=t==null?void 0:t.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=t==null?void 0:t.accessToken)!==null&&n!==void 0?n:null;const v={};v.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:nP,v.heartbeatIntervalMs=(o=t==null?void 0:t.heartbeatIntervalMs)!==null&&o!==void 0?o:Km.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(i=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&i!==void 0?i:2*((a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:Km.HEARTBEAT_INTERVAL),v.transport=(l=t==null?void 0:t.transport)!==null&&l!==void 0?l:QR.getWebSocketConstructor(),v.params=t==null?void 0:t.params,v.logger=t==null?void 0:t.logger,v.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),v.sessionStorage=(c=t==null?void 0:t.sessionStorage)!==null&&c!==void 0?c:MP(),v.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:w=>IP[w-1]||LP;let g,x;const y=(f=t==null?void 0:t.vsn)!==null&&f!==void 0?f:rP;switch(y){case tP:g=(w,b)=>b(JSON.stringify(w)),x=(w,b)=>b(JSON.parse(w));break;case S0:g=this.serializer.encode.bind(this.serializer),x=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${v.vsn}`)}if(v.vsn=y,v.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:g,v.decode=(m=t==null?void 0:t.decode)!==null&&m!==void 0?m:x,v.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,v.params=Object.assign(Object.assign({},v.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,v.autoSendHeartbeat=!this.worker}return v}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
194var oi=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 FP(e,t,r){const n=new URL(t,e);if(r)for(const[s,o]of Object.entries(r))o!==void 0&&n.searchParams.set(s,o);return n.toString()}async function zP(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 BP(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:o,headers:i}){const a=FP(e.baseUrl,n,s),l=await zP(e.auth),c=await t(a,{method:r,headers:{...o?{"Content-Type":"application/json"}:{},...l,...i},body:o?JSON.stringify(o):void 0}),u=await c.text(),f=(c.headers.get("content-type")||"").includes("application/json"),d=f&&u?JSON.parse(u):u;if(!c.ok){const m=f?d:void 0,v=m==null?void 0:m.error;throw new oi((v==null?void 0:v.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:v==null?void 0:v.type,icebergCode:v==null?void 0:v.code,details:m})}return{status:c.status,headers:c.headers,data:d}}}}function oa(e){return e.join("�")}var WP=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:oa(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/${oa(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${oa(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${oa(e.namespace)}`}),!0}catch(t){if(t instanceof oi&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof oi&&r.status===409)return;throw r}}};function Wn(e){return e.join("�")}var HP=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/${Wn(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/${Wn(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/${Wn(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/${Wn(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/${Wn(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/${Wn(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof oi&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof oi&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},VP=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=BP({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new WP(this.client,t),this.tableOps=new HP(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)}
194async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function ii(e){"@babel/helpers - typeof";return ii=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},ii(e)}function KP(e,t){if(ii(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qP(e){var t=KP(e,"string");return ii(t)=="symbol"?t:t+""}function GP(e,t,r){return(t=qP(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qm(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 q(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qm(Object(r),!0).forEach(function(n){GP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var uc=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function dc(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Yd=class extends uc{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return q({},super.toJSON())}},R0=class extends uc{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function wl(e,t,r){const n=q({},e),s=t.toLowerCase();for(const o of Object.keys(n))o.toLowerCase()===s&&delete n[o];return n[s]=r,n}function YP(e){const t={};for(const[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}const JP=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),XP=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)},Jd=e=>{if(Array.isArray(e))return e.map(r=>Jd(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,o=>o.toUpperCase().replace(/[-_]/g,""));t[s]=Jd(n)}),t},QP=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Gm=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const r=t.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(e)},ZP=async(e,t,r,n)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const s=e;let o=parseInt(String(s.status),10);Number.isFinite(o)||(o=500),s.json().then(i=>{const a=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||o+"";t(new Yd(Gm(i),o,a,n))}).catch(()=>{const i=o+"";t(new Yd(s.statusText||`HTTP ${o} error`,o,i,n))})}else t(new R0(Gm(e),e,n))},eA=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!n)return q(q({},s),r);if(XP(n)){var o;const i=(t==null?void 0:t.headers)||{};let a;for(const[l,c]of Object.entries(i))l.toLowerCase()==="content-type"&&(a=c);s.headers=wl(i,"Content-Type",(o=a)!==null&&o!==void 0?o:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return t!=null&&t.duplex&&(s.duplex=t.duplex),q(q({},s),r)};async function fo(e,t,r,n,s,o,i){return new Promise((a,l)=>{e(r,eA(t,n,s,o)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;if(i==="vectors"){const u=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!u||!u.includes("application/json"))return{}}return c.json()}).then(c=>a(c)).catch(c=>ZP(c,l,n,i))})}function P0(e="storage"){return{get:async(t,r,n,s)=>fo(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,o)=>fo(t,"POST",r,s,o,n,e),put:async(t,r,n,s,o)=>fo(t,"PUT",r,s,o,n,e),head:async(t,r,n,s)=>fo(t,"HEAD",r,q(q({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,o)=>fo(t,"DELETE",r,s,o,n,e)}}const tA=P0("storage"),{get:ai,post:Mt,put:Xd,head:rA,remove:li}=tA,ft=P0("vectors");var qs=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=YP(t),this.fetch=JP(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=wl(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(dc(r))return{data:null,error:r};throw r}}};let A0;A0=Symbol.toStringTag;var nA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[A0]="StreamDownloadBuilder",this.promise=null}
194then(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 e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(dc(t))return{data:null,error:t};throw t}}};let N0;N0=Symbol.toStringTag;var sA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[N0]="BlobDownloadBuilder",this.promise=null}asStream(){return new nA(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(dc(t))return{data:null,error:t};throw t}}};const vu={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Ym={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var oA=class extends qs{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let o;const i=q(q({},Ym),n);let a=q(q({},s.headers),e==="POST"&&{"x-upsert":String(i.upsert)});const l=i.metadata;if(typeof Blob<"u"&&r instanceof Blob?(o=new FormData,o.append("cacheControl",i.cacheControl),l&&o.append("metadata",s.encodeMetadata(l)),o.append("",r)):typeof FormData<"u"&&r instanceof FormData?(o=r,o.has("cacheControl")||o.append("cacheControl",i.cacheControl),l&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(l))):(o=r,a["cache-control"]=`max-age=${i.cacheControl}`,a["content-type"]=i.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!i.duplex&&(i.duplex="half")),n!=null&&n.headers)for(const[d,m]of Object.entries(n.headers))a=wl(a,d,m);const c=s._removeEmptyFolders(t),u=s._getFinalPath(c),f=await(e=="PUT"?Xd:Mt)(s.fetch,`${s.url}/object/${u}`,o,q({headers:a},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:c,id:f.Id,fullPath:f.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;const o=s._removeEmptyFolders(e),i=s._getFinalPath(o),a=new URL(s.url+`/object/upload/sign/${i}`);return a.searchParams.set("token",t),s.handleOperation(async()=>{let l;const c=q(q({},Ym),n);let u=q(q({},s.headers),{"x-upsert":String(c.upsert)});const f=c.metadata;if(typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),f&&l.append("metadata",s.encodeMetadata(f)),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.has("cacheControl")||l.append("cacheControl",c.cacheControl),f&&!l.has("metadata")&&l.append("metadata",s.encodeMetadata(f))):(l=r,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType,f&&(u["x-metadata"]=s.toBase64(s.encodeMetadata(f))),(typeof ReadableStream<"u"&&l instanceof ReadableStream||l&&typeof l=="object"&&"pipe"in l&&typeof l.pipe=="function")&&!c.duplex&&(c.duplex="half")),n!=null&&n.headers)for(const[d,m]of Object.entries(n.headers))u=wl(u,d,m);return{path:o,fullPath:(await Xd(s.fetch,a.toString(),l,q({headers:u},c!=null&&c.duplex?{duplex:c.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const s=q({},r.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const o=await Mt(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),i=new URL(r.url+o.url),a=i.searchParams.get("token");if(!a)throw new uc("No token returned by API");return{signedUrl:i.toString(),path:e,token:a}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await Mt(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
194stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await Mt(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e);const o=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let i=await Mt(n.fetch,`${n.url}/object/sign/${s}`,q({expiresIn:t},o?{transform:r.transform}:{}),{headers:n.headers});const a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const l=a.toString();return{signedUrl:encodeURI(`${n.url}${i.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const s=await Mt(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),o=new URLSearchParams;r!=null&&r.download&&o.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const i=o.toString();return s.map(a=>q(q({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${i?`&${i}`:""}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const o=s.toString(),i=this._getFinalPath(e),a=()=>ai(this.fetch,`${this.url}/${n}/${i}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new sA(a,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>Jd(await ai(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await rA(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(dc(s)){var n;const o=s instanceof Yd?s.status:s instanceof R0?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(o!==void 0&&[400,404].includes(o))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=new URLSearchParams;t!=null&&t.download&&n.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(n,t.transform),(t==null?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce));const s=n.toString(),o=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await li(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,r){var n=this;return n.handleOperation(async()=>{const s=n._getFinalPath(e),o=new URLSearchParams;t!=null&&t.transformations&&o.set("transformations","true");const i=o.toString();return await li(n.fetch,`${n.url}/cdn/${s}${i?`?${i}`:""}`,{},{headers:n.headers},r)})}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const s=t!=null&&t.sortBy?q(q({},vu.sortBy),t.sortBy):vu.sortBy,o=q(q(q({},vu),t),{},{sortBy:s,prefix:e||""});return await Mt(n.fetch,`${n.url}/object/list/${n.bucketId}`,o,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=q({},e);return await Mt(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("qual
194ity",t.quality.toString()),e}};const iA="2.110.0",ki={"X-Client-Info":`storage-js/${iA}`};var aA=class extends qs{constructor(e,t={},r,n){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."));const o=s.href.replace(/\/$/,""),i=q(q({},ki),t);super(o,i,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await ai(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ai(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await Mt(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}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await Xd(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}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Mt(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await li(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async purgeBucketCache(e,t,r){var n=this;return n.handleOperation(async()=>{const s=new URLSearchParams;t!=null&&t.transformations&&s.set("transformations","true");const o=s.toString();return await li(n.fetch,`${n.url}/cdn/${e}${o?`?${o}`:""}`,{},{headers:n.headers},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():""}},lA=class extends qs{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=q(q({},ki),t);super(n,s,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Mt(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{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 await ai(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await li(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!QP(e))throw new uc("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 VP({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,o){const i=s[o];return typeof i!="function"?i:async(...a)=>{try{return{data:await i.apply(s,a),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},cA=class extends qs{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=q(q({},ki),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await ft.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await ft.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},uA=class extends qs{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=q(q({},ki),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
194if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},dA=class extends qs{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=q(q({},ki),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await ft.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},fA=class extends dA{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new hA(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)}},hA=class extends cA{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,q(q({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,q(q({},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 pA(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},pA=class extends uA{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,q(q({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,q(q({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,q(q({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,q(q({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,q(q({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},mA=class extends aA{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new oA(this.url,this.headers,e,this.fetch)}get vectors(){return new fA(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new lA(this.url+"/iceberg",this.headers,this.fetch)}};const O0="2.110.0",hr=30*1e3,_o=3,yu=_o*hr,gA=2*hr,vA="http://localhost:9999",yA="supabase.auth.token",wA={"X-Client-Info":`gotrue-js/${O0}`},Qd="X-Supabase-Api-Version",j0={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},bA=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,xA=10*60*1e3;class ci extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function M(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class _A extends ci{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.co
194de=n}}function SA(e){return M(e)&&e.name==="AuthApiError"}class Ft extends ci{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class ir extends ci{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class je extends ir{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function ia(e){return M(e)&&e.name==="AuthSessionMissingError"}class Hn extends ir{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class aa extends ir{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class la extends ir{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function EA(e){return M(e)&&e.name==="AuthImplicitGrantRedirectError"}class Jm extends ir{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class kA extends ir{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 Zd extends ir{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Xm(e){return M(e)&&e.name==="AuthRetryableFetchError"}class Qm extends ir{constructor(t="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(t,"AuthRefreshDiscardedError",409,void 0)}}function CA(e){return M(e)&&e.name==="AuthRefreshDiscardedError"}class Zm extends ir{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class bl extends ir{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const xl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),eg=` 195\r=`.split(""),TA=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<eg.length;t+=1)e[eg[t].charCodeAt(0)]=-2;for(let t=0;t<xl.length;t+=1)e[xl[t].charCodeAt(0)]=t;return e})();function tg(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(xl[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(xl[n]),t.queuedBits-=6}}function I0(e,t,r){const n=TA[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 rg(e){const t=[],r=i=>{t.push(String.fromCodePoint(i))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=i=>{AA(i,n,r)};for(let i=0;i<e.length;i+=1)I0(e.charCodeAt(i),s,o);return t.join("")}function RA(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function PA(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}RA(n,t)}}function AA(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 _s(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;
195s+=1)I0(e.charCodeAt(s),r,n);return new Uint8Array(t)}function NA(e){const t=[];return PA(e,r=>t.push(r)),new Uint8Array(t)}function vn(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>tg(s,r,n)),tg(null,r,n),t.join("")}function OA(e){return Math.round(Date.now()/1e3)+e}function jA(){return Symbol("auth-callback")}const Ke=()=>typeof window<"u"&&typeof document<"u",cn={tested:!1,writable:!1},L0=()=>{if(!Ke())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(cn.tested)return cn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),cn.tested=!0,cn.writable=!0}catch{cn.tested=!0,cn.writable=!1}return cn.writable};function IA(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,o)=>{t[o]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const D0=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),LA=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",es=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},It=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return null}},Se=async(e,t)=>{await e.removeItem(t)};class fc{constructor(){this.promise=new fc.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}fc.promiseConstructor=Promise;function ca(e){const t=e.split(".");if(t.length!==3)throw new bl("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!bA.test(t[n]))throw new bl("JWT not in base64url format");return{header:JSON.parse(rg(t[0])),payload:JSON.parse(rg(t[1])),signature:_s(t[2]),raw:{header:t[0],payload:t[1]}}}async function DA(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function MA(e,t){return new Promise((n,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const i=await e(o);if(!t(o,null,i)){n(i);return}}catch(i){if(!t(o,i)){s(i);return}}})()})}function $A(e){return("0"+e.toString(16)).substr(-2)}function UA(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let o=0;o<56;o++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,$A).join("")}async function FA(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function zA(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 FA(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function un(e,t,r=!1){const n=UA();let s=n;r&&(s+="/recovery"),await es(e,`${t}-code-verifier`,s);const o=await zA(n);return[o,n===o?"plain":"s256"]}const BA=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function WA(e){const t=e.headers.get(Qd);if(!t||!t.match(BA))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function HA(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 VA(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 KA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function cr(e){if(!KA.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Lt(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function wu(){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 qA(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;
195if(typeof n=="symbol"){const o=n.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="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 ng(e){return JSON.parse(JSON.stringify(e))}const hn=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},GA=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function sg(e){var t;if(!LA(e))throw new Zd(hn(e),0);if(GA.includes(e.status))throw new Zd(hn(e),e.status);let r;try{r=await e.json()}catch(o){throw new Ft(hn(o),o)}let n;const s=WA(e);if(s&&s.getTime()>=j0["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 Zm(hn(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new je}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((o,i)=>o&&typeof i=="string",!0))throw new Zm(hn(r),e.status,r.weak_password.reasons);throw new _A(hn(r),e.status||500,n)}const YA=(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 B(e,t,r,n){var s;const o=Object.assign({},n==null?void 0:n.headers);o[Qd]||(o[Qd]=j0["2024-01-01"].name),n!=null&&n.jwt&&(o.Authorization=`Bearer ${n.jwt}`);const i=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(i.redirect_to=n.redirectTo);const a=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",l=await JA(e,t,r+a,{headers:o,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 JA(e,t,r,n,s,o){const i=YA(t,n,s,o);let a;try{a=await e(r,Object.assign({},i))}catch(l){throw console.error(l),new Zd(hn(l),0)}if(a.ok||await sg(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await sg(l)}}function xt(e){var t;let r=null;ZA(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=OA(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:r,user:n},error:null}}function og(e){const t=xt(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 Ur(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function XA(e){return{data:e,error:null}}function QA(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o}=e,i=cc(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:o},l=Object.assign({},i);return{data:{properties:a,user:l},error:null}}function ig(e){return e}function ZA(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const bu=["global","local","others"];class eN{constructor({url:t="",headers:r={},fetch:n,experimental:s}){this.url=t,this.headers=r,this.fetch=D0(n),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,r=bu[0]){if(bu.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${bu.join(", ")}`);try{return await B(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 B(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Ur})}catch(n){if(M(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=cc(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 B(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:QA,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 B(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ur})}catch(r){if(M(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,o,i,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await B(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:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:ig});if(u.error)throw u.error;const f=await u.json(),d=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,m=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(v=>{const g=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(v.split(";")[1].split("=")[1]);c[`${x}Page`]=g}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(M(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){cr(t);try{return await B(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ur})}catch(r){if(M(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){cr(t);try{return await B(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Ur})}catch(n){if(M(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){cr(t);
195try{return await B(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Ur})}catch(n){if(M(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){cr(t.userId);try{const{data:r,error:n}=await B(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){cr(t.userId),cr(t.id);try{return{data:await B(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,o,i,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await B(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:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:ig});if(u.error)throw u.error;const f=await u.json(),d=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,m=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(v=>{const g=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(v.split(";")[1].split("=")[1]);c[`${x}Page`]=g}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(M(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(t){try{return await B(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 B(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 B(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 B(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 B(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}}async _listCustomProviders(t){try{const r={};return t!=null&&t.type&&(r.type=t.type),await B(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(M(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await B(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(M(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await B(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(M(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await B(this.fetch,"PUT",`${this.url}/admin/custom-providers/${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 _deleteCustomProvider(t){try{return await B(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(M(r))return{data:null,error:r};throw r}}async _adminListPasskeys(t){Lt(this.experimental),cr(t.userId);try{return await B(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(M(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(t){Lt(this.experimental),cr(t.userId),cr(t.passkeyId);
195try{return await B(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(M(r))return{data:null,error:r};throw r}}}function ag(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}globalThis&&L0()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class tN extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}function rN(){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 M0(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function nN(e){return parseInt(e,16)}function sN(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function oN(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:o=new Date,nonce:i,notBefore:a,requestId:l,resources:c,scheme:u,uri:f,version:d}=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(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(d!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 196`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=M0(e.address),v=u?`${u}://${n}`:n,g=e.statement?`${e.statement} 197`:"",x=`${v} wants you to sign in with your Ethereum account: 198${m} 199 200${g}`;let y=`URI: ${f} 201Version: ${d} 202Chain ID: ${r}${i?` 203Nonce: ${i}`:""} 204Issued At: ${o.toISOString()}`;if(s&&(y+=` 205Expiration Time: ${s.toISOString()}`),a&&(y+=` 206Not Before: ${a.toISOString()}`),l&&(y+=` 207Request ID: ${l}`),c){let w=` 208Resources:`;for(const b of c){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);w+=` 209- ${b}`}y+=w}return`${x} 210${y}`}class Ce extends Error{constructor({message:t,code:r,cause:n,name:s}){var o;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(o=s??(n instanceof Error?n.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class _l extends Ce{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function iN({error:e,options:t}){var r,n,s;const{publicKey:o}=t;if(!o)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ce({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=o.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Ce({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=o.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Ce({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=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Ce({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 Ce({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ce({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return o.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new Ce({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ce({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 i=window.location.hostname;if($0(i)){if(o.rp.id!==i)return new Ce({message:`The RP ID "${o.rp.id}
210" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ce({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new Ce({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 Ce({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 Ce({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function aN({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 Ce({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ce({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if($0(n)){if(r.rpId!==n)return new Ce({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ce({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ce({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 Ce({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class lN{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 ef=new lN;function lg(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=cc(e,["challenge","user","excludeCredentials"]),o=_s(t).buffer,i=Object.assign(Object.assign({},r),{id:_s(r.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:o,user:i});if(n&&n.length>0){a.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const c=n[l];a.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:_s(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function cg(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=cc(e,["challenge","allowCredentials"]),s=_s(t).buffer,o=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){o.allowCredentials=new Array(r.length);for(let i=0;i<r.length;i++){const a=r[i];o.allowCredentials[i]=Object.assign(Object.assign({},a),{id:_s(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return o}function ug(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:vn(new Uint8Array(e.response.attestationObject)),clientDataJSON:vn(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function dg(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:vn(new Uint8Array(s.authenticatorData)),clientDataJSON:vn(new Uint8Array(s.clientDataJSON)),signature:vn(new Uint8Array(s.signature)),userHandle:s.userHandle?vn(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function $0(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Sl(){var e,t;return!!(Ke()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function U0(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new _l("Browser returned unexpected credential type",t)}:{data:null,error:new _l("Empty credential response",t)}}
210catch(t){return{data:null,error:iN({error:t,options:e})}}}async function F0(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new _l("Browser returned unexpected credential type",t)}:{data:null,error:new _l("Empty credential response",t)}}catch(t){return{data:null,error:aN({error:t,options:e})}}}const cN={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},uN={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function El(...e){const t=s=>s!==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 o in s){const i=s[o];if(i!==void 0)if(Array.isArray(i))n[o]=i;else if(r(i))n[o]=i;else if(t(i)){const a=n[o];t(a)?n[o]=El(a,i):n[o]=El(i)}else n[o]=i}return n}function dN(e,t){return El(cN,e,t||{})}function fN(e,t){return El(uN,e,t||{})}class hN{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},o){var i;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!a)return{data:null,error:l};const c=s??ef.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;if(!u.name){const f=n;if(f)u.name=`${u.id}:${f}`;else{const m=(await this.client.getUser()).data.user,v=((i=m==null?void 0:m.user_metadata)===null||i===void 0?void 0:i.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";u.name=`${u.id}:${v}`}}u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{const u=dN(a.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:f,error:d}=await U0({publicKey:u,signal:c});return f?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:f}},error:null}:{data:null,error:d}}case"request":{const u=fN(a.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:f,error:d}=await F0(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:c}));return f?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:f}},error:null}:{data:null,error:d}}}}catch(a){return M(a)?{data:null,error:a}:{data:null,error:new Ft("Unexpected error in challenge",a)}}}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}={}},o){if(!r)return{data:null,error:new ci("rpId is required for WebAuthn authentication")};try{if(!Sl())return{data:null,error:new Ft("Browser does not support WebAuthn",null)};const{data:i,error:a}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:o});if(!i)return{data:null,error:a};const{webauthn:l}=i;return this._verify({factorId:t,challengeId:i.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(i){return M(i)?{data:null,error:i}:{data:null,error:new Ft("Unexpected error in authenticate",i)}}}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}={}},o){if(!r)return{data:null,error:new ci("rpId is required for WebAuthn registration")};try{if(!Sl())return{data:null,error:new Ft("Browser does not support WebAuthn",null)};const{data:i,error:a}=await this._enroll({friendlyName:t});if(!i)return await this.client.mfa.listFactors().then(u=>{var f;return(f=u.data)===null||f===void 0?void 0:f.all.find(d=>d.factor_type==="webauthn"&&d.friendly_name===t&&d.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:a};const{data:l,error:c}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:o});return l?this._verify({factorId:i.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(i){return M(i)?{data:null,error:i}:{data:null,error:new Ft("Unexpected error in register",i)}}}}rN();const pN={url:vA,storageKey:yA,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:wA,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},Vn={};class ui{get jwks(){var t,r;return(r=(t=Vn[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Vn[this.storageKey]=Object.assign(Object.assign({},Vn[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Vn[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Vn[this.storageKey]=Object.assign(Object.assign({},Vn[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.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},pN),t);
210if(this.storageKey=o.storageKey,this.instanceID=(r=ui.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,ui.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&Ke()){const i=`${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(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(n=o.experimental)!==null&&n!==void 0?n:{},this.admin=new eN({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=D0(o.fetch),this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock!=null&&(this.lock=o.lock),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 hN(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:L0()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ag(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=ag(this.memoryStorage)),Ke()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),(i.data.event==="TOKEN_REFRESHED"||i.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}o.skipAutoInitialize||this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${O0}) ${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()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(Ke()&&(r=IA(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Ke()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),EA(o)){const l=(t=o.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:o}}return{error:o}}const{session:i,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",i,"redirect type",a),await this._saveSession(i),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return M(r)?this._returnResult({error:r}):this._returnResult({error:new Ft("Unexpected error during initialization",r)}
210)}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const o=await B(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:xt}),{data:i,error:a}=o;if(a||!i)return this._returnResult({data:{user:null,session:null},error:a});const l=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(o){if(M(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(t){var r,n,s;try{let o;if("email"in t){const{email:u,password:f,options:d}=t;let m=null,v=null;this.flowType==="pkce"&&([m,v]=await un(this.storage,this.storageKey)),o=await B(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d==null?void 0:d.emailRedirectTo,body:{email:u,password:f,data:(r=d==null?void 0:d.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:m,code_challenge_method:v},xform:xt})}else if("phone"in t){const{phone:u,password:f,options:d}=t;o=await B(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:f,data:(n=d==null?void 0:d.data)!==null&&n!==void 0?n:{},channel:(s=d==null?void 0:d.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:xt})}else throw new aa("You must provide either an email or phone number and a password");const{data:i,error:a}=o;if(a||!i)return await Se(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(o){if(await Se(this.storage,`${this.storageKey}-code-verifier`),M(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let r;if("email"in t){const{email:o,password:i,options:a}=t;r=await B(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:og})}else if("phone"in t){const{phone:o,password:i,options:a}=t;r=await B(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:og})}else throw new aa("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 o=new Hn;return this._returnResult({data:{user:null,session:null},error:o})}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,o;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:(o=t.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t)):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,o,i,a,l,c,u,f,d;let m,v;if("message"in t)m=t.message,v=t.signature;else{const{chain:g,wallet:x,statement:y,options:w}=t;let b;if(Ke())if(typeof x=="object")b=x;else{const N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")b=N.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 x!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=x}const _=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href),S=await b.request({method:"eth_requestAccounts"}).then(N=>N).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=M0(S[0]);let E=(n=w==null?void 0:w.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!E){const N=await b.request({method:"eth_chainId"});E=nN(N)}const T={domain:_.host,address:k,statement:y,uri:_.href,version:"1",chainId:E,nonce:(s=w==null?void 0:w.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(i=(o=w==null?void 0:w.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(a=w==null?void 0:w.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=w==null?void 0:w.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=w==null?void 0:w.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(u=w==null?void 0:w.signInWithEthereum)===null||u===void 0?void 0:u.resources};m=oN(T),v=await b.request({method:"personal_sign",params:[sN(m),k]})}try{const{data:g,error:x}=await B(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:v},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(d=t.options)===null||d===void 0?void 0:d.captchaToken}}:null),xform:xt});if(x)throw x;if(!g||!g.session||!g.user){const y=new Hn;return this._returnResult({data:{user:null,session:null},error:y})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:x})}catch(g){if(M(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,s,o,i,a,l,c,u,f,d,m;let v,g;if("message"in t)v=t.message,g=t.signature;else{const{chain:x,wallet:y,statement:w,options:b}=t;let _;if(Ke())if(typeof y=="object")_=y;
210else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))_=k.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 y!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=y}const S=new URL((r=b==null?void 0:b.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in _&&_.signIn){const k=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),w?{statement:w}:null));let E;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")E=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)E=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)v=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),g=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${S.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(s=(n=b==null?void 0:b.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=b==null?void 0:b.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((i=b==null?void 0:b.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((a=b==null?void 0:b.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((c=b==null?void 0:b.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((f=(u=b==null?void 0:b.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||f===void 0)&&f.length?["Resources",...b.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(` 211`);const k=await _.signMessage(new TextEncoder().encode(v),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=k}}try{const{data:x,error:y}=await B(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:vn(g)},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:xt});if(y)throw y;if(!x||!x.session||!x.user){const w=new Hn;return this._returnResult({data:{user:null,session:null},error:w})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:y})}catch(x){if(M(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(t){const r=await It(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new kA;const{data:o,error:i}=await B(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:xt});if(await Se(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!o||!o.session||!o.user){const a=new Hn;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:i})}catch(o){if(await Se(this.storage,`${this.storageKey}-code-verifier`),M(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:o,nonce:i}=t,a=await B(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:o,nonce:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:xt}),{data:l,error:c}=a;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const u=new Hn;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(r){if(M(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,o,i;try{if("email"in t){const{email:a,options:l}=t;
211let c=null,u=null;this.flowType==="pkce"&&([c,u]=await un(this.storage,this.storageKey));const{error:f}=await B(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:c,code_challenge_method:u},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:a,options:l}=t,{data:c,error:u}=await B(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:(o=l==null?void 0:l.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(i=l==null?void 0:l.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:u})}throw new aa("You must provide either an email or phone number.")}catch(a){if(await Se(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,o;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,o=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:i,error:a}=await B(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:xt});if(a)throw a;if(!i)throw new Error("An error occurred on token verification.");const l=i.session,c=i.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(s){if(M(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,o,i;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await un(this.storage,this.storageKey));const c=await B(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:XA});return!((o=c.data)===null||o===void 0)&&o.url&&Ke()&&!(!((i=t.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(a){if(await Se(this.storage,`${this.storageKey}-code-verifier`),M(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):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 je;const{error:s}=await B(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:o}=t;let i=null,a=null;this.flowType==="pkce"&&([i,a]=await un(this.storage,this.storageKey));const{error:l}=await B(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:o==null?void 0:o.emailRedirectTo});return l&&await Se(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l})}else if("phone"in t){const{phone:n,type:s,options:o}=t,{data:i,error:a}=await B(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:a})}throw new aa("You must provide either an email or phone number and a type")}catch(r){if(await Se(this.storage,`${this.storageKey}-code-verifier`),M(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async t=>t)):await this._useSession(async t=>t)}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.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await It(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 val
211id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<yu:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const i=await It(this.userStorage,this.storageKey+"-user");i!=null&&i.user?t.user=i.user:t.user=wu()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};t.user=qA(t.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);if(o){if(!!(t.expires_at&&t.expires_at*1e3>Date.now())){const a=await It(this.storage,this.storageKey);if(a&&a.refresh_token===t.refresh_token)return this._returnResult({data:{session:t},error:null})}return this._returnResult({data:{session:null},error:o})}return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await B(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ur}):await this._useSession(async r=>{var n,s,o;const{data:i,error:a}=r;if(a)throw a;return!(!((n=i.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new je}:await B(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:Ur})})}catch(r){if(M(r))return ia(r)&&(await this._removeSession(),await Se(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r)):await this._updateUser(t,r)}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:o}=n;if(o)throw o;if(!s.session)throw new je;const i=s.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await un(this.storage,this.storageKey));const{data:c,error:u}=await B(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:i.access_token,xform:Ur});if(u)throw u;return i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await Se(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,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t)):await this._setSession(t)}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new je;const r=Date.now()/1e3;let n=r,s=!0,o=null;const{payload:i}=ca(t.access_token);if(i.exp&&(n=i.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};o=a}else{const{data:a,error:l}=await this._getUser(t.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});o={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(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},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,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t)):await this._refreshSession(t)}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:i,error:a}=r;if(a)throw a;t=(n=i.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new je;const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):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){var n;
211try{if(!Ke())throw new la("No browser detected.");if(t.error||t.error_description||t.error_code)throw new la(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 Jm("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new la("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 Jm("No code detected.");const{data:b,error:_}=await this._exchangeCodeForSession(t.code);if(_)throw _;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:b.session,redirectType:(n=b.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:s,provider_refresh_token:o,access_token:i,refresh_token:a,expires_in:l,expires_at:c,token_type:u}=t;if(!i||!l||!a||!u)throw new la("No session defined in URL");const f=Math.round(Date.now()/1e3),d=parseInt(l);let m=f+d;c&&(m=parseInt(c));const v=m-f;v*1e3<=hr&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${v}s, should have been closer to ${d}s`);const g=m-d;f-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,m,f):f-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,m,f);const{data:x,error:y}=await this._getUser(i);if(y)throw y;const w={provider_token:s,provider_refresh_token:o,access_token:i,expires_in:d,expires_at:m,refresh_token:a,token_type:u,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:t.type},error:null})}catch(s){if(M(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error||t.error_description||t.error_code)}async _isPKCECallback(t){const r=await It(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t)):await this._signOut(t)}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o&&!ia(o))return this._returnResult({error:o});const i=(n=s.session)===null||n===void 0?void 0:n.access_token;if(i){const{error:a}=await this.admin.signOut(i,t);if(a&&!(SA(a)&&(a.status===404||a.status===401||a.status===403)||ia(a)))return this._returnResult({error:a})}return t!=="others"&&(await this._removeSession(),await Se(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=jA(),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,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:o},error:i}=r;if(i)throw i;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",t,"session",o)}catch(o){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",o),ia(o)?console.warn(o):console.error(o)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await un(this.storage,this.storageKey,!0));try{return await B(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(o){if(await Se(this.storage,`${this.storageKey}-code-verifier`),M(o))return this._returnResult({data:null,error:o});throw o}}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 o=>{var i,a,l,c,u;const{data:f,error:d}=o;if(d)throw d;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(i=t.options)===null||i===void 0?void 0:i.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 B(this.fetch,"GET",m,{headers:this.headers,jwt:(u=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return Ke()&&!(!((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:o}}=r;if(s)throw s;const{options:i,provider:a,token:l,access_token:c,nonce:u}=t,f=await B(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=o==null?void 0:o.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:l,access_token:c,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:xt}),{data:d,error:m}=f;return m?this._returnResult({data:{user:null,session:null},error:m}):!d||!d.session||!d.user?this._returnResult({data:{user:null,session:null},error:new Hn}):(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),this._returnResult({data:d,error:m}))}catch(s){if(await Se(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:o,error:i}=r;if(i)throw i;
211return await B(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=o.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()";this._debug(r,"begin");try{const n=Date.now();return await MA(async s=>(s>0&&await DA(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await B(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:xt})),(s,o)=>{const i=200*Math.pow(2,s);return o&&Xm(o)&&Date.now()+i-n<hr})}catch(n){if(this._debug(r,"error",n),M(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),Ke()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await It(this.storage,this.storageKey);if(s&&this.userStorage){let i=await It(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:s.user},await es(this.userStorage,this.storageKey+"-user",i)),s.user=(t=i==null?void 0:i.user)!==null&&t!==void 0?t:wu()}else if(s&&!s.user&&!s.user){const i=await It(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(s.user=i.user,await Se(this.storage,this.storageKey+"-user"),await es(this.storage,this.storageKey,s)):s.user=wu()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const o=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<yu;if(this._debug(n,`session has${o?"":" not"} expired with margin of ${yu}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:i}=await this._callRefreshToken(s.refresh_token);i&&(CA(i)?this._debug(n,"refresh discarded by commit guard",i):this._debug(n,"refresh failed",i))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:a}=await this._getUser(s.access_token);!a&&(i!=null&&i.user)?(s.user=i.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(n,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new je;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===t&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const s="#_callRefreshToken()";this._debug(s,"begin");try{this.refreshingDeferred=new fc;const o=await It(this.storage,this.storageKey),{data:i,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!i.session)throw new je;const l=await It(this.storage,this.storageKey);if(o!==null&&(l===null||l.refresh_token!==o.refresh_token)){this._debug(s,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:l?"replaced":"cleared"});const d={data:null,error:new Qm};return this.refreshingDeferred.resolve(d),d}const u=this._sessionRemovalEpoch;if(await this._saveSession(i.session),this._sessionRemovalEpoch!==u){this._debug(s,"commit guard (post-save): _removeSession ran during _saveSession, und
211oing write"),await Se(this.storage,this.storageKey),this.userStorage&&await Se(this.userStorage,this.storageKey+"-user");const d={data:null,error:new Qm};return this.refreshingDeferred.resolve(d),d}await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const f={data:i.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(f),f}catch(o){if(this._debug(s,"error",o),M(o)){const i={data:null,error:o};if(!Xm(o)){const a=await It(this.storage,this.storageKey);!!(a!=null&&a.expires_at&&a.expires_at*1e3>Date.now())?this._debug(s,"proactive refresh failed, access token still valid â preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:t,result:i,expiresAt:Date.now()+gA},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(i),i}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const o=[],i=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(t,r)}catch(l){o.push(l)}});if(await Promise.all(i),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Se(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await es(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const o=ng(s);await es(this.storage,this.storageKey,o)}else{const s=ng(r);await es(this.storage,this.storageKey,s)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await Se(this.storage,this.storageKey),await Se(this.storage,this.storageKey+"-code-verifier"),await Se(this.storage,this.storageKey+"-user"),this.userStorage&&await Se(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Ke()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),hr);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 dispose(){var t;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(t=this.broadcastChannel)===null||t===void 0||t.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){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)/hr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${hr}ms, refresh threshold is ${_o} ticks`),s<=_o&&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 instanceof tN)this._debug("auto refresh token tick lock not available");else throw t}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const t=Date.now();try{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)/hr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${hr}ms, refresh threshold is ${_o} ticks`),s<=_o&&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")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ke()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!t)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>
211{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()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else 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[o,i]=await un(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(i)}`});s.push(a.toString())}if(n!=null&&n.queryParams){const o=new URLSearchParams(n.queryParams);s.push(o.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:o}=r;return o?this._returnResult({data:null,error:o}):await B(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:o,error:i}=r;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:c}=await B(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(t.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:o,error:i}=n;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?ug(t.webauthn.credential_response):dg(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await B(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(M(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(t){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:o,error:i}=n;if(i)return this._returnResult({data:null,error:i});const a=await B(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});if(a.error)return a;const{data:l}=a;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:lg(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:cg(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(M(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):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 o of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,s,o;if(t)try{const{payload:m}=ca(t);let v=null;m.aal&&(v=m.aal);let g=v;const{data:{user:x},error:y}=await this.getUser(t);if(y)return this._returnResult({data:null,error:y});((n=(r=x==null?void 0:x.factors)===null||r===void 0?void 0:r.filter(_=>_.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(g="aal2");const b=m.amr||[];return{data:{currentLevel:v,nextLevel:g,currentAuthenticationMethods:b},error:null}}catch(m){if(M(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:i},error:a}
211=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=ca(i.access_token);let c=null;l.aal&&(c=l.aal);let u=c;((o=(s=i.user.factors)===null||s===void 0?void 0:s.filter(m=>m.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(u="aal2");const d=l.amr||[];return{data:{currentLevel:c,nextLevel:u,currentAuthenticationMethods:d},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await B(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new je})})}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:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new je});const i=await B(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 i.data&&i.data.redirect_url&&Ke()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}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:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new je});const i=await B(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 i.data&&i.data.redirect_url&&Ke()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}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 B(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 je})})}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 B(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 je})})}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+xA>s)return n;const{data:o,error:i}=await B(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,n=o.keys.find(a=>a.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:m,error:v}
211=await this.getSession();if(v||!m.session)return this._returnResult({data:null,error:v});n=m.session.access_token}const{header:s,payload:o,signature:i,raw:{header:a,payload:l}}=ca(n);if(!(r!=null&&r.allowExpired))try{HA(o.exp)}catch(m){throw new bl(m instanceof Error?m.message:"JWT validation failed")}const c=!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(!c){const{error:m}=await this.getUser(n);if(m)throw m;return{data:{claims:o,header:s,signature:i},error:null}}const u=VA(s.alg),f=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,i,NA(`${a}.${l}`)))throw new bl("Invalid JWT signature");return{data:{claims:o,header:s,signature:i},error:null}}catch(n){if(M(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(t){var r,n,s;Lt(this.experimental);try{if(!Sl())return this._returnResult({data:null,error:new Ft("Browser does not support WebAuthn",null)});const{data:o,error:i}=await this._startPasskeyAuthentication({options:{captchaToken:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}});if(i||!o)return this._returnResult({data:null,error:i});const a=cg(o.options),l=(s=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:ef.createNewAbortSignal(),{data:c,error:u}=await F0({publicKey:a,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new Ft("WebAuthn ceremony failed",null)});const f=dg(c);return this._verifyPasskeyAuthentication({challengeId:o.challenge_id,credential:f})}catch(o){if(M(o))return this._returnResult({data:null,error:o});throw o}}async registerPasskey(t){var r,n;Lt(this.experimental);try{if(!Sl())return this._returnResult({data:null,error:new Ft("Browser does not support WebAuthn",null)});const{data:s,error:o}=await this._startPasskeyRegistration();if(o||!s)return this._returnResult({data:null,error:o});const i=lg(s.options),a=(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:ef.createNewAbortSignal(),{data:l,error:c}=await U0({publicKey:i,signal:a});if(c||!l)return this._returnResult({data:null,error:c??new Ft("WebAuthn ceremony failed",null)});const u=ug(l);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:u})}catch(s){if(M(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){Lt(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new je});const{data:s,error:o}=await B(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(t){if(M(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){Lt(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new je});const{data:o,error:i}=await B(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:o,error:null})})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(t){var r;Lt(this.experimental);try{const{data:n,error:s}=await B(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})}catch(n){if(M(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(t){Lt(this.experimental);try{const{data:r,error:n}=await B(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:xt});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){Lt(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new je});const{data:s,error:o}=await B(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(t){if(M(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){Lt(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new je});const{data:o,error:i}=await B(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:t.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:o,error:null})})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(t){Lt(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new je});const{error:o}
211=await B(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return o?this._returnResult({data:null,error:o}):this._returnResult({data:null,error:null})})}catch(r){if(M(r))return this._returnResult({data:null,error:r});throw r}}}ui.nextInstanceID={};const mN=ui,gN="2.110.0";let So="",kl;if(typeof Deno<"u"){var xu;So="deno",kl=(xu=Deno.version)===null||xu===void 0?void 0:xu.deno}else if(typeof document<"u")So="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")So="react-native";else{var _u;So="node",kl=typeof process<"u"?(_u=process.version)===null||_u===void 0?void 0:_u.replace(/^v/,""):void 0}const z0=[`runtime=${So}`];kl&&z0.push(`runtime-version=${kl}`);const vN={"X-Client-Info":`supabase-js/${gN}; ${z0.join("; ")}`},yN={headers:vN},wN={schema:"public"},bN={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},xN={},_N={enabled:!1,respectSamplingDecision:!0};function SN(e,t,r,n){function s(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function a(u){try{c(n.next(u))}catch(f){i(f)}}function l(u){try{c(n.throw(u))}catch(f){i(f)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((n=n.apply(e,[])).next())})}let Su=null;const EN="@opentelemetry/api";function kN(){return Su===null&&(Su=import(EN).catch(()=>null)),Su}function CN(){return SN(this,void 0,void 0,function*(){try{const e=yield kN();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const r=t.traceparent;return r?{traceparent:r,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function TN(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[r,n,s,o]=t;if(r.length!==2||n.length!==32||s.length!==16||o.length!==2)return null;const i=/^[0-9a-f]+$/i;return!i.test(r)||!i.test(n)||!i.test(s)||!i.test(o)||n==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:r,traceId:n,parentId:s,traceFlags:o,isSampled:(parseInt(o,16)&1)===1}}function RN(e,t){if(!e||!t||t.length===0)return!1;let r;if(e instanceof URL)r=e;else try{r=new URL(e)}catch{return!1}for(const n of t)try{if(typeof n=="string"){if(PN(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function PN(e,t){if(t===e)return!0;if(t.startsWith("*.")){const r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}function AN(e){const t=[];try{const r=new URL(e);t.push(r.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function di(e){"@babel/helpers - typeof";return di=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},di(e)}function NN(e,t){if(di(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ON(e){var t=NN(e,"string");return di(t)=="symbol"?t:t+""}function jN(e,t,r){return(t=ON(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fg(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 be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fg(Object(r),!0).forEach(function(n){jN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const IN=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),LN=()=>Headers,DN=(e,t,r,n,s)=>{const o=IN(n),i=LN(),a=(s==null?void 0:s.enabled)===!0,l=(s==null?void 0:s.respectSamplingDecision)!==!1,c=a?AN(t):null;return async(u,f)=>{var d;const m=(d=await r())!==null&&d!==void 0?d:e;let v=new i(f==null?void 0:f.headers);if(v.has("apikey")||v.set("apikey",e),v.has("Authorization")||v.set("Authorization",`Bearer ${m}`),c){const g=await MN(u,c,l);g&&(g.traceparent&&!v.has("traceparent")&&v.set("traceparent",g.traceparent),g.tracestate&&!v.has("tracestate")&&v.set("tracestate",g.tracestate),g.baggage&&!v.has("baggage")&&v.set("baggage",g.baggage))}return o(u,be(be({},f),{},{headers:v}))}};async function MN(e,t,r){if(!RN(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const n=await CN();if(!n||!n.traceparent)return null;if(r){const s=TN(n.traceparent);if(s&&!s.isSampled)return null}return n}function hg(e){return typeof e=="boolean"?{enabled:e}:e}function $N(e){return e.endsWith("/")?e:e+"/"}function UN(e,t){var r,n,s,o,i,a;const{db:l,auth:c,realtime:u,global:f}=e,{db:d,auth:m,realtime:v,global:g}=t,x=hg(e.tracePropagation),y=hg(t.tracePropagation),w={db:be(be({},d),l),auth:be(be({},m),c),realtime:be(be({},v),u),storage:{},global:be(be(be({},g),f),{},{headers:be(be({},(r=g==null?void 0:g.headers)!==null&&r!==void 0?r:{}),(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(s=(o=x==null?void 0:x.enabled)!==null&&o!==void 0?o:y==null?void 0:y.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(i=(a=x==null?void 0:x.respectSamplingDecision)!==null&&a!==void 0?a:y==null?void 0:y.respectSamplingDecision)!==null&&i!==void 0?i:!0},accessToken:async()=>""};return e.accessToken?w.accessToken=e.accessToken:delete w.accessToken,w}function FN(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");
211if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL($N(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var zN=class extends mN{constructor(e){super(e)}},BN=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const o=FN(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const i=`sb-${o.hostname.split(".")[0]}-auth-token`,a={db:wN,realtime:xN,auth:be(be({},bN),{},{storageKey:i}),global:yN,tracePropagation:_N},l=UN(r??{},a);if(this.settings=l,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:(u,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=l.auth)!==null&&c!==void 0?c:{},this.headers,l.global.fetch)}this.fetch=DN(t,e,this._getAccessToken.bind(this),l.global.fetch,l.tracePropagation),this.realtime=this._initRealtimeClient(be({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new XR(new URL("rest/v1",o).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new mA(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new BR(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:o,flowType:i,lock:a,debug:l,throwOnError:c,experimental:u,lockAcquireTimeout:f,skipAutoInitialize:d},m,v){const g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new zN({url:this.authUrl.href,headers:be(be({},g),m),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:i,lock:a,debug:l,throwOnError:c,experimental:u,fetch:v,lockAcquireTimeout:f,skipAutoInitialize:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(x=>x.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new UP(this.realtimeUrl.href,be(be({},e),{},{params:be(be({},{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 WN=(e,t,r)=>new BN(e,t,r);function HN(){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)<=20:!1}HN()&&console.warn("â ï¸ Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
211ode.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");const VN="https://flfrklwsgqxvowxgnius.supabase.co",KN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZsZnJrbHdzZ3F4dm93eGduaXVzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTQ1MTIyODYsImV4cCI6MjA3MDA4ODI4Nn0.QhvN3O2-TD4jacF2FCs1psDo6fDIj4SICbrPdcfaYHU",G=WN(VN,KN,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});var B0={exports:{}},qN="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",GN=qN,YN=GN;function W0(){}function H0(){}H0.resetWarningCache=W0;var JN=function(){function e(n,s,o,i,a,l){if(l!==YN){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:H0,resetWarningCache:W0};return r.PropTypes=r,r};B0.exports=JN();var XN=B0.exports;const ne=Ds(XN);var QN=typeof Element<"u",ZN=typeof Map=="function",eO=typeof Set=="function",tO=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ua(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(!Ua(e[n],t[n]))return!1;return!0}var o;if(ZN&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(n=o.next()).done;)if(!t.has(n.value[0]))return!1;for(o=e.entries();!(n=o.next()).done;)if(!Ua(n.value[1],t.get(n.value[0])))return!1;return!0}if(eO&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(n=o.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(tO&&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(QN&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!Ua(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var rO=function(t,r){try{return Ua(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 nO=Ds(rO);var sO=function(e,t,r,n,s,o,i,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 c=[r,n,s,o,i,a],u=0;l=new Error(t.replace(/%s/g,function(){return c[u++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},oO=sO;const pg=Ds(oO);var iO=function(t,r,n,s){var o=n?n.call(s,t,r):void 0;if(o!==void 0)return!!o;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),c=0;c<i.length;c++){var u=i[c];if(!l(u))return!1;var f=t[u],d=r[u];if(o=n?n.call(s,f,d,u):void 0,o===!1||o===void 0&&f!==d)return!1}return!0};const aO=Ds(iO);function Ee(){return Ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ee.apply(this,arguments)}function Th(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,tf(e,t)}function tf(e,t){return tf=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},tf(e,t)}function mg(e,t){if(e==null)return{};var r,n,s={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(s[r]=e[r]);return s}var Y={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},lO={rel:["amphtml","canonical","alternate"]},cO={type:["application/ld+json"]}
211,uO={charset:"",name:["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"]},gg=Object.keys(Y).map(function(e){return Y[e]}),Cl={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},dO=Object.keys(Cl).reduce(function(e,t){return e[Cl[t]]=t,e},{}),Ss=function(e,t){for(var r=e.length-1;r>=0;r-=1){var n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},fO=function(e){var t=Ss(e,Y.TITLE),r=Ss(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,function(){return t});var n=Ss(e,"defaultTitle");return t||n||void 0},hO=function(e){return Ss(e,"onChangeClientState")||function(){}},Eu=function(e,t){return t.filter(function(r){return r[e]!==void 0}).map(function(r){return r[e]}).reduce(function(r,n){return Ee({},r,n)},{})},pO=function(e,t){return t.filter(function(r){return r[Y.BASE]!==void 0}).map(function(r){return r[Y.BASE]}).reverse().reduce(function(r,n){if(!r.length)for(var s=Object.keys(n),o=0;o<s.length;o+=1){var i=s[o].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}return r},[])},ho=function(e,t,r){var n={};return r.filter(function(s){return!!Array.isArray(s[e])||(s[e]!==void 0&&console&&typeof console.warn=="function"&&console.warn("Helmet: "+e+' should be of type "Array". Instead found type "'+typeof s[e]+'"'),!1)}).map(function(s){return s[e]}).reverse().reduce(function(s,o){var i={};o.filter(function(f){for(var d,m=Object.keys(f),v=0;v<m.length;v+=1){var g=m[v],x=g.toLowerCase();t.indexOf(x)===-1||d==="rel"&&f[d].toLowerCase()==="canonical"||x==="rel"&&f[x].toLowerCase()==="stylesheet"||(d=x),t.indexOf(g)===-1||g!=="innerHTML"&&g!=="cssText"&&g!=="itemprop"||(d=g)}if(!d||!f[d])return!1;var y=f[d].toLowerCase();return n[d]||(n[d]={}),i[d]||(i[d]={}),!n[d][y]&&(i[d][y]=!0,!0)}).reverse().forEach(function(f){return s.push(f)});for(var a=Object.keys(i),l=0;l<a.length;l+=1){var c=a[l],u=Ee({},n[c],i[c]);n[c]=u}return s},[]).reverse()},mO=function(e,t){if(Array.isArray(e)&&e.length){for(var r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},V0=function(e){return Array.isArray(e)?e.join(""):e},ku=function(e,t){return Array.isArray(e)?e.reduce(function(r,n){return function(s,o){for(var i=Object.keys(s),a=0;a<i.length;a+=1)if(o[i[a]]&&o[i[a]].includes(s[i[a]]))return!0;return!1}(n,t)?r.priority.push(n):r.default.push(n),r},{priority:[],default:[]}):{default:e}},vg=function(e,t){var r;return Ee({},e,((r={})[t]=void 0,r))},gO=[Y.NOSCRIPT,Y.SCRIPT,Y.STYLE],Cu=function(e,t){return t===void 0&&(t=!0),t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},yg=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r]!==void 0?r+'="'+e[r]+'"':""+r;return t?t+" "+n:n},"")},wg=function(e,t){return t===void 0&&(t={}),Object.keys(e).reduce(function(r,n){return r[Cl[n]||n]=e[n],r},t)},Fa=function(e,t){return t.map(function(r,n){var s,o=((s={key:n})["data-rh"]=!0,s);return Object.keys(r).forEach(function(i){var a=Cl[i]||i;a==="innerHTML"||a==="cssText"?o.dangerouslySetInnerHTML={__html:r.innerHTML||r.cssText}:o[a]=r[i]}),I.createElement(e,o)})},bt=function(e,t,r){switch(e){case Y.TITLE:return{toComponent:function(){return s=t.titleAttributes,(o={key:n=t.title})["data-rh"]=!0,i=wg(s,o),[I.createElement(Y.TITLE,i,n)];var n,s,o,i},toString:function(){return function(n,s,o,i){var a=yg(o),l=V0(s);return a?"<"+n+' data-rh="true" '+a+">"+Cu(l,i)+"</"+n+">":"<"+n+' data-rh="true">'+Cu(l,i)+"</"+n+">"}(e,t.title,t.titleAttributes,r)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return wg(t)},toString:function(){return yg(t)}};default:return{toComponent:function(){return Fa(e,t)},toString:function(){return function(n,s,o){return s.reduce(function(i,a){var l=Object.keys(a).filter(function(f){return!(f==="innerHTML"||f==="cssText")}).reduce(function(f,d){var m=a[d]===void 0?d:d+'="'+Cu(a[d],o)+'"';return f?f+" "+m:m},""),c=a.innerHTML||a.cssText||"",u=gO.indexOf(n)===-1;return i+"<"+n+' data-rh="true" '+l+(u?"/>":">"+c+"</"+n+">")},"")}(e,t,r)}}}},rf=function(e){var t=e.baseTag,r=e.bodyAttributes,n=e.encode,s=e.htmlAttributes,o=e.noscriptTags,i=e.styleTags,a=e.title,l=a===void 0?"":a,c=e.titleAttributes,u=e.linkTags,f=e.metaTags,d=e.scriptTags,m={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var v=function(g){var x=g.linkTags,y=g.scriptTags,w=g.encode,b=ku(g.metaTags,uO),_=ku(x,lO),S=ku(y,cO);return{priorityMethods:{toComponent:function(){return[].concat(Fa(Y.META,b.priority),Fa(Y.LINK,_.priority),Fa(Y.SCRIPT,S.priority))},toString:function(){return bt(Y.META,b.priority,w)+" "+bt(Y.LINK,_.priority,w)+" "+bt(Y.SCRIPT,S.priority,w)}},metaTags:b.default,linkTags:_.default,scriptTags:S.default}}(e);m=v.priorityMethods,u=v.linkTags,f=v.metaTags,d=v.scriptTags}return{priority:m,base:bt(Y.BASE,t,n),bodyAttributes:bt("bodyAttributes",r,n),htmlAttributes:bt("htmlAttributes",s,n),link:bt(Y.LINK,u,n),meta:bt(Y.META,f,n
211),noscript:bt(Y.NOSCRIPT,o,n),script:bt(Y.SCRIPT,d,n),style:bt(Y.STYLE,i,n),title:bt(Y.TITLE,{title:l,titleAttributes:c},n)}},ua=[],nf=function(e,t){var r=this;t===void 0&&(t=typeof document<"u"),this.instances=[],this.value={setHelmet:function(n){r.context.helmet=n},helmetInstances:{get:function(){return r.canUseDOM?ua:r.instances},add:function(n){(r.canUseDOM?ua:r.instances).push(n)},remove:function(n){var s=(r.canUseDOM?ua:r.instances).indexOf(n);(r.canUseDOM?ua:r.instances).splice(s,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=rf({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},K0=I.createContext({}),vO=ne.shape({setHelmet:ne.func,helmetInstances:ne.shape({get:ne.func,add:ne.func,remove:ne.func})}),yO=typeof document<"u",ps=function(e){function t(r){var n;return(n=e.call(this,r)||this).helmetData=new nf(n.props.context,t.canUseDOM),n}return Th(t,e),t.prototype.render=function(){return I.createElement(K0.Provider,{value:this.helmetData.value},this.props.children)},t}(h.Component);ps.canUseDOM=yO,ps.propTypes={context:ne.shape({helmet:ne.shape()}),children:ne.node.isRequired},ps.defaultProps={context:{}},ps.displayName="HelmetProvider";var Kn=function(e,t){var r,n=document.head||document.querySelector(Y.HEAD),s=n.querySelectorAll(e+"[data-rh]"),o=[].slice.call(s),i=[];return t&&t.length&&t.forEach(function(a){var l=document.createElement(e);for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(c==="innerHTML"?l.innerHTML=a.innerHTML:c==="cssText"?l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText)):l.setAttribute(c,a[c]===void 0?"":a[c]));l.setAttribute("data-rh","true"),o.some(function(u,f){return r=f,l.isEqualNode(u)})?o.splice(r,1):i.push(l)}),o.forEach(function(a){return a.parentNode.removeChild(a)}
211),i.forEach(function(a){return n.appendChild(a)}),{oldTags:o,newTags:i}},Tu=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var n=r.getAttribute("data-rh"),s=n?n.split(","):[],o=[].concat(s),i=Object.keys(t),a=0;a<i.length;a+=1){var l=i[a],c=t[l]||"";r.getAttribute(l)!==c&&r.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);var u=o.indexOf(l);u!==-1&&o.splice(u,1)}for(var f=o.length-1;f>=0;f-=1)r.removeAttribute(o[f]);s.length===o.length?r.removeAttribute("data-rh"):r.getAttribute("data-rh")!==i.join(",")&&r.setAttribute("data-rh",i.join(","))}},bg=function(e,t){var r=e.baseTag,n=e.htmlAttributes,s=e.linkTags,o=e.metaTags,i=e.noscriptTags,a=e.onChangeClientState,l=e.scriptTags,c=e.styleTags,u=e.title,f=e.titleAttributes;Tu(Y.BODY,e.bodyAttributes),Tu(Y.HTML,n),function(g,x){g!==void 0&&document.title!==g&&(document.title=V0(g)),Tu(Y.TITLE,x)}(u,f);var d={baseTag:Kn(Y.BASE,r),linkTags:Kn(Y.LINK,s),metaTags:Kn(Y.META,o),noscriptTags:Kn(Y.NOSCRIPT,i),scriptTags:Kn(Y.SCRIPT,l),styleTags:Kn(Y.STYLE,c)},m={},v={};Object.keys(d).forEach(function(g){var x=d[g],y=x.newTags,w=x.oldTags;y.length&&(m[g]=y),w.length&&(v[g]=d[g].oldTags)}),t&&t(),a(e,m,v)},po=null,Tl=function(e){function t(){for(var n,s=arguments.length,o=new Array(s),i=0;i<s;i++)o[i]=arguments[i];return(n=e.call.apply(e,[this].concat(o))||this).rendered=!1,n}Th(t,e);var r=t.prototype;return r.shouldComponentUpdate=function(n){return!aO(n,this.props)},r.componentDidUpdate=function(){this.emitChange()},r.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},r.emitChange=function(){var n,s,o=this.props.context,i=o.setHelmet,a=null,l=(n=o.helmetInstances.get().map(function(c){var u=Ee({},c.props);return delete u.context,u}),{baseTag:pO(["href"],n),bodyAttributes:Eu("bodyAttributes",n),defer:Ss(n,"defer"),encode:Ss(n,"encodeSpecialCharacters"),htmlAttributes:Eu("htmlAttributes",n),linkTags:ho(Y.LINK,["rel","href"],n),metaTags:ho(Y.META,["name","charset","http-equiv","property","itemprop"],n),noscriptTags:ho(Y.NOSCRIPT,["innerHTML"],n),onChangeClientState:hO(n),scriptTags:ho(Y.SCRIPT,["src","innerHTML"],n),styleTags:ho(Y.STYLE,["cssText"],n),title:fO(n),titleAttributes:Eu("titleAttributes",n),prioritizeSeoTags:mO(n,"prioritizeSeoTags")});ps.canUseDOM?(s=l,po&&cancelAnimationFrame(po),s.defer?po=requestAnimationFrame(function(){bg(s,function(){po=null})}):(bg(s),po=null)):rf&&(a=rf(l)),i(a)},r.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},r.render=function(){return this.init(),null},t}(h.Component);Tl.propTypes={context:vO.isRequired},Tl.displayName="HelmetDispatcher";var wO=["children"],bO=["children"],za=function(e){function t(){return e.apply(this,arguments)||this}Th(t,e);var r=t.prototype;
vendor: 1,108 bytes, line 211
211return r.shouldComponentUpdate=function(n){return!nO(vg(this.props,"helmetData"),vg(n,"helmetData"))},r.mapNestedChildrenToProps=function(n,s){if(!s)return null;switch(n.type){case Y.SCRIPT:case Y.NOSCRIPT:return{innerHTML:s};case Y.STYLE:return{cssText:s};default:throw new Error("<"+n.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},r.flattenArrayTypeChildren=function(n){var s,o=n.child,i=n.arrayTypeChildren;return Ee({},i,((s={})[o.type]=[].concat(i[o.type]||[],[Ee({},n.newChildProps,this.mapNestedChildrenToProps(o,n.nestedChildren))]),s))},r.mapObjectTypeChildren=function(n){var s,o,i=n.child,a=n.newProps,l=n.newChildProps,c=n.nestedChildren;switch(i.type){case Y.TITLE:return Ee({},a,((s={})[i.type]=c,s.titleAttributes=Ee({},l),s));case Y.BODY:return Ee({},a,{bodyAttributes:Ee({},l)});case Y.HTML:return Ee({},a,{htmlAttributes:Ee({},l)});default:return Ee({},a,((o={})[i.type]=Ee({},l),o))}},r.mapArrayTypeChildrenToProps=function(n,s){var o=Ee({},s);return Object.keys(n).forEach(function(i){var a;o=Ee({},o,((a={})[i]=n[i],a))}),o}
211,r.warnOnInvalidChildren=function(n,s){return pg(gg.some(function(o){return n.type===o}),typeof n.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+gg.join(", ")+" are allowed. Helmet does not support rendering <"+n.type+"> elements. Refer to our API for more information."),pg(!s||typeof s=="string"||Array.isArray(s)&&!s.some(function(o){return typeof o!="string"}),"Helmet expects a string as a child of <"+n.type+">. Did you forget to wrap your children in braces? ( <"+n.type+">{``}</"+n.type+"> ) Refer to our API for more information."),!0},r.mapChildrenToProps=function(n,s){var o=this,i={};return I.Children.forEach(n,function(a){if(a&&a.props){var l=a.props,c=l.children,u=mg(l,wO),f=Object.keys(u).reduce(function(m,v){return m[dO[v]||v]=u[v],m},{}),d=a.type;switch(typeof d=="symbol"?d=d.toString():o.warnOnInvalidChildren(a,c),d){case Y.FRAGMENT:s=o.mapChildrenToProps(c,s);break;case Y.LINK:case Y.META:case Y.NOSCRIPT:case Y.SCRIPT:case Y.STYLE:i=o.flattenArrayTypeChildren({child:a,arrayTypeChildren:i,newChildProps:f,nestedChildren:c});break;default:s=o.mapObjectTypeChildren({child:a,newProps:s,newChildProps:f,nestedChildren:c})}}}),this.mapArrayTypeChildrenToProps(i,s)},r.render=function(){var n=this.props,s=n.children,o=mg(n,bO),i=Ee({},o),a=o.helmetData;return s&&(i=this.mapChildrenToProps(s,i)),!a||a instanceof nf||(a=new nf(a.context,a.instances)),a?I.createElement(Tl,Ee({},i,{context:a.value,helmetData:void 0})):I.createElement(K0.Consumer,null,function(l){return I.createElement(Tl,Ee({},i,{context:l}))})},t}(h.Component);za.propTypes={base:ne.object,bodyAttributes:ne.object,children:ne.oneOfType([ne.arrayOf(ne.node),ne.node]),defaultTitle:ne.string,defer:ne.bool,encodeSpecialCharacters:ne.bool,htmlAttributes:ne.object,link:ne.arrayOf(ne.object),meta:ne.arrayOf(ne.object),noscript:ne.arrayOf(ne.object),onChangeClientState:ne.func,script:ne.arrayOf(ne.object),style:ne.arrayOf(ne.object),title:ne.string,titleAttributes:ne.object,titleTemplate:ne.string,prioritizeSeoTags:ne.bool,helmetData:ne.object},za.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},za.displayName="Helmet";function xO({title:e,description:t,canonicalPath:r,jsonLd:n}){const s=et(),o=typeof window<"u"?window.location.origin:"",i=r?`${o}${r}`:`${o}${s.pathname}${s.search}`;return p.jsxs(za,{children:[p.jsx("title",{children:e}),p.jsx("meta",{name:"description",content:t}),p.jsx("link",{rel:"canonical",href:i}),p.jsx("meta",{property:"og:type",content:"website"}),p.jsx("meta",{property:"og:title",content:e}),p.jsx("meta",{property:"og:description",content:t}),p.jsx("meta",{property:"og:url",content:i}),p.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),p.jsx("meta",{name:"twitter:title",content:e}),p.jsx("meta",{name:"twitter:description",content:t}),n&&p.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(n).replace(/</g,"\\u003c")}})]})}const _O=({size:e="md",className:t})=>{const r={sm:"w-8 h-8",md:"w-16 h-16",lg:"w-24 h-24",xl:"w-32 h-32"},n={sm:"w-6 h-6",md:"w-12 h-12",lg:"w-18 h-18",xl:"w-24 h-24"};return p.jsxs("div",{className:U("relative inline-flex items-center justify-center",r[e],t),children:[p.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-r from-primary via-primary-glow to-primary opacity-20 animate-spin-slow"}),p.jsx("div",{className:"absolute inset-1 rounded-full bg-gradient-to-tr from-primary/40 via-transparent to-primary-glow/40 animate-spin-reverse"}),p.jsxs("div",{className:U("relative rounded-full bg-gradient-radial from-transparent via-primary/30 to-black/80 backdrop-blur-sm border border-primary/20 animate-pulse-slow",n[e]),children:[p.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-radial from-primary/60 via-primary/20 to-transparent animate-ping"}),p.jsx("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-1 h-1 bg-primary rounded-full animate-pulse"})]}),p.jsx("div",{className:"absolute inset-0 rounded-full",children:[...Array(8)].map((s,o)=>p.jsx("div",{className:"absolute w-0.5 h-0.5 bg-primary/60 rounded-full animate-orbit",style:{animationDelay:`${o*.2}s`,top:"50%",left:"50%",transformOrigin:"0 0"}},o))})]})},Ba=({size:e="md",text:t,className:r,useVortex:n=!1})=>{const s={sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12"};return p.jsxs("div",{className:U("flex flex-col items-center justify-center gap-2 min-h-screen",r),children:[n?p.jsx(_O,{size:e}):p.jsx("div",{className:U("animate-spin rounded-full border-2 border-muted border-t-primary",s[e])}),t&&p.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:t})]})},SO=Ws("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium font-grotesk 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",glow:"bg-gradient-to-r from-primary to-accent text-primary-foreground shadow-[0_10px_30px_hsl(var(--primary)/0.35)] hover:from-primary/90 hover:to-accent/90 hover:shadow-[0_12px_40px_hsl(var(--primary)/0.45)]",hero:"bg-secondary/40 text-foreground border border-primary/20 hover:bg-secondary/50 backdrop-blur"},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"}}),ze=h.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?Pt:"button";return p.jsx(i,{className:U(SO({variant:t,size:r,className:e})),ref:o,...s})});ze.displayName="Button";var Rh="Avatar",[EO,F$]=Nn(Rh),[kO,q0]=EO(Rh),G0=h.forwardRef((e,t)=>
vendor: 20,768 bytes, line 211
211{const{__scopeAvatar:r,...n}=e,[s,o]=h.useState("idle");return p.jsx(kO,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:p.jsx(ee.span,{...n,ref:t})})});G0.displayName=Rh;var Y0="AvatarImage",J0=h.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:s=()=>{},...o}=e,i=q0(Y0,r),a=CO(n),l=Re(c=>{s(c),i.onImageLoadingStatusChange(c)});return Ye(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?p.jsx(ee.img,{...o,ref:t,src:n}):null});J0.displayName=Y0;var X0="AvatarFallback",Q0=h.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...s}=e,o=q0(X0,r),[i,a]=h.useState(n===void 0);return h.useEffect(()=>{if(n!==void 0){const l=window.setTimeout(()=>a(!0),n);return()=>window.clearTimeout(l)}},[n]),i&&o.imageLoadingStatus!=="loaded"?p.jsx(ee.span,{...s,ref:t}):null});Q0.displayName=X0;function CO(e){const[t,r]=h.useState("idle");return Ye(()=>{if(!e){r("error");return}let n=!0;const s=new window.Image,o=i=>()=>{n&&r(i)};return r("loading"),s.onload=o("loaded"),s.onerror=o("error"),s.src=e,()=>{n=!1}},[e]),t}var Z0=G0,eb=J0,tb=Q0;const hc=h.forwardRef(({className:e,...t},r)=>p.jsx(Z0,{ref:r,className:U("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-xl",e),...t}));hc.displayName=Z0.displayName;const pc=h.forwardRef(({className:e,...t},r)=>p.jsx(eb,{ref:r,className:U("aspect-square h-full w-full object-cover",e),...t}));pc.displayName=eb.displayName;const mc=h.forwardRef(({className:e,...t},r)=>p.jsx(tb,{ref:r,className:U("flex h-full w-full items-center justify-center rounded-xl bg-muted",e),...t}));mc.displayName=tb.displayName;var TO=h.createContext(void 0);function rb(e){const t=h.useContext(TO);return e||t||"ltr"}var RO="DismissableLayer",sf="dismissableLayer.update",PO="dismissableLayer.pointerDownOutside",AO="dismissableLayer.focusOutside",xg,nb=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sb=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=h.useContext(nb),[u,f]=h.useState(null),d=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),v=ae(t,E=>f(E)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(x),w=u?g.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,_=w>=y,S=jO(E=>{const T=E.target,N=[...c.branches].some(P=>P.contains(T));!_||N||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},d),k=IO(E=>{const T=E.target;[...c.branches].some(P=>P.contains(T))||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},d);return fh(E=>{w===c.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},d),h.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(xg=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),_g(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=xg)}},[u,d,r,c]),h.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),_g())},[u,c]),h.useEffect(()=>{const E=()=>m({});return document.addEventListener(sf,E),()=>document.removeEventListener(sf,E)},[]),p.jsx(ee.div,{...l,ref:v,style:{pointerEvents:b?_?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,k.onFocusCapture),onBlurCapture:W(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,S.onPointerDownCapture)})});sb.displayName=RO;var NO="DismissableLayerBranch",OO=h.forwardRef((e,t)=>{const r=h.useContext(nb),n=h.useRef(null),s=ae(t,n);return h.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),p.jsx(ee.div,{...e,ref:s})});OO.displayName=NO;function jO(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){ob(PO,r,c,{discrete:!0})};const c={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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function IO(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e),n=h.useRef(!1);return h.useEffect(()=>{const s=o=>{o.target&&!n.current&&ob(AO,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function _g(){const e=new CustomEvent(sf);document.dispatchEvent(e)}function ob(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?xi(s,o):s.dispatchEvent(o)}var Ru=0;function LO(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sg()),document.body.insertAdjacentElement("beforeend",e[1]??Sg()),Ru++,()=>{Ru===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ru--}},[])}function Sg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Pu="focusScope.autoFocusOnMount",Au="focusScope.autoFocusOnUnmount",Eg={bubbles:!1,cancelable:!0},DO="FocusScope",Ph=h.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=h.useState(null),c=Re(s),u=Re(o),f=h.useRef(null),d=ae(t,g=>l(g)),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let g=function(b){if(m.paused||!a)return;const _=b.target;a.contains(_)?f.current=_:jr(f.current,{select:!0})},x=function(b){if(m.paused||!a)return;const _=b.relatedTarget;_!==null&&(a.contains(_)||jr(f.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&jr(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),w.disconnect()}}},[n,a,m.paused]),h.useEffect(()=>{if(a){Cg.add(m);const g=document.activeElement;if(!a.contains(g)){const y=new CustomEvent(Pu,Eg);a.addEventListener(Pu,c),a.dispatchEvent(y),y.defaultPrevented||(MO(BO(ib(a)),{select:!0}),document.activeElement===g&&jr(a))}return()=>{a.removeEventListener(Pu,c),setTimeout(()=>{const y=new CustomEvent(Au,Eg);a.addEventListener(Au,u),a.dispatchEvent(y),y.defaultPrevented||jr(g??document.body,{select:!0}),a.removeEventListener(Au,u),Cg.remove(m)},0)}}},[a,c,u,m]);const v=h.useCallback(g=>{if(!r&&!n||m.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(x&&y){const w=g.currentTarget,[b,_]=$O(w);b&&_?!g.shiftKey&&y===_?(g.preventDefault(),r&&jr(b,{select:!0})):g.shiftKey&&y===b&&(g.preventDefault(),r&&jr(_,{select:!0})):y===w&&g.preventDefault()}},[r,n,m.paused]);return p.jsx(ee.div,{tabIndex:-1,...i,ref:d,onKeyDown:v})});Ph.displayName=DO;function MO(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(jr(n,{select:t}),document.activeElement!==r)return}function $O(e){const t=ib(e),r=kg(t,e),n=kg(t.reverse(),e);return[r,n]}function ib(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 kg(e,t){for(const r of e)if(!UO(r,{upTo:t}))return r}function UO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function FO(e){return e instanceof HTMLInputElement&&"select"in e}function jr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&FO(e)&&t&&e.select()}}var Cg=zO();function zO(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Tg(e,t),e.unshift(t)},remove(t){var r;e=Tg(e,t),(r=e[0])==null||r.resume()}}}function Tg(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function BO(e){return e.filter(t=>t.tagName!=="A")}var WO=kS.useId||(()=>{}),HO=0;function bn(e){const[t,r]=h.useState(WO());return Ye(()=>{e||r(n=>n??String(HO++))},[e]),e||(t?`radix-${t}`:"")}const VO=["top","right","bottom","left"],en=Math.min,dt=Math.max,Rl=Math.round,da=Math.floor,tn=e=>({x:e,y:e}),KO={left:"right",right:"left",bottom:"top",top:"bottom"},qO={start:"end",end:"start"};function of(e,t,r){return dt(e,en(t,r))}function Er(e,t){return typeof e=="function"?e(t):e}function kr(e){return e.split("-")[0]}function Gs(e){return e.split("-")[1]}function Ah(e){return e==="x"?"y":"x"}function Nh(e){return e==="y"?"height":"width"}function rn(e){return["top","bottom"].includes(kr(e))?"y":"x"}function Oh(e){return Ah(rn(e))}function GO(e,t,r){r===void 0&&(r=!1);const n=Gs(e),s=Oh(e),o=Nh(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Pl(i)),[i,Pl(i)]}function YO(e){const t=Pl(e);return[af(e),t,af(t)]}function af(e){return e.replace(/start|end/g,t=>qO[t])}function JO(e,t,r){const n=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?o:i;default:return[]}}function XO(e,t,r,n){const s=Gs(e);let o=JO(kr(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(af)))),o}function Pl(e){return e.replace(/left|right|bottom|top/g,t=>KO[t])}function QO(e){return{top:0,right:0,bottom:0,left:0,...e}}function ab(e){return typeof e!="number"?QO(e):{top:e,right:e,bottom:e,left:e}}function Al(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 Rg(e,t,r){let{reference:n,floating:s}=e;const o=rn(t),i=Oh(t),a=Nh(i),l=kr(t),c=o==="y",u=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,d=n[a]/2-s[a]/2;let m;switch(l){case"top":m={x:u,y:n.y-s.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-s.width,y:f};break;default:m={x:n.x,y:n.y}}switch(Gs(t)){case"start":m[i]-=d*(r&&c?-1:1);break;case"end":m[i]+=d*(r&&c?-1:1);break}return m}const ZO=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}=r,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=Rg(c,n,l),d=n,m={},v=0;for(let g=0;g<a.length;g++){const{name:x,fn:y}=a[g],{x:w,y:b,data:_,reset:S}=await y({x:u,y:f,initialPlacement:n,placement:d,strategy:s,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});u=w??u,f=b??f,m={...m,[x]:{...m[x],..._}},S&&v<=50&&(v++,typeof S=="object"&&(S.placement&&(d=S.placement),S.rects&&(c=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):S.rects),{x:u,y:f}=Rg(c,d,l)),g=-1)}return{x:u,y:f,placement:d,strategy:s,middlewareData:m}};async function fi(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=Er(t,e),v=ab(m),x=a[d?f==="floating"?"reference":"floating":f],y=Al(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(x)))==null||r?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=f==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},S=Al(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:l}):w);return{top:(y.top-S.top+v.top)/_.y,bottom:(S.bottom-y.bottom+v.bottom)/_.y,left:(y.left-S.left+v.left)/_.x,right:(S.right-y.right+v.right)/_.x}}const ej=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Er(e,t)||{};if(c==null)return{};const f=ab(u),d={x:r,y:n},m=Oh(s),v=Nh(m),g=await i.getDimensions(c),x=m==="y",y=x?"top":"left",w=x?"bottom":"right",b=x?"clientHeight":"clientWidth",_=o.reference[v]+o.reference[m]-d[m]-o.floating[v],S=d[m]-o.reference[m],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=k?k[b]:0;(!E||!await(i.isElement==null?void 0:i.isElement(k)))&&(E=a.floating[b]||o.floating[v]);const T=_/2-S/2,N=E/2-g[v]/2-1,P=en(f[y],N),O=en(f[w],N),F=P,K=E-g[v]-O,L=E/2-g[v]/2+T,V=of(F,L,K),H=!l.arrow&&Gs(s)!=null&&L!==V&&o.reference[v]/2-(L<F?P:O)-g[v]/2<0,X=H?L<F?L-F:L-K:0;return{[m]:d[m]+X,data:{[m]:V,centerOffset:L-V-X,...H&&{alignmentOffset:X}},reset:H}}}),tj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...x}=Er(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const y=kr(s),w=rn(a),b=kr(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=d||(b||!g?[Pl(a)]:YO(a)),k=v!=="none";!d&&k&&S.push(...XO(a,g,v,_));const E=[a,...S],T=await fi(t,x),N=[];let P=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&N.push(T[y]),f){const L=GO(s,i,_);N.push(T[L[0]],T[L[1]])}if(P=[...P,{placement:s,overflows:N}],!N.every(L=>L<=0)){var O,F;const L=(((O=o.flip)==null?void 0:O.index)||0)+1,V=E[L];if(V)return{data:{index:L,overflows:P},reset:{placement:V}};let H=(F=P.filter(X=>X.overflows[0]<=0).sort((X,C)=>X.overflows[1]-C.overflows[1])[0])==null?void 0:F.placement;if(!H)switch(m){case"bestFit":{var K;const X=(K=P.filter(C=>{if(k){const R=rn(C.placement);return R===w||R==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(R=>R>0).reduce((R,$)=>R+$,0)]).sort((C,R)=>C[1]-R[1])[0])==null?void 0:K[0];X&&(H=X);break}case"initialPlacement":H=a;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function Pg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ag(e){return VO.some(t=>e[t]>=0)}const rj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Er(e,t);switch(n){case"referenceHidden":{const o=await fi(t,{...s,elementContext:"reference"}),i=Pg(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ag(i)}}}case"escaped":{const o=await fi(t,{...s,altBoundary:!0}),i=Pg(o,r.floating);return{data:{escapedOffsets:i,escaped:Ag(i)}}}default:return{}}}}};async function nj(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=kr(r),a=Gs(r),l=rn(r)==="y",c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,f=Er(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),l?{x:m*u,y:d*c}:{x:d*c,y:m*u}}const sj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await nj(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},oj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:x=>{let{x:y,y:w}=x;return{x:y,y:w}}},...l}=Er(e,t),c={x:r,y:n},u=await fi(t,l),f=rn(kr(s)),d=Ah(f);let m=c[d],v=c[f];if(o){const x=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=m+u[x],b=m-u[y];m=of(w,m,b)}if(i){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=v+u[x],b=v-u[y];v=of(w,v,b)}const g=a.fn({...t,[d]:m,[f]:v});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[d]:o,[f]:i}}}}}},ij=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Er(e,t),u={x:r,y:n},f=rn(s),d=Ah(f);let m=u[d],v=u[f];const g=Er(a,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=d==="y"?"height":"width",_=o.reference[d]-o.floating[b]+x.mainAxis,S=o.reference[d]+o.reference[b]-x.mainAxis;m<_?m=_:m>S&&(m=S)}if(c){var y,w;const b=d==="y"?"width":"height",_=["top","left"].includes(kr(s)),S=o.reference[f]-o.floating[b]+(_&&((y=i.offset)==null?void 0:y[f])||0)+(_?0:x.crossAxis),k=o.reference[f]+o.reference[b]+(_?0:((w=i.offset)==null?void 0:w[f])||0)-(_?x.crossAxis:0);v<S?v=S:v>k&&(v=k)}return{[d]:m,[f]:v}}}},aj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Er(e,t),u=await fi(t,c),f=kr(s),d=Gs(s),m=rn(s)==="y",{width:v,height:g}=o.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=d===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,x=d==="end"?"top":"bottom");const w=g-u.top-u.bottom,b=v-u.left-u.right,_=en(g-u[x],w),S=en(v-u[y],b),k=!t.middlewareData.shift;let E=_,T=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(T=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(E=w),k&&!d){const P=dt(u.left,0),O=dt(u.right,0),F=dt(u.top,0),K=dt(u.bottom,0);m?T=v-2*(P!==0||O!==0?P+O:dt(u.left,u.right)):E=g-2*(F!==0||K!==0?F+K:dt(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:E});const N=await i.getDimensions(a.floating);return v!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function gc(){return typeof window<"u"}function Ys(e){return lb(e)?(e.nodeName||"").toLowerCase():"#document"}function mt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ar(e){var t;return(t=(lb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lb(e){return gc()?e instanceof Node||e instanceof mt(e).Node:!1}function Vt(e){return gc()?e instanceof Element||e instanceof mt(e).Element:!1}function or(e){return gc()?e instanceof HTMLElement||e instanceof mt(e).HTMLElement:!1}function Ng(e){return!gc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mt(e).ShadowRoot}function Ci(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Kt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function lj(e){return["table","td","th"].includes(Ys(e))}function vc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function jh(e){const t=Ih(),r=Vt(e)?Kt(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function cj(e){let t=nn(e);for(;or(t)&&!js(t);){if(jh(t))return t;if(vc(t))return null;t=nn(t)}return null}function Ih(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function js(e){return["html","body","#document"].includes(Ys(e))}function Kt(e){return mt(e).getComputedStyle(e)}function yc(e){return Vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nn(e){if(Ys(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ng(e)&&e.host||ar(e);return Ng(t)?t.host:t}function cb(e){const t=nn(e);return js(t)?e.ownerDocument?e.ownerDocument.body:e.body:or(t)&&Ci(t)?t:cb(t)}function hi(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=cb(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=mt(s);if(o){const a=lf(i);
vendor: 4,742 bytes, line 211
211return t.concat(i,i.visualViewport||[],Ci(s)?s:[],a&&r?hi(a):[])}return t.concat(s,hi(s,[],r))}function lf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ub(e){const t=Kt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=or(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=Rl(r)!==o||Rl(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function Lh(e){return Vt(e)?e:e.contextElement}function Es(e){const t=Lh(e);if(!or(t))return tn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=ub(t);let i=(o?Rl(r.width):r.width)/n,a=(o?Rl(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const uj=tn(0);function db(e){const t=mt(e);return!Ih()||!t.visualViewport?uj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dj(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==mt(e)?!1:t}function Tn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Lh(e);let i=tn(1);t&&(n?Vt(n)&&(i=Es(n)):i=Es(e));const a=dj(o,r,n)?db(o):tn(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,u=s.width/i.x,f=s.height/i.y;if(o){const d=mt(o),m=n&&Vt(n)?mt(n):n;let v=d,g=lf(v);for(;g&&n&&m!==v;){const x=Es(g),y=g.getBoundingClientRect(),w=Kt(g),b=y.left+(g.clientLeft+parseFloat(w.paddingLeft))*x.x,_=y.top+(g.clientTop+parseFloat(w.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=b,c+=_,v=mt(g),g=lf(v)}}return Al({width:u,height:f,x:l,y:c})}function fj(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=ar(n),a=t?vc(t.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=tn(1);const u=tn(0),f=or(n);if((f||!f&&!o)&&((Ys(n)!=="body"||Ci(i))&&(l=yc(n)),or(n))){const d=Tn(n);c=Es(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x,y:r.y*c.y-l.scrollTop*c.y+u.y}}function hj(e){return Array.from(e.getClientRects())}function cf(e,t){const r=yc(e).scrollLeft;return t?t.left+r:Tn(ar(e)).left+r}function pj(e){const t=ar(e),r=yc(e),n=e.ownerDocument.body,s=dt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=dt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+cf(e);const a=-r.scrollTop;return Kt(n).direction==="rtl"&&(i+=dt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function mj(e,t){const r=mt(e),n=ar(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const c=Ih();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function gj(e,t){const r=Tn(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=or(e)?Es(e):tn(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:i,height:a,x:l,y:c}}function Og(e,t,r){let n;if(t==="viewport")n=mj(e,r);else if(t==="document")n=pj(ar(e));else if(Vt(t))n=gj(t,r);else{const s=db(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Al(n)}function fb(e,t){const r=nn(e);return r===t||!Vt(r)||js(r)?!1:Kt(r).position==="fixed"||fb(r,t)}function vj(e,t){const r=t.get(e);if(r)return r;let n=hi(e,[],!1).filter(a=>Vt(a)&&Ys(a)!=="body"),s=null;const o=Kt(e).position==="fixed";let i=o?nn(e):e;for(;Vt(i)&&!js(i);){const a=Kt(i),l=jh(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Ci(i)&&!l&&fb(e,i))?n=n.filter(u=>u!==i):s=a,i=nn(i)}return t.set(e,n),n}function yj(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?vc(t)?[]:vj(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((c,u)=>{const f=Og(t,u,s);return c.top=dt(f.top,c.top),c.right=en(f.right,c.right),c.bottom=en(f.bottom,c.bottom),c.left=dt(f.left,c.left),c},Og(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function wj(e){const{width:t,height:r}=ub(e);return{width:t,height:r}}function bj(e,t,r){const n=or(t),s=ar(t),o=r==="fixed",i=Tn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=tn(0);if(n||!n&&!o)if((Ys(t)!=="body"||Ci(s))&&(a=yc(t)),n){const m=Tn(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else s&&(l.x=cf(s));let c=0,u=0;if(s&&!n&&!o){const m=s.getBoundingClientRect();u=m.top+a.scrollTop,c=m.left+a.scrollLeft-cf(s,m)}const f=i.left+a.scrollLeft-l.x-c,d=i.top+a.scrollTop-l.y-u;return{x:f,y:d,width:i.width,height:i.height}}function Nu(e){return Kt(e).position==="static"}function jg(e,t){if(!or(e)||Kt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ar(e)===r&&(r=r.ownerDocument.body),r}function hb(e,t){const r=mt(e);if(vc(e))return r;if(!or(e)){let s=nn(e);for(;s&&!js(s);){if(Vt(s)&&!Nu(s))return s;s=nn(s)}return r}let n=jg(e,t);for(;n&&lj(n)&&Nu(n);)n=jg(n,t);
vendor: 8,902 bytes, line 211
211return n&&js(n)&&Nu(n)&&!jh(n)?r:n||cj(e)||r}const xj=async function(e){const t=this.getOffsetParent||hb,r=this.getDimensions,n=await r(e.floating);return{reference:bj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function _j(e){return Kt(e).direction==="rtl"}const Sj={convertOffsetParentRelativeRectToViewportRelativeRect:fj,getDocumentElement:ar,getClippingRect:yj,getOffsetParent:hb,getElementRects:xj,getClientRects:hj,getDimensions:wj,getScale:Es,isElement:Vt,isRTL:_j};function Ej(e,t){let r=null,n;const s=ar(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(a||t(),!f||!d)return;const m=da(u),v=da(s.clientWidth-(c+f)),g=da(s.clientHeight-(u+d)),x=da(c),w={rootMargin:-m+"px "+-v+"px "+-g+"px "+-x+"px",threshold:dt(0,en(1,l))||1};let b=!0;function _(S){const k=S[0].intersectionRatio;if(k!==l){if(!b)return i();k?i(!1,k):n=setTimeout(()=>{i(!1,1e-7)},1e3)}b=!1}try{r=new IntersectionObserver(_,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(_,w)}r.observe(e)}return i(!0),o}function kj(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Lh(e),u=s||o?[...c?hi(c):[],...hi(t)]:[];u.forEach(y=>{s&&y.addEventListener("scroll",r,{passive:!0}),o&&y.addEventListener("resize",r)});const f=c&&a?Ej(c,r):null;let d=-1,m=null;i&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),r()}),c&&!l&&m.observe(c),m.observe(t));let v,g=l?Tn(e):null;l&&x();function x(){const y=Tn(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&r(),g=y,v=requestAnimationFrame(x)}return r(),()=>{var y;u.forEach(w=>{s&&w.removeEventListener("scroll",r),o&&w.removeEventListener("resize",r)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const Cj=sj,Tj=oj,Rj=tj,Pj=aj,Aj=rj,Ig=ej,Nj=ij,Oj=(e,t,r)=>{const n=new Map,s={platform:Sj,...r},o={...s.platform,_c:n};return ZO(e,t,{...s,platform:o})};var Wa=typeof document<"u"?h.useLayoutEffect:h.useEffect;function Nl(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(!Nl(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 o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!Nl(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function pb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lg(e,t){const r=pb(e);return Math.round(t*r)/r}function Ou(e){const t=h.useRef(e);return Wa(()=>{t.current=e}),t}function jj(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=h.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=h.useState(n);Nl(d,n)||m(n);const[v,g]=h.useState(null),[x,y]=h.useState(null),w=h.useCallback(C=>{C!==k.current&&(k.current=C,g(C))},[]),b=h.useCallback(C=>{C!==E.current&&(E.current=C,y(C))},[]),_=o||v,S=i||x,k=h.useRef(null),E=h.useRef(null),T=h.useRef(u),N=l!=null,P=Ou(l),O=Ou(s),F=Ou(c),K=h.useCallback(()=>{if(!k.current||!E.current)return;const C={placement:t,strategy:r,middleware:d};O.current&&(C.platform=O.current),Oj(k.current,E.current,C).then(R=>{const $={...R,isPositioned:F.current!==!1};L.current&&!Nl(T.current,$)&&(T.current=$,Fs.flushSync(()=>{f($)}))})},[d,t,r,O,F]);Wa(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[c]);const L=h.useRef(!1);Wa(()=>(L.current=!0,()=>{L.current=!1}),[]),Wa(()=>{if(_&&(k.current=_),S&&(E.current=S),_&&S){if(P.current)return P.current(_,S,K);K()}},[_,S,K,P,N]);const V=h.useMemo(()=>({reference:k,floating:E,setReference:w,setFloating:b}),[w,b]),H=h.useMemo(()=>({reference:_,floating:S}),[_,S]),X=h.useMemo(()=>{const C={position:r,left:0,top:0};if(!H.floating)return C;const R=Lg(H.floating,u.x),$=Lg(H.floating,u.y);return a?{...C,transform:"translate("+R+"px, "+$+"px)",...pb(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:R,top:$}},[r,a,H.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:K,refs:V,elements:H,floatingStyles:X}),[u,K,V,H,X])}const Ij=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?Ig({element:n.current,padding:s}).fn(r):{}:n?Ig({element:n,padding:s}).fn(r):{}}}},Lj=(e,t)=>({...Cj(e),options:[e,t]}),Dj=(e,t)=>({...Tj(e),options:[e,t]}),Mj=(e,t)=>({...Nj(e),options:[e,t]}),$j=(e,t)=>({...Rj(e),options:[e,t]}),Uj=(e,t)=>({...Pj(e),options:[e,t]}),Fj=(e,t)=>({...Aj(e),options:[e,t]}),zj=(e,t)=>({...Ij(e),options:[e,t]});var Bj="Arrow",mb=h.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return p.jsx(ee.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});mb.displayName=Bj;var Wj=mb;function Hj(e){const[t,r]=h.useState(void 0);return Ye(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Dh="Popper",[gb,wc]=Nn(Dh),[Vj,vb]=gb(Dh),yb=e=>{const{__scopePopper:t,children:r}=e,[n,s]=h.useState(null);return p.jsx(Vj,{scope:t,anchor:n,onAnchorChange:s,children:r})};yb.displayName=Dh;var wb="PopperAnchor",bb=h.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=vb(wb,r),i=h.useRef(null),a=ae(t,i);return h.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:p.jsx(ee.div,{...s,ref:a})});bb.displayName=wb;var Mh="PopperContent",[Kj,qj]=gb(Mh),xb=h.forwardRef((e,t)=>{var Ne,Nt,Oe,Ot,Ni,Dn;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:d=!1,updatePositionStrategy:m="optimized",onPlaced:v,...g}=e,x=vb(Mh,r),[y,w]=h.useState(null),b=ae(t,ln=>w(ln)),[_,S]=h.useState(null),k=Hj(_),E=(k==null?void 0:k.width)??0,T=(k==null?void 0:k.height)??0,N=n+(o!=="center"?"-"+o:""),P=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(c)?c:[c],F=O.length>0,K={padding:P,boundary:O.filter(Yj),altBoundary:F},{refs:L,floatingStyles:V,placement:H,isPositioned:X,middlewareData:C}=jj({strategy:"fixed",placement:N,whileElementsMounted:(...ln)=>kj(...ln,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[Lj({mainAxis:s+T,alignmentAxis:i}),l&&Dj({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Mj():void 0,...K}),l&&$j({...K}),Uj({...K,apply:({elements:ln,rects:Zs,availableWidth:Oi,availableHeight:Tr})=>{const{width:Ic,height:Lc}=Zs.reference,De=ln.floating.style;De.setProperty("--radix-popper-available-width",`${Oi}px`),De.setProperty("--radix-popper-available-height",`${Tr}px`),De.setProperty("--radix-popper-anchor-width",`${Ic}px`),De.setProperty("--radix-popper-anchor-height",`${Lc}px`)}}),_&&zj({element:_,padding:a}),Jj({arrowWidth:E,arrowHeight:T}),d&&Fj({strategy:"referenceHidden",...K})]}),[R,$]=Eb(H),D=Re(v);Ye(()=>{X&&(D==null||D())},[X,D]);const A=(Ne=C.arrow)==null?void 0:Ne.x,J=(Nt=C.arrow)==null?void 0:Nt.y,ie=((Oe=C.arrow)==null?void 0:Oe.centerOffset)!==0,[Be,re]=h.useState();return Ye(()=>{y&&re(window.getComputedStyle(y).zIndex)},[y]),p.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:X?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Be,"--radix-popper-transform-origin":[(Ot=C.transformOrigin)==null?void 0:Ot.x,(Ni=C.transformOrigin)==null?void 0:Ni.y].join(" "),...((Dn=C.hide)==null?void 0:Dn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Kj,{scope:r,placedSide:R,onArrowChange:S,arrowX:A,arrowY:J,shouldHideArrow:ie,children:p.jsx(ee.div,{"data-side":R,"data-align":$,...g,ref:b,style:{...g.style,animation:X?void 0:"none"}})})})});xb.displayName=Mh;var _b="PopperArrow",Gj={top:"bottom",right:"left",bottom:"top",left:"r
211ight"},Sb=h.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=qj(_b,n),i=Gj[o.placedSide];return p.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:p.jsx(Wj,{...s,ref:r,style:{...s.style,display:"block"}})})});Sb.displayName=_b;function Yj(e){return e!==null}var Jj=e=>({name:"transformOrigin",options:e,fn(t){var x,y,w;const{placement:r,rects:n,middlewareData:s}=t,i=((x=s.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=Eb(r),f={start:"0%",center:"50%",end:"100%"}[u],d=(((y=s.arrow)==null?void 0:y.x)??0)+a/2,m=(((w=s.arrow)==null?void 0:w.y)??0)+l/2;let v="",g="";return c==="bottom"?(v=i?f:`${d}px`,g=`${-l}px`):c==="top"?(v=i?f:`${d}px`,g=`${n.floating.height+l}px`):c==="right"?(v=`${-l}px`,g=i?f:`${m}px`):c==="left"&&(v=`${n.floating.width+l}px`,g=i?f:`${m}px`),{data:{x:v,y:g}}}});function Eb(e){const[t,r="center"]=e.split("-");return[t,r]}var kb=yb,Cb=bb,Tb=xb,Rb=Sb,Xj="Portal",Pb=h.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=h.useState(!1);Ye(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?ec.createPortal(p.jsx(ee.div,{...n,ref:t}),i):null});Pb.displayName=Xj;var ju="rovingFocusGroup.onEntryFocus",Qj={bubbles:!1,cancelable:!0},bc="RovingFocusGroup",[uf,Ab,Zj]=dh(bc),[eI,Nb]=Nn(bc,[Zj]),[tI,rI]=eI(bc),Ob=h.forwardRef((e,t)=>p.jsx(uf.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(uf.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(nI,{...e,ref:t})})}));Ob.displayName=bc;var nI=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,d=h.useRef(null),m=ae(t,d),v=rb(o),[g=null,x]=_i({prop:i,defaultProp:a,onChange:l}),[y,w]=h.useState(!1),b=Re(c),_=Ab(r),S=h.useRef(!1),[k,E]=h.useState(0);return h.useEffect(()=>{const T=d.current;if(T)return T.addEventListener(ju,b),()=>T.removeEventListener(ju,b)},[b]),p.jsx(tI,{scope:r,orientation:n,dir:v,loop:s,currentTabStopId:g,onItemFocus:h.useCallback(T=>x(T),[x]),onItemShiftTab:h.useCallback(()=>w(!0),[]),onFocusableItemAdd:h.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:h.useCallback(()=>E(T=>T-1),[]),children:p.jsx(ee.div,{tabIndex:y||k===0?-1:0,"data-orientation":n,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:W(e.onMouseDown,()=>{S.current=!0}),onFocus:W(e.onFocus,T=>{const N=!S.current;if(T.target===T.currentTarget&&N&&!y){const P=new CustomEvent(ju,Qj);if(T.currentTarget.dispatchEvent(P),!P.defaultPrevented){const O=_().filter(H=>H.focusable),F=O.find(H=>H.active),K=O.find(H=>H.id===g),V=[F,K,...O].filter(Boolean).map(H=>H.ref.current);Lb(V,u)}}S.current=!1}),onBlur:W(e.onBlur,()=>w(!1))})})}),jb="RovingFocusGroupItem",Ib=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,...i}=e,a=bn(),l=o||a,c=rI(jb,r),u=c.currentTabStopId===l,f=Ab(r),{onFocusableItemAdd:d,onFocusableItemRemove:m}=c;return h.useEffect(()=>{if(n)return d(),()=>m()},[n,d,m]),p.jsx(uf.ItemSlot,{scope:r,id:l,focusable:n,active:s,children:p.jsx(ee.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:W(e.onMouseDown,v=>{n?c.onItemFocus(l):v.preventDefault()}),onFocus:W(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:W(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const g=iI(v,c.orientation,c.dir);if(g!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=f().filter(w=>w.focusable).map(w=>w.ref.current);if(g==="last")y.reverse();else if(g==="prev"||g==="next"){g==="prev"&&y.reverse();const w=y.indexOf(v.currentTarget);y=c.loop?aI(y,w+1):y.slice(w+1)}setTimeout(()=>Lb(y))}})})})});Ib.displayName=jb;var sI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}
vendor: 9,564 bytes, lines 211-248
211function iI(e,t,r){const n=oI(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return sI[n]}function Lb(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function aI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var lI=Ob,cI=Ib,uI=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qn=new WeakMap,fa=new WeakMap,ha={},Iu=0,Db=function(e){return e&&(e.host||Db(e.parentNode))},dI=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Db(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},fI=function(e,t,r,n){var s=dI(t,Array.isArray(e)?e:[e]);ha[r]||(ha[r]=new WeakMap);var o=ha[r],i=[],a=new Set,l=new Set(s),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};s.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else try{var m=d.getAttribute(n),v=m!==null&&m!=="false",g=(qn.get(d)||0)+1,x=(o.get(d)||0)+1;qn.set(d,g),o.set(d,x),i.push(d),g===1&&v&&fa.set(d,!0),x===1&&d.setAttribute(r,"true"),v||d.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",d,y)}})};return u(t),a.clear(),Iu++,function(){i.forEach(function(f){var d=qn.get(f)-1,m=o.get(f)-1;qn.set(f,d),o.set(f,m),d||(fa.has(f)||f.removeAttribute(n),fa.delete(f)),m||f.removeAttribute(r)}),Iu--,Iu||(qn=new WeakMap,qn=new WeakMap,fa=new WeakMap,ha={})}},Mb=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=uI(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),fI(n,s,r,"aria-hidden")):function(){return null}},Fr=function(){return Fr=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Fr.apply(this,arguments)};function hI(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function pI(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var $o="right-scroll-bar-position",Uo="width-before-scroll-bar",mI="with-scroll-bars-hidden",gI="--removed-body-scroll-bar-size";function Lu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vI(e,t){var r=h.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var yI=typeof window<"u"?h.useLayoutEffect:h.useEffect,Dg=new WeakMap;function $b(e,t){var r=vI(null,function(n){return e.forEach(function(s){return Lu(s,n)})});return yI(function(){var n=Dg.get(r);if(n){var s=new Set(n),o=new Set(e),i=r.current;s.forEach(function(a){o.has(a)||Lu(a,null)}),o.forEach(function(a){s.has(a)||Lu(a,i)})}Dg.set(r,e)},[e]),r}var Ol=function(){return Ol=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Ol.apply(this,arguments)};function wI(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function bI(e){return e}function xI(e,t){t===void 0&&(t=bI);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var i=t(o,n);return r.push(i),function(){r=r.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(n=!0;r.length;){var i=r;r=[],i.forEach(o)}r={push:function(a){return o(a)},filter:function(){return r}}},assignMedium:function(o){n=!0;var i=[];if(r.length){var a=r;r=[],a.forEach(o),i=r}var l=function(){var u=i;i=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),r}}}};return s}function Ub(e){e===void 0&&(e={});var t=xI(null);return t.options=Ol({async:!0,ssr:!1},e),t}var Fb=function(e){var t=e.sideCar,r=wI(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,Ol({},r))};Fb.isSideCarExport=!0;function zb(e,t){return e.useMedium(t),Fb}var Bb=Ub(),Du=function(){},xc=h.forwardRef(function(e,t){var r=h.useRef(null),n=h.useState({onScrollCapture:Du,onWheelCapture:Du,onTouchMoveCapture:Du}),s=n[0],o=n[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,d=e.sideCar,m=e.noIsolation,v=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,b=hI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=d,S=$b([r,t]),k=Fr(Fr({},b),s);return h.createElement(h.Fragment,null,u&&h.createElement(_,{sideCar:Bb,removeScrollBar:c,shards:f,noIsolation:m,inert:v,setCallbacks:o,allowPinchZoom:!!g,lockRef:r,gapMode:w}),i?h.cloneElement(h.Children.only(a),Fr(Fr({},k),{ref:S})):h.createElement(y,Fr({},k,{className:l,ref:S}),a))});xc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xc.classNames={fullWidth:Uo,zeroRight:$o};var _I=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function SI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_I();return t&&e.setAttribute("nonce",t),e}function EI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var CI=function(){var e=0,t=null;return{add:function(r){e==0&&(t=SI())&&(EI(t,r),kI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TI=function(){var e=CI();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},$h=function(){var e=TI(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},RI={left:0,top:0,right:0,gap:0},Mu=function(e){return parseInt(e||"",10)||0},PI=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Mu(r),Mu(n),Mu(s)]},AI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RI;var t=PI(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},NI=$h(),ks="data-scroll-locked",OI=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),` 212 .`.concat(mI,` { 213 overflow: hidden `).concat(n,`; 214 padding-right: `).concat(a,"px ").concat(n,`; 215 } 216 body[`).concat(ks,`] { 217 overflow: hidden `).concat(n,`; 218 overscroll-behavior: contain; 219 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 220 padding-left: `.concat(s,`px; 221 padding-top: `).concat(o,`px; 222 padding-right: `).concat(i,`px; 223 margin-left:0; 224 margin-top:0; 225 margin-right: `).concat(a,"px ").concat(n,`; 226 `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` 227 } 228 229 .`).concat($o,` { 230 right: `).concat(a,"px ").concat(n,`; 231 } 232 233 .`).concat(Uo,` { 234 margin-right: `).concat(a,"px ").concat(n,`; 235 } 236 237 .`).concat($o," .").concat($o,` { 238 right: 0 `).concat(n,`; 239 } 240 241 .`).concat(Uo," .").concat(Uo,` { 242 margin-right: 0 `).concat(n,`; 243 } 244 245 body[`).concat(ks,`] { 246 `).concat(gI,": ").concat(a,`px; 247 } 248`)},Mg=function(){var e=parseInt(document.body.getAttribute(ks)||"0",10);return isFinite(e)?e:0},jI=function(){h.useEffect(function(){return document.body.setAttribute(ks,(Mg()+1).toString()),function(){var e=Mg()-1;e<=0?document.body.removeAttribute(ks):document.body.setAttribute(ks,e.toString())}},[])},Wb=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;jI();var o=h.useMemo(function(){return AI(s)},[s]);return h.createElement(NI,{styles:OI(o,!t,s,r?"":"!important")})},df=!1;if(typeof window<"u")try{var pa=Object.defineProperty({},"passive",{get:function(){return df=!0,!0}});window.addEventListener("test",pa,pa),window.removeEventListener("test",pa,pa)}catch{df=!1}var Gn=df?{passive:!1}:!1,II=function(e){return e.tagName==="TEXTAREA"},Hb=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!II(e)&&r[t]==="visible")},LI=function(e){return Hb(e,"overflowY")},DI=function(e){return Hb(e,"overflowX")},$g=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Vb(e,n);if(s){var o=Kb(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1}
vendor: 17,959 bytes, lines 248-251
248,MI=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},$I=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Vb=function(e,t){return e==="v"?LI(t):DI(t)},Kb=function(e,t){return e==="v"?MI(t):$I(t)},UI=function(e,t){return e==="h"&&t==="rtl"?-1:1},FI=function(e,t,r,n,s){var o=UI(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,u=i>0,f=0,d=0;do{var m=Kb(e,a),v=m[0],g=m[1],x=m[2],y=g-x-o*v;(v||y)&&Vb(e,a)&&(f+=y,d+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(Math.abs(f)<1||!s)||!u&&(Math.abs(d)<1||!s))&&(c=!0),c},ma=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ug=function(e){return[e.deltaX,e.deltaY]},Fg=function(e){return e&&"current"in e?e.current:e},zI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},BI=function(e){return` 249 .block-interactivity-`.concat(e,` {pointer-events: none;} 250 .allow-interactivity-`).concat(e,` {pointer-events: all;} 251`)},WI=0,Yn=[];function HI(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),s=h.useState(WI++)[0],o=h.useState($h)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=pI([e.lockRef.current],(e.shards||[]).map(Fg),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,x){if("touches"in g&&g.touches.length===2)return!i.current.allowPinchZoom;var y=ma(g),w=r.current,b="deltaX"in g?g.deltaX:w[0]-y[0],_="deltaY"in g?g.deltaY:w[1]-y[1],S,k=g.target,E=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in g&&E==="h"&&k.type==="range")return!1;var T=$g(E,k);if(!T)return!0;if(T?S=E:(S=E==="v"?"h":"v",T=$g(E,k)),!T)return!1;if(!n.current&&"changedTouches"in g&&(b||_)&&(n.current=S),!S)return!0;var N=n.current||S;return FI(N,x,g,N==="h"?b:_,!0)},[]),l=h.useCallback(function(g){var x=g;if(!(!Yn.length||Yn[Yn.length-1]!==o)){var y="deltaY"in x?Ug(x):ma(x),w=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&zI(S.delta,y)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(Fg).filter(Boolean).filter(function(S){return S.contains(x.target)}),_=b.length>0?a(x,b[0]):!i.current.noIsolation;_&&x.cancelable&&x.preventDefault()}}},[]),c=h.useCallback(function(g,x,y,w){var b={name:g,delta:x,target:y,should:w,shadowParent:VI(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(_){return _!==b})},1)},[]),u=h.useCallback(function(g){r.current=ma(g),n.current=void 0},[]),f=h.useCallback(function(g){c(g.type,Ug(g),g.target,a(g,e.lockRef.current))},[]),d=h.useCallback(function(g){c(g.type,ma(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Yn.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Gn),document.addEventListener("touchmove",l,Gn),document.addEventListener("touchstart",u,Gn),function(){Yn=Yn.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,Gn),document.removeEventListener("touchmove",l,Gn),document.removeEventListener("touchstart",u,Gn)}},[]);var m=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(o,{styles:BI(s)}):null,m?h.createElement(Wb,{gapMode:e.gapMode}):null)}function VI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const KI=zb(Bb,HI);var qb=h.forwardRef(function(e,t){return h.createElement(xc,Fr({},e,{ref:t,sideCar:KI}))});qb.classNames=xc.classNames;var ff=["Enter"," "],qI=["ArrowDown","PageUp","Home"],Gb=["ArrowUp","PageDown","End"],GI=[...qI,...Gb],YI={ltr:[...ff,"ArrowRight"],rtl:[...ff,"ArrowLeft"]},JI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ti="Menu",[pi,XI,QI]=dh(Ti),[In,Yb]=Nn(Ti,[QI,wc,Nb]),_c=wc(),Jb=Nb(),[ZI,Ln]=In(Ti),[e2,Ri]=In(Ti),Xb=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:i=!0}=e,a=_c(t),[l,c]=h.useState(null),u=h.useRef(!1),f=Re(o),d=rb(s);return h.useEffect(()=>{const m=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),p.jsx(kb,{...a,children:p.jsx(ZI,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:c,children:p.jsx(e2,{scope:t,onClose:h.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:d,modal:i,children:n})})})};Xb.displayName=Ti;var t2="MenuAnchor",Uh=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=_c(r);return p.jsx(Cb,{...s,...n,ref:t})});Uh.displayName=t2;var Fh="MenuPortal",[r2,Qb]=In(Fh,{forceMount:void 0}),Zb=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=Ln(Fh,t);return p.jsx(r2,{scope:t,forceMount:r,children:p.jsx(Bs,{present:r||o.open,children:p.jsx(Pb,{asChild:!0,container:s,children:n})})})};Zb.displayName=Fh;var Ct="MenuContent",[n2,zh]=In(Ct),ex=h.forwardRef((e,t)=>{const r=Qb(Ct,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Ln(Ct,e.__scopeMenu),i=Ri(Ct,e.__scopeMenu);return p.jsx(pi.Provider,{scope:e.__scopeMenu,children:p.jsx(Bs,{present:n||o.open,children:p.jsx(pi.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(s2,{...s,ref:t}):p.jsx(o2,{...s,ref:t})})})})}),s2=h.forwardRef((e,t)=>{const r=Ln(Ct,e.__scopeMenu),n=h.useRef(null),s=ae(t,n);return h.useEffect(()=>{const o=n.current;if(o)return Mb(o)},[]),p.jsx(Bh,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:W(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),o2=h.forwardRef((e,t)=>{const r=Ln(Ct,e.__scopeMenu);return p.jsx(Bh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Bh=h.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:m,disableOutsideScroll:v,...g}=e,x=Ln(Ct,r),y=Ri(Ct,r),w=_c(r),b=Jb(r),_=XI(r),[S,k]=h.useState(null),E=h.useRef(null),T=ae(t,E,x.onContentChange),N=h.useRef(0),P=h.useRef(""),O=h.useRef(0),F=h.useRef(null),K=h.useRef("right"),L=h.useRef(0),V=v?qb:h.Fragment,H=v?{as:Pt,allowPinchZoom:!0}:void 0,X=R=>{var Ne,Nt;const $=P.current+R,D=_().filter(Oe=>!Oe.disabled),A=document.activeElement,J=(Ne=D.find(Oe=>Oe.ref.current===A))==null?void 0:Ne.textValue,ie=D.map(Oe=>Oe.textValue),Be=v2(ie,$,J),re=(Nt=D.find(Oe=>Oe.textValue===Be))==null?void 0:Nt.ref.current;(function Oe(Ot){P.current=Ot,window.clearTimeout(N.current),Ot!==""&&(N.current=window.setTimeout(()=>Oe(""),1e3))})($),re&&setTimeout(()=>re.focus())};h.useEffect(()=>()=>window.clearTimeout(N.current),[]),LO();const C=h.useCallback(R=>{var D,A;return K.current===((D=F.current)==null?void 0:D.side)&&w2(R,(A=F.current)==null?void 0:A.area)},[]);return p.jsx(n2,{scope:r,searchRef:P,onItemEnter:h.useCallback(R=>{C(R)&&R.preventDefault()},[C]),onItemLeave:h.useCallback(R=>{var $;C(R)||(($=E.current)==null||$.focus(),k(null))},[C]),onTriggerLeave:h.useCallback(R=>{C(R)&&R.preventDefault()},[C]),pointerGraceTimerRef:O,onPointerGraceIntentChange:h.useCallback(R=>{F.current=R},[]),children:p.jsx(V,{...H,children:p.jsx(Ph,{asChild:!0,trapped:s,onMountAutoFocus:W(o,R=>{var $;R.preventDefault(),($=E.current)==null||$.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx(sb,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:m,children:p.jsx(lI,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:k,onEntryFocus:W(l,R=>{y.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(Tb,{role:"menu","aria-orientation":"vertical","data-state":gx(x.open),"data-radix-menu-content":"",dir:y.dir,...w,...g,ref:T,style:{outline:"none",...g.style},onKeyDown:W(g.onKeyDown,R=>{const D=R.target.closest("[data-radix-menu-content]")===R.currentTarget,A=R.ctrlKey||R.altKey||R.metaKey,J=R.key.length===1;D&&(R.key==="Tab"&&R.preventDefault(),!A&&J&&X(R.key));const ie=E.current;if(R.target!==ie||!GI.includes(R.key))return;R.preventDefault();const re=_().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);Gb.includes(R.key)&&re.reverse(),m2(re)}),onBlur:W(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(N.current),P.current="")}),onPointerMove:W(e.onPointerMove,mi(R=>{const $=R.target,D=L.current!==R.clientX;if(R.currentTarget.contains($)&&D){const A=R.clientX>L.current?"right":"left";K.current=A,L.current=R.clientX}}))})})})})})})});ex.displayName=Ct;var i2="MenuGroup",Wh=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(ee.div,{role:"group",...n,ref:t})});Wh.displayName=i2;var a2="MenuLabel",tx=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(ee.div,{...n,ref:t})});tx.displayName=a2;var jl="MenuItem",zg="menu.itemSelect",Sc=h.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=h.useRef(null),i=Ri(jl,e.__scopeMenu),a=zh(jl,e.__scopeMenu),l=ae(t,o),c=h.useRef(!1),u=()=>{const f=o.current;if(!r&&f){const d=new CustomEvent(zg,{bubbles:!0,cancelable:!0});f.addEventListener(zg,m=>n==null?void 0:n(m),{once:!0}),xi(f,d),d.defaultPrevented?c.current=!1:i.onClose()}};return p.jsx(rx,{...s,ref:l,disabled:r,onClick:W(e.onClick,u),onPointerDown:f=>{var d;(d=e.onPointerDown)==null||d.call(e,f),c.current=!0},onPointerUp:W(e.onPointerUp,f=>{var d;c.current||(d=f.currentTarget)==null||d.click()}),onKeyDown:W(e.onKeyDown,f=>{const d=a.searchRef.current!=="";r||d&&f.key===" "||ff.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Sc.displayName=jl;var rx=h.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,i=zh(jl,r),a=Jb(r),l=h.useRef(null),c=ae(t,l),[u,f]=h.useState(!1),[d,m]=h.useState("");return h.useEffect(()=>{const v=l.current;v&&m((v.textContent??"").trim())},[o.children]),p.jsx(pi.ItemSlot,{scope:r,disabled:n,textValue:s??d,children:p.jsx(cI,{asChild:!0,...a,focusable:!n,children:p.jsx(ee.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:W(e.onPointerMove,mi(v=>{n?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(e.onPointerLeave,mi(v=>i.onItemLeave(v))),onFocus:W(e.onFocus,()=>f(!0)),onBlur:W(e.onBlur,()=>f(!1))})})})}),l2="MenuCheckboxItem",nx=h.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return p.jsx(lx,{scope:e.__scopeMenu,checked:r,children:p.jsx(Sc,{role:"menuitemcheckbox","aria-checked":Il(r)?"mixed":r,...s,ref:t,"data-state":Vh(r),onSelect:W(s.onSelect,()=>n==null?void 0:n(Il(r)?!0:!r),{checkForDefaultPrevented:!1})})})});nx.displayName=l2;var sx="MenuRadioGroup",[c2,u2]=In(sx,{value:void 0,onValueChange:()=>{}}),ox=h.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Re(n);return p.jsx(c2,{scope:e.__scopeMenu,value:r,onValueChange:o,children:p.jsx(Wh,{...s,ref:t})})});ox.displayName=sx;var ix="MenuRadioItem",ax=h.forwardRef((e,t)=>{const{value:r,...n}=e,s=u2(ix,e.__scopeMenu),o=r===s.value;return p.jsx(lx,{scope:e.__scopeMenu,checked:o,children:p.jsx(Sc,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":Vh(o),onSelect:W(n.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,r)},{checkForDefaultPrevented:!1})})})});ax.displayName=ix;var Hh="MenuItemIndicator",[lx,d2]=In(Hh,{checked:!1}),cx=h.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=d2(Hh,r);return p.jsx(Bs,{present:n||Il(o.checked)||o.checked===!0,children:p.jsx(ee.span,{...s,ref:t,"data-state":Vh(o.checked)})})});cx.displayName=Hh;var f2="MenuSeparator",ux=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return p.jsx(ee.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});ux.displayName=f2;var h2="MenuArrow",dx=h.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=_c(r);return p.jsx(Rb,{...s,...n,ref:t})});dx.displayName=h2;var p2="MenuSub",[z$,fx]=In(p2),Eo="MenuSubTrigger",hx=h.forwardRef((e,t)=>{const r=Ln(Eo,e.__scopeMenu),n=Ri(Eo,e.__scopeMenu),s=fx(Eo,e.__scopeMenu),o=zh(Eo,e.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>u,[u]),h.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),p.jsx(Uh,{asChild:!0,...c,children:p.jsx(rx,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":gx(r.open),...e,ref:tc(t,s.onTriggerChange),onClick:f=>{var d;(d=e.onClick)==null||d.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:W(e.onPointerMove,mi(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:W(e.onPointerLeave,mi(f=>{var m,v;u();const d=(m=r.content)==null?void 0:m.getBoundingClientRect();if(d){const g=(v=r.content)==null?void 0:v.dataset.side,x=g==="right",y=x?-5:5,w=d[x?"left":"right"],b=d[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:w,y:d.top},{x:b,y:d.top},{x:b,y:d.bottom},{x:w,y:d.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:W(e.onKeyDown,f=>{var m;const d=o.searchRef.current!=="";e.disabled||d&&f.key===" "||YI[n.dir].includes(f.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),f.preventDefault())})})})});hx.displayName=Eo;var px="MenuSubContent",mx=h.forwardRef((e,t)=>{const r=Qb(Ct,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Ln(Ct,e.__scopeMenu),i=Ri(Ct,e.__scopeMenu),a=fx(px,e.__scopeMenu),l=h.useRef(null),c=ae(t,l);return p.jsx(pi.Provider,{scope:e.__scopeMenu,children:p.jsx(Bs,{present:n||o.open,children:p.jsx(pi.Slot,{scope:e.__scopeMenu,children:p.jsx(Bh,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;i.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:W(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:W(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:W(e.onKeyDown,u=>{var m;const f=u.currentTarget.contains(u.target),d=JI[i.dir].includes(u.key);f&&d&&(o.onOpenChange(!1),(m=a.trigger)==null||m.focus(),u.preventDefault())})})})})})});mx.displayName=px;function gx(e){return e?"open":"closed"}function Il(e){return e==="indeterminate"}function Vh(e){return Il(e)?"indeterminate":e?"checked":"unchecked"}function m2(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function g2(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function v2(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=g2(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function y2(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o].x,l=t[o].y,c=t[i].x,u=t[i].y;l>n!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(s=!s)}return s}function w2(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return y2(r,t)}function mi(e){return t=>t.pointerType==="mouse"?e(t):void 0}var b2=Xb,x2=Uh,_2=Zb,S2=ex,E2=Wh,k2=tx,C2=Sc,T2=nx,R2=ox,P2=ax,A2=cx,N2=ux,O2=dx,j2=hx,I2=mx,Kh="DropdownMenu",[L2,B$]=Nn(Kh,[Yb]),tt=Yb(),[D2,vx]=L2(Kh),yx=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=tt(t),c=h.useRef(null),[u=!1,f]=_i({prop:s,defaultProp:o,onChange:i});return p.jsx(D2,{scope:t,triggerId:bn(),triggerRef:c,contentId:bn(),open:u,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(d=>!d),[f]),modal:a,children:p.jsx(b2,{...l,open:u,onOpenChange:f,dir:n,modal:a,children:r})})};yx.displayName=Kh;var wx="DropdownMenuTrigger",bx=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=vx(wx,r),i=tt(r);return p.jsx(x2,{asChild:!0,...i,children:p.jsx(ee.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:tc(t,o.triggerRef),onPointerDown:W(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:W(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});bx.displayName=wx;var M2="DropdownMenuPortal",xx=e=>{const{__scopeDropdownMenu:t,...r}=e,n=tt(t);return p.jsx(_2,{...n,...r})};xx.displayName=M2;var _x="DropdownMenuContent",Sx=h.forwardRef((e,t)=>
251{const{__scopeDropdownMenu:r,...n}=e,s=vx(_x,r),o=tt(r),i=h.useRef(!1);return p.jsx(S2,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:W(e.onCloseAutoFocus,a=>{var l;i.current||(l=s.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:W(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!s.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Sx.displayName=_x;var $2="DropdownMenuGroup",U2=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(E2,{...s,...n,ref:t})});U2.displayName=$2;var F2="DropdownMenuLabel",Ex=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(k2,{...s,...n,ref:t})});Ex.displayName=F2;var z2="DropdownMenuItem",kx=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(C2,{...s,...n,ref:t})});kx.displayName=z2;var B2="DropdownMenuCheckboxItem",Cx=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(T2,{...s,...n,ref:t})});Cx.displayName=B2;var W2="DropdownMenuRadioGroup",H2=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(R2,{...s,...n,ref:t})});H2.displayName=W2;var V2="DropdownMenuRadioItem",Tx=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(P2,{...s,...n,ref:t})});Tx.displayName=V2;var K2="DropdownMenuItemIndicator",Rx=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(A2,{...s,...n,ref:t})});Rx.displayName=K2;var q2="DropdownMenuSeparator",Px=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(N2,{...s,...n,ref:t})});Px.displayName=q2;var G2="DropdownMenuArrow",Y2=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(O2,{...s,...n,ref:t})});Y2.displayName=G2;var J2="DropdownMenuSubTrigger",Ax=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(j2,{...s,...n,ref:t})});Ax.displayName=J2;var X2="DropdownMenuSubContent",Nx=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=tt(r);return p.jsx(I2,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Nx.displayName=X2;var Q2=yx,Z2=bx,eL=xx,Ox=Sx,jx=Ex,Ix=kx,Lx=Cx,Dx=Tx,Mx=Rx,$x=Px,Ux=Ax,Fx=Nx;const zx=Q2,Bx=Z2,tL=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>p.jsxs(Ux,{ref:s,className:U("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,p.jsx(Ok,{className:"ml-auto h-4 w-4"})]}));tL.displayName=Ux.displayName;const rL=h.forwardRef(({className:e,...t},r)=>p.jsx(Fx,{ref:r,className:U("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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),...t}));rL.displayName=Fx.displayName;const qh=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(eL,{children:p.jsx(Ox,{ref:n,sideOffset:t,className:U("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
251de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));qh.displayName=Ox.displayName;const Gh=h.forwardRef(({className:e,inset:t,...r},n)=>p.jsx(Ix,{ref:n,className:U("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Gh.displayName=Ix.displayName;const nL=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>p.jsxs(Lx,{ref:s,className:U("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(Mx,{children:p.jsx(Nk,{className:"h-4 w-4"})})}),t]}));nL.displayName=Lx.displayName;const sL=h.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(Dx,{ref:n,className:U("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(Mx,{children:p.jsx(jk,{className:"h-2 w-2 fill-current"})})}),t]}));sL.displayName=Dx.displayName;const Wx=h.forwardRef(({className:e,inset:t,...r},n)=>p.jsx(jx,{ref:n,className:U("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Wx.displayName=jx.displayName;const Hx=h.forwardRef(({className:e,...t},r)=>p.jsx($x,{ref:r,className:U("-mx-1 my-1 h-px bg-muted",e),...t}));Hx.displayName=$x.displayName;function Bg({className:e,alt:t}){return p.jsx("img",{src:"/lovable-uploads/3ae605e4-9c3b-4cf8-a51a-8cd65ccdc965.png",alt:t??"",className:U("inline-block align-middle select-none",e),loading:"lazy",decoding:"async","aria-hidden":t?void 0:!0})}function $e(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function oL(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const ga=43200,Wg=1440;let iL={};function aL(){return iL}function Hg(e){const t=$e(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Ha(e,t){const r=$e(e),n=$e(t),s=r.getTime()-n.getTime();return s<0?-1:s>0?1:s}function lL(e){return oL(e,Date.now())}function cL(e,t){const r=$e(e),n=$e(t),s=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return s*12+o}function uL(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function dL(e,t){return+$e(e)-+$e(t)}function fL(e){const t=$e(e);return t.setHours(23,59,59,999),t}function hL(e){const t=$e(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function pL(e){const t=$e(e);return+fL(t)==+hL(t)}function mL(e,t){const r=$e(e),n=$e(t),s=Ha(r,n),o=Math.abs(cL(r,n));let i;if(o<1)i=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-s*o);let a=Ha(r,n)===-s;pL($e(e))&&o===1&&Ha(e,n)===1&&(a=!1),i=s*(o-Number(a))}return i===0?0:i}function gL(e,t,r){const n=dL(e,t)/1e3;return uL(r==null?void 0:r.roundingMethod)(n)}const vL={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yL=(e,t,r)=>{let n;const s=vL[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function $u(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const wL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_L={date:$u({formats:wL,defaultWidth:"full"}),time:$u({formats:bL,defaultWidth:"full"}),dateTime:$u({formats:xL,defaultWidth:"full"})},SL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},EL=(e,t,r,n)=>SL[e];function mo(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=r!=null&&r.width?String(r.width):i;s=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[a]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const kL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},CL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},TL={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},RL={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
251ay","Saturday"]},PL={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},AL={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},NL=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},OL={ordinalNumber:NL,era:mo({values:kL,defaultWidth:"wide"}),quarter:mo({values:CL,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mo({values:TL,defaultWidth:"wide"}),day:mo({values:RL,defaultWidth:"wide"}),dayPeriod:mo({values:PL,defaultWidth:"wide",formattingValues:AL,defaultFormattingWidth:"wide"})};function go(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const i=o[0],a=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?IL(a,f=>f.test(i)):jL(a,f=>f.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;const u=t.slice(i.length);return{value:c,rest:u}}}function jL(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function IL(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function LL(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],o=t.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=r.valueCallback?r.valueCallback(i):i;const a=t.slice(s.length);return{value:i,rest:a}}}const DL=/^(\d+)(th|st|nd|rd)?/i,ML=/\d+/i,$L={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},UL={any:[/^b/i,/^(a|c)/i]},FL={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zL={any:[/1/i,/2/i,/3/i,/4/i]},BL={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},WL={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},HL={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},VL={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},KL={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},qL={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},GL={ordinalNumber:LL({matchPattern:DL,parsePattern:ML,valueCallback:e=>parseInt(e,10)}),era:go({matchPatterns:$L,defaultMatchWidth:"wide",parsePatterns:UL,defaultParseWidth:"any"}),quarter:go({matchPatterns:FL,defaultMatchWidth:"wide",parsePatterns:zL,defaultParseWidth:"any",valueCallback:e=>e+1}),month:go({matchPatterns:BL,defaultMatchWidth:"wide",parsePatterns:WL,defaultParseWidth:"any"}),day:go({matchPatterns:HL,defaultMatchWidth:"wide",parsePatterns:VL,defaultParseWidth:"any"}),dayPeriod:go({matchPatterns:KL,defaultMatchWidth:"any",parsePatterns:qL,defaultParseWidth:"any"})},YL={code:"en-US",formatDistance:yL,formatLong:_L,formatRelative:EL,localize:OL,match:GL,options:{weekStartsOn:0,firstWeekContainsDate:1}};function JL(e,t,r){const n=aL(),s=(r==null?void 0:r.locale)??n.locale??YL,o=2520,i=Ha(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:i});let l,c;i>0?(l=$e(t),c=$e(e)):(l=$e(e),c=$e(t));const u=gL(c,l),f=(Hg(c)-Hg(l))/1e3,d=Math.round((u-f)/60);let m;if(d<2)return r!=null&&r.includeSeconds?u<5?s.formatDistance("lessThanXSeconds",5,a):u<10?s.formatDistance("lessThanXSeconds",10,a):u<20?s.formatDistance("lessThanXSeconds",20,a):u<40?s.formatDistance("halfAMinute",0,a):u<60?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",1,a):d===0?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",d,a);if(d<45)return s.formatDistance("xMinutes",d,a);if(d<90)return s.formatDistance("aboutXHours",1,a);if(d<Wg){const v=Math.round(d/60);return s.formatDistance("aboutXHours",v,a)}else{if(d<o)return s.formatDistance("xDays",1,a);if(d<ga){const v=Math.round(d/Wg);return s.formatDistance("xDays",v,a)}else if(d<ga*2)return m=Math.round(d/ga),s.formatDistance("aboutXMonths",m,a)}if(m=mL(c,l),m<12){const v=Math.round(d/ga);return s.formatDistance("xMonths",v,a)}else{const v=m%12,g=Math.trunc(m/12);return v<3?s.formatDistance("aboutXYears",g,a):v<9?s.formatDistance("overXYears",g,a):s.formatDistance("almostXYears",g+1,a)}}function XL(e,t){return JL(e,lL(e),t)}function QL(){const[e,t]=h.useState(null),[r,n]=h.useState(0),[s,o]=h.useState([]),[i,a]=h.useState(!1),[l,c]=h.useState(!0),u=h.useRef(new Set),f=h.useRef(new Map),d=h.useRef(new Map),m="activity_last_opened";h.useEffect(()=>{(async()=>{var N;const{data:{session:_}}=await G.auth.getSession(),S=((N=_==null?void 0:_.user)==null?void 0:N.id)||null;if(t(S),!S){c(!1);return}const{data:k}=await G.from("posts").select("id").eq("user_id",S),E=(k||[]).map(P=>
251P.id).filter(Boolean);u.current=new Set(E);try{const P=parseInt(localStorage.getItem(m)||"0",10);if(E.length>0){const O=P>0?new Date(P).toISOString():new Date(Date.now()-6048e5).toISOString(),[{count:F},{count:K},{count:L}]=await Promise.all([G.from("likes").select("id",{count:"exact",head:!0}).in("post_id",E).neq("user_id",S).gt("created_at",O),G.from("comments").select("id",{count:"exact",head:!0}).in("post_id",E).neq("user_id",S).gt("created_at",O),G.from("reposts").select("id",{count:"exact",head:!0}).in("post_id",E).neq("user_id",S).gt("created_at",O)]);n((F||0)+(K||0)+(L||0))}}catch{}if(E.length>0){const[P,O,F]=await Promise.all([G.from("likes").select("id, created_at, post_id, user_id").in("post_id",E).neq("user_id",S).order("created_at",{ascending:!1}).limit(25),G.from("comments").select("id, created_at, post_id, user_id, content").in("post_id",E).neq("user_id",S).order("created_at",{ascending:!1}).limit(25),G.from("reposts").select("id, created_at, post_id, user_id, comment").in("post_id",E).neq("user_id",S).order("created_at",{ascending:!1}).limit(25)]),K=(P.data||[]).filter(A=>!!A.post_id),L=(O.data||[]).filter(A=>!!A.post_id),V=(F.data||[]).filter(A=>!!A.post_id),H=Array.from(new Set(K.map(A=>A.user_id))),X=Array.from(new Set(L.map(A=>A.user_id))),C=Array.from(new Set(V.map(A=>A.user_id))),R=Array.from(new Set([...H,...X,...C])),$=Array.from(new Set([...K.map(A=>A.post_id).filter(Boolean),...L.map(A=>A.post_id).filter(Boolean),...V.map(A=>A.post_id).filter(Boolean)]));if(R.length>0){const{data:A}=await G.from("profiles").select("user_id, display_name, avatar_url").in("user_id",R);(A||[]).forEach(J=>f.current.set(J.user_id,J))}if($.length>0){const{data:A}=await G.from("posts").select("id, content, image_url").in("id",$);(A||[]).forEach(J=>d.current.set(J.id,J))}const D=[...K.map(A=>({id:A.id,type:"like",created_at:A.created_at,post_id:A.post_id,actor_id:A.user_id})),...L.map(A=>({id:A.id,type:"comment",created_at:A.created_at,post_id:A.post_id,actor_id:A.user_id,previewText:A.content||null})),...V.map(A=>({id:A.id,type:"repost",created_at:A.created_at,post_id:A.post_id,actor_id:A.user_id,previewText:A.comment||null}))].sort((A,J)=>new Date(J.created_at).getTime()-new Date(A.created_at).getTime()).slice(0,25).map(A=>({...A,profile:f.current.get(A.actor_id),post:d.current.get(A.post_id)}));o(D)}const T=G.channel(`activity_${S}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"likes"},async P=>{const O=P.new;!(O!=null&&O.post_id)||O.user_id===S||u.current.has(O.post_id)&&await v({id:O.id,type:"like",created_at:O.created_at,post_id:O.post_id,actor_id:O.user_id})}).on("postgres_changes",{event:"INSERT",schema:"public",table:"comments"},async P=>{const O=P.new;!(O!=null&&O.post_id)||O.user_id===S||u.current.has(O.post_id)&&await v({id:O.id,type:"comment",created_at:O.created_at,post_id:O.post_id,actor_id:O.user_id,previewText:O.content||null})}).on("postgres_changes",{event:"INSERT",schema:"public",table:"reposts"},async P=>{const O=P.new;!(O!=null&&O.post_id)||O.user_id===S||u.current.has(O.post_id)&&await v({id:O.id,type:"repost",created_at:O.created_at,post_id:O.post_id,actor_id:O.user_id,previewText:O.comment||null})}).subscribe();return c(!1),()=>{G.removeChannel(T)}})()},[]);const v=async b=>{if(n(_=>_+1),!f.current.has(b.actor_id)){const{data:_}=await G.from("profiles").select("user_id, display_name, avatar_url").eq("user_id",b.actor_id).maybeSingle();_&&f.current.set(_.user_id,_)}if(!d.current.has(b.post_id)){const{data:_}=await G.from("posts").select("id, content, image_url").eq("id",b.post_id).maybeSingle();_&&d.current.set(_.id,_)}o(_=>[{...b,profile:f.current.get(b.actor_id),post:d.current.get(b.post_id)},..._].slice(0,25))},g=b=>{a(b),b&&r>0&&(localStorage.setItem(m,String(Date.now())),n(0))};if(!e)return null;const x=r>0,y=b=>b==="like"?p.jsx(Bg,{className:"h-4 w-4"}):b==="comment"?p.jsx(Mk,{className:"h-4 w-4 text-primary"}):p.jsx(zk,{className:"h-4 w-4 text-primary"}),w=b=>b==="like"?"liked your post":b==="comment"?"commented on your post":"reposted your post";return p.jsxs(zx,{open:i,onOpenChange:g,children:[p.jsx(Bx,{asChild:!0,children:p.jsxs(ze,{variant:"ghost",size:"icon",className:"relative h-9 w-9 rounded-full","aria-label":x?`${r} new notifications`:"Notifications",children:[p.jsx(Bg,{className:"h-[1.6875rem] w-[1.6875rem]"}),x&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"absolute -top-1 -right-1 h-4 min-w-4 px-1 rounded-full bg-accent text-accent-foreground ring-2 ring-background text-[10px] font-bold leading-none flex items-center justify-center shadow-[0_0_12px] shadow-accent/60",children:r>99?"99+":r}),p.jsx("span",{className:"absolute -top-1 -right-1 h-4 min-w-4 rounded-full bg-accent/50 blur-md animate-pulse","aria-hidden":"true"})]})]})}),p.jsxs(qh,{align:"end",className:"w-80",children:[p.jsx(Wx,{children:"Notifications"}),p.jsx(Hx,{}),l?p.jsx("div",{className:"p-3 text-sm text-muted-foreground",children:"Loadingâ¦"}):s.length===0?p.jsx("div",{className:"p-3 text-sm text-muted-foreground",children:"No recent activity"}):s.map(b=>{var _,S,k,E,T;return p.jsx(Gh,{asChild:!0,className:"gap-3 py-3",children:p.jsx(vr,{to:`/social?post=${b.post_id}`,children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsxs(hc,{className:"h-8 w-8",children:[p.jsx(pc,{src:((_=b.profile)==null?void 0:_.avatar_url)||void 0}),p.jsx(mc,{className:"text-xs",children:(((k=(S=b.profile)==null?void 0:S.display_name)==null?void 0:k[0])||"U").toUpperCase()})]}),p.jsxs("div",{className:"flex-1 text-sm leading-tight",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[y(b.type),p.jsxs("span",{children:[p.jsx("span",{className:"font-medium",children:((E=b.profile)==null?void 0:E.display_name)||"Someone"}),p.jsxs("span",{className:"text-muted-foreground",children:[" ",w(b.type)]})]})]}),b.previewText&&p.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:b.previewText}),((T=b.post)==null?void 0:T.content)&&p.jsx("div",{className:"text-xs text-muted-foreground line-clamp-1",children:b.post.content}),p.jsx("div",{className:"text-[10px] text-muted-foreground",children:XL(new Date(b.created_at),{addSuffix:!0})})]})]})})},`${b.type}-${b.id}`)})]})]})}function ZL(e,t){const r=h.createContext(t),n=o=>{const{children:i,...a}=o,l=h.useMemo(()=>a,Object.values(a));return p.jsx(r.Provider,{value:l,children:i})};n.displayName=e+"Provider";function s(o){const i=h.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,s]}function eD(e,t=[]){let r=[];function n(o,i){const a=h.createContext(i),l=r.length;r=[...r,i];const c=f=>{var y;const{scope:d,children:m,...v}=f,g=((y=d==null?void 0:d[e])==null?void 0:y[l])||a,x=h.useMemo(()=>v,Object.values(v));return p.jsx(g.Provider,{value:x,children:m})};c.displayName=o+"Provider";function u(f,d){var g;const m=((g=d==null?void 0:d[e])==null?void 0:g[l])||a,v=h.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,u]}const s=()=>{const o=r.map(i=>h.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,tD(s,...t)]}function tD(...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(o){const i=n.reduce((a,{useScope:l,scopeName:c}
vendor: 18,837 bytes, lines 251-258
251)=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var rD="DismissableLayer",hf="dismissableLayer.update",nD="dismissableLayer.pointerDownOutside",sD="dismissableLayer.focusOutside",Vg,Vx=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yh=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=h.useContext(Vx),[u,f]=h.useState(null),d=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),v=ae(t,E=>f(E)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(x),w=u?g.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,_=w>=y,S=aD(E=>{const T=E.target,N=[...c.branches].some(P=>P.contains(T));!_||N||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},d),k=lD(E=>{const T=E.target;[...c.branches].some(P=>P.contains(T))||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},d);return fh(E=>{w===c.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},d),h.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Vg=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Kg(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Vg)}},[u,d,r,c]),h.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Kg())},[u,c]),h.useEffect(()=>{const E=()=>m({});return document.addEventListener(hf,E),()=>document.removeEventListener(hf,E)},[]),p.jsx(ee.div,{...l,ref:v,style:{pointerEvents:b?_?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,k.onFocusCapture),onBlurCapture:W(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,S.onPointerDownCapture)})});Yh.displayName=rD;var oD="DismissableLayerBranch",iD=h.forwardRef((e,t)=>{const r=h.useContext(Vx),n=h.useRef(null),s=ae(t,n);return h.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),p.jsx(ee.div,{...e,ref:s})});iD.displayName=oD;function aD(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e),n=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){Kx(nD,r,c,{discrete:!0})};const c={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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function lD(e,t=globalThis==null?void 0:globalThis.document){const r=Re(e),n=h.useRef(!1);return h.useEffect(()=>{const s=o=>{o.target&&!n.current&&Kx(sD,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Kg(){const e=new CustomEvent(hf);document.dispatchEvent(e)}function Kx(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?xi(s,o):s.dispatchEvent(o)}var cD="Portal",qx=h.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=h.useState(!1);Ye(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?ec.createPortal(p.jsx(ee.div,{...n,ref:t}),i):null});qx.displayName=cD;function uD(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var Ec=e=>{const{present:t,children:r}=e,n=dD(t),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),o=ae(n.ref,fD(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:o}):null};Ec.displayName="Presence";function dD(e){const[t,r]=h.useState(),n=h.useRef({}),s=h.useRef(e),o=h.useRef("none"),i=e?"mounted":"unmounted",[a,l]=uD(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=va(n.current);o.current=a==="mounted"?c:"none"},[a]),Ye(()=>{const c=n.current,u=s.current;if(u!==e){const d=o.current,m=va(c);e?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),Ye(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=m=>{const g=va(n.current).includes(m.animationName);if(m.target===t&&g&&(l("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},d=m=>{m.target===t&&(o.current=va(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function va(e){return(e==null?void 0:e.animationName)||"none"}function fD(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 Uu=0;function hD(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qg()),document.body.insertAdjacentElement("beforeend",e[1]??qg()),Uu++,()=>{Uu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uu--}},[])}function qg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zr=function(){return zr=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},zr.apply(this,arguments)};function pD(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function mD(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var Gx=Ub(),Fu=function(){},kc=h.forwardRef(function(e,t){var r=h.useRef(null),n=h.useState({onScrollCapture:Fu,onWheelCapture:Fu,onTouchMoveCapture:Fu}),s=n[0],o=n[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,d=e.sideCar,m=e.noIsolation,v=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,b=pD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=d,S=$b([r,t]),k=zr(zr({},b),s);return h.createElement(h.Fragment,null,u&&h.createElement(_,{sideCar:Gx,removeScrollBar:c,shards:f,noIsolation:m,inert:v,setCallbacks:o,allowPinchZoom:!!g,lockRef:r,gapMode:w}),i?h.cloneElement(h.Children.only(a),zr(zr({},k),{ref:S})):h.createElement(y,zr({},k,{className:l,ref:S}),a))});kc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kc.classNames={fullWidth:Uo,zeroRight:$o};var pf=!1;if(typeof window<"u")try{var ya=Object.defineProperty({},"passive",{get:function(){return pf=!0,!0}});window.addEventListener("test",ya,ya),window.removeEventListener("test",ya,ya)}catch{pf=!1}var Jn=pf?{passive:!1}:!1,gD=function(e){return e.tagName==="TEXTAREA"},Yx=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!gD(e)&&r[t]==="visible")},vD=function(e){return Yx(e,"overflowY")},yD=function(e){return Yx(e,"overflowX")},Gg=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Jx(e,n);if(s){var o=Xx(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wD=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},bD=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Jx=function(e,t){return e==="v"?vD(t):yD(t)},Xx=function(e,t){return e==="v"?wD(t):bD(t)},xD=function(e,t){return e==="h"&&t==="rtl"?-1:1},_D=function(e,t,r,n,s){var o=xD(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,u=i>0,f=0,d=0;do{var m=Xx(e,a),v=m[0],g=m[1],x=m[2],y=g-x-o*v;(v||y)&&Jx(e,a)&&(f+=y,d+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(Math.abs(f)<1||!s)||!u&&(Math.abs(d)<1||!s))&&(c=!0),c},wa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yg=function(e){return[e.deltaX,e.deltaY]},Jg=function(e){return e&&"current"in e?e.current:e},SD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ED=function(e){return` 252 .block-interactivity-`.concat(e,` {pointer-events: none;} 253 .allow-interactivity-`).concat(e,` {pointer-events: all;} 254`)},kD=0,Xn=[];function CD(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),s=h.useState(kD++)[0],o=h.useState($h)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=mD([e.lockRef.current],(e.shards||[]).map(Jg),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var y=wa(g),w=r.current,b="deltaX"in g?g.deltaX:w[0]-y[0],_="deltaY"in g?g.deltaY:w[1]-y[1],S,k=g.target,E=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in g&&E==="h"&&k.type==="range")return!1;var T=Gg(E,k);if(!T)return!0;if(T?S=E:(S=E==="v"?"h":"v",T=Gg(E,k)),!T)return!1;if(!n.current&&"changedTouches"in g&&(b||_)&&(n.current=S),!S)return!0;var N=n.current||S;return _D(N,x,g,N==="h"?b:_,!0)},[]),l=h.useCallback(function(g){var x=g;if(!(!Xn.length||Xn[Xn.length-1]!==o)){var y="deltaY"in x?Yg(x):wa(x),w=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&SD(S.delta,y)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(Jg).filter(Boolean).filter(function(S){return S.contains(x.target)}),_=b.length>0?a(x,b[0]):!i.current.noIsolation;_&&x.cancelable&&x.preventDefault()}}},[]),c=h.useCallback(function(g,x,y,w){var b={name:g,delta:x,target:y,should:w,shadowParent:TD(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(_){return _!==b})},1)},[]),u=h.useCallback(function(g){r.current=wa(g),n.current=void 0},[]),f=h.useCallback(function(g){c(g.type,Yg(g),g.target,a(g,e.lockRef.current))},[]),d=h.useCallback(function(g){c(g.type,wa(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Xn.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Jn),document.addEventListener("touchmove",l,Jn),document.addEventListener("touchstart",u,Jn),function(){Xn=Xn.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,Jn),document.removeEventListener("touchmove",l,Jn),document.removeEventListener("touchstart",u,Jn)}},[]);var m=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(o,{styles:ED(s)}):null,m?h.createElement(Wb,{gapMode:e.gapMode}):null)}function TD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const RD=zb(Gx,CD);var Qx=h.forwardRef(function(e,t){return h.createElement(kc,zr({},e,{ref:t,sideCar:RD}))});Qx.classNames=kc.classNames;var Jh="Dialog",[Zx,W$]=eD(Jh),[PD,Gt]=Zx(Jh),e_=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=h.useRef(null),l=h.useRef(null),[c=!1,u]=_i({prop:n,defaultProp:s,onChange:o});return p.jsx(PD,{scope:t,triggerRef:a,contentRef:l,contentId:bn(),titleId:bn(),descriptionId:bn(),open:c,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:i,children:r})};e_.displayName=Jh;var t_="DialogTrigger",r_=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Gt(t_,r),o=ae(t,s.triggerRef);return p.jsx(ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Zh(s.open),...n,ref:o,onClick:W(e.onClick,s.onOpenToggle)})});r_.displayName=t_;var Xh="DialogPortal",[AD,n_]=Zx(Xh,{forceMount:void 0}),s_=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=Gt(Xh,t);return p.jsx(AD,{scope:t,forceMount:r,children:h.Children.map(n,i=>p.jsx(Ec,{present:r||o.open,children:p.jsx(qx,{asChild:!0,container:s,children:i})}))})};s_.displayName=Xh;var Ll="DialogOverlay",o_=h.forwardRef((e,t)=>{const r=n_(Ll,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Gt(Ll,e.__scopeDialog);return o.modal?p.jsx(Ec,{present:n||o.open,children:p.jsx(ND,{...s,ref:t})}):null});o_.displayName=Ll;var ND=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Gt(Ll,r);return p.jsx(Qx,{as:Pt,allowPinchZoom:!0,shards:[s.contentRef],children:p.jsx(ee.div,{"data-state":Zh(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Rn="DialogContent",i_=h.forwardRef((e,t)=>{const r=n_(Rn,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Gt(Rn,e.__scopeDialog);return p.jsx(Ec,{present:n||o.open,children:o.modal?p.jsx(OD,{...s,ref:t}):p.jsx(jD,{...s,ref:t})})});i_.displayName=Rn;var OD=h.forwardRef((e,t)=>{const r=Gt(Rn,e.__scopeDialog),n=h.useRef(null),s=ae(t,r.contentRef,n);return h.useEffect(()=>{const o=n.current;if(o)return Mb(o)},[]),p.jsx(a_,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:W(e.onFocusOutside,o=>o.preventDefault())})}),jD=h.forwardRef((e,t)=>{const r=Gt(Rn,e.__scopeDialog),n=h.useRef(!1),s=h.useRef(!1);return p.jsx(a_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),a_=h.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=Gt(Rn,r),l=h.useRef(null),c=ae(t,l);return hD(),p.jsxs(p.Fragment,{children:[p.jsx(Ph,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:p.jsx(Yh,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Zh(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(ID,{titleId:a.titleId}),p.jsx(DD,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Qh="DialogTitle",l_=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Gt(Qh,r);return p.jsx(ee.h2,{id:s.titleId,...n,ref:t})});l_.displayName=Qh;var c_="DialogDescription",u_=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Gt(c_,r);return p.jsx(ee.p,{id:s.descriptionId,...n,ref:t})});u_.displayName=c_;var d_="DialogClose",f_=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Gt(d_,r);return p.jsx(ee.button,{type:"button",...n,ref:t,onClick:W(e.onClick,()=>s.onOpenChange(!1))})});f_.displayName=d_;function Zh(e){return e?"open":"closed"}var h_="DialogTitleWarning",[H$,p_]=ZL(h_,{contentName:Rn,titleName:Qh,docsSlug:"dialog"}),ID=({titleId:e})=>{const t=p_(h_),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 255 256If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 257 258For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},LD="DialogDescriptionWarning",DD=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${p_(LD).contentName}}.`;return h.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},m_=e_,MD=r_,g_=s_,Cc=o_,Tc=i_,Rc=l_,Pc=u_,v_=f_;const Pi=m_,V$=MD,$D=g_,y_=h.forwardRef(({className:e,...t},r)=>p.jsx(Cc,{ref:r,className:U("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));y_.displayName=Cc.displayName;const Js=h.forwardRef(({className:e,children:t,hideCloseButton:r=!1,...n},s)=>p.jsxs($D,{children:[p.jsx(y_,{}),p.jsxs(Tc,{ref:s,className:U("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
258nded-lg",e),...n,children:[t,!r&&p.jsxs(v_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[p.jsx(gh,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Js.displayName=Tc.displayName;const Xs=({className:e,...t})=>p.jsx("div",{className:U("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Xs.displayName="DialogHeader";const UD=({className:e,...t})=>p.jsx("div",{className:U("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});UD.displayName="DialogFooter";const Qs=h.forwardRef(({className:e,...t},r)=>p.jsx(Rc,{ref:r,className:U("text-lg font-semibold leading-none tracking-tight",e),...t}));Qs.displayName=Rc.displayName;const w_=h.forwardRef(({className:e,...t},r)=>p.jsx(Pc,{ref:r,className:U("text-sm text-muted-foreground",e),...t}));w_.displayName=Pc.displayName;const Is=h.forwardRef(({className:e,type:t,...r},n)=>p.jsx("input",{type:t,className:U("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 font-grotesk",e),ref:n,...r}));Is.displayName="Input";const FD=({open:e,onOpenChange:t})=>{const[r,n]=h.useState(""),[s,o]=h.useState(!1),[i,a]=h.useState([]),l=jn();h.useEffect(()=>{e||(n(""),a([]))},[e]),h.useEffect(()=>{let u=!0;return(async()=>{if(e){if(r.trim().length<1){const{data:d}=await G.from("profiles").select("user_id, display_name, avatar_url, username").eq("is_public",!0).order("created_at",{ascending:!1}).limit(10);if(!u)return;a(d||[]);return}o(!0);try{const d=r.trim().replace(/%/g,"").replace(/\s+/g,"%"),{data:m}=await G.from("profiles").select("user_id, display_name, avatar_url, username").or(`display_name.ilike.%${d}%,username.ilike.%${d}%`).eq("is_public",!0).limit(25);if(!u)return;a(m||[])}finally{u&&o(!1)}}})(),()=>{u=!1}},[r,e]);const c=u=>{t(!1),l(`/u/${u}`)};return p.jsx(Pi,{open:e,onOpenChange:t,children:p.jsxs(Js,{className:"sm:max-w-lg",children:[p.jsx(Xs,{children:p.jsx(Qs,{children:"Search Users"})}),p.jsxs("div",{className:"space-y-3",children:[p.jsx(Is,{autoFocus:!0,placeholder:"Search by name or @username",value:r,onChange:u=>n(u.target.value)}),p.jsx("div",{className:"max-h-80 overflow-y-auto rounded-md border",children:i.length===0?p.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s?"Searchingâ¦":"No users found"}):i.map(u=>p.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 p-3 text-left hover:bg-muted/50",onClick:()=>c(u.user_id),children:[p.jsxs(hc,{className:"h-8 w-8",children:[p.jsx(pc,{src:u.avatar_url||void 0}),p.jsx(mc,{children:(u.display_name||"U")[0]})]}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"text-sm font-medium truncate",children:u.display_name||"User"}),u.username&&p.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:["@",u.username]})]})]},u.user_id))})]})]})})},b_=h.createContext(void 0),zu={en:{"nav.login":"Login","nav.signup":"Sign Up","nav.dashboard":"Dashboard","nav.social":"Social","nav.messages":"Messages","nav.analyzer":"Podcast Analyzer","hero.title.your":"Your","hero.title.podcasts":"podcasts","hero.title.people":"people","hero.title.community":"videos","hero.subtitle":"","hero.join":"JOIN NOW!","hero.explore":"Explore","upload.title":"Biteverse connects people through podcasts, videos, and songsâpowered by Nova, our AI that turns content into quick bites, fresh ideas, and conversations worth sharing!","upload.step1":"Choose a podcast or video!","upload.step1.desc":"Use our AI to choose a podcast or video below.","upload.step2":"Press get my summary!","upload.step2.desc":"The URL is auto-populated - let our AI do the rest","upload.powered.by":"Powered by","upload.or":"or","upload.get.summary":"Get my summary","tutorial.title":"How to Upload a Podcast URL","tutorial.subtitle":"Get started in just 3 simple steps","language.select":"Language","analyzer.title":"Transform Your Podcast into a Personal AI Couch","analyzer.subtitle":"Upload any Spotify podcast episode and get a customized breakdown designed to improve your life.","analyzer.spotify.url":"Spotify Podcast URL","analyzer.goal.tell":"Tell us your goal â we'll turn it into an actionable roadmap","analyzer.goals.better.sleep":"Better sleep","analyzer.goals.productivity":"Productivity boost","analyzer.goals.marathon":"Marathon prep","analyzer.generate.couch":"Generate My AI Couch","analyzer.make.public":"Make Public","analyzer.analysis.progress":"AI Analysis in Progress","analyzer.analysis.processing":"Processing podcast content and generating personalized insights...","analyzer.ke
258y.points":"Key Points Extracted","analyzer.key.points.desc":"Important insights from the podcast content","analyzer.actionable.insights":"Actionable Insights","analyzer.actionable.desc":"Personalized AI Couch based on your selected goals","analyzer.importance.high":"high importance","analyzer.importance.medium":"medium importance","analyzer.importance.low":"low importance","analyzer.difficulty.easy":"easy","analyzer.difficulty.medium":"medium","analyzer.difficulty.hard":"hard","processor.spotify.url":"Spotify URL","processor.audio.file":"Audio File","processor.upload.file":"Upload Podcast File","processor.custom.instructions":"Custom Instructions (Optional)","processor.custom.placeholder":"Tell me what you want to focus on","processor.make.public":"Make this analysis public (visible to other users)","processor.get.summary":"Get my summary","processor.powered.by.spotify":"Powered by Spotify","processor.search.podcasts":"Search your favorite podcasts","processor.processing":"Processing...","processor.transcribing":"Transcribing podcast...","processor.analyzing":"Analyzing content...","processor.saving":"Saving results...","processor.complete":"Analysis Complete!","processor.summary":"AI Summary","processor.takeaways":"Key Takeaways","processor.action.plan":"Action Plan","processor.fact.check":"Fact Check","processor.transcript":"Full Transcript","processor.download":"Download","processor.share":"Share","processor.error.upload":"Upload failed","processor.error.analyze":"Analysis failed","processor.success.saved":"Your podcast has been analyzed and saved successfully.","processor.success.results":"Here are your results. Log in to save and unlock more.","dashboard.title":"Podcast Analyzer","dashboard.loading":"Loading your Podcast Analyzer...","dashboard.choose.podcast":"Choose a podcast","dashboard.press.analyze":"Press analyze","dashboard.no.podcasts":"No podcasts yet","dashboard.upload.first":"Upload your first podcast to get started with AI-powered insights.","dashboard.get.started":"Upload Your First Podcast","messages.title":"Messages","messages.search":"Search conversations...","messages.no.results":"No results found","messages.try.different":"Try searching with different keywords","messages.no.conversations":"No conversations yet","messages.start.connecting":"Start connecting with other users to begin messaging.","messages.sign.in":"Sign in to view messages","messages.connect.enthusiasts":"Connect with other podcast enthusiasts and share insights in private conversations.","messages.loading":"Loading messages...","messages.loading.conversations":"Loading conversations...","messages.type.message":"Type a message...","messages.start.conversation":"Start the conversation","messages.send.message":"Send a message to {name} and begin your conversation","messages.typing":"Typing...","messages.active.now":"Active now","messages.participants":"{count} participants","messages.delivered":"Delivered","messages.sending":"Sending...","profile.edit":"Edit profile","profile.save":"Save","profile.cancel":"Cancel","profile.follow":"Follow","profile.following":"Following","profile.message":"Message","profile.followers":"followers","profile.following.count":"following","profile.posts":"Posts","profile.podcasts":"Podcasts","profile.no.posts":"No posts yet","profile.no.posts.own":"Share your first post to get started","profile.no.posts.user":"This user hasn't shared anything yet","profile.public.podcasts":"Public Podcasts","profile.display.name":"Display Name","profile.username":"Username","profile.bio":"Bio","profile.website":"Website URL","profile.favorite.podcasts":"Favorite podcasts (optional)","profile.podcast.1":"Podcast 1","profile.podcast.2":"Podcast 2","profile.podcast.3":"Podcast 3","profile.bio.placeholder":"Write a bio...","profile.website.placeholder":"Website URL","profile.avatar.updated":"Avatar updated","profile.banner.updated":"Banner updated","profile.upload.failed":"Upload failed","profile.edit.cover":"Edit cover","profile.add.cover":"Add cover","profile.add.cover.photo":"Add cover photo","profile.recommended.size":"Recommended: 1500x500 pixels","ui.loading":"Loading...","ui.error":"Error","ui.success":"Success","ui.close":"Close","ui.save":"Save","ui.cancel":"Cancel","ui.edit":"Edit","ui.delete":"Delete","ui.share":"Share","ui.copy":"Copy","ui.download":"Download","ui.upload":"Upload","ui.search":"Search","ui.filter":"Filter","ui.sort":"Sort","ui.view.all":"View all","ui.show.more":"Show more","ui.show.less":"Show less","ui.read.more":"Read more","ui.play":"Play","ui.pause":"Pause","ui.stop":"Stop","ui.or":"or","mood.need.inspiration":"Need inspiration? Tell us your mood!","mood.tell.mood":"Tell me your mood!","mood.choose.mood":"Or choose a mood...","mood.workday.focus":"Workday Focus","mood.gym.hype":"Gym Hype","mood.select.moods":"Select moods","mood.find.podcasts":"Find podcasts"}};function zD(){var e,t;try{if(typeof localStorage<"u"){const r=localStorage.getItem("language");if(r&&["en","fr","it","es","de","pt"].includes(r))return r}if(typeof navigator<"u"){const r=(t=(e=navigator.language)==null?void 0:e.split("-"))==null?void 0:t[0];if(r&&["fr","it","es","de","pt"].includes(r))return r}}catch(r){console.warn("Error detecting language:",r)}return"en"}function BD({children:e}){const[t,r]=h.useState(()=>zD()),n=h.useCallback(i=>{r(i);try{typeof localStorage<"u"&&localStorage.setItem("language",i)}catch(a){console.warn("Error saving language:",a)}},[]),s=h.useCallback(i=>(zu[t]||zu.en)[i]||zu.en[i]||i,[t]);h.useEffect(()=>{typeof document<"u"&&(document.documentElement.lang=t)},[t]);const o=h.useMemo(()=>({language:t,setLanguage:n,t:s}),[t,n,s]);return p.jsx(b_.Provider,{value:o,children:e})}const WD=()=>{const e=h.useContext(b_);if(e===void 0)throw new Error("useLanguage must be used within a LanguageProvider");return e}
258,Xg={en:{name:"English",flag:"ðºð¸"},fr:{name:"Français",flag:"ð«ð·"},it:{name:"Italiano",flag:"ð®ð¹"},es:{name:"Español",flag:"ðªð¸"},de:{name:"Deutsch",flag:"ð©ðª"},pt:{name:"Português",flag:"ðµð¹"}},HD=()=>{const{language:e,setLanguage:t,t:r}=WD();return p.jsxs(zx,{children:[p.jsx(Bx,{asChild:!0,children:p.jsx(ze,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-lg hover:bg-accent/50 rounded-full",children:Xg[e].flag})}),p.jsx(qh,{align:"end",className:"w-40 bg-background border border-border shadow-lg z-[9999] min-w-[160px]",sideOffset:4,children:Object.entries(Xg).map(([n,{name:s,flag:o}])=>p.jsxs(Gh,{onClick:()=>t(n),className:`text-sm cursor-pointer hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground ${e===n?"bg-primary/10 text-primary":""}`,children:[p.jsx("span",{className:"mr-2",children:o}),s]},n))})]})},VD=()=>{var x,y,w,b,_,S;const e=jn();et();const[t,r]=h.useState(null),[n,s]=h.useState(!0),[o,i]=h.useState(!1),[a,l]=h.useState(null),[c,u]=h.useState(null),[f,d]=h.useState(!1);h.useEffect(()=>{const k=async N=>{try{const{data:P}=await G.from("profiles").select("avatar_url, display_name").eq("user_id",N).maybeSingle();l((P==null?void 0:P.avatar_url)||null),u((P==null?void 0:P.display_name)||null)}catch{}};(async()=>{const{data:{session:N}}=await G.auth.getSession(),P=(N==null?void 0:N.user)||null;r(P),P!=null&&P.id&&k(P.id),s(!1)})();const{data:{subscription:T}}=G.auth.onAuthStateChange((N,P)=>{const O=(P==null?void 0:P.user)||null;r(O),O!=null&&O.id?k(O.id):(l(null),u(null))});return()=>T.unsubscribe()},[]);const m=async()=>{try{await G.auth.signOut({scope:"global"}),e("/",{replace:!0})}catch{e("/",{replace:!0})}},v=a||((x=t==null?void 0:t.user_metadata)==null?void 0:x.avatar_url)||((y=t==null?void 0:t.user_metadata)==null?void 0:y.avatar)||((w=t==null?void 0:t.user_metadata)==null?void 0:w.picture)||null,g=((c==null?void 0:c[0])||((_=(b=t==null?void 0:t.user_metadata)==null?void 0:b.full_name)==null?void 0:_[0])||((S=t==null?void 0:t.email)==null?void 0:S[0])||"U").toUpperCase();return h.useEffect(()=>{const k=()=>i(E=>!E);return window.addEventListener("toggle-mobile-menu",k),()=>window.removeEventListener("toggle-mobile-menu",k)},[]),p.jsxs("nav",{className:"sticky top-0 z-50 bg-background/95 backdrop-blur-xl border-b border-border/50 shadow-lg shadow-primary/5 pointer-events-auto",children:[p.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3 sm:py-4 flex items-center gap-2 sm:gap-4",children:[p.jsx("div",{className:"flex items-center flex-shrink-0",children:p.jsx(ze,{variant:"ghost",size:"icon","aria-label":"Open menu",className:"h-10 w-10 rounded-lg hover:bg-accent/50 transition-all duration-200 hover:scale-105",onClick:()=>i(k=>!k),children:p.jsx(Dk,{className:"h-5 w-5"})})}),p.jsx("div",{className:"flex-1 min-w-0 max-w-sm sm:max-w-md lg:max-w-xl mx-2 sm:mx-4",children:p.jsx("div",{className:"relative",children:p.jsxs(ze,{variant:"ghost",onClick:()=>d(!0),className:"w-full h-10 justify-start gap-3 bg-accent/30 hover:bg-accent/50 border border-border/30 rounded-full px-4 transition-all duration-200",children:[p.jsx(Bk,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),p.jsx("span",{className:"text-muted-foreground font-normal truncate hidden sm:inline",children:"Search users..."}),p.jsx("span",{className:"text-muted-foreground font-normal truncate sm:hidden",children:"Search..."})]})})}),p.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 flex-shrink-0",children:[p.jsx(HD,{}),p.jsx(QL,{}),t&&!n&&p.jsx(vr,{to:`/u/${t.id}`,"aria-label":"Open profile",className:"rounded-full focus:outline-none focus:ring-2 focus:ring-primary/50 transition-transform hover:scale-105",children:p.jsxs(hc,{className:"h-9 w-9 ring-1 ring-border hover:ring-primary/30 transition-colors",children:[p.jsx(pc,{src:v||void 0,alt:"User profile avatar",loading:"lazy",decoding:"async"}),p.jsx(mc,{className:"text-xs",children:g})]})})]})]}),p.jsx(FD,{open:f,onOpenChange:d}),o&&p.jsx("div",{className:"border-t border-border/50 bg-background/95 backdrop-blur-xl relative z-50",children:p.jsxs("div",{className:"px-4 py-6 space-y-4",children:[p.jsx(vr,{to:"/",className:"block text-foreground hover:text-primary transition-colors font-medium",onClick:()=>i(!1),children:"Home"}),t?p.jsxs(p.Fragment,{children:[p.jsx(vr,{to:`/u/${t.id}`,className:"block text-foreground hover:text-primary transition-colors font-medium",onClick:()=>i(!1),children:"Profile"}),p.jsx(vr,{to:"/settings",className:"block text-foreground hover:text-primary transition-colors font-medium",onClick:()=>i(!1),children:"Settings"}),p.jsx("button",{onClick:()=>{i(!1),m()},className:"block text-left text-foreground hover:text-primary transition-colors font-medium",children:"Log out"})]}):p.jsx("button",{onClick:()=>{i(!1),e("/login")},className:"block text-left text-foreground hover:text-primary transition-colors font-medium",children:"Log in"})]})})]})},KD=({text:e,speed:t=100,className:r=""})=>{const[n,s]=h.useState(""),[o,i]=h.useState(0),[a,l]=h.useState(!0),[c,u]=h.useState(!1),[f,d]=h.useState(!1);return h.useEffect(()=>{s(""),i(0),u(!1),d(!1)},[e]),h.useEffect(()=>{if(f){const m=setTimeout(()=>{d(!1),n===e?u(!0):(u(!1),i(0))},2e3);return()=>clearTimeout(m)}if(!f){const m=setTimeout(()=>{c?n.length>0?s(v=>v.slice(0,-1)):(u(!1),i(0)):o<e.length?(s(v=>v+e[o]),i(v=>v+1)):d(!0)},c?t/2:t);return()=>clearTimeout(m)}},[o,e,t,c,f,n]),h.useEffect(()=>{const m=setInterval(()=>{l(v=>!v)},500);return()=>clearInterval(m)},[]),p.jsxs("span",{className:r,children:[n,p.jsx("span",{className:`inline-block w-0.5 h-4 bg-current ml-2 align-middle transition-opacity duration-300 ${a?"opacity-100":"opacity-0"}`,children:"|"})]})},qD=({onDismiss:e})=>{const[t,r]=h.useState(!1),n=()=>{r(!0),setTimeout(()=>{e()},500)};return p.jsx("div",{className:`absolute inset-0 z-50 bg-black/60 backdrop-blur-lg flex items-center justify-center transition-all duration-500 rounded-lg cursor-pointer ${t?"opacity-0 scale-95":"opacity-100 scale-100"}`,onClick:n,children:p.jsxs("div",{className:"text-center max-w-2xl mx-4 mt-8 md:mt-12 pb-8",children:[p.jsx("div",{className:"mb-4 mt-4",children:p.jsx("img",{src:"/lovable-uploads/9503cb95-7367-4bcf-94a8-bae4330b68b9.png",alt:"Biteverse - A social network that makes you better",className:"w-64 md:w-80 h-auto mx-auto drop-shadow-2xl object-contain relative z-10"})}),p.jsxs("div",{className:"-mt-12 md:-mt-16",children:[p.jsxs("h1",{className:"font-display text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold text-foreground leading-tight mb-8",children:["A social network that ",p.jsx("span",{className:"text-primary",children:"ACTUALLY"})," makes you ",p.jsx("span",{className:"text-primary",children:"SMARTER!"})]}),p.jsx("h2",{className:"text-2xl md:text-3xl lg:text-4xl font-hero text-white mb-4 tracking-tight",children:"Join thousands learning, sharing and connecting faster!"}),p.jsx("div",{className:"text-white/70 text-lg font-display tracking-wide mb-20 mt-4",children:p.jsx(KD,{text:"Click anyw
258here to begin",speed:80})})]})]})})},GD=()=>{const e=jn(),t=()=>{e("/login?mode=signup")};return p.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-r from-primary/20 via-accent/20 to-primary/20 border-b border-primary/20 backdrop-blur-sm",children:[p.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/10 via-transparent to-accent/10 animate-pulse"}),p.jsx("div",{className:"relative z-10 container mx-auto px-4 py-3",children:p.jsxs("div",{className:"flex flex-col items-center justify-center gap-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-2 h-2 bg-accent rounded-full animate-pulse"}),p.jsx("span",{className:"text-sm md:text-base font-medium text-foreground/90",children:"Become one of the first 10,000 founding members!"})]}),p.jsx(ze,{variant:"glow",size:"sm",onClick:t,className:"font-semibold text-sm px-6 py-2 whitespace-nowrap",children:"JOIN NOW"})]})})]})},YD=()=>p.jsxs("div",{className:"absolute inset-0 -z-10 pointer-events-none overflow-hidden",children:[p.jsx("div",{"aria-hidden":"true",className:"bg-grid-pattern grid-mask w-full h-full opacity-5 md:opacity-10 hidden sm:block"}),p.jsx("div",{className:"aurora-layer"}),p.jsx("div",{className:"aurora-layer aurora-two"}),p.jsx("div",{className:"aurora-layer aurora-three"})]}),JD=h.lazy(()=>lt(()=>import("./PodcastProcessor-Cnfi5M7T.js").then(e=>e.b),__vite__mapDeps([0,1,2,3,4,5,6,7]))),XD=()=>{const[e,t]=h.useState(null),[r,n]=h.useState(!0);return h.useEffect(()=>{(async()=>{const{data:{session:i}}=await G.auth.getSession();t((i==null?void 0:i.user)||null)})();const{data:{subscription:o}}=G.auth.onAuthStateChange((i,a)=>{t((a==null?void 0:a.user)||null)});return()=>o.unsubscribe()},[]),p.jsxs(p.Fragment,{children:[p.jsx(xO,{title:"Biteverse â Finally, a social network that makes you better",description:"AI-powered content platform that turns podcasts, videos and articles into insights and conversations.",canonicalPath:"/",jsonLd:{"@context":"https://schema.org","@type":"WebSite",name:"Biteverse",url:typeof window<"u"?`${window.location.protocol}//${window.location.host}`:"",potentialAction:{"@type":"SearchAction",target:`${typeof window<"u"?`${window.location.protocol}//${window.location.host}`:""}/?q={search_term_string}`,"query-input":"required name=search_term_string"}}}),p.jsx("div",{className:"fixed inset-0 bg-background z-0"}),p.jsx("div",{className:"fixed inset-0 bg-background z-10"}),p.jsx("div",{className:"fixed inset-0 bg-background opacity-100 z-20"}),p.jsx("div",{className:"fixed inset-0 bg-background opacity-100 z-25",style:{backgroundColor:"hsl(217, 32%, 8%)"}}),p.jsxs("div",{className:"relative z-30 min-h-screen bg-background overflow-hidden","data-route":"/",children:[p.jsx(YD,{}),p.jsx(GD,{}),p.jsx(VD,{}),p.jsxs("main",{className:"relative z-10 container mx-auto px-4 py-12 lg:py-20",children:[!r&&p.jsx("div",{className:"text-center space-y-6 mb-16 animate-fade-in",children:p.jsxs("div",{className:"space-y-8 max-w-5xl mx-auto",children:[p.jsxs("h1",{className:"font-display text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold text-foreground leading-tight",children:["Fuel your life, ",p.jsx("span",{className:"text-primary",children:"one episode at a time."})]}),p.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"Turn your favorite content into actionable steps to make life better."})]})}),p.jsxs("div",{className:"w-full max-w-5xl mx-auto relative",children:[p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute -inset-4 bg-gradient-radial from-primary/5 via-transparent to-transparent rounded-3xl blur-xl opacity-50"}),p.jsx("div",{className:"relative bg-card/50 backdrop-blur-sm border border-border/50 rounded-2xl p-2",children:p.jsx(h.Suspense,{fallback:p.jsx("div",{className:"border-2 border-primary/20 rounded-xl p-12 min-h-[400px] flex items-center justify-center w-full bg-card/30",children:p.jsx(Ba,{text:"Loading analyzer...",useVortex:!0,size:"lg"})}),children:p.jsx(JD,{user:e})})})]}),r&&p.jsx(qD,{onDismiss:()=>n(!1)}),!r&&p.jsxs("div",{className:"text-center mt-12 animate-fade-in space-y-6",children:[p.jsx("h2",{className:"text-xl md:text-2xl lg:text-3xl font-display font-bold text-foreground",children:"⨠Start by trying our AI summaries!"}),p.jsx("p",{className:"text-2xl md:text-3xl lg:text-4xl font-display font-bold text-foreground leading-relaxed max-w-4xl mx-auto",children:"Your move cost, predicted by AI"})]})]})]})]})]})},Dl=({className:e,size:t="md",text:r="Loading..."})=>{const n={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12"};return p.jsx("div",{className:U("min-h-screen bg-background flex items-center justify-center",e),children:p.jsxs("div",{className:"text-center space-y-3",children:[p.jsx("div",{className:U("border-2 border-primary border-t-transparent roun
258ded-full animate-spin mx-auto",n[t])}),p.jsx("p",{className:"text-muted-foreground",children:r})]})})},Qt=({text:e})=>p.jsx(Dl,{text:e}),K$=({text:e,className:t})=>p.jsxs("div",{className:U("py-8 text-center",t),children:[p.jsx("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin mx-auto mb-3"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:e||"Loading..."})]});function QD(){const e=document.head;["https://fonts.googleapis.com","https://fonts.gstatic.com","https://api.openai.com"].forEach(n=>{if(!document.querySelector(`link[href="${n}"]`)){const s=document.createElement("link");s.rel="dns-prefetch",s.href=n,e.appendChild(s)}}),["https://fonts.googleapis.com","https://fonts.gstatic.com"].forEach(n=>{if(!document.querySelector(`link[href="${n}"][rel="preconnect"]`)){const s=document.createElement("link");s.rel="preconnect",s.href=n,s.crossOrigin="anonymous",e.appendChild(s)}})}function ZD(){"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").then(e=>{console.log("SW registered: ",e)}).catch(e=>{console.log("SW registration failed: ",e)})})}function eM(e){h.useEffect(()=>{const{fonts:t=[],images:r=[],scripts:n=[],stylesheets:s=[]}=e;t.forEach(o=>{const i=document.createElement("link");i.rel="preload",i.as="font",i.type="font/woff2",i.crossOrigin="anonymous",i.href=o,document.head.appendChild(i)}),r.forEach(o=>{const i=document.createElement("link");i.rel="preload",i.as="image",i.href=o,document.head.appendChild(i)}),n.forEach(o=>{const i=document.createElement("link");i.rel="preload",i.as="script",i.href=o,document.head.appendChild(i)}),s.forEach(o=>{const i=document.createElement("link");i.rel="preload",i.as="style",i.href=o,document.head.appendChild(i)})},[])}function tM(){h.useEffect(()=>{const e=r=>{const n=document.createElement("link");n.rel="prefetch",n.href=r,document.head.appendChild(n)};["/#/podcast-analyzer","/#/social","/#/messages"].forEach(r=>{setTimeout(()=>e(r),1e3)})},[])}const x_=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:U("glow-card rounded-2xl border bg-card/60 text-card-foreground shadow-lg transition-shadow",e),...t}));x_.displayName="Card";const __=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:U("flex flex-col space-y-1.5 p-6",e),...t}));__.displayName="CardHeader";const S_=h.forwardRef(({className:e,...t},r)=>p.jsx("h3",{ref:r,className:U("text-2xl font-semibold leading-none tracking-tight",e),...t}));S_.displayName="CardTitle";const rM=h.forwardRef(({className:e,...t},r)=>p.jsx("p",{ref:r,className:U("text-sm text-muted-foreground",e),...t}));rM.displayName="CardDescription";const E_=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:U("p-6 pt-0",e),...t}));E_.displayName="CardContent";const nM=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:U("flex items-center p-6 pt-0",e),...t}));nM.displayName="CardFooter";class ba extends I.Component{constructor(r){super(r);Fn(this,"retryTimeoutId",null);Fn(this,"handleRetry",()=>{this.retryTimeoutId=window.setTimeout(()=>{this.setState({hasError:!1,error:null,errorInfo:null})},100)});this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var s,o;this.setState({error:r,errorInfo:n}),(o=(s=this.props).onError)==null||o.call(s,r,n),console.error("ErrorBoundary caught an error:",r,n),typeof window<"u"&&window.gtag&&window.gtag("event","exception",{description:r.toString(),fatal:!1})}componentWillUnmount(){this.retryTimeoutId&&clearTimeout(this.retryTimeoutId)}render(){if(this.state.hasError&&this.state.error){if(this.props.fallback){const r=this.props.fallback;return p.jsx(r,{error:this.state.error,retry:this.handleRetry})}return p.jsxs(x_,{className:"max-w-lg mx-auto mt-8 border-destructive/20",children:[p.jsxs(__,{className:"text-center",children:[p.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:p.jsx(qk,{className:"h-6 w-6 text-destructive"})}),p.jsx(S_,{className:"text-lg",children:"Something went wrong"})]}),p.jsxs(E_,{className:"space-y-4",children:[p.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"An unexpected error occurred. This has been logged and we'll look into it."}),!1,p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[p.jsxs(ze,{onClick:this.handleRetry,className:"flex-1",children:[p.jsx(Fk,{className:"mr-2 h-4 w-4"}),"Try Again"]}),p.jsx(ze,{variant:"outline",onClick:()=>window.location.reload(),className:"flex-1",children:"Reload Page"})]})]})]})}return this.props.children}}function sM(){const[e,t]=h.useState(null),[r,n]=h.useState(!0),{toast:s}=zs(),o=async()=>{var a;try{const{data:{user:l}}=await G.auth.getUser();if(!l)return;const[c,u,f,d,m]=await Promise.all([G.from("streak_state").select("*").eq("user_id",l.id).single(),G.from("user_stats").select("*").eq("user_id",l.id).single(),G.from("daily_activity").select("*").eq("user_id",l.id).order("date",{ascending:!1}).limit(90),G.from("user_badges").select(` 259 badge_id, 260 awarded_at, 261 badges (id, name, description, icon) 262 `).eq("user_id",l.id),G.from("badges").select("*").order("threshold_number")]),v=((a=d.data)==null?void 0:a.map(g=>({...g.badges,awarded_at:g.awarded_at})))||[];t({streakState:c.data,userStats:u.data?{...u.data,by_category:u.data.by_category}:null,dailyActivity:f.data||[],earnedBadges:v,allBadges:m.data||[]})}catch(l){console.error("Error loading growth data:",l),s({title:"Error loading growth data",description:"Please try refreshing the page",variant:"destructive"})}finally{n(!1)}},i=async a=>{try{console.log("ð [CLIENT] About to call track-digest function...");const{data:{user:l}}=await G.auth.getUser();console.log("ð [CLIENT] Current user:",l==null?void 0:l.id);const{data:c,error:u}=await G.functions.invoke("track-digest",{body:a});if(console.log("ð [CLIENT] Function response:",{data:c,error:u}),u)throw u;return await o(),{success:!0,milestones:c.milestones||[],streak:c.streak,todayCount:c.todayCount,newBadges:c.newBadges||[]}}catch(l){return console.error("Error tracking digest:",l),s({title:"Error tracking progress",description:"Your content was processed but progress tracking failed",variant:"destructive"}),{success:!1,milestones:[],streak:null,todayCount:0,newBadges:[]}}};return h.useEffect(()=>{o()},[]),{growthData:e,loading:r,trackDigest:i,refetch:o}}const oM=Ws("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function iM({className:e,variant:t,...r}){return p.jsx("div",{className:U(oM({variant:t}),e),...r})}function aM({isOpen:e,onClose:t,milestones:r,userProfile:n}){const[s,o]=h.useState(!1),{toast:i}=zs(),a=async l=>{var c;o(!0);try{let u="";if(l.type==="streak")u=`Just hit a ${l.value}-day learning streak! ð¥ Staying consistent with my growth journey.`;else if(l.type==="badge"){const d=l.badges.map(m=>m.name).join(", ");u=`Unlocked new achievement${l.badges.length>
2621?"s":""}: ${d}! ð`}const{error:f}=await G.from("posts").insert({content:u,user_id:(c=(await G.auth.getUser()).data.user)==null?void 0:c.id});if(f)throw f;i({title:"Milestone shared!",description:"Your achievement has been shared to your feed."})}catch(u){console.error("Error sharing milestone:",u),i({title:"Error sharing",description:"Failed to share your milestone. Please try again.",variant:"destructive"})}finally{o(!1)}};return r.length===0?null:p.jsx(Pi,{open:e,onOpenChange:t,children:p.jsxs(Js,{className:"sm:max-w-md",children:[p.jsx(Xs,{children:p.jsxs(Qs,{className:"flex items-center gap-2 text-center",children:[p.jsx(Vk,{className:"h-5 w-5 text-yellow-500"}),"Congratulations!"]})}),p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"text-center space-y-4",children:r.map((l,c)=>p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"text-lg font-medium",children:l.message}),l.type==="badge"&&l.badges&&p.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:l.badges.map(u=>p.jsxs(iM,{variant:"secondary",className:"flex items-center gap-1 px-3 py-1",children:[p.jsx("span",{className:"text-lg",children:u.icon}),u.name]},u.id))}),l.type==="streak"&&p.jsx("div",{className:"text-4xl",children:"ð¥"})]},c))}),p.jsxs("div",{className:"flex gap-2 justify-center",children:[p.jsx(ze,{onClick:t,variant:"outline",children:"Continue"}),p.jsxs(ze,{onClick:()=>a(r[0]),disabled:s,className:"flex items-center gap-2",children:[p.jsx(Hk,{className:"h-4 w-4"}),"Share Achievement"]})]})]})]})})}function lM({children:e}){const{trackDigest:t}=sM(),[r,n]=h.useState([]),[s,o]=h.useState(!1),[i,a]=h.useState(null);return window.getLastGrowthResult=()=>i,window.trackDigestProgress=async l=>{try{const c=await t(l);return c.success&&(a(c),c.milestones&&c.milestones.length>0&&(n(c.milestones),o(!0))),c}catch(c){return console.error("Error tracking digest:",c),{success:!1,milestones:[],streak:null,todayCount:0,newBadges:[]}}},p.jsxs(p.Fragment,{children:[e,p.jsx(aM,{isOpen:s,onClose:()=>o(!1),milestones:r})]})}const cM=()=>{const e=et(),t=h.useRef(""),[r,n]=h.useState(null);return h.useEffect(()=>{G.auth.getSession().then(({data:s})=>{var o,i;return n(((i=(o=s.session)==null?void 0:o.user)==null?void 0:i.id)??null)}).catch(()=>n(null))},[]),h.useEffect(()=>{const s=e.pathname+e.search;t.current!==s&&(t.current=s,setTimeout(async()=>{try{await G.from("pageviews").insert({path:s,referrer:document.referrer||null,user_agent:navigator.userAgent,preview:localStorage.getItem("preview_access")==="true",user_id:r})}catch{}},0))},[e.pathname,e.search,r]),null},Bu=768;function uM(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Bu-1}px)`),n=()=>{t(window.innerWidth<Bu)};return r.addEventListener("change",n),t(window.innerWidth<Bu),()=>r.removeEventListener("change",n)},[]),!!e}var dM="Separator",Qg="horizontal",fM=["horizontal","vertical"],k_=h.forwardRef((e,t)=>{const{decorative:r,orientation:n=Qg,...s}=e,o=hM(n)?n:Qg,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return p.jsx(ee.div,{"data-orientation":o,...a,...s,ref:t})});k_.displayName=dM;function hM(e){return fM.includes(e)}var C_=k_;const T_=h.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>p.jsx(C_,{ref:s,decorative:r,orientation:t,className:U("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));T_.displayName=C_.displayName;const pM=m_,mM=g_,R_=h.forwardRef(({className:e,...t},r)=>p.jsx(Cc,{className:U("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));R_.displayName=Cc.displayName;const gM=Ws("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),P_=h.forwardRef(({side:e="right",className:t,children:r,...n},s)=>p.jsxs(mM,{children:[p.jsx(R_,{}),p.jsxs(Tc,{ref:s,className:U(gM({side:e}),t),...n,children:[r,p.jsxs(v_,{className:"absolute right-4 top-4 roun
262ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[p.jsx(gh,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));P_.displayName=Tc.displayName;const vM=h.forwardRef(({className:e,...t},r)=>p.jsx(Rc,{ref:r,className:U("text-lg font-semibold text-foreground",e),...t}));vM.displayName=Rc.displayName;const yM=h.forwardRef(({className:e,...t},r)=>p.jsx(Pc,{ref:r,className:U("text-sm text-muted-foreground",e),...t}));yM.displayName=Pc.displayName;function Zg({className:e,...t}){return p.jsx("div",{className:U("animate-pulse rounded-md bg-muted",e),...t})}function wM(e,t=[]){let r=[];function n(o,i){const a=h.createContext(i),l=r.length;r=[...r,i];const c=f=>{var y;const{scope:d,children:m,...v}=f,g=((y=d==null?void 0:d[e])==null?void 0:y[l])||a,x=h.useMemo(()=>v,Object.values(v));return p.jsx(g.Provider,{value:x,children:m})};c.displayName=o+"Provider";function u(f,d){var g;const m=((g=d==null?void 0:d[e])==null?void 0:g[l])||a,v=h.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,u]}const s=()=>{const o=r.map(i=>h.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,bM(s,...t)]}function bM(...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(o){const i=n.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function xM(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var A_=e=>{const{present:t,children:r}=e,n=_M(t),s=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),o=ae(n.ref,SM(s));return typeof r=="function"||n.isPresent?h.cloneElement(s,{ref:o}):null};A_.displayName="Presence";function _M(e){const[t,r]=h.useState(),n=h.useRef({}),s=h.useRef(e),o=h.useRef("none"),i=e?"mounted":"unmounted",[a,l]=xM(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=xa(n.current);o.current=a==="mounted"?c:"none"},[a]),Ye(()=>{const c=n.current,u=s.current;if(u!==e){const d=o.current,m=xa(c);e?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),Ye(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=m=>{const g=xa(n.current).includes(m.animationName);if(m.target===t&&g&&(l("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},d=m=>{m.target===t&&(o.current=xa(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function xa(e){return(e==null?void 0:e.animationName)||"none"}function SM(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[Ac,q$]=wM("Tooltip",[wc]),Nc=wc(),N_="TooltipProvider",EM=700,mf="tooltip.open",[kM,ep]=Ac(N_),O_=e=>{const{__scopeTooltip:t,delayDuration:r=EM,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=h.useState(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),p.jsx(kM,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:o})};O_.displayName=N_;var Oc="Tooltip",[CM,jc]=Ac(Oc),j_=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,l=ep(Oc,e.__scopeTooltip),c=Nc(t),[u,f]=h.useState(null),d=bn(),m=h.useRef(0),v=i??l.disableHoverableContent,g=a??l.delayDuration,x=h.useRef(!1),[y=!1,w]=_i({prop:n,defaultProp:s,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(mf))):l.onClose(),o==null||o(E)}}),b=h.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),_=h.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x.current=!1,w(!0)},[w]),S=h.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w(!1)},[w]),k=h.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,w(!0),m.current=0},g)},[g,w]);return h.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),p.jsx(kb,{...c,children:p.jsx(CM,{scope:t,contentId:d,open:y,stateAttribute:b,trigger:u,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{l.isOpenDelayed?k():_()},[l.isOpenDelayed,k,_]),onTriggerLeave:h.useCallback(()=>{v?S():(window.clearTimeout(m.current),m.current=0)},[S,v]),onOpen:_,onClose:S,disableHoverableContent:v,children:r})})};
vendor: 5,635 bytes, line 262
262j_.displayName=Oc;var gf="TooltipTrigger",I_=h.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=jc(gf,r),o=ep(gf,r),i=Nc(r),a=h.useRef(null),l=ae(t,a,s.onTriggerChange),c=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>c.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),p.jsx(Cb,{asChild:!0,...i,children:p.jsx(ee.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:W(e.onPointerMove,d=>{d.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:W(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:W(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:W(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:W(e.onBlur,s.onClose),onClick:W(e.onClick,s.onClose)})})});I_.displayName=gf;var TM="TooltipPortal",[G$,RM]=Ac(TM,{forceMount:void 0}),Ls="TooltipContent",L_=h.forwardRef((e,t)=>{const r=RM(Ls,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=jc(Ls,e.__scopeTooltip);return p.jsx(A_,{present:n||i.open,children:i.disableHoverableContent?p.jsx(D_,{side:s,...o,ref:t}):p.jsx(PM,{side:s,...o,ref:t})})}),PM=h.forwardRef((e,t)=>{const r=jc(Ls,e.__scopeTooltip),n=ep(Ls,e.__scopeTooltip),s=h.useRef(null),o=ae(t,s),[i,a]=h.useState(null),{trigger:l,onClose:c}=r,u=s.current,{onPointerInTransitChange:f}=n,d=h.useCallback(()=>{a(null),f(!1)},[f]),m=h.useCallback((v,g)=>{const x=v.currentTarget,y={x:v.clientX,y:v.clientY},w=jM(y,x.getBoundingClientRect()),b=IM(y,w),_=LM(g.getBoundingClientRect()),S=MM([...b,..._]);a(S),f(!0)},[f]);return h.useEffect(()=>()=>d(),[d]),h.useEffect(()=>{if(l&&u){const v=x=>m(x,u),g=x=>m(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",g)}}},[l,u,m,d]),h.useEffect(()=>{if(i){const v=g=>{const x=g.target,y={x:g.clientX,y:g.clientY},w=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),b=!DM(y,i);w?d():b&&(d(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,i,c,d]),p.jsx(D_,{...e,ref:o})}),[AM,NM]=Ac(Oc,{isInside:!1}),D_=h.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=jc(Ls,r),c=Nc(r),{onClose:u}=l;return h.useEffect(()=>(document.addEventListener(mf,u),()=>document.removeEventListener(mf,u)),[u]),h.useEffect(()=>{if(l.trigger){const f=d=>{const m=d.target;m!=null&&m.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),p.jsx(Yh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:p.jsxs(Tb,{"data-state":l.stateAttribute,...c,...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:[p.jsx(pw,{children:n}),p.jsx(AM,{scope:r,isInside:!0,children:p.jsx(ck,{id:l.contentId,role:"tooltip",children:s||n})})]})})});L_.displayName=Ls;var M_="TooltipArrow",OM=h.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Nc(r);return NM(M_,r).isInside?null:p.jsx(Rb,{...s,...n,ref:t})});OM.displayName=M_;function jM(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function IM(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 LM(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 DM(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o].x,l=t[o].y,c=t[i].x,u=t[i].y;l>n!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(s=!s)}return s}function MM(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),$M(t)}function $M(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.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 o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.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 UM=O_,FM=j_,zM=I_,$_=L_;const BM=UM,WM=FM,HM=zM,U_=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx($_,{ref:n,sideOffset:t,className:U("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]:sli
262de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));U_.displayName=$_.displayName;const VM="sidebar:state",KM=60*60*24*7,qM="16rem",GM="18rem",YM="3rem",JM="b",F_=h.createContext(null);function Ai(){const e=h.useContext(F_);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const z_=h.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:o,...i},a)=>{const l=uM(),[c,u]=h.useState(!1),[f,d]=h.useState(e),m=t??f,v=h.useCallback(w=>{const b=typeof w=="function"?w(m):w;r?r(b):d(b),document.cookie=`${VM}=${b}; path=/; max-age=${KM}`},[r,m]),g=h.useCallback(()=>l?u(w=>!w):v(w=>!w),[l,v,u]);h.useEffect(()=>{const w=b=>{b.key===JM&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),g())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]);const x=m?"expanded":"collapsed",y=h.useMemo(()=>({state:x,open:m,setOpen:v,isMobile:l,openMobile:c,setOpenMobile:u,toggleSidebar:g}),[x,m,v,l,c,u,g]);return p.jsx(F_.Provider,{value:y,children:p.jsx(BM,{delayDuration:0,children:p.jsx("div",{style:{"--sidebar-width":qM,"--sidebar-width-icon":YM,...s},className:U("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:a,...i,children:o})})})});z_.displayName="SidebarProvider";const B_=h.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...o},i)=>{const{isMobile:a,state:l,openMobile:c,setOpenMobile:u}=Ai();return r==="none"?p.jsx("div",{className:U("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:i,...o,children:s}):a?p.jsx(pM,{open:c,onOpenChange:u,...o,children:p.jsx(P_,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":GM},side:e,children:p.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):p.jsxs("div",{ref:i,className:"group peer hidden md:block text-sidebar-foreground","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":t,"data-side":e,children:[p.jsx("div",{className:U("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),p.jsx("div",{className:U("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:p.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:s})})]})});B_.displayName="Sidebar";const XM=h.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:s}=Ai();return p.jsxs(ze,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:U("h-7 w-7",e),onClick:o=>{t==null||t(o),s()},...r,children:[p.jsx(Bw,{}),p.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});XM.displayName="SidebarTrigger";const QM=h.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=Ai();return p.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:U("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});QM.displayName="SidebarRail";const ZM=h.forwardRef(({className:e,...t},r)=>p.jsx("main",{ref:r,className:U("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
262h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));ZM.displayName="SidebarInset";const e$=h.forwardRef(({className:e,...t},r)=>p.jsx(Is,{ref:r,"data-sidebar":"input",className:U("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));e$.displayName="SidebarInput";const t$=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,"data-sidebar":"header",className:U("flex flex-col gap-2 p-2",e),...t}));t$.displayName="SidebarHeader";const r$=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,"data-sidebar":"footer",className:U("flex flex-col gap-2 p-2",e),...t}));r$.displayName="SidebarFooter";const n$=h.forwardRef(({className:e,...t},r)=>p.jsx(T_,{ref:r,"data-sidebar":"separator",className:U("mx-2 w-auto bg-sidebar-border",e),...t}));n$.displayName="SidebarSeparator";const W_=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,"data-sidebar":"content",className:U("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));W_.displayName="SidebarContent";const H_=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,"data-sidebar":"group",className:U("relative flex w-full min-w-0 flex-col p-2",e),...t}));H_.displayName="SidebarGroup";const V_=h.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?Pt:"div";return p.jsx(s,{ref:n,"data-sidebar":"group-label",className:U("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});V_.displayName="SidebarGroupLabel";const s$=h.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?Pt:"button";return p.jsx(s,{ref:n,"data-sidebar":"group-action",className:U("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});s$.displayName="SidebarGroupAction";const K_=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,"data-sidebar":"group-content",className:U("w-full text-sm",e),...t}));K_.displayName="SidebarGroupContent";const q_=h.forwardRef(({className:e,...t},r)=>p.jsx("ul",{ref:r,"data-sidebar":"menu",className:U("flex w-full min-w-0 flex-col gap-1",e),...t}));q_.displayName="SidebarMenu";const G_=h.forwardRef(({className:e,...t},r)=>p.jsx("li",{ref:r,"data-sidebar":"menu-item",className:U("group/menu-item relative",e),...t}));G_.displayName="SidebarMenuItem";const o$=Ws("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Y_=h.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:s,className:o,...i},a)=>{const l=e?Pt:"button",{isMobile:c,state:u}=Ai(),f=p.jsx(l,{ref:a,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:U(o$({variant:r,size:n}),o),...i});return s?(typeof s=="string"&&(s={children:s}),p.jsxs(WM,{children:[p.jsx(HM,{asChild:!0,children:f}),p.jsx(U_,{side:"right",align:"center",hidden:u!=="collapsed"||c,...s})]})):f});Y_.displayName="SidebarMenuButton";const i$=h.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},s)=>{const o=t?Pt:"button";return p.jsx(o,{ref:s,"data-sidebar":"menu-action",className:U("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});i$.displayName="SidebarMenuAction";const a$=h.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:U("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));a$.displayName="SidebarMenuBadge";const l$=h.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const s=h.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return p.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:U("roun
262ded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&p.jsx(Zg,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),p.jsx(Zg,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});l$.displayName="SidebarMenuSkeleton";const c$=h.forwardRef(({className:e,...t},r)=>p.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:U("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));c$.displayName="SidebarMenuSub";const u$=h.forwardRef(({...e},t)=>p.jsx("li",{ref:t,...e}));u$.displayName="SidebarMenuSubItem";const d$=h.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...s},o)=>{const i=e?Pt:"a";return p.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:U("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})});d$.displayName="SidebarMenuSubButton";const f$=[{title:"Home",url:"/",icon:Lk},{title:"Podcast Analyzer",url:"/podcast-analyzer",icon:_m,customIcon:"/lovable-uploads/a8ec14a5-d21a-43fe-8500-eb4e54a8a7ea.png"},{title:"YouTube Analyzer",url:"/youtube-analyzer",icon:_m},{title:"My Growth",url:"/growth",icon:Kk},{title:"Social",url:"/social",icon:Bw},{title:"Messages",url:"/messages",icon:$k,customIcon:"/lovable-uploads/0c47496d-8351-40da-a33b-2ecbb3262099.png?v=2"},{title:"Settings",url:"/settings",icon:Wk}];function h$(){const{state:e}=Ai(),t=e==="collapsed",r=et(),n=r.pathname,[s,o]=h.useState([]),i=h.useRef(new Set),[a,l]=h.useState(0);h.useEffect(()=>{i.current=new Set(s)},[s]),h.useEffect(()=>{(async()=>{var x;const{data:{session:f}}=await G.auth.getSession(),d=((x=f==null?void 0:f.user)==null?void 0:x.id)||null;if(!d)return;const{data:m}=await G.from("conversation_participants").select("conversation_id").eq("user_id",d),v=Array.from(new Set((m||[]).map(y=>y.conversation_id)));o(v);try{const y=parseInt(localStorage.getItem("dm_last_opened")||"0",10);if(v.length>0&&y>0){const{count:w}=await G.from("messages").select("id",{count:"exact",head:!0}).in("conversation_id",v).neq("sender_id",d).gt("created_at",new Date(y).toISOString());l(w||0)}else l(0)}catch{}const g=G.channel(`sidebar_dm_${d}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"messages"},y=>{const w=y.new;w&&w.sender_id!==d&&i.current.has(w.conversation_id)&&(r.pathname.startsWith("/messages")||l(b=>b+1))}).subscribe();return()=>{G.removeChannel(g)}})()},[]),h.useEffect(()=>{r.pathname.startsWith("/messages")&&(localStorage.setItem("dm_last_opened",String(Date.now())),a!==0&&l(0))},[r.pathname,a]);const c=u=>n===u;return p.jsx(B_,{collapsible:"icon",className:"data-[state=collapsed]:w-14",children:p.jsx(W_,{children:p.jsxs(H_,{children:[p.jsx(V_,{children:"Main"}),p.jsx(K_,{children:p.jsx(q_,{children:f$.map(u=>p.jsx(G_,{children:p.jsx(Y_,{asChild:!0,isActive:c(u.url),children:p.jsxs(y0,{to:u.url,end:!0,"aria-label":u.title,children:[p.jsxs("span",{className:"relative mr-2 inline-block",children:["customIcon"in u&&u.customIcon?p.jsx("img",{src:u.customIcon,alt:`${u.title} icon`,className:"h-4 w-4 object-contain",loading:"lazy",decoding:"async"}):p.jsx(u.icon,{className:"h-4 w-4"}),u.title==="Messages"&&a>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"absolute -top-2 -right-2 h-5 min-w-5 px-1.5 rounded-full bg-accent text-accent-foreground ring-2 ring-background text-[10px] font-bold leading-none flex items-center justify-center shadow-[0_0_12px] shadow-accent/60",children:a>99?"99+":a}),p.jsx("span",{className:"absolute -top-2 -right-2 h-5 min-w-5 rounded-full bg-accent/50 blur-md animate-pulse","aria-hidden":"true"})]})]}),!t&&p.jsx("span",{children:u.title})]})})},u.title))})})]})})})}class xn{static preloadImage(t,r=!1){if(this.preloadedAssets.has(t))return Promise.resolve();if(this.loadingPromises.has(t))return this.loadingPromises.get(t);const n=new Promise((s,o)=>{const i=new Image;if(i.onload=()=>{this.preloadedAssets.add(t),s()},i.onerror=()=>{console.warn(`Failed to preload image: ${t}`),s()},r){const a=document.createElement("link");a.rel="preload",a.as="image",a.href=t,document.head.appendChild(a)}i.src=t});return this.loadingPromises.set(t,n),n.finally(()=>{this.loadingPromises.delete(t)}),n}static preloadCriticalAssets(){return Promise.allSettled(this.criticalAssets.map(t=>this.preloadImage(t,!0)))}static preloadFont(t,r="font/woff2"){const n=document.createElement("link");n.rel="preload",n.as="font",n.type=r,n.crossOrigin="anonymous",n.href=t,document.head.appendChild(n)}static isPreloaded(t){return this.preloadedAssets.has(t)}static preloadAsset(t){this.criticalAssets.includes(t)||this.criticalAssets.push(t),this.preloadImage(t,!1)}static cleanup(){this.preloadedAssets.clear(),this.loadingPromises.clear()}}Fn(xn,"preloadedAssets",new Set),Fn(xn,"loadingPromises",new Map),Fn(xn,"criticalAssets",["/lovable-uploads/54642478-74d2-44ca-aaa4-4a285bfcc3d4.png","/lovable-uploads/62e4c357-8f11-4359-bd8f-df9840446c86.png","/lovable-uploads/7171442a-f7b3-40a4-ab04-a93479b98a4d.png","/lovable-uploads/c60b2878-9849-47f8-a459-8e4b7d1f38c4.png","/lovable-uploads/70a41308-6099-409f-9a98-70fe7cdb02ab.png","/lovable-uploads/264c5693-d8d0-49e9-ba8f-508479d68345.png","/lovable-uploads/498014ef-b45c-4c87-83ab-4534b5666aeb.png","/lovable-uploads/25ef01e7-7490-4b2d-aae3-0195446d28a3.png","/lovable-uploads/f6b09d89-87dc-4188-b7fa-f56dbd4988dd.png"]);typeof window<"u"&&("requestIdleCallback"in window?requestIdleCallback(()=>{xn.preloadCriticalAssets()}):setTimeout(()=>{xn.preloadCriticalAssets()},100));const Va=I.memo(({src:e,alt:t,width:r,height:n,fallback:s="/placeholder.svg",className:o,priority:i=!1,...a})=>{const[l,c]=h.useState(()=>xn.isPreloaded(e)),[u,f]=h.useState(!1),[d,m]=h.useState(!1),v=h.useRef(null);h.useEffect(()=>{if(i){m(!0);return}const b=new IntersectionObserver(([_])=>{_.isIntersecting&&(m(!0),b.disconnect())},{rootMargin:"50px",threshold:.1});return v.current&&b.observe(v.current),()=>b.disconnect()},[i]),h.useEffect(()=>{d&&!l&&!u&&xn.preloadImage(e,i).then(()=>c(!0)).catch(()=>f(!0))},[d,e,i,l,u]);const g=h.useCallback(()=>{c(!0),f(!1)},[]),x=h.useCallback(()=>{f(!0),c(!1)},[]),y=d||i,w=u?s:e;return p.jsxs("div",{ref:v,className:U("relative overflow-hidden",!l&&"bg-muted animate-pulse",o),style:{width:r,height:n},children:[y&&p.jsx("img",{...a,src:w,alt:t,className:U("transition-all duration-300 ease-out",l?"opacity-100 scale-100":"opacity-0 scale-105","w-full h-full object-cover"),onLoad:g,onError:x,loading:i?"eager":"lazy",decoding:"async"}),!l&&!u&&p.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-muted via-muted/50 to-muted animate-pulse"})]})});Va.displayName="OptimizedImage";const p$=()=>{const[e,t]=h.useState(null),[r,n]=h.useState([]),s=h.useRef(new Set),[o,i]=h.useState(0),a=et(),l=jn();return eM({images:["/lovable-uploads/0bbfcc5e-62e9-424a-98a2-d4eebf4740ce.png","/lovable-uploads/92138d17-cc44-47c7-b9f9-5fd8738e51f5.png","/lovable-uploads/1e35bc6e-e7e5-4c62-8578-978c1337f3e3.png"]}),h.useEffect(()=>
262{s.current=new Set(r)},[r]),h.useEffect(()=>{(async()=>{var u;try{const{data:{session:f}}=await G.auth.getSession(),d=((u=f==null?void 0:f.user)==null?void 0:u.id)||null;if(t(d),!d)return;const{data:m}=await G.from("conversation_participants").select("conversation_id").eq("user_id",d),v=Array.from(new Set((m||[]).map(x=>x.conversation_id)));n(v);try{const x=parseInt(localStorage.getItem("dm_last_opened")||"0",10);if(v.length>0&&x>0){const{count:y}=await G.from("messages").select("id",{count:"exact",head:!0}).in("conversation_id",v).neq("sender_id",d).gt("created_at",new Date(x).toISOString());i(y||0)}else i(0)}catch{i(0)}const g=G.channel(`bottombar_dm_${d}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"messages"},x=>{const y=x.new;y&&y.sender_id!==d&&s.current.has(y.conversation_id)&&(a.pathname.startsWith("/messages")||i(w=>w+1))}).subscribe();return()=>{G.removeChannel(g)}}catch{}})()},[]),h.useEffect(()=>{a.pathname.startsWith("/messages")&&(localStorage.setItem("dm_last_opened",String(Date.now())),o!==0&&i(0))},[a.pathname,o]),p.jsx("nav",{className:"fixed bottom-0 inset-x-0 z-[100] bg-background/95 backdrop-blur-xl border-t border-border/50 pointer-events-auto",children:p.jsx("div",{className:"w-full mx-auto px-8 py-3",style:{paddingBottom:"env(safe-area-inset-bottom)"},children:p.jsxs("div",{className:"flex items-center justify-between w-full max-w-md mx-auto gap-16",children:[p.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",children:p.jsxs("div",{role:"button","aria-label":"Open messages",className:"relative inline-block",onClick:()=>{localStorage.setItem("dm_last_opened",String(Date.now())),i(0),l(e?"/messages":"/login")},children:[p.jsx(ze,{size:"icon",variant:"ghost",className:"h-14 w-14 p-0 bg-transparent hover:bg-accent/10 text-foreground rounded-full ring-0 shadow-none transition-all duration-200 mt-1",children:p.jsx(Va,{src:"/lovable-uploads/0bbfcc5e-62e9-424a-98a2-d4eebf4740ce.png",alt:"Open messages",className:"h-14 w-14 object-contain",priority:!0})}),e&&o>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"absolute -top-1 -right-1 h-5 min-w-5 px-1.5 rounded-full bg-accent text-accent-foreground ring-2 ring-background text-[10px] font-bold leading-none flex items-center justify-center shadow-lg z-10",children:o>99?"99+":o}),p.jsx("span",{className:"absolute -top-1 -right-1 h-5 min-w-5 rounded-full bg-accent/30 blur-sm animate-pulse","aria-hidden":"true"})]})]})}),p.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",children:p.jsx(Va,{src:"/lovable-uploads/92138d17-cc44-47c7-b9f9-5fd8738e51f5.png",alt:"Upload and analyze podcast",className:"h-24 w-24 object-contain cursor-pointer hover:scale-105 transition-all duration-200",priority:!0,onClick:()=>{if(a.pathname==="/podcast-analyzer"){const c=document.getElementById("processor");c&&c.scrollIntoView({behavior:"smooth",block:"start"})}else l("/podcast-analyzer")}})}),p.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",children:p.jsx(ze,{size:"icon",variant:"ghost","aria-label":"Open Biteverse",className:"h-14 w-14 p-0 bg-transparent hover:bg-accent/10 text-foreground rounded-full ring-0 shadow-none transition-all duration-200",onClick:()=>l("/social"),children:p.jsx(Va,{src:"/lovable-uploads/1e35bc6e-e7e5-4c62-8578-978c1337f3e3.png",alt:"Open Biteverse",className:"h-14 w-14 object-contain",priority:!0})})})]})})})},m$=({open:e,onAccept:t,onDecline:r,accepting:n})=>p.jsx(Pi,{open:e,onOpenChange:s=>!s&&r(),children:p.jsxs(Js,{className:"max-w-2xl max-h-[85vh] overflow-y-auto bg-popover z-[130]",children:[p.jsxs(Xs,{children:[p.jsx(Qs,{children:"Welcome to Biteverse!"}),p.jsx(w_,{children:"Please review and accept our Terms of Service and Privacy Policy to continue."})]}),p.jsx("div",{className:"space-y-4",children:p.jsxs("div",{className:"bg-secondary/20 p-4 rounded-lg",children:[p.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["By continuing, you agree to our"," ",p.jsx(vr,{to:"/terms",target:"_blank",className:"text-primary hover:underline",children:"Terms of Service"})," ","and"," ",p.jsx(vr,{to:"/privacy",target:"_blank",className:"text-primary hover:underline",children:"Privacy Policy"}),"."]}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"We're committed to protecting your privacy and providing a transparent service."})]})}),p.jsxs("div",{className:"flex gap-2 justify-end mt-6",children:[p.jsx(ze,{variant:"outline",onClick:r,disabled:n,children:"Decline"}),p.jsx(ze,{onClick:t,disabled:n,children:n?"Accepting...":"Accept & Continue"})]})]})});var g$="Label",J_=h.forwardRef((e,t)=>
262p.jsx(ee.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())}}));J_.displayName=g$;var X_=J_;const v$=Ws("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 font-grotesk"),Ml=h.forwardRef(({className:e,...t},r)=>p.jsx(X_,{ref:r,className:U(v$(),e),...t}));Ml.displayName=X_.displayName;function y$({user:e,open:t,onComplete:r}){const[n,s]=h.useState(""),[o,i]=h.useState(""),[a,l]=h.useState(!1),[c,u]=h.useState(null),{toast:f}=zs(),d=async g=>{if(!g||g.length<3){u(null);return}try{const{data:x,error:y}=await G.from("profiles").select("username").eq("username",g.toLowerCase()).maybeSingle();if(y&&y.code!=="PGRST116"){console.error("Error checking username:",y);return}u(!x)}catch(x){console.error("Username availability check failed:",x)}},m=g=>{const x=g.toLowerCase().replace(/[^a-z0-9_]/g,"");s(x);const y=setTimeout(()=>d(x),300);return()=>clearTimeout(y)},v=async g=>{if(g.preventDefault(),!n.trim()||!o.trim()){f({title:"Required fields",description:"Both username and display name are required.",variant:"destructive"});return}if(c===!1){f({title:"Username taken",description:"Please choose a different username.",variant:"destructive"});return}l(!0);try{const{error:x}=await G.from("profiles").update({username:n.toLowerCase(),display_name:o.trim()}).eq("user_id",e.id);if(x)throw x;f({title:"Profile updated!",description:"Your username has been set."}),r()}catch(x){console.error("Error setting username:",x),f({title:"Error",description:x.message||"Failed to set username",variant:"destructive"})}finally{l(!1)}};return p.jsx(Pi,{open:t,onOpenChange:()=>{},children:p.jsxs(Js,{className:"max-w-md bg-popover z-[140]",children:[p.jsx(Xs,{children:p.jsx(Qs,{children:"Choose Your Username"})}),p.jsxs("form",{onSubmit:v,className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(Ml,{htmlFor:"display-name",children:"Display Name"}),p.jsx(Is,{id:"display-name",value:o,onChange:g=>i(g.target.value),placeholder:"Your display name",maxLength:50,required:!0})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(Ml,{htmlFor:"username",children:"Username"}),p.jsx(Is,{id:"username",value:n,onChange:g=>m(g.target.value),placeholder:"username",maxLength:30,required:!0}),n.length>=3&&p.jsxs("p",{className:`text-sm ${c===!0?"text-green-600":c===!1?"text-red-600":"text-muted-foreground"}`,children:[c===!0&&"â Username available",c===!1&&"â Username taken",c===null&&"Checking availability..."]})]}),p.jsx(ze,{type:"submit",className:"w-full",disabled:a||!n||!o||c===!1,children:a?"Setting up...":"Continue"})]})]})})}const w$=[{id:"podcaster",title:"Podcaster",description:"I create podcast content",icon:Uk,color:"bg-blue-500/10 text-blue-500 border-blue-500/20"},{id:"youtuber",title:"YouTuber",description:"I create video content on YouTube",icon:Yk,color:"bg-red-500/10 text-red-500 border-red-500/20"},{id:"article_creator",title:"Writer/Blogger",description:"I write articles and blog posts",icon:Ik,color:"bg-green-500/10 text-green-500 border-green-500/20"},{id:"user",title:"Content Consumer",description:"I primarily consume and discover content",icon:Gk,color:"bg-purple-500/10 text-purple-500 border-purple-500/20"}];function b$({user:e,open:t,onComplete:r}){const[n,s]=h.useState(null),[o,i]=h.useState(""),[a,l]=h.useState(!1),{toast:c}=zs(),u=async()=>{if(!n){c({title:"Selection required",description:"Please select your creator type.",variant:"destructive"});return}l(!0);try{const d={creator_type:n};o.trim()&&(d.creator_channel_url=o.trim());const{error:m}=await G.from("profiles").update(d).eq("user_id",e.id);if(m)throw m;c({title:"Profile updated!",description:"Your creator type has been set."}),r()}catch(d){console.error("Error setting creator type:",d),c({title:"Error",description:d.message||"Failed to set creator type",variant:"destructive"})}finally{l(!1)}},f=n==="youtuber"||n==="podcaster";return p.jsx(Pi,{open:t,onOpenChange:()=>{},children:p.jsxs(Js,{className:"max-w-2xl bg-popover z-[140]",children:[p.jsx(Xs,{children:p.jsx(Qs,{children:"What type of creator are you?"})}),p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:w$.map(d=>{const m=d.icon;return p.jsx("button",{onClick:()=>s(d.id),className:`p-4 text-left border rounded-lg transition-all hover:shadow-md ${n===d.id?`${d.color} border-current shadow-md`:"border-muted hover:border-muted-foreground
262/30"}`,children:p.jsxs("div",{className:"flex items-start space-x-3",children:[p.jsx(m,{className:"w-6 h-6 mt-1"}),p.jsxs("div",{children:[p.jsx("h3",{className:"font-semibold",children:d.title}),p.jsx("p",{className:"text-sm text-muted-foreground",children:d.description})]})]})},d.id)})}),f&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs(Ml,{htmlFor:"channel-url",children:[n==="youtuber"?"YouTube Channel URL":"Podcast URL"," (optional)"]}),p.jsx(Is,{id:"channel-url",value:o,onChange:d=>i(d.target.value),placeholder:n==="youtuber"?"https://youtube.com/@yourchannel":"https://your-podcast-url.com"})]}),p.jsx(ze,{onClick:u,className:"w-full",disabled:a||!n,children:a?"Setting up...":"Complete Setup"})]})]})})}const ev="v2-2025-08-10";function x$({user:e,onComplete:t}){const[r,n]=h.useState("checking"),[s,o]=h.useState(!1),{toast:i}=zs();h.useEffect(()=>{a()},[e]);const a=async()=>{if(e)try{console.log("SetupFlow: Checking setup status for user:",e.id);const{data:d,error:m}=await G.from("profiles").select("terms_accepted_at, terms_version, username, display_name, creator_type").eq("user_id",e.id).maybeSingle();if(m&&m.code!=="PGRST116"){console.error("Error checking profile:",m),n("terms");return}console.log("SetupFlow: Profile data:",d);const v=(d==null?void 0:d.terms_accepted_at)&&(d==null?void 0:d.terms_version)===ev,g=(d==null?void 0:d.username)&&(d==null?void 0:d.display_name),x=d==null?void 0:d.creator_type;console.log("SetupFlow: Status check:",{termsAccepted:v,hasUsername:g,hasCreatorType:x}),v?g?x?(n("complete"),t()):n("creator-type"):n("username"):n("terms")}catch(d){console.error("Setup status check failed:",d),n("terms")}},l=async()=>{o(!0);try{console.log("SetupFlow: Accepting terms for user:",e.id);const{error:d}=await G.from("profiles").update({terms_accepted_at:new Date().toISOString(),terms_version:ev}).eq("user_id",e.id);if(d)throw d;i({title:"Welcome to Biteverse!",description:"Let's set up your profile."}),n("username")}catch(d){console.error("Error accepting terms:",d),i({title:"Error",description:d.message||"Failed to accept terms",variant:"destructive"})}finally{o(!1)}},c=async()=>{try{await G.auth.signOut(),window.location.href="/login"}catch(d){console.error("Error signing out:",d),window.location.href="/login"}},u=()=>{console.log("SetupFlow: Username set, moving to creator type"),i({title:"Great!",description:"Now let's set your creator type."}),n("creator-type")},f=()=>{console.log("SetupFlow: Creator type set, setup complete!"),i({title:"Setup Complete!",description:"Welcome to Biteverse!"}),n("complete"),t()};return r==="checking"?p.jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-background",children:p.jsxs("div",{className:"text-center space-y-4",children:[p.jsx(Dl,{size:"lg"}),p.jsx("p",{className:"text-muted-foreground",children:"Setting up your profile..."})]})}):p.jsxs("div",{className:"flex min-h-screen w-full items-center justify-center bg-background",children:[p.jsxs("div",{className:"text-center space-y-4",children:[p.jsx(Dl,{size:"lg"}),p.jsx("p",{className:"text-muted-foreground",children:"Completing your profile setup..."}),p.jsxs("div",{className:"flex justify-center space-x-2 mt-8",children:[p.jsx("div",{className:`w-3 h-3 rounded-full ${r==="terms"?"bg-primary":"bg-primary/30"}`}),p.jsx("div",{className:`w-3 h-3 rounded-full ${r==="username"?"bg-primary":"bg-primary/30"}`}),p.jsx("div",{className:`w-3 h-3 rounded-full ${r==="creator-type"?"bg-primary":"bg-primary/30"}`})]})]}),p.jsx(m$,{open:r==="terms",onAccept:l,onDecline:c,accepting:s}),p.jsx(y$,{user:e,open:r==="username",onComplete:u}),p.jsx(b$,{user:e,open:r==="creator-type",onComplete:f})]})}function Or({children:e}){const[t,r]=h.useState(null),[n,s]=h.useState(!1),[o,i]=h.useState(!0),a=jn();h.useEffect(()=>{const c=async()=>{try{const{data:{session:f}}=await G.auth.getSession();if(!(f!=null&&f.user)){a("/login",{replace:!0});return}r(f.user)}catch(f){console.error("Auth check failed:",f),a("/login",{replace:!0})}finally{i(!1)}},{data:{subscription:u}}=G.auth.onAuthStateChange((f,d)=>{if(!(d!=null&&d.user)){a("/login",{replace:!0});return}r(d.user),i(!1)});return c(),()=>u.unsubscribe()},[a]);const l=()=>{console.log("AppLayout: Setup completed!"),s(!0)};return o?p.jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-background",children:p.jsx(Dl,{size:"lg"})}):t?n?p.jsx(z_,{children:p.jsxs("div",{className:"flex min-h-screen w-full",children:[p.jsx(h$,{}),p.jsx("main",{className:"flex-1 min-w-0 pb-24 pt-20",children:e}),p.jsx(p$,{})]})}):p.jsx(x$,{user:t,onComplete:l}):null}const Q_=h.memo(()=>(h.useEffect(()=>{const e=()=>{const o=document.createElement("style");o.textContent=` 263 @font-face { 264 font-family: 'Inter'; 265 font-display: swap; 266 } 267 @font-face { 268 font-family: 'Poppins'; 269 font-display: swap; 270 } 271 @font-face { 272 font-family: 'Playfair Display'; 273 font-display: swap; 274 } 275 `,document.head.appendChild(o)},t=()=>{document.querySelectorAll("img:not([loading])").forEach(i=>
275{i.getAttribute("loading")||i.setAttribute("loading","lazy")})},r=()=>{document.querySelectorAll("img:not([width]):not([height])").forEach(i=>{const a=i.parentElement;a&&!a.style.aspectRatio&&(a.style.aspectRatio="16 / 9")})},n=()=>{document.querySelectorAll("[data-scroll-optimize]").forEach(i=>{i.style.willChange="transform"})};e(),setTimeout(()=>{t(),r(),n()},100);const s=new MutationObserver(()=>{t(),r()});return s.observe(document.body,{childList:!0,subtree:!0}),()=>{s.disconnect()}},[]),null));Q_.displayName="PerformanceOptimizer";const _$=h.lazy(()=>lt(()=>import("./Login-CZ2iz0eb.js"),[])),S$=h.lazy(()=>lt(()=>import("./Dashboard-LcRdtOKC.js"),__vite__mapDeps([8,0,1,2,3,4,5,6,7]))),E$=h.lazy(()=>lt(()=>import("./NotFound-CEk1sbBn.js"),[])),k$=h.lazy(()=>lt(()=>import("./Social-DG2Wt2Ek.js"),__vite__mapDeps([9,10,1,11,4,6,7,2,5,12]))),C$=h.lazy(()=>lt(()=>import("./UserProfile-CpdOuwVQ.js"),__vite__mapDeps([13,1,10,11,4,6,7]))),T$=h.lazy(()=>lt(()=>import("./Messages-Cul09wWW.js"),[])),R$=h.lazy(()=>lt(()=>import("./MessageThread-Nnjn1fT8.js"),__vite__mapDeps([14,15,6]))),P$=h.lazy(()=>lt(()=>import("./Settings-BxECdJvg.js"),__vite__mapDeps([16,2,4,11]))),A$=h.lazy(()=>lt(()=>import("./Terms-BIoRoDCN.js"),[])),N$=h.lazy(()=>lt(()=>import("./Privacy-BmPBPcr-.js"),[])),O$=h.lazy(()=>lt(()=>import("./YouTubeAnalyzer-2LEvL1DO.js"),__vite__mapDeps([17,1,3,18]))),j$=h.lazy(()=>lt(()=>import("./Growth-D2X2e7Dx.js"),__vite__mapDeps([19,3,12,18]))),I$=h.lazy(()=>lt(()=>import("./Manifesto-1F7vlDVS.js"),__vite__mapDeps([20,15]))),L$=()=>(h.useEffect(()=>{QD(),ZD();const e=document.createElement("link");e.rel="preload",e.as="font",e.type="font/woff2",e.crossOrigin="anonymous",e.href="https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2",document.head.appendChild(e)},[]),tM(),p.jsx("div",{className:"relative min-h-screen",children:p.jsx(AR,{children:p.jsxs(lM,{children:[p.jsx(Q_,{}),p.jsx(NC,{}),p.jsx(iT,{}),p.jsx(cM,{}),p.jsxs(iR,{children:[p.jsx(Ve,{path:"/",element:p.jsx(XD,{})}),p.jsx(Ve,{path:"/login",element:p.jsx(ba,{children:p.jsx(h.Suspense,{fallback:p.jsx(Ba,{text:"Loading login..."}),children:p.jsx(_$,{})})})}),p.jsx(Ve,{path:"/podcast-analyzer",element:p.jsx(Or,{children:p.jsx(ba,{children:p.jsx(h.Suspense,{fallback:p.jsx(Ba,{text:"Loading analyzer...",useVortex:!0,size:"lg"}),children:p.jsx(S$,{})})})})}),p.jsx(Ve,{path:"/dashboard",element:p.jsx(sR,{to:"/podcast-analyzer",replace:!0})}),p.jsx(Ve,{path:"/social",element:p.jsx(Or,{children:p.jsx(ba,{children:p.jsx(h.Suspense,{fallback:p.jsx(Ba,{text:"Loading social feed..."}),children:p.jsx(k$,{})})})})}),p.jsx(Ve,{path:"/messages",element:p.jsx(Or,{children:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{text:"Loading messages..."}),children:p.jsx(T$,{})})})}),p.jsx(Ve,{path:"/messages/:id",element:p.jsx(Or,{children:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{text:"Loading conversation..."}),children:p.jsx(R$,{})})})}),p.jsx(Ve,{path:"/u/:id",element:p.jsx(Or,{children:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{text:"Loading profile..."}),children:p.jsx(C$,{})})})}),p.jsx(Ve,{path:"/settings",element:p.jsx(Or,{children:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{text:"Loading settings..."}),children:p.jsx(P$,{})})})}),p.jsx(Ve,{path:"/terms",element:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{}),children:p.jsx(A$,{})})}),p.jsx(Ve,{path:"/youtube-analyzer",element:p.jsx(Or,{children:p.jsx(ba,{children:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{text:"Loading YouTube analyzer..."}),children:p.jsx(O$,{})})})})}),p.jsx(Ve,{path:"/growth",element:p.jsx(Or,{children:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{text:"Loading growth tracker..."}),children:p.jsx(j$,{})})})}),p.jsx(Ve,{path:"/privacy",element:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{}),children:p.jsx(N$,{})})}),p.jsx(Ve,{path:"/manifesto",element:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{}),children:p.jsx(I$,{})})}),p.jsx(Ve,{path:"*",element:p.jsx(h.Suspense,{fallback:p.jsx(Qt,{}),children:p.jsx(E$,{})})})]})]})})})),Z_=document.getElementById("root");if(!Z_)throw new Error("Root element not found");console.log("Initializing React app...");try{hw(Z_).render(p.jsx(h.StrictMode,{children:p.jsx(ps,{children:p.jsx(BD,{children:p.jsx(L$,{})})})}))}catch(e){console.error("Failed to render React app:",e)}export{Mk as $,Wb as A,ze as B,x_ as C,Pi as D,zb as E,Nn as F,wc as G,Cb as H,Is as I,Bs as J,Mb as K,Ml as L,Pt as M,Ph as N,Tb as O,ee as P,Rb as Q,ec as R,xO as S,_i as T,kb as U,bn as V,U as W,WD as X,VD as Y,vr as Z,_e as _,et as a,Bk as a0,qk as a1,Ik as a2,V$ as a3,w_ as a4,T_ as a5,hc as a6,pc as a7,mc as a8,UD as a9,I as aA,ne as aB,sM as aC,Ba as aD,Kk as aE,xn as aF,Vk as aG,_O as aH,Gk as aI,KD as aJ,Yk as aK,lt as aL,Nb as aM,lI as aN,cI as aO,U$ as aa,Nk as ab,gh as ac,XL as ad,zk as ae,Va as af,zx as ag,Bx as ah,qh as ai,Gh as aj,Bg as ak,Qt as al,K$ as am,Hj as an,B1 as ao,dh as ap,Fs as aq,rc as ar,rb as as,BM as at,WM as au,HM as av,U_ as aw,M$ as ax,Ds as ay,Fw as az,zs as b,__ as c,S_ as d,rM as e,E_ as f,Js as g,Xs as h,Qs as i,p as j,Zg as k,iM as l,ae as m,fh as n,W as o,Re as p,xi as q,h as r,G as s,Ye as t,jn as u,Ub as v,$b as w,Uo as x,$h as y,$o as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.