const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SyncedHighlightsSection-BTbs0uZf.js","assets/useIOSAudioContext-DSBnluc9.js","assets/ChooseYourPaceSection-CN0badvS.js","assets/turtle-DSilfOTO.js","assets/DyslexiaSection-HxytKai5.js","assets/CheckTextSection-COY-6kc8.js","assets/chevron-left-JkOQYbi0.js","assets/ThemesSection-C3c4vtn1.js","assets/ExploreThemesButton-CwfNfMSb.js","assets/StoriesPage-Bj7UfHzG.js","assets/StoryCard-CejHRa54.js","assets/card-Cno9Ax1Q.js","assets/AccessLevelBadge-DltdAAii.js","assets/globe-D0ybSR4l.js","assets/dialog-B2yNK5Sm.js","assets/UpgradeButton-ClIjchS9.js","assets/AnimatedBadge-BhbVKYT_.js","assets/sesl-badge-utils-ehMeVD2e.js","assets/clock-BRThcDnu.js","assets/book-check-hFExILuH.js","assets/bookmark-3T8L64A2.js","assets/slider-BjAg26h_.js","assets/input-DMjOJzUt.js","assets/select-BC_Xa7za.js","assets/index--5Yx_EdU.js","assets/chevron-down-YGZc8BN1.js","assets/chevron-up-BypMSWa2.js","assets/collapsible-AWPYUAZH.js","assets/index-CrenTEad.js","assets/BreadcrumbNavigation-efmAGXCq.js","assets/skeleton-Sqaeczqj.js","assets/search-Q0z6F5mv.js","assets/rotate-ccw-D0oNDqZQ.js","assets/StoryReaderPage-v5JEF2kn.js","assets/arrow-left-CmMu1l7Y.js","assets/useStoryData-X3X5qGA1.js","assets/vocabulary-service-DFGWrm9x.js","assets/circle-question-mark-DG4FuYeb.js","assets/volume-2-NUeKBmbH.js","assets/ShareCard-Flpc0ncj.js","assets/xp-service-BLtZQmoD.js","assets/progress-B1IIhqc2.js","assets/refresh-cw-dd0RP1du.js","assets/sparkles-CEJd6Iay.js","assets/AboutPage-DBRYzIHE.js","assets/CreateFreeAccountButton-LVIprgTE.js","assets/ContactPage-DKxi4cCW.js","assets/textarea-6K-cpIx5.js","assets/tabs-D4m1NJG4.js","assets/SocialIcons-COfxMuTF.js","assets/mail-BHPvq64J.js","assets/circle-check-big-BoGFaHAs.js","assets/ImproveReadingPage-Cha-oyUT.js","assets/eye-CsQ3VIVV.js","assets/users-PLLZU4Nw.js","assets/AuthPages-DcGGCdDY.js","assets/checkbox-x0iROplr.js","assets/eye-off-Bo5a1mvS.js","assets/ResetPasswordPage-DD2-M0Xz.js","assets/VerifyEmailPage-DbW5Yh28.js","assets/NotFound-DFRSstKf.js","assets/book-open-CsAB9oRR.js","assets/ProgressPage-ChAdgX35.js","assets/useQuery-C7enUY78.js","assets/format-B9FvFmC1.js","assets/trending-up-DBGqDsOM.js","assets/zap-E4xU5b-b.js","assets/generateCategoricalChart-X7JPPSYu.js","assets/YAxis-De_G8oT3.js","assets/calendar-VIDo1Rue.js","assets/ReadingCartPage-Doo4w9Lz.js","assets/VocabularyNotebookPage-Bod9M7tw.js","assets/alert-dialog-D5tFbUTi.js","assets/trash-2-Cat-IFJH.js","assets/AdminPage-BXtHmEvJ.js","assets/separator-B0E3P_fc.js","assets/table-DGIJ6fLD.js","assets/CurrencySelector-B2uyOeMH.js","assets/sitemap-generator-KHDpYX28.js","assets/refresh-ccw-CWDS9MLp.js","assets/sesl-algorithm-DuNl3mb1.js","assets/circle-alert-hM0-R5Co.js","assets/download-BbGWIxy0.js","assets/circle-x-KQFtyrH8.js","assets/useBlogData-DwIwqav6.js","assets/settings-rR6bZDWk.js","assets/alert-huYrX0ch.js","assets/image-D6XA6hwv.js","assets/chart-column-yPd14xF3.js","assets/FontManagementPage-CP2v0N5b.js","assets/TermsPage-CWKqs95A.js","assets/PrivacyPage-BFmIsMZM.js","assets/RefundPage-BRbnS1wH.js","assets/SubscriptionPage-CkkmerKN.js","assets/story-generation-service-BI3pWqZj.js","assets/PaymentStatusPage-49pXmL1R.js","assets/ThemeInfoPage-xl-aEnQY.js","assets/BlogPage-CEoRTs0f.js","assets/BlogCard-DyNEFYs6.js","assets/BlogPostPage-BpFNmItN.js","assets/NewsletterPage-D5Q_kGfq.js","assets/StoryMakerPage-DAwEjpU3.js","assets/story-maker-CJAnJm6t.js","assets/ResearchPage-DaOxRCaa.js","assets/TextCheckerPage-BobW1CHu.js","assets/SitemapRoute-C78WYq-Q.js"])))=>i.map(i=>d[i]);
var lL=Object.defineProperty;var Z_=t=>{throw TypeError(t)};var cL=(t,e,n)=>e in t?lL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Tr=(t,e,n)=>cL(t,typeof e!="symbol"?e+"":e,n),lp=(t,e,n)=>e.has(t)||Z_("Cannot "+n);var L=(t,e,n)=>(lp(t,e,"read from private field"),n?n.call(t):e.get(t)),_e=(t,e,n)=>e.has(t)?Z_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),le=(t,e,n,r)=>(lp(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),vt=(t,e,n)=>(lp(t,e,"access private method"),n);var Lu=(t,e,n,r)=>({set _(s){le(t,e,s,n)},get _(){return L(t,e,r)}});function uL(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function dL(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var MS={exports:{}},lf={},$S={exports:{}},ue={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var uu=Symbol.for("react.element"),hL=Symbol.for("react.portal"),fL=Symbol.for("react.fragment"),pL=Symbol.for("react.strict_mode"),gL=Symbol.for("react.profiler"),mL=Symbol.for("react.provider"),vL=Symbol.for("react.context"),yL=Symbol.for("react.forward_ref"),_L=Symbol.for("react.suspense"),wL=Symbol.for("react.memo"),xL=Symbol.for("react.lazy"),ew=Symbol.iterator;function bL(t){return t===null||typeof t!="object"?null:(t=ew&&t[ew]||t["@@iterator"],typeof t=="function"?t:null)}var FS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},VS=Object.assign,US={};function fa(t,e,n){this.props=t,this.context=e,this.refs=US,this.updater=n||FS}fa.prototype.isReactComponent={};fa.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};fa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function zS(){}zS.prototype=fa.prototype;function fy(t,e,n){this.props=t,this.context=e,this.refs=US,this.updater=n||FS}var py=fy.prototype=new zS;py.constructor=fy;VS(py,fa.prototype);py.isPureReactComponent=!0;var tw=Array.isArray,BS=Object.prototype.hasOwnProperty,gy={current:null},HS={key:!0,ref:!0,__self:!0,__source:!0};function WS(t,e,n){var r,s={},i=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)BS.call(e,r)&&!HS.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:uu,type:t,key:i,ref:o,props:s,_owner:gy.current}}function EL(t,e){return{$$typeof:uu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function my(t){return typeof t=="object"&&t!==null&&t.$$typeof===uu}function SL(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var nw=/\/+/g;function cp(t,e){return typeof t=="object"&&t!==null&&t.key!=null?SL(""+t.key):e.toString(36)}function Sd(t,e,n,r,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case uu:case hL:o=!0}}if(o)return o=t,s=s(o),t=r===""?"."+cp(o,0):r,tw(s)?(n="",t!=null&&(n=t.replace(nw,"$&/")+"/"),Sd(s,e,n,"",function(c){return c})):s!=null&&(my(s)&&(s=EL(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(nw,"$&/")+"/")+t)),e.push(s)),1;if(o=0,r=r===""?".":r+":",tw(t))for(var a=0;a<t.length;a++){i=t[a];var l=r+cp(i,a);o+=Sd(i,e,n,l,s)}else if(l=bL(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=r+cp(i,a++),o+=Sd(i,e,n,l,s);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Nu(t,e,n){if(t==null)return t;var r=[],s=0;return Sd(t,r,"","",function(i){return e.call(n,i,s++)}),r}function TL(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Ot={current:null},Td={transition:null},PL={ReactCurrentDispatcher:Ot,ReactCurrentBatchConfig:Td,ReactCurrentOwner:gy};function KS(){throw Error("act(...) is not supported in production builds of React.")}ue.Children={map:Nu,forEach:function(t,e,n){Nu(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Nu(t,function(){e++}),e},toArray:function(t){return Nu(t,function(e){return e})||[]},only:function(t){if(!my(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ue.Component=fa;ue.Fragment=fL;ue.Profiler=gL;ue.PureComponent=fy;ue.StrictMode=pL;ue.Suspense=_L;ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PL;ue.act=KS;ue.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=VS({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=gy.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)BS.call(e,l)&&!HS.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:uu,type:t.type,key:s,ref:i,props:r,_owner:o}};ue.createContext=function(t){return t={$$typeof:vL,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:mL,_context:t},t.Consumer=t};ue.createElement=WS;ue.createFactory=function(t){var e=WS.bind(null,t);return e.type=t,e};ue.createRef=function(){return{current:null}};ue.forwardRef=function(t){return{$$typeof:yL,render:t}};ue.isValidElement=my;ue.lazy=function(t){return{$$typeof:xL,_payload:{_status:-1,_result:t},_init:TL}};ue.memo=function(t,e){return{$$typeof:wL,type:t,compare:e===void 0?null:e}};ue.startTransition=function(t){var e=Td.transition;Td.transition={};try{t()}finally{Td.transition=e}};ue.unstable_act=KS;ue.useCallback=function(t,e){return Ot.current.useCallback(t,e)};ue.useContext=function(t){return Ot.current.useContext(t)};ue.useDebugValue=function(){};ue.useDeferredValue=function(t){return Ot.current.useDeferredValue(t)};ue.useEffect=function(t,e){return Ot.current.useEffect(t,e)};ue.useId=function(){return Ot.current.useId()};ue.useImperativeHandle=function(t,e,n){return Ot.current.useImperativeHandle(t,e,n)};ue.useInsertionEffect=function(t,e){return Ot.current.useInsertionEffect(t,e)};ue.useLayoutEffect=function(t,e){return Ot.current.useLayoutEffect(t,e)};ue.useMemo=function(t,e){return Ot.current.useMemo(t,e)};ue.useReducer=function(t,e,n){return Ot.current.useReducer(t,e,n)};ue.useRef=function(t){return Ot.current.useRef(t)};ue.useState=function(t){return Ot.current.useState(t)};ue.useSyncExternalStore=function(t,e,n){return Ot.current.useSyncExternalStore(t,e,n)};ue.useTransition=function(){return Ot.current.useTransition()};ue.version="18.3.1";$S.exports=ue;var g=$S.exports;const $=cu(g),GS=uL({__proto__:null,default:$},[g]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var CL=g,kL=Symbol.for("react.element"),RL=Symbol.for("react.fragment"),jL=Object.prototype.hasOwnProperty,AL=CL.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,OL={key:!0,ref:!0,__self:!0,__source:!0};function qS(t,e,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)jL.call(e,r)&&!OL.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:kL,type:t,key:i,ref:o,props:s,_owner:AL.current}}lf.Fragment=RL;lf.jsx=qS;lf.jsxs=qS;MS.exports=lf;var h=MS.exports,YS={exports:{}},sn={},QS={exports:{}},XS={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(t){function e(R,A){var U=R.length;R.push(A);e:for(;0<U;){var M=U-1>>>1,z=R[M];if(0<s(z,A))R[M]=A,R[U]=z,U=M;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var A=R[0],U=R.pop();if(U!==A){R[0]=U;e:for(var M=0,z=R.length,J=z>>>1;M<J;){var re=2*(M+1)-1,De=R[re],se=re+1,ye=R[se];if(0>s(De,U))se<z&&0>s(ye,De)?(R[M]=ye,R[se]=U,M=se):(R[M]=De,R[re]=U,M=re);else if(se<z&&0>s(ye,U))R[M]=ye,R[se]=U,M=se;else break e}}return A}function s(R,A){var U=R.sortIndex-A.sortIndex;return U!==0?U:R.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,m=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(R){for(var A=n(c);A!==null;){if(A.callback===null)r(c);else if(A.startTime<=R)r(c),A.sortIndex=A.expirationTime,e(l,A);else break;A=n(c)}}function E(R){if(v=!1,x(R),!m)if(n(l)!==null)m=!0,B(b);else{var A=n(c);A!==null&&H(E,A.startTime-R)}}function b(R,A){m=!1,v&&(v=!1,y(P),P=-1),p=!0;var U=f;try{for(x(A),d=n(l);d!==null&&(!(d.expirationTime>A)||R&&!V());){var M=d.callback;if(typeof M=="function"){d.callback=null,f=d.priorityLevel;var z=M(d.expirationTime<=A);A=t.unstable_now(),typeof z=="function"?d.callback=z:d===n(l)&&r(l),x(A)}else r(l);d=n(l)}if(d!==null)var J=!0;else{var re=n(c);re!==null&&H(E,re.startTime-A),J=!1}return J}finally{d=null,f=U,p=!1}}var S=!1,T=null,P=-1,I=5,k=-1;function V(){return!(t.unstable_now()-k<I)}function F(){if(T!==null){var R=t.unstable_now();k=R;var A=!0;try{A=T(!0,R)}finally{A?Y():(S=!1,T=null)}}else S=!1}var Y;if(typeof _=="function")Y=function(){_(F)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,X=N.port2;N.port1.onmessage=F,Y=function(){X.postMessage(null)}}else Y=function(){w(F,0)};function B(R){T=R,S||(S=!0,Y())}function H(R,A){P=w(function(){R(t.unstable_now())},A)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_continueExecution=function(){m||p||(m=!0,B(b))},t.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<R?Math.floor(1e3/R):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(R){switch(f){case 1:case 2:case 3:var A=3;break;default:A=f}var U=f;f=A;try{return R()}finally{f=U}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(R,A){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var U=f;f=R;try{return A()}finally{f=U}},t.unstable_scheduleCallback=function(R,A,U){var M=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?M+U:M):U=M,R){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=U+z,R={id:u++,callback:A,priorityLevel:R,startTime:U,expirationTime:z,sortIndex:-1},U>M?(R.sortIndex=U,e(c,R),n(l)===null&&R===n(c)&&(v?(y(P),P=-1):v=!0,H(E,U-M))):(R.sortIndex=z,e(l,R),m||p||(m=!0,B(b))),R},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(R){var A=f;return function(){var U=f;f=A;try{return R.apply(this,arguments)}finally{f=U}}}})(XS);QS.exports=XS;var IL=QS.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var LL=g,rn=IL;function D(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var JS=new Set,vc={};function Ii(t,e){qo(t,e),qo(t+"Capture",e)}function qo(t,e){for(vc[t]=e,t=0;t<e.length;t++)JS.add(e[t])}var Ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zg=Object.prototype.hasOwnProperty,NL=/^[: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]*$/,rw={},sw={};function DL(t){return zg.call(sw,t)?!0:zg.call(rw,t)?!1:NL.test(t)?sw[t]=!0:(rw[t]=!0,!1)}function ML(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function $L(t,e,n,r){if(e===null||typeof e>"u"||ML(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function It(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var pt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){pt[t]=new It(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];pt[e]=new It(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){pt[t]=new It(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){pt[t]=new It(t,2,!1,t,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(t){pt[t]=new It(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){pt[t]=new It(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){pt[t]=new It(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){pt[t]=new It(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){pt[t]=new It(t,5,!1,t.toLowerCase(),null,!1,!1)});var vy=/[\-:]([a-z])/g;function yy(t){return t[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(t){var e=t.replace(vy,yy);pt[e]=new It(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(vy,yy);pt[e]=new It(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(vy,yy);pt[e]=new It(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){pt[t]=new It(t,1,!1,t.toLowerCase(),null,!1,!1)});pt.xlinkHref=new It("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){pt[t]=new It(t,1,!1,t.toLowerCase(),null,!0,!0)});function _y(t,e,n,r){var s=pt.hasOwnProperty(e)?pt[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&($L(e,n,s,r)&&(n=null),r||s===null?DL(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):s.mustUseProperty?t[s.propertyName]=n===null?s.type===3?!1:"":n:(e=s.attributeName,r=s.attributeNamespace,n===null?t.removeAttribute(e):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var qr=LL.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Du=Symbol.for("react.element"),so=Symbol.for("react.portal"),io=Symbol.for("react.fragment"),wy=Symbol.for("react.strict_mode"),Bg=Symbol.for("react.profiler"),ZS=Symbol.for("react.provider"),eT=Symbol.for("react.context"),xy=Symbol.for("react.forward_ref"),Hg=Symbol.for("react.suspense"),Wg=Symbol.for("react.suspense_list"),by=Symbol.for("react.memo"),cs=Symbol.for("react.lazy"),tT=Symbol.for("react.offscreen"),iw=Symbol.iterator;function Ia(t){return t===null||typeof t!="object"?null:(t=iw&&t[iw]||t["@@iterator"],typeof t=="function"?t:null)}var Ue=Object.assign,up;function jl(t){if(up===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);up=e&&e[1]||""}return`
`+up+t}var dp=!1;function hp(t,e){if(!t||dp)return"";dp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
`),i=r.stack.split(`
`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
`+s[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{dp=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?jl(t):""}function FL(t){switch(t.tag){case 5:return jl(t.type);case 16:return jl("Lazy");case 13:return jl("Suspense");case 19:return jl("SuspenseList");case 0:case 2:case 15:return t=hp(t.type,!1),t;case 11:return t=hp(t.type.render,!1),t;case 1:return t=hp(t.type,!0),t;default:return""}}function Kg(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case io:return"Fragment";case so:return"Portal";case Bg:return"Profiler";case wy:return"StrictMode";case Hg:return"Suspense";case Wg:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case eT:return(t.displayName||"Context")+".Consumer";case ZS:return(t._context.displayName||"Context")+".Provider";case xy:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case by:return e=t.displayName||null,e!==null?e:Kg(t.type)||"Memo";case cs:e=t._payload,t=t._init;try{return Kg(t(e))}catch{}}return null}function VL(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Kg(e);case 8:return e===wy?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ms(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function nT(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function UL(t){var e=nT(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Mu(t){t._valueTracker||(t._valueTracker=UL(t))}function rT(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=nT(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Zd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Gg(t,e){var n=e.checked;return Ue({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function ow(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ms(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function sT(t,e){e=e.checked,e!=null&&_y(t,"checked",e,!1)}function qg(t,e){sT(t,e);var n=Ms(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Yg(t,e.type,n):e.hasOwnProperty("defaultValue")&&Yg(t,e.type,Ms(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function aw(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Yg(t,e,n){(e!=="number"||Zd(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Al=Array.isArray;function To(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s<n.length;s++)e["$"+n[s]]=!0;for(n=0;n<t.length;n++)s=e.hasOwnProperty("$"+t[n].value),t[n].selected!==s&&(t[n].selected=s),s&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Ms(n),e=null,s=0;s<t.length;s++){if(t[s].value===n){t[s].selected=!0,r&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Qg(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(D(91));return Ue({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function lw(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(D(92));if(Al(n)){if(1<n.length)throw Error(D(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Ms(n)}}function iT(t,e){var n=Ms(e.value),r=Ms(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function cw(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function oT(t){switch(t){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 Xg(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?oT(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var $u,aT=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,s){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for($u=$u||document.createElement("div"),$u.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=$u.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function yc(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Gl={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},zL=["Webkit","ms","Moz","O"];Object.keys(Gl).forEach(function(t){zL.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Gl[e]=Gl[t]})});function lT(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Gl.hasOwnProperty(t)&&Gl[t]?(""+e).trim():e+"px"}function cT(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=lT(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var BL=Ue({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 Jg(t,e){if(e){if(BL[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(D(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(D(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(D(61))}if(e.style!=null&&typeof e.style!="object")throw Error(D(62))}}function Zg(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 em=null;function Ey(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var tm=null,Po=null,Co=null;function uw(t){if(t=fu(t)){if(typeof tm!="function")throw Error(D(280));var e=t.stateNode;e&&(e=ff(e),tm(t.stateNode,t.type,e))}}function uT(t){Po?Co?Co.push(t):Co=[t]:Po=t}function dT(){if(Po){var t=Po,e=Co;if(Co=Po=null,uw(t),e)for(t=0;t<e.length;t++)uw(e[t])}}function hT(t,e){return t(e)}function fT(){}var fp=!1;function pT(t,e,n){if(fp)return t(e,n);fp=!0;try{return hT(t,e,n)}finally{fp=!1,(Po!==null||Co!==null)&&(fT(),dT())}}function _c(t,e){var n=t.stateNode;if(n===null)return null;var r=ff(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(D(231,e,typeof n));return n}var nm=!1;if(Ur)try{var La={};Object.defineProperty(La,"passive",{get:function(){nm=!0}}),window.addEventListener("test",La,La),window.removeEventListener("test",La,La)}catch{nm=!1}function HL(t,e,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var ql=!1,eh=null,th=!1,rm=null,WL={onError:function(t){ql=!0,eh=t}};function KL(t,e,n,r,s,i,o,a,l){ql=!1,eh=null,HL.apply(WL,arguments)}function GL(t,e,n,r,s,i,o,a,l){if(KL.apply(this,arguments),ql){if(ql){var c=eh;ql=!1,eh=null}else throw Error(D(198));th||(th=!0,rm=c)}}function Li(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function gT(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function dw(t){if(Li(t)!==t)throw Error(D(188))}function qL(t){var e=t.alternate;if(!e){if(e=Li(t),e===null)throw Error(D(188));return e!==t?null:t}for(var n=t,r=e;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return dw(s),t;if(i===r)return dw(s),e;i=i.sibling}throw Error(D(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(D(189))}}if(n.alternate!==r)throw Error(D(190))}if(n.tag!==3)throw Error(D(188));return n.stateNode.current===n?t:e}function mT(t){return t=qL(t),t!==null?vT(t):null}function vT(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=vT(t);if(e!==null)return e;t=t.sibling}return null}var yT=rn.unstable_scheduleCallback,hw=rn.unstable_cancelCallback,YL=rn.unstable_shouldYield,QL=rn.unstable_requestPaint,Ye=rn.unstable_now,XL=rn.unstable_getCurrentPriorityLevel,Sy=rn.unstable_ImmediatePriority,_T=rn.unstable_UserBlockingPriority,nh=rn.unstable_NormalPriority,JL=rn.unstable_LowPriority,wT=rn.unstable_IdlePriority,cf=null,fr=null;function ZL(t){if(fr&&typeof fr.onCommitFiberRoot=="function")try{fr.onCommitFiberRoot(cf,t,void 0,(t.current.flags&128)===128)}catch{}}var Nn=Math.clz32?Math.clz32:n2,e2=Math.log,t2=Math.LN2;function n2(t){return t>>>=0,t===0?32:31-(e2(t)/t2|0)|0}var Fu=64,Vu=4194304;function Ol(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function rh(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Ol(a):(i&=o,i!==0&&(r=Ol(i)))}else o=n&~s,o!==0?r=Ol(o):i!==0&&(r=Ol(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Nn(e),s=1<<n,r|=t[n],e&=~s;return r}function r2(t,e){switch(t){case 1:case 2:case 4:return e+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 e+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 s2(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Nn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=r2(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function sm(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function xT(){var t=Fu;return Fu<<=1,!(Fu&4194240)&&(Fu=64),t}function pp(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function du(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Nn(e),t[e]=n}function i2(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var s=31-Nn(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function Ty(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Nn(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var we=0;function bT(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var ET,Py,ST,TT,PT,im=!1,Uu=[],Ps=null,Cs=null,ks=null,wc=new Map,xc=new Map,fs=[],o2="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 fw(t,e){switch(t){case"focusin":case"focusout":Ps=null;break;case"dragenter":case"dragleave":Cs=null;break;case"mouseover":case"mouseout":ks=null;break;case"pointerover":case"pointerout":wc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":xc.delete(e.pointerId)}}function Na(t,e,n,r,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},e!==null&&(e=fu(e),e!==null&&Py(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function a2(t,e,n,r,s){switch(e){case"focusin":return Ps=Na(Ps,t,e,n,r,s),!0;case"dragenter":return Cs=Na(Cs,t,e,n,r,s),!0;case"mouseover":return ks=Na(ks,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return wc.set(i,Na(wc.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,xc.set(i,Na(xc.get(i)||null,t,e,n,r,s)),!0}return!1}function CT(t){var e=ai(t.target);if(e!==null){var n=Li(e);if(n!==null){if(e=n.tag,e===13){if(e=gT(n),e!==null){t.blockedOn=e,PT(t.priority,function(){ST(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Pd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=om(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);em=r,n.target.dispatchEvent(r),em=null}else return e=fu(n),e!==null&&Py(e),t.blockedOn=n,!1;e.shift()}return!0}function pw(t,e,n){Pd(t)&&n.delete(e)}function l2(){im=!1,Ps!==null&&Pd(Ps)&&(Ps=null),Cs!==null&&Pd(Cs)&&(Cs=null),ks!==null&&Pd(ks)&&(ks=null),wc.forEach(pw),xc.forEach(pw)}function Da(t,e){t.blockedOn===e&&(t.blockedOn=null,im||(im=!0,rn.unstable_scheduleCallback(rn.unstable_NormalPriority,l2)))}function bc(t){function e(s){return Da(s,t)}if(0<Uu.length){Da(Uu[0],t);for(var n=1;n<Uu.length;n++){var r=Uu[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Ps!==null&&Da(Ps,t),Cs!==null&&Da(Cs,t),ks!==null&&Da(ks,t),wc.forEach(e),xc.forEach(e),n=0;n<fs.length;n++)r=fs[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<fs.length&&(n=fs[0],n.blockedOn===null);)CT(n),n.blockedOn===null&&fs.shift()}var ko=qr.ReactCurrentBatchConfig,sh=!0;function c2(t,e,n,r){var s=we,i=ko.transition;ko.transition=null;try{we=1,Cy(t,e,n,r)}finally{we=s,ko.transition=i}}function u2(t,e,n,r){var s=we,i=ko.transition;ko.transition=null;try{we=4,Cy(t,e,n,r)}finally{we=s,ko.transition=i}}function Cy(t,e,n,r){if(sh){var s=om(t,e,n,r);if(s===null)Sp(t,e,r,ih,n),fw(t,r);else if(a2(s,t,e,n,r))r.stopPropagation();else if(fw(t,r),e&4&&-1<o2.indexOf(t)){for(;s!==null;){var i=fu(s);if(i!==null&&ET(i),i=om(t,e,n,r),i===null&&Sp(t,e,r,ih,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Sp(t,e,r,null,n)}}var ih=null;function om(t,e,n,r){if(ih=null,t=Ey(r),t=ai(t),t!==null)if(e=Li(t),e===null)t=null;else if(n=e.tag,n===13){if(t=gT(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return ih=t,null}function kT(t){switch(t){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(XL()){case Sy:return 1;case _T:return 4;case nh:case JL:return 16;case wT:return 536870912;default:return 16}default:return 16}}var xs=null,ky=null,Cd=null;function RT(){if(Cd)return Cd;var t,e=ky,n=e.length,r,s="value"in xs?xs.value:xs.textContent,i=s.length;for(t=0;t<n&&e[t]===s[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===s[i-r];r++);return Cd=s.slice(t,1<r?1-r:void 0)}function kd(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function zu(){return!0}function gw(){return!1}function on(t){function e(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?zu:gw,this.isPropagationStopped=gw,this}return Ue(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zu)},persist:function(){},isPersistent:zu}),e}var pa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ry=on(pa),hu=Ue({},pa,{view:0,detail:0}),d2=on(hu),gp,mp,Ma,uf=Ue({},hu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jy,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ma&&(Ma&&t.type==="mousemove"?(gp=t.screenX-Ma.screenX,mp=t.screenY-Ma.screenY):mp=gp=0,Ma=t),gp)},movementY:function(t){return"movementY"in t?t.movementY:mp}}),mw=on(uf),h2=Ue({},uf,{dataTransfer:0}),f2=on(h2),p2=Ue({},hu,{relatedTarget:0}),vp=on(p2),g2=Ue({},pa,{animationName:0,elapsedTime:0,pseudoElement:0}),m2=on(g2),v2=Ue({},pa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),y2=on(v2),_2=Ue({},pa,{data:0}),vw=on(_2),w2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},x2={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"},b2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function E2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=b2[t])?!!e[t]:!1}function jy(){return E2}var S2=Ue({},hu,{key:function(t){if(t.key){var e=w2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=kd(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?x2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jy,charCode:function(t){return t.type==="keypress"?kd(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?kd(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),T2=on(S2),P2=Ue({},uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yw=on(P2),C2=Ue({},hu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jy}),k2=on(C2),R2=Ue({},pa,{propertyName:0,elapsedTime:0,pseudoElement:0}),j2=on(R2),A2=Ue({},uf,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),O2=on(A2),I2=[9,13,27,32],Ay=Ur&&"CompositionEvent"in window,Yl=null;Ur&&"documentMode"in document&&(Yl=document.documentMode);var L2=Ur&&"TextEvent"in window&&!Yl,jT=Ur&&(!Ay||Yl&&8<Yl&&11>=Yl),_w=" ",ww=!1;function AT(t,e){switch(t){case"keyup":return I2.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function OT(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var oo=!1;function N2(t,e){switch(t){case"compositionend":return OT(e);case"keypress":return e.which!==32?null:(ww=!0,_w);case"textInput":return t=e.data,t===_w&&ww?null:t;default:return null}}function D2(t,e){if(oo)return t==="compositionend"||!Ay&&AT(t,e)?(t=RT(),Cd=ky=xs=null,oo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return jT&&e.locale!=="ko"?null:e.data;default:return null}}var M2={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 xw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!M2[t.type]:e==="textarea"}function IT(t,e,n,r){uT(r),e=oh(e,"onChange"),0<e.length&&(n=new Ry("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Ql=null,Ec=null;function $2(t){HT(t,0)}function df(t){var e=co(t);if(rT(e))return t}function F2(t,e){if(t==="change")return e}var LT=!1;if(Ur){var yp;if(Ur){var _p="oninput"in document;if(!_p){var bw=document.createElement("div");bw.setAttribute("oninput","return;"),_p=typeof bw.oninput=="function"}yp=_p}else yp=!1;LT=yp&&(!document.documentMode||9<document.documentMode)}function Ew(){Ql&&(Ql.detachEvent("onpropertychange",NT),Ec=Ql=null)}function NT(t){if(t.propertyName==="value"&&df(Ec)){var e=[];IT(e,Ec,t,Ey(t)),pT($2,e)}}function V2(t,e,n){t==="focusin"?(Ew(),Ql=e,Ec=n,Ql.attachEvent("onpropertychange",NT)):t==="focusout"&&Ew()}function U2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return df(Ec)}function z2(t,e){if(t==="click")return df(e)}function B2(t,e){if(t==="input"||t==="change")return df(e)}function H2(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Mn=typeof Object.is=="function"?Object.is:H2;function Sc(t,e){if(Mn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!zg.call(e,s)||!Mn(t[s],e[s]))return!1}return!0}function Sw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Tw(t,e){var n=Sw(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Sw(n)}}function DT(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?DT(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function MT(){for(var t=window,e=Zd();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Zd(t.document)}return e}function Oy(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function W2(t){var e=MT(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&DT(n.ownerDocument.documentElement,n)){if(r!==null&&Oy(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=Tw(n,i);var o=Tw(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var K2=Ur&&"documentMode"in document&&11>=document.documentMode,ao=null,am=null,Xl=null,lm=!1;function Pw(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lm||ao==null||ao!==Zd(r)||(r=ao,"selectionStart"in r&&Oy(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xl&&Sc(Xl,r)||(Xl=r,r=oh(am,"onSelect"),0<r.length&&(e=new Ry("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=ao)))}function Bu(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var lo={animationend:Bu("Animation","AnimationEnd"),animationiteration:Bu("Animation","AnimationIteration"),animationstart:Bu("Animation","AnimationStart"),transitionend:Bu("Transition","TransitionEnd")},wp={},$T={};Ur&&($T=document.createElement("div").style,"AnimationEvent"in window||(delete lo.animationend.animation,delete lo.animationiteration.animation,delete lo.animationstart.animation),"TransitionEvent"in window||delete lo.transitionend.transition);function hf(t){if(wp[t])return wp[t];if(!lo[t])return t;var e=lo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in $T)return wp[t]=e[n];return t}var FT=hf("animationend"),VT=hf("animationiteration"),UT=hf("animationstart"),zT=hf("transitionend"),BT=new Map,Cw="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 Ws(t,e){BT.set(t,e),Ii(e,[t])}for(var xp=0;xp<Cw.length;xp++){var bp=Cw[xp],G2=bp.toLowerCase(),q2=bp[0].toUpperCase()+bp.slice(1);Ws(G2,"on"+q2)}Ws(FT,"onAnimationEnd");Ws(VT,"onAnimationIteration");Ws(UT,"onAnimationStart");Ws("dblclick","onDoubleClick");Ws("focusin","onFocus");Ws("focusout","onBlur");Ws(zT,"onTransitionEnd");qo("onMouseEnter",["mouseout","mouseover"]);qo("onMouseLeave",["mouseout","mouseover"]);qo("onPointerEnter",["pointerout","pointerover"]);qo("onPointerLeave",["pointerout","pointerover"]);Ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ii("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Il="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(" "),Y2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Il));function kw(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,GL(r,e,void 0,t),t.currentTarget=null}function HT(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],s=r.event;r=r.listeners;e:{var i=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;kw(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;kw(s,a,c),i=l}}}if(th)throw t=rm,th=!1,rm=null,t}function Ae(t,e){var n=e[fm];n===void 0&&(n=e[fm]=new Set);var r=t+"__bubble";n.has(r)||(WT(e,t,2,!1),n.add(r))}function Ep(t,e,n){var r=0;e&&(r|=4),WT(n,t,r,e)}var Hu="_reactListening"+Math.random().toString(36).slice(2);function Tc(t){if(!t[Hu]){t[Hu]=!0,JS.forEach(function(n){n!=="selectionchange"&&(Y2.has(n)||Ep(n,!1,t),Ep(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Hu]||(e[Hu]=!0,Ep("selectionchange",!1,e))}}function WT(t,e,n,r){switch(kT(e)){case 1:var s=c2;break;case 4:s=u2;break;default:s=Cy}n=s.bind(null,e,n,t),s=void 0,!nm||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),r?s!==void 0?t.addEventListener(e,n,{capture:!0,passive:s}):t.addEventListener(e,n,!0):s!==void 0?t.addEventListener(e,n,{passive:s}):t.addEventListener(e,n,!1)}function Sp(t,e,n,r,s){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=ai(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}pT(function(){var c=i,u=Ey(n),d=[];e:{var f=BT.get(t);if(f!==void 0){var p=Ry,m=t;switch(t){case"keypress":if(kd(n)===0)break e;case"keydown":case"keyup":p=T2;break;case"focusin":m="focus",p=vp;break;case"focusout":m="blur",p=vp;break;case"beforeblur":case"afterblur":p=vp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=mw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=f2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=k2;break;case FT:case VT:case UT:p=m2;break;case zT:p=j2;break;case"scroll":p=d2;break;case"wheel":p=O2;break;case"copy":case"cut":case"paste":p=y2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=yw}var v=(e&4)!==0,w=!v&&t==="scroll",y=v?f!==null?f+"Capture":null:f;v=[];for(var _=c,x;_!==null;){x=_;var E=x.stateNode;if(x.tag===5&&E!==null&&(x=E,y!==null&&(E=_c(_,y),E!=null&&v.push(Pc(_,E,x)))),w)break;_=_.return}0<v.length&&(f=new p(f,m,null,n,u),d.push({event:f,listeners:v}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&n!==em&&(m=n.relatedTarget||n.fromElement)&&(ai(m)||m[zr]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?ai(m):null,m!==null&&(w=Li(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(v=mw,E="onMouseLeave",y="onMouseEnter",_="mouse",(t==="pointerout"||t==="pointerover")&&(v=yw,E="onPointerLeave",y="onPointerEnter",_="pointer"),w=p==null?f:co(p),x=m==null?f:co(m),f=new v(E,_+"leave",p,n,u),f.target=w,f.relatedTarget=x,E=null,ai(u)===c&&(v=new v(y,_+"enter",m,n,u),v.target=x,v.relatedTarget=w,E=v),w=E,p&&m)t:{for(v=p,y=m,_=0,x=v;x;x=zi(x))_++;for(x=0,E=y;E;E=zi(E))x++;for(;0<_-x;)v=zi(v),_--;for(;0<x-_;)y=zi(y),x--;for(;_--;){if(v===y||y!==null&&v===y.alternate)break t;v=zi(v),y=zi(y)}v=null}else v=null;p!==null&&Rw(d,f,p,v,!1),m!==null&&w!==null&&Rw(d,w,m,v,!0)}}e:{if(f=c?co(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var b=F2;else if(xw(f))if(LT)b=B2;else{b=U2;var S=V2}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=z2);if(b&&(b=b(t,c))){IT(d,b,n,u);break e}S&&S(t,f,c),t==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&Yg(f,"number",f.value)}switch(S=c?co(c):window,t){case"focusin":(xw(S)||S.contentEditable==="true")&&(ao=S,am=c,Xl=null);break;case"focusout":Xl=am=ao=null;break;case"mousedown":lm=!0;break;case"contextmenu":case"mouseup":case"dragend":lm=!1,Pw(d,n,u);break;case"selectionchange":if(K2)break;case"keydown":case"keyup":Pw(d,n,u)}var T;if(Ay)e:{switch(t){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else oo?AT(t,n)&&(P="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(jT&&n.locale!=="ko"&&(oo||P!=="onCompositionStart"?P==="onCompositionEnd"&&oo&&(T=RT()):(xs=u,ky="value"in xs?xs.value:xs.textContent,oo=!0)),S=oh(c,P),0<S.length&&(P=new vw(P,t,null,n,u),d.push({event:P,listeners:S}),T?P.data=T:(T=OT(n),T!==null&&(P.data=T)))),(T=L2?N2(t,n):D2(t,n))&&(c=oh(c,"onBeforeInput"),0<c.length&&(u=new vw("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=T))}HT(d,e)})}function Pc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function oh(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=_c(t,n),i!=null&&r.unshift(Pc(t,i,s)),i=_c(t,e),i!=null&&r.push(Pc(t,i,s))),t=t.return}return r}function zi(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Rw(t,e,n,r,s){for(var i=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=_c(n,i),l!=null&&o.unshift(Pc(n,l,a))):s||(l=_c(n,i),l!=null&&o.push(Pc(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var Q2=/\r\n?/g,X2=/\u0000|\uFFFD/g;function jw(t){return(typeof t=="string"?t:""+t).replace(Q2,`
`).replace(X2,"")}function Wu(t,e,n){if(e=jw(e),jw(t)!==e&&n)throw Error(D(425))}function ah(){}var cm=null,um=null;function dm(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var hm=typeof setTimeout=="function"?setTimeout:void 0,J2=typeof clearTimeout=="function"?clearTimeout:void 0,Aw=typeof Promise=="function"?Promise:void 0,Z2=typeof queueMicrotask=="function"?queueMicrotask:typeof Aw<"u"?function(t){return Aw.resolve(null).then(t).catch(eN)}:hm;function eN(t){setTimeout(function(){throw t})}function Tp(t,e){var n=e,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){t.removeChild(s),bc(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);bc(e)}function Rs(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Ow(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var ga=Math.random().toString(36).slice(2),sr="__reactFiber$"+ga,Cc="__reactProps$"+ga,zr="__reactContainer$"+ga,fm="__reactEvents$"+ga,tN="__reactListeners$"+ga,nN="__reactHandles$"+ga;function ai(t){var e=t[sr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[zr]||n[sr]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Ow(t);t!==null;){if(n=t[sr])return n;t=Ow(t)}return e}t=n,n=t.parentNode}return null}function fu(t){return t=t[sr]||t[zr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function co(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(D(33))}function ff(t){return t[Cc]||null}var pm=[],uo=-1;function Ks(t){return{current:t}}function Ie(t){0>uo||(t.current=pm[uo],pm[uo]=null,uo--)}function Ce(t,e){uo++,pm[uo]=t.current,t.current=e}var $s={},St=Ks($s),zt=Ks(!1),bi=$s;function Yo(t,e){var n=t.type.contextTypes;if(!n)return $s;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function Bt(t){return t=t.childContextTypes,t!=null}function lh(){Ie(zt),Ie(St)}function Iw(t,e,n){if(St.current!==$s)throw Error(D(168));Ce(St,e),Ce(zt,n)}function KT(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(D(108,VL(t)||"Unknown",s));return Ue({},n,r)}function ch(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||$s,bi=St.current,Ce(St,t),Ce(zt,zt.current),!0}function Lw(t,e,n){var r=t.stateNode;if(!r)throw Error(D(169));n?(t=KT(t,e,bi),r.__reactInternalMemoizedMergedChildContext=t,Ie(zt),Ie(St),Ce(St,t)):Ie(zt),Ce(zt,n)}var Lr=null,pf=!1,Pp=!1;function GT(t){Lr===null?Lr=[t]:Lr.push(t)}function rN(t){pf=!0,GT(t)}function Gs(){if(!Pp&&Lr!==null){Pp=!0;var t=0,e=we;try{var n=Lr;for(we=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Lr=null,pf=!1}catch(s){throw Lr!==null&&(Lr=Lr.slice(t+1)),yT(Sy,Gs),s}finally{we=e,Pp=!1}}return null}var ho=[],fo=0,uh=null,dh=0,gn=[],mn=0,Ei=null,Nr=1,Dr="";function ti(t,e){ho[fo++]=dh,ho[fo++]=uh,uh=t,dh=e}function qT(t,e,n){gn[mn++]=Nr,gn[mn++]=Dr,gn[mn++]=Ei,Ei=t;var r=Nr;t=Dr;var s=32-Nn(r)-1;r&=~(1<<s),n+=1;var i=32-Nn(e)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Nr=1<<32-Nn(e)+s|n<<s|r,Dr=i+t}else Nr=1<<i|n<<s|r,Dr=t}function Iy(t){t.return!==null&&(ti(t,1),qT(t,1,0))}function Ly(t){for(;t===uh;)uh=ho[--fo],ho[fo]=null,dh=ho[--fo],ho[fo]=null;for(;t===Ei;)Ei=gn[--mn],gn[mn]=null,Dr=gn[--mn],gn[mn]=null,Nr=gn[--mn],gn[mn]=null}var tn=null,Zt=null,Ne=!1,In=null;function YT(t,e){var n=vn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Nw(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,tn=t,Zt=Rs(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,tn=t,Zt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ei!==null?{id:Nr,overflow:Dr}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=vn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,tn=t,Zt=null,!0):!1;default:return!1}}function gm(t){return(t.mode&1)!==0&&(t.flags&128)===0}function mm(t){if(Ne){var e=Zt;if(e){var n=e;if(!Nw(t,e)){if(gm(t))throw Error(D(418));e=Rs(n.nextSibling);var r=tn;e&&Nw(t,e)?YT(r,n):(t.flags=t.flags&-4097|2,Ne=!1,tn=t)}}else{if(gm(t))throw Error(D(418));t.flags=t.flags&-4097|2,Ne=!1,tn=t}}}function Dw(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;tn=t}function Ku(t){if(t!==tn)return!1;if(!Ne)return Dw(t),Ne=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!dm(t.type,t.memoizedProps)),e&&(e=Zt)){if(gm(t))throw QT(),Error(D(418));for(;e;)YT(t,e),e=Rs(e.nextSibling)}if(Dw(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Zt=Rs(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Zt=null}}else Zt=tn?Rs(t.stateNode.nextSibling):null;return!0}function QT(){for(var t=Zt;t;)t=Rs(t.nextSibling)}function Qo(){Zt=tn=null,Ne=!1}function Ny(t){In===null?In=[t]:In.push(t)}var sN=qr.ReactCurrentBatchConfig;function $a(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(D(309));var r=n.stateNode}if(!r)throw Error(D(147,t));var s=r,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(D(284));if(!n._owner)throw Error(D(290,t))}return t}function Gu(t,e){throw t=Object.prototype.toString.call(e),Error(D(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Mw(t){var e=t._init;return e(t._payload)}function XT(t){function e(y,_){if(t){var x=y.deletions;x===null?(y.deletions=[_],y.flags|=16):x.push(_)}}function n(y,_){if(!t)return null;for(;_!==null;)e(y,_),_=_.sibling;return null}function r(y,_){for(y=new Map;_!==null;)_.key!==null?y.set(_.key,_):y.set(_.index,_),_=_.sibling;return y}function s(y,_){return y=Is(y,_),y.index=0,y.sibling=null,y}function i(y,_,x){return y.index=x,t?(x=y.alternate,x!==null?(x=x.index,x<_?(y.flags|=2,_):x):(y.flags|=2,_)):(y.flags|=1048576,_)}function o(y){return t&&y.alternate===null&&(y.flags|=2),y}function a(y,_,x,E){return _===null||_.tag!==6?(_=Ip(x,y.mode,E),_.return=y,_):(_=s(_,x),_.return=y,_)}function l(y,_,x,E){var b=x.type;return b===io?u(y,_,x.props.children,E,x.key):_!==null&&(_.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===cs&&Mw(b)===_.type)?(E=s(_,x.props),E.ref=$a(y,_,x),E.return=y,E):(E=Nd(x.type,x.key,x.props,null,y.mode,E),E.ref=$a(y,_,x),E.return=y,E)}function c(y,_,x,E){return _===null||_.tag!==4||_.stateNode.containerInfo!==x.containerInfo||_.stateNode.implementation!==x.implementation?(_=Lp(x,y.mode,E),_.return=y,_):(_=s(_,x.children||[]),_.return=y,_)}function u(y,_,x,E,b){return _===null||_.tag!==7?(_=yi(x,y.mode,E,b),_.return=y,_):(_=s(_,x),_.return=y,_)}function d(y,_,x){if(typeof _=="string"&&_!==""||typeof _=="number")return _=Ip(""+_,y.mode,x),_.return=y,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Du:return x=Nd(_.type,_.key,_.props,null,y.mode,x),x.ref=$a(y,null,_),x.return=y,x;case so:return _=Lp(_,y.mode,x),_.return=y,_;case cs:var E=_._init;return d(y,E(_._payload),x)}if(Al(_)||Ia(_))return _=yi(_,y.mode,x,null),_.return=y,_;Gu(y,_)}return null}function f(y,_,x,E){var b=_!==null?_.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return b!==null?null:a(y,_,""+x,E);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Du:return x.key===b?l(y,_,x,E):null;case so:return x.key===b?c(y,_,x,E):null;case cs:return b=x._init,f(y,_,b(x._payload),E)}if(Al(x)||Ia(x))return b!==null?null:u(y,_,x,E,null);Gu(y,x)}return null}function p(y,_,x,E,b){if(typeof E=="string"&&E!==""||typeof E=="number")return y=y.get(x)||null,a(_,y,""+E,b);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Du:return y=y.get(E.key===null?x:E.key)||null,l(_,y,E,b);case so:return y=y.get(E.key===null?x:E.key)||null,c(_,y,E,b);case cs:var S=E._init;return p(y,_,x,S(E._payload),b)}if(Al(E)||Ia(E))return y=y.get(x)||null,u(_,y,E,b,null);Gu(_,E)}return null}function m(y,_,x,E){for(var b=null,S=null,T=_,P=_=0,I=null;T!==null&&P<x.length;P++){T.index>P?(I=T,T=null):I=T.sibling;var k=f(y,T,x[P],E);if(k===null){T===null&&(T=I);break}t&&T&&k.alternate===null&&e(y,T),_=i(k,_,P),S===null?b=k:S.sibling=k,S=k,T=I}if(P===x.length)return n(y,T),Ne&&ti(y,P),b;if(T===null){for(;P<x.length;P++)T=d(y,x[P],E),T!==null&&(_=i(T,_,P),S===null?b=T:S.sibling=T,S=T);return Ne&&ti(y,P),b}for(T=r(y,T);P<x.length;P++)I=p(T,y,P,x[P],E),I!==null&&(t&&I.alternate!==null&&T.delete(I.key===null?P:I.key),_=i(I,_,P),S===null?b=I:S.sibling=I,S=I);return t&&T.forEach(function(V){return e(y,V)}),Ne&&ti(y,P),b}function v(y,_,x,E){var b=Ia(x);if(typeof b!="function")throw Error(D(150));if(x=b.call(x),x==null)throw Error(D(151));for(var S=b=null,T=_,P=_=0,I=null,k=x.next();T!==null&&!k.done;P++,k=x.next()){T.index>P?(I=T,T=null):I=T.sibling;var V=f(y,T,k.value,E);if(V===null){T===null&&(T=I);break}t&&T&&V.alternate===null&&e(y,T),_=i(V,_,P),S===null?b=V:S.sibling=V,S=V,T=I}if(k.done)return n(y,T),Ne&&ti(y,P),b;if(T===null){for(;!k.done;P++,k=x.next())k=d(y,k.value,E),k!==null&&(_=i(k,_,P),S===null?b=k:S.sibling=k,S=k);return Ne&&ti(y,P),b}for(T=r(y,T);!k.done;P++,k=x.next())k=p(T,y,P,k.value,E),k!==null&&(t&&k.alternate!==null&&T.delete(k.key===null?P:k.key),_=i(k,_,P),S===null?b=k:S.sibling=k,S=k);return t&&T.forEach(function(F){return e(y,F)}),Ne&&ti(y,P),b}function w(y,_,x,E){if(typeof x=="object"&&x!==null&&x.type===io&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Du:e:{for(var b=x.key,S=_;S!==null;){if(S.key===b){if(b=x.type,b===io){if(S.tag===7){n(y,S.sibling),_=s(S,x.props.children),_.return=y,y=_;break e}}else if(S.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===cs&&Mw(b)===S.type){n(y,S.sibling),_=s(S,x.props),_.ref=$a(y,S,x),_.return=y,y=_;break e}n(y,S);break}else e(y,S);S=S.sibling}x.type===io?(_=yi(x.props.children,y.mode,E,x.key),_.return=y,y=_):(E=Nd(x.type,x.key,x.props,null,y.mode,E),E.ref=$a(y,_,x),E.return=y,y=E)}return o(y);case so:e:{for(S=x.key;_!==null;){if(_.key===S)if(_.tag===4&&_.stateNode.containerInfo===x.containerInfo&&_.stateNode.implementation===x.implementation){n(y,_.sibling),_=s(_,x.children||[]),_.return=y,y=_;break e}else{n(y,_);break}else e(y,_);_=_.sibling}_=Lp(x,y.mode,E),_.return=y,y=_}return o(y);case cs:return S=x._init,w(y,_,S(x._payload),E)}if(Al(x))return m(y,_,x,E);if(Ia(x))return v(y,_,x,E);Gu(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,_!==null&&_.tag===6?(n(y,_.sibling),_=s(_,x),_.return=y,y=_):(n(y,_),_=Ip(x,y.mode,E),_.return=y,y=_),o(y)):n(y,_)}return w}var Xo=XT(!0),JT=XT(!1),hh=Ks(null),fh=null,po=null,Dy=null;function My(){Dy=po=fh=null}function $y(t){var e=hh.current;Ie(hh),t._currentValue=e}function vm(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ro(t,e){fh=t,Dy=po=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Vt=!0),t.firstContext=null)}function En(t){var e=t._currentValue;if(Dy!==t)if(t={context:t,memoizedValue:e,next:null},po===null){if(fh===null)throw Error(D(308));po=t,fh.dependencies={lanes:0,firstContext:t}}else po=po.next=t;return e}var li=null;function Fy(t){li===null?li=[t]:li.push(t)}function ZT(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,Fy(e)):(n.next=s.next,s.next=n),e.interleaved=n,Br(t,r)}function Br(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var us=!1;function Vy(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function eP(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Fr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function js(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,pe&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,Br(t,n)}return s=r.interleaved,s===null?(e.next=e,Fy(r)):(e.next=s.next,s.next=e),r.interleaved=e,Br(t,n)}function Rd(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Ty(t,n)}}function $w(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ph(t,e,n,r){var s=t.updateQueue;us=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,u=c=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=t,v=a;switch(f=e,p=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=Ue({},d,f);break e;case 2:us=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(u===null&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Ti|=o,t.lanes=o,t.memoizedState=d}}function Fw(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(D(191,s));s.call(r)}}}var pu={},pr=Ks(pu),kc=Ks(pu),Rc=Ks(pu);function ci(t){if(t===pu)throw Error(D(174));return t}function Uy(t,e){switch(Ce(Rc,e),Ce(kc,t),Ce(pr,pu),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Xg(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Xg(e,t)}Ie(pr),Ce(pr,e)}function Jo(){Ie(pr),Ie(kc),Ie(Rc)}function tP(t){ci(Rc.current);var e=ci(pr.current),n=Xg(e,t.type);e!==n&&(Ce(kc,t),Ce(pr,n))}function zy(t){kc.current===t&&(Ie(pr),Ie(kc))}var Me=Ks(0);function gh(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Cp=[];function By(){for(var t=0;t<Cp.length;t++)Cp[t]._workInProgressVersionPrimary=null;Cp.length=0}var jd=qr.ReactCurrentDispatcher,kp=qr.ReactCurrentBatchConfig,Si=0,Ve=null,nt=null,ot=null,mh=!1,Jl=!1,jc=0,iN=0;function yt(){throw Error(D(321))}function Hy(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Mn(t[n],e[n]))return!1;return!0}function Wy(t,e,n,r,s,i){if(Si=i,Ve=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,jd.current=t===null||t.memoizedState===null?cN:uN,t=n(r,s),Jl){i=0;do{if(Jl=!1,jc=0,25<=i)throw Error(D(301));i+=1,ot=nt=null,e.updateQueue=null,jd.current=dN,t=n(r,s)}while(Jl)}if(jd.current=vh,e=nt!==null&&nt.next!==null,Si=0,ot=nt=Ve=null,mh=!1,e)throw Error(D(300));return t}function Ky(){var t=jc!==0;return jc=0,t}function Zn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Ve.memoizedState=ot=t:ot=ot.next=t,ot}function Sn(){if(nt===null){var t=Ve.alternate;t=t!==null?t.memoizedState:null}else t=nt.next;var e=ot===null?Ve.memoizedState:ot.next;if(e!==null)ot=e,nt=t;else{if(t===null)throw Error(D(310));nt=t,t={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},ot===null?Ve.memoizedState=ot=t:ot=ot.next=t}return ot}function Ac(t,e){return typeof e=="function"?e(t):e}function Rp(t){var e=Sn(),n=e.queue;if(n===null)throw Error(D(311));n.lastRenderedReducer=t;var r=nt,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var u=c.lane;if((Si&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,Ve.lanes|=u,Ti|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,Mn(r,e.memoizedState)||(Vt=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){s=t;do i=s.lane,Ve.lanes|=i,Ti|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function jp(t){var e=Sn(),n=e.queue;if(n===null)throw Error(D(311));n.lastRenderedReducer=t;var r=n.dispatch,s=n.pending,i=e.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=t(i,o.action),o=o.next;while(o!==s);Mn(i,e.memoizedState)||(Vt=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function nP(){}function rP(t,e){var n=Ve,r=Sn(),s=e(),i=!Mn(r.memoizedState,s);if(i&&(r.memoizedState=s,Vt=!0),r=r.queue,Gy(oP.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||ot!==null&&ot.memoizedState.tag&1){if(n.flags|=2048,Oc(9,iP.bind(null,n,r,s,e),void 0,null),lt===null)throw Error(D(349));Si&30||sP(n,e,s)}return s}function sP(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Ve.updateQueue,e===null?(e={lastEffect:null,stores:null},Ve.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function iP(t,e,n,r){e.value=n,e.getSnapshot=r,aP(e)&&lP(t)}function oP(t,e,n){return n(function(){aP(e)&&lP(t)})}function aP(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Mn(t,n)}catch{return!0}}function lP(t){var e=Br(t,1);e!==null&&Dn(e,t,1,-1)}function Vw(t){var e=Zn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ac,lastRenderedState:t},e.queue=t,t=t.dispatch=lN.bind(null,Ve,t),[e.memoizedState,t]}function Oc(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Ve.updateQueue,e===null?(e={lastEffect:null,stores:null},Ve.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function cP(){return Sn().memoizedState}function Ad(t,e,n,r){var s=Zn();Ve.flags|=t,s.memoizedState=Oc(1|e,n,void 0,r===void 0?null:r)}function gf(t,e,n,r){var s=Sn();r=r===void 0?null:r;var i=void 0;if(nt!==null){var o=nt.memoizedState;if(i=o.destroy,r!==null&&Hy(r,o.deps)){s.memoizedState=Oc(e,n,i,r);return}}Ve.flags|=t,s.memoizedState=Oc(1|e,n,i,r)}function Uw(t,e){return Ad(8390656,8,t,e)}function Gy(t,e){return gf(2048,8,t,e)}function uP(t,e){return gf(4,2,t,e)}function dP(t,e){return gf(4,4,t,e)}function hP(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function fP(t,e,n){return n=n!=null?n.concat([t]):null,gf(4,4,hP.bind(null,e,t),n)}function qy(){}function pP(t,e){var n=Sn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Hy(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function gP(t,e){var n=Sn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Hy(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function mP(t,e,n){return Si&21?(Mn(n,e)||(n=xT(),Ve.lanes|=n,Ti|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Vt=!0),t.memoizedState=n)}function oN(t,e){var n=we;we=n!==0&&4>n?n:4,t(!0);var r=kp.transition;kp.transition={};try{t(!1),e()}finally{we=n,kp.transition=r}}function vP(){return Sn().memoizedState}function aN(t,e,n){var r=Os(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},yP(t))_P(e,n);else if(n=ZT(t,e,n,r),n!==null){var s=At();Dn(n,t,r,s),wP(n,e,r)}}function lN(t,e,n){var r=Os(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(yP(t))_P(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Mn(a,o)){var l=e.interleaved;l===null?(s.next=s,Fy(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=ZT(t,e,s,r),n!==null&&(s=At(),Dn(n,t,r,s),wP(n,e,r))}}function yP(t){var e=t.alternate;return t===Ve||e!==null&&e===Ve}function _P(t,e){Jl=mh=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function wP(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Ty(t,n)}}var vh={readContext:En,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useInsertionEffect:yt,useLayoutEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useMutableSource:yt,useSyncExternalStore:yt,useId:yt,unstable_isNewReconciler:!1},cN={readContext:En,useCallback:function(t,e){return Zn().memoizedState=[t,e===void 0?null:e],t},useContext:En,useEffect:Uw,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ad(4194308,4,hP.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ad(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ad(4,2,t,e)},useMemo:function(t,e){var n=Zn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Zn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=aN.bind(null,Ve,t),[r.memoizedState,t]},useRef:function(t){var e=Zn();return t={current:t},e.memoizedState=t},useState:Vw,useDebugValue:qy,useDeferredValue:function(t){return Zn().memoizedState=t},useTransition:function(){var t=Vw(!1),e=t[0];return t=oN.bind(null,t[1]),Zn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ve,s=Zn();if(Ne){if(n===void 0)throw Error(D(407));n=n()}else{if(n=e(),lt===null)throw Error(D(349));Si&30||sP(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,Uw(oP.bind(null,r,i,t),[t]),r.flags|=2048,Oc(9,iP.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Zn(),e=lt.identifierPrefix;if(Ne){var n=Dr,r=Nr;n=(r&~(1<<32-Nn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=jc++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=iN++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},uN={readContext:En,useCallback:pP,useContext:En,useEffect:Gy,useImperativeHandle:fP,useInsertionEffect:uP,useLayoutEffect:dP,useMemo:gP,useReducer:Rp,useRef:cP,useState:function(){return Rp(Ac)},useDebugValue:qy,useDeferredValue:function(t){var e=Sn();return mP(e,nt.memoizedState,t)},useTransition:function(){var t=Rp(Ac)[0],e=Sn().memoizedState;return[t,e]},useMutableSource:nP,useSyncExternalStore:rP,useId:vP,unstable_isNewReconciler:!1},dN={readContext:En,useCallback:pP,useContext:En,useEffect:Gy,useImperativeHandle:fP,useInsertionEffect:uP,useLayoutEffect:dP,useMemo:gP,useReducer:jp,useRef:cP,useState:function(){return jp(Ac)},useDebugValue:qy,useDeferredValue:function(t){var e=Sn();return nt===null?e.memoizedState=t:mP(e,nt.memoizedState,t)},useTransition:function(){var t=jp(Ac)[0],e=Sn().memoizedState;return[t,e]},useMutableSource:nP,useSyncExternalStore:rP,useId:vP,unstable_isNewReconciler:!1};function kn(t,e){if(t&&t.defaultProps){e=Ue({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function ym(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Ue({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var mf={isMounted:function(t){return(t=t._reactInternals)?Li(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=At(),s=Os(t),i=Fr(r,s);i.payload=e,n!=null&&(i.callback=n),e=js(t,i,s),e!==null&&(Dn(e,t,s,r),Rd(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=At(),s=Os(t),i=Fr(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=js(t,i,s),e!==null&&(Dn(e,t,s,r),Rd(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=At(),r=Os(t),s=Fr(n,r);s.tag=2,e!=null&&(s.callback=e),e=js(t,s,r),e!==null&&(Dn(e,t,r,n),Rd(e,t,r))}};function zw(t,e,n,r,s,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,o):e.prototype&&e.prototype.isPureReactComponent?!Sc(n,r)||!Sc(s,i):!0}function xP(t,e,n){var r=!1,s=$s,i=e.contextType;return typeof i=="object"&&i!==null?i=En(i):(s=Bt(e)?bi:St.current,r=e.contextTypes,i=(r=r!=null)?Yo(t,s):$s),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=mf,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function Bw(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&mf.enqueueReplaceState(e,e.state,null)}function _m(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},Vy(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=En(i):(i=Bt(e)?bi:St.current,s.context=Yo(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(ym(t,e,i,n),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&mf.enqueueReplaceState(s,s.state,null),ph(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function Zo(t,e){try{var n="",r=e;do n+=FL(r),r=r.return;while(r);var s=n}catch(i){s=`
Error generating stack: `+i.message+`
`+i.stack}return{value:t,source:e,stack:s,digest:null}}function Ap(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function wm(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var hN=typeof WeakMap=="function"?WeakMap:Map;function bP(t,e,n){n=Fr(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){_h||(_h=!0,jm=r),wm(t,e)},n}function EP(t,e,n){n=Fr(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var s=e.value;n.payload=function(){return r(s)},n.callback=function(){wm(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){wm(t,e),typeof r!="function"&&(As===null?As=new Set([this]):As.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Hw(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new hN;var s=new Set;r.set(e,s)}else s=r.get(e),s===void 0&&(s=new Set,r.set(e,s));s.has(n)||(s.add(n),t=PN.bind(null,t,e,n),e.then(t,t))}function Ww(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Kw(t,e,n,r,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Fr(-1,1),e.tag=2,js(n,e,1))),n.lanes|=1),t)}var fN=qr.ReactCurrentOwner,Vt=!1;function kt(t,e,n,r){e.child=t===null?JT(e,null,n,r):Xo(e,t.child,n,r)}function Gw(t,e,n,r,s){n=n.render;var i=e.ref;return Ro(e,s),r=Wy(t,e,n,r,i,s),n=Ky(),t!==null&&!Vt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Hr(t,e,s)):(Ne&&n&&Iy(e),e.flags|=1,kt(t,e,r,s),e.child)}function qw(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!n0(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,SP(t,e,i,r,s)):(t=Nd(n.type,null,r,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Sc,n(o,r)&&t.ref===e.ref)return Hr(t,e,s)}return e.flags|=1,t=Is(i,r),t.ref=e.ref,t.return=e,e.child=t}function SP(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(Sc(i,r)&&t.ref===e.ref)if(Vt=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(Vt=!0);else return e.lanes=t.lanes,Hr(t,e,s)}return xm(t,e,n,r,s)}function TP(t,e,n){var r=e.pendingProps,s=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ce(mo,Xt),Xt|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Ce(mo,Xt),Xt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ce(mo,Xt),Xt|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,Ce(mo,Xt),Xt|=r;return kt(t,e,s,n),e.child}function PP(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function xm(t,e,n,r,s){var i=Bt(n)?bi:St.current;return i=Yo(e,i),Ro(e,s),n=Wy(t,e,n,r,i,s),r=Ky(),t!==null&&!Vt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Hr(t,e,s)):(Ne&&r&&Iy(e),e.flags|=1,kt(t,e,n,s),e.child)}function Yw(t,e,n,r,s){if(Bt(n)){var i=!0;ch(e)}else i=!1;if(Ro(e,s),e.stateNode===null)Od(t,e),xP(e,n,r),_m(e,n,r,s),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=En(c):(c=Bt(n)?bi:St.current,c=Yo(e,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Bw(e,o,r,c),us=!1;var f=e.memoizedState;o.state=f,ph(e,r,o,s),l=e.memoizedState,a!==r||f!==l||zt.current||us?(typeof u=="function"&&(ym(e,n,u,r),l=e.memoizedState),(a=us||zw(e,n,a,r,f,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,eP(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:kn(e.type,a),o.props=c,d=e.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=En(l):(l=Bt(n)?bi:St.current,l=Yo(e,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==l)&&Bw(e,o,r,l),us=!1,f=e.memoizedState,o.state=f,ph(e,r,o,s);var m=e.memoizedState;a!==d||f!==m||zt.current||us?(typeof p=="function"&&(ym(e,n,p,r),m=e.memoizedState),(c=us||zw(e,n,c,r,f,m,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),o.props=r,o.state=m,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return bm(t,e,n,r,i,s)}function bm(t,e,n,r,s,i){PP(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return s&&Lw(e,n,!1),Hr(t,e,i);r=e.stateNode,fN.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Xo(e,t.child,null,i),e.child=Xo(e,null,a,i)):kt(t,e,a,i),e.memoizedState=r.state,s&&Lw(e,n,!0),e.child}function CP(t){var e=t.stateNode;e.pendingContext?Iw(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Iw(t,e.context,!1),Uy(t,e.containerInfo)}function Qw(t,e,n,r,s){return Qo(),Ny(s),e.flags|=256,kt(t,e,n,r),e.child}var Em={dehydrated:null,treeContext:null,retryLane:0};function Sm(t){return{baseLanes:t,cachePool:null,transitions:null}}function kP(t,e,n){var r=e.pendingProps,s=Me.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(s&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),Ce(Me,s&1),t===null)return mm(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,i?(r=e.mode,i=e.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=_f(o,r,0,null),t=yi(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Sm(n),e.memoizedState=Em,t):Yy(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return pN(t,e,o,r,a,s,n);if(i){i=r.fallback,o=e.mode,s=t.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Is(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Is(a,i):(i=yi(i,o,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,o=t.child.memoizedState,o=o===null?Sm(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=Em,r}return i=t.child,t=i.sibling,r=Is(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Yy(t,e){return e=_f({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function qu(t,e,n,r){return r!==null&&Ny(r),Xo(e,t.child,null,n),t=Yy(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function pN(t,e,n,r,s,i,o){if(n)return e.flags&256?(e.flags&=-257,r=Ap(Error(D(422))),qu(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=_f({mode:"visible",children:r.children},s,0,null),i=yi(i,s,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&Xo(e,t.child,null,o),e.child.memoizedState=Sm(o),e.memoizedState=Em,i);if(!(e.mode&1))return qu(t,e,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(D(419)),r=Ap(i,r,void 0),qu(t,e,o,r)}if(a=(o&t.childLanes)!==0,Vt||a){if(r=lt,r!==null){switch(o&-o){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&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Br(t,s),Dn(r,t,s,-1))}return t0(),r=Ap(Error(D(421))),qu(t,e,o,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=CN.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,Zt=Rs(s.nextSibling),tn=e,Ne=!0,In=null,t!==null&&(gn[mn++]=Nr,gn[mn++]=Dr,gn[mn++]=Ei,Nr=t.id,Dr=t.overflow,Ei=e),e=Yy(e,r.children),e.flags|=4096,e)}function Xw(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),vm(t.return,e,n)}function Op(t,e,n,r,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function RP(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(kt(t,e,r.children,n),r=Me.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Xw(t,n,e);else if(t.tag===19)Xw(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Ce(Me,r),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(n=e.child,s=null;n!==null;)t=n.alternate,t!==null&&gh(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),Op(e,!1,s,n,i);break;case"backwards":for(n=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&gh(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}Op(e,!0,n,null,i);break;case"together":Op(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Od(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Hr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ti|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(D(153));if(e.child!==null){for(t=e.child,n=Is(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Is(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function gN(t,e,n){switch(e.tag){case 3:CP(e),Qo();break;case 5:tP(e);break;case 1:Bt(e.type)&&ch(e);break;case 4:Uy(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;Ce(hh,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Ce(Me,Me.current&1),e.flags|=128,null):n&e.child.childLanes?kP(t,e,n):(Ce(Me,Me.current&1),t=Hr(t,e,n),t!==null?t.sibling:null);Ce(Me,Me.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return RP(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ce(Me,Me.current),r)break;return null;case 22:case 23:return e.lanes=0,TP(t,e,n)}return Hr(t,e,n)}var jP,Tm,AP,OP;jP=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Tm=function(){};AP=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,ci(pr.current);var i=null;switch(n){case"input":s=Gg(t,s),r=Gg(t,r),i=[];break;case"select":s=Ue({},s,{value:void 0}),r=Ue({},r,{value:void 0}),i=[];break;case"textarea":s=Qg(t,s),r=Qg(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=ah)}Jg(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(vc.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(vc.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ae("scroll",t),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(e.updateQueue=c)&&(e.flags|=4)}};OP=function(t,e,n,r){n!==r&&(e.flags|=4)};function Fa(t,e){if(!Ne)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function _t(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function mN(t,e,n){var r=e.pendingProps;switch(Ly(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(e),null;case 1:return Bt(e.type)&&lh(),_t(e),null;case 3:return r=e.stateNode,Jo(),Ie(zt),Ie(St),By(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Ku(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,In!==null&&(Im(In),In=null))),Tm(t,e),_t(e),null;case 5:zy(e);var s=ci(Rc.current);if(n=e.type,t!==null&&e.stateNode!=null)AP(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(D(166));return _t(e),null}if(t=ci(pr.current),Ku(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[sr]=e,r[Cc]=i,t=(e.mode&1)!==0,n){case"dialog":Ae("cancel",r),Ae("close",r);break;case"iframe":case"object":case"embed":Ae("load",r);break;case"video":case"audio":for(s=0;s<Il.length;s++)Ae(Il[s],r);break;case"source":Ae("error",r);break;case"img":case"image":case"link":Ae("error",r),Ae("load",r);break;case"details":Ae("toggle",r);break;case"input":ow(r,i),Ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ae("invalid",r);break;case"textarea":lw(r,i),Ae("invalid",r)}Jg(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Wu(r.textContent,a,t),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Wu(r.textContent,a,t),s=["children",""+a]):vc.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ae("scroll",r)}switch(n){case"input":Mu(r),aw(r,i,!0);break;case"textarea":Mu(r),cw(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ah)}r=s,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=oT(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[sr]=e,t[Cc]=r,jP(t,e,!1,!1),e.stateNode=t;e:{switch(o=Zg(n,r),n){case"dialog":Ae("cancel",t),Ae("close",t),s=r;break;case"iframe":case"object":case"embed":Ae("load",t),s=r;break;case"video":case"audio":for(s=0;s<Il.length;s++)Ae(Il[s],t);s=r;break;case"source":Ae("error",t),s=r;break;case"img":case"image":case"link":Ae("error",t),Ae("load",t),s=r;break;case"details":Ae("toggle",t),s=r;break;case"input":ow(t,r),s=Gg(t,r),Ae("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=Ue({},r,{value:void 0}),Ae("invalid",t);break;case"textarea":lw(t,r),s=Qg(t,r),Ae("invalid",t);break;default:s=r}Jg(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?cT(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&aT(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&yc(t,l):typeof l=="number"&&yc(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(vc.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ae("scroll",t):l!=null&&_y(t,i,l,o))}switch(n){case"input":Mu(t),aw(t,r,!1);break;case"textarea":Mu(t),cw(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Ms(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?To(t,!!r.multiple,i,!1):r.defaultValue!=null&&To(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=ah)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return _t(e),null;case 6:if(t&&e.stateNode!=null)OP(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(D(166));if(n=ci(Rc.current),ci(pr.current),Ku(e)){if(r=e.stateNode,n=e.memoizedProps,r[sr]=e,(i=r.nodeValue!==n)&&(t=tn,t!==null))switch(t.tag){case 3:Wu(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Wu(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[sr]=e,e.stateNode=r}return _t(e),null;case 13:if(Ie(Me),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Ne&&Zt!==null&&e.mode&1&&!(e.flags&128))QT(),Qo(),e.flags|=98560,i=!1;else if(i=Ku(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(D(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(D(317));i[sr]=e}else Qo(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;_t(e),i=!1}else In!==null&&(Im(In),In=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Me.current&1?rt===0&&(rt=3):t0())),e.updateQueue!==null&&(e.flags|=4),_t(e),null);case 4:return Jo(),Tm(t,e),t===null&&Tc(e.stateNode.containerInfo),_t(e),null;case 10:return $y(e.type._context),_t(e),null;case 17:return Bt(e.type)&&lh(),_t(e),null;case 19:if(Ie(Me),i=e.memoizedState,i===null)return _t(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)Fa(i,!1);else{if(rt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=gh(t),o!==null){for(e.flags|=128,Fa(i,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)i=n,t=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Ce(Me,Me.current&1|2),e.child}t=t.sibling}i.tail!==null&&Ye()>ea&&(e.flags|=128,r=!0,Fa(i,!1),e.lanes=4194304)}else{if(!r)if(t=gh(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Fa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ne)return _t(e),null}else 2*Ye()-i.renderingStartTime>ea&&n!==1073741824&&(e.flags|=128,r=!0,Fa(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ye(),e.sibling=null,n=Me.current,Ce(Me,r?n&1|2:n&1),e):(_t(e),null);case 22:case 23:return e0(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Xt&1073741824&&(_t(e),e.subtreeFlags&6&&(e.flags|=8192)):_t(e),null;case 24:return null;case 25:return null}throw Error(D(156,e.tag))}function vN(t,e){switch(Ly(e),e.tag){case 1:return Bt(e.type)&&lh(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Jo(),Ie(zt),Ie(St),By(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return zy(e),null;case 13:if(Ie(Me),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(D(340));Qo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ie(Me),null;case 4:return Jo(),null;case 10:return $y(e.type._context),null;case 22:case 23:return e0(),null;case 24:return null;default:return null}}var Yu=!1,Et=!1,yN=typeof WeakSet=="function"?WeakSet:Set,Q=null;function go(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ke(t,e,r)}else n.current=null}function Pm(t,e,n){try{n()}catch(r){Ke(t,e,r)}}var Jw=!1;function _N(t,e){if(cm=sh,t=MT(),Oy(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===s&&(a=o),f===i&&++u===r&&(l=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(um={focusedElem:t,selectionRange:n},sh=!1,Q=e;Q!==null;)if(e=Q,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Q=t;else for(;Q!==null;){e=Q;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,w=m.memoizedState,y=e.stateNode,_=y.getSnapshotBeforeUpdate(e.elementType===e.type?v:kn(e.type,v),w);y.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(E){Ke(e,e.return,E)}if(t=e.sibling,t!==null){t.return=e.return,Q=t;break}Q=e.return}return m=Jw,Jw=!1,m}function Zl(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&Pm(e,n,i)}s=s.next}while(s!==r)}}function vf(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Cm(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function IP(t){var e=t.alternate;e!==null&&(t.alternate=null,IP(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[sr],delete e[Cc],delete e[fm],delete e[tN],delete e[nN])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function LP(t){return t.tag===5||t.tag===3||t.tag===4}function Zw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||LP(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function km(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ah));else if(r!==4&&(t=t.child,t!==null))for(km(t,e,n),t=t.sibling;t!==null;)km(t,e,n),t=t.sibling}function Rm(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Rm(t,e,n),t=t.sibling;t!==null;)Rm(t,e,n),t=t.sibling}var ct=null,An=!1;function Jr(t,e,n){for(n=n.child;n!==null;)NP(t,e,n),n=n.sibling}function NP(t,e,n){if(fr&&typeof fr.onCommitFiberUnmount=="function")try{fr.onCommitFiberUnmount(cf,n)}catch{}switch(n.tag){case 5:Et||go(n,e);case 6:var r=ct,s=An;ct=null,Jr(t,e,n),ct=r,An=s,ct!==null&&(An?(t=ct,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):ct.removeChild(n.stateNode));break;case 18:ct!==null&&(An?(t=ct,n=n.stateNode,t.nodeType===8?Tp(t.parentNode,n):t.nodeType===1&&Tp(t,n),bc(t)):Tp(ct,n.stateNode));break;case 4:r=ct,s=An,ct=n.stateNode.containerInfo,An=!0,Jr(t,e,n),ct=r,An=s;break;case 0:case 11:case 14:case 15:if(!Et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Pm(n,e,o),s=s.next}while(s!==r)}Jr(t,e,n);break;case 1:if(!Et&&(go(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ke(n,e,a)}Jr(t,e,n);break;case 21:Jr(t,e,n);break;case 22:n.mode&1?(Et=(r=Et)||n.memoizedState!==null,Jr(t,e,n),Et=r):Jr(t,e,n);break;default:Jr(t,e,n)}}function ex(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new yN),e.forEach(function(r){var s=kN.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Tn(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:ct=a.stateNode,An=!1;break e;case 3:ct=a.stateNode.containerInfo,An=!0;break e;case 4:ct=a.stateNode.containerInfo,An=!0;break e}a=a.return}if(ct===null)throw Error(D(160));NP(i,o,s),ct=null,An=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Ke(s,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)DP(e,t),e=e.sibling}function DP(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Tn(e,t),qn(t),r&4){try{Zl(3,t,t.return),vf(3,t)}catch(v){Ke(t,t.return,v)}try{Zl(5,t,t.return)}catch(v){Ke(t,t.return,v)}}break;case 1:Tn(e,t),qn(t),r&512&&n!==null&&go(n,n.return);break;case 5:if(Tn(e,t),qn(t),r&512&&n!==null&&go(n,n.return),t.flags&32){var s=t.stateNode;try{yc(s,"")}catch(v){Ke(t,t.return,v)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&sT(s,i),Zg(a,o);var c=Zg(a,i);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?cT(s,d):u==="dangerouslySetInnerHTML"?aT(s,d):u==="children"?yc(s,d):_y(s,u,d,c)}switch(a){case"input":qg(s,i);break;case"textarea":iT(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?To(s,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?To(s,!!i.multiple,i.defaultValue,!0):To(s,!!i.multiple,i.multiple?[]:"",!1))}s[Cc]=i}catch(v){Ke(t,t.return,v)}}break;case 6:if(Tn(e,t),qn(t),r&4){if(t.stateNode===null)throw Error(D(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(v){Ke(t,t.return,v)}}break;case 3:if(Tn(e,t),qn(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{bc(e.containerInfo)}catch(v){Ke(t,t.return,v)}break;case 4:Tn(e,t),qn(t);break;case 13:Tn(e,t),qn(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Jy=Ye())),r&4&&ex(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(Et=(c=Et)||u,Tn(e,t),Et=c):Tn(e,t),qn(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&t.mode&1)for(Q=t,u=t.child;u!==null;){for(d=Q=u;Q!==null;){switch(f=Q,p=f.child,f.tag){case 0:case 11:case 14:case 15:Zl(4,f,f.return);break;case 1:go(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,m.props=e.memoizedProps,m.state=e.memoizedState,m.componentWillUnmount()}catch(v){Ke(r,n,v)}}break;case 5:go(f,f.return);break;case 22:if(f.memoizedState!==null){nx(d);continue}}p!==null?(p.return=f,Q=p):nx(d)}u=u.sibling}e:for(u=null,d=t;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=lT("display",o))}catch(v){Ke(t,t.return,v)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(v){Ke(t,t.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Tn(e,t),qn(t),r&4&&ex(t);break;case 21:break;default:Tn(e,t),qn(t)}}function qn(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(LP(n)){var r=n;break e}n=n.return}throw Error(D(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(yc(s,""),r.flags&=-33);var i=Zw(t);Rm(t,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Zw(t);km(t,a,o);break;default:throw Error(D(161))}}catch(l){Ke(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function wN(t,e,n){Q=t,MP(t)}function MP(t,e,n){for(var r=(t.mode&1)!==0;Q!==null;){var s=Q,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Yu;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||Et;a=Yu;var c=Et;if(Yu=o,(Et=l)&&!c)for(Q=s;Q!==null;)o=Q,l=o.child,o.tag===22&&o.memoizedState!==null?rx(s):l!==null?(l.return=o,Q=l):rx(s);for(;i!==null;)Q=i,MP(i),i=i.sibling;Q=s,Yu=a,Et=c}tx(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Q=i):tx(t)}}function tx(t){for(;Q!==null;){var e=Q;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Et||vf(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Et)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:kn(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Fw(e,i,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Fw(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&bc(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(D(163))}Et||e.flags&512&&Cm(e)}catch(f){Ke(e,e.return,f)}}if(e===t){Q=null;break}if(n=e.sibling,n!==null){n.return=e.return,Q=n;break}Q=e.return}}function nx(t){for(;Q!==null;){var e=Q;if(e===t){Q=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Q=n;break}Q=e.return}}function rx(t){for(;Q!==null;){var e=Q;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{vf(4,e)}catch(l){Ke(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(l){Ke(e,s,l)}}var i=e.return;try{Cm(e)}catch(l){Ke(e,i,l)}break;case 5:var o=e.return;try{Cm(e)}catch(l){Ke(e,o,l)}}}catch(l){Ke(e,e.return,l)}if(e===t){Q=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Q=a;break}Q=e.return}}var xN=Math.ceil,yh=qr.ReactCurrentDispatcher,Qy=qr.ReactCurrentOwner,yn=qr.ReactCurrentBatchConfig,pe=0,lt=null,et=null,ft=0,Xt=0,mo=Ks(0),rt=0,Ic=null,Ti=0,yf=0,Xy=0,ec=null,$t=null,Jy=0,ea=1/0,Rr=null,_h=!1,jm=null,As=null,Qu=!1,bs=null,wh=0,tc=0,Am=null,Id=-1,Ld=0;function At(){return pe&6?Ye():Id!==-1?Id:Id=Ye()}function Os(t){return t.mode&1?pe&2&&ft!==0?ft&-ft:sN.transition!==null?(Ld===0&&(Ld=xT()),Ld):(t=we,t!==0||(t=window.event,t=t===void 0?16:kT(t.type)),t):1}function Dn(t,e,n,r){if(50<tc)throw tc=0,Am=null,Error(D(185));du(t,n,r),(!(pe&2)||t!==lt)&&(t===lt&&(!(pe&2)&&(yf|=n),rt===4&&ps(t,ft)),Ht(t,r),n===1&&pe===0&&!(e.mode&1)&&(ea=Ye()+500,pf&&Gs()))}function Ht(t,e){var n=t.callbackNode;s2(t,e);var r=rh(t,t===lt?ft:0);if(r===0)n!==null&&hw(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&hw(n),e===1)t.tag===0?rN(sx.bind(null,t)):GT(sx.bind(null,t)),Z2(function(){!(pe&6)&&Gs()}),n=null;else{switch(bT(r)){case 1:n=Sy;break;case 4:n=_T;break;case 16:n=nh;break;case 536870912:n=wT;break;default:n=nh}n=WP(n,$P.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function $P(t,e){if(Id=-1,Ld=0,pe&6)throw Error(D(327));var n=t.callbackNode;if(jo()&&t.callbackNode!==n)return null;var r=rh(t,t===lt?ft:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=xh(t,r);else{e=r;var s=pe;pe|=2;var i=VP();(lt!==t||ft!==e)&&(Rr=null,ea=Ye()+500,vi(t,e));do try{SN();break}catch(a){FP(t,a)}while(!0);My(),yh.current=i,pe=s,et!==null?e=0:(lt=null,ft=0,e=rt)}if(e!==0){if(e===2&&(s=sm(t),s!==0&&(r=s,e=Om(t,s))),e===1)throw n=Ic,vi(t,0),ps(t,r),Ht(t,Ye()),n;if(e===6)ps(t,r);else{if(s=t.current.alternate,!(r&30)&&!bN(s)&&(e=xh(t,r),e===2&&(i=sm(t),i!==0&&(r=i,e=Om(t,i))),e===1))throw n=Ic,vi(t,0),ps(t,r),Ht(t,Ye()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(D(345));case 2:ni(t,$t,Rr);break;case 3:if(ps(t,r),(r&130023424)===r&&(e=Jy+500-Ye(),10<e)){if(rh(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){At(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=hm(ni.bind(null,t,$t,Rr),e);break}ni(t,$t,Rr);break;case 4:if(ps(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var o=31-Nn(r);i=1<<o,o=e[o],o>s&&(s=o),r&=~i}if(r=s,r=Ye()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*xN(r/1960))-r,10<r){t.timeoutHandle=hm(ni.bind(null,t,$t,Rr),r);break}ni(t,$t,Rr);break;case 5:ni(t,$t,Rr);break;default:throw Error(D(329))}}}return Ht(t,Ye()),t.callbackNode===n?$P.bind(null,t):null}function Om(t,e){var n=ec;return t.current.memoizedState.isDehydrated&&(vi(t,e).flags|=256),t=xh(t,e),t!==2&&(e=$t,$t=n,e!==null&&Im(e)),t}function Im(t){$t===null?$t=t:$t.push.apply($t,t)}function bN(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!Mn(i(),s))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ps(t,e){for(e&=~Xy,e&=~yf,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Nn(e),r=1<<n;t[n]=-1,e&=~r}}function sx(t){if(pe&6)throw Error(D(327));jo();var e=rh(t,0);if(!(e&1))return Ht(t,Ye()),null;var n=xh(t,e);if(t.tag!==0&&n===2){var r=sm(t);r!==0&&(e=r,n=Om(t,r))}if(n===1)throw n=Ic,vi(t,0),ps(t,e),Ht(t,Ye()),n;if(n===6)throw Error(D(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ni(t,$t,Rr),Ht(t,Ye()),null}function Zy(t,e){var n=pe;pe|=1;try{return t(e)}finally{pe=n,pe===0&&(ea=Ye()+500,pf&&Gs())}}function Pi(t){bs!==null&&bs.tag===0&&!(pe&6)&&jo();var e=pe;pe|=1;var n=yn.transition,r=we;try{if(yn.transition=null,we=1,t)return t()}finally{we=r,yn.transition=n,pe=e,!(pe&6)&&Gs()}}function e0(){Xt=mo.current,Ie(mo)}function vi(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,J2(n)),et!==null)for(n=et.return;n!==null;){var r=n;switch(Ly(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&lh();break;case 3:Jo(),Ie(zt),Ie(St),By();break;case 5:zy(r);break;case 4:Jo();break;case 13:Ie(Me);break;case 19:Ie(Me);break;case 10:$y(r.type._context);break;case 22:case 23:e0()}n=n.return}if(lt=t,et=t=Is(t.current,null),ft=Xt=e,rt=0,Ic=null,Xy=yf=Ti=0,$t=ec=null,li!==null){for(e=0;e<li.length;e++)if(n=li[e],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}li=null}return t}function FP(t,e){do{var n=et;try{if(My(),jd.current=vh,mh){for(var r=Ve.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}mh=!1}if(Si=0,ot=nt=Ve=null,Jl=!1,jc=0,Qy.current=null,n===null||n.return===null){rt=1,Ic=e,et=null;break}e:{var i=t,o=n.return,a=n,l=e;if(e=ft,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Ww(o);if(p!==null){p.flags&=-257,Kw(p,o,a,i,e),p.mode&1&&Hw(i,c,e),e=p,l=c;var m=e.updateQueue;if(m===null){var v=new Set;v.add(l),e.updateQueue=v}else m.add(l);break e}else{if(!(e&1)){Hw(i,c,e),t0();break e}l=Error(D(426))}}else if(Ne&&a.mode&1){var w=Ww(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Kw(w,o,a,i,e),Ny(Zo(l,a));break e}}i=l=Zo(l,a),rt!==4&&(rt=2),ec===null?ec=[i]:ec.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var y=bP(i,l,e);$w(i,y);break e;case 1:a=l;var _=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof _.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(As===null||!As.has(x)))){i.flags|=65536,e&=-e,i.lanes|=e;var E=EP(i,a,e);$w(i,E);break e}}i=i.return}while(i!==null)}zP(n)}catch(b){e=b,et===n&&n!==null&&(et=n=n.return);continue}break}while(!0)}function VP(){var t=yh.current;return yh.current=vh,t===null?vh:t}function t0(){(rt===0||rt===3||rt===2)&&(rt=4),lt===null||!(Ti&268435455)&&!(yf&268435455)||ps(lt,ft)}function xh(t,e){var n=pe;pe|=2;var r=VP();(lt!==t||ft!==e)&&(Rr=null,vi(t,e));do try{EN();break}catch(s){FP(t,s)}while(!0);if(My(),pe=n,yh.current=r,et!==null)throw Error(D(261));return lt=null,ft=0,rt}function EN(){for(;et!==null;)UP(et)}function SN(){for(;et!==null&&!YL();)UP(et)}function UP(t){var e=HP(t.alternate,t,Xt);t.memoizedProps=t.pendingProps,e===null?zP(t):et=e,Qy.current=null}function zP(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=vN(n,e),n!==null){n.flags&=32767,et=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{rt=6,et=null;return}}else if(n=mN(n,e,Xt),n!==null){et=n;return}if(e=e.sibling,e!==null){et=e;return}et=e=t}while(e!==null);rt===0&&(rt=5)}function ni(t,e,n){var r=we,s=yn.transition;try{yn.transition=null,we=1,TN(t,e,n,r)}finally{yn.transition=s,we=r}return null}function TN(t,e,n,r){do jo();while(bs!==null);if(pe&6)throw Error(D(327));n=t.finishedWork;var s=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(D(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(i2(t,i),t===lt&&(et=lt=null,ft=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Qu||(Qu=!0,WP(nh,function(){return jo(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=yn.transition,yn.transition=null;var o=we;we=1;var a=pe;pe|=4,Qy.current=null,_N(t,n),DP(n,t),W2(um),sh=!!cm,um=cm=null,t.current=n,wN(n),QL(),pe=a,we=o,yn.transition=i}else t.current=n;if(Qu&&(Qu=!1,bs=t,wh=s),i=t.pendingLanes,i===0&&(As=null),ZL(n.stateNode),Ht(t,Ye()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)s=e[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(_h)throw _h=!1,t=jm,jm=null,t;return wh&1&&t.tag!==0&&jo(),i=t.pendingLanes,i&1?t===Am?tc++:(tc=0,Am=t):tc=0,Gs(),null}function jo(){if(bs!==null){var t=bT(wh),e=yn.transition,n=we;try{if(yn.transition=null,we=16>t?16:t,bs===null)var r=!1;else{if(t=bs,bs=null,wh=0,pe&6)throw Error(D(331));var s=pe;for(pe|=4,Q=t.current;Q!==null;){var i=Q,o=i.child;if(Q.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Q=c;Q!==null;){var u=Q;switch(u.tag){case 0:case 11:case 15:Zl(8,u,i)}var d=u.child;if(d!==null)d.return=u,Q=d;else for(;Q!==null;){u=Q;var f=u.sibling,p=u.return;if(IP(u),u===c){Q=null;break}if(f!==null){f.return=p,Q=f;break}Q=p}}}var m=i.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}Q=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Q=o;else e:for(;Q!==null;){if(i=Q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Zl(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,Q=y;break e}Q=i.return}}var _=t.current;for(Q=_;Q!==null;){o=Q;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,Q=x;else e:for(o=_;Q!==null;){if(a=Q,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:vf(9,a)}}catch(b){Ke(a,a.return,b)}if(a===o){Q=null;break e}var E=a.sibling;if(E!==null){E.return=a.return,Q=E;break e}Q=a.return}}if(pe=s,Gs(),fr&&typeof fr.onPostCommitFiberRoot=="function")try{fr.onPostCommitFiberRoot(cf,t)}catch{}r=!0}return r}finally{we=n,yn.transition=e}}return!1}function ix(t,e,n){e=Zo(n,e),e=bP(t,e,1),t=js(t,e,1),e=At(),t!==null&&(du(t,1,e),Ht(t,e))}function Ke(t,e,n){if(t.tag===3)ix(t,t,n);else for(;e!==null;){if(e.tag===3){ix(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(As===null||!As.has(r))){t=Zo(n,t),t=EP(e,t,1),e=js(e,t,1),t=At(),e!==null&&(du(e,1,t),Ht(e,t));break}}e=e.return}}function PN(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=At(),t.pingedLanes|=t.suspendedLanes&n,lt===t&&(ft&n)===n&&(rt===4||rt===3&&(ft&130023424)===ft&&500>Ye()-Jy?vi(t,0):Xy|=n),Ht(t,e)}function BP(t,e){e===0&&(t.mode&1?(e=Vu,Vu<<=1,!(Vu&130023424)&&(Vu=4194304)):e=1);var n=At();t=Br(t,e),t!==null&&(du(t,e,n),Ht(t,n))}function CN(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),BP(t,n)}function kN(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(e),BP(t,n)}var HP;HP=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||zt.current)Vt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Vt=!1,gN(t,e,n);Vt=!!(t.flags&131072)}else Vt=!1,Ne&&e.flags&1048576&&qT(e,dh,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Od(t,e),t=e.pendingProps;var s=Yo(e,St.current);Ro(e,n),s=Wy(null,e,r,t,s,n);var i=Ky();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Bt(r)?(i=!0,ch(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Vy(e),s.updater=mf,e.stateNode=s,s._reactInternals=e,_m(e,r,t,n),e=bm(null,e,r,!0,i,n)):(e.tag=0,Ne&&i&&Iy(e),kt(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Od(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=jN(r),t=kn(r,t),s){case 0:e=xm(null,e,r,t,n);break e;case 1:e=Yw(null,e,r,t,n);break e;case 11:e=Gw(null,e,r,t,n);break e;case 14:e=qw(null,e,r,kn(r.type,t),n);break e}throw Error(D(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:kn(r,s),xm(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:kn(r,s),Yw(t,e,r,s,n);case 3:e:{if(CP(e),t===null)throw Error(D(387));r=e.pendingProps,i=e.memoizedState,s=i.element,eP(t,e),ph(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Zo(Error(D(423)),e),e=Qw(t,e,r,n,s);break e}else if(r!==s){s=Zo(Error(D(424)),e),e=Qw(t,e,r,n,s);break e}else for(Zt=Rs(e.stateNode.containerInfo.firstChild),tn=e,Ne=!0,In=null,n=JT(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qo(),r===s){e=Hr(t,e,n);break e}kt(t,e,r,n)}e=e.child}return e;case 5:return tP(e),t===null&&mm(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,dm(r,s)?o=null:i!==null&&dm(r,i)&&(e.flags|=32),PP(t,e),kt(t,e,o,n),e.child;case 6:return t===null&&mm(e),null;case 13:return kP(t,e,n);case 4:return Uy(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Xo(e,null,r,n):kt(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:kn(r,s),Gw(t,e,r,s,n);case 7:return kt(t,e,e.pendingProps,n),e.child;case 8:return kt(t,e,e.pendingProps.children,n),e.child;case 12:return kt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,Ce(hh,r._currentValue),r._currentValue=o,i!==null)if(Mn(i.value,o)){if(i.children===s.children&&!zt.current){e=Hr(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Fr(-1,n&-n),l.tag=2;var c=i.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}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),vm(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(D(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),vm(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}kt(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Ro(e,n),s=En(s),r=r(s),e.flags|=1,kt(t,e,r,n),e.child;case 14:return r=e.type,s=kn(r,e.pendingProps),s=kn(r.type,s),qw(t,e,r,s,n);case 15:return SP(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:kn(r,s),Od(t,e),e.tag=1,Bt(r)?(t=!0,ch(e)):t=!1,Ro(e,n),xP(e,r,s),_m(e,r,s,n),bm(null,e,r,!0,t,n);case 19:return RP(t,e,n);case 22:return TP(t,e,n)}throw Error(D(156,e.tag))};function WP(t,e){return yT(t,e)}function RN(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vn(t,e,n,r){return new RN(t,e,n,r)}function n0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function jN(t){if(typeof t=="function")return n0(t)?1:0;if(t!=null){if(t=t.$$typeof,t===xy)return 11;if(t===by)return 14}return 2}function Is(t,e){var n=t.alternate;return n===null?(n=vn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Nd(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")n0(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case io:return yi(n.children,s,i,e);case wy:o=8,s|=8;break;case Bg:return t=vn(12,n,e,s|2),t.elementType=Bg,t.lanes=i,t;case Hg:return t=vn(13,n,e,s),t.elementType=Hg,t.lanes=i,t;case Wg:return t=vn(19,n,e,s),t.elementType=Wg,t.lanes=i,t;case tT:return _f(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ZS:o=10;break e;case eT:o=9;break e;case xy:o=11;break e;case by:o=14;break e;case cs:o=16,r=null;break e}throw Error(D(130,t==null?t:typeof t,""))}return e=vn(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function yi(t,e,n,r){return t=vn(7,t,r,e),t.lanes=n,t}function _f(t,e,n,r){return t=vn(22,t,r,e),t.elementType=tT,t.lanes=n,t.stateNode={isHidden:!1},t}function Ip(t,e,n){return t=vn(6,t,null,e),t.lanes=n,t}function Lp(t,e,n){return e=vn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function AN(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pp(0),this.expirationTimes=pp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pp(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function r0(t,e,n,r,s,i,o,a,l){return t=new AN(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=vn(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vy(i),t}function ON(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:so,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function KP(t){if(!t)return $s;t=t._reactInternals;e:{if(Li(t)!==t||t.tag!==1)throw Error(D(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Bt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(D(171))}if(t.tag===1){var n=t.type;if(Bt(n))return KT(t,n,e)}return e}function GP(t,e,n,r,s,i,o,a,l){return t=r0(n,r,!0,t,s,i,o,a,l),t.context=KP(null),n=t.current,r=At(),s=Os(n),i=Fr(r,s),i.callback=e??null,js(n,i,s),t.current.lanes=s,du(t,s,r),Ht(t,r),t}function wf(t,e,n,r){var s=e.current,i=At(),o=Os(s);return n=KP(n),e.context===null?e.context=n:e.pendingContext=n,e=Fr(i,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=js(s,e,o),t!==null&&(Dn(t,s,o,i),Rd(t,s,o)),o}function bh(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function ox(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function s0(t,e){ox(t,e),(t=t.alternate)&&ox(t,e)}function IN(){return null}var qP=typeof reportError=="function"?reportError:function(t){console.error(t)};function i0(t){this._internalRoot=t}xf.prototype.render=i0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(D(409));wf(t,e,null,null)};xf.prototype.unmount=i0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Pi(function(){wf(null,t,null,null)}),e[zr]=null}};function xf(t){this._internalRoot=t}xf.prototype.unstable_scheduleHydration=function(t){if(t){var e=TT();t={blockedOn:null,target:t,priority:e};for(var n=0;n<fs.length&&e!==0&&e<fs[n].priority;n++);fs.splice(n,0,t),n===0&&CT(t)}};function o0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function bf(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function ax(){}function LN(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=bh(o);i.call(c)}}var o=GP(e,r,t,0,null,!1,!1,"",ax);return t._reactRootContainer=o,t[zr]=o.current,Tc(t.nodeType===8?t.parentNode:t),Pi(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=bh(l);a.call(c)}}var l=r0(t,0,!1,null,null,!1,!1,"",ax);return t._reactRootContainer=l,t[zr]=l.current,Tc(t.nodeType===8?t.parentNode:t),Pi(function(){wf(e,l,n,r)}),l}function Ef(t,e,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=bh(o);a.call(l)}}wf(e,o,t,s)}else o=LN(n,e,t,s,r);return bh(o)}ET=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ol(e.pendingLanes);n!==0&&(Ty(e,n|1),Ht(e,Ye()),!(pe&6)&&(ea=Ye()+500,Gs()))}break;case 13:Pi(function(){var r=Br(t,1);if(r!==null){var s=At();Dn(r,t,1,s)}}),s0(t,1)}};Py=function(t){if(t.tag===13){var e=Br(t,134217728);if(e!==null){var n=At();Dn(e,t,134217728,n)}s0(t,134217728)}};ST=function(t){if(t.tag===13){var e=Os(t),n=Br(t,e);if(n!==null){var r=At();Dn(n,t,e,r)}s0(t,e)}};TT=function(){return we};PT=function(t,e){var n=we;try{return we=t,e()}finally{we=n}};tm=function(t,e,n){switch(e){case"input":if(qg(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var s=ff(r);if(!s)throw Error(D(90));rT(r),qg(r,s)}}}break;case"textarea":iT(t,n);break;case"select":e=n.value,e!=null&&To(t,!!n.multiple,e,!1)}};hT=Zy;fT=Pi;var NN={usingClientEntryPoint:!1,Events:[fu,co,ff,uT,dT,Zy]},Va={findFiberByHostInstance:ai,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},DN={bundleType:Va.bundleType,version:Va.version,rendererPackageName:Va.rendererPackageName,rendererConfig:Va.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=mT(t),t===null?null:t.stateNode},findFiberByHostInstance:Va.findFiberByHostInstance||IN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xu.isDisabled&&Xu.supportsFiber)try{cf=Xu.inject(DN),fr=Xu}catch{}}sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=NN;sn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!o0(e))throw Error(D(200));return ON(t,e,null,n)};sn.createRoot=function(t,e){if(!o0(t))throw Error(D(299));var n=!1,r="",s=qP;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=r0(t,1,!1,null,null,n,!1,r,s),t[zr]=e.current,Tc(t.nodeType===8?t.parentNode:t),new i0(e)};sn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(D(188)):(t=Object.keys(t).join(","),Error(D(268,t)));return t=mT(e),t=t===null?null:t.stateNode,t};sn.flushSync=function(t){return Pi(t)};sn.hydrate=function(t,e,n){if(!bf(e))throw Error(D(200));return Ef(null,t,e,!0,n)};sn.hydrateRoot=function(t,e,n){if(!o0(t))throw Error(D(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=qP;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=GP(e,null,t,1,n??null,s,!1,i,o),t[zr]=e.current,Tc(t),r)for(t=0;t<r.length;t++)n=r[t],s=n._getVersion,s=s(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,s]:e.mutableSourceEagerHydrationData.push(n,s);return new xf(e)};sn.render=function(t,e,n){if(!bf(e))throw Error(D(200));return Ef(null,t,e,!1,n)};sn.unmountComponentAtNode=function(t){if(!bf(t))throw Error(D(40));return t._reactRootContainer?(Pi(function(){Ef(null,null,t,!1,function(){t._reactRootContainer=null,t[zr]=null})}),!0):!1};sn.unstable_batchedUpdates=Zy;sn.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!bf(n))throw Error(D(200));if(t==null||t._reactInternals===void 0)throw Error(D(38));return Ef(t,e,n,!1,r)};sn.version="18.3.1-next-f1338f8080-20240426";function YP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(YP)}catch(t){console.error(t)}}YP(),YS.exports=sn;var gu=YS.exports;const QP=cu(gu);var XP,lx=gu;XP=lx.createRoot,lx.hydrateRoot;const MN="modulepreload",$N=function(t){return"/"+t},cx={},C=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");s=Promise.allSettled(n.map(l=>{if(l=$N(l),l in cx)return;cx[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":MN,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};/**
* @remix-run/router v1.20.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Lc(){return Lc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Lc.apply(this,arguments)}var Es;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Es||(Es={}));const ux="popstate";function FN(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:o,hash:a}=r.location;return Lm("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Eh(s)}return UN(e,n,null,t)}function Qe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function JP(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function VN(){return Math.random().toString(36).substr(2,8)}function dx(t,e){return{usr:t.state,key:t.key,idx:e}}function Lm(t,e,n,r){return n===void 0&&(n=null),Lc({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ma(e):e,{state:n,key:e&&e.key||r||VN()})}function Eh(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ma(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function UN(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Es.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(Lc({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=Es.Pop;let w=u(),y=w==null?null:w-c;c=w,l&&l({action:a,location:v.location,delta:y})}function f(w,y){a=Es.Push;let _=Lm(v.location,w,y);c=u()+1;let x=dx(_,c),E=v.createHref(_);try{o.pushState(x,"",E)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;s.location.assign(E)}i&&l&&l({action:a,location:v.location,delta:1})}function p(w,y){a=Es.Replace;let _=Lm(v.location,w,y);c=u();let x=dx(_,c),E=v.createHref(_);o.replaceState(x,"",E),i&&l&&l({action:a,location:v.location,delta:0})}function m(w){let y=s.location.origin!=="null"?s.location.origin:s.location.href,_=typeof w=="string"?w:Eh(w);return _=_.replace(/ $/,"%20"),Qe(y,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,y)}let v={get action(){return a},get location(){return t(s,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(ux,d),l=w,()=>{s.removeEventListener(ux,d),l=null}},createHref(w){return e(s,w)},createURL:m,encodeLocation(w){let y=m(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(w){return o.go(w)}};return v}var hx;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(hx||(hx={}));function zN(t,e,n){return n===void 0&&(n="/"),BN(t,e,n,!1)}function BN(t,e,n,r){let s=typeof e=="string"?ma(e):e,i=a0(s.pathname||"/",n);if(i==null)return null;let o=ZP(t);HN(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=tD(i);a=ZN(o[l],c,r)}return a}function ZP(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(Qe(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Ls([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(Qe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),ZP(i.children,e,u,c)),!(i.path==null&&!i.index)&&e.push({path:c,score:XN(c,i.index),routesMeta:u})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of eC(i.path))s(i,o,l)}),e}function eC(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=eC(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function HN(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:JN(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const WN=/^:[\w-]+$/,KN=3,GN=2,qN=1,YN=10,QN=-2,fx=t=>t==="*";function XN(t,e){let n=t.split("/"),r=n.length;return n.some(fx)&&(r+=QN),e&&(r+=GN),n.filter(s=>!fx(s)).reduce((s,i)=>s+(WN.test(i)?KN:i===""?qN:YN),r)}function JN(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function ZN(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=i==="/"?e:e.slice(i.length)||"/",d=px({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=px({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(s,d.params),o.push({params:s,pathname:Ls([i,d.pathname]),pathnameBase:iD(Ls([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=Ls([i,d.pathnameBase]))}return o}function px(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=eD(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let v=a[d]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const m=a[d];return p&&!m?c[f]=void 0:c[f]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:t}}function eD(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),JP(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function tD(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return JP(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function a0(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function nD(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?ma(t):t;return{pathname:n?n.startsWith("/")?n:rD(n,e):e,search:oD(r),hash:aD(s)}}function rD(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Np(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function sD(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function l0(t,e){let n=sD(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function c0(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=ma(t):(s=Lc({},t),Qe(!s.pathname||!s.pathname.includes("?"),Np("?","pathname","search",s)),Qe(!s.pathname||!s.pathname.includes("#"),Np("#","pathname","hash",s)),Qe(!s.search||!s.search.includes("#"),Np("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}a=d>=0?e[d]:"/"}let l=nD(s,a),c=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ls=t=>t.join("/").replace(/\/\/+/g,"/"),iD=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),oD=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,aD=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function lD(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const tC=["post","put","patch","delete"];new Set(tC);const cD=["get",...tC];new Set(cD);/**
* React Router v6.27.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Nc(){return Nc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Nc.apply(this,arguments)}const u0=g.createContext(null),uD=g.createContext(null),qs=g.createContext(null),Sf=g.createContext(null),Yr=g.createContext({outlet:null,matches:[],isDataRoute:!1}),nC=g.createContext(null);function dD(t,e){let{relative:n}=e===void 0?{}:e;va()||Qe(!1);let{basename:r,navigator:s}=g.useContext(qs),{hash:i,pathname:o,search:a}=sC(t,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:Ls([r,o])),s.createHref({pathname:l,search:a,hash:i})}function va(){return g.useContext(Sf)!=null}function Un(){return va()||Qe(!1),g.useContext(Sf).location}function rC(t){g.useContext(qs).static||g.useLayoutEffect(t)}function ya(){let{isDataRoute:t}=g.useContext(Yr);return t?SD():hD()}function hD(){va()||Qe(!1);let t=g.useContext(u0),{basename:e,future:n,navigator:r}=g.useContext(qs),{matches:s}=g.useContext(Yr),{pathname:i}=Un(),o=JSON.stringify(l0(s,n.v7_relativeSplatPath)),a=g.useRef(!1);return rC(()=>{a.current=!0}),g.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=c0(c,JSON.parse(o),i,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Ls([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,o,i,t])}function CQ(){let{matches:t}=g.useContext(Yr),e=t[t.length-1];return e?e.params:{}}function sC(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=g.useContext(qs),{matches:s}=g.useContext(Yr),{pathname:i}=Un(),o=JSON.stringify(l0(s,r.v7_relativeSplatPath));return g.useMemo(()=>c0(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function fD(t,e){return pD(t,e)}function pD(t,e,n,r){va()||Qe(!1);let{navigator:s}=g.useContext(qs),{matches:i}=g.useContext(Yr),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Un(),u;if(e){var d;let w=typeof e=="string"?ma(e):e;l==="/"||(d=w.pathname)!=null&&d.startsWith(l)||Qe(!1),u=w}else u=c;let f=u.pathname||"/",p=f;if(l!=="/"){let w=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let m=zN(t,{pathname:p}),v=_D(m&&m.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:Ls([l,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:Ls([l,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return e&&v?g.createElement(Sf.Provider,{value:{location:Nc({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Es.Pop}},v):v}function gD(){let t=ED(),e=lD(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},e),n?g.createElement("pre",{style:s},n):null,null)}const mD=g.createElement(gD,null);class vD extends g.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?g.createElement(Yr.Provider,{value:this.props.routeContext},g.createElement(nC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function yD(t){let{routeContext:e,match:n,children:r}=t,s=g.useContext(u0);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Yr.Provider,{value:e},r)}function _D(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let u=o.findIndex(d=>d.route.id&&a?.[d.route.id]!==void 0);u>=0||Qe(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:f,errors:p}=n,m=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let p,m=!1,v=null,w=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,v=d.route.errorElement||mD,l&&(c<0&&f===0?(m=!0,w=null):c===f&&(m=!0,w=d.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,f+1)),_=()=>{let x;return p?x=v:m?x=w:d.route.Component?x=g.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=u,g.createElement(yD,{match:d,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?g.createElement(vD,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:_(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):_()},null)}var iC=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(iC||{}),Sh=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Sh||{});function wD(t){let e=g.useContext(u0);return e||Qe(!1),e}function xD(t){let e=g.useContext(uD);return e||Qe(!1),e}function bD(t){let e=g.useContext(Yr);return e||Qe(!1),e}function oC(t){let e=bD(),n=e.matches[e.matches.length-1];return n.route.id||Qe(!1),n.route.id}function ED(){var t;let e=g.useContext(nC),n=xD(Sh.UseRouteError),r=oC(Sh.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function SD(){let{router:t}=wD(iC.UseNavigateStable),e=oC(Sh.UseNavigateStable),n=g.useRef(!1);return rC(()=>{n.current=!0}),g.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,Nc({fromRouteId:e},i)))},[t,e])}function kQ(t){let{to:e,replace:n,state:r,relative:s}=t;va()||Qe(!1);let{future:i,static:o}=g.useContext(qs),{matches:a}=g.useContext(Yr),{pathname:l}=Un(),c=ya(),u=c0(e,l0(a,i.v7_relativeSplatPath),l,s==="path"),d=JSON.stringify(u);return g.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:s}),[c,d,s,n,r]),null}function j(t){Qe(!1)}function TD(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Es.Pop,navigator:i,static:o=!1,future:a}=t;va()&&Qe(!1);let l=e.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:i,static:o,future:Nc({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=ma(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:m="default"}=r,v=g.useMemo(()=>{let w=a0(u,l);return w==null?null:{location:{pathname:w,search:d,hash:f,state:p,key:m},navigationType:s}},[l,u,d,f,p,m,s]);return v==null?null:g.createElement(qs.Provider,{value:c},g.createElement(Sf.Provider,{children:n,value:v}))}function PD(t){let{children:e,location:n}=t;return fD(Nm(e),n)}new Promise(()=>{});function Nm(t,e){e===void 0&&(e=[]);let n=[];return g.Children.forEach(t,(r,s)=>{if(!g.isValidElement(r))return;let i=[...e,s];if(r.type===g.Fragment){n.push.apply(n,Nm(r.props.children,i));return}r.type!==j&&Qe(!1),!r.props.index||!r.props.children||Qe(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Nm(r.props.children,i)),n.push(o)}),n}/**
* React Router DOM v6.27.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Dm(){return Dm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Dm.apply(this,arguments)}function CD(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function kD(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function RD(t,e){return t.button===0&&(!e||e==="_self")&&!kD(t)}function Mm(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function jD(t,e){let n=Mm(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const AD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],OD="6";try{window.__reactRouterVersion=OD}catch{}const ID="startTransition",gx=GS[ID];function LD(t){let{basename:e,children:n,future:r,window:s}=t,i=g.useRef();i.current==null&&(i.current=FN({window:s,v5Compat:!0}));let o=i.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},u=g.useCallback(d=>{c&&gx?gx(()=>l(d)):l(d)},[l,c]);return g.useLayoutEffect(()=>o.listen(u),[o,u]),g.createElement(TD,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const ND=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",DD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fe=g.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d}=e,f=CD(e,AD),{basename:p}=g.useContext(qs),m,v=!1;if(typeof c=="string"&&DD.test(c)&&(m=c,ND))try{let x=new URL(window.location.href),E=c.startsWith("//")?new URL(x.protocol+c):new URL(c),b=a0(E.pathname,p);E.origin===x.origin&&b!=null?c=b+E.search+E.hash:v=!0}catch{}let w=dD(c,{relative:s}),y=MD(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:s,viewTransition:d});function _(x){r&&r(x),x.defaultPrevented||y(x)}return g.createElement("a",Dm({},f,{href:m||w,onClick:v||i?r:_,ref:n,target:l}))});var mx;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(mx||(mx={}));var vx;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(vx||(vx={}));function MD(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=ya(),c=Un(),u=sC(t,{relative:o});return g.useCallback(d=>{if(RD(d,n)){d.preventDefault();let f=r!==void 0?r:Eh(c)===Eh(u);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[c,l,u,r,s,n,t,i,o,a])}function RQ(t){let e=g.useRef(Mm(t)),n=g.useRef(!1),r=Un(),s=g.useMemo(()=>jD(r.search,n.current?null:e.current),[r.search]),i=ya(),o=g.useCallback((a,l)=>{const c=Mm(typeof a=="function"?a(s):a);n.current=!0,i("?"+c,l)},[i,s]);return[s,o]}class aC extends $.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("ErrorBoundary caught an error:",e,n)}render(){return this.state.hasError?this.props.fallback||h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:h.jsxs("div",{className:"text-center p-8",children:[h.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Something went wrong"}),h.jsx("p",{className:"text-gray-600 mb-4",children:this.state.error?.message||"An unexpected error occurred"}),h.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Reload Page"})]})}):this.props.children}}const $D=1,FD=1e6;let Dp=0;function VD(){return Dp=(Dp+1)%Number.MAX_SAFE_INTEGER,Dp.toString()}const Mp=new Map,yx=t=>{if(Mp.has(t))return;const e=setTimeout(()=>{Mp.delete(t),nc({type:"REMOVE_TOAST",toastId:t})},FD);Mp.set(t,e)},UD=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,$D)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?yx(n):t.toasts.forEach(r=>{yx(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Dd=[];let Md={toasts:[]};function nc(t){Md=UD(Md,t),Dd.forEach(e=>{e(Md)})}function zD({...t}){const e=VD(),n=s=>nc({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>nc({type:"DISMISS_TOAST",toastId:e});return nc({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function lC(){const[t,e]=g.useState(Md);return g.useEffect(()=>(Dd.push(e),()=>{const n=Dd.indexOf(e);n>-1&&Dd.splice(n,1)}),[t]),{...t,toast:zD,dismiss:n=>nc({type:"DISMISS_TOAST",toastId:n})}}function Z(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t?.(s),n===!1||!s.defaultPrevented)return e?.(s)}}function BD(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Tf(...t){return e=>t.forEach(n=>BD(n,e))}function Xe(...t){return g.useCallback(Tf(...t),t)}function HD(t,e=[]){let n=[];function r(i,o){const a=g.createContext(o),l=n.length;n=[...n,o];function c(d){const{scope:f,children:p,...m}=d,v=f?.[t][l]||a,w=g.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:w,children:p})}function u(d,f){const p=f?.[t][l]||a,m=g.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const s=()=>{const i=n.map(o=>g.createContext(o));return function(a){const l=a?.[t]||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,WD(s,...e)]}function WD(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Ci=g.forwardRef((t,e)=>{const{children:n,...r}=t,s=g.Children.toArray(n),i=s.find(KD);if(i){const o=i.props.children,a=s.map(l=>l===i?g.Children.count(o)>1?g.Children.only(null):g.isValidElement(o)?o.props.children:null:l);return h.jsx($m,{...r,ref:e,children:g.isValidElement(o)?g.cloneElement(o,void 0,a):null})}return h.jsx($m,{...r,ref:e,children:n})});Ci.displayName="Slot";var $m=g.forwardRef((t,e)=>{const{children:n,...r}=t;if(g.isValidElement(n)){const s=qD(n);return g.cloneElement(n,{...GD(r,n.props),ref:e?Tf(e,s):s})}return g.Children.count(n)>1?g.Children.only(null):null});$m.displayName="SlotClone";var cC=({children:t})=>h.jsx(h.Fragment,{children:t});function KD(t){return g.isValidElement(t)&&t.type===cC}function GD(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function qD(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function d0(t){const e=t+"CollectionProvider",[n,r]=HD(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:m,children:v}=p,w=$.useRef(null),y=$.useRef(new Map).current;return h.jsx(s,{scope:m,itemMap:y,collectionRef:w,children:v})};o.displayName=e;const a=t+"CollectionSlot",l=$.forwardRef((p,m)=>{const{scope:v,children:w}=p,y=i(a,v),_=Xe(m,y.collectionRef);return h.jsx(Ci,{ref:_,children:w})});l.displayName=a;const c=t+"CollectionItemSlot",u="data-radix-collection-item",d=$.forwardRef((p,m)=>{const{scope:v,children:w,...y}=p,_=$.useRef(null),x=Xe(m,_),E=i(c,v);return $.useEffect(()=>(E.itemMap.set(_,{ref:_,...y}),()=>void E.itemMap.delete(_))),h.jsx(Ci,{[u]:"",ref:x,children:w})});d.displayName=c;function f(p){const m=i(t+"CollectionConsumer",p);return $.useCallback(()=>{const w=m.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((E,b)=>y.indexOf(E.ref.current)-y.indexOf(b.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:l,ItemSlot:d},f,r]}function YD(t,e){const n=g.createContext(e),r=i=>{const{children:o,...a}=i,l=g.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function s(i){const o=g.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function _a(t,e=[]){let n=[];function r(i,o){const a=g.createContext(o),l=n.length;n=[...n,o];const c=d=>{const{scope:f,children:p,...m}=d,v=f?.[t]?.[l]||a,w=g.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:w,children:p})};c.displayName=i+"Provider";function u(d,f){const p=f?.[t]?.[l]||a,m=g.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const s=()=>{const i=n.map(o=>g.createContext(o));return function(a){const l=a?.[t]||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,QD(s,...e)]}function QD(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var XD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=XD.reduce((t,e)=>{const n=g.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?Ci:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function h0(t,e){t&&gu.flushSync(()=>t.dispatchEvent(e))}function Tt(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...n)=>e.current?.(...n),[])}function JD(t,e=globalThis?.document){const n=Tt(t);g.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var ZD="DismissableLayer",Fm="dismissableLayer.update",eM="dismissableLayer.pointerDownOutside",tM="dismissableLayer.focusOutside",_x,uC=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mu=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,c=g.useContext(uC),[u,d]=g.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=g.useState({}),m=Xe(e,T=>d(T)),v=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(w),_=u?v.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,E=_>=y,b=rM(T=>{const P=T.target,I=[...c.branches].some(k=>k.contains(P));!E||I||(s?.(T),o?.(T),T.defaultPrevented||a?.())},f),S=sM(T=>{const P=T.target;[...c.branches].some(k=>k.contains(P))||(i?.(T),o?.(T),T.defaultPrevented||a?.())},f);return JD(T=>{_===c.layers.size-1&&(r?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},f),g.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(_x=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),wx(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=_x)}},[u,f,n,c]),g.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),wx())},[u,c]),g.useEffect(()=>{const T=()=>p({});return document.addEventListener(Fm,T),()=>document.removeEventListener(Fm,T)},[]),h.jsx(ve.div,{...l,ref:m,style:{pointerEvents:x?E?"auto":"none":void 0,...t.style},onFocusCapture:Z(t.onFocusCapture,S.onFocusCapture),onBlurCapture:Z(t.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Z(t.onPointerDownCapture,b.onPointerDownCapture)})});mu.displayName=ZD;var nM="DismissableLayerBranch",dC=g.forwardRef((t,e)=>{const n=g.useContext(uC),r=g.useRef(null),s=Xe(e,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(ve.div,{...t,ref:s})});dC.displayName=nM;function rM(t,e=globalThis?.document){const n=Tt(t),r=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){hC(eM,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function sM(t,e=globalThis?.document){const n=Tt(t),r=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!r.current&&hC(tM,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wx(){const t=new CustomEvent(Fm);document.dispatchEvent(t)}function hC(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?h0(s,i):s.dispatchEvent(i)}var iM=mu,oM=dC,_r=globalThis?.document?g.useLayoutEffect:()=>{},aM="Portal",vu=g.forwardRef((t,e)=>{const{container:n,...r}=t,[s,i]=g.useState(!1);_r(()=>i(!0),[]);const o=n||s&&globalThis?.document?.body;return o?QP.createPortal(h.jsx(ve.div,{...r,ref:e}),o):null});vu.displayName=aM;function lM(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}var zn=t=>{const{present:e,children:n}=t,r=cM(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=Xe(r.ref,uM(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null};zn.displayName="Presence";function cM(t){const[e,n]=g.useState(),r=g.useRef({}),s=g.useRef(t),i=g.useRef("none"),o=t?"mounted":"unmounted",[a,l]=lM(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=Ju(r.current);i.current=a==="mounted"?c:"none"},[a]),_r(()=>{const c=r.current,u=s.current;if(u!==t){const f=i.current,p=Ju(c);t?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),_r(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,d=p=>{const v=Ju(r.current).includes(p.animationName);if(p.target===e&&v&&(l("ANIMATION_END"),!s.current)){const w=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=w)})}},f=p=>{p.target===e&&(i.current=Ju(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ju(t){return t?.animationName||"none"}function uM(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function yu({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=dM({defaultProp:e,onChange:n}),i=t!==void 0,o=i?t:r,a=Tt(n),l=g.useCallback(c=>{if(i){const d=typeof c=="function"?c(t):c;d!==t&&a(d)}else s(c)},[i,t,s,a]);return[o,l]}function dM({defaultProp:t,onChange:e}){const n=g.useState(t),[r]=n,s=g.useRef(r),i=Tt(e);return g.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var hM="VisuallyHidden",Pf=g.forwardRef((t,e)=>h.jsx(ve.span,{...t,ref:e,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",...t.style}}));Pf.displayName=hM;var fM=Pf,f0="ToastProvider",[p0,pM,gM]=d0("Toast"),[fC,jQ]=_a("Toast",[gM]),[mM,Cf]=fC(f0),pC=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=g.useState(null),[c,u]=g.useState(0),d=g.useRef(!1),f=g.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${f0}\`. Expected non-empty \`string\`.`),h.jsx(p0.Provider,{scope:e,children:h.jsx(mM,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>u(p=>p+1),[]),onToastRemove:g.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};pC.displayName=f0;var gC="ToastViewport",vM=["F8"],Vm="toast.viewportPause",Um="toast.viewportResume",mC=g.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=vM,label:s="Notifications ({hotkey})",...i}=t,o=Cf(gC,n),a=pM(n),l=g.useRef(null),c=g.useRef(null),u=g.useRef(null),d=g.useRef(null),f=Xe(e,d,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=o.toastCount>0;g.useEffect(()=>{const w=y=>{r.length!==0&&r.every(x=>y[x]||y.code===x)&&d.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),g.useEffect(()=>{const w=l.current,y=d.current;if(m&&w&&y){const _=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(Vm);y.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(Um);y.dispatchEvent(S),o.isClosePausedRef.current=!1}},E=S=>{!w.contains(S.relatedTarget)&&x()},b=()=>{w.contains(document.activeElement)||x()};return w.addEventListener("focusin",_),w.addEventListener("focusout",E),w.addEventListener("pointermove",_),w.addEventListener("pointerleave",b),window.addEventListener("blur",_),window.addEventListener("focus",x),()=>{w.removeEventListener("focusin",_),w.removeEventListener("focusout",E),w.removeEventListener("pointermove",_),w.removeEventListener("pointerleave",b),window.removeEventListener("blur",_),window.removeEventListener("focus",x)}}},[m,o.isClosePausedRef]);const v=g.useCallback(({tabbingDirection:w})=>{const _=a().map(x=>{const E=x.ref.current,b=[E,...jM(E)];return w==="forwards"?b:b.reverse()});return(w==="forwards"?_.reverse():_).flat()},[a]);return g.useEffect(()=>{const w=d.current;if(w){const y=_=>{const x=_.altKey||_.ctrlKey||_.metaKey;if(_.key==="Tab"&&!x){const b=document.activeElement,S=_.shiftKey;if(_.target===w&&S){c.current?.focus();return}const I=v({tabbingDirection:S?"backwards":"forwards"}),k=I.findIndex(V=>V===b);$p(I.slice(k+1))?_.preventDefault():S?c.current?.focus():u.current?.focus()}};return w.addEventListener("keydown",y),()=>w.removeEventListener("keydown",y)}},[a,v]),h.jsxs(oM,{ref:l,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&h.jsx(zm,{ref:c,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"forwards"});$p(w)}}),h.jsx(p0.Slot,{scope:n,children:h.jsx(ve.ol,{tabIndex:-1,...i,ref:f})}),m&&h.jsx(zm,{ref:u,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"backwards"});$p(w)}})]})});mC.displayName=gC;var vC="ToastFocusProxy",zm=g.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Cf(vC,n);return h.jsx(Pf,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{const a=o.relatedTarget;!i.viewport?.contains(a)&&r()}})});zm.displayName=vC;var kf="Toast",yM="toast.swipeStart",_M="toast.swipeMove",wM="toast.swipeCancel",xM="toast.swipeEnd",yC=g.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a=!0,l]=yu({prop:r,defaultProp:s,onChange:i});return h.jsx(zn,{present:n||a,children:h.jsx(SM,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Tt(t.onPause),onResume:Tt(t.onResume),onSwipeStart:Z(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Z(t.onSwipeMove,c=>{const{x:u,y:d}=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",`${d}px`)}),onSwipeCancel:Z(t.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:Z(t.onSwipeEnd,c=>{const{x:u,y:d}=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",`${d}px`),l(!1)})})})});yC.displayName=kf;var[bM,EM]=fC(kf,{onClose(){}}),SM=g.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=t,v=Cf(kf,n),[w,y]=g.useState(null),_=Xe(e,N=>y(N)),x=g.useRef(null),E=g.useRef(null),b=s||v.duration,S=g.useRef(0),T=g.useRef(b),P=g.useRef(0),{onToastAdd:I,onToastRemove:k}=v,V=Tt(()=>{w?.contains(document.activeElement)&&v.viewport?.focus(),o()}),F=g.useCallback(N=>{!N||N===1/0||(window.clearTimeout(P.current),S.current=new Date().getTime(),P.current=window.setTimeout(V,N))},[V]);g.useEffect(()=>{const N=v.viewport;if(N){const X=()=>{F(T.current),c?.()},B=()=>{const H=new Date().getTime()-S.current;T.current=T.current-H,window.clearTimeout(P.current),l?.()};return N.addEventListener(Vm,B),N.addEventListener(Um,X),()=>{N.removeEventListener(Vm,B),N.removeEventListener(Um,X)}}},[v.viewport,b,l,c,F]),g.useEffect(()=>{i&&!v.isClosePausedRef.current&&F(b)},[i,b,v.isClosePausedRef,F]),g.useEffect(()=>(I(),()=>k()),[I,k]);const Y=g.useMemo(()=>w?TC(w):null,[w]);return v.viewport?h.jsxs(h.Fragment,{children:[Y&&h.jsx(TM,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:Y}),h.jsx(bM,{scope:n,onClose:V,children:gu.createPortal(h.jsx(p0.ItemSlot,{scope:n,children:h.jsx(iM,{asChild:!0,onEscapeKeyDown:Z(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||V(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...m,ref:_,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Z(t.onKeyDown,N=>{N.key==="Escape"&&(a?.(N.nativeEvent),N.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:Z(t.onPointerDown,N=>{N.button===0&&(x.current={x:N.clientX,y:N.clientY})}),onPointerMove:Z(t.onPointerMove,N=>{if(!x.current)return;const X=N.clientX-x.current.x,B=N.clientY-x.current.y,H=!!E.current,R=["left","right"].includes(v.swipeDirection),A=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,U=R?A(0,X):0,M=R?0:A(0,B),z=N.pointerType==="touch"?10:2,J={x:U,y:M},re={originalEvent:N,delta:J};H?(E.current=J,Zu(_M,d,re,{discrete:!1})):xx(J,v.swipeDirection,z)?(E.current=J,Zu(yM,u,re,{discrete:!1}),N.target.setPointerCapture(N.pointerId)):(Math.abs(X)>z||Math.abs(B)>z)&&(x.current=null)}),onPointerUp:Z(t.onPointerUp,N=>{const X=E.current,B=N.target;if(B.hasPointerCapture(N.pointerId)&&B.releasePointerCapture(N.pointerId),E.current=null,x.current=null,X){const H=N.currentTarget,R={originalEvent:N,delta:X};xx(X,v.swipeDirection,v.swipeThreshold)?Zu(xM,p,R,{discrete:!0}):Zu(wM,f,R,{discrete:!0}),H.addEventListener("click",A=>A.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),TM=t=>{const{__scopeToast:e,children:n,...r}=t,s=Cf(kf,e),[i,o]=g.useState(!1),[a,l]=g.useState(!1);return kM(()=>o(!0)),g.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:h.jsx(vu,{asChild:!0,children:h.jsx(Pf,{...r,children:i&&h.jsxs(h.Fragment,{children:[s.label," ",n]})})})},PM="ToastTitle",_C=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(ve.div,{...r,ref:e})});_C.displayName=PM;var CM="ToastDescription",wC=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(ve.div,{...r,ref:e})});wC.displayName=CM;var xC="ToastAction",bC=g.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?h.jsx(SC,{altText:n,asChild:!0,children:h.jsx(g0,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${xC}\`. Expected non-empty \`string\`.`),null)});bC.displayName=xC;var EC="ToastClose",g0=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=EM(EC,n);return h.jsx(SC,{asChild:!0,children:h.jsx(ve.button,{type:"button",...r,ref:e,onClick:Z(t.onClick,s.onClose)})})});g0.displayName=EC;var SC=g.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return h.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function TC(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),RM(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...TC(r))}}),e}function Zu(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?h0(s,i):s.dispatchEvent(i)}var xx=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function kM(t=()=>{}){const e=Tt(t);_r(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function RM(t){return t.nodeType===t.ELEMENT_NODE}function jM(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function $p(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var AM=pC,PC=mC,CC=yC,kC=_C,RC=wC,jC=bC,AC=g0;function OC(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=OC(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function m0(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=OC(t))&&(r&&(r+=" "),r+=e);return r}const bx=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Ex=m0,Rf=(t,e)=>n=>{var r;if(e?.variants==null)return Ex(t,n?.class,n?.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(c=>{const u=n?.[c],d=i?.[c];if(u===null)return null;const f=bx(u)||bx(d);return s[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[v,w]=m;return Array.isArray(w)?w.includes({...i,...a}[v]):{...i,...a}[v]===w})?[...c,d,f]:c},[]);return Ex(t,o,l,n?.class,n?.className)};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OM=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),IM=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),Sx=t=>{const e=IM(t);return e.charAt(0).toUpperCase()+e.slice(1)},IC=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),LM=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var NM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const DM=g.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>g.createElement("svg",{ref:l,...NM,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:IC("lucide",s),...!i&&!LM(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,u])=>g.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ke=(t,e)=>{const n=g.forwardRef(({className:r,...s},i)=>g.createElement(DM,{ref:i,iconNode:e,className:IC(`lucide-${OM(Sx(t))}`,`lucide-${t}`,r),...s}));return n.displayName=Sx(t),n};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const MM=[["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"11xh7x"}],["path",{d:"M9 12h.01",key:"157uk2"}]],$M=ke("baby",MM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FM=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],VM=ke("blocks",FM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const UM=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Tx=ke("camera",UM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],BM=ke("check",zM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const HM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],WM=ke("chevron-right",HM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],GM=ke("circle",KM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qM=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Ua=ke("crown",qM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YM=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],QM=ke("file-check",YM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XM=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],LC=ke("heart",XM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JM=[["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-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],ZM=ke("house",JM);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const e$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],t$=ke("info",e$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const n$=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Px=ke("key-round",n$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const r$=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],s$=ke("library-big",r$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const i$=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],o$=ke("lightbulb",i$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const a$=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Cx=ke("loader-circle",a$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const l$=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],kx=ke("log-in",l$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const c$=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Rx=ke("log-out",c$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const u$=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],d$=ke("menu",u$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h$=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],f$=ke("message-circle-question-mark",h$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const p$=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],g$=ke("notebook-pen",p$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const m$=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],v$=ke("palette",m$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const y$=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],_$=ke("trophy",y$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const w$=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],jx=ke("upload",w$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const x$=[["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"}]],b$=ke("user",x$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const E$=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],S$=ke("wand-sparkles",E$);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const T$=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],NC=ke("x",T$),v0="-",P$=t=>{const e=k$(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(v0);return a[0]===""&&a.length!==1&&a.shift(),DC(a,e)||C$(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},DC=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?DC(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(v0);return e.validators.find(({validator:o})=>o(i))?.classGroupId},Ax=/^\[(.+)\]$/,C$=t=>{if(Ax.test(t)){const e=Ax.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},k$=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return j$(Object.entries(t.classGroups),n).forEach(([i,o])=>{Bm(o,r,i,e)}),r},Bm=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:Ox(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(R$(s)){Bm(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Bm(o,Ox(e,i),n,r)})})},Ox=(t,e)=>{let n=t;return e.split(v0).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},R$=t=>t.isThemeGetter,j$=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[n,s]}):t,A$=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},MC="!",O$=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let c=0,u=0,d;for(let w=0;w<a.length;w++){let y=a[w];if(c===0){if(y===s&&(r||a.slice(w,w+i)===e)){l.push(a.slice(u,w)),u=w+i;continue}if(y==="/"){d=w;continue}}y==="["?c++:y==="]"&&c--}const f=l.length===0?a:a.substring(u),p=f.startsWith(MC),m=p?f.substring(1):f,v=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:o}):o},I$=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},L$=t=>({cache:A$(t.cacheSize),parseClassName:O$(t),...P$(t)}),N$=/\s+/,D$=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(N$);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let m=!!p,v=r(m?f.substring(0,p):f);if(!v){if(!m){a=c+(a.length>0?" "+a:a);continue}if(v=r(f),!v){a=c+(a.length>0?" "+a:a);continue}m=!1}const w=I$(u).join(":"),y=d?w+MC:w,_=y+v;if(i.includes(_))continue;i.push(_);const x=s(v,m);for(let E=0;E<x.length;++E){const b=x[E];i.push(y+b)}a=c+(a.length>0?" "+a:a)}return a};function M$(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=$C(e))&&(r&&(r+=" "),r+=n);return r}const $C=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=$C(t[r]))&&(n&&(n+=" "),n+=e);return n};function $$(t,...e){let n,r,s,i=o;function o(l){const c=e.reduce((u,d)=>d(u),t());return n=L$(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=D$(l,n);return s(l,u),u}return function(){return i(M$.apply(null,arguments))}}const je=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},FC=/^\[(?:([a-z-]+):)?(.+)\]$/i,F$=/^\d+\/\d+$/,V$=new Set(["px","full","screen"]),U$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,z$=/\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$/,B$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,H$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pr=t=>Ao(t)||V$.has(t)||F$.test(t),Zr=t=>wa(t,"length",Z$),Ao=t=>!!t&&!Number.isNaN(Number(t)),Fp=t=>wa(t,"number",Ao),za=t=>!!t&&Number.isInteger(Number(t)),K$=t=>t.endsWith("%")&&Ao(t.slice(0,-1)),oe=t=>FC.test(t),es=t=>U$.test(t),G$=new Set(["length","size","percentage"]),q$=t=>wa(t,G$,VC),Y$=t=>wa(t,"position",VC),Q$=new Set(["image","url"]),X$=t=>wa(t,Q$,tF),J$=t=>wa(t,"",eF),Ba=()=>!0,wa=(t,e,n)=>{const r=FC.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},Z$=t=>z$.test(t)&&!B$.test(t),VC=()=>!1,eF=t=>H$.test(t),tF=t=>W$.test(t),nF=()=>{const t=je("colors"),e=je("spacing"),n=je("blur"),r=je("brightness"),s=je("borderColor"),i=je("borderRadius"),o=je("borderSpacing"),a=je("borderWidth"),l=je("contrast"),c=je("grayscale"),u=je("hueRotate"),d=je("invert"),f=je("gap"),p=je("gradientColorStops"),m=je("gradientColorStopPositions"),v=je("inset"),w=je("margin"),y=je("opacity"),_=je("padding"),x=je("saturate"),E=je("scale"),b=je("sepia"),S=je("skew"),T=je("space"),P=je("translate"),I=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",oe,e],F=()=>[oe,e],Y=()=>["",Pr,Zr],N=()=>["auto",Ao,oe],X=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",oe],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[Ao,oe];return{cacheSize:500,separator:":",theme:{colors:[Ba],spacing:[Pr,Zr],blur:["none","",es,oe],brightness:M(),borderColor:[t],borderRadius:["none","","full",es,oe],borderSpacing:F(),borderWidth:Y(),contrast:M(),grayscale:A(),hueRotate:M(),invert:A(),gap:F(),gradientColorStops:[t],gradientColorStopPositions:[K$,Zr],inset:V(),margin:V(),opacity:M(),padding:F(),saturate:M(),scale:M(),sepia:A(),skew:M(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[es]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:[...X(),oe]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",za,oe]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",za,oe]}],"grid-cols":[{"grid-cols":[Ba]}],"col-start-end":[{col:["auto",{span:["full",za,oe]},oe]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[Ba]}],"row-start-end":[{row:["auto",{span:[za,oe]},oe]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,e]}],"min-w":[{"min-w":[oe,e,"min","max","fit"]}],"max-w":[{"max-w":[oe,e,"none","full","min","max","fit","prose",{screen:[es]},es]}],h:[{h:[oe,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,e,"auto","min","max","fit"]}],"font-size":[{text:["base",es,Zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fp]}],"font-family":[{font:[Ba]}],"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",oe]}],"line-clamp":[{"line-clamp":["none",Ao,Fp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Pr,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pr,Zr]}],"underline-offset":[{"underline-offset":["auto",Pr,oe]}],"text-decoration-color":[{decoration:[t]}],"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",oe]}],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",oe]}],"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:[...X(),Y$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",q$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},X$]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...B(),"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]}],"divide-style":[{divide:B()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Pr,oe]}],"outline-w":[{outline:[Pr,Zr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Pr,Zr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",es,J$]}],"shadow-color":[{shadow:[Ba]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",es,oe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[za,oe]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],accent:[{accent:["auto",t]}],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",oe]}],"caret-color":[{caret:[t]}],"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",oe]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Pr,Zr,Fp]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},rF=$$(nF);function Le(...t){return rF(m0(t))}const sF=AM,UC=g.forwardRef(({className:t,...e},n)=>h.jsx(PC,{ref:n,className:Le("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]",t),...e}));UC.displayName=PC.displayName;const iF=Rf("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"}}),zC=g.forwardRef(({className:t,variant:e,...n},r)=>h.jsx(CC,{ref:r,className:Le(iF({variant:e}),t),...n}));zC.displayName=CC.displayName;const oF=g.forwardRef(({className:t,...e},n)=>h.jsx(jC,{ref:n,className:Le("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",t),...e}));oF.displayName=jC.displayName;const BC=g.forwardRef(({className:t,...e},n)=>h.jsx(AC,{ref:n,className:Le("absolute right-2 top-2 rounded-md p-1 text-foreground/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",t),"toast-close":"",...e,children:h.jsx(NC,{className:"h-4 w-4"})}));BC.displayName=AC.displayName;const HC=g.forwardRef(({className:t,...e},n)=>h.jsx(kC,{ref:n,className:Le("text-sm font-semibold",t),...e}));HC.displayName=kC.displayName;const WC=g.forwardRef(({className:t,...e},n)=>h.jsx(RC,{ref:n,className:Le("text-sm opacity-90",t),...e}));WC.displayName=RC.displayName;function aF(){const{toasts:t}=lC();return h.jsxs(sF,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return h.jsxs(zC,{...i,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(HC,{children:n}),r&&h.jsx(WC,{children:r})]}),s,h.jsx(BC,{})]},e)}),h.jsx(UC,{})]})}var Ix=["light","dark"],lF="(prefers-color-scheme: dark)",cF=g.createContext(void 0),uF={setTheme:t=>{},themes:[]},dF=()=>{var t;return(t=g.useContext(cF))!=null?t:uF};g.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let c=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=s?Ix.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(m,v=!1,w=!0)=>{let y=o?o[m]:m,_=v?m+"|| ''":`'${y}'`,x="";return s&&w&&!v&&Ix.includes(m)&&(x+=`d.style.colorScheme = '${m}';`),n==="class"?v||y?x+=`c.add(${_})`:x+="null":y&&(x+=`d[s](n,${_})`),x},p=t?`!function(){${u}${f(t)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${lF}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${c?"":"else{"+f(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${d}}catch(t){}}();`;return g.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var hF=t=>{switch(t){case"success":return gF;case"info":return vF;case"warning":return mF;case"error":return yF;default:return null}},fF=Array(12).fill(0),pF=({visible:t})=>$.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},$.createElement("div",{className:"sonner-spinner"},fF.map((e,n)=>$.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),gF=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),mF=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},$.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"})),vF=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),yF=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.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"})),_F=()=>{let[t,e]=$.useState(document.hidden);return $.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},Hm=1,wF=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;let{message:r,...s}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Hm++,o=this.toasts.find(l=>l.id===i),a=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:r}),{...l,...e,id:i,dismissible:a,title:r}):l):this.addToast({title:r,...s,dismissible:a,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:e,dismiss:!0})),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let s=e instanceof Promise?e:e(),i=r!==void 0;return s.then(async o=>{if(bF(o)&&!o.ok){i=!1;let a=typeof n.error=="function"?await n.error(`HTTP error! status: ${o.status}`):n.error,l=typeof n.description=="function"?await n.description(`HTTP error! status: ${o.status}`):n.description;this.create({id:r,type:"error",message:a,description:l})}else if(n.success!==void 0){i=!1;let a=typeof n.success=="function"?await n.success(o):n.success,l=typeof n.description=="function"?await n.description(o):n.description;this.create({id:r,type:"success",message:a,description:l})}}).catch(async o=>{if(n.error!==void 0){i=!1;let a=typeof n.error=="function"?await n.error(o):n.error,l=typeof n.description=="function"?await n.description(o):n.description;this.create({id:r,type:"error",message:a,description:l})}}).finally(()=>{var o;i&&(this.dismiss(r),r=void 0),(o=n.finally)==null||o.call(n)}),r},this.custom=(e,n)=>{let r=n?.id||Hm++;return this.create({jsx:e(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},Qt=new wF,xF=(t,e)=>{let n=e?.id||Hm++;return Qt.addToast({title:t,...e,id:n}),n},bF=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",EF=xF,SF=()=>Qt.toasts,lr=Object.assign(EF,{success:Qt.success,info:Qt.info,warning:Qt.warning,error:Qt.error,custom:Qt.custom,message:Qt.message,promise:Qt.promise,dismiss:Qt.dismiss,loading:Qt.loading},{getHistory:SF});function TF(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}TF(`: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;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;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}: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%)}
`);function ed(t){return t.label!==void 0}var PF=3,CF="32px",kF=4e3,RF=356,jF=14,AF=20,OF=200;function IF(...t){return t.filter(Boolean).join(" ")}var LF=t=>{var e,n,r,s,i,o,a,l,c,u;let{invert:d,toast:f,unstyled:p,interacting:m,setHeights:v,visibleToasts:w,heights:y,index:_,toasts:x,expanded:E,removeToast:b,defaultRichColors:S,closeButton:T,style:P,cancelButtonStyle:I,actionButtonStyle:k,className:V="",descriptionClassName:F="",duration:Y,position:N,gap:X,loadingIcon:B,expandByDefault:H,classNames:R,icons:A,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:M,cn:z}=t,[J,re]=$.useState(!1),[De,se]=$.useState(!1),[ye,Kt]=$.useState(!1),[Er,mt]=$.useState(!1),[Ra,Qr]=$.useState(0),[Wn,ja]=$.useState(0),Aa=$.useRef(null),Sr=$.useRef(null),Oa=_===0,eL=_+1<=w,an=f.type,Fi=f.dismissible!==!1,tL=f.className||"",nL=f.descriptionClassName||"",Ou=$.useMemo(()=>y.findIndex(ie=>ie.toastId===f.id)||0,[y,f.id]),rL=$.useMemo(()=>{var ie;return(ie=f.closeButton)!=null?ie:T},[f.closeButton,T]),q_=$.useMemo(()=>f.duration||Y||kF,[f.duration,Y]),op=$.useRef(0),Vi=$.useRef(0),Y_=$.useRef(0),Ui=$.useRef(null),[Q_,sL]=N.split("-"),X_=$.useMemo(()=>y.reduce((ie,Re,Ee)=>Ee>=Ou?ie:ie+Re.height,0),[y,Ou]),J_=_F(),iL=f.invert||d,ap=an==="loading";Vi.current=$.useMemo(()=>Ou*X+X_,[Ou,X_]),$.useEffect(()=>{re(!0)},[]),$.useLayoutEffect(()=>{if(!J)return;let ie=Sr.current,Re=ie.style.height;ie.style.height="auto";let Ee=ie.getBoundingClientRect().height;ie.style.height=Re,ja(Ee),v(Kn=>Kn.find(Gn=>Gn.toastId===f.id)?Kn.map(Gn=>Gn.toastId===f.id?{...Gn,height:Ee}:Gn):[{toastId:f.id,height:Ee,position:f.position},...Kn])},[J,f.title,f.description,v,f.id]);let Xr=$.useCallback(()=>{se(!0),Qr(Vi.current),v(ie=>ie.filter(Re=>Re.toastId!==f.id)),setTimeout(()=>{b(f)},OF)},[f,b,v,Vi]);$.useEffect(()=>{if(f.promise&&an==="loading"||f.duration===1/0||f.type==="loading")return;let ie,Re=q_;return E||m||M&&J_?(()=>{if(Y_.current<op.current){let Ee=new Date().getTime()-op.current;Re=Re-Ee}Y_.current=new Date().getTime()})():Re!==1/0&&(op.current=new Date().getTime(),ie=setTimeout(()=>{var Ee;(Ee=f.onAutoClose)==null||Ee.call(f,f),Xr()},Re)),()=>clearTimeout(ie)},[E,m,H,f,q_,Xr,f.promise,an,M,J_]),$.useEffect(()=>{let ie=Sr.current;if(ie){let Re=ie.getBoundingClientRect().height;return ja(Re),v(Ee=>[{toastId:f.id,height:Re,position:f.position},...Ee]),()=>v(Ee=>Ee.filter(Kn=>Kn.toastId!==f.id))}},[v,f.id]),$.useEffect(()=>{f.delete&&Xr()},[Xr,f.delete]);function oL(){return A!=null&&A.loading?$.createElement("div",{className:"sonner-loader","data-visible":an==="loading"},A.loading):B?$.createElement("div",{className:"sonner-loader","data-visible":an==="loading"},B):$.createElement(pF,{visible:an==="loading"})}return $.createElement("li",{"aria-live":f.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Sr,className:z(V,tL,R?.toast,(e=f?.classNames)==null?void 0:e.toast,R?.default,R?.[an],(n=f?.classNames)==null?void 0:n[an]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:S,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":J,"data-promise":!!f.promise,"data-removed":De,"data-visible":eL,"data-y-position":Q_,"data-x-position":sL,"data-index":_,"data-front":Oa,"data-swiping":ye,"data-dismissible":Fi,"data-type":an,"data-invert":iL,"data-swipe-out":Er,"data-expanded":!!(E||H&&J),style:{"--index":_,"--toasts-before":_,"--z-index":x.length-_,"--offset":`${De?Ra:Vi.current}px`,"--initial-height":H?"auto":`${Wn}px`,...P,...f.style},onPointerDown:ie=>{ap||!Fi||(Aa.current=new Date,Qr(Vi.current),ie.target.setPointerCapture(ie.pointerId),ie.target.tagName!=="BUTTON"&&(Kt(!0),Ui.current={x:ie.clientX,y:ie.clientY}))},onPointerUp:()=>{var ie,Re,Ee,Kn;if(Er||!Fi)return;Ui.current=null;let Gn=Number(((ie=Sr.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Iu=new Date().getTime()-((Re=Aa.current)==null?void 0:Re.getTime()),aL=Math.abs(Gn)/Iu;if(Math.abs(Gn)>=AF||aL>.11){Qr(Vi.current),(Ee=f.onDismiss)==null||Ee.call(f,f),Xr(),mt(!0);return}(Kn=Sr.current)==null||Kn.style.setProperty("--swipe-amount","0px"),Kt(!1)},onPointerMove:ie=>{var Re;if(!Ui.current||!Fi)return;let Ee=ie.clientY-Ui.current.y,Kn=ie.clientX-Ui.current.x,Gn=(Q_==="top"?Math.min:Math.max)(0,Ee),Iu=ie.pointerType==="touch"?10:2;Math.abs(Gn)>Iu?(Re=Sr.current)==null||Re.style.setProperty("--swipe-amount",`${Ee}px`):Math.abs(Kn)>Iu&&(Ui.current=null)}},rL&&!f.jsx?$.createElement("button",{"aria-label":U,"data-disabled":ap,"data-close-button":!0,onClick:ap||!Fi?()=>{}:()=>{var ie;Xr(),(ie=f.onDismiss)==null||ie.call(f,f)},className:z(R?.closeButton,(s=f?.classNames)==null?void 0:s.closeButton)},$.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"},$.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),$.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,f.jsx||$.isValidElement(f.title)?f.jsx||f.title:$.createElement($.Fragment,null,an||f.icon||f.promise?$.createElement("div",{"data-icon":"",className:z(R?.icon,(i=f?.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||oL():null,f.type!=="loading"?f.icon||A?.[an]||hF(an):null):null,$.createElement("div",{"data-content":"",className:z(R?.content,(o=f?.classNames)==null?void 0:o.content)},$.createElement("div",{"data-title":"",className:z(R?.title,(a=f?.classNames)==null?void 0:a.title)},f.title),f.description?$.createElement("div",{"data-description":"",className:z(F,nL,R?.description,(l=f?.classNames)==null?void 0:l.description)},f.description):null),$.isValidElement(f.cancel)?f.cancel:f.cancel&&ed(f.cancel)?$.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||I,onClick:ie=>{var Re,Ee;ed(f.cancel)&&Fi&&((Ee=(Re=f.cancel).onClick)==null||Ee.call(Re,ie),Xr())},className:z(R?.cancelButton,(c=f?.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,$.isValidElement(f.action)?f.action:f.action&&ed(f.action)?$.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||k,onClick:ie=>{var Re,Ee;ed(f.action)&&(ie.defaultPrevented||((Ee=(Re=f.action).onClick)==null||Ee.call(Re,ie),Xr()))},className:z(R?.actionButton,(u=f?.classNames)==null?void 0:u.actionButton)},f.action.label):null))};function Lx(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var NF=t=>{let{invert:e,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:o,offset:a,theme:l="light",richColors:c,duration:u,style:d,visibleToasts:f=PF,toastOptions:p,dir:m=Lx(),gap:v=jF,loadingIcon:w,icons:y,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:x,cn:E=IF}=t,[b,S]=$.useState([]),T=$.useMemo(()=>Array.from(new Set([n].concat(b.filter(M=>M.position).map(M=>M.position)))),[b,n]),[P,I]=$.useState([]),[k,V]=$.useState(!1),[F,Y]=$.useState(!1),[N,X]=$.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=$.useRef(null),H=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=$.useRef(null),A=$.useRef(!1),U=$.useCallback(M=>{var z;(z=b.find(J=>J.id===M.id))!=null&&z.delete||Qt.dismiss(M.id),S(J=>J.filter(({id:re})=>re!==M.id))},[b]);return $.useEffect(()=>Qt.subscribe(M=>{if(M.dismiss){S(z=>z.map(J=>J.id===M.id?{...J,delete:!0}:J));return}setTimeout(()=>{QP.flushSync(()=>{S(z=>{let J=z.findIndex(re=>re.id===M.id);return J!==-1?[...z.slice(0,J),{...z[J],...M},...z.slice(J+1)]:[M,...z]})})})}),[]),$.useEffect(()=>{if(l!=="system"){X(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:M})=>{X(M?"dark":"light")})},[l]),$.useEffect(()=>{b.length<=1&&V(!1)},[b]),$.useEffect(()=>{let M=z=>{var J,re;r.every(De=>z[De]||z.code===De)&&(V(!0),(J=B.current)==null||J.focus()),z.code==="Escape"&&(document.activeElement===B.current||(re=B.current)!=null&&re.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),$.useEffect(()=>{if(B.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,A.current=!1)}},[B.current]),b.length?$.createElement("section",{"aria-label":`${_} ${H}`,tabIndex:-1},T.map((M,z)=>{var J;let[re,De]=M.split("-");return $.createElement("ol",{key:M,dir:m==="auto"?Lx():m,tabIndex:-1,ref:B,className:o,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":re,"data-x-position":De,style:{"--front-toast-height":`${((J=P[0])==null?void 0:J.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||CF,"--width":`${RF}px`,"--gap":`${v}px`,...d},onBlur:se=>{A.current&&!se.currentTarget.contains(se.relatedTarget)&&(A.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||A.current||(A.current=!0,R.current=se.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{F||V(!1)},onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},b.filter(se=>!se.position&&z===0||se.position===M).map((se,ye)=>{var Kt,Er;return $.createElement(LF,{key:se.id,icons:y,index:ye,toast:se,defaultRichColors:c,duration:(Kt=p?.duration)!=null?Kt:u,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:e,visibleToasts:f,closeButton:(Er=p?.closeButton)!=null?Er:i,interacting:F,position:M,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:U,toasts:b.filter(mt=>mt.position==se.position),heights:P.filter(mt=>mt.position==se.position),setHeights:I,expandByDefault:s,gap:v,loadingIcon:w,expanded:k,pauseWhenPageIsHidden:x,cn:E})}))})):null};const DF=({...t})=>{const{theme:e="system"}=dF();return h.jsx(NF,{theme:e,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"}},...t})};var MF=GS.useId||(()=>{}),$F=0;function _i(t){const[e,n]=g.useState(MF());return _r(()=>{n(r=>r??String($F++))},[t]),e?`radix-${e}`:""}const FF=["top","right","bottom","left"],Fs=Math.min,Jt=Math.max,Th=Math.round,td=Math.floor,Vs=t=>({x:t,y:t}),VF={left:"right",right:"left",bottom:"top",top:"bottom"},UF={start:"end",end:"start"};function Wm(t,e,n){return Jt(t,Fs(e,n))}function Wr(t,e){return typeof t=="function"?t(e):t}function Kr(t){return t.split("-")[0]}function xa(t){return t.split("-")[1]}function y0(t){return t==="x"?"y":"x"}function _0(t){return t==="y"?"height":"width"}function Us(t){return["top","bottom"].includes(Kr(t))?"y":"x"}function w0(t){return y0(Us(t))}function zF(t,e,n){n===void 0&&(n=!1);const r=xa(t),s=w0(t),i=_0(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Ph(o)),[o,Ph(o)]}function BF(t){const e=Ph(t);return[Km(t),e,Km(e)]}function Km(t){return t.replace(/start|end/g,e=>UF[e])}function HF(t,e,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?i:o;default:return[]}}function WF(t,e,n,r){const s=xa(t);let i=HF(Kr(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Km)))),i}function Ph(t){return t.replace(/left|right|bottom|top/g,e=>VF[e])}function KF(t){return{top:0,right:0,bottom:0,left:0,...t}}function KC(t){return typeof t!="number"?KF(t):{top:t,right:t,bottom:t,left:t}}function Ch(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function Nx(t,e,n){let{reference:r,floating:s}=t;const i=Us(e),o=w0(e),a=_0(o),l=Kr(e),c=i==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-s.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-s.width,y:d};break;default:p={x:r.x,y:r.y}}switch(xa(e)){case"start":p[o]-=f*(n&&c?-1:1);break;case"end":p[o]+=f*(n&&c?-1:1);break}return p}const GF=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:u,y:d}=Nx(c,r,l),f=r,p={},m=0;for(let v=0;v<a.length;v++){const{name:w,fn:y}=a[v],{x:_,y:x,data:E,reset:b}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:p,rects:c,platform:o,elements:{reference:t,floating:e}});u=_??u,d=x??d,p={...p,[w]:{...p[w],...E}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(c=b.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):b.rects),{x:u,y:d}=Nx(c,f,l)),v=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:p}};async function Dc(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Wr(e,t),m=KC(p),w=a[f?d==="floating"?"reference":"floating":d],y=Ch(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),E=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},b=Ch(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:x,strategy:l}):_);return{top:(y.top-b.top+m.top)/E.y,bottom:(b.bottom-y.bottom+m.bottom)/E.y,left:(y.left-b.left+m.left)/E.x,right:(b.right-y.right+m.right)/E.x}}const qF=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Wr(t,e)||{};if(c==null)return{};const d=KC(u),f={x:n,y:r},p=w0(s),m=_0(p),v=await o.getDimensions(c),w=p==="y",y=w?"top":"left",_=w?"bottom":"right",x=w?"clientHeight":"clientWidth",E=i.reference[m]+i.reference[p]-f[p]-i.floating[m],b=f[p]-i.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let T=S?S[x]:0;(!T||!await(o.isElement==null?void 0:o.isElement(S)))&&(T=a.floating[x]||i.floating[m]);const P=E/2-b/2,I=T/2-v[m]/2-1,k=Fs(d[y],I),V=Fs(d[_],I),F=k,Y=T-v[m]-V,N=T/2-v[m]/2+P,X=Wm(F,N,Y),B=!l.arrow&&xa(s)!=null&&N!==X&&i.reference[m]/2-(N<F?k:V)-v[m]/2<0,H=B?N<F?N-F:N-Y:0;return{[p]:f[p]+H,data:{[p]:X,centerOffset:N-X-H,...B&&{alignmentOffset:H}},reset:B}}}),YF=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...w}=Wr(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Kr(s),_=Us(a),x=Kr(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),b=f||(x||!v?[Ph(a)]:BF(a)),S=m!=="none";!f&&S&&b.push(...WF(a,v,m,E));const T=[a,...b],P=await Dc(e,w),I=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&I.push(P[y]),d){const N=zF(s,o,E);I.push(P[N[0]],P[N[1]])}if(k=[...k,{placement:s,overflows:I}],!I.every(N=>N<=0)){var V,F;const N=(((V=i.flip)==null?void 0:V.index)||0)+1,X=T[N];if(X)return{data:{index:N,overflows:k},reset:{placement:X}};let B=(F=k.filter(H=>H.overflows[0]<=0).sort((H,R)=>H.overflows[1]-R.overflows[1])[0])==null?void 0:F.placement;if(!B)switch(p){case"bestFit":{var Y;const H=(Y=k.filter(R=>{if(S){const A=Us(R.placement);return A===_||A==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(A=>A>0).reduce((A,U)=>A+U,0)]).sort((R,A)=>R[1]-A[1])[0])==null?void 0:Y[0];H&&(B=H);break}case"initialPlacement":B=a;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function Dx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Mx(t){return FF.some(e=>t[e]>=0)}const QF=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=Wr(t,e);switch(r){case"referenceHidden":{const i=await Dc(e,{...s,elementContext:"reference"}),o=Dx(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Mx(o)}}}case"escaped":{const i=await Dc(e,{...s,altBoundary:!0}),o=Dx(i,n.floating);return{data:{escapedOffsets:o,escaped:Mx(o)}}}default:return{}}}}};async function XF(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Kr(n),a=xa(n),l=Us(n)==="y",c=["left","top"].includes(o)?-1:1,u=i&&l?-1:1,d=Wr(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const JF=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=e,l=await XF(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},ZF=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x:y,y:_}=w;return{x:y,y:_}}},...l}=Wr(t,e),c={x:n,y:r},u=await Dc(e,l),d=Us(Kr(s)),f=y0(d);let p=c[f],m=c[d];if(i){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",_=p+u[w],x=p-u[y];p=Wm(_,p,x)}if(o){const w=d==="y"?"top":"left",y=d==="y"?"bottom":"right",_=m+u[w],x=m-u[y];m=Wm(_,m,x)}const v=a.fn({...e,[f]:p,[d]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[d]:o}}}}}},e5=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Wr(t,e),u={x:n,y:r},d=Us(s),f=y0(d);let p=u[f],m=u[d];const v=Wr(a,e),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=f==="y"?"height":"width",E=i.reference[f]-i.floating[x]+w.mainAxis,b=i.reference[f]+i.reference[x]-w.mainAxis;p<E?p=E:p>b&&(p=b)}if(c){var y,_;const x=f==="y"?"width":"height",E=["top","left"].includes(Kr(s)),b=i.reference[d]-i.floating[x]+(E&&((y=o.offset)==null?void 0:y[d])||0)+(E?0:w.crossAxis),S=i.reference[d]+i.reference[x]+(E?0:((_=o.offset)==null?void 0:_[d])||0)-(E?w.crossAxis:0);m<b?m=b:m>S&&(m=S)}return{[f]:p,[d]:m}}}},t5=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:l=()=>{},...c}=Wr(t,e),u=await Dc(e,c),d=Kr(s),f=xa(s),p=Us(s)==="y",{width:m,height:v}=i.floating;let w,y;d==="top"||d==="bottom"?(w=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,w=f==="end"?"top":"bottom");const _=v-u.top-u.bottom,x=m-u.left-u.right,E=Fs(v-u[w],_),b=Fs(m-u[y],x),S=!e.middlewareData.shift;let T=E,P=b;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=_),S&&!f){const k=Jt(u.left,0),V=Jt(u.right,0),F=Jt(u.top,0),Y=Jt(u.bottom,0);p?P=m-2*(k!==0||V!==0?k+V:Jt(u.left,u.right)):T=v-2*(F!==0||Y!==0?F+Y:Jt(u.top,u.bottom))}await l({...e,availableWidth:P,availableHeight:T});const I=await o.getDimensions(a.floating);return m!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function jf(){return typeof window<"u"}function ba(t){return GC(t)?(t.nodeName||"").toLowerCase():"#document"}function nn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function br(t){var e;return(e=(GC(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function GC(t){return jf()?t instanceof Node||t instanceof nn(t).Node:!1}function $n(t){return jf()?t instanceof Element||t instanceof nn(t).Element:!1}function wr(t){return jf()?t instanceof HTMLElement||t instanceof nn(t).HTMLElement:!1}function $x(t){return!jf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof nn(t).ShadowRoot}function _u(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Fn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function n5(t){return["table","td","th"].includes(ba(t))}function Af(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function x0(t){const e=b0(),n=$n(t)?Fn(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function r5(t){let e=zs(t);for(;wr(e)&&!ta(e);){if(x0(e))return e;if(Af(e))return null;e=zs(e)}return null}function b0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ta(t){return["html","body","#document"].includes(ba(t))}function Fn(t){return nn(t).getComputedStyle(t)}function Of(t){return $n(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function zs(t){if(ba(t)==="html")return t;const e=t.assignedSlot||t.parentNode||$x(t)&&t.host||br(t);return $x(e)?e.host:e}function qC(t){const e=zs(t);return ta(e)?t.ownerDocument?t.ownerDocument.body:t.body:wr(e)&&_u(e)?e:qC(e)}function Mc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=qC(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=nn(s);if(i){const a=Gm(o);return e.concat(o,o.visualViewport||[],_u(s)?s:[],a&&n?Mc(a):[])}return e.concat(s,Mc(s,[],n))}function Gm(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function YC(t){const e=Fn(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=wr(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=Th(n)!==i||Th(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function E0(t){return $n(t)?t:t.contextElement}function Oo(t){const e=E0(t);if(!wr(e))return Vs(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=YC(e);let o=(i?Th(n.width):n.width)/r,a=(i?Th(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const s5=Vs(0);function QC(t){const e=nn(t);return!b0()||!e.visualViewport?s5:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function i5(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==nn(t)?!1:e}function ki(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=E0(t);let o=Vs(1);e&&(r?$n(r)&&(o=Oo(r)):o=Oo(t));const a=i5(i,n,r)?QC(i):Vs(0);let l=(s.left+a.x)/o.x,c=(s.top+a.y)/o.y,u=s.width/o.x,d=s.height/o.y;if(i){const f=nn(i),p=r&&$n(r)?nn(r):r;let m=f,v=Gm(m);for(;v&&r&&p!==m;){const w=Oo(v),y=v.getBoundingClientRect(),_=Fn(v),x=y.left+(v.clientLeft+parseFloat(_.paddingLeft))*w.x,E=y.top+(v.clientTop+parseFloat(_.paddingTop))*w.y;l*=w.x,c*=w.y,u*=w.x,d*=w.y,l+=x,c+=E,m=nn(v),v=Gm(m)}}return Ch({width:u,height:d,x:l,y:c})}function o5(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=br(r),a=e?Af(e.floating):!1;if(r===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Vs(1);const u=Vs(0),d=wr(r);if((d||!d&&!i)&&((ba(r)!=="body"||_u(o))&&(l=Of(r)),wr(r))){const f=ki(r);c=Oo(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function a5(t){return Array.from(t.getClientRects())}function qm(t,e){const n=Of(t).scrollLeft;return e?e.left+n:ki(br(t)).left+n}function l5(t){const e=br(t),n=Of(t),r=t.ownerDocument.body,s=Jt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Jt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+qm(t);const a=-n.scrollTop;return Fn(r).direction==="rtl"&&(o+=Jt(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function c5(t,e){const n=nn(t),r=br(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const c=b0();(!c||c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}function u5(t,e){const n=ki(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=wr(t)?Oo(t):Vs(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,c=r*i.y;return{width:o,height:a,x:l,y:c}}function Fx(t,e,n){let r;if(e==="viewport")r=c5(t,n);else if(e==="document")r=l5(br(t));else if($n(e))r=u5(e,n);else{const s=QC(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return Ch(r)}function XC(t,e){const n=zs(t);return n===e||!$n(n)||ta(n)?!1:Fn(n).position==="fixed"||XC(n,e)}function d5(t,e){const n=e.get(t);if(n)return n;let r=Mc(t,[],!1).filter(a=>$n(a)&&ba(a)!=="body"),s=null;const i=Fn(t).position==="fixed";let o=i?zs(t):t;for(;$n(o)&&!ta(o);){const a=Fn(o),l=x0(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||_u(o)&&!l&&XC(t,o))?r=r.filter(u=>u!==o):s=a,o=zs(o)}return e.set(t,r),r}function h5(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Af(e)?[]:d5(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Fx(e,u,s);return c.top=Jt(d.top,c.top),c.right=Fs(d.right,c.right),c.bottom=Fs(d.bottom,c.bottom),c.left=Jt(d.left,c.left),c},Fx(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function f5(t){const{width:e,height:n}=YC(t);return{width:e,height:n}}function p5(t,e,n){const r=wr(e),s=br(e),i=n==="fixed",o=ki(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=Vs(0);if(r||!r&&!i)if((ba(e)!=="body"||_u(s))&&(a=Of(e)),r){const p=ki(e,!0,i,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else s&&(l.x=qm(s));let c=0,u=0;if(s&&!r&&!i){const p=s.getBoundingClientRect();u=p.top+a.scrollTop,c=p.left+a.scrollLeft-qm(s,p)}const d=o.left+a.scrollLeft-l.x-c,f=o.top+a.scrollTop-l.y-u;return{x:d,y:f,width:o.width,height:o.height}}function Vp(t){return Fn(t).position==="static"}function Vx(t,e){if(!wr(t)||Fn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return br(t)===n&&(n=n.ownerDocument.body),n}function JC(t,e){const n=nn(t);if(Af(t))return n;if(!wr(t)){let s=zs(t);for(;s&&!ta(s);){if($n(s)&&!Vp(s))return s;s=zs(s)}return n}let r=Vx(t,e);for(;r&&n5(r)&&Vp(r);)r=Vx(r,e);return r&&ta(r)&&Vp(r)&&!x0(r)?n:r||r5(t)||n}const g5=async function(t){const e=this.getOffsetParent||JC,n=this.getDimensions,r=await n(t.floating);return{reference:p5(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function m5(t){return Fn(t).direction==="rtl"}const v5={convertOffsetParentRelativeRectToViewportRelativeRect:o5,getDocumentElement:br,getClippingRect:h5,getOffsetParent:JC,getElementRects:g5,getClientRects:a5,getDimensions:f5,getScale:Oo,isElement:$n,isRTL:m5};function y5(t,e){let n=null,r;const s=br(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=t.getBoundingClientRect();if(a||e(),!d||!f)return;const p=td(u),m=td(s.clientWidth-(c+d)),v=td(s.clientHeight-(u+f)),w=td(c),_={rootMargin:-p+"px "+-m+"px "+-v+"px "+-w+"px",threshold:Jt(0,Fs(1,l))||1};let x=!0;function E(b){const S=b[0].intersectionRatio;if(S!==l){if(!x)return o();S?o(!1,S):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(E,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,_)}n.observe(t)}return o(!0),i}function _5(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=E0(t),u=s||i?[...c?Mc(c):[],...Mc(e)]:[];u.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&a?y5(c,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let m,v=l?ki(t):null;l&&w();function w(){const y=ki(t);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,m=requestAnimationFrame(w)}return n(),()=>{var y;u.forEach(_=>{s&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),d?.(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const w5=JF,x5=ZF,b5=YF,E5=t5,S5=QF,Ux=qF,T5=e5,P5=(t,e,n)=>{const r=new Map,s={platform:v5,...n},i={...s.platform,_c:r};return GF(t,e,{...s,platform:i})};var $d=typeof document<"u"?g.useLayoutEffect:g.useEffect;function kh(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!kh(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!kh(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function ZC(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zx(t,e){const n=ZC(t);return Math.round(e*n)/n}function Up(t){const e=g.useRef(t);return $d(()=>{e.current=t}),e}function C5(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[u,d]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);kh(f,r)||p(r);const[m,v]=g.useState(null),[w,y]=g.useState(null),_=g.useCallback(R=>{R!==S.current&&(S.current=R,v(R))},[]),x=g.useCallback(R=>{R!==T.current&&(T.current=R,y(R))},[]),E=i||m,b=o||w,S=g.useRef(null),T=g.useRef(null),P=g.useRef(u),I=l!=null,k=Up(l),V=Up(s),F=Up(c),Y=g.useCallback(()=>{if(!S.current||!T.current)return;const R={placement:e,strategy:n,middleware:f};V.current&&(R.platform=V.current),P5(S.current,T.current,R).then(A=>{const U={...A,isPositioned:F.current!==!1};N.current&&!kh(P.current,U)&&(P.current=U,gu.flushSync(()=>{d(U)}))})},[f,e,n,V,F]);$d(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[c]);const N=g.useRef(!1);$d(()=>(N.current=!0,()=>{N.current=!1}),[]),$d(()=>{if(E&&(S.current=E),b&&(T.current=b),E&&b){if(k.current)return k.current(E,b,Y);Y()}},[E,b,Y,k,I]);const X=g.useMemo(()=>({reference:S,floating:T,setReference:_,setFloating:x}),[_,x]),B=g.useMemo(()=>({reference:E,floating:b}),[E,b]),H=g.useMemo(()=>{const R={position:n,left:0,top:0};if(!B.floating)return R;const A=zx(B.floating,u.x),U=zx(B.floating,u.y);return a?{...R,transform:"translate("+A+"px, "+U+"px)",...ZC(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:U}},[n,a,B.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:Y,refs:X,elements:B,floatingStyles:H}),[u,Y,X,B,H])}const k5=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Ux({element:r.current,padding:s}).fn(n):{}:r?Ux({element:r,padding:s}).fn(n):{}}}},R5=(t,e)=>({...w5(t),options:[t,e]}),j5=(t,e)=>({...x5(t),options:[t,e]}),A5=(t,e)=>({...T5(t),options:[t,e]}),O5=(t,e)=>({...b5(t),options:[t,e]}),I5=(t,e)=>({...E5(t),options:[t,e]}),L5=(t,e)=>({...S5(t),options:[t,e]}),N5=(t,e)=>({...k5(t),options:[t,e]});var D5="Arrow",ek=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return h.jsx(ve.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});ek.displayName=D5;var M5=ek;function $5(t,e=[]){let n=[];function r(i,o){const a=g.createContext(o),l=n.length;n=[...n,o];function c(d){const{scope:f,children:p,...m}=d,v=f?.[t][l]||a,w=g.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:w,children:p})}function u(d,f){const p=f?.[t][l]||a,m=g.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const s=()=>{const i=n.map(o=>g.createContext(o));return function(a){const l=a?.[t]||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,F5(s,...e)]}function F5(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function V5(t){const[e,n]=g.useState(void 0);return _r(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var S0="Popper",[tk,If]=$5(S0),[U5,nk]=tk(S0),rk=t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null);return h.jsx(U5,{scope:e,anchor:r,onAnchorChange:s,children:n})};rk.displayName=S0;var sk="PopperAnchor",ik=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=nk(sk,n),o=g.useRef(null),a=Xe(e,o);return g.useEffect(()=>{i.onAnchorChange(r?.current||o.current)}),r?null:h.jsx(ve.div,{...s,ref:a})});ik.displayName=sk;var T0="PopperContent",[z5,B5]=tk(T0),ok=g.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...v}=t,w=nk(T0,n),[y,_]=g.useState(null),x=Xe(e,ye=>_(ye)),[E,b]=g.useState(null),S=V5(E),T=S?.width??0,P=S?.height??0,I=r+(i!=="center"?"-"+i:""),k=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},V=Array.isArray(c)?c:[c],F=V.length>0,Y={padding:k,boundary:V.filter(W5),altBoundary:F},{refs:N,floatingStyles:X,placement:B,isPositioned:H,middlewareData:R}=C5({strategy:"fixed",placement:I,whileElementsMounted:(...ye)=>_5(...ye,{animationFrame:p==="always"}),elements:{reference:w.anchor},middleware:[R5({mainAxis:s+P,alignmentAxis:o}),l&&j5({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?A5():void 0,...Y}),l&&O5({...Y}),I5({...Y,apply:({elements:ye,rects:Kt,availableWidth:Er,availableHeight:mt})=>{const{width:Ra,height:Qr}=Kt.reference,Wn=ye.floating.style;Wn.setProperty("--radix-popper-available-width",`${Er}px`),Wn.setProperty("--radix-popper-available-height",`${mt}px`),Wn.setProperty("--radix-popper-anchor-width",`${Ra}px`),Wn.setProperty("--radix-popper-anchor-height",`${Qr}px`)}}),E&&N5({element:E,padding:a}),K5({arrowWidth:T,arrowHeight:P}),f&&L5({strategy:"referenceHidden",...Y})]}),[A,U]=ck(B),M=Tt(m);_r(()=>{H&&M?.()},[H,M]);const z=R.arrow?.x,J=R.arrow?.y,re=R.arrow?.centerOffset!==0,[De,se]=g.useState();return _r(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),h.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:H?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:De,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(" "),...R.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(z5,{scope:n,placedSide:A,onArrowChange:b,arrowX:z,arrowY:J,shouldHideArrow:re,children:h.jsx(ve.div,{"data-side":A,"data-align":U,...v,ref:x,style:{...v.style,animation:H?void 0:"none"}})})})});ok.displayName=T0;var ak="PopperArrow",H5={top:"bottom",right:"left",bottom:"top",left:"right"},lk=g.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=B5(ak,r),o=H5[i.placedSide];return h.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:h.jsx(M5,{...s,ref:n,style:{...s.style,display:"block"}})})});lk.displayName=ak;function W5(t){return t!==null}var K5=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:s}=e,o=s.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,u]=ck(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(s.arrow?.x??0)+a/2,p=(s.arrow?.y??0)+l/2;let m="",v="";return c==="bottom"?(m=o?d:`${f}px`,v=`${-l}px`):c==="top"?(m=o?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,v=o?d:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,v=o?d:`${p}px`),{data:{x:m,y:v}}}});function ck(t){const[e,n="center"]=t.split("-");return[e,n]}var uk=rk,dk=ik,hk=ok,fk=lk,[Lf,OQ]=_a("Tooltip",[If]),Nf=If(),pk="TooltipProvider",G5=700,Ym="tooltip.open",[q5,P0]=Lf(pk),gk=t=>{const{__scopeTooltip:e,delayDuration:n=G5,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,[o,a]=g.useState(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),h.jsx(q5,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:g.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:i})};gk.displayName=pk;var Df="Tooltip",[Y5,wu]=Lf(Df),mk=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=t,l=P0(Df,t.__scopeTooltip),c=Nf(e),[u,d]=g.useState(null),f=_i(),p=g.useRef(0),m=o??l.disableHoverableContent,v=a??l.delayDuration,w=g.useRef(!1),[y=!1,_]=yu({prop:r,defaultProp:s,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ym))):l.onClose(),i?.(T)}}),x=g.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),E=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w.current=!1,_(!0)},[_]),b=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,_(!1)},[_]),S=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{w.current=!0,_(!0),p.current=0},v)},[v,_]);return g.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(uk,{...c,children:h.jsx(Y5,{scope:e,contentId:f,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayed?S():E()},[l.isOpenDelayed,S,E]),onTriggerLeave:g.useCallback(()=>{m?b():(window.clearTimeout(p.current),p.current=0)},[b,m]),onOpen:E,onClose:b,disableHoverableContent:m,children:n})})};mk.displayName=Df;var Qm="TooltipTrigger",vk=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=wu(Qm,n),i=P0(Qm,n),o=Nf(n),a=g.useRef(null),l=Xe(e,a,s.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(dk,{asChild:!0,...o,children:h.jsx(ve.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Z(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:Z(t.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:Z(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(t.onFocus,()=>{c.current||s.onOpen()}),onBlur:Z(t.onBlur,s.onClose),onClick:Z(t.onClick,s.onClose)})})});vk.displayName=Qm;var C0="TooltipPortal",[Q5,X5]=Lf(C0,{forceMount:void 0}),yk=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=wu(C0,e);return h.jsx(Q5,{scope:e,forceMount:n,children:h.jsx(zn,{present:n||i.open,children:h.jsx(vu,{asChild:!0,container:s,children:r})})})};yk.displayName=C0;var na="TooltipContent",_k=g.forwardRef((t,e)=>{const n=X5(na,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=wu(na,t.__scopeTooltip);return h.jsx(zn,{present:r||o.open,children:o.disableHoverableContent?h.jsx(wk,{side:s,...i,ref:e}):h.jsx(J5,{side:s,...i,ref:e})})}),J5=g.forwardRef((t,e)=>{const n=wu(na,t.__scopeTooltip),r=P0(na,t.__scopeTooltip),s=g.useRef(null),i=Xe(e,s),[o,a]=g.useState(null),{trigger:l,onClose:c}=n,u=s.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),p=g.useCallback((m,v)=>{const w=m.currentTarget,y={x:m.clientX,y:m.clientY},_=n3(y,w.getBoundingClientRect()),x=r3(y,_),E=s3(v.getBoundingClientRect()),b=o3([...x,...E]);a(b),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&u){const m=w=>p(w,u),v=w=>p(w,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),g.useEffect(()=>{if(o){const m=v=>{const w=v.target,y={x:v.clientX,y:v.clientY},_=l?.contains(w)||u?.contains(w),x=!i3(y,o);_?f():x&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,o,c,f]),h.jsx(wk,{...t,ref:i})}),[Z5,e3]=Lf(Df,{isInside:!1}),wk=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=wu(na,n),c=Nf(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(Ym,u),()=>document.removeEventListener(Ym,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=f=>{f.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(mu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(hk,{"data-state":l.stateAttribute,...c,...a,ref:e,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:[h.jsx(cC,{children:r}),h.jsx(Z5,{scope:n,isInside:!0,children:h.jsx(fM,{id:l.contentId,role:"tooltip",children:s||r})})]})})});_k.displayName=na;var xk="TooltipArrow",t3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Nf(n);return e3(xk,n).isInside?null:h.jsx(fk,{...s,...r,ref:e})});t3.displayName=xk;function n3(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function r3(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function s3(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function i3(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i].x,l=e[i].y,c=e[o].x,u=e[o].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(s=!s)}return s}function o3(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),a3(e)}function a3(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var l3=gk,c3=mk,u3=vk,d3=yk,bk=_k;const h3=l3,IQ=c3,LQ=u3,f3=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(d3,{children:h.jsx(bk,{ref:r,sideOffset:e,className:Le("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));f3.displayName=bk.displayName;var Mf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$f=typeof window>"u"||"Deno"in globalThis;function Rn(){}function p3(t,e){return typeof t=="function"?t(e):t}function g3(t){return typeof t=="number"&&t>=0&&t!==1/0}function m3(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Bx(t,e){return typeof t=="function"?t(e):t}function v3(t,e){return typeof t=="function"?t(e):t}function Hx(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==k0(o,e.options))return!1}else if(!Fc(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function Wx(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if($c(e.options.mutationKey)!==$c(i))return!1}else if(!Fc(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function k0(t,e){return(e?.queryKeyHashFn||$c)(t)}function $c(t){return JSON.stringify(t,(e,n)=>Xm(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Fc(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Fc(t[n],e[n])):!1}function Ek(t,e){if(t===e)return t;const n=Kx(t)&&Kx(e);if(n||Xm(t)&&Xm(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),o=i.length,a=n?[]:{};let l=0;for(let c=0;c<o;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&t[u]===void 0&&e[u]===void 0?(a[u]=void 0,l++):(a[u]=Ek(t[u],e[u]),a[u]===t[u]&&t[u]!==void 0&&l++)}return s===o&&l===s?t:a}return e}function NQ(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Kx(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Xm(t){if(!Gx(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Gx(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Gx(t){return Object.prototype.toString.call(t)==="[object Object]"}function y3(t){return new Promise(e=>{setTimeout(e,t)})}function _3(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Ek(t,e):e}function w3(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function x3(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var R0=Symbol();function Sk(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===R0?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var hi,ms,Fo,RS,b3=(RS=class extends Mf{constructor(){super();_e(this,hi);_e(this,ms);_e(this,Fo);le(this,Fo,e=>{if(!$f&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){L(this,ms)||this.setEventListener(L(this,Fo))}onUnsubscribe(){var e;this.hasListeners()||((e=L(this,ms))==null||e.call(this),le(this,ms,void 0))}setEventListener(e){var n;le(this,Fo,e),(n=L(this,ms))==null||n.call(this),le(this,ms,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){L(this,hi)!==e&&(le(this,hi,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof L(this,hi)=="boolean"?L(this,hi):globalThis.document?.visibilityState!=="hidden"}},hi=new WeakMap,ms=new WeakMap,Fo=new WeakMap,RS),Tk=new b3,Vo,vs,Uo,jS,E3=(jS=class extends Mf{constructor(){super();_e(this,Vo,!0);_e(this,vs);_e(this,Uo);le(this,Uo,e=>{if(!$f&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){L(this,vs)||this.setEventListener(L(this,Uo))}onUnsubscribe(){var e;this.hasListeners()||((e=L(this,vs))==null||e.call(this),le(this,vs,void 0))}setEventListener(e){var n;le(this,Uo,e),(n=L(this,vs))==null||n.call(this),le(this,vs,e(this.setOnline.bind(this)))}setOnline(e){L(this,Vo)!==e&&(le(this,Vo,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return L(this,Vo)}},Vo=new WeakMap,vs=new WeakMap,Uo=new WeakMap,jS),Rh=new E3;function S3(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function T3(t){return Math.min(1e3*2**t,3e4)}function Pk(t){return(t??"online")==="online"?Rh.isOnline():!0}var Ck=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function zp(t){return t instanceof Ck}function kk(t){let e=!1,n=0,r=!1,s;const i=S3(),o=v=>{r||(f(new Ck(v)),t.abort?.())},a=()=>{e=!0},l=()=>{e=!1},c=()=>Tk.isFocused()&&(t.networkMode==="always"||Rh.isOnline())&&t.canRun(),u=()=>Pk(t.networkMode)&&t.canRun(),d=v=>{r||(r=!0,t.onSuccess?.(v),s?.(),i.resolve(v))},f=v=>{r||(r=!0,t.onError?.(v),s?.(),i.reject(v))},p=()=>new Promise(v=>{s=w=>{(r||c())&&v(w)},t.onPause?.()}).then(()=>{s=void 0,r||t.onContinue?.()}),m=()=>{if(r)return;let v;const w=n===0?t.initialPromise:void 0;try{v=w??t.fn()}catch(y){v=Promise.reject(y)}Promise.resolve(v).then(d).catch(y=>{if(r)return;const _=t.retry??($f?0:3),x=t.retryDelay??T3,E=typeof x=="function"?x(n,y):x,b=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(e||!b){f(y);return}n++,t.onFail?.(n,y),y3(E).then(()=>c()?void 0:p()).then(()=>{e?f(y):m()})})};return{promise:i,cancel:o,continue:()=>(s?.(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():p().then(m),i)}}function P3(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=a=>setTimeout(a,0);const i=a=>{e?t.push(a):s(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Rt=P3(),fi,AS,Rk=(AS=class{constructor(){_e(this,fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),g3(this.gcTime)&&le(this,fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??($f?1/0:5*60*1e3))}clearGcTimeout(){L(this,fi)&&(clearTimeout(L(this,fi)),le(this,fi,void 0))}},fi=new WeakMap,AS),zo,Bo,pn,xt,au,pi,jn,kr,OS,C3=(OS=class extends Rk{constructor(e){super();_e(this,jn);_e(this,zo);_e(this,Bo);_e(this,pn);_e(this,xt);_e(this,au);_e(this,pi);le(this,pi,!1),le(this,au,e.defaultOptions),this.setOptions(e.options),this.observers=[],le(this,pn,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,le(this,zo,R3(this.options)),this.state=e.state??L(this,zo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){return L(this,xt)?.promise}setOptions(e){this.options={...L(this,au),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,pn).remove(this)}setData(e,n){const r=_3(this.state.data,e,this.options);return vt(this,jn,kr).call(this,{data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e,n){vt(this,jn,kr).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){const n=L(this,xt)?.promise;return L(this,xt)?.cancel(e),n?n.then(Rn).catch(Rn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(L(this,zo))}isActive(){return this.observers.some(e=>v3(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===R0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!m3(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),L(this,xt)?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),L(this,xt)?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),L(this,pn).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(L(this,xt)&&(L(this,pi)?L(this,xt).cancel({revert:!0}):L(this,xt).cancelRetry()),this.scheduleGc()),L(this,pn).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||vt(this,jn,kr).call(this,{type:"invalidate"})}fetch(e,n){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(L(this,xt))return L(this,xt).continueRetry(),L(this,xt).promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(le(this,pi,!0),r.signal)})},i=()=>{const l=Sk(this.options,n),c={queryKey:this.queryKey,meta:this.meta};return s(c),le(this,pi,!1),this.options.persister?this.options.persister(l,c,this):l(c)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};s(o),this.options.behavior?.onFetch(o,this),le(this,Bo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&vt(this,jn,kr).call(this,{type:"fetch",meta:o.fetchOptions?.meta});const a=l=>{zp(l)&&l.silent||vt(this,jn,kr).call(this,{type:"error",error:l}),zp(l)||(L(this,pn).config.onError?.(l,this),L(this,pn).config.onSettled?.(this.state.data,l,this)),this.scheduleGc()};return le(this,xt,kk({initialPromise:n?.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:l=>{if(l===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(l)}catch(c){a(c);return}L(this,pn).config.onSuccess?.(l,this),L(this,pn).config.onSettled?.(l,this.state.error,this),this.scheduleGc()},onError:a,onFail:(l,c)=>{vt(this,jn,kr).call(this,{type:"failed",failureCount:l,error:c})},onPause:()=>{vt(this,jn,kr).call(this,{type:"pause"})},onContinue:()=>{vt(this,jn,kr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),L(this,xt).start()}},zo=new WeakMap,Bo=new WeakMap,pn=new WeakMap,xt=new WeakMap,au=new WeakMap,pi=new WeakMap,jn=new WeakSet,kr=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...k3(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return zp(s)&&s.revert&&L(this,Bo)?{...L(this,Bo),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Rt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),L(this,pn).notify({query:this,type:"updated",action:e})})},OS);function k3(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Pk(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function R3(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var tr,IS,j3=(IS=class extends Mf{constructor(e={}){super();_e(this,tr);this.config=e,le(this,tr,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??k0(s,n);let o=this.get(i);return o||(o=new C3({cache:this,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){L(this,tr).has(e.queryHash)||(L(this,tr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=L(this,tr).get(e.queryHash);n&&(e.destroy(),n===e&&L(this,tr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return L(this,tr).get(e)}getAll(){return[...L(this,tr).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Hx(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Hx(e,r)):n}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},tr=new WeakMap,IS),nr,Ct,gi,rr,rs,LS,A3=(LS=class extends Rk{constructor(e){super();_e(this,rr);_e(this,nr);_e(this,Ct);_e(this,gi);this.mutationId=e.mutationId,le(this,Ct,e.mutationCache),le(this,nr,[]),this.state=e.state||O3(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){L(this,nr).includes(e)||(L(this,nr).push(e),this.clearGcTimeout(),L(this,Ct).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){le(this,nr,L(this,nr).filter(n=>n!==e)),this.scheduleGc(),L(this,Ct).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){L(this,nr).length||(this.state.status==="pending"?this.scheduleGc():L(this,Ct).remove(this))}continue(){return L(this,gi)?.continue()??this.execute(this.state.variables)}async execute(e){le(this,gi,kk({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(s,i)=>{vt(this,rr,rs).call(this,{type:"failed",failureCount:s,error:i})},onPause:()=>{vt(this,rr,rs).call(this,{type:"pause"})},onContinue:()=>{vt(this,rr,rs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,Ct).canRun(this)}));const n=this.state.status==="pending",r=!L(this,gi).canStart();try{if(!n){vt(this,rr,rs).call(this,{type:"pending",variables:e,isPaused:r}),await L(this,Ct).config.onMutate?.(e,this);const i=await this.options.onMutate?.(e);i!==this.state.context&&vt(this,rr,rs).call(this,{type:"pending",context:i,variables:e,isPaused:r})}const s=await L(this,gi).start();return await L(this,Ct).config.onSuccess?.(s,e,this.state.context,this),await this.options.onSuccess?.(s,e,this.state.context),await L(this,Ct).config.onSettled?.(s,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(s,null,e,this.state.context),vt(this,rr,rs).call(this,{type:"success",data:s}),s}catch(s){try{throw await L(this,Ct).config.onError?.(s,e,this.state.context,this),await this.options.onError?.(s,e,this.state.context),await L(this,Ct).config.onSettled?.(void 0,s,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,s,e,this.state.context),s}finally{vt(this,rr,rs).call(this,{type:"error",error:s})}}finally{L(this,Ct).runNext(this)}}},nr=new WeakMap,Ct=new WeakMap,gi=new WeakMap,rr=new WeakSet,rs=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Rt.batch(()=>{L(this,nr).forEach(r=>{r.onMutationUpdate(e)}),L(this,Ct).notify({mutation:this,type:"updated",action:e})})},LS);function O3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yt,lu,NS,I3=(NS=class extends Mf{constructor(e={}){super();_e(this,Yt);_e(this,lu);this.config=e,le(this,Yt,new Map),le(this,lu,Date.now())}build(e,n,r){const s=new A3({mutationCache:this,mutationId:++Lu(this,lu)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){const n=nd(e),r=L(this,Yt).get(n)??[];r.push(e),L(this,Yt).set(n,r),this.notify({type:"added",mutation:e})}remove(e){const n=nd(e);if(L(this,Yt).has(n)){const r=L(this,Yt).get(n)?.filter(s=>s!==e);r&&(r.length===0?L(this,Yt).delete(n):L(this,Yt).set(n,r))}this.notify({type:"removed",mutation:e})}canRun(e){const n=L(this,Yt).get(nd(e))?.find(r=>r.state.status==="pending");return!n||n===e}runNext(e){return L(this,Yt).get(nd(e))?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve()}clear(){Rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...L(this,Yt).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Wx(n,r))}findAll(e={}){return this.getAll().filter(n=>Wx(e,n))}notify(e){Rt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Rt.batch(()=>Promise.all(e.map(n=>n.continue().catch(Rn))))}},Yt=new WeakMap,lu=new WeakMap,NS);function nd(t){return t.options.scope?.id??String(t.mutationId)}function qx(t){return{onFetch:(e,n)=>{const r=e.options,s=e.fetchOptions?.meta?.fetchMore?.direction,i=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(e.signal.aborted?u=!0:e.signal.addEventListener("abort",()=>{u=!0}),e.signal)})},f=Sk(e.options,e.fetchOptions),p=async(m,v,w)=>{if(u)return Promise.reject();if(v==null&&m.pages.length)return Promise.resolve(m);const y={queryKey:e.queryKey,pageParam:v,direction:w?"backward":"forward",meta:e.options.meta};d(y);const _=await f(y),{maxPages:x}=e.options,E=w?x3:w3;return{pages:E(m.pages,_,x),pageParams:E(m.pageParams,v,x)}};if(s&&i.length){const m=s==="backward",v=m?L3:Yx,w={pages:i,pageParams:o},y=v(r,w);a=await p(w,y,m)}else{const m=t??i.length;do{const v=l===0?o[0]??r.initialPageParam:Yx(r,a);if(l>0&&v==null)break;a=await p(a,v),l++}while(l<m)}return a};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function Yx(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function L3(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var He,ys,_s,Ho,Wo,ws,Ko,Go,DS,N3=(DS=class{constructor(t={}){_e(this,He);_e(this,ys);_e(this,_s);_e(this,Ho);_e(this,Wo);_e(this,ws);_e(this,Ko);_e(this,Go);le(this,He,t.queryCache||new j3),le(this,ys,t.mutationCache||new I3),le(this,_s,t.defaultOptions||{}),le(this,Ho,new Map),le(this,Wo,new Map),le(this,ws,0)}mount(){Lu(this,ws)._++,L(this,ws)===1&&(le(this,Ko,Tk.subscribe(async t=>{t&&(await this.resumePausedMutations(),L(this,He).onFocus())})),le(this,Go,Rh.subscribe(async t=>{t&&(await this.resumePausedMutations(),L(this,He).onOnline())})))}unmount(){var t,e;Lu(this,ws)._--,L(this,ws)===0&&((t=L(this,Ko))==null||t.call(this),le(this,Ko,void 0),(e=L(this,Go))==null||e.call(this),le(this,Go,void 0))}isFetching(t){return L(this,He).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return L(this,ys).findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return L(this,He).get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=L(this,He).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(Bx(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return L(this,He).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=L(this,He).get(r.queryHash)?.state.data,o=p3(e,i);if(o!==void 0)return L(this,He).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return Rt.batch(()=>L(this,He).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return L(this,He).get(e.queryHash)?.state}removeQueries(t){const e=L(this,He);Rt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=L(this,He),r={type:"active",...t};return Rt.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=Rt.batch(()=>L(this,He).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Rn).catch(Rn)}invalidateQueries(t={},e={}){return Rt.batch(()=>{if(L(this,He).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:e?.cancelRefetch??!0},r=Rt.batch(()=>L(this,He).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Rn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Rn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=L(this,He).build(this,e);return n.isStaleByTime(Bx(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Rn).catch(Rn)}fetchInfiniteQuery(t){return t.behavior=qx(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Rn).catch(Rn)}ensureInfiniteQueryData(t){return t.behavior=qx(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Rh.isOnline()?L(this,ys).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,He)}getMutationCache(){return L(this,ys)}getDefaultOptions(){return L(this,_s)}setDefaultOptions(t){le(this,_s,t)}setQueryDefaults(t,e){L(this,Ho).set($c(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...L(this,Ho).values()];let n={};return e.forEach(r=>{Fc(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){L(this,Wo).set($c(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...L(this,Wo).values()];let n={};return e.forEach(r=>{Fc(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...L(this,_s).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=k0(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===R0&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...L(this,_s).mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){L(this,He).clear(),L(this,ys).clear()}},He=new WeakMap,ys=new WeakMap,_s=new WeakMap,Ho=new WeakMap,Wo=new WeakMap,ws=new WeakMap,Ko=new WeakMap,Go=new WeakMap,DS),jk=g.createContext(void 0),DQ=t=>{const e=g.useContext(jk);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},D3=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(jk.Provider,{value:t,children:e})),M3=typeof Element<"u",$3=typeof Map=="function",F3=typeof Set=="function",V3=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Fd(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,s;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!Fd(t[r],e[r]))return!1;return!0}var i;if($3&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;for(i=t.entries();!(r=i.next()).done;)if(!Fd(r.value[1],e.get(r.value[0])))return!1;return!0}if(F3&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(V3&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[r]))return!1;if(M3&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&t.$$typeof)&&!Fd(t[s[r]],e[s[r]]))return!1;return!0}return t!==t&&e!==e}var U3=function(e,n){try{return Fd(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const z3=cu(U3);var B3=function(t,e,n,r,s,i,o,a){if(!t){var l;if(e===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=[n,r,s,i,o,a],u=0;l=new Error(e.replace(/%s/g,function(){return c[u++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},H3=B3;const Qx=cu(H3);var W3=function(e,n,r,s){var i=r?r.call(s,e,n):void 0;if(i!==void 0)return!!i;if(e===n)return!0;if(typeof e!="object"||!e||typeof n!="object"||!n)return!1;var o=Object.keys(e),a=Object.keys(n);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),c=0;c<o.length;c++){var u=o[c];if(!l(u))return!1;var d=e[u],f=n[u];if(i=r?r.call(s,d,f,u):void 0,i===!1||i===void 0&&d!==f)return!1}return!0};const K3=cu(W3);var Ak=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(Ak||{}),Bp={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},Xx=Object.values(Ak),j0={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},G3=Object.entries(j0).reduce((t,[e,n])=>(t[n]=e,t),{}),Ln="data-rh",Io={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Lo=(t,e)=>{for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null},q3=t=>{let e=Lo(t,"title");const n=Lo(t,Io.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),n&&e)return n.replace(/%s/g,()=>e);const r=Lo(t,Io.DEFAULT_TITLE);return e||r||void 0},Y3=t=>Lo(t,Io.ON_CHANGE_CLIENT_STATE)||(()=>{}),Hp=(t,e)=>e.filter(n=>typeof n[t]<"u").map(n=>n[t]).reduce((n,r)=>({...n,...r}),{}),Q3=(t,e)=>e.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let i=0;i<s.length;i+=1){const a=s[i].toLowerCase();if(t.indexOf(a)!==-1&&r[a])return n.concat(r)}}return n},[]),X3=t=>console&&typeof console.warn=="function"&&console.warn(t),Ha=(t,e,n)=>{const r={};return n.filter(s=>Array.isArray(s[t])?!0:(typeof s[t]<"u"&&X3(`Helmet: ${t} should be of type "Array". Instead found type "${typeof s[t]}"`),!1)).map(s=>s[t]).reverse().reduce((s,i)=>{const o={};i.filter(l=>{let c;const u=Object.keys(l);for(let f=0;f<u.length;f+=1){const p=u[f],m=p.toLowerCase();e.indexOf(m)!==-1&&!(c==="rel"&&l[c].toLowerCase()==="canonical")&&!(m==="rel"&&l[m].toLowerCase()==="stylesheet")&&(c=m),e.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(c=p)}if(!c||!l[c])return!1;const d=l[c].toLowerCase();return r[c]||(r[c]={}),o[c]||(o[c]={}),r[c][d]?!1:(o[c][d]=!0,!0)}).reverse().forEach(l=>s.push(l));const a=Object.keys(o);for(let l=0;l<a.length;l+=1){const c=a[l],u={...r[c],...o[c]};r[c]=u}return s},[]).reverse()},J3=(t,e)=>{if(Array.isArray(t)&&t.length){for(let n=0;n<t.length;n+=1)if(t[n][e])return!0}return!1},Z3=t=>({baseTag:Q3(["href"],t),bodyAttributes:Hp("bodyAttributes",t),defer:Lo(t,Io.DEFER),encode:Lo(t,Io.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Hp("htmlAttributes",t),linkTags:Ha("link",["rel","href"],t),metaTags:Ha("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:Ha("noscript",["innerHTML"],t),onChangeClientState:Y3(t),scriptTags:Ha("script",["src","innerHTML"],t),styleTags:Ha("style",["cssText"],t),title:q3(t),titleAttributes:Hp("titleAttributes",t),prioritizeSeoTags:J3(t,Io.PRIORITIZE_SEO_TAGS)}),Ok=t=>Array.isArray(t)?t.join(""):t,eV=(t,e)=>{const n=Object.keys(t);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&e[n[r]].includes(t[n[r]]))return!0;return!1},Wp=(t,e)=>Array.isArray(t)?t.reduce((n,r)=>(eV(r,e)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:t,priority:[]},Jx=(t,e)=>({...t,[e]:void 0}),tV=["noscript","script","style"],Jm=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Ik=t=>Object.keys(t).reduce((e,n)=>{const r=typeof t[n]<"u"?`${n}="${t[n]}"`:`${n}`;return e?`${e} ${r}`:r},""),nV=(t,e,n,r)=>{const s=Ik(n),i=Ok(e);return s?`<${t} ${Ln}="true" ${s}>${Jm(i,r)}</${t}>`:`<${t} ${Ln}="true">${Jm(i,r)}</${t}>`},rV=(t,e,n=!0)=>e.reduce((r,s)=>{const i=s,o=Object.keys(i).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,u)=>{const d=typeof i[u]>"u"?u:`${u}="${Jm(i[u],n)}"`;return c?`${c} ${d}`:d},""),a=i.innerHTML||i.cssText||"",l=tV.indexOf(t)===-1;return`${r}<${t} ${Ln}="true" ${o}${l?"/>":`>${a}</${t}>`}`},""),Lk=(t,e={})=>Object.keys(t).reduce((n,r)=>{const s=j0[r];return n[s||r]=t[r],n},e),sV=(t,e,n)=>{const r={key:e,[Ln]:!0},s=Lk(n,r);return[$.createElement("title",s,e)]},Vd=(t,e)=>e.map((n,r)=>{const s={key:r,[Ln]:!0};return Object.keys(n).forEach(i=>{const a=j0[i]||i;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[a]=n[i]}),$.createElement(t,s)}),fn=(t,e,n=!0)=>{switch(t){case"title":return{toComponent:()=>sV(t,e.title,e.titleAttributes),toString:()=>nV(t,e.title,e.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Lk(e),toString:()=>Ik(e)};default:return{toComponent:()=>Vd(t,e),toString:()=>rV(t,e,n)}}},iV=({metaTags:t,linkTags:e,scriptTags:n,encode:r})=>{const s=Wp(t,Bp.meta),i=Wp(e,Bp.link),o=Wp(n,Bp.script);return{priorityMethods:{toComponent:()=>[...Vd("meta",s.priority),...Vd("link",i.priority),...Vd("script",o.priority)],toString:()=>`${fn("meta",s.priority,r)} ${fn("link",i.priority,r)} ${fn("script",o.priority,r)}`},metaTags:s.default,linkTags:i.default,scriptTags:o.default}},oV=t=>{const{baseTag:e,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:i,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:c}=t;let{linkTags:u,metaTags:d,scriptTags:f}=t,p={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:p,linkTags:u,metaTags:d,scriptTags:f}=iV(t)),{priority:p,base:fn("base",e,r),bodyAttributes:fn("bodyAttributes",n,r),htmlAttributes:fn("htmlAttributes",s,r),link:fn("link",u,r),meta:fn("meta",d,r),noscript:fn("noscript",i,r),script:fn("script",f,r),style:fn("style",o,r),title:fn("title",{title:a,titleAttributes:l},r)}},Zm=oV,rd=[],Nk=!!(typeof window<"u"&&window.document&&window.document.createElement),ev=class{constructor(t,e){Tr(this,"instances",[]);Tr(this,"canUseDOM",Nk);Tr(this,"context");Tr(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?rd:this.instances,add:t=>{(this.canUseDOM?rd:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?rd:this.instances).indexOf(t);(this.canUseDOM?rd:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=Zm({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},aV={},Dk=$.createContext(aV),mi,Mk=(mi=class extends g.Component{constructor(n){super(n);Tr(this,"helmetData");this.helmetData=new ev(this.props.context||{},mi.canUseDOM)}render(){return $.createElement(Dk.Provider,{value:this.helmetData.value},this.props.children)}},Tr(mi,"canUseDOM",Nk),mi),Bi=(t,e)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${t}[${Ln}]`),s=[].slice.call(r),i=[];let o;return e&&e.length&&e.forEach(a=>{const l=document.createElement(t);for(const c in a)if(Object.prototype.hasOwnProperty.call(a,c))if(c==="innerHTML")l.innerHTML=a.innerHTML;else if(c==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const u=c,d=typeof a[u]>"u"?"":a[u];l.setAttribute(c,d)}l.setAttribute(Ln,"true"),s.some((c,u)=>(o=u,l.isEqualNode(c)))?s.splice(o,1):i.push(l)}),s.forEach(a=>a.parentNode?.removeChild(a)),i.forEach(a=>n.appendChild(a)),{oldTags:s,newTags:i}},tv=(t,e)=>{const n=document.getElementsByTagName(t)[0];if(!n)return;const r=n.getAttribute(Ln),s=r?r.split(","):[],i=[...s],o=Object.keys(e);for(const a of o){const l=e[a]||"";n.getAttribute(a)!==l&&n.setAttribute(a,l),s.indexOf(a)===-1&&s.push(a);const c=i.indexOf(a);c!==-1&&i.splice(c,1)}for(let a=i.length-1;a>=0;a-=1)n.removeAttribute(i[a]);s.length===i.length?n.removeAttribute(Ln):n.getAttribute(Ln)!==o.join(",")&&n.setAttribute(Ln,o.join(","))},lV=(t,e)=>{typeof t<"u"&&document.title!==t&&(document.title=Ok(t)),tv("title",e)},Zx=(t,e)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:i,metaTags:o,noscriptTags:a,onChangeClientState:l,scriptTags:c,styleTags:u,title:d,titleAttributes:f}=t;tv("body",r),tv("html",s),lV(d,f);const p={baseTag:Bi("base",n),linkTags:Bi("link",i),metaTags:Bi("meta",o),noscriptTags:Bi("noscript",a),scriptTags:Bi("script",c),styleTags:Bi("style",u)},m={},v={};Object.keys(p).forEach(w=>{const{newTags:y,oldTags:_}=p[w];y.length&&(m[w]=y),_.length&&(v[w]=p[w].oldTags)}),e&&e(),l(t,m,v)},Wa=null,cV=t=>{Wa&&cancelAnimationFrame(Wa),t.defer?Wa=requestAnimationFrame(()=>{Zx(t,()=>{Wa=null})}):(Zx(t),Wa=null)},uV=cV,eb=class extends g.Component{constructor(){super(...arguments);Tr(this,"rendered",!1)}shouldComponentUpdate(e){return!K3(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:n}=this.props.context;let r=null;const s=Z3(e.get().map(i=>{const o={...i.props};return delete o.context,o}));Mk.canUseDOM?uV(s):Zm&&(r=Zm(s)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},Ug,dV=(Ug=class extends g.Component{shouldComponentUpdate(t){return!z3(Jx(this.props,"helmetData"),Jx(t,"helmetData"))}mapNestedChildrenToProps(t,e){if(!e)return null;switch(t.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,e,n,r){return{...e,[t.type]:[...e[t.type]||[],{...n,...this.mapNestedChildrenToProps(t,r)}]}}mapObjectTypeChildren(t,e,n,r){switch(t.type){case"title":return{...e,[t.type]:r,titleAttributes:{...n}};case"body":return{...e,bodyAttributes:{...n}};case"html":return{...e,htmlAttributes:{...n}};default:return{...e,[t.type]:{...n}}}}mapArrayTypeChildrenToProps(t,e){let n={...e};return Object.keys(t).forEach(r=>{n={...n,[r]:t[r]}}),n}warnOnInvalidChildren(t,e){return Qx(Xx.some(n=>t.type===n),typeof t.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 ${Xx.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),Qx(!e||typeof e=="string"||Array.isArray(e)&&!e.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,e){let n={};return $.Children.forEach(t,r=>{if(!r||!r.props)return;const{children:s,...i}=r.props,o=Object.keys(i).reduce((l,c)=>(l[G3[c]||c]=i[c],l),{});let{type:a}=r;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,s),a){case"Symbol(react.fragment)":e=this.mapChildrenToProps(s,e);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,o,s);break;default:e=this.mapObjectTypeChildren(r,e,o,s);break}}),this.mapArrayTypeChildrenToProps(n,e)}render(){const{children:t,...e}=this.props;let n={...e},{helmetData:r}=e;if(t&&(n=this.mapChildrenToProps(t,n)),r&&!(r instanceof ev)){const s=r;r=new ev(s.context,!0),delete n.helmetData}return r?$.createElement(eb,{...n,context:r.value}):$.createElement(Dk.Consumer,null,s=>$.createElement(eb,{...n,context:s}))}},Tr(Ug,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Ug);const hV=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>C(async()=>{const{default:r}=await Promise.resolve().then(()=>Ea);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)};class A0 extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class fV extends A0{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class pV extends A0{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class gV extends A0{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var nv;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(nv||(nv={}));var mV=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};class vV{constructor(e,{headers:n={},customFetch:r,region:s=nv.Any}={}){this.url=e,this.headers=n,this.region=s,this.fetch=hV(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,n={}){var r;return mV(this,void 0,void 0,function*(){try{const{headers:s,method:i,body:o}=n;let a={},{region:l}=n;l||(l=this.region),l&&l!=="any"&&(a["x-region"]=l);let c;o&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=o):typeof o=="string"?(a["Content-Type"]="text/plain",c=o):typeof FormData<"u"&&o instanceof FormData?c=o:(a["Content-Type"]="application/json",c=JSON.stringify(o)));const u=yield this.fetch(`${this.url}/${e}`,{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),s),body:c}).catch(m=>{throw new fV(m)}),d=u.headers.get("x-relay-error");if(d&&d==="true")throw new pV(u);if(!u.ok)throw new gV(u);let f=((r=u.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),p;return f==="application/json"?p=yield u.json():f==="application/octet-stream"?p=yield u.blob():f==="text/event-stream"?p=u:f==="multipart/form-data"?p=yield u.formData():p=yield u.text(),{data:p,error:null}}catch(s){return{data:null,error:s}}})}}var Ft={},O0={},Ff={},xu={},Vf={},Uf={},yV=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},ra=yV();const _V=ra.fetch,$k=ra.fetch.bind(ra),Fk=ra.Headers,wV=ra.Request,xV=ra.Response,Ea=Object.freeze(Object.defineProperty({__proto__:null,Headers:Fk,Request:wV,Response:xV,default:$k,fetch:_V},Symbol.toStringTag,{value:"Module"})),bV=dL(Ea);var zf={};Object.defineProperty(zf,"__esModule",{value:!0});let EV=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};zf.default=EV;var Vk=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Uf,"__esModule",{value:!0});const SV=Vk(bV),TV=Vk(zf);let PV=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=SV.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,n){return this.headers=Object.assign({},this.headers),this.headers[e]=n,this}then(e,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const r=this.fetch;let s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var o,a,l;let c=null,u=null,d=null,f=i.status,p=i.statusText;if(i.ok){if(this.method!=="HEAD"){const y=await i.text();y===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?u=y:u=JSON.parse(y))}const v=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),w=(a=i.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");v&&w&&w.length>1&&(d=parseInt(w[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(u)&&(u.length>1?(c={code:"PGRST116",details:`Results contain ${u.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},u=null,d=null,f=406,p="Not Acceptable"):u.length===1?u=u[0]:u=null)}else{const v=await i.text();try{c=JSON.parse(v),Array.isArray(c)&&i.status===404&&(u=[],c=null,f=200,p="OK")}catch{i.status===404&&v===""?(f=204,p="No Content"):c={message:v}}if(c&&this.isMaybeSingle&&(!((l=c?.details)===null||l===void 0)&&l.includes("0 rows"))&&(c=null,f=200,p="OK"),c&&this.shouldThrowOnError)throw new TV.default(c)}return{error:c,data:u,count:d,status:f,statusText:p}});return this.shouldThrowOnError||(s=s.catch(i=>{var o,a,l;return{error:{message:`${(o=i?.name)!==null&&o!==void 0?o:"FetchError"}: ${i?.message}`,details:`${(a=i?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(l=i?.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),s.then(e,n)}returns(){return this}overrideTypes(){return this}};Uf.default=PV;var CV=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vf,"__esModule",{value:!0});const kV=CV(Uf);let RV=class extends kV.default{select(e){let n=!1;const r=(e??"*").split("").map(s=>/\s/.test(s)&&!n?"":(s==='"'&&(n=!n),s)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:n=!0,nullsFirst:r,foreignTable:s,referencedTable:i=s}={}){const o=i?`${i}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,n,{foreignTable:r,referencedTable:s=r}={}){const i=typeof s>"u"?"offset":`${s}.offset`,o=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(o,`${n-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:n=!1,settings:r=!1,buffers:s=!1,wal:i=!1,format:o="text"}={}){var a;const l=[e?"analyze":null,n?"verbose":null,r?"settings":null,s?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${c}"; options=${l};`,o==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Vf.default=RV;var jV=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xu,"__esModule",{value:!0});const AV=jV(Vf);let OV=class extends AV.default{eq(e,n){return this.url.searchParams.append(e,`eq.${n}`),this}neq(e,n){return this.url.searchParams.append(e,`neq.${n}`),this}gt(e,n){return this.url.searchParams.append(e,`gt.${n}`),this}gte(e,n){return this.url.searchParams.append(e,`gte.${n}`),this}lt(e,n){return this.url.searchParams.append(e,`lt.${n}`),this}lte(e,n){return this.url.searchParams.append(e,`lte.${n}`),this}like(e,n){return this.url.searchParams.append(e,`like.${n}`),this}likeAllOf(e,n){return this.url.searchParams.append(e,`like(all).{${n.join(",")}}`),this}likeAnyOf(e,n){return this.url.searchParams.append(e,`like(any).{${n.join(",")}}`),this}ilike(e,n){return this.url.searchParams.append(e,`ilike.${n}`),this}ilikeAllOf(e,n){return this.url.searchParams.append(e,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(e,n){return this.url.searchParams.append(e,`ilike(any).{${n.join(",")}}`),this}is(e,n){return this.url.searchParams.append(e,`is.${n}`),this}in(e,n){const r=Array.from(new Set(n)).map(s=>typeof s=="string"&&new RegExp("[,()]").test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}contains(e,n){return typeof n=="string"?this.url.searchParams.append(e,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(e,`cs.{${n.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(n)}`),this}containedBy(e,n){return typeof n=="string"?this.url.searchParams.append(e,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(e,`cd.{${n.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(n)}`),this}rangeGt(e,n){return this.url.searchParams.append(e,`sr.${n}`),this}rangeGte(e,n){return this.url.searchParams.append(e,`nxl.${n}`),this}rangeLt(e,n){return this.url.searchParams.append(e,`sl.${n}`),this}rangeLte(e,n){return this.url.searchParams.append(e,`nxr.${n}`),this}rangeAdjacent(e,n){return this.url.searchParams.append(e,`adj.${n}`),this}overlaps(e,n){return typeof n=="string"?this.url.searchParams.append(e,`ov.${n}`):this.url.searchParams.append(e,`ov.{${n.join(",")}}`),this}textSearch(e,n,{config:r,type:s}={}){let i="";s==="plain"?i="pl":s==="phrase"?i="ph":s==="websearch"&&(i="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${o}.${n}`),this}match(e){return Object.entries(e).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(e,n,r){return this.url.searchParams.append(e,`not.${n}.${r}`),this}or(e,{foreignTable:n,referencedTable:r=n}={}){const s=r?`${r}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,n,r){return this.url.searchParams.append(e,`${n}.${r}`),this}};xu.default=OV;var IV=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ff,"__esModule",{value:!0});const Ka=IV(xu);let LV=class{constructor(e,{headers:n={},schema:r,fetch:s}){this.url=e,this.headers=n,this.schema=r,this.fetch=s}select(e,{head:n=!1,count:r}={}){const s=n?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),r&&(this.headers.Prefer=`count=${r}`),new Ka.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:n,defaultToNull:r=!0}={}){const s="POST",i=[];if(this.headers.Prefer&&i.push(this.headers.Prefer),n&&i.push(`count=${n}`),r||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(e)){const o=e.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(o.length>0){const a=[...new Set(o)].map(l=>`"${l}"`);this.url.searchParams.set("columns",a.join(","))}}return new Ka.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:n,ignoreDuplicates:r=!1,count:s,defaultToNull:i=!0}={}){const o="POST",a=[`resolution=${r?"ignore":"merge"}-duplicates`];if(n!==void 0&&this.url.searchParams.set("on_conflict",n),this.headers.Prefer&&a.push(this.headers.Prefer),s&&a.push(`count=${s}`),i||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new Ka.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:n}={}){const r="PATCH",s=[];return this.headers.Prefer&&s.push(this.headers.Prefer),n&&s.push(`count=${n}`),this.headers.Prefer=s.join(","),new Ka.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){const n="DELETE",r=[];return e&&r.push(`count=${e}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new Ka.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ff.default=LV;var Bf={},Hf={};Object.defineProperty(Hf,"__esModule",{value:!0});Hf.version=void 0;Hf.version="0.0.0-automated";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.DEFAULT_HEADERS=void 0;const NV=Hf;Bf.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${NV.version}`};var Uk=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(O0,"__esModule",{value:!0});const DV=Uk(Ff),MV=Uk(xu),$V=Bf;let FV=class zk{constructor(e,{headers:n={},schema:r,fetch:s}={}){this.url=e,this.headers=Object.assign(Object.assign({},$V.DEFAULT_HEADERS),n),this.schemaName=r,this.fetch=s}from(e){const n=new URL(`${this.url}/${e}`);return new DV.default(n,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new zk(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,n={},{head:r=!1,get:s=!1,count:i}={}){let o;const a=new URL(`${this.url}/rpc/${e}`);let l;r||s?(o=r?"HEAD":"GET",Object.entries(n).filter(([u,d])=>d!==void 0).map(([u,d])=>[u,Array.isArray(d)?`{${d.join(",")}}`:`${d}`]).forEach(([u,d])=>{a.searchParams.append(u,d)})):(o="POST",l=n);const c=Object.assign({},this.headers);return i&&(c.Prefer=`count=${i}`),new MV.default({method:o,url:a,headers:c,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};O0.default=FV;var Sa=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.PostgrestError=Ft.PostgrestBuilder=Ft.PostgrestTransformBuilder=Ft.PostgrestFilterBuilder=Ft.PostgrestQueryBuilder=Ft.PostgrestClient=void 0;const Bk=Sa(O0);Ft.PostgrestClient=Bk.default;const Hk=Sa(Ff);Ft.PostgrestQueryBuilder=Hk.default;const Wk=Sa(xu);Ft.PostgrestFilterBuilder=Wk.default;const Kk=Sa(Vf);Ft.PostgrestTransformBuilder=Kk.default;const Gk=Sa(Uf);Ft.PostgrestBuilder=Gk.default;const qk=Sa(zf);Ft.PostgrestError=qk.default;var VV=Ft.default={PostgrestClient:Bk.default,PostgrestQueryBuilder:Hk.default,PostgrestFilterBuilder:Wk.default,PostgrestTransformBuilder:Kk.default,PostgrestBuilder:Gk.default,PostgrestError:qk.default};const{PostgrestClient:UV,PostgrestQueryBuilder:zQ,PostgrestFilterBuilder:BQ,PostgrestTransformBuilder:HQ,PostgrestBuilder:WQ,PostgrestError:KQ}=VV,zV="2.11.2",BV={"X-Client-Info":`realtime-js/${zV}`},HV="1.0.0",Yk=1e4,WV=1e3;var No;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(No||(No={}));var qt;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(qt||(qt={}));var On;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(On||(On={}));var rv;(function(t){t.websocket="websocket"})(rv||(rv={}));var oi;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(oi||(oi={}));class KV{constructor(){this.HEADER_LENGTH=1}decode(e,n){return e.constructor===ArrayBuffer?n(this._binaryDecode(e)):n(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const n=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,n,r)}_decodeBroadcast(e,n,r){const s=n.getUint8(1),i=n.getUint8(2);let o=this.HEADER_LENGTH+2;const a=r.decode(e.slice(o,o+s));o=o+s;const l=r.decode(e.slice(o,o+i));o=o+i;const c=JSON.parse(r.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:l,payload:c}}}class Qk{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}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))}}var Se;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Se||(Se={}));const tb=(t,e,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(e).reduce((i,o)=>(i[o]=GV(o,t,e,s),i),{})},GV=(t,e,n,r)=>{const s=e.find(a=>a.name===t),i=s?.type,o=n[t];return i&&!r.includes(i)?Xk(i,o):sv(o)},Xk=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return XV(e,n)}switch(t){case Se.bool:return qV(e);case Se.float4:case Se.float8:case Se.int2:case Se.int4:case Se.int8:case Se.numeric:case Se.oid:return YV(e);case Se.json:case Se.jsonb:return QV(e);case Se.timestamp:return JV(e);case Se.abstime:case Se.date:case Se.daterange:case Se.int4range:case Se.int8range:case Se.money:case Se.reltime:case Se.text:case Se.time:case Se.timestamptz:case Se.timetz:case Se.tsrange:case Se.tstzrange:return sv(e);default:return sv(e)}},sv=t=>t,qV=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},YV=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},QV=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},XV=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let i;const o=t.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>Xk(e,a))}return t},JV=t=>typeof t=="string"?t.replace(" ","T"):t,Jk=t=>{let e=t;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};class Kp{constructor(e,n,r={},s=Yk){this.channel=e,this.event=n,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var nb;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(nb||(nb={}));class rc{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=n?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=rc.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=rc.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=rc.syncDiff(this.state,s,i,o),a())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,s){const i=this.cloneDeep(e),o=this.transformState(n),a={},l={};return this.map(i,(c,u)=>{o[c]||(l[c]=u)}),this.map(o,(c,u)=>{const d=i[c];if(d){const f=u.map(w=>w.presence_ref),p=d.map(w=>w.presence_ref),m=u.filter(w=>p.indexOf(w.presence_ref)<0),v=d.filter(w=>f.indexOf(w.presence_ref)<0);m.length>0&&(a[c]=m),v.length>0&&(l[c]=v)}else a[c]=u}),this.syncDiff(i,{joins:a,leaves:l},r,s)}static syncDiff(e,n,r,s){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(i,(a,l)=>{var c;const u=(c=e[a])!==null&&c!==void 0?c:[];if(e[a]=this.cloneDeep(l),u.length>0){const d=e[a].map(p=>p.presence_ref),f=u.filter(p=>d.indexOf(p.presence_ref)<0);e[a].unshift(...f)}r(a,u,l)}),this.map(o,(a,l)=>{let c=e[a];if(!c)return;const u=l.map(d=>d.presence_ref);c=c.filter(d=>u.indexOf(d.presence_ref)<0),e[a]=c,s(a,c,l),c.length===0&&delete e[a]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const s=e[r];return"metas"in s?n[r]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=s,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var rb;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(rb||(rb={}));var sb;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(sb||(sb={}));var jr;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(jr||(jr={}));class I0{constructor(e,n={config:{}},r){this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=qt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new Kp(this,On.join,this.params,this.timeout),this.rejoinTimer=new Qk(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=qt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=qt.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=qt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=qt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(On.reply,{},(s,i)=>{this._trigger(this._replyEventName(i),s)}),this.presence=new rc(this),this.broadcastEndpointURL=Jk(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(e,n=this.timeout){var r,s;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:i,presence:o,private:a}}=this.params;this._onError(u=>e?.(jr.CHANNEL_ERROR,u)),this._onClose(()=>e?.(jr.CLOSED));const l={},c={broadcast:i,presence:o,postgres_changes:(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(u=>u.filter))!==null&&s!==void 0?s:[],private:a};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:c},l)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:u})=>{var d;if(this.socket.setAuth(),u===void 0){e?.(jr.SUBSCRIBED);return}else{const f=this.bindings.postgres_changes,p=(d=f?.length)!==null&&d!==void 0?d:0,m=[];for(let v=0;v<p;v++){const w=f[v],{filter:{event:y,schema:_,table:x,filter:E}}=w,b=u&&u[v];if(b&&b.event===y&&b.schema===_&&b.table===x&&b.filter===E)m.push(Object.assign(Object.assign({},w),{id:b.id}));else{this.unsubscribe(),e?.(jr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=m,e&&e(jr.SUBSCRIBED);return}}).receive("error",u=>{e?.(jr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(u).join(", ")||"error")))}).receive("timeout",()=>{e?.(jr.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){return this._on(e,n,r)}async send(e,n={}){var r,s;if(!this._canPush()&&e.type==="broadcast"){const{event:i,payload:o}=e,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const c=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),c.receive("ok",()=>i("ok")),c.receive("error",()=>i("error")),c.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=qt.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(On.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(r=>{const s=new Kp(this,On.leave,{},e);s.receive("ok",()=>{n(),r("ok")}).receive("timeout",()=>{n(),r("timed out")}).receive("error",()=>{r("error")}),s.send(),this._canPush()||s.trigger("ok",{})})}async _fetchWithTimeout(e,n,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),o}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Kp(this,e,n,r);return this._canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var s,i;const o=e.toLocaleLowerCase(),{close:a,error:l,leave:c,join:u}=On;if(r&&[a,l,c,u].indexOf(o)>=0&&r!==this._joinRef())return;let f=this._onMessage(o,n,r);if(n&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(p=>{var m,v,w;return((m=p.filter)===null||m===void 0?void 0:m.event)==="*"||((w=(v=p.filter)===null||v===void 0?void 0:v.event)===null||w===void 0?void 0:w.toLocaleLowerCase())===o}).map(p=>p.callback(f,r)):(i=this.bindings[o])===null||i===void 0||i.filter(p=>{var m,v,w,y,_,x;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const E=p.id,b=(m=p.filter)===null||m===void 0?void 0:m.event;return E&&((v=n.ids)===null||v===void 0?void 0:v.includes(E))&&(b==="*"||b?.toLocaleLowerCase()===((w=n.data)===null||w===void 0?void 0:w.type.toLocaleLowerCase()))}else{const E=(_=(y=p?.filter)===null||y===void 0?void 0:y.event)===null||_===void 0?void 0:_.toLocaleLowerCase();return E==="*"||E===((x=n?.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof f=="object"&&"ids"in f){const m=f.data,{schema:v,table:w,commit_timestamp:y,type:_,errors:x}=m;f=Object.assign(Object.assign({},{schema:v,table:w,commit_timestamp:y,eventType:_,new:{},old:{},errors:x}),this._getPayloadRecords(m))}p.callback(f,r)})}_isClosed(){return this.state===qt.closed}_isJoined(){return this.state===qt.joined}_isJoining(){return this.state===qt.joining}_isLeaving(){return this.state===qt.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const s=e.toLocaleLowerCase(),i={type:s,filter:n,callback:r};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&I0.isEqual(s.filter,n))}),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(On.close,{},e)}_onError(e){this._on(On.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=qt.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=tb(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=tb(e.columns,e.old_record)),n}}const ZV=()=>{},e4=typeof WebSocket<"u",t4=`
addEventListener("message", (e) => {
if (e.data.event === "start") {
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
}
});`;class n4{constructor(e,n){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=BV,this.params={},this.timeout=Yk,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=ZV,this.conn=null,this.sendBuffer=[],this.serializer=new KV,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=i=>{let o;return i?o=i:typeof fetch>"u"?o=(...a)=>C(async()=>{const{default:l}=await Promise.resolve().then(()=>Ea);return{default:l}},void 0).then(({default:l})=>l(...a)):o=fetch,(...a)=>o(...a)},this.endPoint=`${e}/${rv.websocket}`,this.httpEndpoint=Jk(e),n?.transport?this.transport=n.transport:this.transport=null,n?.params&&(this.params=n.params),n?.headers&&(this.headers=Object.assign(Object.assign({},this.headers),n.headers)),n?.timeout&&(this.timeout=n.timeout),n?.logger&&(this.logger=n.logger),n?.heartbeatIntervalMs&&(this.heartbeatIntervalMs=n.heartbeatIntervalMs);const s=(r=n?.params)===null||r===void 0?void 0:r.apikey;if(s&&(this.accessTokenValue=s,this.apiKey=s),this.reconnectAfterMs=n?.reconnectAfterMs?n.reconnectAfterMs:i=>[1e3,2e3,5e3,1e4][i-1]||1e4,this.encode=n?.encode?n.encode:(i,o)=>o(JSON.stringify(i)),this.decode=n?.decode?n.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new Qk(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(n?.fetch),n?.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=n?.worker||!1,this.workerUrl=n?.workerUrl}this.accessToken=n?.accessToken||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(e4){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new r4(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),C(async()=>{const{default:e}=await import("./browser-BkLwIrfy.js").then(n=>n.b);return{default:e}},[]).then(({default:e})=>{this.conn=new e(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:HV}))}disconnect(e,n){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,n??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case No.connecting:return oi.Connecting;case No.open:return oi.Open;case No.closing:return oi.Closing;default:return oi.Closed}}isConnected(){return this.connectionState()===oi.Open}channel(e,n={config:{}}){const r=new I0(`realtime:${e}`,n,this);return this.channels.push(r),r}push(e){const{topic:n,event:r,payload:s,ref:i}=e,o=()=>{this.encode(e,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${n} ${r} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){let n=e||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(n){let r=null;try{r=JSON.parse(atob(n.split(".")[1]))}catch{}if(r&&r.exp&&!(Math.floor(Date.now()/1e3)-r.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${r.exp}`);this.accessTokenValue=n,this.channels.forEach(s=>{n&&s.updateJoinPayload({access_token:n}),s.joinedOnce&&s._isJoined()&&s._push(On.access_token,{access_token:n})})}}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(WV,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n._joinRef()!==e._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_onConnMessage(e){this.decode(e.data,n=>{let{topic:r,event:s,payload:i,ref:o}=n;o&&o===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${i.status||""} ${r} ${s} ${o&&"("+o+")"||""}`,i),this.channels.filter(a=>a._isMember(r)).forEach(a=>a._trigger(s,i,o)),this.stateChangeCallbacks.message.forEach(a=>a(n))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(n=>n(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(n=>n(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(On.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",s=new URLSearchParams(n);return`${e}${r}${s}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([t4],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}}class r4{constructor(e,n,r){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=No.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=r.close}}class L0 extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function st(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class s4 extends L0{constructor(e,n){super(e),this.name="StorageApiError",this.status=n}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class iv extends L0{constructor(e,n){super(e),this.name="StorageUnknownError",this.originalError=n}}var i4=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};const Zk=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>C(async()=>{const{default:r}=await Promise.resolve().then(()=>Ea);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},o4=()=>i4(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield C(()=>Promise.resolve().then(()=>Ea),void 0)).Response:Response}),ov=t=>{if(Array.isArray(t))return t.map(n=>ov(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=ov(r)}),e};var Ni=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};const Gp=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),a4=(t,e,n)=>Ni(void 0,void 0,void 0,function*(){const r=yield o4();t instanceof r&&!n?.noResolveJson?t.json().then(s=>{e(new s4(Gp(s),t.status||500))}).catch(s=>{e(new iv(Gp(s),s))}):e(new iv(Gp(t),t))}),l4=(t,e,n,r)=>{const s={method:t,headers:e?.headers||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json"},e?.headers),r&&(s.body=JSON.stringify(r)),Object.assign(Object.assign({},s),n))};function bu(t,e,n,r,s,i){return Ni(this,void 0,void 0,function*(){return new Promise((o,a)=>{t(n,l4(e,r,s,i)).then(l=>{if(!l.ok)throw l;return r?.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>a4(l,a,r))})})}function jh(t,e,n,r){return Ni(this,void 0,void 0,function*(){return bu(t,"GET",e,n,r)})}function ds(t,e,n,r,s){return Ni(this,void 0,void 0,function*(){return bu(t,"POST",e,r,s,n)})}function c4(t,e,n,r,s){return Ni(this,void 0,void 0,function*(){return bu(t,"PUT",e,r,s,n)})}function u4(t,e,n,r){return Ni(this,void 0,void 0,function*(){return bu(t,"HEAD",e,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function eR(t,e,n,r,s){return Ni(this,void 0,void 0,function*(){return bu(t,"DELETE",e,r,s,n)})}var Dt=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};const d4={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},ib={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class h4{constructor(e,n={},r,s){this.url=e,this.headers=n,this.bucketId=r,this.fetch=Zk(s)}uploadOrUpdate(e,n,r,s){return Dt(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},ib),s);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",this.encodeMetadata(l)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",this.encodeMetadata(l))):(i=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),s?.headers&&(a=Object.assign(Object.assign({},a),s.headers));const c=this._removeEmptyFolders(n),u=this._getFinalPath(c),d=yield this.fetch(`${this.url}/object/${u}`,Object.assign({method:e,body:i,headers:a},o?.duplex?{duplex:o.duplex}:{})),f=yield d.json();return d.ok?{data:{path:c,id:f.Id,fullPath:f.Key},error:null}:{data:null,error:f}}catch(i){if(st(i))return{data:null,error:i};throw i}})}upload(e,n,r){return Dt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,n,r)})}uploadToSignedUrl(e,n,r,s){return Dt(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",n);try{let l;const c=Object.assign({upsert:ib.upsert},s),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",c.cacheControl)):(l=r,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType);const d=yield this.fetch(a.toString(),{method:"PUT",body:l,headers:u}),f=yield d.json();return d.ok?{data:{path:i,fullPath:f.Key},error:null}:{data:null,error:f}}catch(l){if(st(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e,n){return Dt(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const s=Object.assign({},this.headers);n?.upsert&&(s["x-upsert"]="true");const i=yield ds(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new L0("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(r){if(st(r))return{data:null,error:r};throw r}})}update(e,n,r){return Dt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,n,r)})}move(e,n,r){return Dt(this,void 0,void 0,function*(){try{return{data:yield ds(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(st(s))return{data:null,error:s};throw s}})}copy(e,n,r){return Dt(this,void 0,void 0,function*(){try{return{data:{path:(yield ds(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(st(s))return{data:null,error:s};throw s}})}createSignedUrl(e,n,r){return Dt(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield ds(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:n},r?.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r?.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(s){if(st(s))return{data:null,error:s};throw s}})}createSignedUrls(e,n,r){return Dt(this,void 0,void 0,function*(){try{const s=yield ds(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:e},{headers:this.headers}),i=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{data:s.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(s){if(st(s))return{data:null,error:s};throw s}})}download(e,n){return Dt(this,void 0,void 0,function*(){const s=typeof n?.transform<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString(n?.transform||{}),o=i?`?${i}`:"";try{const a=this._getFinalPath(e);return{data:yield(yield jh(this.fetch,`${this.url}/${s}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(st(a))return{data:null,error:a};throw a}})}info(e){return Dt(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{const r=yield jh(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:ov(r),error:null}}catch(r){if(st(r))return{data:null,error:r};throw r}})}exists(e){return Dt(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{return yield u4(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(st(r)&&r instanceof iv){const s=r.originalError;if([400,404].includes(s?.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,n){const r=this._getFinalPath(e),s=[],i=n?.download?`download=${n.download===!0?"":n.download}`:"";i!==""&&s.push(i);const a=typeof n?.transform<"u"?"render/image":"object",l=this.transformOptsToQueryString(n?.transform||{});l!==""&&s.push(l);let c=s.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${c}`)}}}remove(e){return Dt(this,void 0,void 0,function*(){try{return{data:yield eR(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(n){if(st(n))return{data:null,error:n};throw n}})}list(e,n,r){return Dt(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},d4),n),{prefix:e||""});return{data:yield ds(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},r),error:null}}catch(s){if(st(s))return{data:null,error:s};throw s}})}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}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const n=[];return e.width&&n.push(`width=${e.width}`),e.height&&n.push(`height=${e.height}`),e.resize&&n.push(`resize=${e.resize}`),e.format&&n.push(`format=${e.format}`),e.quality&&n.push(`quality=${e.quality}`),n.join("&")}}const f4="2.7.1",p4={"X-Client-Info":`storage-js/${f4}`};var Hi=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};class g4{constructor(e,n={},r){this.url=e,this.headers=Object.assign(Object.assign({},p4),n),this.fetch=Zk(r)}listBuckets(){return Hi(this,void 0,void 0,function*(){try{return{data:yield jh(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(st(e))return{data:null,error:e};throw e}})}getBucket(e){return Hi(this,void 0,void 0,function*(){try{return{data:yield jh(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(n){if(st(n))return{data:null,error:n};throw n}})}createBucket(e,n={public:!1}){return Hi(this,void 0,void 0,function*(){try{return{data:yield ds(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(st(r))return{data:null,error:r};throw r}})}updateBucket(e,n){return Hi(this,void 0,void 0,function*(){try{return{data:yield c4(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(st(r))return{data:null,error:r};throw r}})}emptyBucket(e){return Hi(this,void 0,void 0,function*(){try{return{data:yield ds(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(st(n))return{data:null,error:n};throw n}})}deleteBucket(e){return Hi(this,void 0,void 0,function*(){try{return{data:yield eR(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(n){if(st(n))return{data:null,error:n};throw n}})}}class m4 extends g4{constructor(e,n={},r){super(e,n,r)}from(e){return new h4(this.url,this.headers,e,this.fetch)}}const v4="2.49.4";let Ll="";typeof Deno<"u"?Ll="deno":typeof document<"u"?Ll="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ll="react-native":Ll="node";const y4={"X-Client-Info":`supabase-js-${Ll}/${v4}`},_4={headers:y4},w4={schema:"public"},x4={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},b4={};var E4=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};const S4=t=>{let e;return t?e=t:typeof fetch>"u"?e=$k:e=fetch,(...n)=>e(...n)},T4=()=>typeof Headers>"u"?Fk:Headers,P4=(t,e,n)=>{const r=S4(n),s=T4();return(i,o)=>E4(void 0,void 0,void 0,function*(){var a;const l=(a=yield e())!==null&&a!==void 0?a:t;let c=new s(o?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),r(i,Object.assign(Object.assign({},o),{headers:c}))})};var C4=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};function k4(t){return t.replace(/\/$/,"")}function R4(t,e){const{db:n,auth:r,realtime:s,global:i}=t,{db:o,auth:a,realtime:l,global:c}=e,u={db:Object.assign(Object.assign({},o),n),auth:Object.assign(Object.assign({},a),r),realtime:Object.assign(Object.assign({},l),s),global:Object.assign(Object.assign({},c),i),accessToken:()=>C4(this,void 0,void 0,function*(){return""})};return t.accessToken?u.accessToken=t.accessToken:delete u.accessToken,u}const tR="2.69.1",eo=30*1e3,av=3,qp=av*eo,j4="http://localhost:9999",A4="supabase.auth.token",O4={"X-Client-Info":`gotrue-js/${tR}`},lv="X-Supabase-Api-Version",nR={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},I4=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,L4=6e5;class N0 extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function ae(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class N4 extends N0{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function D4(t){return ae(t)&&t.name==="AuthApiError"}class rR extends N0{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class Ys extends N0{constructor(e,n,r,s){super(e,r,s),this.name=n,this.status=r}}class ss extends Ys{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function M4(t){return ae(t)&&t.name==="AuthSessionMissingError"}class Yp extends Ys{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class sd extends Ys{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class id extends Ys{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function $4(t){return ae(t)&&t.name==="AuthImplicitGrantRedirectError"}class ob extends Ys{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class cv extends Ys{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function Qp(t){return ae(t)&&t.name==="AuthRetryableFetchError"}class ab extends Ys{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class sc extends Ys{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const lb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),cb=`
\r=`.split(""),F4=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<cb.length;e+=1)t[cb[e].charCodeAt(0)]=-2;for(let e=0;e<lb.length;e+=1)t[lb[e].charCodeAt(0)]=e;return t})();function sR(t,e,n){const r=F4[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function ub(t){const e=[],n=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{z4(o,r,n)};for(let o=0;o<t.length;o+=1)sR(t.charCodeAt(o),s,i);return e.join("")}function V4(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function U4(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}V4(r,e)}}function z4(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if(!(t>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function B4(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)sR(t.charCodeAt(s),n,r);return new Uint8Array(e)}function H4(t){const e=[];return U4(t,n=>e.push(n)),new Uint8Array(e)}function W4(t){return Math.round(Date.now()/1e3)+t}function K4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const Jn=()=>typeof window<"u"&&typeof document<"u",Xs={tested:!1,writable:!1},ic=()=>{if(!Jn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Xs.tested)return Xs.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Xs.tested=!0,Xs.writable=!0}catch{Xs.tested=!0,Xs.writable=!1}return Xs.writable};function G4(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{e[s]=r}),e}const iR=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>C(async()=>{const{default:r}=await Promise.resolve().then(()=>Ea);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},q4=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",oR=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},od=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},ad=async(t,e)=>{await t.removeItem(e)};class Wf{constructor(){this.promise=new Wf.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}Wf.promiseConstructor=Promise;function Xp(t){const e=t.split(".");if(e.length!==3)throw new sc("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!I4.test(e[r]))throw new sc("JWT not in base64url format");return{header:JSON.parse(ub(e[0])),payload:JSON.parse(ub(e[1])),signature:B4(e[2]),raw:{header:e[0],payload:e[1]}}}async function Y4(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function Q4(t,e){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await t(i);if(!e(i,null,o)){r(o);return}}catch(o){if(!e(i,o)){s(o);return}}})()})}function X4(t){return("0"+t.toString(16)).substr(-2)}function J4(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let i=0;i<56;i++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(e),Array.from(e,X4).join("")}async function Z4(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function eU(t){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."),t;const n=await Z4(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Wi(t,e,n=!1){const r=J4();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await oR(t,`${e}-code-verifier`,s);const i=await eU(r);return[i,r===i?"plain":"s256"]}const tU=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function nU(t){const e=t.headers.get(lv);if(!e||!e.match(tU))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function rU(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function sU(t){switch(t){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")}}var iU=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};const ri=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),oU=[502,503,504];async function db(t){var e;if(!q4(t))throw new cv(ri(t),0);if(oU.includes(t.status))throw new cv(ri(t),t.status);let n;try{n=await t.json()}catch(i){throw new rR(ri(i),i)}let r;const s=nU(t);if(s&&s.getTime()>=nR["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new ab(ri(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new ss}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new ab(ri(n),t.status,n.weak_password.reasons);throw new N4(ri(n),t.status||500,r)}const aU=(t,e,n,r)=>{const s={method:t,headers:e?.headers||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function de(t,e,n,r){var s;const i=Object.assign({},r?.headers);i[lv]||(i[lv]=nR["2024-01-01"].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r?.query)!==null&&s!==void 0?s:{};r?.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await lU(t,e,n+a,{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(l):{data:Object.assign({},l),error:null}}async function lU(t,e,n,r,s,i){const o=aU(e,r,s,i);let a;try{a=await t(n,Object.assign({},o))}catch(l){throw console.error(l),new cv(ri(l),0)}if(a.ok||await db(a),r?.noResolveJson)return a;try{return await a.json()}catch(l){await db(l)}}function is(t){var e;let n=null;hU(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=W4(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function hb(t){const e=is(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function gs(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function cU(t){return{data:t,error:null}}function uU(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=t,o=iU(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function dU(t){return t}function hU(t){return t.access_token&&t.refresh_token&&t.expires_in}var fU=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};class pU{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=iR(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,n="global"){try{return await de(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ae(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await de(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:gs})}catch(r){if(ae(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=fU(e,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r?.newEmail,delete s.newEmail),await de(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:uU,redirectTo:n?.redirectTo})}catch(n){if(ae(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await de(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:gs})}catch(n){if(ae(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,s,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await de(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e?.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=e?.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:dU});if(u.error)throw u.error;const d=await u.json(),f=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(m=>{const v=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(m.split(";")[1].split("=")[1]);c[`${w}Page`]=v}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(ae(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await de(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:gs})}catch(n){if(ae(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){try{return await de(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:gs})}catch(r){if(ae(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){try{return await de(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:gs})}catch(r){if(ae(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){try{const{data:n,error:r}=await de(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _deleteFactor(e){try{return{data:await de(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(ae(n))return{data:null,error:n};throw n}}}const gU={getItem:t=>ic()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{ic()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{ic()&&globalThis.localStorage.removeItem(t)}};function fb(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}function mU(){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)}}const Ki={debug:!!(globalThis&&ic()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class aR extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class vU extends aR{}async function yU(t,e,n){Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await n()}finally{Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new vU(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Ki.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}mU();const _U={url:j4,storageKey:A4,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:O4,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function pb(t,e,n){return await n()}class Vc{constructor(e){var n,r;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=Vc.nextInstanceID,Vc.nextInstanceID+=1,this.instanceID>0&&Jn()&&console.warn("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.");const s=Object.assign(Object.assign({},_U),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new pU({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=iR(s.fetch),this.lock=s.lock||pb,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:Jn()&&(!((n=globalThis?.navigator)===null||n===void 0)&&n.locks)?this.lock=yU:this.lock=pb,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)},this.persistSession?s.storage?this.storage=s.storage:ic()?this.storage=gU:(this.memoryStorage={},this.storage=fb(this.memoryStorage)):(this.memoryStorage={},this.storage=fb(this.memoryStorage)),Jn()&&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)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${tR}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const n=G4(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),Jn()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),$4(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ae(n)?{error:n}:{error:new rR("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,s;try{const i=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e?.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=e?.options)===null||s===void 0?void 0:s.captchaToken}},xform:is}),{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(i){if(ae(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(e){var n,r,s;try{let i;if("email"in e){const{email:u,password:d,options:f}=e;let p=null,m=null;this.flowType==="pkce"&&([p,m]=await Wi(this.storage,this.storageKey)),i=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f?.emailRedirectTo,body:{email:u,password:d,data:(n=f?.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:p,code_challenge_method:m},xform:is})}else if("phone"in e){const{phone:u,password:d,options:f}=e;i=await de(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(r=f?.data)!==null&&r!==void 0?r:{},channel:(s=f?.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:is})}else throw new sd("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(i){if(ae(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(e){try{let n;if("email"in e){const{email:i,password:o,options:a}=e;n=await de(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:hb})}else if("phone"in e){const{phone:i,password:o,options:a}=e;n=await de(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:hb})}else throw new sd("You must provide either an email or phone number and a password");const{data:r,error:s}=n;return s?{data:{user:null,session:null},error:s}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Yp}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(ae(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(e){var n,r,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const n=await od(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{const{data:i,error:o}=await de(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:is});if(await ad(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new Yp}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(ae(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(e){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=e,a=await de(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n?.captchaToken}},xform:is}),{data:l,error:c}=a;return c?{data:{user:null,session:null},error:c}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new Yp}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:c})}catch(n){if(ae(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(e){var n,r,s,i,o;try{if("email"in e){const{email:a,options:l}=e;let c=null,u=null;this.flowType==="pkce"&&([c,u]=await Wi(this.storage,this.storageKey));const{error:d}=await de(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=l?.data)!==null&&n!==void 0?n:{},create_user:(r=l?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:l?.emailRedirectTo});return{data:{user:null,session:null},error:d}}if("phone"in e){const{phone:a,options:l}=e,{data:c,error:u}=await de(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l?.data)!==null&&s!==void 0?s:{},create_user:(i=l?.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(o=l?.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:u}}throw new sd("You must provide either an email or phone number.")}catch(a){if(ae(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var n,r;try{let s,i;"options"in e&&(s=(n=e.options)===null||n===void 0?void 0:n.redirectTo,i=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await de(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:is});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,c=o.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(s){if(ae(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithSSO(e){var n,r,s;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await Wi(this.storage,this.storageKey)),await de(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=e?.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:cU})}catch(i){if(ae(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new ss;const{error:s}=await de(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:s}})}catch(e){if(ae(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:s,options:i}=e,{error:o}=await de(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},redirectTo:i?.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:r,type:s,options:i}=e,{data:o,error:a}=await de(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return{data:{user:null,session:null,messageId:o?.message_id},error:a}}throw new sd("You must provide either an email or phone number and a type")}catch(n){if(ae(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await od(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<qp:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.storage.isServer){let o=this.suppressGetSessionWarning;e=new Proxy(e,{get:(l,c,u)=>(!o&&c==="user"&&(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."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,c,u))})}return{data:{session:e},error:null}}const{session:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:s},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await de(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:gs}):await this._useSession(async n=>{var r,s,i;const{data:o,error:a}=n;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ss}:await de(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:gs})})}catch(n){if(ae(n))return M4(n)&&(await this._removeSession(),await ad(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new ss;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&e.email!=null&&([a,l]=await Wi(this.storage,this.storageKey));const{data:c,error:u}=await de(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:gs});if(u)throw u;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(r){if(ae(r))return{data:{user:null},error:r};throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new ss;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=Xp(e.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){const{session:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)throw l;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(n){if(ae(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:o,error:a}=n;if(a)throw a;e=(r=o.session)!==null&&r!==void 0?r:void 0}if(!e?.refresh_token)throw new ss;const{session:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(ae(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(e,n){try{if(!Jn())throw new id("No browser detected.");if(e.error||e.error_description||e.error_code)throw new id(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new ob("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new id("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new ob("No code detected.");const{data:_,error:x}=await this._exchangeCodeForSession(e.code);if(x)throw x;const E=new URL(window.location.href);return E.searchParams.delete("code"),window.history.replaceState(window.history.state,"",E.toString()),{data:{session:_.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:c}=e;if(!i||!a||!o||!c)throw new id("No session defined in URL");const u=Math.round(Date.now()/1e3),d=parseInt(a);let f=u+d;l&&(f=parseInt(l));const p=f-u;p*1e3<=eo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);const m=f-d;u-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,f,u):u-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,f,u);const{data:v,error:w}=await this._getUser(i);if(w)throw w;const y={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:d,expires_at:f,refresh_token:o,token_type:c,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:y,redirectType:e.type},error:null}}catch(r){if(ae(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await od(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return{error:i};const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(D4(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await ad(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const n=K4(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,s;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Wi(this.storage,this.storageKey,!0));try{return await de(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(ae(i))return{data:null,error:i};throw i}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(n){if(ae(n))return{data:null,error:n};throw n}}async linkIdentity(e){var n;try{const{data:r,error:s}=await this._useSession(async i=>{var o,a,l,c,u;const{data:d,error:f}=i;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await de(this.fetch,"GET",p,{headers:this.headers,jwt:(u=(c=d.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return Jn()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r?.url),{data:{provider:e.provider,url:r?.url},error:null}}catch(r){if(ae(r))return{data:{provider:e.provider,url:null},error:r};throw r}}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)throw o;return await de(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await Q4(async s=>(s>0&&await Y4(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await de(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:is})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Qp(i)&&Date.now()+o-r<eo})}catch(r){if(this._debug(n,"error",r),ae(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),Jn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const r=await od(this.storage,this.storageKey);if(this._debug(n,"session from storage",r),!this._isValidSession(r)){this._debug(n,"session is not valid"),r!==null&&await this._removeSession();return}const s=((e=r.expires_at)!==null&&e!==void 0?e:1/0)*1e3-Date.now()<qp;if(this._debug(n,`session has${s?"":" not"} expired with margin of ${qp}s`),s){if(this.autoRefreshToken&&r.refresh_token){const{error:i}=await this._callRefreshToken(r.refresh_token);i&&(console.error(i),Qp(i)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",i),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(r){this._debug(n,"error",r),console.error(r);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new ss;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Wf;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new ss;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={session:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),ae(i)){const o={session:null,error:i};return Qp(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,n,r=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,n)}catch(l){i.push(l)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await oR(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await ad(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Jn()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),eo);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-e)/eo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${eo}ms, refresh threshold is ${av} ticks`),s<=av&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof aR)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Jn()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r?.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r?.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await Wi(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(r?.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r?.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?{data:null,error:i}:await de(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=s?.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:l,error:c}=await de(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i?.session)===null||r===void 0?void 0:r.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((s=l?.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(n){if(ae(n))return{data:null,error:n};throw n}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return{data:null,error:i};const{data:o,error:a}=await de(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(r=s?.session)===null||r===void 0?void 0:r.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(n){if(ae(n))return{data:null,error:n};throw n}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?{data:null,error:i}:await de(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(r=s?.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ae(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){const{data:{user:e},error:n}=await this.getUser();if(n)return{data:null,error:n};const r=e?.factors||[],s=r.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=r.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:r,totp:s,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var n,r;const{data:{session:s},error:i}=e;if(i)return{data:null,error:i};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=Xp(s.access_token);let a=null;o.aal&&(a=o.aal);let l=a;((r=(n=s.user.factors)===null||n===void 0?void 0:n.filter(d=>d.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const u=o.amr||[];return{data:{currentLevel:a,nextLevel:l,currentAuthenticationMethods:u},error:null}}))}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(o=>o.kid===e);if(r||(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+L4>Date.now()))return r;const{data:s,error:i}=await de(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;if(!s.keys||s.keys.length===0)throw new sc("JWKS is empty");if(this.jwks=s,this.jwks_cached_at=Date.now(),r=s.keys.find(o=>o.kid===e),!r)throw new sc("No matching signing key found in JWKS");return r}async getClaims(e,n={keys:[]}){try{let r=e;if(!r){const{data:p,error:m}=await this.getSession();if(m||!p.session)return{data:null,error:m};r=p.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=Xp(r);if(rU(i.exp),!s.kid||s.alg==="HS256"||!("crypto"in globalThis&&"subtle"in globalThis.crypto)){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:i,header:s,signature:o},error:null}}const c=sU(s.alg),u=await this.fetchJwk(s.kid,n),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,o,H4(`${a}.${l}`)))throw new sc("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(ae(r))return{data:null,error:r};throw r}}}Vc.nextInstanceID=0;const wU=Vc;class xU extends wU{constructor(e){super(e)}}var bU=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};class EU{constructor(e,n,r){var s,i,o;if(this.supabaseUrl=e,this.supabaseKey=n,!e)throw new Error("supabaseUrl is required.");if(!n)throw new Error("supabaseKey is required.");const a=k4(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;const l=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:w4,realtime:b4,auth:Object.assign(Object.assign({},x4),{storageKey:l}),global:_4},u=R4(r??{},c);this.storageKey=(s=u.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(i=u.global.headers)!==null&&i!==void 0?i:{},u.accessToken?(this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=u.auth)!==null&&o!==void 0?o:{},this.headers,u.global.fetch),this.fetch=P4(n,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.rest=new UV(`${a}/rest/v1`,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),u.accessToken||this._listenForAuthEvents()}get functions(){return new vV(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new m4(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,n={},r={}){return this.rest.rpc(e,n,r)}channel(e,n={config:{}}){return this.realtime.channel(e,n)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,n;return bU(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&n!==void 0?n:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:s,storageKey:i,flowType:o,lock:a,debug:l},c,u){const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new xU({url:this.authUrl,headers:Object.assign(Object.assign({},d),c),storageKey:i,autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:s,flowType:o,lock:a,debug:l,fetch:u,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new n4(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r?.access_token)})}_handleTokenChanged(e,n,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:e==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const SU=(t,e,n)=>new EU(t,e,n),TU="https://pldrgdplxacehsmcyjnx.supabase.co",PU="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBsZHJnZHBseGFjZWhzbWN5am54Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDM0MzU5MzEsImV4cCI6MjA1OTAxMTkzMX0.YnKo7pfbjg52NF6TL2pNilHkND5ZgkhbDuAtC_-IQL4",xe=SU(TU,PU),GQ=async()=>{try{const{data:t,error:e}=await xe.functions.invoke("get-stripe-prices");if(e)throw console.error("Error fetching Stripe prices:",e),e;return{prices:t?.prices||[],stripeMode:t?.stripeMode||"test"}}catch(t){throw console.error("Error in getActivePricingTiers:",t),t}},qQ=async(t,e,n)=>{try{console.log("Creating Stripe subscription for plan:",t,"currency:",n);const{data:r,error:s}=await xe.functions.invoke("create-checkout",{body:{planType:t,currentLanguage:e||"en",currency:n||"GBP"}});if(s)throw console.error("Error creating Stripe subscription:",s),new Error(s.message||"Failed to create Stripe subscription");if(!r||!r.url)throw console.error("No URL returned from Stripe subscription:",r),new Error("Invalid response from server");return console.log("Stripe subscription created successfully:",r),r}catch(r){const s=r instanceof Error?r.message:String(r);throw console.error("Error in Stripe subscription service:",s),r}},YQ=async()=>{try{console.log("Creating customer portal session");const{data:t,error:e}=await xe.functions.invoke("customer-portal");if(e)throw console.error("Error creating customer portal session:",e),new Error(e.message||"Failed to create customer portal session");if(!t||!t.url)throw console.error("No URL returned from customer portal session:",t),new Error("Invalid response from server");return console.log("Customer portal session created successfully:",t),t}catch(t){const e=t instanceof Error?t.message:String(t);throw console.error("Error in subscription service:",e),t}},CU=async(t=!1)=>{try{console.log("Checking subscription status",t?"(force refresh)":"");const{data:e,error:n}=await xe.functions.invoke("check-subscription",{body:t?{forceRefresh:!0,timestamp:new Date().getTime()}:void 0});if(n){const r=n.message||"";if(r.includes("401")||r.includes("Invalid user token")||r.includes("Unauthorized"))return console.warn("Session expired during subscription check, returning null"),null;throw console.error("Error checking subscription status:",n),new Error(r||"Failed to check subscription status")}return console.log("Subscription status checked successfully:",e),e}catch(e){const n=e instanceof Error?e.message:String(e);throw console.error("Error in subscription service:",n),e}};var O=typeof window<"u"?window:void 0,ht=typeof globalThis<"u"?globalThis:O;typeof self>"u"&&(ht.self=ht),typeof File>"u"&&(ht.File=function(){});var lR=Array.prototype,gb=lR.forEach,mb=lR.indexOf,en=ht?.navigator,W=ht?.document,dt=ht?.location,uv=ht?.fetch,dv=ht!=null&&ht.XMLHttpRequest&&"withCredentials"in new ht.XMLHttpRequest?ht.XMLHttpRequest:void 0,vb=ht?.AbortController,Mt=en?.userAgent,ee=O??{},Ar={DEBUG:!1,LIB_VERSION:"1.354.0"};function yb(t,e,n,r,s,i,o){try{var a=t[i](o),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(r,s)}function Or(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(l){yb(i,r,s,o,a,"next",l)}function a(l){yb(i,r,s,o,a,"throw",l)}o(void 0)})}}function K(){return K=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},K.apply(null,arguments)}function cR(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var kU=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],RU=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],_b=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return RU.concat(e).some(r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1})};function ce(t,e){return t.indexOf(e)!==-1}var Kf=function(t){return t.trim()},hv=function(t){return t.replace(/^\$/,"")},jU=Array.isArray,uR=Object.prototype,dR=uR.hasOwnProperty,Gf=uR.toString,me=jU||function(t){return Gf.call(t)==="[object Array]"},Mr=t=>typeof t=="function",tt=t=>t===Object(t)&&!me(t),vo=t=>{if(tt(t)){for(var e in t)if(dR.call(t,e))return!1;return!0}return!1},G=t=>t===void 0,Ze=t=>Gf.call(t)=="[object String]",fv=t=>Ze(t)&&t.trim().length===0,Bn=t=>t===null,he=t=>G(t)||Bn(t),Gr=t=>Gf.call(t)=="[object Number]"&&t==t,to=t=>Gr(t)&&t>0,Vr=t=>Gf.call(t)==="[object Boolean]",AU=t=>t instanceof FormData,OU=t=>ce(kU,t);function pv(t){return t===null||typeof t!="object"}function Ah(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function hR(t){return!G(Event)&&function(e,n){try{return e instanceof n}catch{return!1}}(t,Event)}var IU=[!0,"true",1,"1","yes"],Jp=t=>ce(IU,t),LU=[!1,"false",0,"0","no"];function cr(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Gr(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),cr(s||n,e,n,r))}class NU{constructor(e){this.t={},this.i=e.i,this.o=cr(e.bucketSize,0,100,e.h),this.m=cr(e.refillRate,0,this.o,e.h),this.$=cr(e.refillInterval,0,864e5,e.h)}S(e,n){var r=n-e.lastAccess,s=Math.floor(r/this.$);if(s>0){var i=s*this.m;e.tokens=Math.min(e.tokens+i,this.o),e.lastAccess=e.lastAccess+s*this.$}}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.t[s];return i?this.S(i,r):(i={tokens:this.o,lastAccess:r},this.t[s]=i),i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.i)==null||n.call(this,e)),i.tokens===0)}stop(){this.t={}}}var _n="Mobile",Oh="iOS",$r="Android",Uc="Tablet",fR=$r+" "+Uc,pR="iPad",gR="Apple",mR=gR+" Watch",zc="Safari",sa="BlackBerry",vR="Samsung",yR=vR+"Browser",_R=vR+" Internet",Ri="Chrome",DU=Ri+" OS",wR=Ri+" "+Oh,D0="Internet Explorer",xR=D0+" "+_n,M0="Opera",MU=M0+" Mini",$0="Edge",bR="Microsoft "+$0,Do="Firefox",ER=Do+" "+Oh,Bc="Nintendo",Hc="PlayStation",Mo="Xbox",SR=$r+" "+_n,TR=_n+" "+zc,Nl="Windows",gv=Nl+" Phone",wb="Nokia",mv="Ouya",PR="Generic",$U=PR+" "+_n.toLowerCase(),CR=PR+" "+Uc.toLowerCase(),vv="Konqueror",Pt="(\\d+(\\.\\d+)?)",Zp=new RegExp("Version/"+Pt),FU=new RegExp(Mo,"i"),VU=new RegExp(Hc+" \\w+","i"),UU=new RegExp(Bc+" \\w+","i"),F0=new RegExp(sa+"|PlayBook|BB10","i"),zU={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},ld,xb,eg,BU=(t,e)=>e&&ce(e,gR)||function(n){return ce(n,zc)&&!ce(n,Ri)&&!ce(n,$r)}(t),kR=function(t,e){return e=e||"",ce(t," OPR/")&&ce(t,"Mini")?MU:ce(t," OPR/")?M0:F0.test(t)?sa:ce(t,"IE"+_n)||ce(t,"WPDesktop")?xR:ce(t,yR)?_R:ce(t,$0)||ce(t,"Edg/")?bR:ce(t,"FBIOS")?"Facebook "+_n:ce(t,"UCWEB")||ce(t,"UCBrowser")?"UC Browser":ce(t,"CriOS")?wR:ce(t,"CrMo")||ce(t,Ri)?Ri:ce(t,$r)&&ce(t,zc)?SR:ce(t,"FxiOS")?ER:ce(t.toLowerCase(),vv.toLowerCase())?vv:BU(t,e)?ce(t,_n)?TR:zc:ce(t,Do)?Do:ce(t,"MSIE")||ce(t,"Trident/")?D0:ce(t,"Gecko")?Do:""},HU={[xR]:[new RegExp("rv:"+Pt)],[bR]:[new RegExp($0+"?\\/"+Pt)],[Ri]:[new RegExp("("+Ri+"|CrMo)\\/"+Pt)],[wR]:[new RegExp("CriOS\\/"+Pt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Pt)],[zc]:[Zp],[TR]:[Zp],[M0]:[new RegExp("(Opera|OPR)\\/"+Pt)],[Do]:[new RegExp(Do+"\\/"+Pt)],[ER]:[new RegExp("FxiOS\\/"+Pt)],[vv]:[new RegExp("Konqueror[:/]?"+Pt,"i")],[sa]:[new RegExp(sa+" "+Pt),Zp],[SR]:[new RegExp("android\\s"+Pt,"i")],[_R]:[new RegExp(yR+"\\/"+Pt)],[D0]:[new RegExp("(rv:|MSIE )"+Pt)],Mozilla:[new RegExp("rv:"+Pt)]},WU=function(t,e){var n=kR(t,e),r=HU[n];if(G(r))return null;for(var s=0;s<r.length;s++){var i=r[s],o=t.match(i);if(o)return parseFloat(o[o.length-2])}return null},bb=[[new RegExp(Mo+"; "+Mo+" (.*?)[);]","i"),t=>[Mo,t&&t[1]||""]],[new RegExp(Bc,"i"),[Bc,""]],[new RegExp(Hc,"i"),[Hc,""]],[F0,[sa,""]],[new RegExp(Nl,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[gv,""];if(new RegExp(_n).test(e)&&!/IEMobile\b/.test(e))return[Nl+" "+_n,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],s=zU[r]||"";return/arm/i.test(e)&&(s="RT"),[Nl,s]}return[Nl,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Oh,e.join(".")]}return[Oh,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=G(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+$r+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+$r+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[$r,e.join(".")]}return[$r,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[DU,""]],[/Linux|debian/i,["Linux",""]]],Eb=function(t){return UU.test(t)?Bc:VU.test(t)?Hc:FU.test(t)?Mo:new RegExp(mv,"i").test(t)?mv:new RegExp("("+gv+"|WPDesktop)","i").test(t)?gv:/iPad/.test(t)?pR:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?mR:F0.test(t)?sa:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(wb,"i").test(t)?wb:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(_n).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?$r:fR:new RegExp("(pda|"+_n+")","i").test(t)?$U:new RegExp(Uc,"i").test(t)&&!new RegExp(Uc+" pc","i").test(t)?CR:""},KU=t=>t instanceof Error;function GU(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return eg&&n.length===xb||(xb=n.length,eg=n.reduce((r,s)=>{ld||(ld={});var i=ld[s];if(i)r[i[0]]=i[1];else for(var o=t(s),a=o.length-1;a>=0;a--){var l=o[a],c=l?.filename,u=e[s];if(c&&u){r[c]=u,ld[s]=[c,u];break}}return r},{})),eg}}class qU{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),o=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Or(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&me(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),K({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Or(function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r})()}convertToExceptionList(e,n){var r,s,i,o={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,K({},n,{handled:!0}))),a}buildParsingContext(e){var n;return{chunkIdMap:GU(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,o)=>{if(o<=4){var a=this.buildCoercingContext(e,n,o);return this.applyCoercers(i,a)}};return K({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var ia="?";function yv(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?ia:n,in_app:!0};return G(r)||(i.lineno=r),G(s)||(i.colno=s),i}var RR=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:ia,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},YU=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,QU=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,XU=/\((\S*)(?::(\d+))(?::(\d+))\)/,JU=(t,e)=>{var n=YU.exec(t);if(n){var[,r,s,i]=n;return yv(e,r,ia,+s,+i)}var o=QU.exec(t);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=XU.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,c]=RR(o[1]||ia,o[2]);return yv(e,c,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},ZU=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ez=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tz=(t,e)=>{var n=ZU.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=ez.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||ia;return[i,s]=RR(i,s),yv(e,s,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Sb=/\(error: (.*)\)/,Tb=50;function nz(){return function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(s,i){i===void 0&&(i=0);for(var o=[],a=s.split(`
`),l=i;l<a.length;l++){var c=a[l];if(!(c.length>1024)){var u=Sb.test(c)?c.replace(Sb,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of n){var f=d(u,t);if(f){o.push(f);break}}if(o.length>=Tb)break}}}return function(p){if(!p.length)return[];var m=Array.from(p);return m.reverse(),m.slice(0,Tb).map(v=>{return K({},v,{filename:v.filename||(w=m,w[w.length-1]||{}).filename,function:v.function||ia});var w})}(o)}}("web:javascript",JU,tz)}class rz{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=Ze(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Ah(e,"DOMException")}isDOMError(e){return Ah(e,"DOMError")}}class sz{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class iz{constructor(){}match(e){return Ah(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,s=n.apply(e.error);return s||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var oz=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class az{match(e){return typeof e=="string"}coerce(e,n){var r,[s,i]=this.getInfos(e);return{type:s??"Error",value:i??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(oz);return s&&(n=s[1],r=s[2]),[n,r]}}var lz=["fatal","error","warning","log","info","debug"];function jR(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(!(s.length>e))return r===n.length||s.length<=e?s:s.slice(0,e)+"..."}return""}class cz{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return hR(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+jR(e)}isSeverityLevel(e){return Ze(e)&&!fv(e)&&lz.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(KU(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class uz{match(e){return hR(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+jR(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class dz{match(e){return pv(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class hz{match(e){return Ah(e,"PromiseRejectionEvent")}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return pv(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){if(pv(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var AR=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(s){if(O&&(Ar.DEBUG||ee.POSTHOG_DEBUG||n)&&!G(O.console)&&O.console){for(var i=("__rrweb_original__"in O.console[s])?O.console[s].__rrweb_original__:O.console[s],o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];i(t,...a)}},info:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("log",...i)},warn:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("warn",...i)},error:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("error",...i)},critical:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];console.error(t,...i)},uninitializedWarning:s=>{r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>AR(t+" "+s,i)};return r},q=AR("[PostHog.js]"),ze=q.createLogger,fz=ze("[ExternalScriptsLoader]"),Pb=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return fz.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=W?.querySelectorAll("script");if(r){for(var s,i=function(){if(r[o].src===e){var l=r[o];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)}),l.onerror=c=>n(c),{v:void 0})}},o=0;o<r.length;o++)if(s=i())return s.v}var a=()=>{if(!W)return n("document not found");var l=W.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")W.head.appendChild(l);else{var c,u=W.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):W.body.appendChild(l)}};W!=null&&W.body?a():W?.addEventListener("DOMContentLoaded",a)};ee.__PosthogExtensions__=ee.__PosthogExtensions__||{},ee.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var i=t.requestRouter.endpointFor("assets",r);Pb(t,i,n)},ee.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);Pb(t,r,n)};var Ih={};function Ns(t,e,n){if(me(t)){if(gb&&t.forEach===gb)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,s=t.length;r<s;r++)if(r in t&&e.call(n,t[r],r)===Ih)return}}}function Te(t,e,n){if(!he(t)){if(me(t))return Ns(t,e,n);if(AU(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===Ih)return}else for(var s in t)if(dR.call(t,s)&&e.call(n,t[s],s)===Ih)return}}var qe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ns(n,function(s){for(var i in s)s[i]!==void 0&&(t[i]=s[i])}),t},oa=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ns(n,function(s){Ns(s,function(i){t.push(i)})}),t};function Ud(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var Cb=function(t){try{return t()}catch{return}},pz=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){q.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),q.critical(s)}}},V0=function(t){var e={};return Te(t,function(n,r){(Ze(n)&&n.length>0||Gr(n))&&(e[r]=n)}),e};function gz(t,e){return n=t,r=i=>Ze(i)&&!Bn(e)?i.slice(0,e):i,s=new Set,function i(o,a){return o!==Object(o)?r?r(o,a):o:s.has(o)?void 0:(s.add(o),me(o)?(l=[],Ns(o,c=>{l.push(i(c))})):(l={},Te(o,(c,u)=>{s.has(c)||(l[u]=i(c,u))})),l);var l}(n);var n,r,s}var mz=["herokuapp.com","vercel.app","netlify.app"];function vz(t){var e=t?.hostname;if(!Ze(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of mz)if(n===r)return!1;return!0}function OR(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function Je(t,e,n,r){var{capture:s=!1,passive:i=!0}=r??{};t?.addEventListener(e,n,{capture:s,passive:i})}function IR(t){return t.name==="ph_toolbar_internal"}var LR="$people_distinct_id",Dl="__alias",Ml="__timers",kb="$autocapture_disabled_server_side",_v="$heatmaps_enabled_server_side",Rb="$exception_capture_enabled_server_side",wv="$error_tracking_suppression_rules",jb="$error_tracking_capture_extension_exceptions",Ab="$web_vitals_enabled_server_side",NR="$dead_clicks_enabled_server_side",Ob="$product_tours_enabled_server_side",Ib="$web_vitals_allowed_metrics",cd="$session_recording_remote_config",Lh="$sesid",DR="$session_is_sampled",yo="$enabled_feature_flags",$l="$early_access_features",xv="$feature_flag_details",Fl="$stored_person_properties",si="$stored_group_properties",bv="$surveys",Nh="$flag_call_reported",Ev="$feature_flag_errors",er="$user_state",Sv="$client_session_props",Tv="$capture_rate_limit",Pv="$initial_campaign_params",Cv="$initial_referrer_info",Dh="$initial_person_info",Mh="$epp",MR="__POSTHOG_TOOLBAR__",Ga="$posthog_cookieless",yz=[LR,Dl,"__cmpns",Ml,"$session_recording_enabled_server_side",_v,Lh,yo,wv,er,$l,xv,si,Fl,bv,Nh,Ev,Sv,Tv,Pv,Cv,Mh,Dh];Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Gr(t)&&isFinite(t)&&Math.floor(t)===t});var Lb="0123456789abcdef";class $h{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||e<0||n<0||r<0||s<0||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new $h(i)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+Lb.charAt(this.bytes[n]>>>4)+Lb.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new $h(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class _z{constructor(){this.P=0,this.T=0,this.I=new wz}generate(){var e=this.generateOrAbort();if(G(e)){this.P=0;var n=this.generateOrAbort();if(G(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.C();else{if(!(e+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.C())}return $h.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.I.nextUint32())}C(){this.T=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Nb,$R=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};O&&!G(O.crypto)&&crypto.getRandomValues&&($R=t=>crypto.getRandomValues(t));class wz{constructor(){this.R=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.R.length&&($R(this.R),this.F=0),this.R[this.F++]}}var Ss=()=>xz().toString(),xz=()=>(Nb||(Nb=new _z)).generate(),qa="",bz=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ez(t,e){if(e){var n=function(s,i){if(i===void 0&&(i=W),qa)return qa;if(!i||["localhost","127.0.0.1"].includes(s))return"";for(var o=s.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Ss();!qa&&a--;){var c=o.slice(a).join("."),u=l+"=1;domain=."+c+";path=/";i.cookie=u+";max-age=3",i.cookie.includes(l)&&(i.cookie=u+";max-age=0",qa=c)}return qa}(t);if(!n){var r=(s=>{var i=s.match(bz);return i?i[0]:""})(t);r!==n&&q.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var ir={O:()=>!!W,M:function(t){q.error("cookieStore error: "+t)},A:function(t){if(W){try{for(var e=t+"=",n=W.cookie.split(";").filter(i=>i.length),r=0;r<n.length;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},j:function(t){var e;try{e=JSON.parse(ir.A(t))||{}}catch{}return e},D:function(t,e,n,r,s){if(W)try{var i="",o="",a=Ez(W.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),i="; expires="+l.toUTCString()}s&&(o="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&q.warn("cookieStore warning: large cookie, len="+c.length),W.cookie=c,c}catch{return}},L:function(t,e){if(W!=null&&W.cookie)try{ir.D(t,"",-1,e)}catch{return}}},tg=null,$e={O:function(){if(!Bn(tg))return tg;var t=!0;if(G(O))t=!1;else try{var e="__mplssupport__";$e.D(e,"xyz"),$e.A(e)!=='"xyz"'&&(t=!1),$e.L(e)}catch{t=!1}return t||q.error("localStorage unsupported; falling back to cookie store"),tg=t,t},M:function(t){q.error("localStorage error: "+t)},A:function(t){try{return O?.localStorage.getItem(t)}catch(e){$e.M(e)}return null},j:function(t){try{return JSON.parse($e.A(t))||{}}catch{}return null},D:function(t,e){try{O?.localStorage.setItem(t,JSON.stringify(e))}catch(n){$e.M(n)}},L:function(t){try{O?.localStorage.removeItem(t)}catch(e){$e.M(e)}}},Sz=["$device_id","distinct_id",Lh,DR,Mh,Dh,er],ud={},Tz={O:function(){return!0},M:function(t){q.error("memoryStorage error: "+t)},A:function(t){return ud[t]||null},j:function(t){return ud[t]||null},D:function(t,e){ud[t]=e},L:function(t){delete ud[t]}},Js=null,ut={O:function(){if(!Bn(Js))return Js;if(Js=!0,G(O))Js=!1;else try{var t="__support__";ut.D(t,"xyz"),ut.A(t)!=='"xyz"'&&(Js=!1),ut.L(t)}catch{Js=!1}return Js},M:function(t){q.error("sessionStorage error: ",t)},A:function(t){try{return O?.sessionStorage.getItem(t)}catch(e){ut.M(e)}return null},j:function(t){try{return JSON.parse(ut.A(t))||null}catch{}return null},D:function(t,e){try{O?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){ut.M(n)}},L:function(t){try{O?.sessionStorage.removeItem(t)}catch(e){ut.M(e)}}},Ir=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Pz{constructor(e){this._instance=e}get N(){return this._instance.config}get consent(){return this.U()?Ir.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===Ir.DENIED||this.consent===Ir.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ir.DENIED}optInOut(e){this.B.D(this.q,e?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.L(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get H(){var e=this.B.A(this.q);return Jp(e)?Ir.GRANTED:ce(LU,e)?Ir.DENIED:Ir.PENDING}get B(){if(!this.W){var e=this.N.opt_out_capturing_persistence_type;this.W=e==="localStorage"?$e:ir;var n=e==="localStorage"?ir:$e;n.A(this.q)&&(this.W.A(this.q)||this.optInOut(Jp(n.A(this.q))),n.L(this.q,this.N.cross_subdomain_cookie))}return this.W}U(){return!!this.N.respect_dnt&&!!OR([en?.doNotTrack,en?.msDoNotTrack,ee.doNotTrack],e=>Jp(e))}}var dd=ze("[Dead Clicks]"),Cz=()=>!0,kz=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(NR)),r=t.instance.config.capture_dead_clicks;return Vr(r)?r:!!tt(r)||n};class Db{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[NR]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.V(()=>{this.J()}):this.stop()}V(e){var n,r;(n=ee.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=ee.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?dd.error("failed to load script",s):e()})}J(){var e;if(W){if(!this.G&&(e=ee.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=tt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.G=ee.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.G.start(W),dd.info("starting...")}}else dd.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,dd.info("stopping..."))}}var ng=ze("[SegmentIntegration]");function Rz(t,e){var n=t.config.segment;if(!n)return e();(function(r,s){var i=r.config.segment;if(!i)return s();var o=l=>{var c=()=>l.anonymousId()||Ss();r.config.get_device_id=c,l.id()&&(r.register({distinct_id:l.id(),$device_id:c()}),r.persistence.set_property(er,"identified")),s()},a=i.user();"then"in a&&Mr(a.then)?a.then(o):o(a)})(t,()=>{n.register((r=>{Promise&&Promise.resolve||ng.warn("This browser does not have Promise support, and can not use the segment integration");var s=(i,o)=>{if(!o)return i;i.event.userId||i.event.anonymousId===r.get_distinct_id()||(ng.info("No userId set, resetting PostHog"),r.reset()),i.event.userId&&i.event.userId!==r.get_distinct_id()&&(ng.info("UserId set, identifying with PostHog"),r.identify(i.event.userId));var a=r.calculateEventProperties(o,i.event.properties);return i.event.properties=Object.assign({},a,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:i=>s(i,i.event.event),page:i=>s(i,"$pageview"),identify:i=>s(i,"$identify"),screen:i=>s(i,"$screen")}})(t)).then(()=>{e()})})}var FR="posthog-js";function VR(t,e){var{organization:n,projectId:r,prefix:s,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}=e===void 0?{}:e;return a=>{var l,c,u,d,f;if(!(i==="*"||i.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var p=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=p,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var m=((l=a.exception)==null?void 0:l.values)||[],v=m.map(y=>K({},y,{stacktrace:y.stacktrace?K({},y.stacktrace,{type:"raw",frames:(y.stacktrace.frames||[]).map(_=>K({},_,{platform:"web:javascript"}))}):void 0})),w={$exception_message:((c=m[0])==null?void 0:c.value)||a.message,$exception_type:(u=m[0])==null?void 0:u.type,$exception_level:a.level,$exception_list:v,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((d=m[0])==null?void 0:d.value)||a.message,$sentry_exception_type:(f=m[0])==null?void 0:f.type,$sentry_tags:a.tags};return n&&r&&(w.$sentry_url=(s||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),o&&t.exceptions.sendExceptionEvent(w),a}}class jz{constructor(e,n,r,s,i,o){this.name=FR,this.setupOnce=function(a){a(VR(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}}var Fh=t=>{var e=W?.createElement("a");return G(e)?null:(e.href=t,e)},Az=function(t,e){var n,r;e===void 0&&(e="&");var s=[];return Te(t,function(i,o){G(i)||G(o)||o==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(i)?i.name:i.toString()),r=encodeURIComponent(o),s[s.length]=r+"="+n)}),s.join(e)},Vh=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!me(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{q.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Wc=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[0]||"",i=r[1],o=s.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],d=0;d<c.length;d++){var f=c[d].split("=");me(f)&&(e.includes(f[0])?u.push(f[0]+"="+n):u.push(c[d]))}var p=l;return a!=null&&(p+="?"+u.join("&")),i!=null&&(p+="#"+i),p},Uh=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Oz=O!=null&&O.location?Uh(O.location.hash,"__posthog")||Uh(location.hash,"state"):null,Mb="_postHogToolbarParams",$b=ze("[Toolbar]"),os=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(os||{});class Iz{constructor(e){this.instance=e}K(e){ee.ph_toolbar_state=e}Y(){var e;return(e=ee.ph_toolbar_state)!==null&&e!==void 0?e:os.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),IR(this.instance.config)||!O||!W)return!1;e=e??O.location,r=r??O.history;try{if(!n){try{O.localStorage.setItem("test","test"),O.localStorage.removeItem("test")}catch{return!1}n=O?.localStorage}var s,i=Oz||Uh(e.hash,"__posthog")||Uh(e.hash,"state"),o=i?Cb(()=>JSON.parse(atob(decodeURIComponent(i))))||Cb(()=>JSON.parse(decodeURIComponent(i))):null;return o&&o.action==="ph_authorize"?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(n.getItem(Mb)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}X(e){var n=ee.ph_load_toolbar||ee.ph_load_editor;!he(n)&&Mr(n)?n(e,this.instance):$b.warn("No toolbar load function found")}loadToolbar(e){var n=!(W==null||!W.getElementById(MR));if(!O||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=K({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(O.localStorage.setItem(Mb,JSON.stringify(K({},s,{source:void 0}))),this.Y()===os.LOADED)this.X(s);else if(this.Y()===os.UNINITIALIZED){var i;this.K(os.LOADING),(i=ee.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",o=>{if(o)return $b.error("[Toolbar] Failed to load",o),void this.K(os.UNINITIALIZED);this.K(os.LOADED),this.X(s)}),Je(O,"turbolinks:load",()=>{this.K(os.UNINITIALIZED),this.loadToolbar(s)})}return!0}Z(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}}class Fb{constructor(e){this.tt=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength)&&(q.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.it=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.et()}et(){var e;this.rt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.tt)}destroy(){var e;(e=this.rt)==null||e.call(this),this.rt=void 0}doPageView(e,n){var r,s=this.st(e,n);return this.it={pathname:(r=O?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.st(e,(n=this.it)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.it)==null?void 0:e.pageViewId}}st(e,n){var r=this.it;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=i;if(!(G(o)||G(a)||G(l)||G(c)||G(u)||G(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var f=o<=1?1:cr(a/o,0,1,q),p=o<=1?1:cr(l/o,0,1,q),m=c<=1?1:cr(u/c,0,1,q),v=c<=1?1:cr(d/c,0,1,q);s=qe(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:m,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var or=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),wn=Uint8Array,Ut=Uint16Array,aa=Uint32Array,U0=new wn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),z0=new wn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Vb=new wn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),UR=function(t,e){for(var n=new Ut(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var s=new aa(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)s[i]=i-n[r]<<5|r;return[n,s]},zR=UR(U0,2),Lz=zR[0],kv=zR[1];Lz[28]=258,kv[258]=28;for(var Ub=UR(z0,0)[1],BR=new Ut(32768),Oe=0;Oe<32768;++Oe){var Zs=(43690&Oe)>>>1|(21845&Oe)<<1;Zs=(61680&(Zs=(52428&Zs)>>>2|(13107&Zs)<<2))>>>4|(3855&Zs)<<4,BR[Oe]=((65280&Zs)>>>8|(255&Zs)<<8)>>>1}var oc=function(t,e,n){for(var r=t.length,s=0,i=new Ut(e);s<r;++s)++i[t[s]-1];var o,a=new Ut(e);for(s=0;s<e;++s)a[s]=a[s-1]+i[s-1]<<1;for(o=new Ut(r),s=0;s<r;++s)o[s]=BR[a[t[s]-1]++]>>>15-t[s];return o},ji=new wn(288);for(Oe=0;Oe<144;++Oe)ji[Oe]=8;for(Oe=144;Oe<256;++Oe)ji[Oe]=9;for(Oe=256;Oe<280;++Oe)ji[Oe]=7;for(Oe=280;Oe<288;++Oe)ji[Oe]=8;var zh=new wn(32);for(Oe=0;Oe<32;++Oe)zh[Oe]=5;var Nz=oc(ji,9),Dz=oc(zh,5),HR=function(t){return(t/8>>0)+(7&t&&1)},WR=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Ut?Ut:t instanceof aa?aa:wn)(n-e);return r.set(t.subarray(e,n)),r},Cr=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},Ya=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},rg=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new wn(0),0];if(s==1){var o=new wn(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(b,S){return b.f-S.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var f=i[0].s;for(r=1;r<s;++r)i[r].s>f&&(f=i[r].s);var p=new Ut(f+1),m=Rv(n[u-1],p,0);if(m>e){r=0;var v=0,w=m-e,y=1<<w;for(i.sort(function(b,S){return p[S.s]-p[b.s]||b.f-S.f});r<s;++r){var _=i[r].s;if(!(p[_]>e))break;v+=y-(1<<m-p[_]),p[_]=e}for(v>>>=w;v>0;){var x=i[r].s;p[x]<e?v-=1<<e-p[x]++-1:++r}for(;r>=0&&v;--r){var E=i[r].s;p[E]==e&&(--p[E],++v)}m=e}return[new wn(p),m]},Rv=function(t,e,n){return t.s==-1?Math.max(Rv(t.l,e,n+1),Rv(t.r,e,n+1)):e[t.s]=n},zb=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ut(++e),r=0,s=t[0],i=1,o=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==s&&a!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[a]}return[n.subarray(0,r),e]},Qa=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},jv=function(t,e,n){var r=n.length,s=HR(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;i<r;++i)t[s+i+4]=n[i];return 8*(s+4+r)},Bb=function(t,e,n,r,s,i,o,a,l,c,u){Cr(e,u++,n),++s[256];for(var d=rg(s,15),f=d[0],p=d[1],m=rg(i,15),v=m[0],w=m[1],y=zb(f),_=y[0],x=y[1],E=zb(v),b=E[0],S=E[1],T=new Ut(19),P=0;P<_.length;++P)T[31&_[P]]++;for(P=0;P<b.length;++P)T[31&b[P]]++;for(var I=rg(T,7),k=I[0],V=I[1],F=19;F>4&&!k[Vb[F-1]];--F);var Y,N,X,B,H=c+5<<3,R=Qa(s,ji)+Qa(i,zh)+o,A=Qa(s,f)+Qa(i,v)+o+14+3*F+Qa(T,k)+(2*T[16]+3*T[17]+7*T[18]);if(H<=R&&H<=A)return jv(e,u,t.subarray(l,l+c));if(Cr(e,u,1+(A<R)),u+=2,A<R){Y=oc(f,p),N=f,X=oc(v,w),B=v;var U=oc(k,V);for(Cr(e,u,x-257),Cr(e,u+5,S-1),Cr(e,u+10,F-4),u+=14,P=0;P<F;++P)Cr(e,u+3*P,k[Vb[P]]);u+=3*F;for(var M=[_,b],z=0;z<2;++z){var J=M[z];for(P=0;P<J.length;++P){var re=31&J[P];Cr(e,u,U[re]),u+=k[re],re>15&&(Cr(e,u,J[P]>>>5&127),u+=J[P]>>>12)}}}else Y=Nz,N=ji,X=Dz,B=zh;for(P=0;P<a;++P)if(r[P]>255){re=r[P]>>>18&31,Ya(e,u,Y[re+257]),u+=N[re+257],re>7&&(Cr(e,u,r[P]>>>23&31),u+=U0[re]);var De=31&r[P];Ya(e,u,X[De]),u+=B[De],De>3&&(Ya(e,u,r[P]>>>5&8191),u+=z0[De])}else Ya(e,u,Y[r[P]]),u+=N[r[P]];return Ya(e,u,Y[256]),u+N[256]},Mz=new aa([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$z=function(){for(var t=new aa(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),Fz=function(t,e,n,r,s){return function(i,o,a,l,c,u){var d=i.length,f=new wn(l+d+5*(1+Math.floor(d/7e3))+c),p=f.subarray(l,f.length-c),m=0;if(!o||d<8)for(var v=0;v<=d;v+=65535){var w=v+65535;w<d?m=jv(p,m,i.subarray(v,w)):(p[v]=u,m=jv(p,m,i.subarray(v,d)))}else{for(var y=Mz[o-1],_=y>>>13,x=8191&y,E=(1<<a)-1,b=new Ut(32768),S=new Ut(E+1),T=Math.ceil(a/3),P=2*T,I=function(Oa){return(i[Oa]^i[Oa+1]<<T^i[Oa+2]<<P)&E},k=new aa(25e3),V=new Ut(288),F=new Ut(32),Y=0,N=0,X=(v=0,0),B=0,H=0;v<d;++v){var R=I(v),A=32767&v,U=S[R];if(b[A]=U,S[R]=A,B<=v){var M=d-v;if((Y>7e3||X>24576)&&M>423){m=Bb(i,p,0,k,V,F,N,X,H,v-H,m),X=Y=N=0,H=v;for(var z=0;z<286;++z)V[z]=0;for(z=0;z<30;++z)F[z]=0}var J=2,re=0,De=x,se=A-U&32767;if(M>2&&R==I(v-se))for(var ye=Math.min(_,M)-1,Kt=Math.min(32767,v),Er=Math.min(258,M);se<=Kt&&--De&&A!=U;){if(i[v+J]==i[v+J-se]){for(var mt=0;mt<Er&&i[v+mt]==i[v+mt-se];++mt);if(mt>J){if(J=mt,re=se,mt>ye)break;var Ra=Math.min(se,mt-2),Qr=0;for(z=0;z<Ra;++z){var Wn=v-se+z+32768&32767,ja=Wn-b[Wn]+32768&32767;ja>Qr&&(Qr=ja,U=Wn)}}}se+=(A=U)-(U=b[A])+32768&32767}if(re){k[X++]=268435456|kv[J]<<18|Ub[re];var Aa=31&kv[J],Sr=31&Ub[re];N+=U0[Aa]+z0[Sr],++V[257+Aa],++F[Sr],B=v+J,++Y}else k[X++]=i[v],++V[i[v]]}}m=Bb(i,p,u,k,V,F,N,X,H,v-H,m)}return WR(f,0,l+HR(m)+c)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!0)},sg=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function Vz(t,e){e===void 0&&(e={});var n=function(){var a=4294967295;return{p:function(l){for(var c=a,u=0;u<l.length;++u)c=$z[255&c^l[u]]^c>>>8;a=c},d:function(){return 4294967295^a}}}(),r=t.length;n.p(t);var s,i=Fz(t,e,10+((s=e).filename&&s.filename.length+1||0),8),o=i.length;return function(a,l){var c=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&sg(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){a[3]=8;for(var u=0;u<=c.length;++u)a[u+10]=c.charCodeAt(u)}}(i,e),sg(i,o-8,n.d()),sg(i,o-4,r),i}var Uz=function(t){var e,n,r,s,i="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`)).length,s=0;s<r;s++){var o=t.charCodeAt(s),a=null;o<128?n++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Bn(a)||(n>e&&(i+=t.substring(e,n)),i+=a,e=n=s+1)}return n>e&&(i+=t.substring(e,t.length)),i},zz=!!dv||!!uv,Hb="text/plain",Bh=function(t,e,n){var r;n===void 0&&(n=!0);var[s,i]=t.split("?"),o=K({},e),a=(r=i?.split("&").map(c=>{var u,[d,f]=c.split("="),p=n&&(u=o[d])!==null&&u!==void 0?u:f;return delete o[d],d+"="+p}))!==null&&r!==void 0?r:[],l=Az(o);return l&&a.push(l),s+"?"+a.join("&")},Vl=(t,e)=>JSON.stringify(t,(n,r)=>typeof r=="bigint"?r.toString():r,e),ig=t=>{var{data:e,compression:n}=t;if(e){if(n===or.GZipJS){var r=Vz(function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var d=new wn(l.length+(l.length>>>1)),f=0,p=function(y){d[f++]=y},m=0;m<u;++m){if(f+5>d.length){var v=new wn(f+8+(u-m<<1));v.set(d),d=v}var w=l.charCodeAt(m);w<128||c?p(w):w<2048?(p(192|w>>>6),p(128|63&w)):w>55295&&w<57344?(p(240|(w=65536+(1047552&w)|1023&l.charCodeAt(++m))>>>18),p(128|w>>>12&63),p(128|w>>>6&63),p(128|63&w)):(p(224|w>>>12),p(128|w>>>6&63),p(128|63&w))}return WR(d,0,f)}(Vl(e)),{mtime:0}),s=new Blob([r],{type:Hb});return{contentType:Hb,body:s,estimatedSize:s.size}}if(n===or.Base64){var i=function(l){var c,u,d,f,p,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",v=0,w=0,y="",_=[];if(!l)return l;l=Uz(l);do c=(p=l.charCodeAt(v++)<<16|l.charCodeAt(v++)<<8|l.charCodeAt(v++))>>18&63,u=p>>12&63,d=p>>6&63,f=63&p,_[w++]=m.charAt(c)+m.charAt(u)+m.charAt(d)+m.charAt(f);while(v<l.length);switch(y=_.join(""),l.length%3){case 1:y=y.slice(0,-2)+"==";break;case 2:y=y.slice(0,-1)+"="}return y}(Vl(e)),o=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Vl(l)))(i);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Vl(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},zd=[];uv&&zd.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:s,estimatedSize:i}=(e=ig(t))!==null&&e!==void 0?e:{},o=new Headers;Te(t.headers,function(u,d){o.append(d,u)}),r&&o.append("Content-Type",r);var a=t.url,l=null;if(vb){var c=new vb;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),t.timeout)}}uv(a,K({method:t?.method||"GET",headers:o,keepalive:t.method==="POST"&&(i||0)<52428.8,body:s,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then(u=>u.text().then(d=>{var f={statusCode:u.status,text:d};if(u.status===200)try{f.json=JSON.parse(d)}catch(p){q.error(p)}t.callback==null||t.callback(f)})).catch(u=>{q.error(u),t.callback==null||t.callback({statusCode:0,error:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),dv&&zd.push({transport:"XHR",method:t=>{var e,n=new dv;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:s}=(e=ig(t))!==null&&e!==void 0?e:{};Te(t.headers,function(i,o){n.setRequestHeader(o,i)}),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var i={statusCode:n.status,text:n.responseText};if(n.status===200)try{i.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(i)}},n.send(s)}}),en!=null&&en.sendBeacon&&zd.push({transport:"sendBeacon",method:t=>{var e=Bh(t.url,{beacon:"1"});try{var n,{contentType:r,body:s}=(n=ig(t))!==null&&n!==void 0?n:{},i=typeof s=="string"?new Blob([s],{type:r}):s;en.sendBeacon(e,i)}catch{}}});var Hh=function(t,e){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Wb(t,e,n){return Vl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var KR={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>Hh(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Hh(n,r))),icontains:(t,e)=>e.map(hd).some(n=>t.map(hd).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(hd).every(n=>t.map(hd).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{var r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{var r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})},hd=t=>t.toLowerCase();function GR(t,e){return!t||Object.entries(t).every(n=>{var[r,s]=n,i=e?.[r];if(G(i)||Bn(i))return!1;var o=[String(i)],a=KR[s.operator];return!!a&&a(s.values,o)})}var og=ze("[Error tracking]");class Bz{constructor(e){var n,r;this.nt=[],this.ot=new qU([new rz,new hz,new iz,new sz,new uz,new cz,new az,new dz],nz()),this._instance=e,this.nt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(wv))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,s;if("errorTracking"in e){var i=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],o=(s=e.errorTracking)==null?void 0:s.captureExtensionExceptions;this.nt=i,this._instance.persistence&&this._instance.persistence.register({[wv]:this.nt,[jb]:o})}}get ut(){var e,n=!!this._instance.get_property(jb),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.ot.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.ht(n)){if(this.dt(n))return void og.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(n))return void og.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(n))return void og.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(e){if(e.length===0)return!1;var n=e.reduce((r,s)=>{var{type:i,value:o}=s;return Ze(i)&&i.length>0&&r.$exception_types.push(i),Ze(o)&&o.length>0&&r.$exception_values.push(o),r},{$exception_types:[],$exception_values:[]});return this.nt.some(r=>{var s=r.values.map(i=>{var o,a=KR[i.operator],l=me(i.value)?i.value:[i.value],c=(o=n[i.key])!==null&&o!==void 0?o:[];return l.length>0&&a(l,c)});return r.type==="OR"?s.some(Boolean):s.every(Boolean)})}vt(e){return e.flatMap(n=>{var r,s;return(r=(s=n.stacktrace)==null?void 0:s.frames)!==null&&r!==void 0?r:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}ct(e){if(e.length>0){var n,r,s,i,o=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=o[o.length-1];return(s=a==null||(i=a.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}ht(e){return!he(e)&&me(e)}}var fd="https?://(.*)",la=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Hz=oa(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],la),Kc="<masked>",Wz=["li_fat_id"];function qR(t,e,n){if(!W)return{};var r,s=e?oa([],la,n||[]):[],i=YR(Wc(W.URL,s,Kc),t),o=(r={},Te(Wz,function(a){var l=ir.A(a);r[a]=l||null}),r);return qe(o,i)}function YR(t,e){var n=Hz.concat(e||[]),r={};return Te(n,function(s){var i=Vh(t,s);r[s]=i||null}),r}function QR(t){var e=function(i){return i?i.search(fd+"google.([^/?]*)")===0?"google":i.search(fd+"bing.com")===0?"bing":i.search(fd+"yahoo.com")===0?"yahoo":i.search(fd+"duckduckgo.com")===0?"duckduckgo":null:null}(t),n=e!="yahoo"?"q":"p",r={};if(!Bn(e)){r.$search_engine=e;var s=W?Vh(W.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function Kb(){return navigator.language||navigator.userLanguage}function XR(){return W?.referrer||"$direct"}function JR(t,e){var n=t?oa([],la,e||[]):[],r=dt?.href.substring(0,1e3);return{r:XR().substring(0,1e3),u:r?Wc(r,n,Kc):void 0}}function ZR(t){var e,{r:n,u:r}=t,s={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=Fh(n))==null?void 0:e.host};if(r){s.$current_url=r;var i=Fh(r);s.$host=i?.host,s.$pathname=i?.pathname;var o=YR(r);qe(s,o)}if(n){var a=QR(n);qe(s,a)}return s}function ej(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Kz(){try{return new Date().getTimezoneOffset()}catch{return}}function Gz(t,e){if(!Mt)return{};var n,r,s,i=t?oa([],la,e||[]):[],[o,a]=function(l){for(var c=0;c<bb.length;c++){var[u,d]=bb[c],f=u.exec(l),p=f&&(Mr(d)?d(f,l):d);if(p)return p}return["",""]}(Mt);return qe(V0({$os:o,$os_version:a,$browser:kR(Mt,navigator.vendor),$device:Eb(Mt),$device_type:(r=Mt,s=Eb(r),s===pR||s===fR||s==="Kobo"||s==="Kindle Fire"||s===CR?Uc:s===Bc||s===Mo||s===Hc||s===mv?"Console":s===mR?"Wearable":s?_n:"Desktop"),$timezone:ej(),$timezone_offset:Kz()}),{$current_url:Wc(dt?.href,i,Kc),$host:dt?.host,$pathname:dt?.pathname,$raw_user_agent:Mt.length>1e3?Mt.substring(0,997)+"...":Mt,$browser_version:WU(Mt,navigator.vendor),$browser_language:Kb(),$browser_language_prefix:(n=Kb(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:O?.screen.height,$screen_width:O?.screen.width,$viewport_height:O?.innerHeight,$viewport_width:O?.innerWidth,$lib:"web",$lib_version:Ar.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Gt=ze("[FeatureFlags]"),Xa=ze("[FeatureFlags]",{debugEnabled:!0}),qz="errors_while_computing_flags",Yz="flag_missing",Qz="quota_limited",Xz="timeout",Jz="connection_error",Zz="unknown_error",eB=t=>"api_error_"+t,ag="$active_feature_flags",Gi="$override_feature_flags",Gb="$feature_flag_payloads",Ja="$override_feature_flag_payloads",qb="$feature_flag_request_id",Yb="$feature_flag_evaluated_at",Qb=t=>{var e={};for(var[n,r]of Ud(t||{}))r&&(e[n]=r);return e},tB=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map(n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]})),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(n=>e[n].enabled).filter(n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload}).map(n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]}))):Gt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},nB=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class rB{constructor(e){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this._instance=e,this.featureFlagEventHandlers=[]}St(){var e,n=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(Gt.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),n!=null&&n.length?n.filter(r=>{var s=r&&typeof r=="string"&&r.trim().length>0;return s||Gt.error("Invalid evaluation context found:",r,"Expected non-empty string"),s}):[]}kt(){return this.St().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(xv),n=this._instance.get_property(Gi),r=this._instance.get_property(Ja);if(!r&&!n)return e||{};var s=qe({},e||{}),i=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of i){var a,l,c=s[o],u=n?.[o],d=G(u)?(a=c?.enabled)!==null&&a!==void 0&&a:!!u,f=G(u)?c.variant:typeof u=="string"?u:void 0,p=r?.[o],m=K({},c,{enabled:d,variant:d?f??c?.variant:void 0});d!==c?.enabled&&(m.original_enabled=c?.enabled),f!==c?.variant&&(m.original_variant=c?.variant),p&&(m.metadata=K({},c?.metadata,{payload:p,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),s[o]=m}return this._t||(Gt.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:s}),this._t=!0),s}getFlagVariants(){var e=this._instance.get_property(yo),n=this._instance.get_property(Gi);if(!n)return e||{};for(var r=qe({},e),s=Object.keys(n),i=0;i<s.length;i++)r[s[i]]=n[s[i]];return this._t||(Gt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this._t=!0),r}getFlagPayloads(){var e=this._instance.get_property(Gb),n=this._instance.get_property(Ja);if(!n)return e||{};for(var r=qe({},e||{}),s=Object.keys(n),i=0;i<s.length;i++)r[s[i]]=n[s[i]];return this._t||(Gt.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:r}),this._t=!0),r}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Pt||(this._instance.Tt.emit("featureFlagsReloading",!0),this.Pt=setTimeout(()=>{this.It()},5))}Ct(){clearTimeout(this.Pt),this.Pt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Pt||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.wt=e}It(e){var n;if(this.Ct(),!this._instance.Rt())if(this.yt)this.xt=!0;else{var r=this._instance.config.token,s=this._instance.get_property("$device_id"),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:K({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Fl)||{}),group_properties:this._instance.get_property(si),timezone:ej()};Bn(s)||G(s)||(i.$device_id=s),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.kt()&&(i.evaluation_contexts=this.St());var o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+o);this.yt=!0,this._instance._send_request({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:or.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d,f=!0;if(l.statusCode===200&&(this.xt||(this.$anon_distinct_id=void 0),f=!1),this.yt=!1,!i.disable_flags||this.xt){this.$t=!f;var p=[];l.error?l.error instanceof Error?p.push(l.error.name==="AbortError"?Xz:Jz):p.push(Zz):l.statusCode!==200&&p.push(eB(l.statusCode)),(c=l.json)!=null&&c.errorsWhileComputingFlags&&p.push(qz);var m=!((u=l.json)==null||(u=u.quotaLimited)==null||!u.includes(nB.FeatureFlags));if(m&&p.push(Qz),(d=this._instance.persistence)==null||d.register({[Ev]:p}),m)Gt.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var v;i.disable_flags||this.receivedFeatureFlags((v=l.json)!==null&&v!==void 0?v:{},f),this.xt&&(this.xt=!1,this.It())}}}})}}getFeatureFlag(e,n){var r;if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var s=this.getFeatureFlagResult(e,n);return(r=s?.variant)!==null&&r!==void 0?r:s?.enabled}Gt.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var n=this.getFeatureFlagResult(e,{send_event:!1});return n?.payload}getFeatureFlagResult(e,n){if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),s=e in r,i=r[e],o=this.getFlagPayloads()[e],a=String(i),l=this._instance.get_property(qb)||void 0,c=this._instance.get_property(Yb)||void 0,u=this._instance.get_property(Nh)||{};if((n.send_event||!("send_event"in n))&&(!(e in u)||!u[e].includes(a))){var d,f,p,m,v,w,y,_,x,E;me(u[e])?u[e].push(a):u[e]=[a],(d=this._instance.persistence)==null||d.register({[Nh]:u});var b=this.getFeatureFlagDetails(e),S=[...(f=this._instance.get_property(Ev))!==null&&f!==void 0?f:[]];G(i)&&S.push(Yz);var T={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:o||null,$feature_flag_request_id:l,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((p=this._instance.config.bootstrap)==null||(p=p.featureFlags)==null?void 0:p[e])||null,$feature_flag_bootstrapped_payload:((m=this._instance.config.bootstrap)==null||(m=m.featureFlagPayloads)==null?void 0:m[e])||null,$used_bootstrap_value:!this.$t};G(b==null||(v=b.metadata)==null?void 0:v.version)||(T.$feature_flag_version=b.metadata.version);var P,I=(w=b==null||(y=b.reason)==null?void 0:y.description)!==null&&w!==void 0?w:b==null||(_=b.reason)==null?void 0:_.code;I&&(T.$feature_flag_reason=I),b!=null&&(x=b.metadata)!=null&&x.id&&(T.$feature_flag_id=b.metadata.id),G(b?.original_variant)&&G(b?.original_enabled)||(T.$feature_flag_original_response=G(b.original_variant)?b.original_enabled:b.original_variant),b!=null&&(E=b.metadata)!=null&&E.original_payload&&(T.$feature_flag_original_payload=b==null||(P=b.metadata)==null?void 0:P.original_payload),S.length&&(T.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",T)}if(s){var k=o;if(!G(o))try{k=JSON.parse(o)}catch{}return{key:e,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:k}}}else Gt.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,n){var r=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:r};this.kt()&&(s.evaluation_contexts=this.St()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this._instance.config.disable_compression?void 0:or.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var o,a=(o=i.json)==null?void 0:o.featureFlagPayloads;n(a?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return G(r)?void 0:!!r}Gt.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==e)}receivedFeatureFlags(e,n){if(this._instance.persistence){this.bt=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(o,a,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=tB(o),f=d.flags,p=d.featureFlags,m=d.featureFlagPayloads;if(p){var v=o.requestId,w=o.evaluatedAt;if(me(p)){Gt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var y={};if(p)for(var _=0;_<p.length;_++)y[p[_]]=!0;a&&a.register({[ag]:p,[yo]:y})}else{var x=p,E=m,b=f;if(o.errorsWhileComputingFlags)if(f){var S=new Set(Object.keys(f).filter(T=>{var P;return!((P=f[T])!=null&&P.failed)}));x=K({},l,Object.fromEntries(Object.entries(x).filter(T=>{var[P]=T;return S.has(P)}))),E=K({},c,Object.fromEntries(Object.entries(E||{}).filter(T=>{var[P]=T;return S.has(P)}))),b=K({},u,Object.fromEntries(Object.entries(b||{}).filter(T=>{var[P]=T;return S.has(P)})))}else x=K({},l,x),E=K({},c,E),b=K({},u,b);a&&a.register(K({[ag]:Object.keys(Qb(x)),[yo]:x||{},[Gb]:E||{},[xv]:b||{}},v?{[qb]:v}:{},w?{[Yb]:w}:{}))}}})(e,this._instance.persistence,r,s,i),this.Ft(n)}}override(e,n){n===void 0&&(n=!1),Gt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Gt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Gi),this._instance.persistence.unregister(Ja),this.Ft(),Xa.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this._t=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Gi),Xa.info("Flag overrides cleared");else if(r.flags){if(me(r.flags)){for(var s={},i=0;i<r.flags.length;i++)s[r.flags[i]]=!0;this._instance.persistence.register({[Gi]:s})}else this._instance.persistence.register({[Gi]:r.flags});Xa.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Ja),Xa.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Ja]:r.payloads}),Xa.info("Payload overrides set",{payloads:r.payloads}))),void this.Ft()}this.Ft()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.bt){var{flags:n,flagVariants:r}=this.Ot();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var s,i=(this._instance.get_property($l)||[]).find(c=>c.flagKey===e),o={["$feature_enrollment/"+e]:n},a={$feature_flag:e,$feature_enrollment:n,$set:o};i&&(a.$early_access_feature_name=i.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=K({},this.getFlagVariants(),{[e]:n});(s=this._instance.persistence)==null||s.register({[ag]:Object.keys(Qb(l)),[yo]:l}),this.Ft()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var s=this._instance.get_property($l),i=r?"&"+r.map(o=>"stage="+o).join("&"):"";if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+i),method:"GET",callback:o=>{var a,l;if(o.json){var c=o.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister($l),(l=this._instance.persistence)==null||l.register({[$l]:c}),e(c)}}})}Ot(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,s)=>(r[s]=n[s],r),{})}}Ft(e){var{flags:n,flagVariants:r}=this.Ot();this.featureFlagEventHandlers.forEach(s=>s(n,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(Fl)||{};this._instance.register({[Fl]:K({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Fl)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(si)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(s=>{r[s]=K({},r[s],e[s]),delete e[s]}),this._instance.register({[si]:K({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(si)||{};this._instance.register({[si]:K({},n,{[e]:{}})})}else this._instance.unregister(si)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Ct(),this._t=!1}}var sB=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class lg{constructor(e,n){this.N=e,this.props={},this.Mt=!1,this.At=(r=>{var s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(e),this.B=this.jt(e),this.load(),e.debug&&q.info("Persistence loaded",e.persistence,K({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.Dt}jt(e){sB.indexOf(e.persistence.toLowerCase())===-1&&(q.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=function(s){s===void 0&&(s=[]);var i=[...Sz,...s];return K({},$e,{j:function(o){try{var a={};try{a=ir.j(o)||{}}catch{}var l=qe(a,JSON.parse($e.A(o)||"{}"));return $e.D(o,l),l}catch{}return null},D:function(o,a,l,c,u,d){try{$e.D(o,a,void 0,void 0,d);var f={};i.forEach(p=>{a[p]&&(f[p]=a[p])}),Object.keys(f).length&&ir.D(o,f,l,c,u,d)}catch(p){$e.M(p)}},L:function(o,a){try{O?.localStorage.removeItem(o),ir.L(o,a)}catch(l){$e.M(l)}}})}(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r==="localstorage"&&$e.O()?$e:r==="localstorage+cookie"&&n.O()?n:r==="sessionstorage"&&ut.O()?ut:r==="memory"?Tz:r==="cookie"?ir:n.O()?n:ir}properties(){var e={};return Te(this.props,function(n,r){if(r===yo&&tt(n))for(var s=Object.keys(n),i=0;i<s.length;i++)e["$feature/"+s[i]]=n[s[i]];else a=r,l=!1,(Bn(o=yz)?l:mb&&o.indexOf===mb?o.indexOf(a)!=-1:(Te(o,function(c){if(l||(l=c===a))return Ih}),l))||(e[r]=n);var o,a,l}),e}load(){if(!this.Dt){var e=this.B.j(this.At);e&&(this.props=qe({},e))}}save(){this.Dt||this.B.D(this.At,this.props,this.Lt,this.Nt,this.Ut,this.N.debug)}remove(){this.B.L(this.At,!1),this.B.L(this.At,!0)}clear(){this.remove(),this.props={}}register_once(e,n,r){if(tt(e)){G(n)&&(n="None"),this.Lt=G(r)?this.zt:r;var s=!1;if(Te(e,(i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=i,s=!0)}),s)return this.save(),!0}return!1}register(e,n){if(tt(e)){this.Lt=G(n)?this.zt:n;var r=!1;if(Te(e,(s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.props[i]=s,r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Mt){var e=qR(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);vo(V0(e))||this.register(e),this.Mt=!0}}update_search_keyword(){var e;this.register((e=W?.referrer)?QR(e):{})}update_referrer_info(){var e;this.register_once({$referrer:XR(),$referring_domain:W!=null&&W.referrer&&((e=Fh(W.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Pv]||this.props[Cv]||this.register_once({[Dh]:JR(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Te([Cv,Pv],o=>{var a=this.props[o];a&&Te(a,function(l,c){e["$initial_"+hv(c)]=l})});var n,r,s=this.props[Dh];if(s){var i=(n=ZR(s),r={},Te(n,function(o,a){r["$initial_"+hv(a)]=o}),r);qe(e,i)}return e}safe_merge(e){return Te(this.props,function(n,r){r in e||(e[r]=n)}),e}update_config(e,n,r){if(this.zt=this.Lt=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence||!((o,a)=>{if(o.length!==a.length)return!1;var l=[...o].sort(),c=[...a].sort();return l.every((u,d)=>u===c[d])})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var s=this.jt(e),i=this.props;this.clear(),this.B=s,this.props=i,this.save()}}set_disabled(e){this.Dt=e,this.Dt?this.remove():this.save()}set_cross_subdomain(e){e!==this.Nt&&(this.Nt=e,this.remove(),this.save())}set_secure(e){e!==this.Ut&&(this.Ut=e,this.remove(),this.save())}set_event_timer(e,n){var r=this.props[Ml]||{};r[e]=n,this.props[Ml]=r,this.save()}remove_event_timer(e){var n=(this.props[Ml]||{})[e];return G(n)||(delete this.props[Ml][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}}var no=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({});(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({});(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({});(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({});var Bd=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({});(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({});(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({});(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({});var _o=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Hd=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Wh=function(t){return t.Popover="popover",t.Inline="inline",t}({}),be=ze("[Surveys]"),tj="seenSurvey_",iB=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},Xb=t=>((e,n)=>{var r=""+e+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+e+n.id+"_"+n.current_iteration),r})(tj,t),oB=[Bd.Popover,Bd.Widget,Bd.API],aB={ignoreConditions:!1,ignoreDelay:!1,displayType:Wh.Popover};class B0{constructor(){this.Ht={},this.Ht={}}on(e,n){return this.Ht[e]||(this.Ht[e]=[]),this.Ht[e].push(n),()=>{this.Ht[e]=this.Ht[e].filter(r=>r!==n)}}emit(e,n){for(var r of this.Ht[e]||[])r(n);for(var s of this.Ht["*"]||[])s(e,n)}}function qi(t,e,n){if(he(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class lB{constructor(e){this.Bt=new B0,this.qt=(n,r)=>this.Wt(n,r)&&this.Gt(n,r)&&this.Vt(n,r)&&this.Jt(n,r),this.Wt=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=e,this.Kt=new Set,this.Yt=new Set}init(){var e;if(!G((e=this._instance)==null?void 0:e._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook((r,s)=>{this.on(r,s)})}}register(e){var n,r;if(!G((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach(o=>{var a,l;(a=this.Yt)==null||a.add(o),(l=o.steps)==null||l.forEach(c=>{var u;(u=this.Kt)==null||u.add(c?.event||"")})}),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach(o=>{var a;(a=o.steps)==null||a.forEach(l=>{l!=null&&l.selector&&i.add(l?.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Kt.has(e)||this.Kt.has(n?.event))&&this.Yt&&((r=this.Yt)==null?void 0:r.size)>0&&this.Yt.forEach(s=>{this.Xt(n,s)&&this.Bt.emit("actionCaptured",s.name)})}Qt(e){this.onAction("actionCaptured",n=>e(n))}Xt(e,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.qt(e,r))return!0;return!1}onAction(e,n){return this.Bt.on(e,n)}Gt(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!qi(s,n.url,n.url_matching||"contains"))return!1}return!0}Vt(e,n){return!!this.Zt(e,n)&&!!this.ti(e,n)&&!!this.ii(e,n)}Zt(e,n){var r;if(n==null||!n.href)return!0;var s=this.ei(e);if(s.length>0)return s.some(a=>qi(a.href,n.href,n.href_matching||"exact"));var i,o=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!o&&qi((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}ti(e,n){var r;if(n==null||!n.text)return!0;var s=this.ei(e);if(s.length>0)return s.some(c=>qi(c.text,n.text,n.text_matching||"exact")||qi(c.$el_text,n.text,n.text_matching||"exact"));var i,o,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(i=function(c){for(var u,d=[],f=/(?::|")text="(.*?)"/g;!he(u=f.exec(c));)d.includes(u[1])||d.push(u[1]);return d}(l),o=n.text,a=n.text_matching||"exact",i.some(c=>qi(c,o,a)))}ii(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}ei(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Jt(e,n){return n==null||!n.properties||n.properties.length===0||GR(n.properties.reduce((r,s)=>{var i=me(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r},{}),e?.properties)}}class cB{constructor(e){this._instance=e,this.ri=new Map,this.si=new Map,this.ni=new Map}oi(e,n){return!!e&&GR(e.propertyFilters,n?.properties)}ai(e,n){var r=new Map;return e.forEach(s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(s.id),r.set(o.name,a)}})}),r}li(e,n,r){var s=(r===no.Activation?this.ri:this.si).get(e),i=[];return this.ui(o=>{i=o.filter(a=>s?.includes(a.id))}),i.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(c=>c.name===e);return this.oi(l,n)})}register(e){var n;G((n=this._instance)==null?void 0:n._addCaptureHook)||(this.hi(e),this.di(e))}di(e){var n=e.filter(r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0});n.length!==0&&(this.vi==null&&(this.vi=new lB(this._instance),this.vi.init(),this.vi.Qt(r=>{this.onAction(r)})),n.forEach(r=>{var s,i,o,a,l;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.vi)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.ni.get(c.name);u&&u.push(r.id),this.ni.set(c.name,u||[r.id])}}))}))}hi(e){var n,r=e.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.events)&&((a=i.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0}),s=e.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((a=i.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0});(r.length!==0||s.length!==0)&&((n=this._instance)==null||n._addCaptureHook((i,o)=>{this.onEvent(i,o)}),this.ri=this.ai(e,no.Activation),this.si=this.ai(e,no.Cancellation))}onEvent(e,n){var r,s=this.ci(),i=this.fi(),o=this.pi(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[i])||[];if(o===e&&n&&a.length>0){var l,c;s.info("event matched, removing item from activated items",{event:e,eventPayload:n,existingActivatedItems:a});var u=(n==null||(l=n.properties)==null?void 0:l.$survey_id)||(n==null||(c=n.properties)==null?void 0:c.$product_tour_id);if(u){var d=a.indexOf(u);d>=0&&(a.splice(d,1),this.gi(a))}}else{if(this.si.has(e)){var f=this.li(e,n,no.Cancellation);f.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:f.map(m=>m.id)}),f.forEach(m=>{var v=a.indexOf(m.id);v>=0&&a.splice(v,1),this.mi(m.id)}),this.gi(a))}if(this.ri.has(e)){s.info("event name matched",{event:e,eventPayload:n,items:this.ri.get(e)});var p=this.li(e,n,no.Activation);this.gi(a.concat(p.map(m=>m.id)||[]))}}}onAction(e){var n,r=this.fi(),s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ni.has(e)&&this.gi(s.concat(this.ni.get(e)||[]))}gi(e){var n,r=this.ci(),s=this.fi(),i=[...new Set(e)].filter(o=>!this.bi(o));r.info("updating activated items",{activatedItems:i}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[s]:i})}getActivatedIds(){var e,n=this.fi(),r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r||[]}getEventToItemsMap(){return this.ri}yi(){return this.vi}}class uB extends cB{constructor(e){super(e)}fi(){return"$surveys_activated"}pi(){return _o.SHOWN}ui(e){var n;(n=this._instance)==null||n.getSurveys(e)}mi(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}ci(){return be}bi(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class dB{constructor(e){this.wi=void 0,this._surveyManager=null,this.xi=!1,this.$i=[],this.Ei=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(he(n))return be.warn("Flags not loaded yet. Not loading surveys.");var r=me(n);this.wi=r?n.length>0:n,be.info("flags response received, isSurveysEnabled: "+this.wi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(tj)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(s=>localStorage.removeItem(s))}loadIfEnabled(){if(!this._surveyManager)if(this.xi)be.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)be.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())be.info("Not loading surveys in cookieless mode without consent.");else{var e=ee?.__PosthogExtensions__;if(e){if(!G(this.wi)||this._instance.config.advanced_enable_surveys){var n=this.wi||this._instance.config.advanced_enable_surveys;this.xi=!0;try{var r=e.generateSurveys;if(r)return void this.Si(r,n);var s=e.loadExternalDependency;if(!s)return void this.ki("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.ki("Could not load surveys script",i):this.Si(e.generateSurveys,n)})}catch(i){throw this.ki("Error initializing surveys",i),i}finally{this.xi=!1}}}else be.error("PostHog Extensions not found.")}}Si(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new uB(this._instance),be.info("Surveys loaded successfully"),this.Pi({isLoaded:!0})}ki(e,n){be.error(e,n),this.Pi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$i.push(e),this._surveyManager&&this.Pi({isLoaded:!0}),()=>{this.$i=this.$i.filter(n=>n!==e)}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return be.info("Disabled. Not loading surveys."),e([]);var r,s=this._instance.get_property(bv);if(s&&!n)return e(s,{isLoaded:!0});typeof Promise<"u"&&this.Ei?this.Ei.then(i=>{var{surveys:o,context:a}=i;return e(o,a)}):(typeof Promise<"u"&&(this.Ei=new Promise(i=>{r=i})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var o;this.Ei=null;var a=i.statusCode;if(a!==200||!i.json){var l="Surveys API could not be loaded, status: "+a;be.error(l);var c={isLoaded:!1,error:l};return e([],c),void(r==null||r({surveys:[],context:c}))}var u,d=i.json.surveys||[],f=d.filter(m=>function(v){return!(!v.start_date||v.end_date)}(m)&&(function(v){var w;return!((w=v.conditions)==null||(w=w.events)==null||(w=w.values)==null||!w.length)}(m)||function(v){var w;return!((w=v.conditions)==null||(w=w.actions)==null||(w=w.values)==null||!w.length)}(m)));f.length>0&&((u=this._surveyEventReceiver)==null||u.register(f)),(o=this._instance.persistence)==null||o.register({[bv]:d});var p={isLoaded:!0};e(d,p),r?.({surveys:d,context:p})}}))}Pi(e){for(var n of this.$i)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){be.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!he(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);be.warn("init was not called")}Ti(e){var n=null;return this.getSurveys(r=>{var s;n=(s=r.find(i=>i.id===e))!==null&&s!==void 0?s:null}),n}Ii(e){if(he(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.Ti(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(he(this._surveyManager))return be.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.Ii(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return he(this._surveyManager)?(be.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(r=>{this.getSurveys(s=>{var i,o=(i=s.find(l=>l.id===e))!==null&&i!==void 0?i:null;if(o){var a=this.Ii(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n,r){var s;if(he(this._surveyManager))be.warn("init was not called");else{var i=typeof e=="string"?this.Ti(e):e;if(i!=null&&i.id)if(oB.includes(i.type)){var o=W?.querySelector(n);if(o)return(s=i.appearance)!=null&&s.surveyPopupDelaySeconds?(be.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,l;be.info("Rendering survey "+i.id+" with delay of "+((a=i.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(i,o,r),be.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o,r);be.warn("Survey element not found")}else be.warn("Surveys of type "+i.type+" cannot be rendered in the app");else be.warn("Survey not found")}}displaySurvey(e,n){var r;if(he(this._surveyManager))be.warn("init was not called");else{var s=this.Ti(e);if(s){var i=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=K({},s,{appearance:K({},s.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==Wh.Popover&&n.initialResponses&&be.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.canRenderSurvey(s);if(!o.visible)return void be.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==Wh.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else be.warn("Survey not found")}}cancelPendingSurvey(e){he(this._surveyManager)?be.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}var ln=ze("[Conversations]");class hB{constructor(e){this.Ci=void 0,this._conversationsManager=null,this.Ri=!1,this.Fi=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var n=e.conversations;he(n)||(Vr(n)?this.Ci=n:(this.Ci=n.enabled,this.Fi=n),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ci=void 0,this.Fi=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ri||this._instance.config.disable_conversations||IR(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=ee?.__PosthogExtensions__;if(e&&!G(this.Ci)&&this.Ci)if(this.Fi&&this.Fi.token){this.Ri=!0;try{var n=e.initConversations;if(n)return this.Oi(n),void(this.Ri=!1);var r=e.loadExternalDependency;if(!r)return void this.Mi("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",s=>{s||!e.initConversations?this.Mi("Could not load conversations script",s):this.Oi(e.initConversations),this.Ri=!1})}catch(s){this.Mi("Error initializing conversations",s),this.Ri=!1}}else ln.error("Conversations enabled but missing token in remote config.")}}Oi(e){if(this.Fi)try{this._conversationsManager=e(this.Fi,this._instance),ln.info("Conversations loaded successfully")}catch(n){this.Mi("Error completing conversations initialization",n)}else ln.error("Cannot complete initialization: remote config is null")}Mi(e,n){ln.error(e,n),this._conversationsManager=null,this.Ri=!1}show(){this._conversationsManager?this._conversationsManager.show():ln.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ci===!0&&!Bn(this._conversationsManager)}isVisible(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&e!==void 0&&e}sendMessage(e,n,r){var s=this;return Or(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,n,r):(ln.warn("Conversations not available yet."),null)})()}getMessages(e,n){var r=this;return Or(function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,n):(ln.warn("Conversations not available yet."),null)})()}markAsRead(e){var n=this;return Or(function*(){return n._conversationsManager?n._conversationsManager.markAsRead(e):(ln.warn("Conversations not available yet."),null)})()}getTickets(e){var n=this;return Or(function*(){return n._conversationsManager?n._conversationsManager.getTickets(e):(ln.warn("Conversations not available yet."),null)})()}requestRestoreLink(e){var n=this;return Or(function*(){return n._conversationsManager?n._conversationsManager.requestRestoreLink(e):(ln.warn("Conversations not available yet."),null)})()}restoreFromToken(e){var n=this;return Or(function*(){return n._conversationsManager?n._conversationsManager.restoreFromToken(e):(ln.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var e=this;return Or(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ln.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&e!==void 0?e:null}}class fB{constructor(e){var n;this.Ai=!1,this.ji=!1,this._instance=e,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.Ai=!0)}onRemoteConfig(e){var n,r=(n=e.logs)==null?void 0:n.captureConsoleLogs;!he(r)&&r&&(this.Ai=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ai&&!this.ji){var e=ze("[logs]"),n=ee?.__PosthogExtensions__;if(n){var r=n.loadExternalDependency;r?r(this._instance,"logs",s=>{var i;s||(i=n.logs)==null||!i.initializeLogs?e.error("Could not load logs script",s):(n.logs.initializeLogs(this._instance),this.ji=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var Jb=ze("[RateLimiter]");class pB{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(s=>{Jb.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void Jb.warn('could not rate limit - continuing. Error: "'+s?.message+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:o}=this,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Tv))!==null&&n!==void 0?n:{tokens:i,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>i&&(l.tokens=i);var c=l.tokens<1;return c||e||(l.tokens=Math.max(0,l.tokens-1)),!c||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=c,(s=this.instance.persistence)==null||s.set_property(Tv,l),{isRateLimited:c,remainingTokens:l.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Za=ze("[RemoteConfig]");class nj{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=ee._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Di(e){var n,r;(n=ee.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=ee.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Li(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return Za.info("Using preloaded remote config",this.remoteConfig),this.Ni(this.remoteConfig),void this.Ui();if(this._instance.Rt())return void Za.warn("Remote config is disabled. Falling back to local config.");this.Di(e=>{if(!e)return Za.info("No config found after loading remote JS config. Falling back to JSON."),void this.Li(n=>{this.Ni(n),this.Ui()});this.Ni(e),this.Ui()})}catch(e){Za.error("Error loading remote config",e)}}stop(){this.zi&&(clearInterval(this.zi),this.zi=void 0)}refresh(){this._instance.Rt()||W?.visibilityState==="hidden"||this._instance.featureFlags.reloadFeatureFlags()}Ui(){this.zi||(this.zi=setInterval(()=>{this.refresh()},3e5))}Ni(e){e||Za.error("Failed to fetch remote config from PostHog."),this._instance.Ni(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}var Av=3e3;class gB{constructor(e,n){this.Hi=!0,this.Bi=[],this.qi=cr(n?.flush_interval_ms||Av,250,5e3,q.createLogger("flush interval"),Av),this.Wi=e}enqueue(e){this.Bi.push(e),this.Gi||this.Vi()}unload(){this.Ji();var e=this.Bi.length>0?this.Ki():{},n=Object.values(e);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Wi(K({},r,{transport:"sendBeacon"}))})}enable(){this.Hi=!1,this.Vi()}Vi(){var e=this;this.Hi||(this.Gi=setTimeout(()=>{if(this.Ji(),this.Bi.length>0){var n=this.Ki(),r=function(){var i=n[s],o=new Date().getTime();i.data&&me(i.data)&&Te(i.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),e.Wi(i)};for(var s in n)r()}},this.qi))}Ji(){clearTimeout(this.Gi),this.Gi=void 0}Ki(){var e={};return Te(this.Bi,n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;G(e[i])&&(e[i]=K({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)}),this.Bi=[],e}}var mB=["retriesPerformedSoFar"];class vB{constructor(e){this.Yi=!1,this.Xi=3e3,this.Bi=[],this._instance=e,this.Bi=[],this.Qi=!0,!G(O)&&"onLine"in O.navigator&&(this.Qi=O.navigator.onLine,this.Zi=()=>{this.Qi=!0,this.te()},this.ie=()=>{this.Qi=!1},Je(O,"online",this.Zi),Je(O,"offline",this.ie))}get length(){return this.Bi.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=cR(e,mB);to(n)&&(r.url=Bh(r.url,{retry_count:n})),this._instance._send_request(K({},r,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(n??0)<10?this.ee(K({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(s)}}))}ee(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)}(n),s=Date.now()+r;this.Bi.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),q.warn(i),this.Yi||(this.Yi=!0,this.re())}re(){if(this.se&&clearTimeout(this.se),this.Bi.length===0)return this.Yi=!1,void(this.se=void 0);this.se=setTimeout(()=>{this.Qi&&this.Bi.length>0&&this.te(),this.re()},this.Xi)}te(){var e=Date.now(),n=[],r=this.Bi.filter(i=>i.retryAt<e||(n.push(i),!1));if(this.Bi=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.se&&(clearTimeout(this.se),this.se=void 0),this.Yi=!1,G(O)||(this.Zi&&(O.removeEventListener("online",this.Zi),this.Zi=void 0),this.ie&&(O.removeEventListener("offline",this.ie),this.ie=void 0)),this.Bi))try{this._instance._send_request(K({},e,{transport:"sendBeacon"}))}catch(n){q.error(n)}this.Bi=[]}}class yB{constructor(e){this.ne=()=>{var n,r,s,i;this.oe||(this.oe={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=a+(o?.clientHeight||0),u=o?.scrollHeight||0;this.oe.lastScrollY=Math.ceil(a),this.oe.maxScrollY=Math.max(a,(n=this.oe.maxScrollY)!==null&&n!==void 0?n:0),this.oe.maxScrollHeight=Math.max(l,(r=this.oe.maxScrollHeight)!==null&&r!==void 0?r:0),this.oe.lastContentY=c,this.oe.maxContentY=Math.max(c,(s=this.oe.maxContentY)!==null&&s!==void 0?s:0),this.oe.maxContentHeight=Math.max(u,(i=this.oe.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}getContext(){return this.oe}resetContext(){var e=this.oe;return setTimeout(this.ne,0),e}startMeasuringScrollPosition(){Je(O,"scroll",this.ne,{capture:!0}),Je(O,"scrollend",this.ne,{capture:!0}),Je(O,"resize",this.ne)}scrollElement(){if(!this._instance.config.scroll_root_selector)return O?.document.documentElement;var e=me(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=O?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return O&&(O.scrollY||O.pageYOffset||O.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return O&&(O.scrollX||O.pageXOffset||O.document.documentElement.scrollLeft)||0}}var _B=t=>JR(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties);class Zb{constructor(e,n,r,s){this.ae=i=>{var o=this.le();if(!o||o.sessionId!==i){var a={sessionId:i,props:this.ue(this._instance)};this.he.register({[Sv]:a})}},this._instance=e,this.de=n,this.he=r,this.ue=s||_B,this.de.onSessionId(this.ae)}le(){return this.he.props[Sv]}getSetOnceProps(){var e,n=(e=this.le())==null?void 0:e.props;return n?"r"in n?ZR(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return Te(V0(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+hv(r)]=n}),e}}var cg=ze("[SessionId]");class e1{on(e,n){return this.ve.on(e,n)}constructor(e,n,r){var s;if(this.ce=[],this.fe=void 0,this.ve=new B0,this.pe=(u,d)=>!(!to(u)||!to(d))&&Math.abs(u-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=e.config,this.he=e.persistence,this._e=void 0,this.ge=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.me=n||Ss,this.be=r||Ss;var i=this.N.persistence_name||this.N.token,o=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*cr(o,60,36e3,cg.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ye(),this.we="ph_"+i+"_window_id",this.xe="ph_"+i+"_primary_window_exists",this.$e()){var a=ut.j(this.we),l=ut.j(this.xe);a&&!l?this._e=a:ut.L(this.we),ut.D(this.xe,!0)}if((s=this.N.bootstrap)!=null&&s.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.N.bootstrap.sessionID);this.Ee(this.N.bootstrap.sessionID,new Date().getTime(),c)}catch(u){cg.error("Invalid sessionID in bootstrap",u)}this.Se()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return G(this.ce)&&(this.ce=[]),this.ce.push(e),this.ge&&e(this.ge,this._e),()=>{this.ce=this.ce.filter(n=>n!==e)}}$e(){return this.N.persistence!=="memory"&&!this.he.Dt&&ut.O()}ke(e){e!==this._e&&(this._e=e,this.$e()&&ut.D(this.we,e))}Pe(){return this._e?this._e:this.$e()?ut.j(this.we):null}Ee(e,n,r){e===this.ge&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.ge=e,this.he.register({[Lh]:[n,e,r]}))}Te(){var e=this.he.props[Lh];return me(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ee(null,null,null)}destroy(){clearTimeout(this.Ie),this.Ie=void 0,this.fe&&O&&(O.removeEventListener("beforeunload",this.fe,{capture:!1}),this.fe=void 0),this.ce=[]}Se(){this.fe=()=>{this.$e()&&ut.L(this.xe)},Je(O,"beforeunload",this.fe,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[s,i,o]=this.Te(),a=this.Pe(),l=to(o)&&Math.abs(r-o)>864e5,c=!1,u=!i,d=!u&&!e&&this.pe(r,s);u||d||l?(i=this.me(),a=this.be(),cg.info("new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),o=r,c=!0):a||(a=this.be(),c=!0);var f=to(s)&&e&&!l?s:r,p=to(o)?o:new Date().getTime();return this.ke(a),this.Ee(i,f,p),e||this.ye(),c&&this.ce.forEach(m=>m(i,a,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:i,windowId:a,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}ye(){clearTimeout(this.Ie),this.Ie=setTimeout(()=>{var[e]=this.Te();if(this.pe(new Date().getTime(),e)){var n=this.ge;this.resetSessionId(),this.ve.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var rj=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&_b(n,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>_b(s?.brand,e)))return!0}catch{}return!!t.webdriver},Ul=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),t1="i.posthog.com";class wB{constructor(e){this.Ce={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+t1,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Ce[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ce[this.apiHost]=Ul.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ce[this.apiHost]=Ul.EU:this.Ce[this.apiHost]=Ul.CUSTOM),this.Ce[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Ul.CUSTOM)return this.apiHost+n;var r=t1+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var xB={icontains:(t,e)=>!!O&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!O&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!O&&Hh(e.href,t),not_regex:(t,e)=>!!O&&!Hh(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class wt{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(s=>{wt.Re("retrieved web experiments from the server"),n.Fe=new Map,s.forEach(i=>{if(i.feature_flag_key){var o;n.Fe&&(wt.Re("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.Fe)==null||o.set(i.feature_flag_key,i));var a=n._instance.getFeatureFlag(i.feature_flag_key);Ze(a)&&i.variants[a]&&n.Oe(i.name,a,i.variants[a].transforms)}else if(i.variants)for(var l in i.variants){var c=i.variants[l];wt.Me(c)&&n.Oe(i.name,l,c.transforms)}})},r)},this._instance=e,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(e){if(this._is_bot())wt.Re("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(he(this.Fe))return this.Fe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();wt.Re("applying feature flags",e),e.forEach(n=>{var r;if(this.Fe&&(r=this.Fe)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),o=(s=this.Fe)==null?void 0:s.get(n);i&&o!=null&&o.variants[i]&&this.Oe(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){var e=wt.getWindowLocation();if(e!=null&&e.search){var n=Vh(e?.search,"__experiment_id"),r=Vh(e?.search,"__experiment_variant");n&&r&&(wt.Re("previewing web experiments "+n+" && "+r),this.getWebExperiments(s=>{this.Ae(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return e([]);var o=i.json.experiments||[];return e(o)}})}Ae(e,n,r){var s=r.filter(i=>i.id===e);s&&s.length>0&&(wt.Re("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Oe(s[0].name,n,s[0].variants[n].transforms))}static Me(e){return!he(e.conditions)&&wt.je(e)&&wt.De(e)}static je(e){var n;if(he(e.conditions)||he((n=e.conditions)==null?void 0:n.url))return!0;var r,s,i,o=wt.getWindowLocation();return!!o&&((r=e.conditions)==null||!r.url||xB[(s=(i=e.conditions)==null?void 0:i.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,o))}static getWindowLocation(){return O?.location}static De(e){var n;if(he(e.conditions)||he((n=e.conditions)==null?void 0:n.utm))return!0;var r=qR();if(r.utm_source){var s,i,o,a,l,c,u,d,f=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,p=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,m=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==r.utm_medium,v=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return f&&m&&v&&p}return!1}static Re(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];q.info("[WebExperiments] "+e,r)}Oe(e,n,r){this._is_bot()?wt.Re("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(s=>{if(s.selector){var i;wt.Re("applying transform of variant "+n+" for experiment "+e+" ",s);var o=(i=document)==null?void 0:i.querySelectorAll(s.selector);o?.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):wt.Re("Control variants leave the page unmodified.")}_is_bot(){return en&&this._instance?rj(en,this._instance.config.custom_blocked_useragents):void 0}}var bB=ze("[PostHog ExternalIntegrations]"),EB={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class SB{constructor(e){this._instance=e}V(e,n){var r;(r=ee.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,s=>{if(s)return bB.error("failed to load script",s);n()})}startIfEnabledOrStop(){var e=this,n=function(o){var a,l,c;!s||(a=ee.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||e.V(EB[o],()=>{var u;(u=ee.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.start(e._instance)}),!s&&(l=ee.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((c=ee.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.stop())};for(var[r,s]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(r)}}}var ac={},ug=0,Ov=()=>{},ro="posthog",sj=!zz&&Mt?.indexOf("MSIE")===-1&&Mt?.indexOf("Mozilla")===-1,n1=t=>{var e;return K({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:vz(W?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ov,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:dt&&Ze(dt?.search)&&dt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(O==null||(e=O.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;q.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Av},error_tracking:{},_onCapture:Ov,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},r1=t=>{var e={};G(t.process_person)||(e.person_profiles=t.process_person),G(t.xhr_headers)||(e.request_headers=t.xhr_headers),G(t.cookie_name)||(e.persistence_name=t.cookie_name),G(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),G(t.store_google)||(e.save_campaign_params=t.store_google),G(t.verbose)||(e.debug=t.verbose);var n=qe({},e,t);return me(t.property_blacklist)&&(G(t.property_denylist)?n.property_denylist=t.property_blacklist:me(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:q.error("Invalid value for property_denylist config: "+t.property_denylist)),n};class TB{constructor(){this.__forceAllowLocalhost=!1}get Le(){return this.__forceAllowLocalhost}set Le(e){q.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ur{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new TB,this.Ne=!1,this.version=Ar.LIB_VERSION,this.Tt=new B0,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=n1(),this.SentryIntegration=jz,this.sentryIntegration=e=>function(n,r){var s=VR(n,r);return{name:FR,processEvent:i=>s(i)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ue=!1,this.ze=null,this.He=null,this.Be=null,this.featureFlags=new rB(this),this.toolbar=new Iz(this),this.scrollManager=new yB(this),this.pageViewManager=new Fb(this),this.surveys=new dB(this),this.conversations=new hB(this),this.logs=new fB(this),this.experiments=new wt(this),this.exceptions=new Bz(this),this.rateLimiter=new pB(this),this.requestRouter=new wB(this),this.consent=new Pz(this),this.externalIntegrations=new SB(this),this.people={set:(e,n,r)=>{var s=Ze(e)?{[e]:n}:e;this.setPersonProperties(s),r?.({})},set_once:(e,n,r)=>{var s=Ze(e)?{[e]:n}:e;this.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",e=>q.info('send "'+e?.event+'"',e))}init(e,n,r){if(r&&r!==ro){var s,i=(s=ac[r])!==null&&s!==void 0?s:new ur;return i._init(e,n,r),ac[r]=i,ac[ro][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s;if(n===void 0&&(n={}),G(e)||fv(e))return q.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.qe(n.debug),this.We=n,this.Ge=[],n.person_profiles?this.He=n.person_profiles:n.process_person&&(this.He=n.process_person),this.set_config(qe({},n1(n.defaults),r1(n),{name:r,token:e})),this.config.on_xhr_error&&q.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:or.GZipJS;var i=this.Ve();this.persistence=new lg(this.config,i),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new lg(K({},this.config,{persistence:"sessionStorage"}),i);var o=K({},this.persistence.props),a=K({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Je=new gB(_=>this.Ke(_),this.config.request_queue_config),this.Ye=new vB(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new e1(this),this.sessionPropsManager=new Zb(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(q.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Xe(l)},0)):(q.info("Initializing extensions synchronously"),this.Xe(l)),Ar.DEBUG=Ar.DEBUG||this.config.debug,Ar.DEBUG&&q.info("Starting in debug mode",{this:this,config:n,thisC:K({},this.config),p:o,s:a}),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var c,u,d=this.config.get_device_id(Ss()),f=(c=n.bootstrap)!=null&&c.isIdentifiedID?d:n.bootstrap.distinctID;this.persistence.set_property(er,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:f})}if(this.Qe()){var p,m,v=Object.keys(((p=n.bootstrap)==null?void 0:p.featureFlags)||{}).filter(_=>{var x;return!((x=n.bootstrap)==null||(x=x.featureFlags)==null||!x[_])}).reduce((_,x)=>{var E;return _[x]=((E=n.bootstrap)==null||(E=E.featureFlags)==null?void 0:E[x])||!1,_},{}),w=Object.keys(((m=n.bootstrap)==null?void 0:m.featureFlagPayloads)||{}).filter(_=>v[_]).reduce((_,x)=>{var E,b;return(E=n.bootstrap)!=null&&(E=E.featureFlagPayloads)!=null&&E[x]&&(_[x]=(b=n.bootstrap)==null||(b=b.featureFlagPayloads)==null?void 0:b[x]),_},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:w})}if(l)this.register_once({distinct_id:Ga,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(Ss());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(er,"anonymous")}return Je(O,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?Rz(this,()=>this.Ze()):this.Ze(),Mr(this.config._onCapture)&&this.config._onCapture!==Ov&&(q.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",_=>this.config._onCapture(_.event,_))),this.config.ip&&q.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Xe(e){var n=performance.now(),r=K({},ur.__defaultExtensionClasses,this.config.__extensionClasses);r.historyAutocapture&&(this.historyAutocapture=new r.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var s=[];r.tracingHeaders&&s.push(()=>{new r.tracingHeaders(this).startIfEnabledOrStop()}),r.siteApps&&s.push(()=>{var i;this.siteApps=new r.siteApps(this),(i=this.siteApps)==null||i.init()}),!e&&r.sessionRecording&&s.push(()=>{this.sessionRecording=new r.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&s.push(()=>{this.autocapture=new r.autocapture(this),this.autocapture.startIfEnabled()}),s.push(()=>{this.surveys.loadIfEnabled()}),s.push(()=>{this.logs.loadIfEnabled()}),s.push(()=>{this.conversations.loadIfEnabled()}),r.productTours&&s.push(()=>{this.productTours=new r.productTours(this),this.productTours.loadIfEnabled()}),r.heatmaps&&s.push(()=>{this.heatmaps=new r.heatmaps(this),this.heatmaps.startIfEnabled()}),r.webVitalsAutocapture&&s.push(()=>{this.webVitalsAutocapture=new r.webVitalsAutocapture(this)}),r.exceptionObserver&&s.push(()=>{this.exceptionObserver=new r.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()}),r.deadClicksAutocapture&&s.push(()=>{this.deadClicksAutocapture=new r.deadClicksAutocapture(this,kz),this.deadClicksAutocapture.startIfEnabledOrStop()}),s.push(()=>{if(this.tr){var i=this.tr;this.tr=void 0,this.Ni(i)}}),this.ir(s,n)}ir(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.ir(e,n)},0);var r=e.shift();if(r)try{r()}catch(i){q.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&q.info("PostHog extensions initialized ("+s+"ms)")}Ni(e){var n,r,s,i,o,a,l,c,u;if(!W||!W.body)return q.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ni(e)},500);this.config.__preview_deferred_init_extensions&&(this.tr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=ce(e.supportedCompression,or.GZipJS)?or.GZipJS:ce(e.supportedCompression,or.Base64)?or.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.He?this.He:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(s=this.sessionRecording)==null||s.onRemoteConfig(e),(i=this.autocapture)==null||i.onRemoteConfig(e),(o=this.heatmaps)==null||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(a=this.productTours)==null||a.onRemoteConfig(e),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(e),(c=this.exceptionObserver)==null||c.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Ze(){try{this.config.loaded(this)}catch(r){q.critical("`loaded` function failed",r)}if(this.er(),this.config.internal_or_test_user_hostname&&dt!=null&&dt.hostname){var e=dt.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.rr()},1),this.sr=new nj(this),this.sr.load()}er(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Je)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Ns(this.__request_queue,e=>this.Ke(e)),this.__request_queue=[],this.er()}_handle_unload(){var e,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.nr()&&this.capture("$pageleave"),(e=this.Je)==null||e.unload(),(n=this.Ye)==null||n.unload()):this.nr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(sj?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Bh(e.url,{ip:this.config.ip?1:0}),e.headers=K({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,o=K({},n);o.timeout=o.timeout||6e4,o.url=Bh(o.url,{_:new Date().getTime().toString(),ver:Ar.LIB_VERSION,compression:o.compression});var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=zd.filter(u=>!o.disableTransport||!u.transport||!o.disableTransport.includes(u.transport)),c=(s=(i=OR(l,u=>u.transport===a))==null?void 0:i.method)!==null&&s!==void 0?s:l[0].method;if(!c)throw new Error("No available transport method");c(o)})(K({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(s=this.config).on_request_error)==null||r.call(s,n)),e.callback==null||e.callback(n)}}))))}Ke(e){this.Ye?this.Ye.retriableRequest(e):this._send_request(e)}_execute_array(e){ug++;try{var n,r=[],s=[],i=[];Ns(e,a=>{a&&(n=a[0],me(n)?i.push(a):Mr(a)?a.call(this):me(a)&&n==="alias"?r.push(a):me(a)&&n.indexOf("capture")!==-1&&Mr(this[n])?i.push(a):s.push(a))});var o=function(a,l){Ns(a,function(c){if(me(c[0])){var u=l;Te(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};o(r,this),o(s,this),o(i,this)}finally{ug--}}Qe(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){if(ug>0&&me(e)&&Ze(e[0])){var n=ur.prototype[e[0]];Mr(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Je){if(this.is_capturing())if(!G(e)&&Ze(e)){var i=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(i&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!Ze(n?.$current_url)&&(q.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.ft||q.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=r?.timestamp||a,c=Ss(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&i&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),o&&(u.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r?.$set&&(u.$set=r?.$set);var d,f=e!=="$groupidentify",p=this.ar(r?.$set_once,f);if(p&&(u.$set_once=p),(u=gz(u,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,G(r?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a),e===_o.DISMISSED||e===_o.SENT){var m=n?.[Hd.SURVEY_ID],v=n?.[Hd.SURVEY_ITERATION];d={id:m,current_iteration:v},localStorage.getItem(Xb(d))||localStorage.setItem(Xb(d),"true"),u.$set=K({},u.$set,{[iB({id:m,current_iteration:v},e===_o.SENT?"responded":"dismissed")]:!0})}else e===_o.SHOWN&&(u.$set=K({},u.$set,{[Hd.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var w=K({},u.properties.$set,u.$set);if(vo(w)||this.setPersonPropertiesForFlags(w),!he(this.config.before_send)){var y=this.lr(u);if(!y)return;u=y}this.Tt.emit("eventCaptured",u);var _={method:"POST",url:(s=r?._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ke(_):this.Je.enqueue(_),u}q.critical("This capture call is ignored due to client rate limiting.")}}else q.error("No event name provided to posthog.capture")}else q.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=i?void 0:this.persistence.remove_event_timer(e),a=K({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=K({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Ze(a.distinct_id)&&!Gr(a.distinct_id)||fv(a.distinct_id))&&q.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=Gz(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime());a.$session_id=d,a.$window_id=f}this.sessionPropsManager&&qe(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&qe(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(p=this.Ye)==null?void 0:p.length}catch(y){a.$sdk_debug_error_capturing_properties=String(y)}if(this.requestRouter.region===Ul.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=qe(a,c),e==="$pageview"&&W&&(a.title=W.title),!G(o)){var m=r.getTime()-o;a.$duration=parseFloat((m/1e3).toFixed(3))}Mt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=qe({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),me(this.config.property_denylist)?Te(this.config.property_denylist,function(y){delete a[y]}):q.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var v=this.config.sanitize_properties;v&&(q.error("sanitize_properties is deprecated. Use before_send instead"),a=v(a,e));var w=this.ur();return a.$process_person_profile=w,w&&!i&&this.hr("_calculate_event_properties"),a}ar(e,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.ur()||this.Ne)return e;var s=this.persistence.get_initial_props(),i=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=qe({},s,i||{},e||{}),a=this.config.sanitize_properties;return a&&(q.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),n&&(this.Ne=!0),vo(o)?void 0:o}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}dr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){return this.featureFlags.getFeatureFlagResult(e,n)}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,n,r){var s=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},i=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},o=K({},s,e),a=K({},i,n),l={};for(var[c,u]of Object.entries(o)){var d=typeof u=="string";l[c]={key:c,enabled:!!d||!!u,variant:d?u:void 0,reason:void 0,metadata:G(a?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:a[c]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(e,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Tt.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=aB),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,r){if(!this.__loaded||!this.persistence)return q.uninitializedWarning("posthog.identify");if(Gr(e)&&(e=e.toString(),q.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))q.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Ga){if(this.hr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==s&&e!==this.get_property(Dl)&&(this.unregister(Dl),this.register({distinct_id:e}));var o=(this.persistence.get_property(er)||"anonymous")==="anonymous";e!==s&&o?(this.persistence.set_property(er,"identified"),this.setPersonPropertiesForFlags(K({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Be=Wb(e,n,r),this.featureFlags.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(Nh))}}else q.critical('The string "'+Ga+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else q.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.hr("posthog.setPersonProperties")){var r=Wb(this.get_distinct_id(),e,n);this.Be!==r?(this.setPersonPropertiesForFlags(K({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Be=r):q.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){var s=this.getGroups();s[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:K({},s,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),s[e]===n||r||this.reloadFeatureFlags()}else q.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.hr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,i,o;if(q.info("reset"),!this.__loaded)return q.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),(s=this.sr)==null||s.stop(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(er,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Be=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Ga,$device_id:null},"");else{var l=this.config.get_device_id(Ss());this.register_once({distinct_id:l,$device_id:e?l:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var i,o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return s}alias(e,n){return e===this.get_property(LR)?(q.critical("Attempting to create alias for existing People user - aborting."),-2):this.hr("posthog.alias")?(G(n)&&(n=this.get_distinct_id()),e!==n?(this.dr(Dl,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(q.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=K({},this.config);if(tt(e)){var r,s,i,o,a,l,c,u;qe(this.config,r1(e));var d=this.Ve();(r=this.persistence)==null||r.update_config(this.config,n,d),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new lg(K({},this.config,{persistence:"sessionStorage"}),d);var f=this.qe(this.config.debug);Vr(f)&&(this.config.debug=f),Vr(this.config.debug)&&(this.config.debug?(Ar.DEBUG=!0,$e.O()&&$e.D("ph_debug","true"),q.info("set_config",{config:e,oldConfig:n,newConfig:K({},this.config)})):(Ar.DEBUG=!1,$e.O()&&$e.L("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(c=this.deadClicksAutocapture)==null||c.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.vr(),(u=this.externalIntegrations)==null||u.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var s,i,o,a,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(K({},s,n))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:ro;return n!==ro&&(n=ro+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(er))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(er))==="identified"}ur(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&vo(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Dl])&&((n=this.persistence)==null||(n=n.props)==null||!n[Mh]))}nr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.ur()||this.hr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.hr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}hr(e){return this.config.person_profiles==="never"?(q.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.dr(Mh,!0),!0)}Ve(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}vr(){var e,n,r,s,i=this.Ve();return((e=this.persistence)==null?void 0:e.Dt)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.Dt)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,s,i,o,a;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new e1(this),this.pageViewManager=new Fb(this),this.persistence&&(this.sessionPropsManager=new Zb(this,this.sessionManager,this.persistence));var l=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(a=ur.__defaultExtensionClasses)==null?void 0:a.sessionRecording;l&&(this.sessionRecording=new l(this),this.sessionRecording.startIfEnabledOrStop())}var c;this.consent.optInOut(!0),this.vr(),this.er(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(G(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((c=e?.captureEventName)!==null&&c!==void 0?c:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.rr()}else q.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.vr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Ga,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.rr())):q.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Ir.GRANTED?"granted":e===Ir.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.vr()}_is_bot(){return en?rj(en,this.config.custom_blocked_useragents):void 0}rr(){W&&(W.visibilityState==="visible"?this.Ue||(this.Ue=!0,this.capture("$pageview",{title:W.title},{send_instantly:!0}),this.ze&&(W.removeEventListener("visibilitychange",this.ze),this.ze=null)):this.ze||(this.ze=this.rr.bind(this),Je(W,"visibilitychange",this.ze)))}debug(e){e===!1?(O?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(O?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Rt(){var e,n,r,s,i,o,a,l=this.We||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(q.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",s=!1,i=q,o=(n="advanced_disable_flags")in(e=l)&&!he(e[n]),a=r in e&&!he(e[r]),o?e[n]:a?(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):s)}lr(e){if(he(this.config.before_send))return e;var n=me(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var s of n){if(r=s(r),he(r)){var i="Event '"+e.event+"' was rejected in beforeSend function";return OU(e.event)?q.warn(i+". This can cause unexpected behavior."):q.info(i),null}r.properties&&!vo(r.properties)||q.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.it)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}qe(e){var n=Vr(e)&&!e,r=$e.O()&&$e.A("ph_debug")==="true";return!n&&(!!r||e)}}ur.__defaultExtensionClasses={},function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=pz(t.prototype[e[n]])}(ur,["identify"]);function s1(t){return t instanceof Element&&(t.id===MR||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function qf(t){return!!t&&t.nodeType===1}function Ds(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function ij(t){return!!t&&t.nodeType===3}function oj(t){return!!t&&t.nodeType===11}function H0(t){return t?Kf(t).split(/\s+/):[]}function i1(t){var e=O?.location.href;return!!(e&&t&&t.some(n=>e.match(n)))}function Kh(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return H0(e)}function aj(t){return he(t)?null:Kf(t).split(/(\s+)/).filter(e=>Gc(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Eu(t){var e="";return Iv(t)&&!dj(t)&&t.childNodes&&t.childNodes.length&&Te(t.childNodes,function(n){var r;ij(n)&&n.textContent&&(e+=(r=aj(n.textContent))!==null&&r!==void 0?r:"")}),Kf(e)}function o1(t){return G(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var W0=["a","button","form","input","select","textarea","label"];function lj(t,e){if(G(e))return!0;var n,r=function(i){if(e.some(o=>i.matches(o)))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function cj(t){var e=t.parentNode;return!(!e||!qf(e))&&e}var PB=["next","previous","prev",">","<"],a1=10,l1=[".ph-no-rageclick",".ph-no-capture"];function CB(t,e){if(!O||K0(t))return!1;var n,r,s;if(Vr(e)?(n=!!e&&l1,r=void 0):(n=(s=e?.css_selector_ignorelist)!==null&&s!==void 0?s:l1,r=e?.content_ignorelist),n===!1)return!1;var{targetElementList:i}=uj(t,!1);return!function(o,a){if(o===!1||G(o))return!1;var l;if(o===!0)l=PB;else{if(!me(o))return!1;if(o.length>a1)return q.error("[PostHog] content_ignorelist array cannot exceed "+a1+" items. Use css_selector_ignorelist for more complex matching."),!1;l=o.map(c=>c.toLowerCase())}return a.some(c=>{var{safeText:u,ariaLabel:d}=c;return l.some(f=>u.includes(f)||d.includes(f))})}(r,i.map(o=>{var a;return{safeText:Eu(o).toLowerCase(),ariaLabel:((a=o.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}}))&&!lj(i,n)}var K0=t=>!t||Ds(t,"html")||!qf(t),uj=(t,e)=>{if(!O||K0(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Ds(s,"body");)if(oj(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=cj(s);if(!i)break;if(e||W0.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var o=O.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function kB(t,e,n,r,s){var i,o,a,l;if(n===void 0&&(n=void 0),!O||K0(t)||(i=n)!=null&&i.url_allowlist&&!i1(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&i1(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some(m=>e.type===m))return!1}var{parentIsUsefulElement:u,targetElementList:d}=uj(t,r);if(!function(m,v){var w=v?.element_allowlist;if(G(w))return!0;var y,_=function(E){if(w.some(b=>E.tagName.toLowerCase()===b))return{v:!0}};for(var x of m)if(y=_(x))return y.v;return!1}(d,n)||!lj(d,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var f=O.getComputedStyle(t);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=t.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return u?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(W0.indexOf(p)>-1||t.getAttribute("contenteditable")==="true")}}function Iv(t){for(var e=t;e.parentNode&&!Ds(e,"body");e=e.parentNode){var n=Kh(e);if(ce(n,"ph-sensitive")||ce(n,"ph-no-capture"))return!1}if(ce(Kh(t),"ph-include"))return!0;var r=t.type||"";if(Ze(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=t.name||t.id||"";return!(Ze(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function dj(t){return!!(Ds(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Ds(t,"select")||Ds(t,"textarea")||t.getAttribute("contenteditable")==="true")}var hj="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",RB=new RegExp("^(?:"+hj+")$"),jB=new RegExp(hj),fj="\\d{3}-?\\d{2}-?\\d{4}",AB=new RegExp("^("+fj+")$"),OB=new RegExp("("+fj+")");function Gc(t,e){return e===void 0&&(e=!0),!(he(t)||Ze(t)&&(t=Kf(t),(e?RB:jB).test((t||"").replace(/[- ]/g,""))||(e?AB:OB).test(t)))}function pj(t){var e=Eu(t);return Gc(e=(e+" "+gj(t)).trim())?e:""}function gj(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Te(t.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Eu(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+gj(n)).trim())}catch(i){q.error("[AutoCapture]",i)}}),e}function IB(t){return function(e){var n=e.map(r=>{var s,i,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))o+="."+a.replace(/"/g,"");var l=K({},r.text?{text:r.text}:{},{"nth-child":(s=r.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(i=r.nth_of_type)!==null&&i!==void 0?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),c={};return Ud(l).sort((u,d)=>{var[f]=u,[p]=d;return f.localeCompare(p)}).forEach(u=>{var[d,f]=u;return c[c1(d.toString())]=c1(f.toString())}),o+=":",o+=Ud(c).map(u=>{var[d,f]=u;return d+'="'+f+'"'}).join("")});return n.join(";")}(function(e){return e.map(n=>{var r,s,i={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(s=n.attr__href)==null?void 0:s.slice(0,2048),attr_class:LB(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Ud(n).filter(o=>{var[a]=o;return a.indexOf("attr__")===0}).forEach(o=>{var[a,l]=o;return i.attributes[a]=l}),i})}(t))}function c1(t){return t.replace(/"|\\"/g,'\\"')}function LB(t){var e=t.attr__class;return e?me(e)?e:H0(e):void 0}class u1{constructor(e){this.disabled=e===!1;var n=tt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&r-s.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var dg="$copy_autocapture",d1=ze("[AutoCapture]");function hg(t,e){return e.length>t?e.slice(0,t)+"...":e}function NB(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!qf(e));return e}function DB(t,e,n,r){var s=t.tagName.toLowerCase(),i={tag_name:s};W0.indexOf(s)>-1&&!n&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?i.$el_text=hg(1024,pj(t)):i.$el_text=hg(1024,Eu(t)));var o=Kh(t);o.length>0&&(i.classes=o.filter(function(u){return u!==""})),Te(t.attributes,function(u){var d;if((!dj(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(r==null||!r.includes(u.name))&&!e&&Gc(u.value)&&(d=u.name,!Ze(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=u.value;u.name==="class"&&(f=H0(f).join(" ")),i["attr__"+u.name]=hg(1024,f)}});for(var a=1,l=1,c=t;c=NB(c);)a++,c.tagName===t.tagName&&l++;return i.nth_child=a,i.nth_of_type=l,i}function MB(t,e){for(var n,r,{e:s,maskAllElementAttributes:i,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!Ds(u,"body");)oj(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,f=[],p={},m=!1,v=!1;if(Te(c,E=>{var b=Iv(E);E.tagName.toLowerCase()==="a"&&(m=E.getAttribute("href"),m=b&&m&&Gc(m)&&m),ce(Kh(E),"ph-no-capture")&&(v=!0),f.push(DB(E,i,o,a));var S=function(T){if(!Iv(T))return{};var P={};return Te(T.attributes,function(I){if(I.name&&I.name.indexOf("data-ph-capture-attribute")===0){var k=I.name.replace("data-ph-capture-attribute-",""),V=I.value;k&&V&&Gc(V)&&(P[k]=V)}}),P}(E);qe(p,S)}),v)return{props:{},explicitNoCapture:v};if(o||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=pj(t):f[0].$el_text=Eu(t)),m){var w,y;f[0].attr__href=m;var _=(w=Fh(m))==null?void 0:w.host,x=O==null||(y=O.location)==null?void 0:y.host;_&&x&&_!==x&&(d=m)}return{props:qe({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:IB(f)},(n=f[0])!=null&&n.$el_text?{$el_text:(r=f[0])==null?void 0:r.$el_text}:{},d&&s.type==="click"?{$external_click_url:d}:{},p)}}var el=ze("[ExceptionAutocapture]");function h1(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],s=n(r);return Mr(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=s,()=>{t[e]=r}}catch{return()=>{}}}var $B=ze("[TracingHeaders]"),ts=ze("[Web Vitals]"),f1=9e5;ze("[SessionRecording]");var Lv="[SessionRecording]",Yi=ze(Lv),FB=ze("[Heatmaps]");function p1(t){return tt(t)&&"clientX"in t&&"clientY"in t&&Gr(t.clientX)&&Gr(t.clientY)}var g1=ze("[Product Tours]"),fg="ph_product_tours",VB=["$set_once","$set"],ns=ze("[SiteApps]"),UB={sessionRecording:class{get started(){var t;return!((t=this.cr)==null||!t.isStarted)}get status(){return this.cr?this.cr.status:this.pr&&!this._r?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.pr=!1,this.gr=!1,this.mr=void 0,this._instance=t,!this._instance.sessionManager)throw Yi.error("started without valid sessionManager"),new Error(Lv+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Lv+' cannot be used with cookieless_mode="always"')}get _r(){var t,e=!((t=this._instance.get_property(cd))==null||!t.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return O&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this._r||(e=this.cr)==null||!e.isStarted){var n=!G(Object.assign)&&!G(Array.from);this._r&&n?(this.br(t),Yi.info("starting")):this.stopRecording()}}br(t){var e,n,r;this._r&&(ee!=null&&(e=ee.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=ee.__PosthogExtensions__)!=null&&n.initSessionRecording?this.yr(t):(r=ee.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.wr,s=>{if(s)return Yi.error("could not load recorder",s);this.yr(t)}))}stopRecording(){var t,e;(t=this.mr)==null||t.call(this),this.mr=void 0,(e=this.cr)==null||e.stop()}$r(){var t;(t=this._instance.persistence)==null||t.unregister(DR)}Er(t){if(this._instance.persistence){var e,n,r=this._instance.persistence,s=()=>{var i=t.sessionRecording===!1?void 0:t.sessionRecording,o=i?.sampleRate,a=he(o)?null:parseFloat(o);he(a)&&this.$r();var l=i?.minimumDurationMilliseconds;r.register({[cd]:K({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:K({capturePerformance:t.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:G(l)?null:l,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};s(),(e=this.mr)==null||e.call(this),this.mr=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?t.sessionRecording!==!1?(this.gr=!1,this.Er(t),this.pr=!0,this.startIfEnabledOrStop()):this.pr=!0:Yi.info("skipping remote config with no sessionRecording",t)}log(t,e){var n;e===void 0&&(e="log"),(n=this.cr)!=null&&n.log?this.cr.log(t,e):Yi.warn("log called before recorder was ready")}get wr(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(cd);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Sr(){var t,e=this._instance.get_property(cd);if(!e)return!1;var n=(t=(typeof e=="object"?e:JSON.parse(e)).cache_timestamp)!==null&&t!==void 0?t:Date.now();return Date.now()-n<=3e5}yr(t){var e,n;if((e=ee.__PosthogExtensions__)==null||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.cr||(this.cr=(n=ee.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.cr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Sr()?this.cr.start(t):this.gr||(this.gr=!0,Yi.info("persisted remote config is stale, requesting fresh config before starting"),new nj(this._instance).load())}onRRwebEmit(t){var e;(e=this.cr)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.cr||(e=this._instance.persistence)==null||e.register({$replay_override_linked_flag:!0}),(t=this.cr)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.cr||(e=this._instance.persistence)==null||e.register({$replay_override_sampling:!0}),(t=this.cr)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.cr||(n=this._instance.persistence)==null||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.cr)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.cr)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.cr)==null||!n.tryAddCustomEvent(t,e))}}},zB={autocapture:class{constructor(t){this.kr=!1,this.Pr=null,this.Tr=!1,this.instance=t,this.rageclicks=new u1(t.config.rageclick),this.Ir=null}get N(){var t,e,n=tt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map(r=>new RegExp(r)),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map(r=>new RegExp(r)),n}Cr(){if(this.isBrowserSupported()){if(O&&W){var t=n=>{n=n||O?.event;try{this.Rr(n)}catch(r){d1.error("Failed to capture event",r)}};if(Je(W,"submit",t,{capture:!0}),Je(W,"change",t,{capture:!0}),Je(W,"click",t,{capture:!0}),this.N.capture_copied_text){var e=n=>{n=n||O?.event,this.Rr(n,dg)};Je(W,"copy",e,{capture:!0}),Je(W,"cut",e,{capture:!0})}}}else d1.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.kr&&(this.Cr(),this.kr=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Tr=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[kb]:!!t.autocapture_opt_out}),this.Pr=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Ir=t}getElementSelectors(t){var e,n=[];return(e=this.Ir)==null||e.forEach(r=>{var s=W?.querySelectorAll(r);s?.forEach(i=>{t===i&&n.push(r)})}),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[kb],r=this.Pr;if(Bn(r)&&!Vr(n)&&!this.instance.Rt())return!1;var s=(e=this.Pr)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!s}Rr(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=o1(t);ij(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&CB(r,this.instance.config.rageclick)&&this.Rr(t,"$rageclick");var s=e===dg;if(r&&kB(r,t,this.N,s,s?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=MB(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Tr});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(i.$element_selectors=a),e===dg){var l,c=aj(O==null||(l=O.getSelection())==null?void 0:l.toString()),u=t.type||"clipboard";if(!c)return!1;i.$selected_content=c,i.$copy_type=u}return this.instance.capture(e,i),!0}}}isBrowserSupported(){return Mr(W?.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Fr=(O==null||(e=O.location)==null?void 0:e.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(q.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Or&&this.Or(),this.Or=void 0,q.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(O&&O.history){var n=this;(t=O.history.pushState)!=null&&t.__posthog_wrapped__||h1(O.history,"pushState",r=>function(s,i,o){r.call(this,s,i,o),n.Mr("pushState")}),(e=O.history.replaceState)!=null&&e.__posthog_wrapped__||h1(O.history,"replaceState",r=>function(s,i,o){r.call(this,s,i,o),n.Mr("replaceState")}),this.Ar()}}Mr(t){try{var e,n=O==null||(e=O.location)==null?void 0:e.pathname;if(!n)return;n!==this.Fr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.Fr=n}catch(r){q.error("Error capturing "+t+" pageview",r)}}Ar(){if(!this.Or){var t=()=>{this.Mr("popstate")};Je(O,"popstate",t),this.Or=()=>{O&&O.removeEventListener("popstate",t)}}}},heatmaps:class{constructor(t){var e;this.jr=!1,this.kr=!1,this.Dr=null,this.instance=t,this.jr=!((e=this.instance.persistence)==null||!e.props[_v]),this.rageclicks=new u1(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return tt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return he(this.instance.config.capture_heatmaps)?he(this.instance.config.enable_heatmaps)?this.jr:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.kr)return;FB.info("starting..."),this.Lr(),this.Nr()}else{var t;clearInterval((t=this.Dr)!==null&&t!==void 0?t:void 0),this.Ur(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[_v]:e}),this.jr=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}zr(t){this.Hr(t.originalEvent,"deadclick")}Nr(){this.Dr&&clearInterval(this.Dr),this.Dr=function(t){return t?.visibilityState==="visible"}(W)?setInterval(this.te.bind(this),this.flushIntervalMilliseconds):null}Lr(){O&&W&&(this.Br=this.te.bind(this),Je(O,"beforeunload",this.Br),this.qr=t=>this.Hr(t||O?.event),Je(W,"click",this.qr,{capture:!0}),this.Wr=t=>this.Gr(t||O?.event),Je(W,"mousemove",this.Wr,{capture:!0}),this.Vr=new Db(this.instance,Cz,this.zr.bind(this)),this.Vr.startIfEnabledOrStop(),this.Jr=this.Nr.bind(this),Je(W,"visibilitychange",this.Jr),this.kr=!0)}Ur(){var t;O&&W&&(this.Br&&O.removeEventListener("beforeunload",this.Br),this.qr&&W.removeEventListener("click",this.qr,{capture:!0}),this.Wr&&W.removeEventListener("mousemove",this.Wr,{capture:!0}),this.Jr&&W.removeEventListener("visibilitychange",this.Jr),clearTimeout(this.Kr),(t=this.Vr)==null||t.stop(),this.kr=!1)}Yr(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=function(o,a,l){for(var c=o;c&&qf(c)&&!Ds(c,"body");){if(c===l)return!1;if(ce(a,O?.getComputedStyle(c).position))return!0;c=cj(c)}return!1}(o1(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Hr(t,e){var n;if(e===void 0&&(e="click"),!s1(t.target)&&p1(t)){var r=this.Yr(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.Xr(K({},r,{type:"rageclick"})),this.Xr(r)}}Gr(t){!s1(t.target)&&p1(t)&&(clearTimeout(this.Kr),this.Kr=setTimeout(()=>{this.Xr(this.Yr(t,"mousemove"))},500))}Xr(t){if(O){var e=O.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,s=n?oa([],la,r||[]):[],i=Wc(e,s,Kc);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(t)}}te(){this.R&&!vo(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Db,webVitalsAutocapture:class{constructor(t){var e;this.jr=!1,this.kr=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Qr=()=>{clearTimeout(this.Zr),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((n,r)=>K({},n,{["$web_vitals_"+r.name+"_event"]:K({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ts=n=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(G(s))ts.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.es();G(i)||(he(n?.name)||he(n?.value)?ts.error("Invalid metric received",n):this.rs&&n.value>=this.rs?ts.error("Ignoring metric with value >= "+this.rs,n):(this.R.url!==i&&(this.Qr(),this.Zr=setTimeout(this.Qr,this.flushToCaptureTimeoutMs)),G(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=G(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.R.metrics.push(K({},n,{$current_url:i,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.Qr()))}},this.ss=()=>{if(!this.kr){var n,r,s,i,o=ee.__PosthogExtensions__;G(o)||G(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:s,onINP:i}=o.postHogWebVitalsCallbacks),n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ts.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ts.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.ts.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ts.bind(this)),this.kr=!0):ts.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.jr=!((e=this._instance.persistence)==null||!e.props[Ab]),this.startIfEnabled()}get allowedMetrics(){var t,e,n=tt(this._instance.config.capture_performance)?(t=this._instance.config.capture_performance)==null?void 0:t.web_vitals_allowed_metrics:void 0;return he(n)?((e=this._instance.persistence)==null?void 0:e.props[Ib])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(tt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=tt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return t!=null&&t}get rs(){var t=tt(this._instance.config.capture_performance)&&Gr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:f1;return 0<t&&t<=6e4?f1:t}get isEnabled(){var t=dt?.protocol;if(t!=="http:"&&t!=="https:")return ts.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=tt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Vr(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Vr(e)?e:this.jr}startIfEnabled(){this.isEnabled&&!this.kr&&(ts.info("enabled, starting..."),this.V(this.ss))}onRemoteConfig(t){if("capturePerformance"in t){var e=tt(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=tt(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ab]:e}),this._instance.persistence.register({[Ib]:n})),this.jr=e,this.startIfEnabled()}}V(t){var e,n;if((e=ee.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks)t();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=ee.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,s=>{s?ts.error("failed to load script",s):t()})}}es(){var t=O?O.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=e?oa([],la,n||[]):[];return Wc(t,r,Kc)}ts.error("Could not determine current URL")}}},BB={exceptionObserver:class{constructor(t){var e,n,r;this.ss=()=>{var s;if(O&&this.isEnabled&&(s=ee.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var i=ee.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=ee.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=ee.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ns&&this.N.capture_unhandled_errors&&(this.ns=i(this.captureException.bind(this))),!this.os&&this.N.capture_unhandled_rejections&&(this.os=o(this.captureException.bind(this))),!this.ls&&this.N.capture_console_errors&&(this.ls=a(this.captureException.bind(this)))}catch(l){el.error("failed to start",l),this.us()}}},this._instance=t,this.hs=!((e=this._instance.persistence)==null||!e.props[Rb]),this.ds=new NU({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:el}),this.N=this.vs(),this.startIfEnabledOrStop()}vs(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return tt(t)?e=K({},e,t):(G(t)?this.hs:t)&&(e=K({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(el.info("enabled"),this.us(),this.V(this.ss)):this.us()}V(t){var e,n;(e=ee.__PosthogExtensions__)!=null&&e.errorWrappingFunctions&&t(),(n=ee.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return el.error("failed to load script",r);t()})}us(){var t,e,n;(t=this.ns)==null||t.call(this),this.ns=void 0,(e=this.os)==null||e.call(this),this.os=void 0,(n=this.ls)==null||n.call(this),this.ls=void 0}onRemoteConfig(t){if("autocaptureExceptions"in t){var e=t.autocaptureExceptions;this.hs=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Rb]:this.hs}),this.N=this.vs(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.vs()}captureException(t){var e,n,r=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.ds.consumeRateLimit(r)?el.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(t)}}},HB={productTours:class{constructor(t){this.cs=null,this.fs=null,this._instance=t}onRemoteConfig(t){"productTours"in t&&(this._instance.persistence&&this._instance.persistence.register({[Ob]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.cs||(t=this._instance).config.disable_product_tours||(e=t.persistence)==null||!e.get_property(Ob)||this.V(()=>this.ps())}V(t){var e,n;(e=ee.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=ee.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?g1.error("Could not load product tours script",r):t()})}ps(){var t;!this.cs&&(t=ee.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.cs=ee.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!me(this.fs)||e){var n=this._instance.persistence;if(n){var r=n.props[fg];if(me(r)&&!e)return this.fs=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var i=s.statusCode;if(i!==200||!s.json){var o="Product Tours API could not be loaded, status: "+i;return g1.error(o),void t([],{isLoaded:!1,error:o})}var a=me(s.json.product_tours)?s.json.product_tours:[];this.fs=a,n&&n.register({[fg]:a}),t(a,{isLoaded:!0})}})}else t(this.fs,{isLoaded:!0})}getActiveProductTours(t){he(this.cs)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.cs.getActiveProductTours(t)}showProductTour(t){var e;(e=this.cs)==null||e.showTourById(t)}previewTour(t){this.cs?this.cs.previewTour(t):this.V(()=>{var e;this.ps(),(e=this.cs)==null||e.previewTour(t)})}dismissProductTour(){var t;(t=this.cs)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.cs)==null||t.nextStep()}previousStep(){var t;(t=this.cs)==null||t.previousStep()}clearCache(){var t;this.fs=null,(t=this._instance.persistence)==null||t.unregister(fg)}resetTour(t){var e;(e=this.cs)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.cs)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.cs)==null||e.cancelPendingTour(t)}}},WB={siteApps:class{constructor(t){this._instance=t,this._s=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}gs(t,e){if(e){var n=this.globalsForEvent(e);this._s.push(n),this._s.length>1e3&&(this._s=this._s.slice(10))}}get siteAppLoaders(){var t;return(t=ee._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.gs.bind(this));this.bs=()=>{t(),this._s=[],this.bs=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,a;if(!t)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[d,f]of Object.entries(u))l[d]={id:c[d],type:d,properties:f};var{$set_once:p,$set:m}=t;return{event:K({},cR(t,VB),{properties:K({},t.properties,m?{$set:K({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},m)}:{},p?{$set_once:K({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},p)}:{}),elements_chain:(i=(o=t.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(a=t.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var o;!e.errored&&this._s.length&&(ns.info("Processing "+this._s.length+" events for site app with id "+t.id),this._s.forEach(a=>e.processEvent==null?void 0:e.processEvent(a)),e.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.bs)==null||o.call(this))},r=!1,s=o=>{e.errored=!o,e.loaded=!0,ns.info("Site app with id "+t.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:i}=t.init({posthog:this._instance,callback:o=>{s(o)}});i&&(e.processEvent=i),r=!0}catch(o){ns.error("Error while initializing PostHog app with config id "+t.id,o),s(!1)}if(r&&e.loaded)try{n()}catch(o){ns.error("Error while processing buffered events PostHog app with config id "+t.id,o),e.errored=!0}}ys(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}ws(t){if(Object.keys(this.apps).length!==0){var e=this.globalsForEvent(t);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(e)}catch(r){ns.error("Error while processing event "+t.event+" for site app "+n.id,r)}}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ys(),void this._instance.on("eventCaptured",l=>this.ws(l))):void ns.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.bs)==null||n.call(this),(r=t.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(l){var c;ee["__$$ph_site_app_"+l]=s._instance,(c=ee.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,a,u=>{if(u)return ns.error("Error while initializing PostHog app with config id "+l,u)})};for(var{id:o,url:a}of t.siteApps)i(o)}else ns.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},KB=K({},UB,zB,BB,HB,WB,{tracingHeaders:class{constructor(t){this.xs=void 0,this.$s=void 0,this.ss=()=>{var e,n;G(this.xs)&&((e=ee.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),G(this.$s)&&((n=ee.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}V(t){var e,n;(e=ee.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns&&t(),(n=ee.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return $B.error("failed to load script",r);t()})}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.V(this.ss):((t=this.xs)==null||t.call(this),(e=this.$s)==null||e.call(this),this.xs=void 0,this.$s=void 0)}}});ur.__defaultExtensionClasses=K({},KB);var m1;(function(t){return t.SHOWN="product tour shown",t.DISMISSED="product tour dismissed",t.COMPLETED="product tour completed",t.STEP_SHOWN="product tour step shown",t.STEP_COMPLETED="product tour step completed",t.BUTTON_CLICKED="product tour button clicked",t.STEP_SELECTOR_FAILED="product tour step selector failed",t.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",t.BANNER_ACTION_CLICKED="product tour banner action clicked",t})({});(function(t){return t.TOUR_ID="$product_tour_id",t.TOUR_NAME="$product_tour_name",t.TOUR_ITERATION="$product_tour_iteration",t.TOUR_RENDER_REASON="$product_tour_render_reason",t.TOUR_STEP_ID="$product_tour_step_id",t.TOUR_STEP_ORDER="$product_tour_step_order",t.TOUR_STEP_TYPE="$product_tour_step_type",t.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",t.TOUR_BUTTON_TEXT="$product_tour_button_text",t.TOUR_BUTTON_ACTION="$product_tour_button_action",t.TOUR_BUTTON_LINK="$product_tour_button_link",t.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",t.TOUR_STEPS_COUNT="$product_tour_steps_count",t.TOUR_STEP_SELECTOR="$product_tour_step_selector",t.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",t.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",t.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",t.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",t.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",t.TOUR_ERROR="$product_tour_error",t.TOUR_MATCHES_COUNT="$product_tour_matches_count",t.TOUR_FAILURE_PHASE="$product_tour_failure_phase",t.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",t.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",t.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",t.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",t.USE_MANUAL_SELECTOR="$use_manual_selector",t.INFERENCE_DATA_PRESENT="$inference_data_present",t})({});var lc=(m1=ac[ro]=new ur,function(){function t(){t.done||(t.done=!0,sj=!1,Te(ac,function(e){e._dom_loaded()}))}W!=null&&W.addEventListener?W.readyState==="complete"?t():Je(W,"DOMContentLoaded",t,{capture:!1}):O&&q.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),m1);const GB=Object.freeze(Object.defineProperty({__proto__:null,Compression:or,DisplaySurveyType:Wh,PostHog:ur,SurveyEventName:_o,SurveyEventProperties:Hd,SurveyEventType:no,SurveyType:Bd,default:lc,posthog:lc},Symbol.toStringTag,{value:"Module"})),pg={trackPageView:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("config","G-RKW2321F04",{page_path:t,page_title:e||document.title})},trackEvent:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event",t,e),typeof window<"u"&&lc.capture(t,e)},identifyUser:(t,e)=>{typeof window<"u"&&lc.identify(t,e)},resetUser:()=>{typeof window<"u"&&lc.reset()},initialize:()=>{typeof window<"u"&&window.gtag&&window.gtag("config","G-RKW2321F04",{page_path:window.location.pathname,page_title:document.title})}},mj=g.createContext(void 0),v1=(t,e)=>Promise.race([t,new Promise((n,r)=>setTimeout(()=>r(new Error("Timeout")),e))]),qB=()=>{try{const t=e=>{const n=[];for(let r=0;r<e.length;r++){const s=e.key(r);s&&(s.includes("-auth-token")||s.includes("-code-verifier"))&&n.push(s)}n.forEach(r=>e.removeItem(r))};t(localStorage),t(sessionStorage),sessionStorage.removeItem("pendingAuthRedirect"),sessionStorage.removeItem("storyMakerDraft")}catch(t){console.warn("Error purging auth storage:",t)}},YB=({children:t})=>{const[e,n]=g.useState(null),[r,s]=g.useState(null),[i,o]=g.useState(!0),a=g.useRef(!1),l=g.useRef(0),{toast:c}=lC(),u=g.useCallback(async x=>{const E=x||e?.id;if(E)try{console.log("[AUTH] Refreshing subscription for:",E),await CU(!0)}catch(b){console.error("[AUTH] Error refreshing subscription:",b),lr.error("Subscription refresh failed",{description:"Could not update your subscription status. Please try again later."})}},[e?.id]);g.useEffect(()=>{const{data:{subscription:x}}=xe.auth.onAuthStateChange((E,b)=>{if(console.log("[AUTH] Event:",E),a.current&&E!=="SIGNED_OUT"){console.log("[AUTH] Ignoring event during sign-out:",E);return}if(Date.now()<l.current&&(E==="SIGNED_IN"||E==="TOKEN_REFRESHED")){console.log("[AUTH] Ignoring late rehydration event after sign-out:",E);return}s(b);const S=b?.user?.id??null;n(T=>{const P=T?.id??null;return P===S&&P!==null?T:b?.user??null}),E==="SIGNED_OUT"&&(pg.resetUser(),a.current=!1),o(!1)});return xe.auth.getSession().then(({data:{session:E}})=>{s(E),n(E?.user??null),o(!1)}),()=>x.unsubscribe()},[]),g.useEffect(()=>{if(!e||a.current)return;let x=!1;return(async()=>{pg.identifyUser(e.id,{email:e.email,user_type:e.user_metadata?.user_type});try{const b=e.user_metadata,S=b?.avatar_url||b?.picture;if(S){const{data:T}=await xe.from("profiles").select("avatar_url").eq("id",e.id).single();!x&&!T?.avatar_url&&await xe.from("profiles").update({avatar_url:S}).eq("id",e.id)}}catch(b){console.error("[AUTH] Avatar sync error:",b)}if(!x)try{await u(e.id)}catch(b){console.error("[AUTH] Subscription refresh error on sign-in:",b)}})(),()=>{x=!0}},[e?.id]);const d=async(x,E)=>{try{o(!0);const{data:b,error:S}=await xe.auth.signInWithPassword({email:x,password:E});if(S)throw S}catch(b){throw console.error("Error signing in:",b),b}finally{o(!1)}},f=async(x,E,b,S)=>{try{o(!0);const{error:T}=await xe.auth.signUp({email:x,password:E,options:{data:{user_type:b||"free",display_name:S}}});if(T)throw c({title:"Sign up failed",description:T.message,variant:"destructive"}),T}catch(T){throw console.error("Error signing up:",T),T}finally{o(!1)}},p=async(x,E)=>{try{o(!0);const{error:b}=await xe.auth.signInWithOAuth({provider:x});if(b)throw c({title:`${E} sign in failed`,description:b.message,variant:"destructive"}),b}catch(b){throw console.error(`Error signing in with ${E}:`,b),b}finally{o(!1)}},m=()=>p("google","Google"),v=()=>p("facebook","Facebook"),w=()=>p("twitter","X"),y=()=>p("azure","Microsoft"),_=async()=>{a.current=!0;try{o(!0),pg.resetUser();try{await v1(xe.auth.signOut(),3e3)}catch(x){console.warn("[AUTH] Global sign-out failed/timed out:",x);try{await v1(xe.auth.signOut({scope:"local"}),2e3)}catch(E){console.warn("[AUTH] Local sign-out also failed:",E)}}}catch(x){console.error("[AUTH] Sign-out error:",x)}finally{qB(),n(null),s(null),o(!1),l.current=Date.now()+2e3,a.current=!1}};return h.jsx(mj.Provider,{value:{user:e,session:r,isLoading:i,signIn:d,signUp:f,signInWithGoogle:m,signInWithFacebook:v,signInWithTwitter:w,signInWithMicrosoft:y,signOut:_,refreshSubscription:u},children:t})},G0=()=>{const t=g.useContext(mj);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},QB=(t,e,n,r)=>{const s=[n,{code:e,...r||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(s,"warn","react-i18next::",!0);wi(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...s):console?.warn&&console.warn(...s)},y1={},Nv=(t,e,n,r)=>{wi(n)&&y1[n]||(wi(n)&&(y1[n]=new Date),QB(t,e,n,r))},vj=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Dv=(t,e,n)=>{t.loadNamespaces(e,vj(t,n))},_1=(t,e,n,r)=>{if(wi(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Dv(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,vj(t,r))},XB=(t,e,n={})=>!e.languages||!e.languages.length?(Nv(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,t))return!1}}),wi=t=>typeof t=="string",JB=t=>typeof t=="object"&&t!==null,ZB=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,e6={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},t6=t=>e6[t],n6=t=>t.replace(ZB,t6);let Mv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:n6};const r6=(t={})=>{Mv={...Mv,...t}},s6=()=>Mv;let yj;const i6=t=>{yj=t},o6=()=>yj,a6={type:"3rdParty",init(t){r6(t.options.react),i6(t)}},l6=g.createContext();class c6{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const u6=(t,e)=>{const n=g.useRef();return g.useEffect(()=>{n.current=t},[t,e]),n.current},_j=(t,e,n,r)=>t.getFixedT(e,n,r),d6=(t,e,n,r)=>g.useCallback(_j(t,e,n,r),[t,e,n,r]),Lt=(t,e={})=>{const{i18n:n}=e,{i18n:r,defaultNS:s}=g.useContext(l6)||{},i=n||r||o6();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new c6),!i){Nv(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const E=(S,T)=>wi(T)?T:JB(T)&&wi(T.defaultValue)?T.defaultValue:Array.isArray(S)?S[S.length-1]:S,b=[E,{},!1];return b.t=E,b.i18n={},b.ready=!1,b}i.options.react?.wait&&Nv(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...s6(),...i.options.react,...e},{useSuspense:a,keyPrefix:l}=o;let c=t||s||i.options?.defaultNS;c=wi(c)?[c]:c||["translation"],i.reportNamespaces.addUsedNamespaces?.(c);const u=(i.isInitialized||i.initializedStoreOnce)&&c.every(E=>XB(E,i,o)),d=d6(i,e.lng||null,o.nsMode==="fallback"?c:c[0],l),f=()=>d,p=()=>_j(i,e.lng||null,o.nsMode==="fallback"?c:c[0],l),[m,v]=g.useState(f);let w=c.join();e.lng&&(w=`${e.lng}${w}`);const y=u6(w),_=g.useRef(!0);g.useEffect(()=>{const{bindI18n:E,bindI18nStore:b}=o;_.current=!0,!u&&!a&&(e.lng?_1(i,e.lng,c,()=>{_.current&&v(p)}):Dv(i,c,()=>{_.current&&v(p)})),u&&y&&y!==w&&_.current&&v(p);const S=()=>{_.current&&v(p)};return E&&i?.on(E,S),b&&i?.store.on(b,S),()=>{_.current=!1,i&&E?.split(" ").forEach(T=>i.off(T,S)),b&&i&&b.split(" ").forEach(T=>i.store.off(T,S))}},[i,w]),g.useEffect(()=>{_.current&&u&&v(f)},[i,l,u]);const x=[m,i,u];if(x.t=m,x.i18n=i,x.ready=u,u||!u&&!a)return x;throw new Promise(E=>{e.lng?_1(i,e.lng,c,()=>E()):Dv(i,c,()=>E())})},h6=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((s,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},ne=t=>typeof t=="string",tl=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},w1=t=>t==null?"":""+t,f6=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},p6=/###/g,x1=t=>t&&t.indexOf("###")>-1?t.replace(p6,"."):t,b1=t=>!t||ne(t),cc=(t,e,n)=>{const r=ne(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(b1(t))return{};const i=x1(r[s]);!t[i]&&n&&(t[i]=new n),Object.prototype.hasOwnProperty.call(t,i)?t=t[i]:t={},++s}return b1(t)?{}:{obj:t,k:x1(r[s])}},E1=(t,e,n)=>{const{obj:r,k:s}=cc(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],o=e.slice(0,e.length-1),a=cc(t,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=cc(t,o,Object),a?.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},g6=(t,e,n,r)=>{const{obj:s,k:i}=cc(t,e,Object);s[i]=s[i]||[],s[i].push(n)},Gh=(t,e)=>{const{obj:n,k:r}=cc(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},m6=(t,e,n)=>{const r=Gh(t,n);return r!==void 0?r:Gh(e,n)},wj=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?ne(t[r])||t[r]instanceof String||ne(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):wj(t[r],e[r],n):t[r]=e[r]);return t},Qi=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var v6={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const y6=t=>ne(t)?t.replace(/[&<>"'\/]/g,e=>v6[e]):t;class _6{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const w6=[" ",",","?","!",";"],x6=new _6(20),b6=(t,e,n)=>{e=e||"",n=n||"";const r=w6.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=x6.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(t);if(!i){const o=t.indexOf(n);o>0&&!s.test(t.substring(0,o))&&(i=!0)}return i},$v=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let s=t;for(let i=0;i<r.length;){if(!s||typeof s!="object")return;let o,a="";for(let l=i;l<r.length;++l)if(l!==i&&(a+=n),a+=r[l],o=s[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<r.length-1)continue;i+=l-i+1;break}s=o}return s},qc=t=>t?.replace("_","-"),E6={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class qh{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||E6,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,s){return s&&!this.debug?null:(ne(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new qh(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new qh(this.logger,e)}}var dr=new qh;class Yf{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,i])=>{for(let o=0;o<i;o++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,i])=>{for(let o=0;o<i;o++)s.apply(s,[e,...n])})}}class S1 extends Yf{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r,s={}){const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],r&&(Array.isArray(r)?a.push(...r):ne(r)&&i?a.push(...r.split(i)):a.push(r)));const l=Gh(this.data,a);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=a[0],n=a[1],r=a.slice(2).join(".")),l||!o||!ne(r)?l:$v(this.data?.[e]?.[n],r,i)}addResource(e,n,r,s,i={silent:!1}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,n];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),s=n,n=a[1]),this.addNamespaces(n),E1(this.data,a,s),i.silent||this.emit("added",e,n,r,s)}addResources(e,n,r,s={silent:!1}){for(const i in r)(ne(r[i])||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,i,o={silent:!1,skipCopy:!1}){let a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let l=Gh(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?wj(l,r,i):l={...l,...r},E1(this.data,a,l),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var xj={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(i=>{e=this.processors[i]?.process(e,n,r,s)??e}),e}};const T1={},P1=t=>!ne(t)&&typeof t!="boolean"&&typeof t!="number";class Yh extends Yf{constructor(e,n={}){super(),f6(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=dr.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};return e==null?!1:this.resolve(e,r)?.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!b6(e,r,s);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:ne(i)?[i]:i};const c=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(s)}return{key:e,namespaces:ne(i)?[i]:i}}translate(e,n,r){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],s),c=l[l.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const d=s.lng||this.language,f=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return f?i?{res:`${c}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:a;const p=this.resolve(e,s);let m=p?.res;const v=p?.usedKey||a,w=p?.exactUsedKey||a,y=["[object Number]","[object Function]","[object RegExp]"],_=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,E=s.count!==void 0&&!ne(s.count),b=Yh.hasDefaultValue(s),S=E?this.pluralResolver.getSuffix(d,s.count,s):"",T=s.ordinal&&E?this.pluralResolver.getSuffix(d,s.count,{ordinal:!1}):"",P=E&&!s.ordinal&&s.count===0,I=P&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${S}`]||s[`defaultValue${T}`]||s.defaultValue;let k=m;x&&!m&&b&&(k=I);const V=P1(k),F=Object.prototype.toString.apply(k);if(x&&k&&V&&y.indexOf(F)<0&&!(ne(_)&&Array.isArray(k))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Y=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,k,{...s,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=Y,p.usedParams=this.getUsedParamsDetails(s),p):Y}if(o){const Y=Array.isArray(k),N=Y?[]:{},X=Y?w:v;for(const B in k)if(Object.prototype.hasOwnProperty.call(k,B)){const H=`${X}${o}${B}`;b&&!m?N[B]=this.translate(H,{...s,defaultValue:P1(I)?I[B]:void 0,joinArrays:!1,ns:l}):N[B]=this.translate(H,{...s,joinArrays:!1,ns:l}),N[B]===H&&(N[B]=k[B])}m=N}}else if(x&&ne(_)&&Array.isArray(m))m=m.join(_),m&&(m=this.extendTranslation(m,e,s,r));else{let Y=!1,N=!1;!this.isValidLookup(m)&&b&&(Y=!0,m=I),this.isValidLookup(m)||(N=!0,m=a);const B=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:m,H=b&&I!==m&&this.options.updateMissing;if(N||Y||H){if(this.logger.log(H?"updateKey":"missingKey",d,c,a,H?I:m),o){const M=this.resolve(a,{...s,keySeparator:!1});M&&M.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let R=[];const A=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&A&&A[0])for(let M=0;M<A.length;M++)R.push(A[M]);else this.options.saveMissingTo==="all"?R=this.languageUtils.toResolveHierarchy(s.lng||this.language):R.push(s.lng||this.language);const U=(M,z,J)=>{const re=b&&J!==m?J:B;this.options.missingKeyHandler?this.options.missingKeyHandler(M,c,z,re,H,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(M,c,z,re,H,s),this.emit("missingKey",M,c,z,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?R.forEach(M=>{const z=this.pluralResolver.getSuffixes(M,s);P&&s[`defaultValue${this.options.pluralSeparator}zero`]&&z.indexOf(`${this.options.pluralSeparator}zero`)<0&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(J=>{U([M],a+J,s[`defaultValue${J}`]||I)})}):U(R,a,I))}m=this.extendTranslation(m,e,s,p,r),N&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}${u}${a}`),(N||Y)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${a}`:a,Y?m:void 0,s))}return i?(p.res=m,p.usedParams=this.getUsedParamsDetails(s),p):m}extendTranslation(e,n,r,s,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const l=ne(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const d=e.match(this.interpolator.nestingRegexp);c=d&&d.length}let u=r.replace&&!ne(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,r.lng||this.language||s.usedLng,r),l){const d=e.match(this.interpolator.nestingRegexp),f=d&&d.length;c<f&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...d)=>i?.[0]===d[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${n[0]}`),null):this.translate(...d,n),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,a=ne(o)?[o]:o;return e!=null&&a?.length&&r.applyPostProcessor!==!1&&(e=xj.handle(a,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,s,i,o,a;return ne(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;s=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&!ne(n.count),p=f&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(ne(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(w=>{this.isValidLookup(r)||(a=w,!T1[`${v[0]}-${w}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(T1[`${v[0]}-${w}`]=!0,this.logger.warn(`key "${s}" for languages "${v.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(y=>{if(this.isValidLookup(r))return;o=y;const _=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(_,u,y,w,n);else{let E;f&&(E=this.pluralResolver.getSuffix(y,n.count,n));const b=`${this.options.pluralSeparator}zero`,S=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(_.push(u+E),n.ordinal&&E.indexOf(S)===0&&_.push(u+E.replace(S,this.options.pluralSeparator)),p&&_.push(u+b)),m){const T=`${u}${this.options.contextSeparator}${n.context}`;_.push(T),f&&(_.push(T+E),n.ordinal&&E.indexOf(S)===0&&_.push(T+E.replace(S,this.options.pluralSeparator)),p&&_.push(T+b))}}let x;for(;x=_.pop();)this.isValidLookup(r)||(i=x,r=this.getResource(y,w,x,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!ne(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class C1{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=dr.create("languageUtils")}getScriptPartFromCode(e){if(e=qc(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=qc(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(ne(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return n=s;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),ne(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return ne(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):ne(e)&&i(this.formatLanguageCode(e)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}const k1={zero:0,one:1,two:2,few:3,many:4,other:5},R1={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class S6{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=dr.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=qc(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),R1;if(!e.match(/-|_/))return R1;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[i]=o,o}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,i)=>k1[s]-k1[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,n,r={}){const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const j1=(t,e,n,r=".",s=!0)=>{let i=m6(t,e,n);return!i&&s&&ne(n)&&(i=$v(t,n,r),i===void 0&&(i=$v(e,n,r))),i},gg=t=>t.replace(/\$/g,"$$$$");class T6{constructor(e={}){this.logger=dr.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:v,nestingOptionsSeparator:w,maxReplaces:y,alwaysFormat:_}=e.interpolation;this.escape=n!==void 0?n:y6,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Qi(i):o||"{{",this.suffix=a?Qi(a):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=f?Qi(f):p||Qi("$t("),this.nestingSuffix=m?Qi(m):v||Qi(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=y||1e3,this.alwaysFormat=_!==void 0?_:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let i,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=p=>{if(p.indexOf(this.formatSeparator)<0){const y=j1(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...s,...n,interpolationkey:p}):y}const m=p.split(this.formatSeparator),v=m.shift().trim(),w=m.join(this.formatSeparator).trim();return this.format(j1(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),w,r,{...s,...n,interpolationkey:v})};this.resetRegExp();const u=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>gg(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?gg(this.escape(p)):gg(p)}].forEach(p=>{for(a=0;i=p.regex.exec(e);){const m=i[1].trim();if(o=c(m),o===void 0)if(typeof u=="function"){const w=u(e,i,s);o=ne(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,m))o="";else if(d){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!ne(o)&&!this.useRawValueToEscape&&(o=w1(o));const v=p.safeValue(o);if(e=e.replace(i[0],v),d?(p.regex.lastIndex+=o.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n,r={}){let s,i,o;const a=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const d=l.split(new RegExp(`${u}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,o);const p=f.match(/'/g),m=f.match(/"/g);((p?.length??0)%2===0&&!m||m.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),c&&(o={...c,...o})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,v),`${l}${u}${f}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&!ne(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(d=>d.trim());s[1]=u.shift(),l=u,c=!0}if(i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&!ne(i))return i;ne(i)||(i=w1(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),c&&(i=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const P6=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=a.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:e,formatOptions:n}},A1=t=>{const e={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=e[o];return a||(a=t(qc(r),s),e[o]=a),a(n)}},C6=t=>(e,n,r)=>t(qc(n),r)(e);class k6{constructor(e={}){this.logger=dr.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?A1:C6;this.formats={number:r((s,i)=>{const o=new Intl.NumberFormat(s,{...i});return a=>o.format(a)}),currency:r((s,i)=>{const o=new Intl.NumberFormat(s,{...i,style:"currency"});return a=>o.format(a)}),datetime:r((s,i)=>{const o=new Intl.DateTimeFormat(s,{...i});return a=>o.format(a)}),relativetime:r((s,i)=>{const o=new Intl.RelativeTimeFormat(s,{...i});return a=>o.format(a,i.range||"day")}),list:r((s,i)=>{const o=new Intl.ListFormat(s,{...i});return a=>o.format(a)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=A1(n)}format(e,n,r,s={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(l=>l.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,l)=>{const{formatName:c,formatOptions:u}=P6(l);if(this.formats[c]){let d=a;try{const f=s?.formatParams?.[s.interpolationkey]||{},p=f.locale||f.lng||s.locale||s.lng||r;d=this.formats[c](a,p,{...u,...s,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}const R6=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class j6 extends Yf{constructor(e,n,r,s={}){super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=dr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,s.backend,s)}queueLoad(e,n,r,s){const i={},o={},a={},l={};return e.forEach(c=>{let u=!0;n.forEach(d=>{const f=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,u=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(a[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const s=e.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const a={};this.queue.forEach(l=>{g6(l.loaded,[i],o),R6(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{a[c][d]===void 0&&(a[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r,s=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,s+1,i*2,o)},i);return}o(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(e,n);c&&typeof c.then=="function"?c.then(u=>a(null,u)).catch(a):a(null,c)}catch(c){a(c)}return}return l(e,n,a)}prepareLoading(e,n,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();ne(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ne(n)&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,n,r,s,i,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const l={...o,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(e,n,r,s,l):u=c(e,n,r,s),u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}else c(e,n,r,s,a,l)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const O1=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),ne(t[1])&&(e.defaultValue=t[1]),ne(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),I1=t=>(ne(t.ns)&&(t.ns=[t.ns]),ne(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),ne(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),pd=()=>{},A6=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Yc extends Yf{constructor(e={},n){if(super(),this.options=I1(e),this.services={},this.logger=dr,this.modules={external:[]},A6(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(ne(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=O1();this.options={...r,...this.options,...I1(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?dr.init(s(this.modules.logger),this.options):dr.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=k6;const u=new C1(this.options);this.store=new S1(this.options.resources,this.options);const d=this.services;d.logger=dr,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new S6(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(d.formatter=s(c),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new T6(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new j6(s(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(d.languageDetector=s(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=s(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Yh(this.services,this.options),this.translator.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=pd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...u)=>this.store[c](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...u)=>(this.store[c](...u),this)});const a=tl(),l=()=>{const c=(u,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(d),n(u,d)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,n=pd){let r=n;const s=ne(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(c=>{c!=="cimode"&&i.indexOf(c)<0&&i.push(c)})};s?o(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload?.forEach?.(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(e,n,r){const s=tl();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=pd),this.services.backendConnector.reload(e,n,i=>{s.resolve(),r(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&xj.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=tl();this.emit("languageChanging",e);const s=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...c)=>this.t(...c)),n&&n(a,(...c)=>this.t(...c))},o=a=>{!e&&!a&&this.services.languageDetector&&(a=[]);const l=ne(a)?a:a&&a[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(ne(a)?[a]:a);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{i(u,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,n,r){const s=(i,o,...a)=>{let l;typeof o!="object"?l=this.options.overloadTranslationOptionHandler([i,o].concat(a)):l={...o},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||s.keyPrefix);const c=this.options.keySeparator||".";let u;return l.keyPrefix&&Array.isArray(i)?u=i.map(d=>`${l.keyPrefix}${c}${d}`):u=l.keyPrefix?`${l.keyPrefix}${c}${i}`:i,this.t(u,l)};return ne(e)?s.lng=e:s.lngs=e,s.ns=n,s.keyPrefix=r,s}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const c=this.services.backendConnector.state[`${a}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!s||o(i,e)))}loadNamespaces(e,n){const r=tl();return this.options.ns?(ne(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=tl();ne(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new C1(O1());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){return new Yc(e,n)}cloneInstance(e={},n=pd){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new Yc(s);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const a=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((u,d)=>(u[d]={...l[c][d]},u),l[c]),l),{});i.store=new S1(a,s),i.services.resourceStore=i.store}return i.translator=new Yh(i.services,s),i.translator.on("*",(a,...l)=>{i.emit(a,...l)}),i.init(s,n),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const gt=Yc.createInstance();gt.createInstance=Yc.createInstance;gt.createInstance;gt.dir;gt.init;gt.loadResources;gt.reloadResources;gt.use;gt.changeLanguage;gt.getFixedT;gt.t;gt.exists;gt.setDefaultNamespace;gt.hasLoadedNamespace;gt.loadNamespaces;gt.loadLanguages;var O6=function(e){return{type:"backend",init:function(r,s,i){},read:function(r,s,i){if(typeof e=="function"){if(e.length<3){try{var o=e(r,s);o&&typeof o.then=="function"?o.then(function(a){return i(null,a&&a.default||a)}).catch(i):i(null,o)}catch(a){i(a)}return}e(r,s,i);return}i(null,e&&e[r]&&e[r][s])}}};const Qc=["en","zh","bn","es","ja"],bj=["navbar","footer"],I6={"":["home","landing"],subscription:["subscription"],stories:["stories"],themes:["themes"],theme:["themes"],about:["about"],contact:["contact"],"improve-reading":["improve-reading"],"text-checker":["text-checker"],"reading-cart":["reading-cart"],vocabulary:["vocabulary"],progress:["progress"],research:["research"],blog:["blog","newsletter"],"story-maker":["story-maker"],story:["story-reader"],auth:["auth"],login:["auth"],signup:["auth"],"verify-email":["auth"],"reset-password":["auth"],terms:["terms"],privacy:["privacy"],refund:["refund"],newsletter:["newsletter"],"payment-status":["payment-status"],payment:["payment-status"],stripe:["payment-status"]};function Fv(t){const e=t.split("/").filter(Boolean)[0]?.toLowerCase();return Qc.includes(e)?e:"en"}function Ej(t){const e=t.split("/").filter(Boolean),n=e[0]?.toLowerCase(),s=((Qc.includes(n)?e.slice(1):e)[0]||"").toLowerCase(),i=I6[s]??[];return Array.from(new Set([...bj,...i]))}const L6=typeof window<"u"?Fv(window.location.pathname):"en";gt.use(O6((t,e)=>h6(Object.assign({"../locales/bn/about.json":()=>C(()=>import("./about-IMrI-vB2.js"),[]),"../locales/bn/auth.json":()=>C(()=>import("./auth-527YGbra.js"),[]),"../locales/bn/blog.json":()=>C(()=>import("./blog-CRDfTz6g.js"),[]),"../locales/bn/contact.json":()=>C(()=>import("./contact-3LVKK4oT.js"),[]),"../locales/bn/footer.json":()=>C(()=>import("./footer-BSxBqHhD.js"),[]),"../locales/bn/generation.json":()=>C(()=>import("./generation-CbNDqnSu.js"),[]),"../locales/bn/home.json":()=>C(()=>import("./home-5IDLJ1L2.js"),[]),"../locales/bn/improve-reading.json":()=>C(()=>import("./improve-reading-CfTBjAlp.js"),[]),"../locales/bn/landing.json":()=>C(()=>import("./landing-DvNLxy8Y.js"),[]),"../locales/bn/navbar.json":()=>C(()=>import("./navbar-BWEOBUG7.js"),[]),"../locales/bn/newsletter.json":()=>C(()=>import("./newsletter-1T6UBzkr.js"),[]),"../locales/bn/notfound.json":()=>C(()=>import("./notfound-CPkJ3HOw.js"),[]),"../locales/bn/payment-status.json":()=>C(()=>import("./payment-status-wgfjMmgM.js"),[]),"../locales/bn/privacy.json":()=>C(()=>import("./privacy-DTLzvZAR.js"),[]),"../locales/bn/progress.json":()=>C(()=>import("./progress-BYexOijN.js"),[]),"../locales/bn/reading-cart.json":()=>C(()=>import("./reading-cart-BCd2nmAM.js"),[]),"../locales/bn/refund.json":()=>C(()=>import("./refund-75w9UWZs.js"),[]),"../locales/bn/research.json":()=>C(()=>import("./research-C9DfPdmg.js"),[]),"../locales/bn/stories.json":()=>C(()=>import("./stories-DQKP8VzD.js"),[]),"../locales/bn/story-maker.json":()=>C(()=>import("./story-maker-spUs0PQV.js"),[]),"../locales/bn/story-reader.json":()=>C(()=>import("./story-reader-CQcceV-f.js"),[]),"../locales/bn/subscription.json":()=>C(()=>import("./subscription-CWp09wcj.js"),[]),"../locales/bn/terms.json":()=>C(()=>import("./terms-DKuS4yZL.js"),[]),"../locales/bn/text-checker.json":()=>C(()=>import("./text-checker-CkQ1SWkj.js"),[]),"../locales/bn/themes.json":()=>C(()=>import("./themes-DRAP3_KB.js"),[]),"../locales/bn/vocabulary.json":()=>C(()=>import("./vocabulary-CCWpBz8Y.js"),[]),"../locales/en/about.json":()=>C(()=>import("./about-Cfi7PXQF.js"),[]),"../locales/en/auth.json":()=>C(()=>import("./auth-ChcFz0rH.js"),[]),"../locales/en/blog.json":()=>C(()=>import("./blog-DaqAtZWV.js"),[]),"../locales/en/contact.json":()=>C(()=>import("./contact-B1ewm6S_.js"),[]),"../locales/en/footer.json":()=>C(()=>import("./footer-Cj59KvtR.js"),[]),"../locales/en/generation.json":()=>C(()=>import("./generation-UrkKrDMw.js"),[]),"../locales/en/home.json":()=>C(()=>import("./home-i-64rcvp.js"),[]),"../locales/en/improve-reading.json":()=>C(()=>import("./improve-reading-Ba0OnmAu.js"),[]),"../locales/en/landing.json":()=>C(()=>import("./landing-DM_Z-0ac.js"),[]),"../locales/en/navbar.json":()=>C(()=>import("./navbar-D4XjqLhY.js"),[]),"../locales/en/newsletter.json":()=>C(()=>import("./newsletter-BaqeoYHu.js"),[]),"../locales/en/notfound.json":()=>C(()=>import("./notfound-CQuG0LtW.js"),[]),"../locales/en/payment-status.json":()=>C(()=>import("./payment-status-C7SHYdC9.js"),[]),"../locales/en/privacy.json":()=>C(()=>import("./privacy-D9qnP2jO.js"),[]),"../locales/en/progress.json":()=>C(()=>import("./progress-DbOw3W9u.js"),[]),"../locales/en/reading-cart.json":()=>C(()=>import("./reading-cart-BptBWt_r.js"),[]),"../locales/en/refund.json":()=>C(()=>import("./refund-CC1P1Dku.js"),[]),"../locales/en/research.json":()=>C(()=>import("./research-BW5Fbins.js"),[]),"../locales/en/stories.json":()=>C(()=>import("./stories-BthT35i0.js"),[]),"../locales/en/story-maker.json":()=>C(()=>import("./story-maker-CJAnJm6t.js"),[]),"../locales/en/story-reader.json":()=>C(()=>import("./story-reader-Dnw2Ezjl.js"),[]),"../locales/en/subscription.json":()=>C(()=>import("./subscription-Dj8KOFas.js"),[]),"../locales/en/terms.json":()=>C(()=>import("./terms-NVC40PjG.js"),[]),"../locales/en/text-checker.json":()=>C(()=>import("./text-checker-BkJbNwhe.js"),[]),"../locales/en/themes.json":()=>C(()=>import("./themes-CkPi0xuD.js"),[]),"../locales/en/vocabulary.json":()=>C(()=>import("./vocabulary-43COnWwL.js"),[]),"../locales/es/about.json":()=>C(()=>import("./about-CzvVkbDv.js"),[]),"../locales/es/auth.json":()=>C(()=>import("./auth-CWyG6RSy.js"),[]),"../locales/es/blog.json":()=>C(()=>import("./blog-BG7p7K8N.js"),[]),"../locales/es/contact.json":()=>C(()=>import("./contact-BZPyAx2-.js"),[]),"../locales/es/footer.json":()=>C(()=>import("./footer-BZPiJHxT.js"),[]),"../locales/es/generation.json":()=>C(()=>import("./generation-CoyA_3Lk.js"),[]),"../locales/es/home.json":()=>C(()=>import("./home-Dfzi3n6j.js"),[]),"../locales/es/improve-reading.json":()=>C(()=>import("./improve-reading-cSc0CSFc.js"),[]),"../locales/es/landing.json":()=>C(()=>import("./landing-CLCn5RB6.js"),[]),"../locales/es/navbar.json":()=>C(()=>import("./navbar-BthOgS2j.js"),[]),"../locales/es/newsletter.json":()=>C(()=>import("./newsletter-C7lJho9h.js"),[]),"../locales/es/notfound.json":()=>C(()=>import("./notfound-B_Gzz6gc.js"),[]),"../locales/es/payment-status.json":()=>C(()=>import("./payment-status-B32pY1CE.js"),[]),"../locales/es/privacy.json":()=>C(()=>import("./privacy-CLStpuoK.js"),[]),"../locales/es/progress.json":()=>C(()=>import("./progress-BcsPwhns.js"),[]),"../locales/es/reading-cart.json":()=>C(()=>import("./reading-cart-GwQBdftB.js"),[]),"../locales/es/refund.json":()=>C(()=>import("./refund-CHPr9L0z.js"),[]),"../locales/es/research.json":()=>C(()=>import("./research-DqNLNc5F.js"),[]),"../locales/es/stories.json":()=>C(()=>import("./stories-CVRvuLz2.js"),[]),"../locales/es/story-maker.json":()=>C(()=>import("./story-maker-C5NBEexq.js"),[]),"../locales/es/story-reader.json":()=>C(()=>import("./story-reader-BbMNfAUy.js"),[]),"../locales/es/subscription.json":()=>C(()=>import("./subscription-CZhn2cU7.js"),[]),"../locales/es/terms.json":()=>C(()=>import("./terms-CTcFR6yJ.js"),[]),"../locales/es/text-checker.json":()=>C(()=>import("./text-checker-CLT6Nwe8.js"),[]),"../locales/es/themes.json":()=>C(()=>import("./themes-DCZTUMpt.js"),[]),"../locales/es/vocabulary.json":()=>C(()=>import("./vocabulary-CP1qAXI7.js"),[]),"../locales/ja/about.json":()=>C(()=>import("./about-Ct4afmar.js"),[]),"../locales/ja/auth.json":()=>C(()=>import("./auth-dV0lN-LO.js"),[]),"../locales/ja/blog.json":()=>C(()=>import("./blog-BZZnUCkp.js"),[]),"../locales/ja/contact.json":()=>C(()=>import("./contact-BBFLer9D.js"),[]),"../locales/ja/footer.json":()=>C(()=>import("./footer-D-BMgFYB.js"),[]),"../locales/ja/generation.json":()=>C(()=>import("./generation-Pdrq8ZB-.js"),[]),"../locales/ja/home.json":()=>C(()=>import("./home-xirgBP8l.js"),[]),"../locales/ja/improve-reading.json":()=>C(()=>import("./improve-reading-BsRzsehI.js"),[]),"../locales/ja/landing.json":()=>C(()=>import("./landing-COdzYQPO.js"),[]),"../locales/ja/navbar.json":()=>C(()=>import("./navbar-FFSzRUGt.js"),[]),"../locales/ja/newsletter.json":()=>C(()=>import("./newsletter-DJBHGpWh.js"),[]),"../locales/ja/notfound.json":()=>C(()=>import("./notfound-Wrvu-KxG.js"),[]),"../locales/ja/payment-status.json":()=>C(()=>import("./payment-status-BwvT-6IN.js"),[]),"../locales/ja/privacy.json":()=>C(()=>import("./privacy-DI-ylDP2.js"),[]),"../locales/ja/progress.json":()=>C(()=>import("./progress-7pJUl9iw.js"),[]),"../locales/ja/reading-cart.json":()=>C(()=>import("./reading-cart-D1G8OPkf.js"),[]),"../locales/ja/refund.json":()=>C(()=>import("./refund-CYHonIjU.js"),[]),"../locales/ja/research.json":()=>C(()=>import("./research-CivulXLD.js"),[]),"../locales/ja/stories.json":()=>C(()=>import("./stories-xVkqpFyE.js"),[]),"../locales/ja/story-maker.json":()=>C(()=>import("./story-maker-Cji5XC0z.js"),[]),"../locales/ja/story-reader.json":()=>C(()=>import("./story-reader-CfRYkEJG.js"),[]),"../locales/ja/subscription.json":()=>C(()=>import("./subscription-BlMCO5U6.js"),[]),"../locales/ja/terms.json":()=>C(()=>import("./terms-CssJnV-J.js"),[]),"../locales/ja/text-checker.json":()=>C(()=>import("./text-checker-DSz7QeV-.js"),[]),"../locales/ja/themes.json":()=>C(()=>import("./themes-B3Dt6ojX.js"),[]),"../locales/ja/vocabulary.json":()=>C(()=>import("./vocabulary-CA_-k2Kb.js"),[]),"../locales/zh/about.json":()=>C(()=>import("./about-wynC5o3J.js"),[]),"../locales/zh/auth.json":()=>C(()=>import("./auth-CvR0HAI4.js"),[]),"../locales/zh/blog.json":()=>C(()=>import("./blog-BuGisSqj.js"),[]),"../locales/zh/contact.json":()=>C(()=>import("./contact-TRjNzjJw.js"),[]),"../locales/zh/footer.json":()=>C(()=>import("./footer-CZTn0yOr.js"),[]),"../locales/zh/generation.json":()=>C(()=>import("./generation-DmueeL_y.js"),[]),"../locales/zh/home.json":()=>C(()=>import("./home-BKeSHLWz.js"),[]),"../locales/zh/improve-reading.json":()=>C(()=>import("./improve-reading-Dv7w1L9N.js"),[]),"../locales/zh/landing.json":()=>C(()=>import("./landing-CInxhw3d.js"),[]),"../locales/zh/navbar.json":()=>C(()=>import("./navbar-BrsdzXsD.js"),[]),"../locales/zh/newsletter.json":()=>C(()=>import("./newsletter-wGuJRvTc.js"),[]),"../locales/zh/notfound.json":()=>C(()=>import("./notfound-BHjB4e-M.js"),[]),"../locales/zh/payment-status.json":()=>C(()=>import("./payment-status-ubxHsmFd.js"),[]),"../locales/zh/privacy.json":()=>C(()=>import("./privacy-y1aPYI4v.js"),[]),"../locales/zh/progress.json":()=>C(()=>import("./progress-BmrsDT3B.js"),[]),"../locales/zh/reading-cart.json":()=>C(()=>import("./reading-cart-DvJQrLvq.js"),[]),"../locales/zh/refund.json":()=>C(()=>import("./refund-VHDYVAUj.js"),[]),"../locales/zh/research.json":()=>C(()=>import("./research-funY68fu.js"),[]),"../locales/zh/stories.json":()=>C(()=>import("./stories-DZir73N6.js"),[]),"../locales/zh/story-maker.json":()=>C(()=>import("./story-maker-CwhU-fq9.js"),[]),"../locales/zh/story-reader.json":()=>C(()=>import("./story-reader-Kw0wr9wN.js"),[]),"../locales/zh/subscription.json":()=>C(()=>import("./subscription-Dm4UZQV5.js"),[]),"../locales/zh/terms.json":()=>C(()=>import("./terms-oJg-2cMy.js"),[]),"../locales/zh/text-checker.json":()=>C(()=>import("./text-checker-FwX8r5pE.js"),[]),"../locales/zh/themes.json":()=>C(()=>import("./themes-QUDfBGZx.js"),[]),"../locales/zh/vocabulary.json":()=>C(()=>import("./vocabulary-BWISugwZ.js"),[])}),`../locales/${t}/${e}.json`,4))).use(a6).init({lng:L6,fallbackLng:"en",defaultNS:"home",ns:[...bj],partialBundledLanguages:!0,load:"languageOnly",supportedLngs:Qc,nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!0}});const Sj=g.createContext(void 0),N6=({children:t})=>{const{i18n:e}=Lt(),n=ya(),r=Un(),[s,i]=g.useState(()=>Fv(typeof window<"u"?window.location.pathname:"/")),o=[];g.useEffect(()=>{const c=Fv(r.pathname),u=Ej(r.pathname);i(c);let d=!1;return e.loadNamespaces(u).finally(()=>{!d&&e.language!==c?e.changeLanguage(c):d||e.changeLanguage(c)}),()=>{d=!0}},[r.pathname,e]);const a=c=>{i(c),e.changeLanguage(c);let u=r.pathname;u.startsWith("/bn/")?u=u.substring(3):u==="/bn"?u="/":u.startsWith("/es/")?u=u.substring(3):u==="/es"?u="/":u.startsWith("/zh/")?u=u.substring(3):u==="/zh"?u="/":u.startsWith("/ja/")?u=u.substring(3):u==="/ja"&&(u="/");const d=o.includes(u);if(c==="bn"){if(!d){const f=u==="/"?"/bn/":`/bn${u}`;n(f)}}else if(c==="es"){if(!d){const f=u==="/"?"/es/":`/es${u}`;n(f)}}else if(c==="zh"){if(!d){const f=u==="/"?"/zh/":`/zh${u}`;n(f)}}else if(c==="ja"){if(!d){const f=u==="/"?"/ja/":`/ja${u}`;n(f)}}else n(u==="/"?"/":u)},l=c=>{const u=o.includes(c);return s==="bn"&&!u?c==="/"?"/bn/":`/bn${c}`:s==="es"&&!u?c==="/"?"/es/":`/es${c}`:s==="zh"&&!u?c==="/"?"/zh/":`/zh${c}`:s==="ja"&&!u?c==="/"?"/ja/":`/ja${c}`:c};return h.jsx(Sj.Provider,{value:{currentLanguage:s,changeLanguage:a,getLocalizedPath:l},children:t})},Ta=()=>{const t=g.useContext(Sj);if(t===void 0)throw new Error("useLanguage must be used within a LanguageProvider");return t},Tj=g.createContext({targetElement:null,setLumiTarget:()=>{},onTargetReached:void 0,setOnTargetReached:()=>{}}),Pj=()=>g.useContext(Tj),D6=({children:t})=>{const[e,n]=g.useState(null),r=g.useRef(void 0),[,s]=g.useState(0),i=g.useCallback(a=>{n(a)},[]),o=g.useCallback(a=>{r.current=a,s(l=>l+1)},[]);return h.jsx(Tj.Provider,{value:{targetElement:e,setLumiTarget:i,onTargetReached:r.current,setOnTargetReached:o},children:t})},q0=g.createContext({});function Bs(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const Y0=typeof window<"u",Su=Y0?g.useLayoutEffect:g.useEffect,Qf=g.createContext(null),Tu=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class M6 extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=r instanceof HTMLElement&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=s-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function $6({children:t,isPresent:e,anchorX:n}){const r=g.useId(),s=g.useRef(null),i=g.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=g.useContext(Tu);return g.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u,right:d}=i.current;if(e||!s.current||!a||!l)return;const f=n==="left"?`left: ${u}`:`right: ${d}`;s.current.dataset.motionPopId=r;const p=document.createElement("style");return o&&(p.nonce=o),document.head.appendChild(p),p.sheet&&p.sheet.insertRule(`
[data-motion-pop-id="${r}"] {
position: absolute !important;
width: ${a}px !important;
height: ${l}px !important;
${f}px !important;
top: ${c}px !important;
}
`),()=>{document.head.removeChild(p)}},[e]),h.jsx(M6,{isPresent:e,childRef:s,sizeRef:i,children:g.cloneElement(t,{ref:s})})}const F6=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=Bs(V6),c=g.useId(),u=g.useCallback(f=>{l.set(f,!0);for(const p of l.values())if(!p)return;r&&r()},[l,r]),d=g.useMemo(()=>({id:c,initial:e,isPresent:n,custom:s,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),i?[Math.random(),u]:[n,u]);return g.useMemo(()=>{l.forEach((f,p)=>l.set(p,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(t=h.jsx($6,{isPresent:n,anchorX:a,children:t})),h.jsx(Qf.Provider,{value:d,children:t})};function V6(){return new Map}function Cj(t=!0){const e=g.useContext(Qf);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const o=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const gd=t=>t.key||"";function L1(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const U6=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=Cj(o),u=g.useMemo(()=>L1(t),[t]),d=o&&!l?[]:u.map(gd),f=g.useRef(!0),p=g.useRef(u),m=Bs(()=>new Map),[v,w]=g.useState(u),[y,_]=g.useState(u);Su(()=>{f.current=!1,p.current=u;for(let b=0;b<y.length;b++){const S=gd(y[b]);d.includes(S)?m.delete(S):m.get(S)!==!0&&m.set(S,!1)}},[y,d.length,d.join("-")]);const x=[];if(u!==v){let b=[...u];for(let S=0;S<y.length;S++){const T=y[S],P=gd(T);d.includes(P)||(b.splice(S,0,T),x.push(T))}return i==="wait"&&x.length&&(b=x),_(L1(b)),w(u),null}const{forceRender:E}=g.useContext(q0);return h.jsx(h.Fragment,{children:y.map(b=>{const S=gd(b),T=o&&!l?!1:u===y||d.includes(S),P=()=>{if(m.has(S))m.set(S,!0);else return;let I=!0;m.forEach(k=>{k||(I=!1)}),I&&(E?.(),_(p.current),o&&c?.(),r&&r())};return h.jsx(F6,{isPresent:T,initial:!f.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,onExitComplete:T?void 0:P,anchorX:a,children:b},S)})})};function Q0(t,e){t.indexOf(e)===-1&&t.push(e)}function X0(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let z6=()=>{},Vv=()=>{};const B6={skipAnimations:!1,useManualTiming:!1};function J0(t){let e;return()=>(e===void 0&&(e=t()),e)}const Wt=t=>t,ca=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Z0{constructor(){this.subscriptions=[]}add(e){return Q0(this.subscriptions,e),()=>X0(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const gr=t=>t*1e3,mr=t=>t/1e3;function e_(t,e){return e?t*(1e3/e):0}const kj=J0(()=>window.ScrollTimeline!==void 0);class H6{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(s=>{if(kj()&&s.attachTimeline)return s.attachTimeline(e);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class W6 extends H6{then(e,n){return this.finished.finally(e).then(()=>{})}}const N1={value:null,addProjectionMetrics:null},t_=t=>Array.isArray(t)&&typeof t[0]=="number",K6={};function G6(t,e){const n=J0(t);return()=>K6[e]??n()}const Xc=G6(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Rj=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=t(i/(s-1))+", ";return`linear(${r.substring(0,r.length-2)})`},zl=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Uv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zl([0,.65,.55,1]),circOut:zl([.55,0,1,.45]),backIn:zl([.31,.01,.66,-.59]),backOut:zl([.33,1.53,.69,.99])};function jj(t,e){if(t)return typeof t=="function"&&Xc()?Rj(t,e):t_(t)?zl(t):Array.isArray(t)?t.map(n=>jj(n,e)||Uv.easeOut):Uv[t]}function q6(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const d=jj(a,s);return Array.isArray(d)&&(u.easing=d),t.animate(u,{delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:c})}function n_(t){return typeof t=="function"&&"applyToOptions"in t}function r_(t,e){return t?.[e]??t?.default??t}const Qh=2e4;function s_(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Qh;)e+=n,r=t.next(e);return e>=Qh?1/0:e}function Y6(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(s_(r),Qh);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:mr(s)}}function Aj(t){return!!(typeof t=="function"&&Xc()||!t||typeof t=="string"&&(t in Uv||Xc())||t_(t)||Array.isArray(t)&&t.every(Aj))}function D1(t,e){t.timeline=e,t.onfinish=null}const md=["read","resolveKeyframes","update","preRender","render","postRender"];function Q6(t,e){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){o.has(d)&&(u.schedule(d),t()),l++,d(a)}const u={schedule:(d,f=!1,p=!1)=>{const v=p&&s?n:r;return f&&o.add(d),v.has(d)||v.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(a=d,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),e&&N1.value&&N1.value.frameloop[e].push(l),l=0,n.clear(),s=!1,i&&(i=!1,u.process(d))}};return u}const X6=40;function Oj(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=md.reduce((y,_)=>(y[_]=Q6(i,e?_:void 0),y),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=o,p=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,X6),1),s.timestamp=y,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),d.process(s),f.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(p))},m=()=>{n=!0,r=!0,s.isProcessing||t(p)};return{schedule:md.reduce((y,_)=>{const x=o[_];return y[_]=(E,b=!1,S=!1)=>(n||m(),x.schedule(E,b,S)),y},{}),cancel:y=>{for(let _=0;_<md.length;_++)o[md[_]].cancel(y)},state:s,steps:o}}const{schedule:ge,cancel:Vn,state:it,steps:mg}=Oj(typeof requestAnimationFrame<"u"?requestAnimationFrame:Wt,!0),{schedule:i_,cancel:QQ}=Oj(queueMicrotask,!1);let Wd;function J6(){Wd=void 0}const vr={now:()=>(Wd===void 0&&vr.set(it.isProcessing||B6.useManualTiming?it.timestamp:performance.now()),Wd),set:t=>{Wd=t,queueMicrotask(J6)}},Cn={x:!1,y:!1};function Ij(){return Cn.x||Cn.y}function Z6(t){return t==="x"||t==="y"?Cn[t]?null:(Cn[t]=!0,()=>{Cn[t]=!1}):Cn.x||Cn.y?null:(Cn.x=Cn.y=!0,()=>{Cn.x=Cn.y=!1})}function o_(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=n?.[t]??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function Lj(t,e){const n=o_(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function M1(t){return!(t.pointerType==="touch"||Ij())}function e8(t,e,n={}){const[r,s,i]=Lj(t,n),o=a=>{if(!M1(a))return;const{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;const u=d=>{M1(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}const Nj=(t,e)=>e?t===e?!0:Nj(t,e.parentElement):!1,a_=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,t8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function n8(t){return t8.has(t.tagName)||t.tabIndex!==-1}const Bl=new WeakSet;function $1(t){return e=>{e.key==="Enter"&&t(e)}}function vg(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const r8=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=$1(()=>{if(Bl.has(n))return;vg(n,"down");const s=$1(()=>{vg(n,"up")}),i=()=>vg(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function F1(t){return a_(t)&&!Ij()}function s8(t,e,n={}){const[r,s,i]=Lj(t,n),o=a=>{const l=a.currentTarget;if(!F1(a)||Bl.has(l))return;Bl.add(l);const c=e(l,a),u=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!F1(p)||!Bl.has(l))&&(Bl.delete(l),typeof c=="function"&&c(p,{success:m}))},d=p=>{u(p,l===window||l===document||n.useGlobalTarget||Nj(l,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,s),window.addEventListener("pointercancel",f,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),a instanceof HTMLElement&&(a.addEventListener("focus",c=>r8(c,s)),!n8(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}const V1=30,i8=t=>!isNaN(parseFloat(t)),uc={current:void 0};class o8{constructor(e,n={}){this.version="12.6.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=vr.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=vr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=i8(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Z0);const r=this.events[e].add(n);return e==="change"?()=>{r(),ge.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return uc.current&&uc.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=vr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>V1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,V1);return e_(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function hr(t,e){return new o8(t,e)}const Dj=g.createContext({strict:!1}),U1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ua={};for(const t in U1)ua[t]={isEnabled:e=>U1[t].some(n=>!!e[n])};function a8(t){for(const e in t)ua[e]={...ua[e],...t[e]}}const l8=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Xh(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||l8.has(t)}let Mj=t=>!Xh(t);function c8(t){t&&(Mj=e=>e.startsWith("on")?!Xh(e):t(e))}try{c8(require("@emotion/is-prop-valid").default)}catch{}function u8(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(Mj(s)||n===!0&&Xh(s)||!e&&!Xh(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function d8(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,s)=>s==="create"?t:(e.has(s)||e.set(s,t(s)),e.get(s))})}const Xf=g.createContext({});function Jf(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Jc(t){return typeof t=="string"||Array.isArray(t)}const l_=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],c_=["initial",...l_];function Zf(t){return Jf(t.animate)||c_.some(e=>Jc(t[e]))}function $j(t){return!!(Zf(t)||t.variants)}function h8(t,e){if(Zf(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Jc(n)?n:void 0,animate:Jc(r)?r:void 0}}return t.inherit!==!1?e:{}}function f8(t){const{initial:e,animate:n}=h8(t,g.useContext(Xf));return g.useMemo(()=>({initial:e,animate:n}),[z1(e),z1(n)])}function z1(t){return Array.isArray(t)?t.join(" "):t}const p8=Symbol.for("motionComponentSymbol");function wo(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function g8(t,e,n){return g.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):wo(n)&&(n.current=r))},[e])}const u_=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),m8="framerAppearId",Fj="data-"+u_(m8),Vj=g.createContext({});function v8(t,e,n,r,s){const{visualElement:i}=g.useContext(Xf),o=g.useContext(Dj),a=g.useContext(Qf),l=g.useContext(Tu).reducedMotion,c=g.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(t,{visualState:e,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=g.useContext(Vj);u&&!u.projection&&s&&(u.type==="html"||u.type==="svg")&&y8(c.current,n,s,d);const f=g.useRef(!1);g.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const p=n[Fj],m=g.useRef(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return Su(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),i_.render(u.render),m.current&&u.animationState&&u.animationState.animateChanges())}),g.useEffect(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),m.current=!1))}),u}function y8(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Uj(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&wo(a),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Uj(t){if(t)return t.options.allowProjection!==!1?t.projection:Uj(t.parent)}function _8({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&a8(t);function i(a,l){let c;const u={...g.useContext(Tu),...a,layoutId:w8(a)},{isStatic:d}=u,f=f8(a),p=r(a,d);if(!d&&Y0){x8();const m=b8(u);c=m.MeasureLayout,f.visualElement=v8(s,p,u,e,m.ProjectionNode)}return h.jsxs(Xf.Provider,{value:f,children:[c&&f.visualElement?h.jsx(c,{visualElement:f.visualElement,...u}):null,n(s,a,g8(p,f.visualElement,l),p,d,f.visualElement)]})}i.displayName=`motion.${typeof s=="string"?s:`create(${s.displayName??s.name??""})`}`;const o=g.forwardRef(i);return o[p8]=s,o}function w8({layoutId:t}){const e=g.useContext(q0).id;return e&&t!==void 0?e+"-"+t:t}function x8(t,e){g.useContext(Dj).strict}function b8(t){const{drag:e,layout:n}=ua;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const zj=t=>e=>typeof e=="string"&&e.startsWith(t),d_=zj("--"),E8=zj("var(--"),h_=t=>E8(t)?S8.test(t.split("/*")[0].trim()):!1,S8=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Zc={};function T8(t){for(const e in t)Zc[e]=t[e],d_(e)&&(Zc[e].isCSSVariable=!0)}const Pa=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Di=new Set(Pa);function Bj(t,{layout:e,layoutId:n}){return Di.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Zc[t]||t==="opacity")}const at=t=>!!(t&&t.getVelocity),Hj=(t,e)=>e&&typeof t=="number"?e.transform(t):t,xr=(t,e,n)=>n>e?e:n<t?t:n,Ca={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},eu={...Ca,transform:t=>xr(0,1,t)},vd={...Ca,default:1},Pu=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),as=Pu("deg"),yr=Pu("%"),te=Pu("px"),P8=Pu("vh"),C8=Pu("vw"),B1={...yr,parse:t=>yr.parse(t)/100,transform:t=>yr.transform(t*100)},k8={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,radius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,top:te,right:te,bottom:te,left:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,backgroundPositionX:te,backgroundPositionY:te},R8={rotate:as,rotateX:as,rotateY:as,rotateZ:as,scale:vd,scaleX:vd,scaleY:vd,scaleZ:vd,skew:as,skewX:as,skewY:as,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:eu,originX:B1,originY:B1,originZ:te},H1={...Ca,transform:Math.round},f_={...k8,...R8,zIndex:H1,size:te,fillOpacity:eu,strokeOpacity:eu,numOctaves:H1},j8={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},A8=Pa.length;function O8(t,e,n){let r="",s=!0;for(let i=0;i<A8;i++){const o=Pa[i],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Hj(a,f_[o]);if(!l){s=!1;const u=j8[o]||o;r+=`${u}(${c}) `}n&&(e[o]=c)}}return r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function p_(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(Di.has(l)){o=!0;continue}else if(d_(l)){s[l]=c;continue}else{const u=Hj(c,f_[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(e.transform||(o||n?r.transform=O8(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const g_=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Wj(t,e,n){for(const r in e)!at(e[r])&&!Bj(r,n)&&(t[r]=e[r])}function I8({transformTemplate:t},e){return g.useMemo(()=>{const n=g_();return p_(n,e,t),Object.assign({},n.vars,n.style)},[e])}function L8(t,e){const n=t.style||{},r={};return Wj(r,n,t),Object.assign(r,I8(t,e)),r}function N8(t,e){const n={},r=L8(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const D8=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function m_(t){return typeof t!="string"||t.includes("-")?!1:!!(D8.indexOf(t)>-1||/[A-Z]/u.test(t))}const M8={offset:"stroke-dashoffset",array:"stroke-dasharray"},$8={offset:"strokeDashoffset",array:"strokeDasharray"};function F8(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?M8:$8;t[i.offset]=te.transform(-r);const o=te.transform(e),a=te.transform(n);t[i.array]=`${o} ${a}`}function W1(t,e,n){return typeof t=="string"?t:te.transform(e+n*t)}function V8(t,e,n){const r=W1(e,t.x,t.width),s=W1(n,t.y,t.height);return`${r} ${s}`}function v_(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(p_(t,c,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:p,dimensions:m}=t;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=V8(m,s!==void 0?s:.5,i!==void 0?i:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&F8(f,o,a,l,!1)}const Kj=()=>({...g_(),attrs:{}}),y_=t=>typeof t=="string"&&t.toLowerCase()==="svg";function U8(t,e,n,r){const s=g.useMemo(()=>{const i=Kj();return v_(i,e,y_(r),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};Wj(i,t.style,t),s.style={...i,...s.style}}return s}function z8(t=!1){return(n,r,s,{latestValues:i},o)=>{const l=(m_(n)?U8:N8)(r,i,o,n),c=u8(r,typeof n=="string",t),u=n!==g.Fragment?{...c,...l,ref:s}:{},{children:d}=r,f=g.useMemo(()=>at(d)?d.get():d,[d]);return g.createElement(n,{...u,children:f})}}function K1(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function __(t,e,n,r){if(typeof e=="function"){const[s,i]=K1(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=K1(r);e=e(n!==void 0?n:t.custom,s,i)}return e}const zv=t=>Array.isArray(t),B8=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),H8=t=>zv(t)?t[t.length-1]||0:t;function Kd(t){const e=at(t)?t.get():t;return B8(e)?e.toValue():e}function W8({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,s,i){const o={latestValues:K8(r,s,i,t),renderState:e()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Gj=t=>(e,n)=>{const r=g.useContext(Xf),s=g.useContext(Qf),i=()=>W8(t,e,r,s);return n?i():Bs(i)};function K8(t,e,n,r){const s={},i=r(t,{});for(const f in i)s[f]=Kd(i[f]);let{initial:o,animate:a}=t;const l=Zf(t),c=$j(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!Jf(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const m=__(t,f[p]);if(m){const{transitionEnd:v,transition:w,...y}=m;for(const _ in y){let x=y[_];if(Array.isArray(x)){const E=u?x.length-1:0;x=x[E]}x!==null&&(s[_]=x)}for(const _ in v)s[_]=v[_]}}}return s}function w_(t,e,n){const{style:r}=t,s={};for(const i in r)(at(r[i])||e.style&&at(e.style[i])||Bj(i,t)||n?.getValue(i)?.liveStyle!==void 0)&&(s[i]=r[i]);return s}const G8={useVisualState:Gj({scrapeMotionValuesFromProps:w_,createRenderState:g_})};function qj(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}function Yj(t,{style:e,vars:n},r,s){Object.assign(t.style,e,s&&s.getProjectionStyles(r));for(const i in n)t.style.setProperty(i,n[i])}const Qj=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Xj(t,e,n,r){Yj(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(Qj.has(s)?s:u_(s),e.attrs[s])}function Jj(t,e,n){const r=w_(t,e,n);for(const s in t)if(at(t[s])||at(e[s])){const i=Pa.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}const G1=["x","y","width","height","cx","cy","r"],q8={useVisualState:Gj({scrapeMotionValuesFromProps:Jj,createRenderState:Kj,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!t.drag;if(!i){for(const a in s)if(Di.has(a)){i=!0;break}}if(!i)return;let o=!e;if(e)for(let a=0;a<G1.length;a++){const l=G1[a];t[l]!==e[l]&&(o=!0)}o&&ge.read(()=>{qj(n,r),ge.render(()=>{v_(r,s,y_(n.tagName),t.transformTemplate),Xj(n,r)})})}})};function Y8(t,e){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...m_(r)?q8:G8,preloadedFeatures:t,useRender:z8(s),createVisualElement:e,Component:r};return _8(o)}}function tu(t,e,n){const r=t.getProps();return __(r,e,n!==void 0?n:r.custom,t)}const Zj=new Set(["width","height","top","left","right","bottom",...Pa]);function Q8(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,hr(n))}function X8(t,e){const n=tu(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=H8(i[o]);Q8(t,o,a)}}function J8(t){return!!(at(t)&&t.add)}function Bv(t,e){const n=t.getValue("willChange");if(J8(n))return n.add(e)}function eA(t){return t.props[Fj]}const tA=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Z8=1e-7,eH=12;function tH(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=tA(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>Z8&&++a<eH);return o}function Cu(t,e,n,r){if(t===e&&n===r)return Wt;const s=i=>tH(i,0,1,t,n);return i=>i===0||i===1?i:tA(s(i),e,r)}const nA=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,rA=t=>e=>1-t(1-e),sA=Cu(.33,1.53,.69,.99),x_=rA(sA),iA=nA(x_),oA=t=>(t*=2)<1?.5*x_(t):.5*(2-Math.pow(2,-10*(t-1))),b_=t=>1-Math.sin(Math.acos(t)),aA=rA(b_),lA=nA(b_),cA=t=>/^0[^.\s]+$/u.test(t);function nH(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||cA(t):!0}const dc=t=>Math.round(t*1e5)/1e5,E_=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rH(t){return t==null}const sH=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,S_=(t,e)=>n=>!!(typeof n=="string"&&sH.test(n)&&n.startsWith(t)||e&&!rH(n)&&Object.prototype.hasOwnProperty.call(n,e)),uA=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(E_);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},iH=t=>xr(0,255,t),yg={...Ca,transform:t=>Math.round(iH(t))},ui={test:S_("rgb","red"),parse:uA("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+yg.transform(t)+", "+yg.transform(e)+", "+yg.transform(n)+", "+dc(eu.transform(r))+")"};function oH(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Hv={test:S_("#"),parse:oH,transform:ui.transform},xo={test:S_("hsl","hue"),parse:uA("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+yr.transform(dc(e))+", "+yr.transform(dc(n))+", "+dc(eu.transform(r))+")"},bt={test:t=>ui.test(t)||Hv.test(t)||xo.test(t),parse:t=>ui.test(t)?ui.parse(t):xo.test(t)?xo.parse(t):Hv.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ui.transform(t):xo.transform(t)},aH=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function lH(t){return isNaN(t)&&typeof t=="string"&&(t.match(E_)?.length||0)+(t.match(aH)?.length||0)>0}const dA="number",hA="color",cH="var",uH="var(",q1="${}",dH=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function nu(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(dH,l=>(bt.test(l)?(r.color.push(i),s.push(hA),n.push(bt.parse(l))):l.startsWith(uH)?(r.var.push(i),s.push(cH),n.push(l)):(r.number.push(i),s.push(dA),n.push(parseFloat(l))),++i,q1)).split(q1);return{values:n,split:a,indexes:r,types:s}}function fA(t){return nu(t).values}function pA(t){const{split:e,types:n}=nu(t),r=e.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=e[o],s[o]!==void 0){const a=n[o];a===dA?i+=dc(s[o]):a===hA?i+=bt.transform(s[o]):i+=s[o]}return i}}const hH=t=>typeof t=="number"?0:t;function fH(t){const e=fA(t);return pA(t)(e.map(hH))}const Hs={test:lH,parse:fA,createTransformer:pA,getAnimatableNone:fH},pH=new Set(["brightness","contrast","saturate","opacity"]);function gH(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(E_)||[];if(!r)return t;const s=n.replace(r,"");let i=pH.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const mH=/\b([a-z-]*)\(.*?\)/gu,Wv={...Hs,getAnimatableNone:t=>{const e=t.match(mH);return e?e.map(gH).join(" "):t}},vH={...f_,color:bt,backgroundColor:bt,outlineColor:bt,fill:bt,stroke:bt,borderColor:bt,borderTopColor:bt,borderRightColor:bt,borderBottomColor:bt,borderLeftColor:bt,filter:Wv,WebkitFilter:Wv},gA=t=>vH[t];function mA(t,e){let n=gA(t);return n!==Wv&&(n=Hs),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const yH=new Set(["auto","none","0"]);function _H(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!yH.has(i)&&nu(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=mA(n,s)}const di=t=>t*180/Math.PI,Kv=t=>{const e=di(Math.atan2(t[1],t[0]));return Gv(e)},wH={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Kv,rotateZ:Kv,skewX:t=>di(Math.atan(t[1])),skewY:t=>di(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Gv=t=>(t=t%360,t<0&&(t+=360),t),Y1=Kv,Q1=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),X1=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),xH={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Q1,scaleY:X1,scale:t=>(Q1(t)+X1(t))/2,rotateX:t=>Gv(di(Math.atan2(t[6],t[5]))),rotateY:t=>Gv(di(Math.atan2(-t[2],t[0]))),rotateZ:Y1,rotate:Y1,skewX:t=>di(Math.atan(t[4])),skewY:t=>di(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function J1(t){return t.includes("scale")?1:0}function qv(t,e){if(!t||t==="none")return J1(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=xH,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=wH,s=a}if(!s)return J1(e);const i=r[e],o=s[1].split(",").map(EH);return typeof i=="function"?i(o):o[i]}const bH=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return qv(n,e)};function EH(t){return parseFloat(t.trim())}const Z1=t=>t===Ca||t===te,SH=new Set(["x","y","z"]),TH=Pa.filter(t=>!SH.has(t));function PH(t){const e=[];return TH.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const da={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>qv(e,"x"),y:(t,{transform:e})=>qv(e,"y")};da.translateX=da.x;da.translateY=da.y;const xi=new Set;let Yv=!1,Qv=!1;function vA(){if(Qv){const t=Array.from(xi).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=PH(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{r.getValue(i)?.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Qv=!1,Yv=!1,xi.forEach(t=>t.complete()),xi.clear()}function yA(){xi.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Qv=!0)})}function CH(){yA(),vA()}class T_{constructor(e,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(xi.add(this),Yv||(Yv=!0,ge.read(yA),ge.resolveKeyframes(vA))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){const o=s?.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),s&&o===void 0&&s.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),xi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,xi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const _A=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),kH=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function RH(t){const e=kH.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function wA(t,e,n=1){const[r,s]=RH(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return _A(o)?parseFloat(o):o}return h_(s)?wA(s,e,n+1):s}const xA=t=>e=>e.test(t),jH={test:t=>t==="auto",parse:t=>t},bA=[Ca,te,yr,as,C8,P8,jH],eE=t=>bA.find(xA(t));class EA extends T_{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),h_(c))){const u=wA(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Zj.has(r)||e.length!==2)return;const[s,i]=e,o=eE(s),a=eE(i);if(o!==a)if(Z1(o)&&Z1(a))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)nH(e[s])&&r.push(s);r.length&&_H(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=da[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=da[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}const tE=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Hs.test(t)||t==="0")&&!t.startsWith("url("));function AH(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function OH(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=tE(s,e),a=tE(i,e);return!o||!a?!1:AH(t)||(n==="spring"||n_(n))&&r}const IH=t=>t!==null;function ep(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter(IH),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const LH=40;class SA{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=vr.now(),this.options={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>LH?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&CH(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=vr.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!OH(e,r,s,i))if(o)this.options.duration=0;else{l&&l(ep(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Fe=(t,e,n)=>t+(e-t)*n;function _g(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function NH({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=_g(l,a,t+1/3),i=_g(l,a,t),o=_g(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Jh(t,e){return n=>n>0?e:t}const wg=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},DH=[Hv,ui,xo],MH=t=>DH.find(e=>e.test(t));function nE(t){const e=MH(t);if(!e)return!1;let n=e.parse(t);return e===xo&&(n=NH(n)),n}const rE=(t,e)=>{const n=nE(t),r=nE(e);if(!n||!r)return Jh(t,e);const s={...n};return i=>(s.red=wg(n.red,r.red,i),s.green=wg(n.green,r.green,i),s.blue=wg(n.blue,r.blue,i),s.alpha=Fe(n.alpha,r.alpha,i),ui.transform(s))},$H=(t,e)=>n=>e(t(n)),ku=(...t)=>t.reduce($H),Xv=new Set(["none","hidden"]);function FH(t,e){return Xv.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function VH(t,e){return n=>Fe(t,e,n)}function P_(t){return typeof t=="number"?VH:typeof t=="string"?h_(t)?Jh:bt.test(t)?rE:BH:Array.isArray(t)?TA:typeof t=="object"?bt.test(t)?rE:UH:Jh}function TA(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>P_(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function UH(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=P_(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function zH(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],a=t.values[o]??0;n[s]=a,r[i]++}return n}const BH=(t,e)=>{const n=Hs.createTransformer(e),r=nu(t),s=nu(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Xv.has(t)&&!s.values.length||Xv.has(e)&&!r.values.length?FH(t,e):ku(TA(zH(r,s),s.values),n):Jh(t,e)};function PA(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Fe(t,e,n):P_(t)(t,e)}const HH=5;function CA(t,e,n){const r=Math.max(e-HH,0);return e_(n-t(r),e-r)}const We={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},xg=.001;function WH({duration:t=We.duration,bounce:e=We.bounce,velocity:n=We.velocity,mass:r=We.mass}){let s,i,o=1-e;o=xr(We.minDamping,We.maxDamping,o),t=xr(We.minDuration,We.maxDuration,mr(t)),o<1?(s=c=>{const u=c*o,d=u*t,f=u-n,p=Jv(c,o),m=Math.exp(-d);return xg-f/p*m},i=c=>{const d=c*o*t,f=d*n+n,p=Math.pow(o,2)*Math.pow(c,2)*t,m=Math.exp(-d),v=Jv(Math.pow(c,2),o);return(-s(c)+xg>0?-1:1)*((f-p)*m)/v}):(s=c=>{const u=Math.exp(-c*t),d=(c-n)*t+1;return-xg+u*d},i=c=>{const u=Math.exp(-c*t),d=(n-c)*(t*t);return u*d});const a=5/t,l=GH(s,i,a);if(t=gr(t),isNaN(l))return{stiffness:We.stiffness,damping:We.damping,duration:t};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:t}}}const KH=12;function GH(t,e,n){let r=n;for(let s=1;s<KH;s++)r=r-t(r)/e(r);return r}function Jv(t,e){return t*Math.sqrt(1-e*e)}const qH=["duration","bounce"],YH=["stiffness","damping","mass"];function sE(t,e){return e.some(n=>t[n]!==void 0)}function QH(t){let e={velocity:We.velocity,stiffness:We.stiffness,damping:We.damping,mass:We.mass,isResolvedFromDuration:!1,...t};if(!sE(t,YH)&&sE(t,qH))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*xr(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:We.mass,stiffness:s,damping:i}}else{const n=WH(t);e={...e,...n,mass:We.mass},e.isResolvedFromDuration=!0}return e}function Zh(t=We.visualDuration,e=We.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=QH({...n,velocity:-mr(n.velocity||0)}),m=f||0,v=c/(2*Math.sqrt(l*u)),w=o-i,y=mr(Math.sqrt(l/u)),_=Math.abs(w)<5;r||(r=_?We.restSpeed.granular:We.restSpeed.default),s||(s=_?We.restDelta.granular:We.restDelta.default);let x;if(v<1){const b=Jv(y,v);x=S=>{const T=Math.exp(-v*y*S);return o-T*((m+v*y*w)/b*Math.sin(b*S)+w*Math.cos(b*S))}}else if(v===1)x=b=>o-Math.exp(-y*b)*(w+(m+y*w)*b);else{const b=y*Math.sqrt(v*v-1);x=S=>{const T=Math.exp(-v*y*S),P=Math.min(b*S,300);return o-T*((m+v*y*w)*Math.sinh(P)+b*w*Math.cosh(P))/b}}const E={calculatedDuration:p&&d||null,next:b=>{const S=x(b);if(p)a.done=b>=d;else{let T=0;v<1&&(T=b===0?gr(m):CA(x,b,S));const P=Math.abs(T)<=r,I=Math.abs(o-S)<=s;a.done=P&&I}return a.value=a.done?o:S,a},toString:()=>{const b=Math.min(s_(E),Qh),S=Rj(T=>E.next(b*T).value,b,30);return b+"ms "+S},toTransition:()=>{}};return E}Zh.applyToOptions=t=>{const e=Y6(t,100,Zh);return t.ease=Xc()?e.ease:"easeOut",t.duration=gr(e.duration),t.type="keyframes",t};function iE({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=t[0],f={done:!1,value:d},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let v=n*e;const w=d+v,y=o===void 0?w:o(w);y!==w&&(v=y-d);const _=P=>-v*Math.exp(-P/r),x=P=>y+_(P),E=P=>{const I=_(P),k=x(P);f.done=Math.abs(I)<=c,f.value=f.done?y:k};let b,S;const T=P=>{p(f.value)&&(b=P,S=Zh({keyframes:[f.value,m(f.value)],velocity:CA(x,P,f.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:P=>{let I=!1;return!S&&b===void 0&&(I=!0,E(P),T(P)),b!==void 0&&P>=b?S.next(P-b):(!I&&E(P),f)}}}const XH=Cu(.42,0,1,1),JH=Cu(0,0,.58,1),kA=Cu(.42,0,.58,1),ZH=t=>Array.isArray(t)&&typeof t[0]!="number",oE={linear:Wt,easeIn:XH,easeInOut:kA,easeOut:JH,circIn:b_,circInOut:lA,circOut:aA,backIn:x_,backInOut:iA,backOut:sA,anticipate:oA},aE=t=>{if(t_(t)){Vv(t.length===4);const[e,n,r,s]=t;return Cu(e,n,r,s)}else if(typeof t=="string")return Vv(oE[t]!==void 0),oE[t];return t};function eW(t,e,n){const r=[],s=n||PA,i=t.length-1;for(let o=0;o<i;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||Wt:e;a=ku(l,a)}r.push(a)}return r}function C_(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Vv(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=eW(e,r,s),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let d=0;if(l>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const f=ca(t[d],t[d+1],u);return a[d](f)};return n?u=>c(xr(t[0],t[i-1],u)):c}function tW(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=ca(0,e,r);t.push(Fe(n,1,s))}}function RA(t){const e=[0];return tW(e,t.length-1),e}function nW(t,e){return t.map(n=>n*e)}function rW(t,e){return t.map(()=>e||kA).splice(0,t.length-1)}function ef({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=ZH(r)?r.map(aE):aE(r),i={done:!1,value:e[0]},o=nW(n&&n.length===e.length?n:RA(e),t),a=C_(o,e,{ease:Array.isArray(s)?s:rW(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const sW=t=>{const e=({timestamp:n})=>t(n);return{start:()=>ge.update(e,!0),stop:()=>Vn(e),now:()=>it.isProcessing?it.timestamp:vr.now()}},iW={decay:iE,inertia:iE,tween:ef,keyframes:ef,spring:Zh},oW=t=>t/100;class tp extends SA{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=s?.KeyframeResolver||T_,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(i,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=n_(n)?n:iW[n]||ef;let l,c;a!==ef&&typeof e[0]!="number"&&(l=ku(oW,PA(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});i==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=s_(u));const{calculatedDuration:d}=u,f=d+s,p=f*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:P}=this.options;return{done:!0,value:P[P.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return i.next(0);const{delay:f,repeat:p,repeatType:m,repeatDelay:v,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-f*(this.speed>=0?1:-1),_=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let x=this.currentTime,E=i;if(p){const P=Math.min(this.currentTime,u)/d;let I=Math.floor(P),k=P%1;!k&&P>=1&&(k=1),k===1&&I--,I=Math.min(I,p+1),!!(I%2)&&(m==="reverse"?(k=1-k,v&&(k-=v/d)):m==="mirror"&&(E=o)),x=xr(0,1,k)*d}const b=_?{done:!1,value:l[0]}:E.next(x);a&&(b.value=a(b.value));let{done:S}=b;!_&&c!==null&&(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return T&&s!==void 0&&(b.value=ep(l,this.options,s)),w&&w(b.value),T&&this.finish(),b}get duration(){const{resolved:e}=this;return e?mr(e.calculatedDuration):0}get time(){return mr(this.currentTime)}set time(e){e=gr(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=mr(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=sW,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}get finished(){return this.currentFinishedPromise}}function aW(t){return new tp(t)}const lW=new Set(["opacity","clipPath","filter","transform"]),cW=J0(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),tf=10,uW=2e4;function dW(t){return n_(t.type)||t.type==="spring"||!Aj(t.ease)}function hW(t,e){const n=new tp({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const s=[];let i=0;for(;!r.done&&i<uW;)r=n.sample(i),s.push(r.value),i+=tf;return{times:void 0,keyframes:s,duration:i-tf,ease:"linear"}}const jA={anticipate:oA,backInOut:iA,circInOut:lA};function fW(t){return t in jA}class lE extends SA{constructor(e){super(e);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new EA(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Xc()&&fW(i)&&(i=jA[i]),dW(this.options)){const{onComplete:d,onUpdate:f,motionValue:p,element:m,...v}=this.options,w=hW(e,v);e=w.keyframes,e.length===1&&(e[1]=e[0]),r=w.duration,s=w.times,i=w.ease,o="keyframes"}const u=q6(a.owner.current,l,e,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(D1(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(ep(e,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return mr(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return mr(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=gr(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return Wt;const{animation:r}=n;D1(r,e)}return Wt}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:f,...p}=this.options,m=new tp({...p,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),v=gr(this.time);c.setWithVelocity(m.sample(v-tf).value,m.sample(v).value,tf)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return cW()&&r&&lW.has(r)&&(r!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const pW={type:"spring",stiffness:500,damping:25,restSpeed:10},gW=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),mW={type:"keyframes",duration:.8},vW={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},yW=(t,{keyframes:e})=>e.length>2?mW:Di.has(t)?t.startsWith("scale")?gW(e[1]):pW:vW;function _W({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const k_=(t,e,n,r={},s,i)=>o=>{const a=r_(r,t)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-gr(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};_W(a)||(u={...u,...yW(t,u)}),u.duration&&(u.duration=gr(u.duration)),u.repeatDelay&&(u.repeatDelay=gr(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),u.allowFlatten=!a.type&&!a.ease,d&&!i&&e.get()!==void 0){const f=ep(u.keyframes,a);if(f!==void 0)return ge.update(()=>{u.onUpdate(f),u.onComplete()}),new W6([])}return!i&&lE.supports(u)?new lE(u):new tp(u)};function wW({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function AA(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...a}=e;r&&(i=r);const l=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const u in a){const d=t.getValue(u,t.latestValues[u]??null),f=a[u];if(f===void 0||c&&wW(c,u))continue;const p={delay:n,...r_(i||{},u)};let m=!1;if(window.MotionHandoffAnimation){const w=eA(t);if(w){const y=window.MotionHandoffAnimation(w,u,ge);y!==null&&(p.startTime=y,m=!0)}}Bv(t,u),d.start(k_(u,d,f,t.shouldReduceMotion&&Zj.has(u)?{type:!1}:p,t,m));const v=d.animation;v&&l.push(v)}return o&&Promise.all(l).then(()=>{ge.update(()=>{o&&X8(t,o)})}),l}function Zv(t,e,n={}){const r=tu(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(AA(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return xW(t,e,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[i,o]:[o,i];return l().then(()=>c())}else return Promise.all([i(),o(n.delay)])}function xW(t,e,n=0,r=0,s=1,i){const o=[],a=(t.variantChildren.size-1)*r,l=s===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(t.variantChildren).sort(bW).forEach((c,u)=>{c.notify("AnimationStart",e),o.push(Zv(c,e,{...i,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function bW(t,e){return t.sortNodePosition(e)}function EW(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Zv(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Zv(t,e,n);else{const s=typeof e=="function"?tu(t,e,n.custom):e;r=Promise.all(AA(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function OA(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const SW=c_.length;function IA(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?IA(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<SW;n++){const r=c_[n],s=t.props[r];(Jc(s)||s===!1)&&(e[r]=s)}return e}const TW=[...l_].reverse(),PW=l_.length;function CW(t){return e=>Promise.all(e.map(({animation:n,options:r})=>EW(t,n,r)))}function kW(t){let e=CW(t),n=cE(),r=!0;const s=l=>(c,u)=>{const d=tu(t,u,l==="exit"?t.presenceContext?.custom:void 0);if(d){const{transition:f,transitionEnd:p,...m}=d;c={...c,...m,...p}}return c};function i(l){e=l(t)}function o(l){const{props:c}=t,u=IA(t.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let w=0;w<PW;w++){const y=TW[w],_=n[y],x=c[y]!==void 0?c[y]:u[y],E=Jc(x),b=y===l?_.isActive:null;b===!1&&(m=w);let S=x===u[y]&&x!==c[y]&&E;if(S&&r&&t.manuallyAnimateOnMount&&(S=!1),_.protectedKeys={...p},!_.isActive&&b===null||!x&&!_.prevProp||Jf(x)||typeof x=="boolean")continue;const T=RW(_.prevProp,x);let P=T||y===l&&_.isActive&&!S&&E||w>m&&E,I=!1;const k=Array.isArray(x)?x:[x];let V=k.reduce(s(y),{});b===!1&&(V={});const{prevResolvedValues:F={}}=_,Y={...F,...V},N=H=>{P=!0,f.has(H)&&(I=!0,f.delete(H)),_.needsAnimating[H]=!0;const R=t.getValue(H);R&&(R.liveStyle=!1)};for(const H in Y){const R=V[H],A=F[H];if(p.hasOwnProperty(H))continue;let U=!1;zv(R)&&zv(A)?U=!OA(R,A):U=R!==A,U?R!=null?N(H):f.add(H):R!==void 0&&f.has(H)?N(H):_.protectedKeys[H]=!0}_.prevProp=x,_.prevResolvedValues=V,_.isActive&&(p={...p,...V}),r&&t.blockInitialAnimation&&(P=!1),P&&(!(S&&T)||I)&&d.push(...k.map(H=>({animation:H,options:{type:y}})))}if(f.size){const w={};if(typeof c.initial!="boolean"){const y=tu(t,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(w.transition=y.transition)}f.forEach(y=>{const _=t.getBaseTarget(y),x=t.getValue(y);x&&(x.liveStyle=!0),w[y]=_??null}),d.push({animation:w})}let v=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(v=!1),r=!1,v?e(d):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(d=>d.animationState?.setActive(l,c)),n[l].isActive=c;const u=o(l);for(const d in n)n[d].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=cE(),r=!0}}}function RW(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!OA(e,t):!1}function ei(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cE(){return{animate:ei(!0),whileInView:ei(),whileHover:ei(),whileTap:ei(),whileDrag:ei(),whileFocus:ei(),exit:ei()}}class Qs{constructor(e){this.isMounted=!1,this.node=e}update(){}}class jW extends Qs{constructor(e){super(e),e.animationState||(e.animationState=kW(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Jf(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let AW=0;class OW extends Qs{constructor(){super(...arguments),this.id=AW++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const IW={animation:{Feature:jW},exit:{Feature:OW}};function ru(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function Ru(t){return{point:{x:t.pageX,y:t.pageY}}}const LW=t=>e=>a_(e)&&t(e,Ru(e));function hc(t,e,n,r){return ru(t,e,LW(n),r)}function LA({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function NW({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function DW(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const NA=1e-4,MW=1-NA,$W=1+NA,DA=.01,FW=0-DA,VW=0+DA;function jt(t){return t.max-t.min}function UW(t,e,n){return Math.abs(t-e)<=n}function uE(t,e,n,r=.5){t.origin=r,t.originPoint=Fe(e.min,e.max,t.origin),t.scale=jt(n)/jt(e),t.translate=Fe(n.min,n.max,t.origin)-t.originPoint,(t.scale>=MW&&t.scale<=$W||isNaN(t.scale))&&(t.scale=1),(t.translate>=FW&&t.translate<=VW||isNaN(t.translate))&&(t.translate=0)}function fc(t,e,n,r){uE(t.x,e.x,n.x,r?r.originX:void 0),uE(t.y,e.y,n.y,r?r.originY:void 0)}function dE(t,e,n){t.min=n.min+e.min,t.max=t.min+jt(e)}function zW(t,e,n){dE(t.x,e.x,n.x),dE(t.y,e.y,n.y)}function hE(t,e,n){t.min=e.min-n.min,t.max=t.min+jt(e)}function pc(t,e,n){hE(t.x,e.x,n.x),hE(t.y,e.y,n.y)}const fE=()=>({translate:0,scale:1,origin:0,originPoint:0}),bo=()=>({x:fE(),y:fE()}),pE=()=>({min:0,max:0}),Ge=()=>({x:pE(),y:pE()});function hn(t){return[t("x"),t("y")]}function bg(t){return t===void 0||t===1}function ey({scale:t,scaleX:e,scaleY:n}){return!bg(t)||!bg(e)||!bg(n)}function ii(t){return ey(t)||MA(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function MA(t){return gE(t.x)||gE(t.y)}function gE(t){return t&&t!=="0%"}function nf(t,e,n){const r=t-n,s=e*r;return n+s}function mE(t,e,n,r,s){return s!==void 0&&(t=nf(t,s,r)),nf(t,n,r)+e}function ty(t,e=0,n=1,r,s){t.min=mE(t.min,e,n,r,s),t.max=mE(t.max,e,n,r,s)}function $A(t,{x:e,y:n}){ty(t.x,e.translate,e.scale,e.originPoint),ty(t.y,n.translate,n.scale,n.originPoint)}const vE=.999999999999,yE=1.0000000000001;function BW(t,e,n,r=!1){const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&So(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,$A(t,o)),r&&ii(i.latestValues)&&So(t,i.latestValues))}e.x<yE&&e.x>vE&&(e.x=1),e.y<yE&&e.y>vE&&(e.y=1)}function Eo(t,e){t.min=t.min+e,t.max=t.max+e}function _E(t,e,n,r,s=.5){const i=Fe(t.min,t.max,s);ty(t,e,n,i,r)}function So(t,e){_E(t.x,e.x,e.scaleX,e.scale,e.originX),_E(t.y,e.y,e.scaleY,e.scale,e.originY)}function FA(t,e){return LA(DW(t.getBoundingClientRect(),e))}function HW(t,e,n){const r=FA(t,n),{scroll:s}=e;return s&&(Eo(r.x,s.offset.x),Eo(r.y,s.offset.y)),r}const VA=({current:t})=>t?t.ownerDocument.defaultView:null,wE=(t,e)=>Math.abs(t-e);function WW(t,e){const n=wE(t.x,e.x),r=wE(t.y,e.y);return Math.sqrt(n**2+r**2)}class UA{constructor(e,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Sg(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=WW(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:v}=it;this.history.push({...m,timestamp:v});const{onStart:w,onMove:y}=this.handlers;f||(w&&w(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Eg(f,this.transformPagePoint),ge.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Sg(d.type==="pointercancel"?this.lastMoveEventInfo:Eg(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,w),m&&m(d,w)},!a_(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Ru(e),a=Eg(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=it;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(e,Sg(a,this.history)),this.removeListeners=ku(hc(this.contextWindow,"pointermove",this.handlePointerMove),hc(this.contextWindow,"pointerup",this.handlePointerUp),hc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Vn(this.updatePoint)}}function Eg(t,e){return e?{point:e(t.point)}:t}function xE(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Sg({point:t},e){return{point:t,delta:xE(t,zA(e)),offset:xE(t,KW(e)),velocity:GW(e,.1)}}function KW(t){return t[0]}function zA(t){return t[t.length-1]}function GW(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=zA(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>gr(e)));)n--;if(!r)return{x:0,y:0};const i=mr(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function qW(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Fe(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Fe(n,t,r.max):Math.min(t,n)),t}function bE(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function YW(t,{top:e,left:n,bottom:r,right:s}){return{x:bE(t.x,n,s),y:bE(t.y,e,r)}}function EE(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function QW(t,e){return{x:EE(t.x,e.x),y:EE(t.y,e.y)}}function XW(t,e){let n=.5;const r=jt(t),s=jt(e);return s>r?n=ca(e.min,e.max-r,t.min):r>s&&(n=ca(t.min,t.max-s,e.min)),xr(0,1,n)}function JW(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const ny=.35;function ZW(t=ny){return t===!1?t=0:t===!0&&(t=ny),{x:SE(t,"left","right"),y:SE(t,"top","bottom")}}function SE(t,e,n){return{min:TE(t,e),max:TE(t,n)}}function TE(t,e){return typeof t=="number"?t:t[e]||0}const e9=new WeakMap;class t9{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ge(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ru(u).point)},i=(u,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Z6(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),hn(w=>{let y=this.getAxisMotionValue(w).get()||0;if(yr.test(y)){const{projection:_}=this.visualElement;if(_&&_.layout){const x=_.layout.layoutBox[w];x&&(y=jt(x)*(parseFloat(y)/100))}}this.originPoint[w]=y}),m&&ge.postRender(()=>m(u,d)),Bv(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:w}=d;if(p&&this.currentDirection===null){this.currentDirection=n9(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,w),this.updateAxis("y",d.point,w),this.visualElement.render(),v&&v(u,d)},a=(u,d)=>this.stop(u,d),l=()=>hn(u=>this.getAnimationState(u)==="paused"&&this.getAxisMotionValue(u).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new UA(e,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:VA(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ge.postRender(()=>i(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!yd(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=qW(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;e&&wo(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=YW(r.layoutBox,e):this.constraints=!1,this.elastic=ZW(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&hn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=JW(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!wo(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=HW(r,s.root,this.visualElement.getTransformPagePoint());let o=QW(s.layout.layoutBox,i);if(n){const a=n(NW(o));this.hasMutatedConstraints=!!a,a&&(o=LA(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=hn(u=>{if(!yd(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const f=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?e[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Bv(this.visualElement,e),r.start(k_(e,r,0,n,this.visualElement,!1))}stopAnimation(){hn(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){hn(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){hn(n=>{const{drag:r}=this.getProps();if(!yd(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(e[n]-Fe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!wo(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};hn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=XW({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),hn(o=>{if(!yd(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Fe(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;e9.set(this.visualElement,this);const e=this.visualElement.current,n=hc(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();wo(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ge.read(r);const o=ru(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(hn(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=ny,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function yd(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function n9(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class r9 extends Qs{constructor(e){super(e),this.removeGroupControls=Wt,this.removeListeners=Wt,this.controls=new t9(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Wt}unmount(){this.removeGroupControls(),this.removeListeners()}}const PE=t=>(e,n)=>{t&&ge.postRender(()=>t(e,n))};class s9 extends Qs{constructor(){super(...arguments),this.removePointerDownListener=Wt}onPointerDown(e){this.session=new UA(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:VA(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:PE(e),onStart:PE(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&ge.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=hc(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Gd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function CE(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const nl={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(te.test(t))t=parseFloat(t);else return t;const n=CE(t,e.target.x),r=CE(t,e.target.y);return`${n}% ${r}%`}},i9={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Hs.parse(t);if(s.length>5)return r;const i=Hs.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const c=Fe(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class o9 extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;T8(a9),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Gd.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||ge.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),i_.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function BA(t){const[e,n]=Cj(),r=g.useContext(q0);return h.jsx(o9,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(Vj),isPresent:e,safeToRemove:n})}const a9={borderRadius:{...nl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nl,borderTopRightRadius:nl,borderBottomLeftRadius:nl,borderBottomRightRadius:nl,boxShadow:i9};function l9(t,e,n){const r=at(t)?t:hr(t);return r.start(k_("",r,e,n)),r.animation}function c9(t){return t instanceof SVGElement&&t.tagName!=="svg"}const u9=(t,e)=>t.depth-e.depth;class d9{constructor(){this.children=[],this.isDirty=!1}add(e){Q0(this.children,e),this.isDirty=!0}remove(e){X0(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(u9),this.isDirty=!1,this.children.forEach(e)}}function h9(t,e){const n=vr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Vn(r),t(i-e))};return ge.read(r,!0),()=>Vn(r)}const HA=["TopLeft","TopRight","BottomLeft","BottomRight"],f9=HA.length,kE=t=>typeof t=="string"?parseFloat(t):t,RE=t=>typeof t=="number"||te.test(t);function p9(t,e,n,r,s,i){s?(t.opacity=Fe(0,n.opacity!==void 0?n.opacity:1,g9(r)),t.opacityExit=Fe(e.opacity!==void 0?e.opacity:1,0,m9(r))):i&&(t.opacity=Fe(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<f9;o++){const a=`border${HA[o]}Radius`;let l=jE(e,a),c=jE(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||RE(l)===RE(c)?(t[a]=Math.max(Fe(kE(l),kE(c),r),0),(yr.test(c)||yr.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=Fe(e.rotate||0,n.rotate||0,r))}function jE(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const g9=WA(0,.5,aA),m9=WA(.5,.95,Wt);function WA(t,e,n){return r=>r<t?0:r>e?1:n(ca(t,e,r))}function AE(t,e){t.min=e.min,t.max=e.max}function cn(t,e){AE(t.x,e.x),AE(t.y,e.y)}function OE(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function IE(t,e,n,r,s){return t-=e,t=nf(t,1/n,r),s!==void 0&&(t=nf(t,1/s,r)),t}function v9(t,e=0,n=1,r=.5,s,i=t,o=t){if(yr.test(e)&&(e=parseFloat(e),e=Fe(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Fe(i.min,i.max,r);t===i&&(a-=e),t.min=IE(t.min,e,n,a,s),t.max=IE(t.max,e,n,a,s)}function LE(t,e,[n,r,s],i,o){v9(t,e[n],e[r],e[s],e.scale,i,o)}const y9=["x","scaleX","originX"],_9=["y","scaleY","originY"];function NE(t,e,n,r){LE(t.x,e,y9,n?n.x:void 0,r?r.x:void 0),LE(t.y,e,_9,n?n.y:void 0,r?r.y:void 0)}function DE(t){return t.translate===0&&t.scale===1}function KA(t){return DE(t.x)&&DE(t.y)}function ME(t,e){return t.min===e.min&&t.max===e.max}function w9(t,e){return ME(t.x,e.x)&&ME(t.y,e.y)}function $E(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function GA(t,e){return $E(t.x,e.x)&&$E(t.y,e.y)}function FE(t){return jt(t.x)/jt(t.y)}function VE(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class x9{constructor(){this.members=[]}add(e){Q0(this.members,e),e.scheduleRender()}remove(e){if(X0(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function b9(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=n?.z||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Tg=["","X","Y","Z"],E9={visibility:"hidden"},UE=1e3;let S9=0;function Pg(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function qA(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=eA(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ge,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&qA(r)}function YA({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e?.()){this.id=S9++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(C9),this.nodes.forEach(O9),this.nodes.forEach(I9),this.nodes.forEach(k9)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new d9)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Z0),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=c9(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),t){let d;const f=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=h9(f,250),Gd.hasAnimatedSinceResize&&(Gd.hasAnimatedSinceResize=!1,this.nodes.forEach(BE))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||$9,{onLayoutAnimationStart:w,onLayoutAnimationComplete:y}=u.getProps(),_=!this.targetLayout||!GA(this.targetLayout,m),x=!f&&p;if(this.options.layoutRoot||this.resumeFrom||x||f&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const E={...r_(v,"layout"),onPlay:w,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else f||BE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Vn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(L9),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qA(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(zE);return}this.isUpdating||this.nodes.forEach(j9),this.isUpdating=!1,this.nodes.forEach(A9),this.nodes.forEach(T9),this.nodes.forEach(P9),this.clearAllSnapshots();const a=vr.now();it.delta=xr(0,1e3/60,a-it.timestamp),it.timestamp=a,it.isProcessing=!0,mg.update.process(it),mg.preRender.process(it),mg.render.process(it),it.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,i_.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(R9),this.sharedNodes.forEach(N9)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ge.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ge.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!jt(this.snapshot.measuredBox.x)&&!jt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ge(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!KA(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||ii(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),F9(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return Ge();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(V9))){const{scroll:c}=this.root;c&&(Eo(a.x,c.offset.x),Eo(a.y,c.offset.y))}return a}removeElementScroll(o){const a=Ge();if(cn(a,o),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:d}=c;c!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&cn(a,o),Eo(a.x,u.offset.x),Eo(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=Ge();cn(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&So(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ii(u.latestValues)&&So(l,u.latestValues)}return ii(this.latestValues)&&So(l,this.latestValues),l}removeTransform(o){const a=Ge();cn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ii(c.latestValues))continue;ey(c.latestValues)&&c.updateSnapshot();const u=Ge(),d=c.measurePageBox();cn(u,d),NE(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return ii(this.latestValues)&&NE(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==it.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=it.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ge(),this.relativeTargetOrigin=Ge(),pc(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),cn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ge(),this.targetWithTransforms=Ge()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zW(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):cn(this.target,this.layout.layoutBox),$A(this.target,this.targetDelta)):cn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ge(),this.relativeTargetOrigin=Ge(),pc(this.relativeTargetOrigin,this.target,f.target),cn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ey(this.parent.latestValues)||MA(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===it.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;cn(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;BW(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Ge());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(OE(this.prevProjectionDelta.x,this.projectionDelta.x),OE(this.prevProjectionDelta.y,this.projectionDelta.y)),fc(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!VE(this.projectionDelta.x,this.prevProjectionDelta.x)||!VE(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bo(),this.projectionDelta=bo(),this.projectionDeltaWithTransform=bo()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=bo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Ge(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,v=p!==m,w=this.getStack(),y=!w||w.members.length<=1,_=!!(v&&!y&&this.options.crossfade===!0&&!this.path.some(M9));this.animationProgress=0;let x;this.mixTargetDelta=E=>{const b=E/1e3;HE(d.x,o.x,b),HE(d.y,o.y,b),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pc(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),D9(this.relativeTarget,this.relativeTargetOrigin,f,b),x&&w9(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Ge()),cn(x,this.relativeTarget)),v&&(this.animationValues=u,p9(u,c,this.latestValues,b,_,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Vn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ge.update(()=>{Gd.hasAnimatedSinceResize=!0,this.currentAnimation=l9(0,UE,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(UE),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&QA(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Ge();const d=jt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const f=jt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}cn(a,l),So(a,u),fc(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new x9),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Pg("z",o,c,this.animationValues);for(let u=0;u<Tg.length;u++)Pg(`rotate${Tg[u]}`,o,c,this.animationValues),Pg(`skew${Tg[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return E9;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=Kd(o?.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Kd(o?.pointerEvents)||""),this.hasProjected&&!ii(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=!1),p}const u=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=b9(this.projectionDeltaWithTransform,this.treeScale,u),l&&(a.transform=l(u,a.transform));const{x:d,y:f}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,c.animationValues?a.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in Zc){if(u[p]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:w}=Zc[p],y=a.transform==="none"?u[p]:m(u[p],c);if(v){const _=v.length;for(let x=0;x<_;x++)a[v[x]]=y}else w?this.options.visualElement.renderState.vars[p]=y:a[p]=y}return this.options.layoutId&&(a.pointerEvents=c===this?Kd(o?.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(zE),this.root.sharedNodes.clear()}}}function T9(t){t.updateLayout()}function P9(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=t.layout,{animationType:s}=t.options,i=e.source!==t.layout.source;s==="size"?hn(u=>{const d=i?e.measuredBox[u]:e.layoutBox[u],f=jt(d);d.min=n[u].min,d.max=d.min+f}):QA(s,e.layoutBox,n)&&hn(u=>{const d=i?e.measuredBox[u]:e.layoutBox[u],f=jt(n[u]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+f)});const o=bo();fc(o,n,e.layoutBox);const a=bo();i?fc(a,t.applyTransform(r,!0),e.measuredBox):fc(a,n,e.layoutBox);const l=!KA(o);let c=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:d,layout:f}=u;if(d&&f){const p=Ge();pc(p,e.layoutBox,d.layoutBox);const m=Ge();pc(m,n,f.layoutBox),GA(p,m)||(c=!0),u.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function C9(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function k9(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function R9(t){t.clearSnapshot()}function zE(t){t.clearMeasurements()}function j9(t){t.isLayoutDirty=!1}function A9(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function BE(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function O9(t){t.resolveTargetDelta()}function I9(t){t.calcProjection()}function L9(t){t.resetSkewAndRotation()}function N9(t){t.removeLeadSnapshot()}function HE(t,e,n){t.translate=Fe(e.translate,0,n),t.scale=Fe(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function WE(t,e,n,r){t.min=Fe(e.min,n.min,r),t.max=Fe(e.max,n.max,r)}function D9(t,e,n,r){WE(t.x,e.x,n.x,r),WE(t.y,e.y,n.y,r)}function M9(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $9={duration:.45,ease:[.4,0,.1,1]},KE=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),GE=KE("applewebkit/")&&!KE("chrome/")?Math.round:Wt;function qE(t){t.min=GE(t.min),t.max=GE(t.max)}function F9(t){qE(t.x),qE(t.y)}function QA(t,e,n){return t==="position"||t==="preserve-aspect"&&!UW(FE(e),FE(n),.2)}function V9(t){return t!==t.root&&t.scroll?.wasRoot}const U9=YA({attachResizeListener:(t,e)=>ru(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cg={current:void 0},XA=YA({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Cg.current){const t=new U9({});t.mount(window),t.setOptions({layoutScroll:!0}),Cg.current=t}return Cg.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),z9={pan:{Feature:s9},drag:{Feature:r9,ProjectionNode:XA,MeasureLayout:BA}};function YE(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ge.postRender(()=>i(e,Ru(e)))}class B9 extends Qs{mount(){const{current:e}=this.node;e&&(this.unmount=e8(e,(n,r)=>(YE(this.node,r,"Start"),s=>YE(this.node,s,"End"))))}unmount(){}}class H9 extends Qs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ku(ru(this.node.current,"focus",()=>this.onFocus()),ru(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function QE(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ge.postRender(()=>i(e,Ru(e)))}class W9 extends Qs{mount(){const{current:e}=this.node;e&&(this.unmount=s8(e,(n,r)=>(QE(this.node,r,"Start"),(s,{success:i})=>QE(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ry=new WeakMap,kg=new WeakMap,K9=t=>{const e=ry.get(t.target);e&&e(t)},G9=t=>{t.forEach(K9)};function q9({root:t,...e}){const n=t||document;kg.has(n)||kg.set(n,{});const r=kg.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(G9,{root:t,...e})),r[s]}function Y9(t,e,n){const r=q9(e);return ry.set(t,n),r.observe(t),()=>{ry.delete(t),r.unobserve(t)}}const Q9={some:0,all:1};class X9 extends Qs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Q9[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return Y9(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(J9(e,n))&&this.startObserver()}unmount(){}}function J9({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Z9={inView:{Feature:X9},tap:{Feature:W9},focus:{Feature:H9},hover:{Feature:B9}},e7={layout:{ProjectionNode:XA,MeasureLayout:BA}},sy={current:null},JA={current:!1};function t7(){if(JA.current=!0,!!Y0)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>sy.current=t.matches;t.addListener(e),e()}else sy.current=!1}const n7=[...bA,bt,Hs],r7=t=>n7.find(xA(t)),s7=new WeakMap;function i7(t,e,n){for(const r in e){const s=e[r],i=n[r];if(at(s))t.addValue(r,s);else if(at(i))t.addValue(r,hr(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,hr(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const XE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class o7{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=T_,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=vr.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ge.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Zf(n),this.isVariantNode=$j(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const m=f[p];l[p]!==void 0&&at(m)&&m.set(l[p],!1)}}mount(e){this.current=e,s7.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),JA.current||t7(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:sy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Vn(this.notifyUpdate),Vn(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Di.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&ge.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ua){const n=ua[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ge()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<XE.length;r++){const s=XE[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=i7(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=hr(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(_A(r)||cA(r))?r=parseFloat(r):!r7(r)&&Hs.test(n)&&(r=mA(e,n)),this.setBaseTarget(e,at(r)?r.get():r)),at(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=__(this.props,n,this.presenceContext?.custom);i&&(r=i[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!at(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Z0),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class ZA extends o7{constructor(){super(...arguments),this.KeyframeResolver=EA}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;at(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function a7(t){return window.getComputedStyle(t)}class l7 extends ZA{constructor(){super(...arguments),this.type="html",this.renderInstance=Yj}readValueFromInstance(e,n){if(Di.has(n))return bH(e,n);{const r=a7(e),s=(d_(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return FA(e,n)}build(e,n,r){p_(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return w_(e,n,r)}}class c7 extends ZA{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ge,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&qj(this.current,this.renderState)}}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Di.has(n)){const r=gA(n);return r&&r.default||0}return n=Qj.has(n)?n:u_(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return Jj(e,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&ge.postRender(this.updateDimensions)}build(e,n,r){v_(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,s){Xj(e,n,r,s)}mount(e){this.isSVGTag=y_(e.tagName),super.mount(e)}}const u7=(t,e)=>m_(t)?new c7(e):new l7(e,{allowProjection:t!==g.Fragment}),d7=Y8({...IW,...Z9,...z9,...e7},u7),Pe=d8(d7);function h7(t,e,n){g.useInsertionEffect(()=>t.on(e,n),[t,e,n])}function eO(t,e){let n;const r=()=>{const{currentTime:s}=e,o=(s===null?0:s.value)/100;n!==o&&t(o),n=o};return ge.update(r,!0),()=>Vn(r)}const qd=new WeakMap;let Yd;function f7(t,e){if(e){const{inlineSize:n,blockSize:r}=e[0];return{width:n,height:r}}else return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}function p7({target:t,contentRect:e,borderBoxSize:n}){qd.get(t)?.forEach(r=>{r({target:t,contentSize:e,get size(){return f7(t,n)}})})}function g7(t){t.forEach(p7)}function m7(){typeof ResizeObserver>"u"||(Yd=new ResizeObserver(g7))}function v7(t,e){Yd||m7();const n=o_(t);return n.forEach(r=>{let s=qd.get(r);s||(s=new Set,qd.set(r,s)),s.add(e),Yd?.observe(r)}),()=>{n.forEach(r=>{const s=qd.get(r);s?.delete(e),s?.size||Yd?.unobserve(r)})}}const Qd=new Set;let gc;function y7(){gc=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Qd.forEach(n=>n(e))},window.addEventListener("resize",gc)}function _7(t){return Qd.add(t),gc||y7(),()=>{Qd.delete(t),!Qd.size&&gc&&(gc=void 0)}}function w7(t,e){return typeof t=="function"?_7(t):v7(t,e)}const x7=50,JE=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),b7=()=>({time:0,x:JE(),y:JE()}),E7={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ZE(t,e,n,r){const s=n[e],{length:i,position:o}=E7[e],a=s.current,l=n.time;s.current=t[`scroll${o}`],s.scrollLength=t[`scroll${i}`]-t[`client${i}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=ca(0,s.scrollLength,s.current);const c=r-l;s.velocity=c>x7?0:e_(s.current-a,c)}function S7(t,e,n){ZE(t,"x",e,n),ZE(t,"y",e,n),e.time=n}function T7(t,e){const n={x:0,y:0};let r=t;for(;r&&r!==e;)if(r instanceof HTMLElement)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const s=r.getBoundingClientRect();r=r.parentElement;const i=r.getBoundingClientRect();n.x+=s.left-i.left,n.y+=s.top-i.top}else if(r instanceof SVGGraphicsElement){const{x:s,y:i}=r.getBBox();n.x+=s,n.y+=i;let o=null,a=r.parentNode;for(;!o;)a.tagName==="svg"&&(o=a),a=r.parentNode;r=o}else break;return n}const iy={start:0,center:.5,end:1};function eS(t,e,n=0){let r=0;if(t in iy&&(t=iy[t]),typeof t=="string"){const s=parseFloat(t);t.endsWith("px")?r=s:t.endsWith("%")?t=s/100:t.endsWith("vw")?r=s/100*document.documentElement.clientWidth:t.endsWith("vh")?r=s/100*document.documentElement.clientHeight:t=s}return typeof t=="number"&&(r=e*t),n+r}const P7=[0,0];function C7(t,e,n,r){let s=Array.isArray(t)?t:P7,i=0,o=0;return typeof t=="number"?s=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?s=t.split(" "):s=[t,iy[t]?t:"0"]),i=eS(s[0],n,r),o=eS(s[1],e),i-o}const k7={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},R7={x:0,y:0};function j7(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function A7(t,e,n){const{offset:r=k7.All}=n,{target:s=t,axis:i="y"}=n,o=i==="y"?"height":"width",a=s!==t?T7(s,t):R7,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:j7(s),c={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let u=!e[i].interpolate;const d=r.length;for(let f=0;f<d;f++){const p=C7(r[f],c[o],l[o],a[i]);!u&&p!==e[i].interpolatorOffsets[f]&&(u=!0),e[i].offset[f]=p}u&&(e[i].interpolate=C_(e[i].offset,RA(r),{clamp:!1}),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=xr(0,1,e[i].interpolate(e[i].current))}function O7(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let r=e;for(;r&&r!==t;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}function I7(t,e,n,r={}){return{measure:()=>O7(t,r.target,n),update:s=>{S7(t,n,s),(r.offset||r.target)&&A7(t,n,r)},notify:()=>e(n)}}const rl=new WeakMap,tS=new WeakMap,Rg=new WeakMap,nS=t=>t===document.documentElement?window:t;function R_(t,{container:e=document.documentElement,...n}={}){let r=Rg.get(e);r||(r=new Set,Rg.set(e,r));const s=b7(),i=I7(e,t,s,n);if(r.add(i),!rl.has(e)){const a=()=>{for(const f of r)f.measure()},l=()=>{for(const f of r)f.update(it.timestamp)},c=()=>{for(const f of r)f.notify()},u=()=>{ge.read(a,!1,!0),ge.read(l,!1,!0),ge.update(c,!1,!0)};rl.set(e,u);const d=nS(e);window.addEventListener("resize",u,{passive:!0}),e!==document.documentElement&&tS.set(e,w7(e,u)),d.addEventListener("scroll",u,{passive:!0})}const o=rl.get(e);return ge.read(o,!1,!0),()=>{Vn(o);const a=Rg.get(e);if(!a||(a.delete(i),a.size))return;const l=rl.get(e);rl.delete(e),l&&(nS(e).removeEventListener("scroll",l),tS.get(e)?.(),window.removeEventListener("resize",l))}}function L7({source:t,container:e,axis:n="y"}){t&&(e=t);const r={value:0},s=R_(i=>{r.value=i[n].progress*100},{container:e,axis:n});return{currentTime:r,cancel:s}}const jg=new Map;function tO({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),jg.has(e)||jg.set(e,{});const r=jg.get(e);return r[n]||(r[n]=kj()?new ScrollTimeline({source:e,axis:n}):L7({source:e,axis:n})),r[n]}function N7(t){return t.length===2}function nO(t){return t&&(t.target||t.offset)}function D7(t,e){return N7(t)||nO(e)?R_(n=>{t(n[e.axis].progress,n)},e):eO(t,tO(e))}function M7(t,e){if(t.flatten(),nO(e))return t.pause(),R_(n=>{t.time=t.duration*n[e.axis].progress},e);{const n=tO(e);return t.attachTimeline?t.attachTimeline(n,r=>(r.pause(),eO(s=>{r.time=r.duration*s},n))):Wt}}function $7(t,{axis:e="y",...n}={}){const r={axis:e,...n};return typeof t=="function"?D7(t,r):M7(t,r)}function rS(t,e){z6(!!(!e||e.current))}const F7=()=>({scrollX:hr(0),scrollY:hr(0),scrollXProgress:hr(0),scrollYProgress:hr(0)});function rO({container:t,target:e,layoutEffect:n=!0,...r}={}){const s=Bs(F7);return(n?Su:g.useEffect)(()=>(rS("target",e),rS("container",t),$7((o,{x:a,y:l})=>{s.scrollX.set(a.current),s.scrollXProgress.set(a.progress),s.scrollY.set(l.current),s.scrollYProgress.set(l.progress)},{...r,container:t?.current||void 0,target:e?.current||void 0})),[t,e,JSON.stringify(r.offset)]),s}function sO(t){const e=Bs(()=>hr(t)),{isStatic:n}=g.useContext(Tu);if(n){const[,r]=g.useState(t);g.useEffect(()=>e.on("change",r),[])}return e}function iO(t,e){const n=sO(e()),r=()=>n.set(e());return r(),Su(()=>{const s=()=>ge.preRender(r,!1,!0),i=t.map(o=>o.on("change",s));return()=>{i.forEach(o=>o()),Vn(r)}}),n}function sS(t,e={}){const{isStatic:n}=g.useContext(Tu),r=g.useRef(null),s=Bs(()=>at(t)?t.get():t),i=Bs(()=>typeof s=="string"?s.replace(/[\d.-]/g,""):void 0),o=sO(s),a=g.useRef(s),l=g.useRef(Wt),c=()=>{u(),r.current=aW({keyframes:[oS(o.get()),oS(a.current)],velocity:o.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...e,onUpdate:l.current})},u=()=>{r.current&&r.current.stop()};return g.useInsertionEffect(()=>o.attach((d,f)=>n?f(d):(a.current=d,l.current=p=>f(iS(p,i)),ge.postRender(c),o.get()),u),[JSON.stringify(e)]),Su(()=>{if(at(t))return t.on("change",d=>o.set(iS(d,i)))},[o,i]),o}function iS(t,e){return e?t+e:t}function oS(t){return typeof t=="number"?t:parseFloat(t)}const V7=t=>t&&typeof t=="object"&&t.mix,U7=t=>V7(t)?t.mix:void 0;function z7(...t){const e=!Array.isArray(t[0]),n=e?0:-1,r=t[0+n],s=t[1+n],i=t[2+n],o=t[3+n],a=C_(s,i,{mixer:U7(i[0]),...o});return e?a(r):a}function B7(t){uc.current=[],t();const e=iO(uc.current,t);return uc.current=void 0,e}function rf(t,e,n,r){if(typeof t=="function")return B7(t);const s=typeof e=="function"?e:z7(e,n,r);return Array.isArray(t)?aS(t,s):aS([t],([i])=>s(i))}function aS(t,e){const n=Bs(()=>[]);return iO(t,()=>{n.length=0;const r=t.length;for(let s=0;s<r;s++)n[s]=t[s].get();return e(n)})}const H7={some:0,all:1};function W7(t,e,{root:n,margin:r,amount:s="some"}={}){const i=o_(t),o=new WeakMap,a=c=>{c.forEach(u=>{const d=o.get(u.target);if(u.isIntersecting!==!!d)if(u.isIntersecting){const f=e(u.target,u);typeof f=="function"?o.set(u.target,f):l.unobserve(u.target)}else typeof d=="function"&&(d(u),o.delete(u.target))})},l=new IntersectionObserver(a,{root:n,rootMargin:r,threshold:typeof s=="number"?s:H7[s]});return i.forEach(c=>l.observe(c)),()=>l.disconnect()}function K7(t,{root:e,margin:n,amount:r,once:s=!1,initial:i=!1}={}){const[o,a]=g.useState(i);return g.useEffect(()=>{if(!t.current||s&&o)return;const l=()=>(a(!0),s?void 0:()=>a(!1)),c={root:e&&e.current||void 0,margin:n,amount:r};return W7(t.current,l,c)},[e,t,n,s,r]),o}const oO="/assets/lumi-idle-0POIBpsz.webp",aO="/assets/lumi-flying-BYO-JzK3.webp",G7=({flyingGifSrc:t=aO,idleGifSrc:e=oO,targetElement:n,onTargetReached:r})=>{const[s,i]=g.useState(!1),[o,a]=g.useState(!1),[l,c]=g.useState(!1),[u,d]=g.useState(!1),f=g.useRef({x:0,y:0}),p=g.useRef(!1),m={stiffness:150,damping:15,mass:1},v=sS(0,m),w=sS(0,m);if(g.useEffect(()=>{if(n){d(!0),p.current=!1;const _=n.getBoundingClientRect(),x=_.left+_.width/2+20,E=_.top-30;v.set(x),w.set(E);const b=setTimeout(()=>{p.current||(p.current=!0,r?.())},500);return()=>clearTimeout(b)}else d(!1)},[n,v,w,r]),g.useEffect(()=>{if(u)return;let _=0;const x=E=>{const b=performance.now();if(b-_<16)return;_=b,l||c(!0),v.set(E.clientX+20),w.set(E.clientY-20);const T=E.target.closest("[data-lumi-interactive]")!==null;i(T)};return window.addEventListener("mousemove",x,{passive:!0}),()=>{window.removeEventListener("mousemove",x)}},[l,v,w,u]),g.useEffect(()=>{if(u)return;let _=0;const x=b=>{const S=b.touches[0];if(!S)return;const T=performance.now();if(T-_<16)return;_=T,l||c(!0),v.set(S.clientX+20),w.set(S.clientY-50);const I=b.target.closest("[data-lumi-interactive]")!==null;i(I)},E=b=>{const S=b.touches[0];S&&(l||c(!0),v.set(S.clientX+20),w.set(S.clientY-50))};return window.addEventListener("touchstart",E,{passive:!0}),window.addEventListener("touchmove",x,{passive:!0}),()=>{window.removeEventListener("touchstart",E),window.removeEventListener("touchmove",x)}},[l,v,w,u]),g.useEffect(()=>{const _=setInterval(()=>{const x=v.get(),E=w.get(),b=x-f.current.x,S=E-f.current.y,T=Math.sqrt(b*b+S*S);a(T>1),f.current={x,y:E}},50);return()=>clearInterval(_)},[v,w]),!l)return null;const y=o&&!s&&!(u&&p.current);return h.jsxs(Pe.div,{className:"fixed top-0 left-0 pointer-events-none z-[9999]",style:{x:v,y:w,willChange:"transform"},children:[h.jsx(Pe.div,{animate:{scale:s||u?1.3:1,filter:s||u?"drop-shadow(0 0 20px rgba(255, 200, 100, 0.9)) drop-shadow(0 0 40px rgba(255, 180, 50, 0.6))":"drop-shadow(0 0 8px rgba(255, 200, 100, 0.4))"},transition:{duration:.25,ease:"easeOut"},children:h.jsxs("div",{className:"relative w-14 h-14",children:[h.jsx("img",{src:e,alt:"Lumi",className:"absolute inset-0 w-14 h-14 object-contain transition-opacity duration-150",style:{opacity:y?0:1},draggable:!1,decoding:"async"}),h.jsx("img",{src:t,alt:"","aria-hidden":"true",className:"absolute inset-0 w-14 h-14 object-contain transition-opacity duration-150",style:{opacity:y?1:0},draggable:!1,decoding:"async"})]})}),(s||u)&&h.jsx(Pe.div,{className:"absolute inset-0 -z-10 rounded-full",initial:{scale:.8,opacity:0},animate:{scale:1.5,opacity:1},transition:{duration:.3},style:{background:"radial-gradient(circle, rgba(255, 200, 100, 0.4) 0%, transparent 70%)"}})]})};let _d=null;function q7(t){"requestIdleCallback"in window?window.requestIdleCallback(t,{timeout:4e3}):setTimeout(t,2e3)}function Y7(){return _d||(_d=new Promise(t=>{if(typeof window>"u"){t(null);return}q7(async()=>{const{default:e}=await C(async()=>{const{default:n}=await Promise.resolve().then(()=>GB);return{default:n}},void 0);e.init("phc_5WxlAFQoA7g6daYB1QX9p6OsJMQkzmwgbjaBKG28S5m",{api_host:"https://us.i.posthog.com",loaded:()=>{},capture_pageview:!1,capture_pageleave:!0}),t(e)})}),_d)}function Q7(){const t=Un();return g.useEffect(()=>{Y7().then(e=>{e?.capture("$pageview")})},[t.pathname]),null}function X7({children:t}){return h.jsxs(h.Fragment,{children:[h.jsx(Q7,{}),t]})}const J7=()=>{const{user:t,session:e}=G0(),[n,r]=g.useState("guest"),[s,i]=g.useState({status:"none",isExpired:!0,isCancelledAtPeriodEnd:!1,planType:null}),[o,a]=g.useState(null),[l,c]=g.useState(null),[u,d]=g.useState(!0),[f,p]=g.useState(!1),[m,v]=g.useState(null),[w,y]=g.useState(!1),_=g.useRef(null),x=g.useCallback(async(S=!1)=>{if(!t){r("guest"),i({status:"none",isExpired:!0,isCancelledAtPeriodEnd:!1,planType:null}),d(!1),y(!0),_.current=null;return}if(!(w&&_.current===t.id&&!S))try{d(!0),S&&p(!0),v(null);const{data:T,error:P}=await xe.from("profiles").select("user_type, avatar_url, display_name").eq("id",t.id).single();if(P)throw console.error("[ACCESS-CONTROL] Profile error:",P),P;const{data:I,error:k}=await xe.from("user_payments").select("subscription_status, subscription_start_date, subscription_end_date, cancel_at_period_end, plan_type").eq("user_id",t.id).maybeSingle();if(k&&console.error("[ACCESS-CONTROL] Payment error:",k),T){a(T.avatar_url||null);const V=T.display_name||t.user_metadata?.display_name||t.user_metadata?.name||t.user_metadata?.full_name||null;c(V);const F=T.user_type||"free",Y=new Date,N=I?.subscription_end_date?new Date(I.subscription_end_date):void 0,X=N?Y>N:!0;i({status:I?.subscription_status||"none",startDate:I?.subscription_start_date?new Date(I.subscription_start_date):void 0,endDate:N,isExpired:X,isCancelledAtPeriodEnd:I?.cancel_at_period_end??!1,planType:I?.plan_type??null}),F!=="admin"?I?.subscription_status==="active"&&!X?r("paid"):T.user_type!=="guest"&&r("free"):r(F)}}catch(T){console.error("[ACCESS-CONTROL] Error:",T);const P=T instanceof Error?T.message:String(T);v(P),S&&lr.error("Failed to refresh profile data",{description:"Please try again later or contact support."})}finally{d(!1),y(!0),_.current=t.id,S&&p(!1)}},[t?.id,w]);g.useEffect(()=>{t?.id!==_.current&&y(!1)},[t?.id]),g.useEffect(()=>{x()},[x]);const E=S=>S==="guest"?!0:S==="free"?n==="free"||n==="paid"||n==="admin":S==="paid"?n==="paid"||n==="admin"||s.status==="active"&&!s.isExpired:!1,b=g.useCallback(async()=>{await x(!0)},[x]);return{userType:n,subscription:s,avatarUrl:o,displayName:l,isLoading:u,isRefreshing:f,lastRefreshError:m,canAccessStory:E,isAuthenticated:!!t,refreshSubscriptionStatus:b}},Z7=Rf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-300 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 hover:scale-[1.02] active:scale-[0.98]",{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",contrast:"bg-nature-red text-white hover:bg-nature-yellow",coral:"bg-nature-coral text-white hover:bg-nature-coral/90"},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"},animated:{true:"animate-pulse-gentle",false:""}},defaultVariants:{variant:"default",size:"default",animated:!1}}),Ts=g.forwardRef(({className:t,variant:e,size:n,animated:r,asChild:s=!1,...i},o)=>{const a=s?Ci:"button";return h.jsx(a,{className:Le(Z7({variant:e,size:n,animated:r,className:t})),ref:o,...i})});Ts.displayName="Button";var eK=g.createContext(void 0);function lO(t){const e=g.useContext(eK);return t||e||"ltr"}var Ag=0;function cO(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??lS()),document.body.insertAdjacentElement("beforeend",t[1]??lS()),Ag++,()=>{Ag===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ag--}},[])}function lS(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Og="focusScope.autoFocusOnMount",Ig="focusScope.autoFocusOnUnmount",cS={bubbles:!1,cancelable:!0},tK="FocusScope",j_=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,l]=g.useState(null),c=Tt(s),u=Tt(i),d=g.useRef(null),f=Xe(e,v=>l(v)),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let v=function(x){if(p.paused||!a)return;const E=x.target;a.contains(E)?d.current=E:ls(d.current,{select:!0})},w=function(x){if(p.paused||!a)return;const E=x.relatedTarget;E!==null&&(a.contains(E)||ls(d.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const b of x)b.removedNodes.length>0&&ls(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const _=new MutationObserver(y);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,p.paused]),g.useEffect(()=>{if(a){dS.add(p);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(Og,cS);a.addEventListener(Og,c),a.dispatchEvent(y),y.defaultPrevented||(nK(aK(uO(a)),{select:!0}),document.activeElement===v&&ls(a))}return()=>{a.removeEventListener(Og,c),setTimeout(()=>{const y=new CustomEvent(Ig,cS);a.addEventListener(Ig,u),a.dispatchEvent(y),y.defaultPrevented||ls(v??document.body,{select:!0}),a.removeEventListener(Ig,u),dS.remove(p)},0)}}},[a,c,u,p]);const m=g.useCallback(v=>{if(!n&&!r||p.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(w&&y){const _=v.currentTarget,[x,E]=rK(_);x&&E?!v.shiftKey&&y===E?(v.preventDefault(),n&&ls(x,{select:!0})):v.shiftKey&&y===x&&(v.preventDefault(),n&&ls(E,{select:!0})):y===_&&v.preventDefault()}},[n,r,p.paused]);return h.jsx(ve.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});j_.displayName=tK;function nK(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ls(r,{select:e}),document.activeElement!==n)return}function rK(t){const e=uO(t),n=uS(e,t),r=uS(e.reverse(),t);return[n,r]}function uO(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function uS(t,e){for(const n of t)if(!sK(n,{upTo:e}))return n}function sK(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function iK(t){return t instanceof HTMLInputElement&&"select"in t}function ls(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&iK(t)&&e&&t.select()}}var dS=oK();function oK(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=hS(t,e),t.unshift(e)},remove(e){t=hS(t,e),t[0]?.resume()}}}function hS(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function aK(t){return t.filter(e=>e.tagName!=="A")}function lK(t,e=[]){let n=[];function r(i,o){const a=g.createContext(o),l=n.length;n=[...n,o];function c(d){const{scope:f,children:p,...m}=d,v=f?.[t][l]||a,w=g.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:w,children:p})}function u(d,f){const p=f?.[t][l]||a,m=g.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const s=()=>{const i=n.map(o=>g.createContext(o));return function(a){const l=a?.[t]||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,cK(s,...e)]}function cK(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Lg="rovingFocusGroup.onEntryFocus",uK={bubbles:!1,cancelable:!0},np="RovingFocusGroup",[oy,dO,dK]=d0(np),[hK,hO]=lK(np,[dK]),[fK,pK]=hK(np),fO=g.forwardRef((t,e)=>h.jsx(oy.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(oy.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(gK,{...t,ref:e})})}));fO.displayName=np;var gK=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=g.useRef(null),p=Xe(e,f),m=lO(i),[v=null,w]=yu({prop:o,defaultProp:a,onChange:l}),[y,_]=g.useState(!1),x=Tt(c),E=dO(n),b=g.useRef(!1),[S,T]=g.useState(0);return g.useEffect(()=>{const P=f.current;if(P)return P.addEventListener(Lg,x),()=>P.removeEventListener(Lg,x)},[x]),h.jsx(fK,{scope:n,orientation:r,dir:m,loop:s,currentTabStopId:v,onItemFocus:g.useCallback(P=>w(P),[w]),onItemShiftTab:g.useCallback(()=>_(!0),[]),onFocusableItemAdd:g.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:g.useCallback(()=>T(P=>P-1),[]),children:h.jsx(ve.div,{tabIndex:y||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:Z(t.onMouseDown,()=>{b.current=!0}),onFocus:Z(t.onFocus,P=>{const I=!b.current;if(P.target===P.currentTarget&&I&&!y){const k=new CustomEvent(Lg,uK);if(P.currentTarget.dispatchEvent(k),!k.defaultPrevented){const V=E().filter(B=>B.focusable),F=V.find(B=>B.active),Y=V.find(B=>B.id===v),X=[F,Y,...V].filter(Boolean).map(B=>B.ref.current);mO(X,u)}}b.current=!1}),onBlur:Z(t.onBlur,()=>_(!1))})})}),pO="RovingFocusGroupItem",gO=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...o}=t,a=_i(),l=i||a,c=pK(pO,n),u=c.currentTabStopId===l,d=dO(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return g.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),h.jsx(oy.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:h.jsx(ve.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...o,ref:e,onMouseDown:Z(t.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Z(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:Z(t.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=yK(m,c.orientation,c.dir);if(v!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=d().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const _=y.indexOf(m.currentTarget);y=c.loop?_K(y,_+1):y.slice(_+1)}setTimeout(()=>mO(y))}})})})});gO.displayName=pO;var mK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vK(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function yK(t,e,n){const r=vK(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return mK[r]}function mO(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function _K(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var wK=fO,xK=gO,bK=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Xi=new WeakMap,wd=new WeakMap,xd={},Ng=0,vO=function(t){return t&&(t.host||vO(t.parentNode))},EK=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=vO(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},SK=function(t,e,n,r){var s=EK(e,Array.isArray(t)?t:[t]);xd[n]||(xd[n]=new WeakMap);var i=xd[n],o=[],a=new Set,l=new Set(s),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};s.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",v=(Xi.get(f)||0)+1,w=(i.get(f)||0)+1;Xi.set(f,v),i.set(f,w),o.push(f),v===1&&m&&wd.set(f,!0),w===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(e),a.clear(),Ng++,function(){o.forEach(function(d){var f=Xi.get(d)-1,p=i.get(d)-1;Xi.set(d,f),i.set(d,p),f||(wd.has(d)||d.removeAttribute(r),wd.delete(d)),p||d.removeAttribute(n)}),Ng--,Ng||(Xi=new WeakMap,Xi=new WeakMap,wd=new WeakMap,xd={})}},yO=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=bK(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),SK(r,s,n,"aria-hidden")):function(){return null}},ar=function(){return ar=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ar.apply(this,arguments)};function _O(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function TK(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Xd="right-scroll-bar-position",Jd="width-before-scroll-bar",PK="with-scroll-bars-hidden",CK="--removed-body-scroll-bar-size";function Dg(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function kK(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var RK=typeof window<"u"?g.useLayoutEffect:g.useEffect,fS=new WeakMap;function jK(t,e){var n=kK(null,function(r){return t.forEach(function(s){return Dg(s,r)})});return RK(function(){var r=fS.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(a){i.has(a)||Dg(a,null)}),i.forEach(function(a){s.has(a)||Dg(a,o)})}fS.set(n,t)},[t]),n}function AK(t){return t}function OK(t,e){e===void 0&&(e=AK);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var l=function(){var u=o;o=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return s}function IK(t){t===void 0&&(t={});var e=OK(null);return e.options=ar({async:!0,ssr:!1},t),e}var wO=function(t){var e=t.sideCar,n=_O(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,ar({},n))};wO.isSideCarExport=!0;function LK(t,e){return t.useMedium(e),wO}var xO=IK(),Mg=function(){},rp=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:Mg,onWheelCapture:Mg,onTouchMoveCapture:Mg}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,d=t.shards,f=t.sideCar,p=t.noIsolation,m=t.inert,v=t.allowPinchZoom,w=t.as,y=w===void 0?"div":w,_=t.gapMode,x=_O(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,b=jK([n,e]),S=ar(ar({},x),s);return g.createElement(g.Fragment,null,u&&g.createElement(E,{sideCar:xO,removeScrollBar:c,shards:d,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:_}),o?g.cloneElement(g.Children.only(a),ar(ar({},S),{ref:b})):g.createElement(y,ar({},S,{className:l,ref:b}),a))});rp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rp.classNames={fullWidth:Jd,zeroRight:Xd};var NK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function DK(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=NK();return e&&t.setAttribute("nonce",e),t}function MK(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function $K(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var FK=function(){var t=0,e=null;return{add:function(n){t==0&&(e=DK())&&(MK(e,n),$K(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},VK=function(){var t=FK();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},bO=function(){var t=VK(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},UK={left:0,top:0,right:0,gap:0},$g=function(t){return parseInt(t||"",10)||0},zK=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[$g(n),$g(r),$g(s)]},BK=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return UK;var e=zK(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},HK=bO(),$o="data-scroll-locked",WK=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
.`.concat(PK,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(a,"px ").concat(r,`;
}
body[`).concat($o,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(s,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(o,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(a,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(Xd,` {
right: `).concat(a,"px ").concat(r,`;
}
.`).concat(Jd,` {
margin-right: `).concat(a,"px ").concat(r,`;
}
.`).concat(Xd," .").concat(Xd,` {
right: 0 `).concat(r,`;
}
.`).concat(Jd," .").concat(Jd,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat($o,`] {
`).concat(CK,": ").concat(a,`px;
}
`)},pS=function(){var t=parseInt(document.body.getAttribute($o)||"0",10);return isFinite(t)?t:0},KK=function(){g.useEffect(function(){return document.body.setAttribute($o,(pS()+1).toString()),function(){var t=pS()-1;t<=0?document.body.removeAttribute($o):document.body.setAttribute($o,t.toString())}},[])},GK=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;KK();var i=g.useMemo(function(){return BK(s)},[s]);return g.createElement(HK,{styles:WK(i,!e,s,n?"":"!important")})},ay=!1;if(typeof window<"u")try{var bd=Object.defineProperty({},"passive",{get:function(){return ay=!0,!0}});window.addEventListener("test",bd,bd),window.removeEventListener("test",bd,bd)}catch{ay=!1}var Ji=ay?{passive:!1}:!1,qK=function(t){return t.tagName==="TEXTAREA"},EO=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!qK(t)&&n[e]==="visible")},YK=function(t){return EO(t,"overflowY")},QK=function(t){return EO(t,"overflowX")},gS=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=SO(t,r);if(s){var i=TO(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},XK=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},JK=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},SO=function(t,e){return t==="v"?YK(e):QK(e)},TO=function(t,e){return t==="v"?XK(e):JK(e)},ZK=function(t,e){return t==="h"&&e==="rtl"?-1:1},eG=function(t,e,n,r,s){var i=ZK(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,l=e.contains(a),c=!1,u=o>0,d=0,f=0;do{var p=TO(t,a),m=p[0],v=p[1],w=p[2],y=v-w-i*m;(m||y)&&SO(t,a)&&(d+=y,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(u&&(Math.abs(d)<1||!s)||!u&&(Math.abs(f)<1||!s))&&(c=!0),c},Ed=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},mS=function(t){return[t.deltaX,t.deltaY]},vS=function(t){return t&&"current"in t?t.current:t},tG=function(t,e){return t[0]===e[0]&&t[1]===e[1]},nG=function(t){return`
.block-interactivity-`.concat(t,` {pointer-events: none;}
.allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},rG=0,Zi=[];function sG(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(rG++)[0],i=g.useState(bO)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var v=TK([t.lockRef.current],(t.shards||[]).map(vS),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=g.useCallback(function(v,w){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var y=Ed(v),_=n.current,x="deltaX"in v?v.deltaX:_[0]-y[0],E="deltaY"in v?v.deltaY:_[1]-y[1],b,S=v.target,T=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in v&&T==="h"&&S.type==="range")return!1;var P=gS(T,S);if(!P)return!0;if(P?b=T:(b=T==="v"?"h":"v",P=gS(T,S)),!P)return!1;if(!r.current&&"changedTouches"in v&&(x||E)&&(r.current=b),!b)return!0;var I=r.current||b;return eG(I,w,v,I==="h"?x:E,!0)},[]),l=g.useCallback(function(v){var w=v;if(!(!Zi.length||Zi[Zi.length-1]!==i)){var y="deltaY"in w?mS(w):Ed(w),_=e.current.filter(function(b){return b.name===w.type&&(b.target===w.target||w.target===b.shadowParent)&&tG(b.delta,y)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var x=(o.current.shards||[]).map(vS).filter(Boolean).filter(function(b){return b.contains(w.target)}),E=x.length>0?a(w,x[0]):!o.current.noIsolation;E&&w.cancelable&&w.preventDefault()}}},[]),c=g.useCallback(function(v,w,y,_){var x={name:v,delta:w,target:y,should:_,shadowParent:iG(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(E){return E!==x})},1)},[]),u=g.useCallback(function(v){n.current=Ed(v),r.current=void 0},[]),d=g.useCallback(function(v){c(v.type,mS(v),v.target,a(v,t.lockRef.current))},[]),f=g.useCallback(function(v){c(v.type,Ed(v),v.target,a(v,t.lockRef.current))},[]);g.useEffect(function(){return Zi.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Ji),document.addEventListener("touchmove",l,Ji),document.addEventListener("touchstart",u,Ji),function(){Zi=Zi.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,Ji),document.removeEventListener("touchmove",l,Ji),document.removeEventListener("touchstart",u,Ji)}},[]);var p=t.removeScrollBar,m=t.inert;return g.createElement(g.Fragment,null,m?g.createElement(i,{styles:nG(s)}):null,p?g.createElement(GK,{gapMode:t.gapMode}):null)}function iG(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const oG=LK(xO,sG);var A_=g.forwardRef(function(t,e){return g.createElement(rp,ar({},t,{ref:e,sideCar:oG}))});A_.classNames=rp.classNames;var ly=["Enter"," "],aG=["ArrowDown","PageUp","Home"],PO=["ArrowUp","PageDown","End"],lG=[...aG,...PO],cG={ltr:[...ly,"ArrowRight"],rtl:[...ly,"ArrowLeft"]},uG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ju="Menu",[su,dG,hG]=d0(ju),[Mi,CO]=_a(ju,[hG,If,hO]),sp=If(),kO=hO(),[fG,$i]=Mi(ju),[pG,Au]=Mi(ju),RO=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=t,a=sp(e),[l,c]=g.useState(null),u=g.useRef(!1),d=Tt(i),f=lO(s);return g.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),h.jsx(uk,{...a,children:h.jsx(fG,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(pG,{scope:e,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};RO.displayName=ju;var gG="MenuAnchor",O_=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=sp(n);return h.jsx(dk,{...s,...r,ref:e})});O_.displayName=gG;var I_="MenuPortal",[mG,jO]=Mi(I_,{forceMount:void 0}),AO=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=$i(I_,e);return h.jsx(mG,{scope:e,forceMount:n,children:h.jsx(zn,{present:n||i.open,children:h.jsx(vu,{asChild:!0,container:s,children:r})})})};AO.displayName=I_;var xn="MenuContent",[vG,L_]=Mi(xn),OO=g.forwardRef((t,e)=>{const n=jO(xn,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=$i(xn,t.__scopeMenu),o=Au(xn,t.__scopeMenu);return h.jsx(su.Provider,{scope:t.__scopeMenu,children:h.jsx(zn,{present:r||i.open,children:h.jsx(su.Slot,{scope:t.__scopeMenu,children:o.modal?h.jsx(yG,{...s,ref:e}):h.jsx(_G,{...s,ref:e})})})})}),yG=g.forwardRef((t,e)=>{const n=$i(xn,t.__scopeMenu),r=g.useRef(null),s=Xe(e,r);return g.useEffect(()=>{const i=r.current;if(i)return yO(i)},[]),h.jsx(N_,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),_G=g.forwardRef((t,e)=>{const n=$i(xn,t.__scopeMenu);return h.jsx(N_,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),N_=g.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...v}=t,w=$i(xn,n),y=Au(xn,n),_=sp(n),x=kO(n),E=dG(n),[b,S]=g.useState(null),T=g.useRef(null),P=Xe(e,T,w.onContentChange),I=g.useRef(0),k=g.useRef(""),V=g.useRef(0),F=g.useRef(null),Y=g.useRef("right"),N=g.useRef(0),X=m?A_:g.Fragment,B=m?{as:Ci,allowPinchZoom:!0}:void 0,H=A=>{const U=k.current+A,M=E().filter(ye=>!ye.disabled),z=document.activeElement,J=M.find(ye=>ye.ref.current===z)?.textValue,re=M.map(ye=>ye.textValue),De=AG(re,U,J),se=M.find(ye=>ye.textValue===De)?.ref.current;(function ye(Kt){k.current=Kt,window.clearTimeout(I.current),Kt!==""&&(I.current=window.setTimeout(()=>ye(""),1e3))})(U),se&&setTimeout(()=>se.focus())};g.useEffect(()=>()=>window.clearTimeout(I.current),[]),cO();const R=g.useCallback(A=>Y.current===F.current?.side&&IG(A,F.current?.area),[]);return h.jsx(vG,{scope:n,searchRef:k,onItemEnter:g.useCallback(A=>{R(A)&&A.preventDefault()},[R]),onItemLeave:g.useCallback(A=>{R(A)||(T.current?.focus(),S(null))},[R]),onTriggerLeave:g.useCallback(A=>{R(A)&&A.preventDefault()},[R]),pointerGraceTimerRef:V,onPointerGraceIntentChange:g.useCallback(A=>{F.current=A},[]),children:h.jsx(X,{...B,children:h.jsx(j_,{asChild:!0,trapped:s,onMountAutoFocus:Z(i,A=>{A.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:h.jsx(mu,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(wK,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:S,onEntryFocus:Z(l,A=>{y.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(hk,{role:"menu","aria-orientation":"vertical","data-state":qO(w.open),"data-radix-menu-content":"",dir:y.dir,..._,...v,ref:P,style:{outline:"none",...v.style},onKeyDown:Z(v.onKeyDown,A=>{const M=A.target.closest("[data-radix-menu-content]")===A.currentTarget,z=A.ctrlKey||A.altKey||A.metaKey,J=A.key.length===1;M&&(A.key==="Tab"&&A.preventDefault(),!z&&J&&H(A.key));const re=T.current;if(A.target!==re||!lG.includes(A.key))return;A.preventDefault();const se=E().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);PO.includes(A.key)&&se.reverse(),RG(se)}),onBlur:Z(t.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(I.current),k.current="")}),onPointerMove:Z(t.onPointerMove,iu(A=>{const U=A.target,M=N.current!==A.clientX;if(A.currentTarget.contains(U)&&M){const z=A.clientX>N.current?"right":"left";Y.current=z,N.current=A.clientX}}))})})})})})})});OO.displayName=xn;var wG="MenuGroup",D_=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(ve.div,{role:"group",...r,ref:e})});D_.displayName=wG;var xG="MenuLabel",IO=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(ve.div,{...r,ref:e})});IO.displayName=xG;var sf="MenuItem",yS="menu.itemSelect",ip=g.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=g.useRef(null),o=Au(sf,t.__scopeMenu),a=L_(sf,t.__scopeMenu),l=Xe(e,i),c=g.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(yS,{bubbles:!0,cancelable:!0});d.addEventListener(yS,p=>r?.(p),{once:!0}),h0(d,f),f.defaultPrevented?c.current=!1:o.onClose()}};return h.jsx(LO,{...s,ref:l,disabled:n,onClick:Z(t.onClick,u),onPointerDown:d=>{t.onPointerDown?.(d),c.current=!0},onPointerUp:Z(t.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:Z(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||ly.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ip.displayName=sf;var LO=g.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,o=L_(sf,n),a=kO(n),l=g.useRef(null),c=Xe(e,l),[u,d]=g.useState(!1),[f,p]=g.useState("");return g.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[i.children]),h.jsx(su.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:h.jsx(xK,{asChild:!0,...a,focusable:!r,children:h.jsx(ve.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Z(t.onPointerMove,iu(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(t.onPointerLeave,iu(m=>o.onItemLeave(m))),onFocus:Z(t.onFocus,()=>d(!0)),onBlur:Z(t.onBlur,()=>d(!1))})})})}),bG="MenuCheckboxItem",NO=g.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return h.jsx(VO,{scope:t.__scopeMenu,checked:n,children:h.jsx(ip,{role:"menuitemcheckbox","aria-checked":of(n)?"mixed":n,...s,ref:e,"data-state":$_(n),onSelect:Z(s.onSelect,()=>r?.(of(n)?!0:!n),{checkForDefaultPrevented:!1})})})});NO.displayName=bG;var DO="MenuRadioGroup",[EG,SG]=Mi(DO,{value:void 0,onValueChange:()=>{}}),MO=g.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Tt(r);return h.jsx(EG,{scope:t.__scopeMenu,value:n,onValueChange:i,children:h.jsx(D_,{...s,ref:e})})});MO.displayName=DO;var $O="MenuRadioItem",FO=g.forwardRef((t,e)=>{const{value:n,...r}=t,s=SG($O,t.__scopeMenu),i=n===s.value;return h.jsx(VO,{scope:t.__scopeMenu,checked:i,children:h.jsx(ip,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":$_(i),onSelect:Z(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});FO.displayName=$O;var M_="MenuItemIndicator",[VO,TG]=Mi(M_,{checked:!1}),UO=g.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=TG(M_,n);return h.jsx(zn,{present:r||of(i.checked)||i.checked===!0,children:h.jsx(ve.span,{...s,ref:e,"data-state":$_(i.checked)})})});UO.displayName=M_;var PG="MenuSeparator",zO=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});zO.displayName=PG;var CG="MenuArrow",BO=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=sp(n);return h.jsx(fk,{...s,...r,ref:e})});BO.displayName=CG;var kG="MenuSub",[JQ,HO]=Mi(kG),Hl="MenuSubTrigger",WO=g.forwardRef((t,e)=>{const n=$i(Hl,t.__scopeMenu),r=Au(Hl,t.__scopeMenu),s=HO(Hl,t.__scopeMenu),i=L_(Hl,t.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},u=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>u,[u]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),h.jsx(O_,{asChild:!0,...c,children:h.jsx(LO,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":qO(n.open),...t,ref:Tf(e,s.onTriggerChange),onClick:d=>{t.onClick?.(d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Z(t.onPointerMove,iu(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Z(t.onPointerLeave,iu(d=>{u();const f=n.content?.getBoundingClientRect();if(f){const p=n.content?.dataset.side,m=p==="right",v=m?-5:5,w=f[m?"left":"right"],y=f[m?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:w,y:f.top},{x:y,y:f.top},{x:y,y:f.bottom},{x:w,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Z(t.onKeyDown,d=>{const f=i.searchRef.current!=="";t.disabled||f&&d.key===" "||cG[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});WO.displayName=Hl;var KO="MenuSubContent",GO=g.forwardRef((t,e)=>{const n=jO(xn,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=$i(xn,t.__scopeMenu),o=Au(xn,t.__scopeMenu),a=HO(KO,t.__scopeMenu),l=g.useRef(null),c=Xe(e,l);return h.jsx(su.Provider,{scope:t.__scopeMenu,children:h.jsx(zn,{present:r||i.open,children:h.jsx(su.Slot,{scope:t.__scopeMenu,children:h.jsx(N_,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{o.isUsingKeyboardRef.current&&l.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Z(t.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Z(t.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:Z(t.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=uG[o.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),a.trigger?.focus(),u.preventDefault())})})})})})});GO.displayName=KO;function qO(t){return t?"open":"closed"}function of(t){return t==="indeterminate"}function $_(t){return of(t)?"indeterminate":t?"checked":"unchecked"}function RG(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function jG(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function AG(t,e,n){const s=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=jG(t,Math.max(i,0));s.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function OG(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i].x,l=e[i].y,c=e[o].x,u=e[o].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(s=!s)}return s}function IG(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return OG(n,e)}function iu(t){return e=>e.pointerType==="mouse"?t(e):void 0}var LG=RO,NG=O_,DG=AO,MG=OO,$G=D_,FG=IO,VG=ip,UG=NO,zG=MO,BG=FO,HG=UO,WG=zO,KG=BO,GG=WO,qG=GO,F_="DropdownMenu",[YG,ZQ]=_a(F_,[CO]),Nt=CO(),[QG,YO]=YG(F_),QO=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,l=Nt(e),c=g.useRef(null),[u=!1,d]=yu({prop:s,defaultProp:i,onChange:o});return h.jsx(QG,{scope:e,triggerId:_i(),triggerRef:c,contentId:_i(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:h.jsx(LG,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};QO.displayName=F_;var XO="DropdownMenuTrigger",JO=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=YO(XO,n),o=Nt(n);return h.jsx(NG,{asChild:!0,...o,children:h.jsx(ve.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Tf(e,i.triggerRef),onPointerDown:Z(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Z(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});JO.displayName=XO;var XG="DropdownMenuPortal",ZO=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Nt(e);return h.jsx(DG,{...r,...n})};ZO.displayName=XG;var eI="DropdownMenuContent",tI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=YO(eI,n),i=Nt(n),o=g.useRef(!1);return h.jsx(MG,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:Z(t.onCloseAutoFocus,a=>{o.current||s.triggerRef.current?.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Z(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!s.modal||u)&&(o.current=!0)}),style:{...t.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)"}})});tI.displayName=eI;var JG="DropdownMenuGroup",ZG=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx($G,{...s,...r,ref:e})});ZG.displayName=JG;var eq="DropdownMenuLabel",nI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(FG,{...s,...r,ref:e})});nI.displayName=eq;var tq="DropdownMenuItem",rI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(VG,{...s,...r,ref:e})});rI.displayName=tq;var nq="DropdownMenuCheckboxItem",sI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(UG,{...s,...r,ref:e})});sI.displayName=nq;var rq="DropdownMenuRadioGroup",sq=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(zG,{...s,...r,ref:e})});sq.displayName=rq;var iq="DropdownMenuRadioItem",iI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(BG,{...s,...r,ref:e})});iI.displayName=iq;var oq="DropdownMenuItemIndicator",oI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(HG,{...s,...r,ref:e})});oI.displayName=oq;var aq="DropdownMenuSeparator",aI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(WG,{...s,...r,ref:e})});aI.displayName=aq;var lq="DropdownMenuArrow",cq=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(KG,{...s,...r,ref:e})});cq.displayName=lq;var uq="DropdownMenuSubTrigger",lI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(GG,{...s,...r,ref:e})});lI.displayName=uq;var dq="DropdownMenuSubContent",cI=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Nt(n);return h.jsx(qG,{...s,...r,ref:e,style:{...t.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)"}})});cI.displayName=dq;var hq=QO,fq=JO,pq=ZO,uI=tI,dI=nI,hI=rI,fI=sI,pI=iI,gI=oI,mI=aI,vI=lI,yI=cI;const _I=hq,wI=fq,gq=g.forwardRef(({className:t,inset:e,children:n,...r},s)=>h.jsxs(vI,{ref:s,className:Le("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,h.jsx(WM,{className:"ml-auto h-4 w-4"})]}));gq.displayName=vI.displayName;const mq=g.forwardRef(({className:t,...e},n)=>h.jsx(yI,{ref:n,className:Le("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",t),...e}));mq.displayName=yI.displayName;const V_=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(pq,{children:h.jsx(uI,{ref:r,sideOffset:e,className:Le("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));V_.displayName=uI.displayName;const hs=g.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(hI,{ref:r,className:Le("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",e&&"pl-8",t),...n}));hs.displayName=hI.displayName;const vq=g.forwardRef(({className:t,children:e,checked:n,...r},s)=>h.jsxs(fI,{ref:s,className:Le("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",t),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(gI,{children:h.jsx(BM,{className:"h-4 w-4"})})}),e]}));vq.displayName=fI.displayName;const yq=g.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(pI,{ref:r,className:Le("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",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(gI,{children:h.jsx(GM,{className:"h-2 w-2 fill-current"})})}),e]}));yq.displayName=pI.displayName;const _q=g.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(dI,{ref:r,className:Le("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));_q.displayName=dI.displayName;const Wl=g.forwardRef(({className:t,...e},n)=>h.jsx(mI,{ref:n,className:Le("-mx-1 my-1 h-px bg-muted",t),...e}));Wl.displayName=mI.displayName;var U_="Dialog",[xI,eX]=_a(U_),[wq,Hn]=xI(U_),bI=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=g.useRef(null),l=g.useRef(null),[c=!1,u]=yu({prop:r,defaultProp:s,onChange:i});return h.jsx(wq,{scope:e,triggerRef:a,contentRef:l,contentId:_i(),titleId:_i(),descriptionId:_i(),open:c,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};bI.displayName=U_;var EI="DialogTrigger",SI=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Hn(EI,n),i=Xe(e,s.triggerRef);return h.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":H_(s.open),...r,ref:i,onClick:Z(t.onClick,s.onOpenToggle)})});SI.displayName=EI;var z_="DialogPortal",[xq,TI]=xI(z_,{forceMount:void 0}),PI=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Hn(z_,e);return h.jsx(xq,{scope:e,forceMount:n,children:g.Children.map(r,o=>h.jsx(zn,{present:n||i.open,children:h.jsx(vu,{asChild:!0,container:s,children:o})}))})};PI.displayName=z_;var af="DialogOverlay",CI=g.forwardRef((t,e)=>{const n=TI(af,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Hn(af,t.__scopeDialog);return i.modal?h.jsx(zn,{present:r||i.open,children:h.jsx(bq,{...s,ref:e})}):null});CI.displayName=af;var bq=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Hn(af,n);return h.jsx(A_,{as:Ci,allowPinchZoom:!0,shards:[s.contentRef],children:h.jsx(ve.div,{"data-state":H_(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Ai="DialogContent",kI=g.forwardRef((t,e)=>{const n=TI(Ai,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Hn(Ai,t.__scopeDialog);return h.jsx(zn,{present:r||i.open,children:i.modal?h.jsx(Eq,{...s,ref:e}):h.jsx(Sq,{...s,ref:e})})});kI.displayName=Ai;var Eq=g.forwardRef((t,e)=>{const n=Hn(Ai,t.__scopeDialog),r=g.useRef(null),s=Xe(e,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return yO(i)},[]),h.jsx(RI,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Z(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Z(t.onFocusOutside,i=>i.preventDefault())})}),Sq=g.forwardRef((t,e)=>{const n=Hn(Ai,t.__scopeDialog),r=g.useRef(!1),s=g.useRef(!1);return h.jsx(RI,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),RI=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Hn(Ai,n),l=g.useRef(null),c=Xe(e,l);return cO(),h.jsxs(h.Fragment,{children:[h.jsx(j_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:h.jsx(mu,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":H_(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Tq,{titleId:a.titleId}),h.jsx(Cq,{contentRef:l,descriptionId:a.descriptionId})]})]})}),B_="DialogTitle",jI=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Hn(B_,n);return h.jsx(ve.h2,{id:s.titleId,...r,ref:e})});jI.displayName=B_;var AI="DialogDescription",OI=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Hn(AI,n);return h.jsx(ve.p,{id:s.descriptionId,...r,ref:e})});OI.displayName=AI;var II="DialogClose",LI=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Hn(II,n);return h.jsx(ve.button,{type:"button",...r,ref:e,onClick:Z(t.onClick,()=>s.onOpenChange(!1))})});LI.displayName=II;function H_(t){return t?"open":"closed"}var NI="DialogTitleWarning",[tX,DI]=YD(NI,{contentName:Ai,titleName:B_,docsSlug:"dialog"}),Tq=({titleId:t})=>{const e=DI(NI),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return g.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Pq="DialogDescriptionWarning",Cq=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DI(Pq).contentName}}.`;return g.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},kq=bI,Rq=SI,jq=PI,MI=CI,$I=kI,FI=jI,VI=OI,Aq=LI;const Oq=kq,Iq=Rq,Lq=jq,UI=g.forwardRef(({className:t,...e},n)=>h.jsx(MI,{className:Le("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",t),...e,ref:n}));UI.displayName=MI.displayName;const Nq=Rf("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"}}),zI=g.forwardRef(({side:t="right",className:e,children:n,...r},s)=>h.jsxs(Lq,{children:[h.jsx(UI,{}),h.jsxs($I,{ref:s,className:Le(Nq({side:t}),e),...r,children:[n,h.jsxs(Aq,{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-secondary",children:[h.jsx(NC,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zI.displayName=$I.displayName;const Dq=g.forwardRef(({className:t,...e},n)=>h.jsx(FI,{ref:n,className:Le("text-lg font-semibold text-foreground",t),...e}));Dq.displayName=FI.displayName;const Mq=g.forwardRef(({className:t,...e},n)=>h.jsx(VI,{ref:n,className:Le("text-sm text-muted-foreground",t),...e}));Mq.displayName=VI.displayName;var W_="Avatar",[$q,nX]=_a(W_),[Fq,BI]=$q(W_),HI=g.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=g.useState("idle");return h.jsx(Fq,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:h.jsx(ve.span,{...r,ref:e})})});HI.displayName=W_;var WI="AvatarImage",KI=g.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,o=BI(WI,n),a=Vq(r,i.referrerPolicy),l=Tt(c=>{s(c),o.onImageLoadingStatusChange(c)});return _r(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?h.jsx(ve.img,{...i,ref:e,src:r}):null});KI.displayName=WI;var GI="AvatarFallback",qI=g.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=BI(GI,n),[o,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&i.imageLoadingStatus!=="loaded"?h.jsx(ve.span,{...s,ref:e}):null});qI.displayName=GI;function Vq(t,e){const[n,r]=g.useState("idle");return _r(()=>{if(!t){r("error");return}let s=!0;const i=new window.Image,o=a=>()=>{s&&r(a)};return r("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=t,e&&(i.referrerPolicy=e),()=>{s=!1}},[t,e]),n}var YI=HI,QI=KI,XI=qI;const cy=g.forwardRef(({className:t,...e},n)=>h.jsx(YI,{ref:n,className:Le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));cy.displayName=YI.displayName;const uy=g.forwardRef(({className:t,...e},n)=>h.jsx(QI,{ref:n,className:Le("aspect-square h-full w-full",t),...e}));uy.displayName=QI.displayName;const dy=g.forwardRef(({className:t,...e},n)=>h.jsx(XI,{ref:n,className:Le("flex h-full w-full items-center justify-center rounded-full bg-nature-red text-white hover:bg-nature-yellow transition-colors",t),...e}));dy.displayName=XI.displayName;const _S=Rf("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",success:"border-transparent bg-green-500 text-white hover:bg-green-600",warning:"border-transparent bg-yellow-500 text-white hover:bg-yellow-600",info:"border-transparent bg-blue-500 text-white hover:bg-blue-600",gold:"border-transparent bg-yellow-400 text-yellow-900 hover:bg-yellow-500",silver:"border-transparent bg-gray-400 text-gray-50 hover:bg-gray-500",bronze:"border-transparent bg-amber-700 text-white hover:bg-amber-800",purple:"border-transparent bg-sparkle-purple text-white hover:opacity-90",gradient:"border-transparent bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 text-white",mint:"border-transparent bg-green-100 text-green-800 hover:bg-green-200",peach:"border-transparent bg-orange-100 text-orange-800 hover:bg-orange-200",sky:"border-transparent bg-blue-100 text-blue-800 hover:bg-blue-200",lavender:"border-transparent bg-purple-100 text-purple-800 hover:bg-purple-200"}},defaultVariants:{variant:"default"}});function Uq({className:t,variant:e,animated:n=!1,...r}){if(n){const s={className:Le(_S({variant:e}),t),initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:400,damping:10},whileHover:{scale:1.1}};return h.jsx(Pe.div,{...s,children:r.children})}return h.jsx("div",{className:Le(_S({variant:e}),t),...r})}const un=({Icon:t,className:e="",size:n=24,hoverEffect:r="bounce"})=>{const s=()=>{switch(r){case"bounce":return{scale:[1,1.2,1],y:[0,-4,0],transition:{duration:.3}};case"rotate":return{rotate:[0,15,-15,0],transition:{duration:.4}};case"scale":return{scale:1.15,transition:{duration:.2}};case"wiggle":return{rotate:[0,-3,3,-3,3,0],scale:1.5,transition:{duration:.5}};default:return{}}},i=()=>({scale:1.2,rotate:[0,-2,2,0],transition:{duration:.15}});return h.jsx(Pe.div,{className:`inline-block touch-manipulation ${e}`,whileHover:s(),whileTap:i(),style:{WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},children:h.jsx(t,{size:n})})},wS=({countryCode:t,size:e=20,className:n=""})=>h.jsx("img",{src:`https://flagcdn.com/w40/${t.toLowerCase()}.png`,alt:`${t} flag`,className:`rounded-full object-cover ${n}`,style:{width:e,height:e},loading:"lazy"}),xS={en:"gb",zh:"cn",bn:"in",es:"es",ja:"jp"},rX={"zh-Hans":"cn",ja:"jp",ko:"kr",hi:"in",bn:"in",es:"es",pt:"br",th:"th",vi:"vn",fil:"ph",ms:"my",lo:"la",id:"id",km:"kh",my:"mm"},zq=()=>{const{currentLanguage:t,changeLanguage:e}=Ta(),n=[{code:"en",name:"English"},{code:"zh",name:"ä¸ć–‡"},{code:"bn",name:"বাংলা"},{code:"es",name:"Español"},{code:"ja",name:"日本語"}],r=n.find(s=>s.code===t)?.name||"English";return h.jsxs(_I,{children:[h.jsx(wI,{asChild:!0,children:h.jsxs(Ts,{variant:"ghost",size:"sm",className:"gap-2",children:[h.jsx(wS,{countryCode:xS[t]||"gb",size:20}),h.jsx("span",{className:"hidden sm:inline",children:r})]})}),h.jsx(V_,{align:"end",className:"bg-white",children:n.map(s=>h.jsxs(hs,{onClick:()=>e(s.code),className:`flex items-center gap-2 ${t===s.code?"bg-gray-100":""}`,children:[h.jsx(wS,{countryCode:xS[s.code]||"gb",size:16}),s.name]},s.code))})]})},bS="https://cdn.storysparkle.org/logo_assets/favicon.webp",Bq=()=>{const[t,e]=g.useState(!1),[n,r]=g.useState(!1),s=Un(),i=ya(),{user:o,signOut:a}=G0(),{userType:l,subscription:c,avatarUrl:u,displayName:d,refreshSubscriptionStatus:f}=J7(),p=g.useRef(null),[m,v]=g.useState(!1),w=async k=>{const V=k.target.files?.[0];if(!(!V||!o)){if(V.size>5*1024*1024){lr.error("Image must be under 5MB");return}v(!0),lr.loading("Uploading photo...",{id:"avatar-upload"});try{const F=V.name.split(".").pop()||"jpg",Y=`${o.id}/avatar.${F}`,{error:N}=await xe.storage.from("avatars").upload(Y,V,{upsert:!0});if(N)throw N;const{data:{publicUrl:X}}=xe.storage.from("avatars").getPublicUrl(Y),B=`${X}?t=${Date.now()}`,{error:H}=await xe.from("profiles").update({avatar_url:B}).eq("id",o.id);if(H)throw H;lr.success("Profile photo updated!",{id:"avatar-upload"}),f()}catch(F){console.error("Avatar upload error:",F),lr.error("Failed to upload photo",{id:"avatar-upload"})}finally{v(!1),p.current&&(p.current.value="")}}},{t:y}=Lt("navbar"),{getLocalizedPath:_}=Ta(),x=k=>s.pathname===k;let E=[{name:y("home"),path:"/",icon:ZM},{name:y("stories"),path:"/stories",icon:s$},{name:y("improveReading"),path:"/improve-reading",icon:$M},{name:y("themes"),path:"/themes",icon:v$},{name:y("blog"),path:"/blog",icon:o$},{name:y("about"),path:"/about",icon:t$},{name:y("contact"),path:"/contact",icon:f$},{name:y("premiumPlans"),path:"/subscription",icon:Ua}];E.splice(2,0,{name:y("storyMaker"),path:"/story-maker",icon:S$}),E.splice(3,0,{name:y("textChecker"),path:"/text-checker",icon:QM});const b=[{name:y("readingCart"),path:"/reading-cart",icon:LC},{name:y("vocabulary"),path:"/vocabulary",icon:g$},{name:y("progress"),path:"/progress",icon:_$}],S=()=>e(!1),T=async()=>{if(!n){r(!0);try{await a(),i("/")}finally{r(!1)}}},P=(k,V)=>k?k.charAt(0).toUpperCase():V?V.charAt(0).toUpperCase():"U",I=l==="paid"||l==="admin"||c?.status==="active"&&!c?.isExpired;return h.jsxs("header",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[h.jsxs("div",{className:"container flex h-14 items-center",children:[h.jsxs(fe,{to:_("/"),className:"flex items-center gap-2 mr-6",children:[h.jsx("img",{src:bS,alt:"StorySparkle Logo",width:24,height:24,fetchPriority:"high",decoding:"async",className:"h-6 w-6"}),h.jsxs("span",{className:"font-bold text-lg hidden sm:inline-block",children:[h.jsx("span",{className:"text-nature-red",children:"Story"}),h.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})]}),h.jsxs("nav",{className:"hidden md:flex ipad-portrait:!hidden items-center space-x-4 lg:space-x-6 mx-6",children:[E.map(k=>h.jsx(fe,{to:_(k.path),className:`text-sm font-medium transition-colors hover:text-foreground/80 flex items-center justify-center p-2 ${x(k.path)?"text-nature-coral":"text-foreground/60"}`,title:k.name,children:x(k.path)?h.jsx(Pe.div,{animate:{y:[0,-3,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:h.jsx(un,{Icon:k.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer text-nature-coral"})}):h.jsx(un,{Icon:k.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer"})},k.path)),o&&h.jsx(h.Fragment,{children:b.map(k=>h.jsx(fe,{to:_(k.path),className:`text-sm font-medium transition-colors hover:text-foreground/80 flex items-center justify-center p-2 ${x(k.path)?"text-nature-coral":"text-foreground/60"}`,title:k.name,children:x(k.path)?h.jsx(Pe.div,{animate:{y:[0,-3,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:h.jsx(un,{Icon:k.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer text-nature-coral"})}):h.jsx(un,{Icon:k.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer"})},k.path))})]}),h.jsxs("div",{className:"flex items-center ml-auto gap-2",children:[h.jsx(zq,{}),o?h.jsxs(_I,{children:[h.jsx(wI,{asChild:!0,children:h.jsxs(Ts,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:[h.jsxs(cy,{className:"h-8 w-8",children:[h.jsx(uy,{src:u||"",alt:o.email||"User"}),h.jsx(dy,{children:P(d,o.email)})]}),I&&h.jsx("span",{className:"absolute -top-1 -right-1",children:h.jsx(Uq,{className:"h-4 w-4 p-0 flex items-center justify-center bg-amber-500 rounded-full",children:h.jsx(Ua,{className:"h-3 w-3 text-black"})})})]})}),h.jsxs(V_,{align:"end",className:"bg-background border border-border shadow-lg",children:[h.jsx("div",{className:"flex items-center justify-start gap-2 p-2",children:h.jsxs("div",{className:"flex flex-col space-y-1 leading-none",children:[d&&h.jsx("p",{className:"text-sm font-medium leading-none",children:d}),I&&h.jsxs("p",{className:"font-medium text-sm flex items-center gap-1",children:[h.jsx(Ua,{className:"h-3 w-3 text-amber-500"}),"Premium"]}),h.jsx("p",{className:"text-xs text-muted-foreground",children:o.email})]})}),h.jsx(Wl,{}),l==="admin"&&h.jsx(hs,{asChild:!0,children:h.jsx(fe,{to:"/admin",children:"Admin Dashboard"})}),l==="admin"&&h.jsx(Wl,{}),b.map(k=>h.jsx(hs,{asChild:!0,children:h.jsxs(fe,{to:k.path,className:"flex items-center gap-2",children:[k.icon&&h.jsx(k.icon,{className:"h-4 w-4"}),k.name]})},k.path)),h.jsx(Wl,{}),h.jsxs(hs,{onSelect:()=>p.current?.click(),disabled:m,className:"flex items-center gap-2 cursor-pointer",children:[h.jsx(Tx,{className:"h-4 w-4"}),y(m?"uploading":"updatePhoto")]}),h.jsx(hs,{asChild:!0,children:h.jsxs(fe,{to:_("/subscription"),className:"flex items-center gap-2",children:[h.jsx(Ua,{className:"h-4 w-4"}),y(I?"manageSubscription":"upgradeToPremium")]})}),h.jsx(hs,{asChild:!0,children:h.jsxs(fe,{to:_("/reset-password"),className:"flex items-center gap-2",children:[h.jsx(Px,{className:"h-4 w-4"}),y("resetPassword","Reset Password")]})}),h.jsx(Wl,{}),h.jsxs(hs,{className:"cursor-pointer",disabled:n,onSelect:k=>{k.preventDefault(),T()},children:[h.jsx(Rx,{className:"mr-2 h-4 w-4"}),h.jsx("span",{children:n?"Signing out...":y("logOut")})]})]})]}):h.jsx(fe,{to:_("/login"),children:h.jsxs(Ts,{variant:"default",size:"sm",className:"gap-1",children:[h.jsx(un,{Icon:kx,size:16,hoverEffect:"scale",className:"cursor-pointer mr-1"}),y("signIn")]})}),h.jsxs(Oq,{open:t,onOpenChange:e,children:[h.jsx(Iq,{asChild:!0,children:h.jsxs(Ts,{variant:"outline",size:"icon",className:"md:hidden ipad-portrait:!inline-flex",children:[h.jsx(un,{Icon:d$,size:20,hoverEffect:"wiggle",className:"cursor-pointer"}),h.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),h.jsxs(zI,{side:"right",className:"bg-white",children:[h.jsxs(fe,{to:_("/"),className:"flex items-center gap-2 mb-8",onClick:S,children:[h.jsx("img",{src:bS,alt:"StorySparkle Logo",width:24,height:24,decoding:"async",className:"h-6 w-6"}),h.jsxs("span",{className:"font-bold text-lg",children:[h.jsx("span",{className:"text-nature-red",children:"Story"}),h.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})]}),h.jsxs("nav",{className:"flex flex-col gap-4",children:[E.map(k=>h.jsxs(fe,{to:_(k.path),className:`hover:text-foreground flex items-center gap-2 ${x(k.path)?"text-nature-coral font-medium":"text-foreground/60"}`,onClick:S,children:[h.jsx(un,{Icon:k.icon,size:16,hoverEffect:"wiggle",className:`cursor-pointer touch-manipulation ${x(k.path)?"text-nature-coral":""}`}),k.name,x(k.path)&&h.jsx(Pe.div,{className:"ml-auto w-2 h-2 bg-nature-coral rounded-full",animate:{scale:[1,1.2,1]},transition:{duration:1,repeat:1/0}})]},k.path)),h.jsx("div",{className:"border-t my-2 pt-2"}),o?h.jsxs(h.Fragment,{children:[b.map(k=>h.jsxs(fe,{to:_(k.path),className:`hover:text-foreground flex items-center gap-2 ${x(k.path)?"text-nature-coral font-medium":"text-foreground/60"}`,onClick:S,children:[h.jsx(un,{Icon:k.icon,size:16,hoverEffect:"wiggle",className:`cursor-pointer touch-manipulation ${x(k.path)?"text-nature-coral":""}`}),k.name,x(k.path)&&h.jsx(Pe.div,{className:"ml-auto w-2 h-2 bg-nature-coral rounded-full",animate:{scale:[1,1.2,1]},transition:{duration:1,repeat:1/0}})]},k.path)),h.jsx("div",{className:"border-t my-2 pt-2"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(cy,{className:"h-8 w-8",children:[h.jsx(uy,{src:u||"",alt:o.email||"User"}),h.jsx(dy,{children:P(d,o.email)})]}),h.jsxs("div",{className:"flex flex-col",children:[d&&h.jsx("span",{className:"text-sm font-medium",children:d}),h.jsx("span",{className:"text-xs text-muted-foreground",children:o.email})]})]}),l==="admin"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"border-t my-2 pt-2"}),h.jsxs(fe,{to:"/admin",className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:S,children:[h.jsx(un,{Icon:VM,size:16,hoverEffect:"wiggle",className:"cursor-pointer touch-manipulation"}),y("adminDashboard")]})]}),h.jsx("div",{className:"border-t my-2 pt-2"}),h.jsxs("button",{onClick:()=>p.current?.click(),disabled:m,className:"hover:text-foreground flex items-center gap-2 text-foreground/60 text-left",children:[h.jsx(Tx,{className:"h-4 w-4"}),y(m?"uploading":"updatePhoto")]}),h.jsxs(fe,{to:_("/subscription"),className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:S,children:[h.jsx(Ua,{className:"h-4 w-4"}),y(I?"manageSubscription":"upgradeToPremium")]}),h.jsxs(fe,{to:_("/reset-password"),className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:S,children:[h.jsx(Px,{className:"h-4 w-4"}),y("resetPassword","Reset Password")]}),h.jsx("div",{className:"border-t my-2 pt-2"}),h.jsxs(Ts,{variant:"outline",disabled:n,onClick:async()=>{await T(),S()},children:[h.jsx(un,{Icon:Rx,size:16,hoverEffect:"scale",className:"cursor-pointer mr-2 touch-manipulation"}),n?"Signing out...":y("logOut")]})]}):h.jsxs(h.Fragment,{children:[h.jsxs(fe,{to:_("/login"),className:"flex items-center gap-2",onClick:S,children:[h.jsx(un,{Icon:kx,size:16,hoverEffect:"scale",className:"cursor-pointer touch-manipulation"}),y("signIn")]}),h.jsxs(fe,{to:_("/signup"),className:"flex items-center gap-2",onClick:S,children:[h.jsx(un,{Icon:b$,size:16,hoverEffect:"wiggle",className:"cursor-pointer touch-manipulation"}),y("createAccount")]})]})]})]})]})]})]}),o&&h.jsx("input",{type:"file",ref:p,className:"hidden",accept:"image/*",onChange:w})]})},Hq="https://cdn.storysparkle.org/logo_assets/favicon.webp",Wq=()=>{const{t,i18n:e}=Lt("footer"),{getLocalizedPath:n}=Ta(),r=new Date().getFullYear();return h.jsxs("footer",{className:"text-background py-12 px-4 md:px-8 bg-nature-green/80",children:[h.jsxs("div",{className:"max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-4 gap-8",children:[h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs(fe,{to:n("/"),className:"flex items-center gap-2",children:[h.jsx("img",{src:Hq,alt:"StorySparkle Logo",width:32,height:32,loading:"lazy",decoding:"async",className:"h-8 w-8"}),h.jsxs("span",{className:"font-bold text-xl",children:[h.jsx("span",{className:"text-nature-red",children:t("companyTitleStart")}),h.jsx("span",{className:"text-nature-coral",children:t("companyTitleEnd")})]})]}),h.jsx("p",{className:"text-white text-sm max-w-xs text-left",children:t("companyDescription")})]}),h.jsxs("div",{className:"text-left ",children:[h.jsx("h3",{className:"font-medium text-lg mb-4 text-white",children:t("quickLinks")}),h.jsxs("ul",{className:"space-y-2",children:[h.jsx("li",{children:h.jsx(fe,{to:n("/"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("home")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/stories"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("stories")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/story-maker"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("storyMaker")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/about"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("about")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/subscription"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("subscription")})})]})]}),h.jsx("div",{children:h.jsxs("div",{className:"text-left ",children:[h.jsx("h3",{className:"font-medium text-lg mb-4 text-white",children:t("resources")}),h.jsxs("ul",{className:"space-y-2",children:[h.jsx("li",{children:h.jsx(fe,{to:n("/text-checker"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("textChecker")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/improve-reading"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("improveReading")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/themes"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("themes")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/research"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("seslAlgorithm")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/blog"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("blog")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/blog/newsletter"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("newsletter")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/contact?tab=faq"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("faq")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/contact"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("contact")})})]})]})}),h.jsxs("div",{className:"text-left ",children:[h.jsx("h3",{className:"font-medium text-lg mb-4 text-white",children:t("legal")}),h.jsxs("ul",{className:"space-y-2",children:[h.jsx("li",{children:h.jsx(fe,{to:n("/terms"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("terms")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/refund"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("refund")})}),h.jsx("li",{children:h.jsx(fe,{to:n("/privacy"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("privacy")})})]})]})]}),h.jsxs("div",{className:"max-w-7xl mx-auto mt-12 pt-6 border-t border-border flex flex-col lg:flex-row justify-between items-center gap-4",children:[h.jsx("p",{className:"text-sm text-white",children:t("copyright",{year:r})}),h.jsxs("p",{className:"text-sm flex items-center gap-1 text-white",children:[t("madeWith")," ",h.jsx(LC,{className:"h-3 w-3 text-nature-red"})," ",t("forYoungReaders")]})]})]})},Kq=()=>{const[t,e]=g.useState({}),[n,r]=g.useState(!0);g.useEffect(()=>{(async()=>{try{const{data:a,error:l}=await xe.from("landing_assets").select("*");if(l)throw l;const c={};a?.forEach(u=>{c[u.section_id]||(c[u.section_id]={}),c[u.section_id][u.asset_key]=u.asset_url}),e(c)}catch(a){console.error("Failed to fetch landing assets:",a)}finally{r(!1)}})()},[]);const s=g.useCallback(async(o,a,l,c="image")=>{try{const{error:u}=await xe.from("landing_assets").upsert({section_id:o,asset_key:a,asset_url:l,asset_type:c},{onConflict:"section_id,asset_key"});if(u)throw u;return e(d=>({...d,[o]:{...d[o],[a]:l}})),!0}catch(u){return console.error("Failed to save landing asset:",u),!1}},[]),i=g.useCallback((o,a)=>t[o]?.[a],[t]);return{assets:t,isLoading:n,saveAsset:s,getAsset:i}},Oi={A1:{label:"A1 (Beginner)",shortLabel:"A1",ageBand:"5-7",classes:"bg-[#5ABFAD] text-white"},A2:{label:"A2 (Elementary)",shortLabel:"A2",ageBand:"7-9",classes:"bg-[#7BC99E] text-white"},B1:{label:"B1 (Intermediate)",shortLabel:"B1",ageBand:"9-12",classes:"bg-[#ABDA64] text-gray-800"},B2:{label:"B2 (Upper-Intermediate)",shortLabel:"B2",ageBand:"12-15",classes:"bg-[#F2CB05] text-gray-800"},C1:{label:"C1 (Advanced)",shortLabel:"C1",ageBand:"15-18",classes:"bg-[#F2A55E] text-gray-800"},C2:{label:"C2 (Proficient)",shortLabel:"C2",ageBand:"18+",classes:"bg-[#F27E7E] text-white"}},sX=t=>!t||!(t in Oi)?"bg-gray-100 text-gray-800":Oi[t].classes,iX=["A1","A2","B1","B2","C1","C2"],oX=t=>!t||!(t in Oi)?{label:"Unknown",shortLabel:"?",ageBand:"Unknown",classes:"bg-gray-100 text-gray-800"}:Oi[t],hy=t=>!t||!(t in Oi)?"Unknown":Oi[t].ageBand,aX=t=>{if(!t)return null;const e=Object.entries(Oi).find(([n,r])=>r.ageBand===t);return e?e[0]:null},lX=t=>t==null?"bg-gray-100 text-gray-800":t<=250?"bg-green-200 text-green-900":t<=400?"bg-green-500 text-green-50":t<=550?"bg-yellow-200 text-yellow-900":t<=700?"bg-yellow-500 text-yellow-50":t<=850?"bg-red-200 text-red-900":"bg-red-600 text-red-50",Gq=(t,e=160)=>t.length<=e?t:t.substring(0,e-3).trim()+"...",qq=t=>{const e="https://storysparkle.org",n=t.startsWith("/")?t:`/${t}`,r=n==="/"?"/":n.replace(/\/$/,"");return`${e}${r}`},cX=t=>{const e=t.cefrLevel?hy(t.cefrLevel):t.ageRange,n=e?` for ages ${e}`:"",r=t.cefrLevel?` (${t.cefrLevel} level)`:"";return Gq(`${t.description}${n}${r}. Interactive reading with audio narration and dyslexia support.`)},Yq={en:"en_US",bn:"bn_BD",es:"es_ES",zh:"zh_CN",ja:"ja_JP"},ka=({title:t="StorySparkle - Interactive Reading Experiences for Children",description:e="StorySparkle—reading practice app for kids with interactive leveled stories, adjustable-speed video narration, vocabulary builder, and custom AI story maker.",canonical:n,ogImage:r="https://cdn.storysparkle.org/logo_assets/favicon_512x512.png",ogType:s="website",structuredData:i,noIndex:o=!1,keywords:a})=>{const{currentLanguage:l}=Ta(),c=t.includes("StorySparkle")?t:`${t} | StorySparkle`,u=n||window.location.pathname,d=qq(u),f="https://storysparkle.org",p=Qc.filter(y=>y!=="en"),m=new RegExp(`^/(${p.join("|")})(?=/|$)`);let v=u.replace(m,"");v===""&&(v="/");const w=y=>y==="en"?f+(v==="/"?"/":v):f+"/"+y+(v==="/"?"":v);return h.jsxs(dV,{children:[h.jsx("title",{children:c}),h.jsx("meta",{name:"description",content:e}),h.jsx("meta",{name:"author",content:"StorySparkle"}),a&&h.jsx("meta",{name:"keywords",content:a}),h.jsx("html",{lang:l}),h.jsx("link",{rel:"canonical",href:d}),Qc.map(y=>h.jsx("link",{rel:"alternate",href:w(y),hrefLang:y},y)),h.jsx("link",{rel:"alternate",href:w("en"),hrefLang:"x-default"}),h.jsx("meta",{property:"og:title",content:c}),h.jsx("meta",{property:"og:description",content:e}),h.jsx("meta",{property:"og:type",content:s}),h.jsx("meta",{property:"og:url",content:d}),h.jsx("meta",{property:"og:image",content:r}),h.jsx("meta",{property:"og:site_name",content:"StorySparkle"}),h.jsx("meta",{property:"og:locale",content:Yq[l]||"en_US"}),h.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),h.jsx("meta",{name:"twitter:title",content:c}),h.jsx("meta",{name:"twitter:description",content:e}),h.jsx("meta",{name:"twitter:image",content:r}),h.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),h.jsx("meta",{name:"robots",content:o?"noindex,nofollow":"index,follow"}),h.jsx("meta",{name:"googlebot",content:o?"noindex,nofollow":"index,follow"}),h.jsx("meta",{name:"language",content:l}),i&&h.jsx("script",{type:"application/ld+json",children:JSON.stringify(i)})]})},Qq={"@context":"https://schema.org","@type":"Organization",name:"StorySparkle",description:"Interactive reading experiences for children with special support for dyslexic readers",url:"https://storysparkle.org",logo:"https://storysparkle.org/favicon.webp",sameAs:["https://twitter.com/StorySparkle"],contactPoint:{"@type":"ContactPoint",contactType:"customer service",email:"hello@storysparkle.com"}},Xq={"@context":"https://schema.org","@type":"WebSite",name:"StorySparkle",description:"Interactive reading experiences for children",url:"https://storysparkle.org",potentialAction:{"@type":"SearchAction",target:"https://storysparkle.org/stories?search={search_term_string}","query-input":"required name=search_term_string"}},uX=t=>({"@context":"https://schema.org","@type":"CreativeWork",name:t.title,description:t.description,author:{"@type":"Organization",name:"StorySparkle"},publisher:{"@type":"Organization",name:"StorySparkle",logo:"https://storysparkle.org/favicon.webp"},audience:(()=>{const e=hy(t.cefrLevel),n=e.includes("+")?parseInt(e):parseInt(e.split("-")[0])||3,r=e.includes("+")?99:parseInt(e.split("-")[1])||12;return{"@type":"Audience",audienceType:"Children",suggestedMinAge:n,suggestedMaxAge:r}})(),educationalAlignment:{"@type":"AlignmentObject",educationalFramework:"CEFR Language Levels",targetDescription:`CEFR ${t.cefrLevel||"Unknown"} reading level`},learningResourceType:"Interactive Story",interactivityType:"active",typicalAgeRange:`${hy(t.cefrLevel)} years`,timeRequired:`PT${Math.floor(t.duration/60)}M${t.duration%60}S`,wordCount:t.wordCount,genre:t.theme,accessibilityFeature:["audioDescription","synchronizedAudioText","dyslexiaSupport"],isAccessibleForFree:!1,hasPart:{"@type":"WebPageElement",isAccessibleForFree:!1,cssSelector:".story-body-gated"}}),dX=t=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((e,n)=>({"@type":"ListItem",position:n+1,name:e.name,item:`https://storysparkle.org${e.url}`}))}),Jq={1:"M0,64 C120,20 240,100 480,64 C720,28 960,96 1200,64 C1320,48 1380,80 1440,64 L1440,120 L0,120 Z",2:"M0,40 C180,100 360,20 540,60 C720,100 900,30 1080,70 C1200,90 1340,40 1440,50 L1440,120 L0,120 Z",3:"M0,80 C160,30 320,90 480,50 C640,10 800,80 960,40 C1120,0 1280,70 1440,30 L1440,120 L0,120 Z",4:"M0,60 C240,110 480,10 720,70 C960,130 1200,20 1440,60 L1440,120 L0,120 Z",5:"M0,50 C100,20 200,80 360,40 C520,0 640,90 800,50 C960,10 1100,85 1260,45 C1360,25 1400,60 1440,55 L1440,120 L0,120 Z",6:"M0,45 C180,36 360,58 540,45 S900,32 1080,45 S1260,54 1440,45 L1440,120 L0,120 Z",7:"M0,30 C180,90 360,10 600,70 C840,130 1020,20 1200,60 C1320,80 1400,40 1440,50 L1440,120 L0,120 Z",8:"M0,70 C80,20 160,100 300,50 C440,0 520,80 660,60 C800,40 880,100 1020,30 C1160,-10 1300,80 1440,55 L1440,120 L0,120 Z",9:"M0,55 C60,90 140,15 260,65 C380,115 440,20 580,55 C720,90 800,10 940,50 C1080,90 1180,25 1300,60 C1380,80 1420,50 1440,60 L1440,120 L0,120 Z",10:"M0,80 C240,20 480,100 720,40 C960,-10 1200,90 1440,35 L1440,120 L0,120 Z",11:"M0,25 C100,70 220,10 380,55 C540,100 660,15 820,65 C980,110 1120,30 1280,70 C1360,90 1420,45 1440,55 L1440,120 L0,120 Z",12:"M0,40 C180,90 360,100 540,30 C720,-20 900,-10 1080,50 C1200,90 1340,80 1440,45 L1440,120 L0,120 Z"},Pn=({topColor:t,bottomColor:e,variant:n=1,flip:r=!1,className:s=""})=>h.jsx("div",{className:`relative w-full overflow-hidden leading-[0] ${s}`,style:{backgroundColor:t},"aria-hidden":"true",children:h.jsx("svg",{viewBox:"0 0 1440 120",preserveAspectRatio:"none",className:"block w-full h-[60px] md:h-[80px] lg:h-[120px]",style:{transform:r?"scaleX(-1)":void 0},children:h.jsx("path",{d:Jq[n],fill:e})})}),ES=1024;function Zq(){const[t,e]=g.useState(void 0);return g.useEffect(()=>{const n=()=>{const s=window.innerWidth,i=window.innerHeight;return s<ES||s===ES&&i>s},r=()=>e(n());return window.addEventListener("resize",r),window.addEventListener("orientationchange",r),e(n()),()=>{window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[]),!!t}function eY(t,e,n){const r=t(e,{returnObjects:!0});return Array.isArray(r)?r:[]}const tY=({words:t,className:e="",typingSpeed:n=100,deletingSpeed:r=60,pauseAfterWord:s=1500,finalWordMultiplier:i=5})=>{const[o,a]=g.useState(0),[l,c]=g.useState(""),[u,d]=g.useState(!1),[f,p]=g.useState(!1),m=Array.isArray(t)&&t.length>0?t:[];g.useEffect(()=>{a(0),c(""),d(!1),p(!1)},[m.join("|")]);const v=m[o]??"",w=o===m.length-1,y=g.useCallback(()=>{if(!(f||!v))if(u)l.length>0?c(l.slice(0,-1)):(d(!1),a(_=>m.length?(_+1)%m.length:0));else if(l.length<v.length)c(v.slice(0,l.length+1));else{p(!0);const _=w?s*i:s;setTimeout(()=>{p(!1),d(!0)},_)}},[l,u,f,v,w,s,i,m.length]);return g.useEffect(()=>{if(f||!v)return;const x=setTimeout(y,u?r:n);return()=>clearTimeout(x)},[y,u,f,n,r,v]),v?h.jsxs("span",{className:e,children:[l,h.jsx("span",{className:"animate-blink",children:"|"})]}):null},nY="https://cdn.storysparkle.org/ui_elements/Hero%20Icons/StoryLibrary.webp",K_=({className:t="",labelOverride:e})=>{const{getLocalizedPath:n}=Ta(),{t:r}=Lt("landing");return h.jsx(fe,{to:n("/stories"),className:t,children:h.jsxs(Pe.div,{className:"relative inline-flex flex-col items-center pl-12",whileHover:{scale:1.05},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},children:[h.jsx("img",{src:nY,alt:"Magical story book",className:"absolute -top-0 left-0 w-20 h-auto pointer-events-none z-10 rotate-[-15deg]"}),h.jsx("div",{className:`bg-gradient-to-r from-orange-600 via-red-400 to-orange-300
pl-12 pr-10 py-4 rounded-full shadow-lg shadow-orange-600/30
hover:shadow-xl hover:shadow-orange-600/40 transition-shadow`,children:h.jsx("span",{className:"text-white font-bold uppercase tracking-widest text-sm md:text-base whitespace-nowrap",children:e||r("buttons.readStories")})})]})})},rY="https://cdn.storysparkle.org/landing_assets/computer.webp",SS="https://cdn.storysparkle.org/logo_assets/StorySparkle_Logo_Colourful_Padding.webp",sY="https://cdn.storysparkle.org/landing_assets/cheerful-characters-reduced-size.mp4",iY=()=>{const t=g.useRef(null),e=Zq(),{t:n}=Lt("landing"),[r,s]=g.useState(!1),[i,o]=g.useState(!1);g.useEffect(()=>{const d=new Image,f=()=>o(!0);d.onload=f,d.onerror=f,d.src=SS;const p=window.setTimeout(f,800);return()=>window.clearTimeout(p)},[]);const{scrollYProgress:a}=rO({target:t,offset:["start start","end end"]}),l=rf(a,[0,.5],[0,500]),c=rf(a,[0,.5],[1,0]);h7(a,"change",d=>{d>=.01&&!r&&s(!0),d<.01&&r&&s(!1)});const u=eY(n,"hero.typewriterWords");return h.jsx("section",{ref:t,className:"relative h-auto md:h-[250vh]",children:h.jsxs("div",{className:"md:sticky overflow-hidden min-h-[calc(100vh-3.5rem)] md:min-h-0 md:h-[calc(100vh-3.5rem)]",style:{top:"3.5rem"},children:[h.jsx("div",{className:"absolute top-0 left-0 right-0 bottom-0",style:{background:"#FFFFFF"}}),h.jsxs("div",{className:"relative h-full flex flex-col md:flex-row ipad-portrait:!flex-col items-center justify-center ipad-portrait:!justify-around px-4 md:px-8 ipad-portrait:!py-4",children:[h.jsx("div",{className:"w-full md:w-1/2 ipad-portrait:!w-full flex items-center justify-center ipad-portrait:!order-1",children:h.jsxs("div",{className:"relative w-[80vw] md:w-[42vw] max-w-2xl",children:[h.jsx(Pe.div,{className:"relative z-10 w-full",initial:{scale:.95},animate:i?{scale:1}:{scale:.95},transition:{delay:.1,duration:.6,type:"spring",stiffness:200,damping:20},children:h.jsx("img",{src:rY,alt:"Desktop computer",className:"w-full h-auto",width:2084,height:1916,fetchPriority:"high",decoding:"async"})}),h.jsxs("div",{className:"absolute z-20 top-[8%] md:top-[5%] left-[10%] md:left-[8%] right-[10%] md:right-[8%] bottom-[40%] md:bottom-[38%] flex flex-col items-center justify-center text-center px-2 md:px-4",children:[h.jsx(Pe.p,{initial:{opacity:0,y:10},animate:i?{opacity:1,y:0}:{opacity:0,y:10},transition:{delay:.8,duration:.5},className:"text-sm sm:text-lg md:text-xl lg:text-2xl font-noto font-semibold text-foreground mb-1",children:n("hero.prefix")}),h.jsxs(Pe.div,{initial:{opacity:0},animate:i?{opacity:1}:{opacity:0},transition:{delay:1.1,duration:.5},children:[h.jsx("h1",{className:"sr-only",children:"StorySparkle | Reading is Fun"}),h.jsx("div",{"aria-hidden":"true",children:h.jsx(tY,{words:u,className:"text-lg sm:text-2xl md:text-3xl lg:text-4xl bg-gradient-to-r from-nature-purple via-nature-coral to-nature-green bg-clip-text text-transparent font-bold",finalWordMultiplier:5})})]}),h.jsx(Pe.img,{src:SS,alt:"StorySparkle Logo",className:"mt-2 md:mt-4 w-[55%] md:w-[60%] max-w-xs h-auto",initial:{opacity:0,y:10},animate:i?{opacity:1,y:0}:{opacity:0,y:10},transition:{delay:1.4,duration:.5}})]})]})}),h.jsxs("div",{className:"w-full md:w-1/2 ipad-portrait:!w-full flex flex-col items-center md:items-end ipad-portrait:!items-center justify-between md:py-[4%] h-full max-[1366px]:lg:justify-center max-[1366px]:lg:gap-4 max-[1366px]:lg:py-0 ipad-portrait:!justify-around ipad-portrait:!py-0 ipad-portrait:!h-auto ipad-portrait:!gap-6 ipad-portrait:!order-2",children:[h.jsx(Pe.div,{initial:{opacity:0,y:20},animate:i?{opacity:1,y:0}:{opacity:0,y:20},transition:{delay:e?2:3.8,duration:.6},className:"mt-4 md:mt-0 ipad-portrait:!order-1",children:h.jsx(K_,{})}),h.jsx(Pe.video,{src:sY,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-[80%] md:w-[90%] ipad-portrait:!w-[60%] max-w-xl h-auto pointer-events-none self-center md:self-end ipad-portrait:!self-center ipad-portrait:!order-2",style:{y:r&&!e?l:0,opacity:r&&!e?c:1},initial:{y:300,opacity:0},animate:i?{y:0,opacity:1}:{y:300,opacity:0},transition:{delay:e?2.2:3.2,duration:1.2,ease:"easeOut"}})]})]})]})})},oY="https://cdn.storysparkle.org/landing_assets/flicker-reading-reduced-size.mp4",aY=()=>{const t=g.useRef(null),e=K7(t,{amount:.3}),{t:n}=Lt("landing");return h.jsx("section",{ref:t,className:"relative min-h-0 py-8 lg:py-0 lg:min-h-screen flex items-center overflow-hidden",style:{background:"#FFF8E7"},children:h.jsx("div",{className:"container mx-auto max-w-6xl px-6",children:h.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-4 lg:gap-12",children:[h.jsxs("div",{className:"max-w-lg text-center lg:text-left flex flex-col",children:[h.jsxs("div",{className:"space-y-2 lg:space-y-4",children:[h.jsx("h2",{className:"section-header text-[22px] lg:text-[32px]",children:n("description.heading")}),h.jsx("p",{className:"section-subtext text-sm lg:text-xl",children:n("description.subtext")})]}),h.jsx("div",{className:"mt-4 lg:mt-8",children:h.jsx(K_,{})})]}),h.jsx("div",{className:"flex-1 flex justify-center items-center",children:h.jsx(Pe.div,{className:"w-40 md:w-80 lg:w-96",initial:{x:200,opacity:0},animate:{x:e?0:200,opacity:e?1:0},transition:{duration:1.2,ease:[.25,.1,.25,1]},children:h.jsx("video",{src:oY,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full object-contain"})})})]})})})},lY="https://cdn.storysparkle.org/ui_elements/Speedometer.webp",cY=({className:t=""})=>{const{getLocalizedPath:e}=Ta(),{t:n}=Lt("landing");return h.jsx(fe,{to:e("/research"),className:t,children:h.jsxs(Pe.div,{className:"relative inline-flex flex-col items-center pl-10",whileHover:{scale:1.05},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},children:[h.jsx("img",{src:lY,alt:"SESL Algorithm speedometer",className:"absolute top-2 left-0 w-16 h-auto pointer-events-none z-10 rotate-[-15deg]"}),h.jsx("div",{className:`bg-gradient-to-r from-cyan-500 via-teal-500 to-blue-500
pl-12 pr-10 py-4 rounded-full shadow-lg shadow-teal-500/30
hover:shadow-xl hover:shadow-teal-500/40 transition-shadow`,children:h.jsx("span",{className:"text-white font-bold uppercase tracking-widest text-sm md:text-base",children:n("buttons.seslAlgorithm")})})]})})},uY="https://cdn.storysparkle.org/landing_assets/xp-chart-card.webp",dY=({sectionRef:t})=>{const e=g.useRef(null),n=t??e,{t:r}=Lt("landing"),[s,i]=g.useState(!1);return g.useEffect(()=>{const o=n.current;if(!o)return;const a=new IntersectionObserver(l=>{l.forEach(c=>i(c.isIntersecting))},{rootMargin:"-50% 0px -50% 0px",threshold:0});return a.observe(o),()=>a.disconnect()},[n]),h.jsx("section",{ref:n,className:"relative h-[150vh]",style:{background:"#ECF4E8"},children:h.jsxs("div",{className:"sticky top-14 h-[calc(100vh-3.5rem)] overflow-hidden flex flex-col justify-start pt-16 md:pt-0 md:justify-center",children:[h.jsxs("div",{className:"relative z-10 px-6 md:absolute md:top-16 md:left-0 md:right-0 md:px-12 lg:px-20",children:[h.jsx("h2",{className:"section-header text-[22px] lg:text-[32px] mb-4",children:r("seslProgress.heading")}),h.jsx("p",{className:"section-subtext text-sm lg:text-xl max-w-6xl",children:r("seslProgress.subtext")})]}),h.jsx("div",{className:"relative z-10 mt-6 px-6 flex justify-center md:block md:absolute md:top-[30%] md:left-0 md:mt-0 md:px-12 lg:px-20",children:h.jsx(cY,{})}),h.jsx(Pe.div,{className:"relative mt-8 w-full px-6 md:absolute md:left-0 md:top-[45%] md:-translate-y-1/2 md:w-[75vw] md:max-w-6xl md:mt-0 md:px-0 md:pl-12 lg:pl-20",initial:{x:"30%",opacity:0},animate:s?{x:"0%",opacity:1}:{x:"30%",opacity:0},transition:{duration:.8,ease:[.22,1,.36,1]},children:h.jsx("img",{src:uY,alt:"XP Points Progress Chart",className:"w-full h-auto rounded-2xl shadow-2xl",width:1600,height:1e3,loading:"lazy",decoding:"async"})})]})})},hY=({variant:t="inline",className:e="",as:n="span"})=>{let r="",s="";switch(t){case"navbar":r="text-lg",s="font-bold";break;case"footer":r="text-xl",s="font-bold";break;default:r="",s="";break}return h.jsxs(n,{className:m0(e,s,r,"whitespace-nowrap font-noto inline"),children:[h.jsx("span",{className:"text-nature-red",children:"Story"}),h.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})},fY="https://cdn.storysparkle.org/landing_assets/castle-on-cloud.webp",pY=()=>{const{t}=Lt("landing");return h.jsx("section",{className:"relative h-[200vh]",children:h.jsxs("div",{className:"sticky top-14 h-[calc(100vh-3.5rem)] flex flex-col overflow-hidden",style:{background:"#FFF7ED"},children:[h.jsx(Pe.img,{src:fY,alt:"Castle on Cloud",className:"absolute bottom-0 left-0 h-[35vh] md:h-[75vh] max-[1366px]:lg:h-[55vh] ipad-portrait:!h-[42vh] w-auto object-contain animate-bob pl-4 md:pl-8",initial:{opacity:0},whileInView:{opacity:1},viewport:{once:!0},transition:{duration:1.5,ease:"easeOut"}}),h.jsxs("div",{className:"relative flex flex-col items-center justify-start md:justify-center ipad-portrait:!justify-start text-center z-10 px-4 md:px-8 flex-1",children:[h.jsxs("div",{className:"absolute top-[12%] left-0 right-0 px-4 md:relative md:top-auto md:px-0 md:pt-0 ipad-portrait:!absolute ipad-portrait:!top-[12%] ipad-portrait:!px-4",children:[h.jsx(Pe.h2,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"section-header text-[22px] lg:text-[32px] text-center mb-3",children:t("cta.heading")}),h.jsxs(Pe.p,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.2},className:"section-subtext text-sm lg:text-xl text-center max-w-lg ipad-portrait:!max-w-md mx-auto mb-8",children:[t("cta.subtextPart1")," ",h.jsx(hY,{})," ",t("cta.subtextPart2")]})]}),h.jsxs("div",{className:"absolute top-[45%] left-0 right-0 -translate-y-1/2 md:relative md:top-auto md:translate-y-0 ipad-portrait:!absolute ipad-portrait:!top-[45%] ipad-portrait:!-translate-y-1/2",children:[h.jsx(Pe.div,{initial:{y:30,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{delay:.5},children:h.jsx(K_,{})}),h.jsx(Pe.p,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.3},className:"section-footnote mt-3 text-center",children:t("cta.footnote")})]})]})]})})},TS=()=>h.jsx("div",{style:{minHeight:"100vh"},"aria-hidden":"true"}),gY="https://cdn.storysparkle.org";function Fg(t){let n="";for(let r=0;r<t.length;r+=32768){const s=t.subarray(r,r+32768);n+=String.fromCharCode.apply(null,s)}return btoa(n)}async function mY(t,e,n,r){let s,i=r;if(n instanceof File){i=i||n.type;const l=await n.arrayBuffer();s=Fg(new Uint8Array(l))}else if(n instanceof Blob){i=i||n.type;const l=await n.arrayBuffer();s=Fg(new Uint8Array(l))}else s=Fg(n);const{data:o,error:a}=await xe.functions.invoke("r2-upload",{body:{bucket:t,path:e,content:s,contentType:i||"application/octet-stream"}});if(a)throw new Error(`R2 upload failed: ${a.message}`);if(o?.error)throw new Error(`R2 upload failed: ${o.error}`);return o.url}async function hX(t,e){const{data:n,error:r}=await xe.functions.invoke("r2-delete",{body:{bucket:t,path:e}});if(r)throw new Error(`R2 delete failed: ${r.message}`);if(n?.error)throw new Error(`R2 delete failed: ${n.error}`);return!0}async function fX(t){const{data:e,error:n}=await xe.functions.invoke("r2-list",{body:{prefix:t}});if(n)throw new Error(`R2 list failed: ${n.message}`);if(e?.error)throw new Error(`R2 list failed: ${e.error}`);return e.files||[]}function vY(t,e){return`${gY}/${t}/${e}`}function yY(t){const e=t.split(".").pop(),n=Date.now(),r=Math.random().toString(36).substring(2,8);return`${n}-${r}.${e}`}const _Y=({placeholder:t,description:e,aspectRatio:n="square",className:r="",imageSrc:s,size:i="md",uploadPath:o="landing",onUpload:a})=>{const l=g.useRef(null),[c,u]=g.useState(!1),[d,f]=g.useState(s),p={square:"aspect-square","16:9":"aspect-video","4:3":"aspect-[4/3]",auto:""},m={sm:"w-16 h-16",md:"w-24 h-24",lg:"w-32 h-32",full:"w-full"},v=()=>{l.current?.click()},w=async y=>{const _=y.target.files?.[0];if(!_)return;if(!["image/jpeg","image/png","image/gif","image/webp"].includes(_.type)){lr.error("Please upload an image file (JPEG, PNG, GIF, or WebP)");return}if(_.size>10*1024*1024){lr.error("File size must be less than 10MB");return}u(!0);try{const E=yY(_.name),b=`${o}/${E}`;await mY("landing_assets",b,_,_.type);const S=vY("landing_assets",b);f(S),a?.(S),lr.success("Image uploaded successfully!")}catch(E){console.error("Upload failed:",E),lr.error("Failed to upload image")}finally{u(!1),l.current&&(l.current.value="")}};return d?h.jsxs("div",{className:"relative group",children:[h.jsx("img",{src:d,alt:e,className:`object-cover rounded-xl ${n!=="auto"?p[n]:""} ${i!=="full"?m[i]:"w-full"} ${r}`}),h.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:w,className:"hidden"}),h.jsx(Ts,{variant:"secondary",size:"sm",onClick:v,disabled:c,className:"absolute bottom-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:c?h.jsx(Cx,{className:"w-4 h-4 animate-spin"}):h.jsx(jx,{className:"w-4 h-4"})})]}):h.jsxs("div",{className:`relative border-2 border-dashed border-muted-foreground/40 rounded-xl bg-muted/20 flex flex-col items-center justify-center p-4 text-center ${n!=="auto"?p[n]:"min-h-[100px]"} ${i!=="full"?m[i]:"w-full"} ${r}`,children:[h.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:w,className:"hidden"}),h.jsx("div",{className:"text-2xl mb-2",children:"🖼️"}),h.jsx(Ts,{variant:"outline",size:"sm",onClick:v,disabled:c,className:"text-xs",children:c?h.jsxs(h.Fragment,{children:[h.jsx(Cx,{className:"w-3 h-3 mr-1 animate-spin"}),"Uploading..."]}):h.jsxs(h.Fragment,{children:[h.jsx(jx,{className:"w-3 h-3 mr-1"}),"Upload"]})})]})},wY=({isVisible:t,beanstalkImageSrc:e,onBeanstalkUpload:n})=>h.jsx(U6,{children:t&&h.jsx(Pe.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{duration:1.2,ease:[.4,0,.2,1]},className:"fixed bottom-0 right-0 z-30 h-screen ipad-portrait:!h-[45vh] pointer-events-none",children:e?h.jsx("img",{src:e,alt:"Magical beanstalk",className:"h-full w-auto object-contain"}):h.jsx("div",{className:"h-full w-32 pointer-events-auto",children:h.jsx(_Y,{placeholder:"BEANSTALK",description:"Claymation beanstalk growing from bottom to top",aspectRatio:"auto",size:"full",className:"h-full",imageSrc:e,onUpload:n})})})}),xY="1071313126266-r1durnkl0lrnj4ur1609lit0dm7div5n.apps.googleusercontent.com",PS="googleOneTapDismissed",bY=1e3*60*60,EY=async t=>{const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(n)).map(r=>r.toString(16).padStart(2,"0")).join("")},SY=()=>{const{user:t,isLoading:e}=G0(),n=g.useRef(!1);return g.useEffect(()=>{if(t||e||n.current)return;const r=sessionStorage.getItem(PS);if(r&&Date.now()-Number(r)<bY)return;const s=()=>new Promise(l=>{if(document.querySelector('script[src="https://accounts.google.com/gsi/client"]')){l();return}const c=document.createElement("script");c.src="https://accounts.google.com/gsi/client",c.async=!0,c.onload=()=>l(),c.onerror=()=>l(),document.head.appendChild(c)});let i,o;const a=async()=>{if(!window.google?.accounts?.id)return!1;const l=crypto.randomUUID(),c=await EY(l);return window.google.accounts.id.initialize({client_id:xY,callback:async u=>{try{const{error:d}=await xe.auth.signInWithIdToken({provider:"google",token:u.credential,nonce:l});d&&console.error("Google One Tap sign-in error:",d.message)}catch(d){console.error("Google One Tap callback error:",d)}},nonce:c,use_fedcm_for_prompt:!0,auto_select:!1,cancel_on_tap_outside:!0,context:"signup",itp_support:!0}),window.google.accounts.id.prompt(u=>{u.isDismissedMoment()&&sessionStorage.setItem(PS,String(Date.now()))}),n.current=!0,!0};return s().then(()=>{a().then(l=>{l||(i=setInterval(()=>{a().then(c=>{c&&i&&clearInterval(i)})},300),o=setTimeout(()=>{i&&clearInterval(i)},5e3))})}),()=>{i&&clearInterval(i),o&&clearTimeout(o),window.google?.accounts?.id&&window.google.accounts.id.cancel()}},[t,e]),null},TY=g.lazy(()=>C(()=>import("./ProfessionalNarrationSection-CKFPrwvm.js"),[])),PY=g.lazy(()=>C(()=>import("./SyncedHighlightsSection-BTbs0uZf.js"),__vite__mapDeps([0,1]))),CY=g.lazy(()=>C(()=>import("./InteractiveWordsSection-Dum9fa2v.js"),[])),kY=g.lazy(()=>C(()=>import("./VocabularySection-D5LkE3Y1.js"),[])),RY=g.lazy(()=>C(()=>import("./ChooseYourPaceSection-CN0badvS.js"),__vite__mapDeps([2,3]))),jY=g.lazy(()=>C(()=>import("./DyslexiaSection-HxytKai5.js"),__vite__mapDeps([4,1]))),AY=g.lazy(()=>C(()=>import("./CheckTextSection-COY-6kc8.js"),__vite__mapDeps([5,1,6]))),OY=g.lazy(()=>C(()=>import("./ThemesSection-C3c4vtn1.js"),__vite__mapDeps([7,1,8]))),IY=g.lazy(()=>C(()=>import("./StoryMakerSection-lWQqOrQu.js"),[])),LY=g.lazy(()=>C(()=>import("./AchievementsSection-BvnABxom.js"),[])),NY=g.lazy(()=>C(()=>import("./HotAirBalloon-DFAojK9l.js"),[])),DY=g.lazy(()=>C(()=>import("./QuillWipe-Bu996A7p.js"),[])),MY="https://cdn.storysparkle.org/landing_assets/flicker-on-beanstalk.webp",Be={white:"#FFFFFF",buttercream:"#FFF8E7",lavender:"#F3E8FF",sky:"#E0F2FE",lemon:"#FEF9C3",pink:"#FCE7F3",mint:"#F0FDF4",violet:"#EDE9FE",peach:"#FFF7ED",apricot:"#FFECD2",seafoam:"#E0F5F0",rose:"#FFE4E6",sage:"#ECF4E8"},sl=()=>{const{t}=Lt("home"),{getAsset:e,saveAsset:n}=Kq(),[r,s]=g.useState(!1),[i,o]=g.useState(!1),[a,l]=g.useState(0),c=g.useRef(null),u=g.useRef(null),{scrollYProgress:d}=rO({target:u,offset:["start start","end end"]}),f=rf(d,[.4,.9],["100%","0%"]),p=rf(d,[.4,.7],[0,1]),{setLumiTarget:m,setOnTargetReached:v}=Pj(),[w,y]=g.useState(!1);return g.useEffect(()=>(v(()=>{y(!0),setTimeout(()=>{y(!1),m(null)},1e3)}),()=>v(void 0)),[v,m,y]),g.useEffect(()=>{const _=()=>{const x=window.scrollY,E=window.innerHeight,b=Math.floor(x/E);l(Math.min(b,10))};return window.addEventListener("scroll",_),()=>window.removeEventListener("scroll",_)},[]),h.jsxs(h.Fragment,{children:[h.jsx(SY,{}),h.jsx(ka,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/",structuredData:[Qq,Xq]}),h.jsxs("div",{className:"min-h-screen overflow-x-clip",style:{background:Be.white},children:[h.jsx(iY,{}),h.jsx(Pn,{topColor:Be.white,bottomColor:Be.buttercream,variant:8,flip:!0}),h.jsx(aY,{}),h.jsxs(g.Suspense,{fallback:h.jsx(TS,{}),children:[h.jsx(Pn,{topColor:Be.buttercream,bottomColor:Be.lavender,variant:8}),h.jsx(TY,{}),h.jsx(Pn,{topColor:Be.lavender,bottomColor:Be.sky,variant:2,flip:!0}),h.jsx(PY,{}),h.jsx(Pn,{topColor:Be.sky,bottomColor:Be.apricot,variant:9}),h.jsx(CY,{videoSrc:e("interactive_words","main_video"),onVideoUpload:_=>n("interactive_words","main_video",_,"video"),onLumiTarget:_=>m(_),isWordHovered:w}),h.jsx(Pn,{topColor:Be.apricot,bottomColor:Be.lemon,variant:4,flip:!0}),h.jsx(kY,{}),h.jsx(Pn,{topColor:Be.lemon,bottomColor:Be.seafoam,variant:10}),h.jsx(RY,{}),h.jsx("div",{className:"relative -mt-12 z-20 pointer-events-none",children:h.jsx(Pn,{topColor:"transparent",bottomColor:Be.pink,variant:6,flip:!0})}),h.jsx(jY,{}),h.jsx(AY,{}),h.jsx(OY,{onInteractionComplete:()=>{},hasCarouselInteracted:!0}),h.jsx(NY,{isActive:r,onComplete:()=>s(!1)})]}),h.jsxs(g.Suspense,{fallback:null,children:[h.jsx(Pn,{topColor:Be.mint,bottomColor:Be.rose,variant:11}),h.jsx(IY,{flickerWritingImageSrc:e("story_maker","flicker_writing_image")}),h.jsx(DY,{isActive:i,onComplete:()=>o(!1)})]}),h.jsxs(g.Suspense,{fallback:h.jsx(TS,{}),children:[h.jsx(Pn,{topColor:Be.rose,bottomColor:Be.violet,variant:3,flip:!0}),h.jsx(LY,{}),h.jsx(Pn,{topColor:Be.violet,bottomColor:Be.sage,variant:12}),h.jsxs("div",{className:"relative",children:[h.jsx(dY,{sectionRef:u}),h.jsx(Pn,{topColor:Be.sage,bottomColor:Be.peach,variant:5,flip:!0}),h.jsx("div",{ref:c,children:h.jsx(pY,{})}),h.jsx("div",{className:"sticky bottom-0 h-0 z-30 pointer-events-none",children:h.jsx("div",{className:"absolute bottom-0 right-[5vw] w-[24vw] sm:w-[40vw] max-w-[250px] sm:max-w-[420px] h-[312px] sm:h-[65vh] ipad-portrait:!w-[30vw] ipad-portrait:!max-w-[280px] ipad-portrait:!h-[45vh] overflow-hidden",children:h.jsx(Pe.img,{src:MY,alt:"Flicker on Beanstalk",className:"absolute inset-0 w-full h-full object-contain object-bottom will-change-transform",width:420,height:650,loading:"lazy",decoding:"async",style:{y:f,opacity:p}})})})]})]}),h.jsx(wY,{isVisible:!1,beanstalkImageSrc:e("progress","beanstalk_image"),onBeanstalkUpload:_=>n("progress","beanstalk_image",_,"image")})]})]})},$Y="https://cdn.storysparkle.org";async function FY(){try{return[{name:"OpenDyslexic-Regular.woff2",format:"woff2"},{name:"OpenDyslexic-Regular.woff",format:"woff"},{name:"OpenDyslexic-Bold.woff2",format:"woff2"},{name:"OpenDyslexic-Bold.woff",format:"woff"}].map(e=>({name:e.name,url:`${$Y}/fonts/${e.name}`,format:e.format}))}catch(t){return console.error("Failed to load fonts:",t),[]}}function VY(){const[t,e]=g.useState(!1);return g.useEffect(()=>{(async()=>{await new Promise(r=>{"requestIdleCallback"in window?window.requestIdleCallback(()=>r(),{timeout:5e3}):setTimeout(r,3e3)});try{const r=await FY();if(r.length===0){console.log("No fonts found in storage, using fallback"),e(!0);return}const s=r.map(i=>{const o=i.name.includes("Bold");return new FontFace("OpenDyslexic",`url(${i.url}) format('${i.format}')`,{weight:o?"700":"400",style:"normal",display:"swap"}).load().then(l=>(document.fonts.add(l),l))});await Promise.all(s),e(!0),console.log("All fonts loaded from Supabase")}catch(r){console.error("Error loading fonts (using fallback):",r),e(!0)}})()},[]),null}const UY=()=>{const{pathname:t}=Un();return g.useEffect(()=>{window.scrollTo(0,0)},[t]),null},zY="5.0.1",BY=10,HY=0,WY=20,KY=800,GY=600,qY=0,YY=[],QY=[{ind:3,nm:"Layer 3",ks:{p:{a:1,k:[{t:0,s:[456.419,423.252,0],to:[-161.825,-53.536,0],ti:[-62.867,94.219,0],i:{x:[.15],y:[.86]},o:{x:[.785],y:[.135]},e:[371.703,167.513,0]},{t:10,s:[371.703,167.513,0],to:[0,0,0],ti:[0,0,0],i:{x:[.15],y:[.86]},o:{x:[.785],y:[.135]},e:[456.419,423.252,0]},{t:20,s:[456.419,423.252,0]}]},a:{a:0,k:[-24.5,-24.5,0]},s:{a:0,k:[100,100,100]},r:{a:0,k:-43.065},o:{a:0,k:100}},ao:0,ip:0,op:20,st:0,bm:3,sr:1,ty:4,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[210.919,210.919]},p:{a:0,k:[0,0]}},{ty:"fl",c:{a:0,k:[.9961,.9608,.7412,1]},hd:!1,o:{a:0,k:100},r:1},{ty:"tr",p:{a:0,k:[0,0]},a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},r:{a:0,k:0},o:{a:0,k:100},sk:{a:0,k:0},sa:{a:0,k:0}}],nm:"Object",hd:!1}]},{ind:2,nm:"Layer 2",ks:{p:{a:1,k:[{t:0,s:[361.777,165.918,0],to:[0,0,0],ti:[0,0,0],i:{x:[.15],y:[.86]},o:{x:[.785],y:[.135]},e:[214.784,406.838,0]},{t:10,s:[214.784,406.838,0],to:[-83.035,-34.503,0],ti:[0,0,0],i:{x:[.15],y:[.86]},o:{x:[.785],y:[.135]},e:[361.777,165.918,0]},{t:20,s:[361.777,165.918,0]}]},a:{a:0,k:[-66.5,-66.5,0]},s:{a:0,k:[100,100,100]},r:{a:0,k:-43.065},o:{a:0,k:100}},ao:0,ip:0,op:20,st:0,bm:3,sr:1,ty:4,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[236,236]},p:{a:0,k:[0,0]}},{ty:"fl",c:{a:0,k:[.38,.1647,0,1]},hd:!1,o:{a:0,k:100},r:1},{ty:"tr",p:{a:0,k:[0,0]},a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},r:{a:0,k:0},o:{a:0,k:100},sk:{a:0,k:0},sa:{a:0,k:0}}],nm:"Object",hd:!1}]},{ind:1,nm:"Layer 1",ks:{p:{a:1,k:[{t:0,s:[263.776,342.564,0],to:[0,0,0],ti:[0,0,0],i:{x:[.15],y:[.86]},o:{x:[.785],y:[.135]},e:[545.716,355.446,0]},{t:10,s:[545.716,355.446,0],to:[-7.345,74.699,0],ti:[0,0,0],i:{x:[.15],y:[.86]},o:{x:[.785],y:[.135]},e:[263.776,342.564,0]},{t:20,s:[263.776,342.564,0]}]},a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},r:{a:0,k:-43.065},o:{a:0,k:100}},ao:0,ip:0,op:20,st:0,bm:3,sr:1,ty:4,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[150.135,150.135]},p:{a:0,k:[0,0]}},{ty:"fl",c:{a:0,k:[1,.5569,.2275,1]},hd:!1,o:{a:0,k:100},r:1},{ty:"tr",p:{a:0,k:[0,0]},a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},r:{a:0,k:0},o:{a:0,k:100},sk:{a:0,k:0},sa:{a:0,k:0}}],nm:"Object",hd:!1}]}],XY=[],JY={v:zY,fr:BY,ip:HY,op:WY,w:KY,h:GY,ddd:qY,assets:YY,layers:QY,markers:XY},ZY=g.lazy(()=>C(()=>import("./index.es-imAayibc.js"),[])),eQ=({delay:t=150,label:e="Loading…",minHeight:n="60vh"})=>{const[r,s]=g.useState(!1),[i,o]=g.useState(!1);return g.useEffect(()=>{const a=window.matchMedia("(prefers-reduced-motion: reduce)");o(a.matches);const l=setTimeout(()=>s(!0),t);return()=>clearTimeout(l)},[t]),h.jsxs("div",{role:"status","aria-busy":"true","aria-live":"polite","aria-label":e,className:"w-full flex items-center justify-center bg-gradient-to-b from-teal-100 via-yellow-200 to-red-300",style:{minHeight:n},children:[r&&h.jsx(g.Suspense,{fallback:h.jsx("span",{className:"sr-only",children:e}),children:h.jsx("div",{className:"w-32 h-32 md:w-40 md:h-40",children:h.jsx(ZY,{animationData:JY,loop:!0,autoplay:!i,"aria-hidden":"true"})})}),h.jsx("span",{className:"sr-only",children:e})]})},tQ=["en","es","bn","zh","ja"],nQ=t=>{const e=t.match(/^\/([a-z]{2})(\/|$)/);return e&&tQ.includes(e[1])?e[1]:null},rQ=t=>t?`/${t}/subscription`:"/subscription",sQ=t=>{const e=t.match(/^(?:\/[a-z]{2})?\/story\/([^/?#]+)/);return e?e[1]:null},iQ=()=>{const t=ya();g.useEffect(()=>{const{data:{subscription:e}}=xe.auth.onAuthStateChange((n,r)=>{if(n!=="SIGNED_IN")return;const s=sessionStorage.getItem("pendingAuthRedirect");if(!s){sessionStorage.getItem("storyMakerDraft")&&setTimeout(()=>t("/story-maker"),0);return}sessionStorage.removeItem("pendingAuthRedirect");const i=sQ(s);if(!i||!r?.user){setTimeout(()=>t(s),0);return}(async()=>{try{const o=nQ(s),[a,l,c]=await Promise.all([xe.from("stories").select("access_level").eq("id",i).maybeSingle(),xe.from("profiles").select("user_type").eq("id",r.user.id).maybeSingle(),xe.from("user_payments").select("subscription_status, subscription_end_date").eq("user_id",r.user.id).maybeSingle()]),u=a.data?.access_level??"paid",d=l.data?.user_type??"free",f=c.data?.subscription_status,p=c.data?.subscription_end_date?new Date(c.data.subscription_end_date):null,m=f==="active"&&(!p||p>new Date);let v=!1;d==="admin"||u==="guest"||u==="free"?v=!0:u==="paid"&&(v=d==="paid"||m),v?setTimeout(()=>t(s),0):(sessionStorage.setItem("postSubscriptionRedirect",s),setTimeout(()=>t(rQ(o)),0))}catch(o){console.error("[useAuthRedirect] story access check failed:",o),setTimeout(()=>t(s),0)}})()});return()=>e.unsubscribe()},[t])},il=()=>{const{t}=Lt("improve-reading");return h.jsx(ka,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/improve-reading"})},ol=()=>{const{t}=Lt("contact");return h.jsx(ka,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/contact"})},al=()=>{const{t}=Lt("subscription");return h.jsx(ka,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/subscription"})},ll=()=>{const{t}=Lt("auth");return h.jsx(ka,{title:t("meta.login.title"),description:t("meta.login.description"),keywords:t("meta.login.keywords",{defaultValue:""})||void 0,canonical:"/login",noIndex:!0})},cl=()=>{const{t}=Lt("auth");return h.jsx(ka,{title:t("meta.signup.title"),description:t("meta.signup.description"),keywords:t("meta.signup.keywords",{defaultValue:""})||void 0,canonical:"/signup"})},ul=g.lazy(()=>C(()=>import("./StoriesPage-Bj7UfHzG.js"),__vite__mapDeps([9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),Yn=g.lazy(()=>C(()=>import("./StoryReaderPage-v5JEF2kn.js"),__vite__mapDeps([33,34,35,24,21,36,3,37,25,14,15,38,39,19,40,11,41,42,43,1,29]))),dl=g.lazy(()=>C(()=>import("./AboutPage-DBRYzIHE.js"),__vite__mapDeps([44,29,8,45,20]))),hl=g.lazy(()=>C(()=>import("./ContactPage-DKxi4cCW.js"),__vite__mapDeps([46,22,47,48,28,25,49,29,50,51]))),fl=g.lazy(()=>C(()=>import("./ImproveReadingPage-Cha-oyUT.js"),__vite__mapDeps([52,11,29,39,53,54]))),pl=g.lazy(()=>C(()=>import("./AuthPages-DcGGCdDY.js"),__vite__mapDeps([55,22,56,24,49,50,57,53])).then(t=>({default:t.LoginPage}))),gl=g.lazy(()=>C(()=>import("./AuthPages-DcGGCdDY.js"),__vite__mapDeps([55,22,56,24,49,50,57,53])).then(t=>({default:t.SignupPage}))),ml=g.lazy(()=>C(()=>import("./ResetPasswordPage-DD2-M0Xz.js"),__vite__mapDeps([58,22,50,34,51,57,53]))),vl=g.lazy(()=>C(()=>import("./VerifyEmailPage-DbW5Yh28.js"),__vite__mapDeps([59,11,50,18,51,34]))),oQ=g.lazy(()=>C(()=>import("./NotFound-DFRSstKf.js"),__vite__mapDeps([60,29,61,31,34]))),yl=g.lazy(()=>C(()=>import("./ProgressPage-ChAdgX35.js"),__vite__mapDeps([62,11,63,40,30,29,64,65,66,67,68,41,61,18,69,31]))),_l=g.lazy(()=>C(()=>import("./ReadingCartPage-Doo4w9Lz.js"),__vite__mapDeps([70,10,11,12,13,14,15,16,17,18,19,20,29,61]))),wl=g.lazy(()=>C(()=>import("./VocabularyNotebookPage-Bod9M7tw.js"),__vite__mapDeps([71,11,22,72,36,27,28,29,15,31,38,73,26,25]))),aQ=g.lazy(()=>C(()=>import("./AdminPage-BXtHmEvJ.js"),__vite__mapDeps([74,21,22,23,24,25,26,11,75,47,27,28,76,72,35,36,12,13,31,53,73,77,64,42,63,78,79,80,81,66,37,56,43,82,83,18,84,6,69,51,48,14,85,86,17,87,88,32,41,67,65,50,54]))),lQ=g.lazy(()=>C(()=>import("./FontManagementPage-CP2v0N5b.js"),__vite__mapDeps([89,11,22,86,42,73]))),xl=g.lazy(()=>C(()=>import("./TermsPage-CWKqs95A.js"),__vite__mapDeps([90,75,29]))),bl=g.lazy(()=>C(()=>import("./PrivacyPage-BFmIsMZM.js"),__vite__mapDeps([91,75,29]))),El=g.lazy(()=>C(()=>import("./RefundPage-BRbnS1wH.js"),__vite__mapDeps([92,75,29]))),Sl=g.lazy(()=>C(()=>import("./SubscriptionPage-CkkmerKN.js"),__vite__mapDeps([93,41,94,64,77,16,29,45,11,81,69]))),dn=g.lazy(()=>C(()=>import("./PaymentStatusPage-49pXmL1R.js"),__vite__mapDeps([95,11,51,83,61]))),Qn=g.lazy(()=>C(()=>import("./ThemeInfoPage-xl-aEnQY.js"),__vite__mapDeps([96,11,75,29,39,20]))),Tl=g.lazy(()=>C(()=>import("./BlogPage-CEoRTs0f.js"),__vite__mapDeps([97,22,98,11,18,84,29,31]))),Xn=g.lazy(()=>C(()=>import("./BlogPostPage-BpFNmItN.js"),__vite__mapDeps([99,11,30,87,32,39,84,29,34,69,18]))),Pl=g.lazy(()=>C(()=>import("./NewsletterPage-D5Q_kGfq.js"),__vite__mapDeps([100,22,98,11,18,84,29,31]))),Cl=g.lazy(()=>C(()=>import("./StoryMakerPage-DAwEjpU3.js"),__vite__mapDeps([101,94,29,54,13,66,85,11,22,23,24,25,26,43,6,81,102,82,79]))),kl=g.lazy(()=>C(()=>import("./ResearchPage-DaOxRCaa.js"),__vite__mapDeps([103,29,11,76,39,82,43,88,61]))),Rl=g.lazy(()=>C(()=>import("./TextCheckerPage-BobW1CHu.js"),__vite__mapDeps([104,94,47,11,23,24,25,26,37,31,88,67,68,17,30,80,29,39,79]))),cQ=g.lazy(()=>C(()=>import("./SitemapRoute-C78WYq-Q.js"),__vite__mapDeps([105,63,78]))),uQ=new N3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5*60*1e3}}}),dQ=()=>(iQ(),null),hQ=()=>{const{targetElement:t,onTargetReached:e}=Pj();return h.jsx(G7,{targetElement:t,onTargetReached:e})},fQ=()=>h.jsx(eQ,{}),pQ=({children:t})=>{const e=Un();return h.jsx(aC,{children:t},e.pathname)};function gQ(){return h.jsx(Mk,{children:h.jsx(D3,{client:uQ,children:h.jsx(h3,{children:h.jsx(LD,{children:h.jsx(X7,{children:h.jsx(YB,{children:h.jsx(N6,{children:h.jsxs(D6,{children:[h.jsx(VY,{}),h.jsx(UY,{}),h.jsx(dQ,{}),h.jsx(hQ,{}),h.jsxs("div",{className:"min-h-screen flex flex-col",children:[h.jsx(Bq,{}),h.jsx("main",{className:"flex-1",children:h.jsx(pQ,{children:h.jsx(g.Suspense,{fallback:h.jsx(fQ,{}),children:h.jsxs(PD,{children:[h.jsx(j,{path:"/",element:h.jsx(sl,{})}),h.jsx(j,{path:"/stories",element:h.jsx(ul,{})}),h.jsx(j,{path:"/story-maker",element:h.jsx(Cl,{})}),h.jsx(j,{path:"/stories/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/story/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/improve-reading",element:h.jsxs(h.Fragment,{children:[h.jsx(il,{}),h.jsx(fl,{})]})}),h.jsx(j,{path:"/themes",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/themes/:themeSlug",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/about",element:h.jsx(dl,{})}),h.jsx(j,{path:"/contact",element:h.jsxs(h.Fragment,{children:[h.jsx(ol,{}),h.jsx(hl,{})]})}),h.jsx(j,{path:"/blog",element:h.jsx(Tl,{})}),h.jsx(j,{path:"/blog/newsletter",element:h.jsx(Pl,{})}),h.jsx(j,{path:"/blog/newsletter/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/blog/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/research",element:h.jsx(kl,{})}),h.jsx(j,{path:"/login",element:h.jsxs(h.Fragment,{children:[h.jsx(ll,{}),h.jsx(pl,{})]})}),h.jsx(j,{path:"/signup",element:h.jsxs(h.Fragment,{children:[h.jsx(cl,{}),h.jsx(gl,{})]})}),h.jsx(j,{path:"/reset-password",element:h.jsx(ml,{})}),h.jsx(j,{path:"/verify-email",element:h.jsx(vl,{})}),h.jsx(j,{path:"/progress",element:h.jsx(yl,{})}),h.jsx(j,{path:"/reading-cart",element:h.jsx(_l,{})}),h.jsx(j,{path:"/vocabulary",element:h.jsx(wl,{})}),h.jsx(j,{path:"/admin",element:h.jsx(aQ,{})}),h.jsx(j,{path:"/admin/fonts",element:h.jsx(lQ,{})}),h.jsx(j,{path:"/terms",element:h.jsx(xl,{})}),h.jsx(j,{path:"/privacy",element:h.jsx(bl,{})}),h.jsx(j,{path:"/refund",element:h.jsx(El,{})}),h.jsx(j,{path:"/subscription",element:h.jsxs(h.Fragment,{children:[h.jsx(al,{}),h.jsx(Sl,{})]})}),h.jsx(j,{path:"/payment/success",element:h.jsx(dn,{})}),h.jsx(j,{path:"/payment/cancel",element:h.jsx(dn,{})}),h.jsx(j,{path:"/stripe/success",element:h.jsx(dn,{})}),h.jsx(j,{path:"/stripe/failure",element:h.jsx(dn,{})}),h.jsx(j,{path:"/es",element:h.jsx(sl,{})}),h.jsx(j,{path:"/es/stories",element:h.jsx(ul,{})}),h.jsx(j,{path:"/es/story-maker",element:h.jsx(Cl,{})}),h.jsx(j,{path:"/es/stories/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/es/story/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/es/improve-reading",element:h.jsxs(h.Fragment,{children:[h.jsx(il,{}),h.jsx(fl,{})]})}),h.jsx(j,{path:"/es/themes",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/es/themes/:themeSlug",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/es/about",element:h.jsx(dl,{})}),h.jsx(j,{path:"/es/contact",element:h.jsxs(h.Fragment,{children:[h.jsx(ol,{}),h.jsx(hl,{})]})}),h.jsx(j,{path:"/es/blog",element:h.jsx(Tl,{})}),h.jsx(j,{path:"/es/blog/newsletter",element:h.jsx(Pl,{})}),h.jsx(j,{path:"/es/blog/newsletter/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/es/blog/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/es/research",element:h.jsx(kl,{})}),h.jsx(j,{path:"/es/login",element:h.jsxs(h.Fragment,{children:[h.jsx(ll,{}),h.jsx(pl,{})]})}),h.jsx(j,{path:"/es/signup",element:h.jsxs(h.Fragment,{children:[h.jsx(cl,{}),h.jsx(gl,{})]})}),h.jsx(j,{path:"/es/reset-password",element:h.jsx(ml,{})}),h.jsx(j,{path:"/es/verify-email",element:h.jsx(vl,{})}),h.jsx(j,{path:"/es/progress",element:h.jsx(yl,{})}),h.jsx(j,{path:"/es/reading-cart",element:h.jsx(_l,{})}),h.jsx(j,{path:"/es/vocabulary",element:h.jsx(wl,{})}),h.jsx(j,{path:"/es/terms",element:h.jsx(xl,{})}),h.jsx(j,{path:"/es/privacy",element:h.jsx(bl,{})}),h.jsx(j,{path:"/es/refund",element:h.jsx(El,{})}),h.jsx(j,{path:"/es/subscription",element:h.jsxs(h.Fragment,{children:[h.jsx(al,{}),h.jsx(Sl,{})]})}),h.jsx(j,{path:"/es/stripe/success",element:h.jsx(dn,{})}),h.jsx(j,{path:"/es/stripe/failure",element:h.jsx(dn,{})}),h.jsx(j,{path:"/bn",element:h.jsx(sl,{})}),h.jsx(j,{path:"/bn/stories",element:h.jsx(ul,{})}),h.jsx(j,{path:"/bn/story-maker",element:h.jsx(Cl,{})}),h.jsx(j,{path:"/bn/stories/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/bn/story/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/bn/improve-reading",element:h.jsxs(h.Fragment,{children:[h.jsx(il,{}),h.jsx(fl,{})]})}),h.jsx(j,{path:"/bn/themes",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/bn/themes/:themeSlug",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/bn/about",element:h.jsx(dl,{})}),h.jsx(j,{path:"/bn/contact",element:h.jsxs(h.Fragment,{children:[h.jsx(ol,{}),h.jsx(hl,{})]})}),h.jsx(j,{path:"/bn/blog",element:h.jsx(Tl,{})}),h.jsx(j,{path:"/bn/blog/newsletter",element:h.jsx(Pl,{})}),h.jsx(j,{path:"/bn/blog/newsletter/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/bn/blog/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/bn/research",element:h.jsx(kl,{})}),h.jsx(j,{path:"/bn/login",element:h.jsxs(h.Fragment,{children:[h.jsx(ll,{}),h.jsx(pl,{})]})}),h.jsx(j,{path:"/bn/signup",element:h.jsxs(h.Fragment,{children:[h.jsx(cl,{}),h.jsx(gl,{})]})}),h.jsx(j,{path:"/bn/reset-password",element:h.jsx(ml,{})}),h.jsx(j,{path:"/bn/verify-email",element:h.jsx(vl,{})}),h.jsx(j,{path:"/bn/progress",element:h.jsx(yl,{})}),h.jsx(j,{path:"/bn/reading-cart",element:h.jsx(_l,{})}),h.jsx(j,{path:"/bn/vocabulary",element:h.jsx(wl,{})}),h.jsx(j,{path:"/bn/terms",element:h.jsx(xl,{})}),h.jsx(j,{path:"/bn/privacy",element:h.jsx(bl,{})}),h.jsx(j,{path:"/bn/refund",element:h.jsx(El,{})}),h.jsx(j,{path:"/bn/subscription",element:h.jsxs(h.Fragment,{children:[h.jsx(al,{}),h.jsx(Sl,{})]})}),h.jsx(j,{path:"/bn/stripe/success",element:h.jsx(dn,{})}),h.jsx(j,{path:"/bn/stripe/failure",element:h.jsx(dn,{})}),h.jsx(j,{path:"/zh",element:h.jsx(sl,{})}),h.jsx(j,{path:"/zh/stories",element:h.jsx(ul,{})}),h.jsx(j,{path:"/zh/story-maker",element:h.jsx(Cl,{})}),h.jsx(j,{path:"/zh/stories/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/zh/story/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/zh/improve-reading",element:h.jsxs(h.Fragment,{children:[h.jsx(il,{}),h.jsx(fl,{})]})}),h.jsx(j,{path:"/zh/themes",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/zh/themes/:themeSlug",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/zh/about",element:h.jsx(dl,{})}),h.jsx(j,{path:"/zh/contact",element:h.jsxs(h.Fragment,{children:[h.jsx(ol,{}),h.jsx(hl,{})]})}),h.jsx(j,{path:"/zh/blog",element:h.jsx(Tl,{})}),h.jsx(j,{path:"/zh/blog/newsletter",element:h.jsx(Pl,{})}),h.jsx(j,{path:"/zh/blog/newsletter/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/zh/blog/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/zh/research",element:h.jsx(kl,{})}),h.jsx(j,{path:"/zh/login",element:h.jsxs(h.Fragment,{children:[h.jsx(ll,{}),h.jsx(pl,{})]})}),h.jsx(j,{path:"/zh/signup",element:h.jsxs(h.Fragment,{children:[h.jsx(cl,{}),h.jsx(gl,{})]})}),h.jsx(j,{path:"/zh/reset-password",element:h.jsx(ml,{})}),h.jsx(j,{path:"/zh/verify-email",element:h.jsx(vl,{})}),h.jsx(j,{path:"/zh/progress",element:h.jsx(yl,{})}),h.jsx(j,{path:"/zh/reading-cart",element:h.jsx(_l,{})}),h.jsx(j,{path:"/zh/vocabulary",element:h.jsx(wl,{})}),h.jsx(j,{path:"/zh/terms",element:h.jsx(xl,{})}),h.jsx(j,{path:"/zh/privacy",element:h.jsx(bl,{})}),h.jsx(j,{path:"/zh/refund",element:h.jsx(El,{})}),h.jsx(j,{path:"/zh/subscription",element:h.jsxs(h.Fragment,{children:[h.jsx(al,{}),h.jsx(Sl,{})]})}),h.jsx(j,{path:"/zh/stripe/success",element:h.jsx(dn,{})}),h.jsx(j,{path:"/zh/stripe/failure",element:h.jsx(dn,{})}),h.jsx(j,{path:"/ja",element:h.jsx(sl,{})}),h.jsx(j,{path:"/ja/stories",element:h.jsx(ul,{})}),h.jsx(j,{path:"/ja/story-maker",element:h.jsx(Cl,{})}),h.jsx(j,{path:"/ja/stories/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/ja/story/:id",element:h.jsx(Yn,{})}),h.jsx(j,{path:"/ja/improve-reading",element:h.jsxs(h.Fragment,{children:[h.jsx(il,{}),h.jsx(fl,{})]})}),h.jsx(j,{path:"/ja/themes",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/ja/themes/:themeSlug",element:h.jsx(Qn,{})}),h.jsx(j,{path:"/ja/about",element:h.jsx(dl,{})}),h.jsx(j,{path:"/ja/contact",element:h.jsxs(h.Fragment,{children:[h.jsx(ol,{}),h.jsx(hl,{})]})}),h.jsx(j,{path:"/ja/blog",element:h.jsx(Tl,{})}),h.jsx(j,{path:"/ja/blog/newsletter",element:h.jsx(Pl,{})}),h.jsx(j,{path:"/ja/blog/newsletter/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/ja/blog/:slug",element:h.jsx(Xn,{})}),h.jsx(j,{path:"/ja/research",element:h.jsx(kl,{})}),h.jsx(j,{path:"/ja/login",element:h.jsxs(h.Fragment,{children:[h.jsx(ll,{}),h.jsx(pl,{})]})}),h.jsx(j,{path:"/ja/signup",element:h.jsxs(h.Fragment,{children:[h.jsx(cl,{}),h.jsx(gl,{})]})}),h.jsx(j,{path:"/ja/reset-password",element:h.jsx(ml,{})}),h.jsx(j,{path:"/ja/verify-email",element:h.jsx(vl,{})}),h.jsx(j,{path:"/ja/progress",element:h.jsx(yl,{})}),h.jsx(j,{path:"/ja/reading-cart",element:h.jsx(_l,{})}),h.jsx(j,{path:"/ja/vocabulary",element:h.jsx(wl,{})}),h.jsx(j,{path:"/ja/terms",element:h.jsx(xl,{})}),h.jsx(j,{path:"/ja/privacy",element:h.jsx(bl,{})}),h.jsx(j,{path:"/ja/refund",element:h.jsx(El,{})}),h.jsx(j,{path:"/ja/subscription",element:h.jsxs(h.Fragment,{children:[h.jsx(al,{}),h.jsx(Sl,{})]})}),h.jsx(j,{path:"/ja/stripe/success",element:h.jsx(dn,{})}),h.jsx(j,{path:"/ja/stripe/failure",element:h.jsx(dn,{})}),h.jsx(j,{path:"/text-checker",element:h.jsx(Rl,{})}),h.jsx(j,{path:"/es/text-checker",element:h.jsx(Rl,{})}),h.jsx(j,{path:"/bn/text-checker",element:h.jsx(Rl,{})}),h.jsx(j,{path:"/zh/text-checker",element:h.jsx(Rl,{})}),h.jsx(j,{path:"/ja/text-checker",element:h.jsx(Rl,{})}),h.jsx(j,{path:"/sitemap.xml",element:h.jsx(cQ,{})}),h.jsx(j,{path:"*",element:h.jsx(oQ,{})})]})})})}),h.jsx(Wq,{})]}),h.jsx(aF,{}),h.jsx(DF,{})]})})})})})})})})}const CS="ss_build_id",mQ=60*1e3,vQ=2e3,yQ="ss-build";let ha=null,Vg=null,mc=null;const ou=()=>{try{const t=window.location.pathname;return t.includes("/story/")||t.includes("/story-maker")}catch{return!1}},JI=()=>{try{return"1777995256517-2c3rrd"}catch{return"dev"}};async function _Q(){try{const t=JI();if(localStorage.getItem(CS)===t)return;if("caches"in window){const n=await caches.keys();await Promise.all(n.map(r=>caches.delete(r)))}if("serviceWorker"in navigator){const n=await navigator.serviceWorker.getRegistrations();await Promise.all(n.map(r=>r.update().catch(()=>{})))}localStorage.setItem(CS,t)}catch{}}function ZI(t,e=!1){if(!(t===JI()||t===ha)){if(ha=t,console.info("[build-version] new build detected:",t),!e&&mc)try{mc.postMessage({type:"stale",buildId:t})}catch{}typeof document<"u"&&document.visibilityState==="hidden"&&!ou()&&window.location.reload()}}async function Kl(){try{const t=await fetch(`/version.json?t=${Date.now()}`,{cache:"no-store",headers:{"cache-control":"no-cache"}});if(!t.ok)return;const n=(await t.json())?.buildId;if(!n)return;ZI(n)}catch{}}function wQ(){if(typeof window>"u")return;const t=window;if(t.__ssNavReloadInstalled)return;t.__ssNavReloadInstalled=!0;const e=a=>{if(!ha||ou())return!1;const l=a?String(a):window.location.pathname+window.location.search;return window.location.href=l,!0},n=history.pushState.bind(history),r=history.replaceState.bind(history);history.pushState=function(a,l,c){if(!e(c))return n(a,l,c??null)},history.replaceState=function(a,l,c){if(!e(c))return r(a,l,c??null)},window.addEventListener("popstate",()=>{ha&&!ou()&&window.location.reload()});const s=()=>{Kl()},i=history.pushState,o=history.replaceState;history.pushState=function(...a){const l=i.apply(this,a);return s(),l},history.replaceState=function(...a){const l=o.apply(this,a);return s(),l}}function xQ(){if(!(typeof window>"u")){wQ();try{mc=new BroadcastChannel(yQ),mc.onmessage=t=>{const e=t?.data?.buildId;typeof e=="string"&&ZI(e,!0)}}catch{mc=null}setTimeout(()=>void Kl(),vQ),Vg&&clearInterval(Vg),Vg=setInterval(()=>void Kl(),mQ),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(ha&&!ou()){window.location.reload();return}Kl()}}),window.addEventListener("focus",()=>{if(ha&&!ou()){window.location.reload();return}Kl()})}}const G_=document.getElementById("root");if(!G_)throw new Error("Root element not found");G_.innerHTML="";_Q().finally(()=>{xQ()});const bQ=XP(G_),EQ=Ej(window.location.pathname),SQ=()=>bQ.render(h.jsx($.StrictMode,{children:h.jsx(aC,{children:h.jsx(gQ,{})})})),TQ=new Promise(t=>setTimeout(t,1500));Promise.race([gt.loadNamespaces(EQ),TQ]).finally(SQ);const kS=()=>{[oO,aO].forEach(t=>{const e=new Image;e.decoding="async",e.src=t})};typeof window.requestIdleCallback=="function"?window.requestIdleCallback(kS,{timeout:3e3}):setTimeout(kS,1500);export{QB as $,U6 as A,Ts as B,hY as C,_I as D,eY as E,wS as F,SY as G,d0 as H,_a as I,lr as J,yu as K,fe as L,Xe as M,lO as N,Z as O,ve as P,_i as Q,$ as R,ka as S,rX as T,Le as U,Uq as V,cu as W,NC as X,Nv as Y,s6 as Z,wi as _,lC as a,kq as a$,JB as a0,o6 as a1,l6 as a2,Un as a3,Px as a4,b$ as a5,ZM as a6,m0 as a7,h3 as a8,IQ as a9,GM as aA,S$ as aB,V5 as aC,If as aD,dk as aE,yO as aF,A_ as aG,cO as aH,j_ as aI,mu as aJ,hk as aK,fk as aL,vu as aM,uk as aN,gt as aO,GS as aP,hO as aQ,wK as aR,xK as aS,BM as aT,Ua as aU,MI as aV,$I as aW,Aq as aX,FI as aY,VI as aZ,jq as a_,LQ as aa,f3 as ab,kQ as ac,LC as ad,sX as ae,oX as af,Mf as ag,NQ as ah,$c as ai,O3 as aj,Rt as ak,Rf as al,bn as am,yY as an,mY as ao,iX as ap,t$ as aq,Ci as ar,WM as as,zD as at,jx as au,Z7 as av,lX as aw,zn as ax,Tt as ay,_r as az,RQ as b,Rq as b0,eX as b1,tX as b2,cC as b3,fX as b4,hX as b5,CU as b6,Gq as b7,qq as b8,GQ as b9,X0 as bA,at as bB,RA as bC,Y6 as bD,tW as bE,ca as bF,n_ as bG,gr as bH,o7 as bI,Ge as bJ,c9 as bK,c7 as bL,l7 as bM,s7 as bN,l9 as bO,AA as bP,Zh as bQ,W6 as bR,sO as bS,qQ as ba,YQ as bb,$Y as bc,Oi as bd,dV as be,gu as bf,Pf as bg,S3 as bh,v3 as bi,Bx as bj,Rn as bk,$f as bl,g3 as bm,m3 as bn,Tk as bo,k3 as bp,_3 as bq,K7 as br,rO as bs,rf as bt,FY as bu,Pn as bv,_Y as bw,ZH as bx,o_ as by,Fe as bz,Lt as c,Ta as d,J7 as e,aX as f,hy as g,ke as h,ya as i,h as j,wI as k,V_ as l,Pe as m,hs as n,kx as o,Cx as p,Zq as q,g as r,xe as s,K_ as t,G0 as u,CQ as v,DQ as w,cX as x,uX as y,dX as z};
//# sourceMappingURL=index-CxGMQRP8.js.map