PageSourceSearch

https://askezy.unstucklabs.app/assets/index-DTd_ow8s.js

js unstucklabs.app collected 2026-10-07 03:07:44 UTC 1,245,899 bytes, 706 lines download raw bytes

vendor: 5,780 bytes, lines 1-9
1function MO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))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 bf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ai(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var VC={exports:{}},Ch={},UC={exports:{}},Ke={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var yu=Symbol.for("react.element"),IO=Symbol.for("react.portal"),OO=Symbol.for("react.fragment"),DO=Symbol.for("react.strict_mode"),LO=Symbol.for("react.profiler"),$O=Symbol.for("react.provider"),FO=Symbol.for("react.context"),zO=Symbol.for("react.forward_ref"),BO=Symbol.for("react.suspense"),VO=Symbol.for("react.memo"),UO=Symbol.for("react.lazy"),ib=Symbol.iterator;function HO(e){return e===null||typeof e!="object"?null:(e=ib&&e[ib]||e["@@iterator"],typeof e=="function"?e:null)}var HC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},WC=Object.assign,qC={};function sl(e,t,n){this.props=e,this.context=t,this.refs=qC,this.updater=n||HC}sl.prototype.isReactComponent={};sl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};sl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function GC(){}GC.prototype=sl.prototype;function Bv(e,t,n){this.props=e,this.context=t,this.refs=qC,this.updater=n||HC}var Vv=Bv.prototype=new GC;Vv.constructor=Bv;WC(Vv,sl.prototype);Vv.isPureReactComponent=!0;var ob=Array.isArray,KC=Object.prototype.hasOwnProperty,Uv={current:null},YC={key:!0,ref:!0,__self:!0,__source:!0};function JC(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)KC.call(t,r)&&!YC.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:yu,type:e,key:i,ref:o,props:s,_owner:Uv.current}}function WO(e,t){return{$$typeof:yu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Hv(e){return typeof e=="object"&&e!==null&&e.$$typeof===yu}function qO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ab=/\/+/g;function $p(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qO(""+e.key):t.toString(36)}function Vd(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case yu:case IO:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+$p(o,0):r,ob(s)?(n="",e!=null&&(n=e.replace(ab,"$&/")+"/"),Vd(s,t,n,"",function(u){return u})):s!=null&&(Hv(s)&&(s=WO(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(ab,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",ob(e))for(var a=0;a<e.length;a++){i=e[a];var c=r+$p(i,a);o+=Vd(i,t,n,c,s)}else if(c=HO(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=r+$p(i,a++),o+=Vd(i,t,n,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Gu(e,t,n){if(e==null)return e;var r=[],s=0;return Vd(e,r,"","",function(i){return t.call(n,i,s++)}),r}function GO(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xn={current:null},Ud={transition:null},KO={ReactCurrentDispatcher:xn,ReactCurrentBatchConfig:Ud,ReactCurrentOwner:Uv};function XC(){throw Error("act(...) is not supported in production builds of React.")}Ke.Children={map:Gu,forEach:function(e,t,n){Gu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Gu(e,function(){t++}),t},toArray:function(e){return Gu(e,function(t){return t})||[]},only:function(e){if(!Hv(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ke.Component=sl;Ke.Fragment=OO;Ke.Profiler=LO;Ke.PureComponent=Bv;Ke.StrictMode=DO;Ke.Suspense=BO;
vendor: 8,012 bytes, lines 9-33
9Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KO;Ke.act=XC;Ke.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=WC({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Uv.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)KC.call(t,c)&&!YC.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:yu,type:e.type,key:s,ref:i,props:r,_owner:o}};Ke.createContext=function(e){return e={$$typeof:FO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:$O,_context:e},e.Consumer=e};Ke.createElement=JC;Ke.createFactory=function(e){var t=JC.bind(null,e);return t.type=e,t};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(e){return{$$typeof:zO,render:e}};Ke.isValidElement=Hv;Ke.lazy=function(e){return{$$typeof:UO,_payload:{_status:-1,_result:e},_init:GO}};Ke.memo=function(e,t){return{$$typeof:VO,type:e,compare:t===void 0?null:t}};Ke.startTransition=function(e){var t=Ud.transition;Ud.transition={};try{e()}finally{Ud.transition=t}};Ke.unstable_act=XC;Ke.useCallback=function(e,t){return xn.current.useCallback(e,t)};Ke.useContext=function(e){return xn.current.useContext(e)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(e){return xn.current.useDeferredValue(e)};Ke.useEffect=function(e,t){return xn.current.useEffect(e,t)};Ke.useId=function(){return xn.current.useId()};Ke.useImperativeHandle=function(e,t,n){return xn.current.useImperativeHandle(e,t,n)};Ke.useInsertionEffect=function(e,t){return xn.current.useInsertionEffect(e,t)};Ke.useLayoutEffect=function(e,t){return xn.current.useLayoutEffect(e,t)};Ke.useMemo=function(e,t){return xn.current.useMemo(e,t)};Ke.useReducer=function(e,t,n){return xn.current.useReducer(e,t,n)};Ke.useRef=function(e){return xn.current.useRef(e)};Ke.useState=function(e){return xn.current.useState(e)};Ke.useSyncExternalStore=function(e,t,n){return xn.current.useSyncExternalStore(e,t,n)};Ke.useTransition=function(){return xn.current.useTransition()};Ke.version="18.3.1";UC.exports=Ke;var m=UC.exports;const $=Ai(m),jh=MO({__proto__:null,default:$},[m]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var YO=m,JO=Symbol.for("react.element"),XO=Symbol.for("react.fragment"),QO=Object.prototype.hasOwnProperty,ZO=YO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,eD={key:!0,ref:!0,__self:!0,__source:!0};function QC(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)QO.call(t,r)&&!eD.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:JO,type:e,key:i,ref:o,props:s,_owner:ZO.current}}Ch.Fragment=XO;Ch.jsx=QC;Ch.jsxs=QC;VC.exports=Ch;var l=VC.exports,_g={},ZC={exports:{}},nr={},ej={exports:{}},tj={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(A,D){var E=A.length;A.push(D);e:for(;0<E;){var K=E-1>>>1,te=A[K];if(0<s(te,D))A[K]=D,A[E]=te,E=K;else break e}}function n(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var D=A[0],E=A.pop();if(E!==D){A[0]=E;e:for(var K=0,te=A.length,N=te>>>1;K<N;){var ee=2*(K+1)-1,ie=A[ee],U=ee+1,W=A[U];if(0>s(ie,E))U<te&&0>s(W,ie)?(A[K]=W,A[U]=E,K=U):(A[K]=ie,A[ee]=E,K=ee);else if(U<te&&0>s(W,E))A[K]=W,A[U]=E,K=U;else break e}}return D}function s(A,D){var E=A.sortIndex-D.sortIndex;return E!==0?E:A.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(A){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=A)r(u),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(u)}}function S(A){if(v=!1,x(A),!g)if(n(c)!==null)g=!0,V(C);else{var D=n(u);D!==null&&I(S,D.startTime-A)}}function C(A,D){g=!1,v&&(v=!1,y(j),j=-1),p=!0;var E=h;try{for(x(D),f=n(c);f!==null&&(!(f.expirationTime>D)||A&&!M());){var K=f.callback;if(typeof K=="function"){f.callback=null,h=f.priorityLevel;var te=K(f.expirationTime<=D);D=e.unstable_now(),typeof te=="function"?f.callback=te:f===n(c)&&r(c),x(D)}else r(c);f=n(c)}if(f!==null)var N=!0;else{var ee=n(u);ee!==null&&I(S,ee.startTime-D),N=!1}return N}finally{f=null,h=E,p=!1}}var k=!1,_=null,j=-1,R=5,P=-1;function M(){return!(e.unstable_now()-P<R)}function T(){if(_!==null){var A=e.unstable_now();P=A;var D=!0;try{D=_(!0,A)}finally{D?L():(k=!1,_=null)}}else k=!1}var L;if(typeof w=="function")L=function(){w(T)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,z=F.port2;F.port1.onmessage=T,L=function(){z.postMessage(null)}}else L=function(){b(T,0)};function V(A){_=A,k||(k=!0,L())}function I(A,D){j=b(function(){A(e.unstable_now())},D)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(A){A.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,V(C))},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(A){switch(h){case 1:case 2:case 3:var D=3;break;default:D=h}var E=h;h=D;try{return A()}finally{h=E}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(A,D){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var E=h;h=A;try{return D()}finally{h=E}},e.unstable_scheduleCallback=function(A,D,E){var K=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?K+E:K):E=K,A){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=E+te,A={id:d++,callback:D,priorityLevel:A,startTime:E,expirationTime:te,sortIndex:-1},E>K?(A.sortIndex=E,t(u,A),n(c)===null&&A===n(u)&&(v?(y(j),j=-1):v=!0,I(S,E-K))):(A.sortIndex=te,t(c,A),g||p||(g=!0,V(C))),A},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(A){var D=h;return function(){var E=h;h=D;try{return A.apply(this,arguments)}finally{h=E}}}})(tj);ej.exports=tj;var tD=ej.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var nD=m,Zn=tD;function ue(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
vendor: 5,017 bytes, line 33
33var nj=new Set,Nc={};function To(e,t){za(e,t),za(e+"Capture",t)}function za(e,t){for(Nc[e]=t,e=0;e<t.length;e++)nj.add(t[e])}var Ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cg=Object.prototype.hasOwnProperty,rD=/^[: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]*$/,lb={},cb={};function sD(e){return Cg.call(cb,e)?!0:Cg.call(lb,e)?!1:rD.test(e)?cb[e]=!0:(lb[e]=!0,!1)}function iD(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function oD(e,t,n,r){if(t===null||typeof t>"u"||iD(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function wn(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var sn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){sn[e]=new wn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];sn[t]=new wn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){sn[e]=new wn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){sn[e]=new wn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){sn[e]=new wn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){sn[e]=new wn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){sn[e]=new wn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){sn[e]=new wn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){sn[e]=new wn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Wv=/[\-:]([a-z])/g;function qv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Wv,qv);sn[t]=new wn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Wv,qv);sn[t]=new wn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Wv,qv);sn[t]=new wn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){sn[e]=new wn(e,1,!1,e.toLowerCase(),null,!1,!1)});sn.xlinkHref=new wn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){sn[e]=new wn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gv(e,t,n,r){var s=sn.hasOwnProperty(t)?sn[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(oD(t,n,s,r)&&(n=null),r||s===null?sD(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}
vendor: 5,027 bytes, lines 33-37
33var $s=nD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ku=Symbol.for("react.element"),ra=Symbol.for("react.portal"),sa=Symbol.for("react.fragment"),Kv=Symbol.for("react.strict_mode"),jg=Symbol.for("react.profiler"),rj=Symbol.for("react.provider"),sj=Symbol.for("react.context"),Yv=Symbol.for("react.forward_ref"),Eg=Symbol.for("react.suspense"),Ng=Symbol.for("react.suspense_list"),Jv=Symbol.for("react.memo"),Xs=Symbol.for("react.lazy"),ij=Symbol.for("react.offscreen"),ub=Symbol.iterator;function bl(e){return e===null||typeof e!="object"?null:(e=ub&&e[ub]||e["@@iterator"],typeof e=="function"?e:null)}var kt=Object.assign,Fp;function Gl(e){if(Fp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Fp=t&&t[1]||""}return`
34`+Fp+e}var zp=!1;function Bp(e,t){if(!e||zp)return"";zp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
35`),i=r.stack.split(`
36`),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 c=`
37`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{zp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gl(e):""}function aD(e){switch(e.tag){case 5:return Gl(e.type);case 16:return Gl("Lazy");case 13:return Gl("Suspense");case 19:return Gl("SuspenseList");case 0:case 2:case 15:return e=Bp(e.type,!1),e;case 11:return e=Bp(e.type.render,!1),e;case 1:return e=Bp(e.type,!0),e;default:return""}}function Tg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case sa:return"Fragment";case ra:return"Portal";case jg:return"Profiler";case Kv:return"StrictMode";case Eg:return"Suspense";case Ng:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sj:return(e.displayName||"Context")+".Consumer";case rj:return(e._context.displayName||"Context")+".Provider";case Yv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jv:return t=e.displayName||null,t!==null?t:Tg(e.type)||"Memo";case Xs:t=e._payload,e=e._init;try{return Tg(e(t))}catch{}}return null}function lD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Tg(t);case 8:return t===Kv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Si(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function oj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cD(e){var t=oj(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yu(e){e._valueTracker||(e._valueTracker=cD(e))}function aj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=oj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Sf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Pg(e,t){var n=t.checked;return kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function db(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Si(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}
vendor: 4,658 bytes, line 37
37function lj(e,t){t=t.checked,t!=null&&Gv(e,"checked",t,!1)}function Ag(e,t){lj(e,t);var n=Si(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Rg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Rg(e,t.type,Si(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fb(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Rg(e,t,n){(t!=="number"||Sf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Kl=Array.isArray;function Sa(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Si(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Mg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ue(91));return kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function hb(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ue(92));if(Kl(n)){if(1<n.length)throw Error(ue(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Si(n)}}function cj(e,t){var n=Si(t.value),r=Si(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function pb(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function uj(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ig(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?uj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ju,dj=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ju=Ju||document.createElement("div"),Ju.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ju.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var lc={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},uD=["Webkit","ms","Moz","O"];Object.keys(lc).forEach(function(e){uD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),lc[t]=lc[e]})});function fj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||lc.hasOwnProperty(e)&&lc[e]?(""+t).trim():t+"px"}function hj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=fj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var dD=kt({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 Og(e,t){if(t){if(dD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ue(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ue(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ue(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ue(62))}}function Dg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="str
37ing";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Lg=null;function Xv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $g=null,ka=null,_a=null;function mb(e){if(e=wu(e)){if(typeof $g!="function")throw Error(ue(280));var t=e.stateNode;t&&(t=Ah(t),$g(e.stateNode,e.type,t))}}function pj(e){ka?_a?_a.push(e):_a=[e]:ka=e}function mj(){if(ka){var e=ka,t=_a;if(_a=ka=null,mb(e),t)for(e=0;e<t.length;e++)mb(t[e])}}function gj(e,t){return e(t)}function yj(){}var Vp=!1;function vj(e,t,n){if(Vp)return e(t,n);Vp=!0;try{return gj(e,t,n)}finally{Vp=!1,(ka!==null||_a!==null)&&(yj(),mj())}}function Pc(e,t){var n=e.stateNode;if(n===null)return null;var r=Ah(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ue(231,t,typeof n));return n}var Fg=!1;if(Ps)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){Fg=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{Fg=!1}function fD(e,t,n,r,s,i,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var cc=!1,kf=null,_f=!1,zg=null,hD={onError:function(e){cc=!0,kf=e}};function pD(e,t,n,r,s,i,o,a,c){cc=!1,kf=null,fD.apply(hD,arguments)}function mD(e,t,n,r,s,i,o,a,c){if(pD.apply(this,arguments),cc){if(cc){var u=kf;cc=!1,kf=null}else throw Error(ue(198));_f||(_f=!0,zg=u)}}function Po(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function xj(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function gb(e){if(Po(e)!==e)throw Error(ue(188))}function gD(e){var t=e.alternate;if(!t){if(t=Po(e),t===null)throw Error(ue(188));return t!==e?null:e}for(var n=e,r=t;;){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 gb(s),e;if(i===r)return gb(s),t;i=i.sibling}throw Error(ue(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(ue(189))}}if(n.alternate!==r)throw Error(ue(190))}if(n.tag!==3)throw Error(ue(188));return n.stateNode.current===n?e:t}function wj(e){return e=gD(e),e!==null?bj(e):null}function bj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=bj(e);if(t!==null)return t;e=e.sibling}return null}var Sj=Zn.unstable_scheduleCallback,yb=Zn.unstable_cancelCallback,yD=Zn.unstable_shouldYield,vD=Zn.unstable_requestPaint,Rt=Zn.unstable_now,xD=Zn.unstable_getCurrentPriorityLevel,Qv=Zn.unstable_ImmediatePriority,kj=Zn.unstable_UserBlockingPriority,Cf=Zn.unstable_NormalPriority,wD=Zn.unstable_LowPriority,_j=Zn.unstable_IdlePriority,Eh=null,Xr=null;function bD(e){if(Xr&&typeof Xr.onCommitFiberRoot=="function")try{Xr.onCommitFiberRoot(Eh,e,void 0,(e.current.flags&128)===128)}catch{}}var Nr=Math.clz32?Math.clz32:_D,SD=Math.log,kD=Math.LN2;function _D(e){return e>>>=0,e===0?32:31-(SD(e)/kD|0)|0}var Xu=64,Qu=4194304;function Yl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Yl(a):(i&=o,i!==0&&(r=Yl(i)))}else o=n&~s,o!==0?r=Yl(o):i!==0&&(r=Yl(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Nr(t),s=1<<n,r|=e[n],t&=~s;return r}function CD(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jD(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Nr(i),a=1<<o,c=s[o];c===-1?(!(a&n)||a&r)&&(s[o]=CD(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function Bg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Cj(){var e=Xu;return Xu<<=1,!(Xu&4194240)&&(Xu=64),e}function Up(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nr(t),e[t]=n}function ED(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Nr(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Zv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nr(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var tt=0;function jj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}
vendor: 1,042 bytes, line 37
37var Ej,ex,Nj,Tj,Pj,Vg=!1,Zu=[],ui=null,di=null,fi=null,Ac=new Map,Rc=new Map,Zs=[],ND="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 vb(e,t){switch(e){case"focusin":case"focusout":ui=null;break;case"dragenter":case"dragleave":di=null;break;case"mouseover":case"mouseout":fi=null;break;case"pointerover":case"pointerout":Ac.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rc.delete(t.pointerId)}}function kl(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=wu(t),t!==null&&ex(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function TD(e,t,n,r,s){switch(t){case"focusin":return ui=kl(ui,e,t,n,r,s),!0;case"dragenter":return di=kl(di,e,t,n,r,s),!0;
vendor: 9,863 bytes, line 37
37case"mouseover":return fi=kl(fi,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Ac.set(i,kl(Ac.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Rc.set(i,kl(Rc.get(i)||null,e,t,n,r,s)),!0}return!1}function Aj(e){var t=eo(e.target);if(t!==null){var n=Po(t);if(n!==null){if(t=n.tag,t===13){if(t=xj(n),t!==null){e.blockedOn=t,Pj(e.priority,function(){Nj(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ug(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Lg=r,n.target.dispatchEvent(r),Lg=null}else return t=wu(n),t!==null&&ex(t),e.blockedOn=n,!1;t.shift()}return!0}function xb(e,t,n){Hd(e)&&n.delete(t)}function PD(){Vg=!1,ui!==null&&Hd(ui)&&(ui=null),di!==null&&Hd(di)&&(di=null),fi!==null&&Hd(fi)&&(fi=null),Ac.forEach(xb),Rc.forEach(xb)}function _l(e,t){e.blockedOn===t&&(e.blockedOn=null,Vg||(Vg=!0,Zn.unstable_scheduleCallback(Zn.unstable_NormalPriority,PD)))}function Mc(e){function t(s){return _l(s,e)}if(0<Zu.length){_l(Zu[0],e);for(var n=1;n<Zu.length;n++){var r=Zu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ui!==null&&_l(ui,e),di!==null&&_l(di,e),fi!==null&&_l(fi,e),Ac.forEach(t),Rc.forEach(t),n=0;n<Zs.length;n++)r=Zs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Zs.length&&(n=Zs[0],n.blockedOn===null);)Aj(n),n.blockedOn===null&&Zs.shift()}var Ca=$s.ReactCurrentBatchConfig,Ef=!0;function AD(e,t,n,r){var s=tt,i=Ca.transition;Ca.transition=null;try{tt=1,tx(e,t,n,r)}finally{tt=s,Ca.transition=i}}function RD(e,t,n,r){var s=tt,i=Ca.transition;Ca.transition=null;try{tt=4,tx(e,t,n,r)}finally{tt=s,Ca.transition=i}}function tx(e,t,n,r){if(Ef){var s=Ug(e,t,n,r);if(s===null)Zp(e,t,r,Nf,n),vb(e,r);else if(TD(s,e,t,n,r))r.stopPropagation();else if(vb(e,r),t&4&&-1<ND.indexOf(e)){for(;s!==null;){var i=wu(s);if(i!==null&&Ej(i),i=Ug(e,t,n,r),i===null&&Zp(e,t,r,Nf,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Zp(e,t,r,null,n)}}var Nf=null;function Ug(e,t,n,r){if(Nf=null,e=Xv(r),e=eo(e),e!==null)if(t=Po(e),t===null)e=null;else if(n=t.tag,n===13){if(e=xj(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Nf=e,null}function Rj(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(xD()){case Qv:return 1;case kj:return 4;case Cf:case wD:return 16;case _j:return 536870912;default:return 16}default:return 16}}var oi=null,nx=null,Wd=null;function Mj(){if(Wd)return Wd;var e,t=nx,n=t.length,r,s="value"in oi?oi.value:oi.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return Wd=s.slice(e,1<r?1-r:void 0)}function qd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ed(){return!0}function wb(){return!1}function rr(e){function t(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 e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ed:wb,this.isPropagationStopped=wb,this}return kt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ed)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ed)},persist:function(){},isPersistent:ed}),t}var il={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rx=rr(il),xu=kt({},il,{view:0,detail:0}),MD=rr(xu),Hp,Wp,Cl,Nh=kt({},xu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sx,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Cl&&(Cl&&e.type==="mousemove"?(Hp=e.screenX-Cl.screenX,Wp=e.screenY-Cl.screenY):Wp=Hp=0,Cl=e),Hp)},movementY:function(e){return"movementY"in e?e.movementY:Wp}}),bb=rr(Nh),ID=kt({},Nh,{dataTransfer:0}),OD=rr(ID),DD=kt({},xu,{relatedTarget:0}),qp=rr(DD),LD=kt({},il,{animationName:0,elapsedTime:0,pseudoElement:0}),$D=rr(LD),FD=kt({},il,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zD=rr(FD),BD=kt({},il,{data:0}),Sb=rr(BD),VD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UD={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"},HD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function WD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=HD[e])?!!t[e]:!1}function sx(){return WD}var qD=kt({},xu,{key:function(e){if(e.key){var t=VD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?UD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sx,charCode:function(e){return e.type==="keypress"?qd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),GD=rr(qD),KD=kt({},Nh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kb=rr(KD),YD=kt({},xu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sx}),JD=rr(YD),XD=kt({},il,{propertyName:0,elapsedTime:0,pseudoElement:0}),QD=rr(XD),ZD=kt({},Nh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),eL=rr(ZD),tL=[9,13,27,32],ix=Ps&&"CompositionEvent"in window,uc=null;Ps&&"documentMode"in document&&(uc=document.documentMode);var nL=Ps&&"TextEvent"in window&&!uc,Ij=Ps&&(!ix||uc&&8<uc&&11>=uc),_b=" ",Cb=!1;function Oj(e,t){switch(e){case"keyup":return tL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ia=!1;function rL(e,t){switch(e){case"compositionend":return Dj(t);case"keypress":return t.which!==32?null:(Cb=!0,_b);case"textInput":return e=t.data,e===_b&&Cb?null:e;default:return null}}function sL(e,t){if(ia)return e==="compositionend"||!ix&&Oj(e,t)?(e=Mj(),Wd=nx=oi=null,ia=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ij&&t.locale!=="ko"?null:t.data;default:return null}}var iL={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 jb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!iL[e.type]:t==="textarea"}function Lj(e,t,n,r){pj(r),t=Tf(t,"onChange"),0<t.length&&(n=new rx("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var dc=null,Ic=null;function oL(e){Kj(e,0)}function Th(e){var t=la(e);if(aj(t))return e}function aL(e,t){if(e==="change")return t}var $j=!1;if(Ps){var Gp;if(Ps){var Kp="oninput"in document;if(!Kp){var Eb=document.createElement("div");Eb.setAttribute("oninput","return;"),Kp=typeof Eb.oninput=="function"}Gp=Kp}else Gp=!1;$j=Gp&&(!document.documentMode||9<document.documentMode)}function Nb(){dc&&(dc.detachEvent("onpropertychange",Fj),Ic=dc=null)}function Fj(e){if(e.propertyName==="value"&&Th(Ic)){var t=[];Lj(t,Ic,e,Xv(e)),vj(oL,t)}}
vendor: 5,253 bytes, line 37
37function lL(e,t,n){e==="focusin"?(Nb(),dc=t,Ic=n,dc.attachEvent("onpropertychange",Fj)):e==="focusout"&&Nb()}function cL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Th(Ic)}function uL(e,t){if(e==="click")return Th(t)}function dL(e,t){if(e==="input"||e==="change")return Th(t)}function fL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rr=typeof Object.is=="function"?Object.is:fL;function Oc(e,t){if(Rr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Cg.call(t,s)||!Rr(e[s],t[s]))return!1}return!0}function Tb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pb(e,t){var n=Tb(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Tb(n)}}function zj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bj(){for(var e=window,t=Sf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Sf(e.document)}return t}function ox(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function hL(e){var t=Bj(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zj(n.ownerDocument.documentElement,n)){if(r!==null&&ox(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Pb(n,i);var o=Pb(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var pL=Ps&&"documentMode"in document&&11>=document.documentMode,oa=null,Hg=null,fc=null,Wg=!1;function Ab(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wg||oa==null||oa!==Sf(r)||(r=oa,"selectionStart"in r&&ox(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}),fc&&Oc(fc,r)||(fc=r,r=Tf(Hg,"onSelect"),0<r.length&&(t=new rx("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=oa)))}function td(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var aa={animationend:td("Animation","AnimationEnd"),animationiteration:td("Animation","AnimationIteration"),animationstart:td("Animation","AnimationStart"),transitionend:td("Transition","TransitionEnd")},Yp={},Vj={};Ps&&(Vj=document.createElement("div").style,"AnimationEvent"in window||(delete aa.animationend.animation,delete aa.animationiteration.animation,delete aa.animationstart.animation),"TransitionEvent"in window||delete aa.transitionend.transition);function Ph(e){if(Yp[e])return Yp[e];if(!aa[e])return e;var t=aa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vj)return Yp[e]=t[n];return e}var Uj=Ph("animationend"),Hj=Ph("animationiteration"),Wj=Ph("animationstart"),qj=Ph("transitionend"),Gj=new Map,Rb="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 Ri(e,t){Gj.set(e,t),To(t,[e])}for(var Jp=0;Jp<Rb.length;Jp++){var Xp=Rb[Jp],mL=Xp.toLowerCase(),gL=Xp[0].toUpperCase()+Xp.slice(1);Ri(mL,"on"+gL)}Ri(Uj,"onAnimationEnd");Ri(Hj,"onAnimationIteration");Ri(Wj,"onAnimationStart");Ri("dblclick","onDoubleClick");Ri("focusin","onFocus");Ri("focusout","onBlur");Ri(qj,"onTransitionEnd");za("onMouseEnter",["mouseout","mouseover"]);za("onMouseLeave",["mouseout","mouseover"]);za("onPointerEnter",["pointerout","pointerover"]);za("onPointerLeave",["pointerout","pointerover"]);To("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,770 bytes, line 37
37To("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));To("onBeforeInput",["compositionend","keypress","textInput","paste"]);To("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));To("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));To("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="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(" "),yL=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jl));function Mb(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,mD(r,t,void 0,e),e.currentTarget=null}function Kj(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;Mb(s,a,u),i=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;Mb(s,a,u),i=c}}}if(_f)throw e=zg,_f=!1,zg=null,e}function ut(e,t){var n=t[Jg];n===void 0&&(n=t[Jg]=new Set);var r=e+"__bubble";n.has(r)||(Yj(t,e,2,!1),n.add(r))}function Qp(e,t,n){var r=0;t&&(r|=4),Yj(n,e,r,t)}var nd="_reactListening"+Math.random().toString(36).slice(2);function Dc(e){if(!e[nd]){e[nd]=!0,nj.forEach(function(n){n!=="selectionchange"&&(yL.has(n)||Qp(n,!1,e),Qp(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[nd]||(t[nd]=!0,Qp("selectionchange",!1,t))}}function Yj(e,t,n,r){switch(Rj(t)){case 1:var s=AD;break;case 4:s=RD;break;default:s=tx}n=s.bind(null,t,n,e),s=void 0,!Fg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Zp(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&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 c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;a!==null;){if(o=eo(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}vj(function(){var u=i,d=Xv(n),f=[];e:{var h=Gj.get(e);if(h!==void 0){var p=rx,g=e;switch(e){case"keypress":if(qd(n)===0)break e;case"keydown":case"keyup":p=GD;break;case"focusin":g="focus",p=qp;break;case"focusout":g="blur",p=qp;break;case"beforeblur":case"afterblur":p=qp;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=bb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=OD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=JD;break;case Uj:case Hj:case Wj:p=$D;break;case qj:p=QD;break;case"scroll":p=MD;break;case"wheel":p=eL;break;case"copy":case"cut":case"paste":p=zD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=kb}var v=(t&4)!==0,b=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var w=u,x;w!==null;){x=w;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,y!==null&&(S=Pc(w,y),S!=null&&v.push(Lc(w,S,x)))),b)break;w=w.return}0<v.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Lg&&(g=n.relatedTarget||n.fromElement)&&(eo(g)||g[As]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?eo(g):null,g!==null&&(b=Po(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(v=bb,S="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=kb,S="onPointerLeave",y="onPointerEnter",w="pointer"),b=p==null?h:la(p),x=g==null?h:la(g),h=new v(S,w+"leave",p,n,d),h.target=b,h.relatedTarget=x,S=null,eo(d)===u&&(v=new v(y,w+"enter",g,n,d),v.target=x,v.relatedTarget=b,S=v),b=S,p&&g)t:{for(v=p,y=g,w=0,x=v;x;x=Do(x))w++;for(x=0,S=y;S;S=Do(S))x++;for(;0<w-x;)v=Do(v),w--;for(;0<x-w;)y=Do(y),x--;for(;w--;){if(v===y||y!==null&&v===y.alternate)break t;v=Do(v),y=Do(y)}v=null}else v=null;p!==null&&Ib(f,h,p,v,!1),g!==null&&b!==null&&Ib(f,b,g,v,!0)}}
vendor: 5,488 bytes, lines 37-38
37e:{if(h=u?la(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var C=aL;else if(jb(h))if($j)C=dL;else{C=cL;var k=lL}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=uL);if(C&&(C=C(e,u))){Lj(f,C,n,d);break e}k&&k(e,h,u),e==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&Rg(h,"number",h.value)}switch(k=u?la(u):window,e){case"focusin":(jb(k)||k.contentEditable==="true")&&(oa=k,Hg=u,fc=null);break;case"focusout":fc=Hg=oa=null;break;case"mousedown":Wg=!0;break;case"contextmenu":case"mouseup":case"dragend":Wg=!1,Ab(f,n,d);break;case"selectionchange":if(pL)break;case"keydown":case"keyup":Ab(f,n,d)}var _;if(ix)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else ia?Oj(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(Ij&&n.locale!=="ko"&&(ia||j!=="onCompositionStart"?j==="onCompositionEnd"&&ia&&(_=Mj()):(oi=d,nx="value"in oi?oi.value:oi.textContent,ia=!0)),k=Tf(u,j),0<k.length&&(j=new Sb(j,e,null,n,d),f.push({event:j,listeners:k}),_?j.data=_:(_=Dj(n),_!==null&&(j.data=_)))),(_=nL?rL(e,n):sL(e,n))&&(u=Tf(u,"onBeforeInput"),0<u.length&&(d=new Sb("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=_))}Kj(f,t)})}function Lc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Tf(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Pc(e,n),i!=null&&r.unshift(Lc(e,i,s)),i=Pc(e,t),i!=null&&r.push(Lc(e,i,s))),e=e.return}return r}function Do(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ib(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&u!==null&&(a=u,s?(c=Pc(n,i),c!=null&&o.unshift(Lc(n,c,a))):s||(c=Pc(n,i),c!=null&&o.push(Lc(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var vL=/\r\n?/g,xL=/\u0000|\uFFFD/g;function Ob(e){return(typeof e=="string"?e:""+e).replace(vL,`
38`).replace(xL,"")}function rd(e,t,n){if(t=Ob(t),Ob(e)!==t&&n)throw Error(ue(425))}function Pf(){}var qg=null,Gg=null;function Kg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yg=typeof setTimeout=="function"?setTimeout:void 0,wL=typeof clearTimeout=="function"?clearTimeout:void 0,Db=typeof Promise=="function"?Promise:void 0,bL=typeof queueMicrotask=="function"?queueMicrotask:typeof Db<"u"?function(e){return Db.resolve(null).then(e).catch(SL)}:Yg;function SL(e){setTimeout(function(){throw e})}function em(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Mc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Mc(t)}function hi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Lb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ol=Math.random().toString(36).slice(2),qr="__reactFiber$"+ol,$c="__reactProps$"+ol,As="__reactContainer$"+ol,Jg="__reactEvents$"+ol,kL="__reactListeners$"+ol,_L="__reactHandles$"+ol;function eo(e){var t=e[qr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[As]||n[qr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Lb(e);e!==null;){if(n=e[qr])return n;e=Lb(e)}return t}e=n,n=e.parentNode}return null}function wu(e){return e=e[qr]||e[As],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function la(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ue(33))}function Ah(e){return e[$c]||null}var Xg=[],ca=-1;function Mi(e){return{current:e}}function ft(e){0>ca||(e.current=Xg[ca],Xg[ca]=null,ca--)}function ot(e,t){ca++,Xg[ca]=e.current,e.current=t}var ki={},dn=Mi(ki),An=Mi(!1),po=ki;function Ba(e,t){var n=e.type.contextTypes;if(!n)return ki;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Rn(e){return e=e.childContextTypes,e!=null}function Af(){ft(An),ft(dn)}function $b(e,t,n){if(dn.current!==ki)throw Error(ue(168));ot(dn,t),ot(An,n)}function Jj(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(ue(108,lD(e)||"Unknown",s));return kt({},n,r)}function Rf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ki,po=dn.current,ot(dn,e),ot(An,An.current),!0}function Fb(e,t,n){var r=e.stateNode;if(!r)throw Error(ue(169));n?(e=Jj(e,t,po),r.__reactInternalMemoizedMergedChildContext=e,ft(An),ft(dn),ot(dn,e)):ft(An),ot(An,n)}var hs=null,Rh=!1,tm=!1;function Xj(e){hs===null?hs=[e]:hs.push(e)}function CL(e){Rh=!0,Xj(e)}function Ii(){if(!tm&&hs!==null){tm=!0;var e=0,t=tt;try{var n=hs;for(tt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}hs=null,Rh=!1}
vendor: 16,112 bytes, line 38
38catch(s){throw hs!==null&&(hs=hs.slice(e+1)),Sj(Qv,Ii),s}finally{tt=t,tm=!1}}return null}var ua=[],da=0,Mf=null,If=0,ur=[],dr=0,mo=null,Ss=1,ks="";function qi(e,t){ua[da++]=If,ua[da++]=Mf,Mf=e,If=t}function Qj(e,t,n){ur[dr++]=Ss,ur[dr++]=ks,ur[dr++]=mo,mo=e;var r=Ss;e=ks;var s=32-Nr(r)-1;r&=~(1<<s),n+=1;var i=32-Nr(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Ss=1<<32-Nr(t)+s|n<<s|r,ks=i+e}else Ss=1<<i|n<<s|r,ks=e}function ax(e){e.return!==null&&(qi(e,1),Qj(e,1,0))}function lx(e){for(;e===Mf;)Mf=ua[--da],ua[da]=null,If=ua[--da],ua[da]=null;for(;e===mo;)mo=ur[--dr],ur[dr]=null,ks=ur[--dr],ur[dr]=null,Ss=ur[--dr],ur[dr]=null}var Jn=null,Kn=null,gt=!1,Cr=null;function Zj(e,t){var n=hr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function zb(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Jn=e,Kn=hi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Jn=e,Kn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=mo!==null?{id:Ss,overflow:ks}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=hr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Jn=e,Kn=null,!0):!1;default:return!1}}function Qg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zg(e){if(gt){var t=Kn;if(t){var n=t;if(!zb(e,t)){if(Qg(e))throw Error(ue(418));t=hi(n.nextSibling);var r=Jn;t&&zb(e,t)?Zj(r,n):(e.flags=e.flags&-4097|2,gt=!1,Jn=e)}}else{if(Qg(e))throw Error(ue(418));e.flags=e.flags&-4097|2,gt=!1,Jn=e}}}function Bb(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Jn=e}function sd(e){if(e!==Jn)return!1;if(!gt)return Bb(e),gt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kg(e.type,e.memoizedProps)),t&&(t=Kn)){if(Qg(e))throw eE(),Error(ue(418));for(;t;)Zj(e,t),t=hi(t.nextSibling)}if(Bb(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ue(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Kn=hi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Kn=null}}else Kn=Jn?hi(e.stateNode.nextSibling):null;return!0}function eE(){for(var e=Kn;e;)e=hi(e.nextSibling)}function Va(){Kn=Jn=null,gt=!1}function cx(e){Cr===null?Cr=[e]:Cr.push(e)}var jL=$s.ReactCurrentBatchConfig;function jl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ue(309));var r=n.stateNode}if(!r)throw Error(ue(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(ue(284));if(!n._owner)throw Error(ue(290,e))}return e}function id(e,t){throw e=Object.prototype.toString.call(t),Error(ue(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vb(e){var t=e._init;return t(e._payload)}function tE(e){function t(y,w){if(e){var x=y.deletions;x===null?(y.deletions=[w],y.flags|=16):x.push(w)}}function n(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function r(y,w){for(y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function s(y,w){return y=yi(y,w),y.index=0,y.sibling=null,y}function i(y,w,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<w?(y.flags|=2,w):x):(y.flags|=2,w)):(y.flags|=1048576,w)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,w,x,S){return w===null||w.tag!==6?(w=lm(x,y.mode,S),w.return=y,w):(w=s(w,x),w.return=y,w)}function c(y,w,x,S){var C=x.type;return C===sa?d(y,w,x.props.children,S,x.key):w!==null&&(w.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Xs&&Vb(C)===w.type)?(S=s(w,x.props),S.ref=jl(y,w,x),S.return=y,S):(S=Zd(x.type,x.key,x.props,null,y.mode,S),S.ref=jl(y,w,x),S.return=y,S)}function u(y,w,x,S){return w===null||w.tag!==4||w.stateNode.containerInfo!==x.containerInfo||w.stateNode.implementation!==x.implementation?(w=cm(x,y.mode,S),w.return=y,w):(w=s(w,x.children||[]),w.return=y,w)}function d(y,w,x,S,C){return w===null||w.tag!==7?(w=lo(x,y.mode,S,C),w.return=y,w):(w=s(w,x),w.return=y,w)}function f(y,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return w=lm(""+w,y.mode,x),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ku:return x=Zd(w.type,w.key,w.props,null,y.mode,x),x.ref=jl(y,null,w),x.return=y,x;case ra:return w=cm(w,y.mode,x),w.return=y,w;case Xs:var S=w._init;return f(y,S(w._payload),x)}if(Kl(w)||bl(w))return w=lo(w,y.mode,x,null),w.return=y,w;id(y,w)}return null}function h(y,w,x,S){var C=w!==null?w.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return C!==null?null:a(y,w,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ku:return x.key===C?c(y,w,x,S):null;case ra:return x.key===C?u(y,w,x,S):null;case Xs:return C=x._init,h(y,w,C(x._payload),S)}if(Kl(x)||bl(x))return C!==null?null:d(y,w,x,S,null);id(y,x)}return null}function p(y,w,x,S,C){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(x)||null,a(w,y,""+S,C);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ku:return y=y.get(S.key===null?x:S.key)||null,c(w,y,S,C);case ra:return y=y.get(S.key===null?x:S.key)||null,u(w,y,S,C);case Xs:var k=S._init;return p(y,w,x,k(S._payload),C)}if(Kl(S)||bl(S))return y=y.get(x)||null,d(w,y,S,C,null);id(w,S)}return null}function g(y,w,x,S){for(var C=null,k=null,_=w,j=w=0,R=null;_!==null&&j<x.length;j++){_.index>j?(R=_,_=null):R=_.sibling;var P=h(y,_,x[j],S);if(P===null){_===null&&(_=R);break}e&&_&&P.alternate===null&&t(y,_),w=i(P,w,j),k===null?C=P:k.sibling=P,k=P,_=R}if(j===x.length)return n(y,_),gt&&qi(y,j),C;if(_===null){for(;j<x.length;j++)_=f(y,x[j],S),_!==null&&(w=i(_,w,j),k===null?C=_:k.sibling=_,k=_);return gt&&qi(y,j),C}for(_=r(y,_);j<x.length;j++)R=p(_,y,j,x[j],S),R!==null&&(e&&R.alternate!==null&&_.delete(R.key===null?j:R.key),w=i(R,w,j),k===null?C=R:k.sibling=R,k=R);return e&&_.forEach(function(M){return t(y,M)}),gt&&qi(y,j),C}function v(y,w,x,S){var C=bl(x);if(typeof C!="function")throw Error(ue(150));if(x=C.call(x),x==null)throw Error(ue(151));for(var k=C=null,_=w,j=w=0,R=null,P=x.next();_!==null&&!P.done;j++,P=x.next()){_.index>j?(R=_,_=null):R=_.sibling;var M=h(y,_,P.value,S);if(M===null){_===null&&(_=R);break}e&&_&&M.alternate===null&&t(y,_),w=i(M,w,j),k===null?C=M:k.sibling=M,k=M,_=R}if(P.done)return n(y,_),gt&&qi(y,j),C;if(_===null){for(;!P.done;j++,P=x.next())P=f(y,P.value,S),P!==null&&(w=i(P,w,j),k===null?C=P:k.sibling=P,k=P);return gt&&qi(y,j),C}for(_=r(y,_);!P.done;j++,P=x.next())P=p(_,y,j,P.value,S),P!==null&&(e&&P.alternate!==null&&_.delete(P.key===null?j:P.key),w=i(P,w,j),k===null?C=P:k.sibling=P,k=P);return e&&_.forEach(function(T){return t(y,T)}),gt&&qi(y,j),C}function b(y,w,x,S){if(typeof x=="object"&&x!==null&&x.type===sa&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ku:e:{for(var C=x.key,k=w;k!==null;){if(k.key===C){if(C=x.type,C===sa){if(k.tag===7){n(y,k.sibling),w=s(k,x.props.children),w.return=y,y=w;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Xs&&Vb(C)===k.type){n(y,k.sibling),w=s(k,x.props),w.ref=jl(y,k,x),w.return=y,y=w;break e}n(y,k);break}else t(y,k);k=k.sibling}x.type===sa?(w=lo(x.props.children,y.mode,S,x.key),w.return=y,y=w):(S=Zd(x.type,x.key,x.props,null,y.mode,S),S.ref=jl(y,w,x),S.return=y,y=S)}return o(y);case ra:e:{for(k=x.key;w!==null;){if(w.key===k)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),w=s(w,x.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else t(y,w);w=w.sibling}w=cm(x,y.mode,S),w.return=y,y=w}return o(y);case Xs:return k=x._init,b(y,w,k(x._payload),S)}if(Kl(x))return g(y,w,x,S);if(bl(x))return v(y,w,x,S);id(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),w=s(w,x),w.return=y,y=w):(n(y,w),w=lm(x,y.mode,S),w.return=y,y=w),o(y)):n(y,w)}return b}var Ua=tE(!0),nE=tE(!1),Of=Mi(null),Df=null,fa=null,ux=null;function dx(){ux=fa=Df=null}function fx(e){var t=Of.current;ft(Of),e._currentValue=t}function ey(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ja(e,t){Df=e,ux=fa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Tn=!0),e.firstContext=null)}function gr(e){var t=e._currentValue;if(ux!==e)if(e={context:e,memoizedValue:t,next:null},fa===null){if(Df===null)throw Error(ue(308));fa=e,Df.dependencies={lanes:0,firstContext:e}}else fa=fa.next=e;return t}var to=null;function hx(e){to===null?to=[e]:to.push(e)}function rE(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,hx(t)):(n.next=s.next,s.next=n),t.interleaved=n,Rs(e,r)}function Rs(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Qs=!1;function px(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sE(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Cs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xe&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Rs(e,n)}return s=r.interleaved,s===null?(t.next=t,hx(r)):(t.next=s.next,s.next=t),r.interleaved=t,Rs(e,n)}function Gd(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zv(e,n)}}function Ub(e,t){var n=e.updateQueue,r=e.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=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Lf(e,t,n,r){var s=e.updateQueue;Qs=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;o=0,d=u=c=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,v=a;switch(h=t,p=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=kt({},f,h);break e;case 2:Qs=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);yo|=o,e.lanes=o,e.memoizedState=f}}function Hb(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(ue(191,s));s.call(r)}}}var bu={},Qr=Mi(bu),Fc=Mi(bu),zc=Mi(bu);function no(e){if(e===bu)throw Error(ue(174));return e}function mx(e,t){switch(ot(zc,t),ot(Fc,e),ot(Qr,bu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ig(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ig(t,e)}ft(Qr),ot(Qr,t)}function Ha(){ft(Qr),ft(Fc),ft(zc)}function iE(e){no(zc.current);var t=no(Qr.current),n=Ig(t,e.type);t!==n&&(ot(Fc,e),ot(Qr,n))}function gx(e){Fc.current===e&&(ft(Qr),ft(Fc))}var wt=Mi(0);function $f(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var nm=[];function yx(){for(var e=0;e<nm.length;e++)nm[e]._workInProgressVersionPrimary=null;nm.length=0}var Kd=$s.ReactCurrentDispatcher,rm=$s.ReactCurrentBatchConfig,go=0,St=null,Ut=null,Wt=null,Ff=!1,hc=!1,Bc=0,EL=0;function on(){throw Error(ue(321))}function vx(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rr(e[n],t[n]))return!1;return!0}function xx(e,t,n,r,s,i){if(go=i,St=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Kd.current=e===null||e.memoizedState===null?AL:RL,e=n(r,s),hc){i=0;do{if(hc=!1,Bc=0,25<=i)throw Error(ue(301));i+=1,Wt=Ut=null,t.updateQueue=null,Kd.current=ML,e=n(r,s)}while(hc)}if(Kd.current=zf,t=Ut!==null&&Ut.next!==null,go=0,Wt=Ut=St=null,Ff=!1,t)throw Error(ue(300));return e}function wx(){var e=Bc!==0;return Bc=0,e}function Br(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wt===null?St.memoizedState=Wt=e:Wt=Wt.next=e,Wt}function yr(){if(Ut===null){var e=St.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var t=Wt===null?St.memoizedState:Wt.next;if(t!==null)Wt=t,Ut=e;else{if(e===null)throw Error(ue(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Wt===null?St.memoizedState=Wt=e:Wt=Wt.next=e}return Wt}function Vc(e,t){return typeof t=="function"?t(e):t}function sm(e){var t=yr(),n=t.queue;if(n===null)throw Error(ue(311));n.lastRenderedReducer=e;var r=Ut,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,c=null,u=i;do{var d=u.lane;if((go&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=f,o=r):c=c.next=f,St.lanes|=d,yo|=d}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=a,Rr(r,t.memoizedState)||(Tn=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,St.lanes|=i,yo|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function im(e){var t=yr(),n=t.queue;if(n===null)throw Error(ue(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);Rr(i,t.memoizedState)||(Tn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function oE(){}function aE(e,t){var n=St,r=yr(),s=t(),i=!Rr(r.memoizedState,s);if(i&&(r.memoizedState=s,Tn=!0),r=r.queue,bx(uE.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Wt!==null&&Wt.memoizedState.tag&1){if(n.flags|=2048,Uc(9,cE.bind(null,n,r,s,t),void 0,null),qt===null)throw Error(ue(349));go&30||lE(n,t,s)}return s}
vendor: 4,204 bytes, line 38
38function lE(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=St.updateQueue,t===null?(t={lastEffect:null,stores:null},St.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cE(e,t,n,r){t.value=n,t.getSnapshot=r,dE(t)&&fE(e)}function uE(e,t,n){return n(function(){dE(t)&&fE(e)})}function dE(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rr(e,n)}catch{return!0}}function fE(e){var t=Rs(e,1);t!==null&&Tr(t,e,1,-1)}function Wb(e){var t=Br();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vc,lastRenderedState:e},t.queue=e,e=e.dispatch=PL.bind(null,St,e),[t.memoizedState,e]}function Uc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=St.updateQueue,t===null?(t={lastEffect:null,stores:null},St.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function hE(){return yr().memoizedState}function Yd(e,t,n,r){var s=Br();St.flags|=e,s.memoizedState=Uc(1|t,n,void 0,r===void 0?null:r)}function Mh(e,t,n,r){var s=yr();r=r===void 0?null:r;var i=void 0;if(Ut!==null){var o=Ut.memoizedState;if(i=o.destroy,r!==null&&vx(r,o.deps)){s.memoizedState=Uc(t,n,i,r);return}}St.flags|=e,s.memoizedState=Uc(1|t,n,i,r)}function qb(e,t){return Yd(8390656,8,e,t)}function bx(e,t){return Mh(2048,8,e,t)}function pE(e,t){return Mh(4,2,e,t)}function mE(e,t){return Mh(4,4,e,t)}function gE(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yE(e,t,n){return n=n!=null?n.concat([e]):null,Mh(4,4,gE.bind(null,t,e),n)}function Sx(){}function vE(e,t){var n=yr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vx(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xE(e,t){var n=yr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vx(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function wE(e,t,n){return go&21?(Rr(n,t)||(n=Cj(),St.lanes|=n,yo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Tn=!0),e.memoizedState=n)}function NL(e,t){var n=tt;tt=n!==0&&4>n?n:4,e(!0);var r=rm.transition;rm.transition={};try{e(!1),t()}finally{tt=n,rm.transition=r}}function bE(){return yr().memoizedState}function TL(e,t,n){var r=gi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},SE(e))kE(t,n);else if(n=rE(e,t,n,r),n!==null){var s=yn();Tr(n,e,r,s),_E(n,t,r)}}function PL(e,t,n){var r=gi(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(SE(e))kE(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Rr(a,o)){var c=t.interleaved;c===null?(s.next=s,hx(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=rE(e,t,s,r),n!==null&&(s=yn(),Tr(n,e,r,s),_E(n,t,r))}}function SE(e){var t=e.alternate;return e===St||t!==null&&t===St}function kE(e,t){hc=Ff=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _E(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zv(e,n)}}var zf={readContext:gr,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},AL={readContext:gr,useCallback:function(e,t){return Br().memoizedState=[e,t===void 0?null:t],e},useContext:gr,useEffect:qb,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Yd(4194308,4,gE.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yd(4,2,e,t)},useMemo:function(e,t){var n=Br();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Br();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=TL.bind(null,St,e),[r.memoizedState,e]}
vendor: 5,550 bytes, lines 38-40
38,useRef:function(e){var t=Br();return e={current:e},t.memoizedState=e},useState:Wb,useDebugValue:Sx,useDeferredValue:function(e){return Br().memoizedState=e},useTransition:function(){var e=Wb(!1),t=e[0];return e=NL.bind(null,e[1]),Br().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=St,s=Br();if(gt){if(n===void 0)throw Error(ue(407));n=n()}else{if(n=t(),qt===null)throw Error(ue(349));go&30||lE(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,qb(uE.bind(null,r,i,e),[e]),r.flags|=2048,Uc(9,cE.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Br(),t=qt.identifierPrefix;if(gt){var n=ks,r=Ss;n=(r&~(1<<32-Nr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Bc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=EL++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},RL={readContext:gr,useCallback:vE,useContext:gr,useEffect:bx,useImperativeHandle:yE,useInsertionEffect:pE,useLayoutEffect:mE,useMemo:xE,useReducer:sm,useRef:hE,useState:function(){return sm(Vc)},useDebugValue:Sx,useDeferredValue:function(e){var t=yr();return wE(t,Ut.memoizedState,e)},useTransition:function(){var e=sm(Vc)[0],t=yr().memoizedState;return[e,t]},useMutableSource:oE,useSyncExternalStore:aE,useId:bE,unstable_isNewReconciler:!1},ML={readContext:gr,useCallback:vE,useContext:gr,useEffect:bx,useImperativeHandle:yE,useInsertionEffect:pE,useLayoutEffect:mE,useMemo:xE,useReducer:im,useRef:hE,useState:function(){return im(Vc)},useDebugValue:Sx,useDeferredValue:function(e){var t=yr();return Ut===null?t.memoizedState=e:wE(t,Ut.memoizedState,e)},useTransition:function(){var e=im(Vc)[0],t=yr().memoizedState;return[e,t]},useMutableSource:oE,useSyncExternalStore:aE,useId:bE,unstable_isNewReconciler:!1};function Sr(e,t){if(e&&e.defaultProps){t=kt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ty(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:kt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ih={isMounted:function(e){return(e=e._reactInternals)?Po(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yn(),s=gi(e),i=Cs(r,s);i.payload=t,n!=null&&(i.callback=n),t=pi(e,i,s),t!==null&&(Tr(t,e,s,r),Gd(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yn(),s=gi(e),i=Cs(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=pi(e,i,s),t!==null&&(Tr(t,e,s,r),Gd(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yn(),r=gi(e),s=Cs(n,r);s.tag=2,t!=null&&(s.callback=t),t=pi(e,s,r),t!==null&&(Tr(t,e,r,n),Gd(t,e,r))}};function Gb(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Oc(n,r)||!Oc(s,i):!0}function CE(e,t,n){var r=!1,s=ki,i=t.contextType;return typeof i=="object"&&i!==null?i=gr(i):(s=Rn(t)?po:dn.current,r=t.contextTypes,i=(r=r!=null)?Ba(e,s):ki),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ih,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Kb(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ih.enqueueReplaceState(t,t.state,null)}function ny(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},px(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=gr(i):(i=Rn(t)?po:dn.current,s.context=Ba(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ty(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Ih.enqueueReplaceState(s,s.state,null),Lf(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Wa(e,t){try{var n="",r=t;do n+=aD(r),r=r.return;while(r);var s=n}catch(i){s=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:t,stack:s,digest:null}}function om(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ry(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var IL=typeof WeakMap=="function"?WeakMap:Map;function jE(e,t,n){n=Cs(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Vf||(Vf=!0,hy=r),ry(e,t)},n}function EE(e,t,n){n=Cs(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){ry(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ry(e,t),typeof r!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Yb(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new IL;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=KL.bind(null,e,t,n),t.then(e,e))}function Jb(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}
vendor: 10,919 bytes, line 40
40function Xb(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Cs(-1,1),t.tag=2,pi(n,t,1))),n.lanes|=1),e)}var OL=$s.ReactCurrentOwner,Tn=!1;function hn(e,t,n,r){t.child=e===null?nE(t,null,n,r):Ua(t,e.child,n,r)}function Qb(e,t,n,r,s){n=n.render;var i=t.ref;return ja(t,s),r=xx(e,t,n,r,i,s),n=wx(),e!==null&&!Tn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ms(e,t,s)):(gt&&n&&ax(t),t.flags|=1,hn(e,t,r,s),t.child)}function Zb(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Px(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,NE(e,t,i,r,s)):(e=Zd(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Oc,n(o,r)&&e.ref===t.ref)return Ms(e,t,s)}return t.flags|=1,e=yi(i,r),e.ref=t.ref,e.return=t,t.child=e}function NE(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Oc(i,r)&&e.ref===t.ref)if(Tn=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Tn=!0);else return t.lanes=e.lanes,Ms(e,t,s)}return sy(e,t,n,r,s)}function TE(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(pa,Hn),Hn|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ot(pa,Hn),Hn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ot(pa,Hn),Hn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ot(pa,Hn),Hn|=r;return hn(e,t,s,n),t.child}function PE(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function sy(e,t,n,r,s){var i=Rn(n)?po:dn.current;return i=Ba(t,i),ja(t,s),n=xx(e,t,n,r,i,s),r=wx(),e!==null&&!Tn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Ms(e,t,s)):(gt&&r&&ax(t),t.flags|=1,hn(e,t,n,s),t.child)}function e1(e,t,n,r,s){if(Rn(n)){var i=!0;Rf(t)}else i=!1;if(ja(t,s),t.stateNode===null)Jd(e,t),CE(t,n,r),ny(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=gr(u):(u=Rn(n)?po:dn.current,u=Ba(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==u)&&Kb(t,o,r,u),Qs=!1;var h=t.memoizedState;o.state=h,Lf(t,r,o,s),c=t.memoizedState,a!==r||h!==c||An.current||Qs?(typeof d=="function"&&(ty(t,n,d,r),c=t.memoizedState),(a=Qs||Gb(t,n,a,r,h,c,u))?(f||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"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,sE(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Sr(t.type,a),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=gr(c):(c=Rn(n)?po:dn.current,c=Ba(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==c)&&Kb(t,o,r,c),Qs=!1,h=t.memoizedState,o.state=h,Lf(t,r,o,s);var g=t.memoizedState;a!==f||h!==g||An.current||Qs?(typeof p=="function"&&(ty(t,n,p,r),g=t.memoizedState),(u=Qs||Gb(t,n,u,r,h,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return iy(e,t,n,r,i,s)}function iy(e,t,n,r,s,i){PE(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Fb(t,n,!1),Ms(e,t,i);r=t.stateNode,OL.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ua(t,e.child,null,i),t.child=Ua(t,null,a,i)):hn(e,t,a,i),t.memoizedState=r.state,s&&Fb(t,n,!0),t.child}function AE(e){var t=e.stateNode;t.pendingContext?$b(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$b(e,t.context,!1),mx(e,t.containerInfo)}function t1(e,t,n,r,s){return Va(),cx(s),t.flags|=256,hn(e,t,n,r),t.child}var oy={dehydrated:null,treeContext:null,retryLane:0};function ay(e){return{baseLanes:e,cachePool:null,transitions:null}}function RE(e,t,n){var r=t.pendingProps,s=wt.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ot(wt,s&1),e===null)return Zg(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Lh(o,r,0,null),e=lo(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ay(n),t.memoizedState=oy,e):kx(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return DL(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=yi(s,c),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=yi(a,i):(i=lo(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?ay(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=oy,r}return i=e.child,e=i.sibling,r=yi(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function kx(e,t){return t=Lh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function od(e,t,n,r){return r!==null&&cx(r),Ua(t,e.child,null,n),e=kx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function DL(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=om(Error(ue(422))),od(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Lh({mode:"visible",children:r.children},s,0,null),i=lo(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ua(t,e.child,null,o),t.child.memoizedState=ay(o),t.memoizedState=oy,i);if(!(t.mode&1))return od(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(ue(419)),r=om(i,r,void 0),od(e,t,o,r)}if(a=(o&e.childLanes)!==0,Tn||a){if(r=qt,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,Rs(e,s),Tr(r,e,s,-1))}return Tx(),r=om(Error(ue(421))),od(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=YL.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Kn=hi(s.nextSibling),Jn=t,gt=!0,Cr=null,e!==null&&(ur[dr++]=Ss,ur[dr++]=ks,ur[dr++]=mo,Ss=e.id,ks=e.overflow,mo=t),t=kx(t,r.children),t.flags|=4096,t)}function n1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ey(e.return,t,n)}function am(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function ME(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(hn(e,t,r.children,n),r=wt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&n1(e,n,t);else if(e.tag===19)n1(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ot(wt,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&$f(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),am(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&$f(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}am(t,!0,n,null,i);break;case"together":am(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Jd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ms(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ue(153));if(t.child!==null){for(e=t.child,n=yi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function LL(e,t,n){switch(t.tag){case 3:AE(t),Va();break;case 5:iE(t);break;case 1:Rn(t.type)&&Rf(t);break;case 4:mx(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;ot(Of,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ot(wt,wt.current&1),t.flags|=128,null):n&t.child.childLanes?RE(e,t,n):(ot(wt,wt.current&1),e=Ms(e,t,n),e!==null?e.sibling:null);ot(wt,wt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ME(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ot(wt,wt.current),r)break;return null;
vendor: 4,598 bytes, line 40
40case 22:case 23:return t.lanes=0,TE(e,t,n)}return Ms(e,t,n)}var IE,ly,OE,DE;IE=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ly=function(){};OE=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,no(Qr.current);var i=null;switch(n){case"input":s=Pg(e,s),r=Pg(e,r),i=[];break;case"select":s=kt({},s,{value:void 0}),r=kt({},r,{value:void 0}),i=[];break;case"textarea":s=Mg(e,s),r=Mg(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pf)}Og(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Nc.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(a=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Nc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ut("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};DE=function(e,t,n,r){n!==r&&(t.flags|=4)};function El(e,t){if(!gt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function an(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function $L(e,t,n){var r=t.pendingProps;switch(lx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(t),null;case 1:return Rn(t.type)&&Af(),an(t),null;case 3:return r=t.stateNode,Ha(),ft(An),ft(dn),yx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(sd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Cr!==null&&(gy(Cr),Cr=null))),ly(e,t),an(t),null;case 5:gx(t);var s=no(zc.current);if(n=t.type,e!==null&&t.stateNode!=null)OE(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ue(166));return an(t),null}if(e=no(Qr.current),sd(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[qr]=t,r[$c]=i,e=(t.mode&1)!==0,n){case"dialog":ut("cancel",r),ut("close",r);break;case"iframe":case"object":case"embed":ut("load",r);break;case"video":case"audio":for(s=0;s<Jl.length;s++)ut(Jl[s],r);break;case"source":ut("error",r);break;case"img":case"image":case"link":ut("error",r),ut("load",r);break;case"details":ut("toggle",r);break;case"input":db(r,i),ut("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ut("invalid",r);break;case"textarea":hb(r,i),ut("invalid",r)}Og(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&&rd(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&rd(r.textContent,a,e),s=["children",""+a]):Nc.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ut("scroll",r)}switch(n){case"input":Yu(r),fb(r,i,!0);break;case"textarea":Yu(r),pb(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Pf)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=uj(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[qr]=t,e[$c]=r,IE(e,t,!1,!1),t.stateNode=e;e:{switch(o=Dg(n,r),n){case"dialog":ut("cancel",e),ut("close",e),s=r;break;case"iframe":case"object":case"embed":ut("load",e),s=r;break;case"video":case"audio":for(s=0;s<Jl.length;s++)ut(Jl[s],e);s=r;break;case"source":ut("error",e),s=r;break;case"img":case"image":case"link":ut("error",e),ut("load",e),s=r;break;case"details":ut("toggle",e),s=r;break;case"input":db(e,r),s=Pg(e,r),ut("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=kt({},r,{value:void 0}),ut("invalid",e);break;case"textarea":hb(e,r),s=Mg(e,r),ut("invalid",e);break;default:s=r}Og(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?hj(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&dj(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Tc(e,c):typeof c=="number"&&Tc(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Nc.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ut("scroll",e):c!=null&&Gv(e,i,c,o))}switch(n){case"input":Yu(e),fb(e,r,!1);break;case"textarea":Yu(e),pb(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Si(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Sa(e,!!r.multiple,i,!1):r.defaultValue!=null&&Sa(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Pf)}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&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return an(t),null;case 6:if(e&&t.stateNode!=null)DE(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ue(166));if(n=no(zc.current),no(Qr.current),sd(t)){if(r=t.stateNode,n=t.memoizedProps,r[qr]=t,(i=r.nodeValue!==n)&&(e=Jn,e!==null))switch(e.tag){case 3:rd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rd(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[qr]=t,t.stateNode=r}return an(t),null;case 13:if(ft(wt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(gt&&Kn!==null&&t.mode&1&&!(t.flags&128))eE(),Va(),t.flags|=98560,i=!1;else if(i=sd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(ue(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ue(317));i[qr]=t}else Va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;an(t),i=!1}else Cr!==null&&(gy(Cr),Cr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||wt.current&1?Ht===0&&(Ht=3):Tx())),t.updateQueue!==null&&(t.flags|=4),an(t),null);case 4:return Ha(),ly(e,t),e===null&&Dc(t.stateNode.containerInfo),an(t),null;case 10:return fx(t.type._context),an(t),null;case 17:return Rn(t.type)&&Af(),an(t),null;case 19:if(ft(wt),i=t.memoizedState,i===null)return an(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)El(i,!1);else{if(Ht!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=$f(e),o!==null){for(t.flags|=128,El(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ot(wt,wt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Rt()>qa&&(t.flags|=128,r=!0,El(i,!1),t.lanes=4194304)}else{if(!r)if(e=$f(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),El(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!gt)return an(t),null}else 2*Rt()-i.renderingStartTime>qa&&n!==1073741824&&(t.flags|=128,r=!0,El(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Rt(),t.sibling=null,n=wt.current,ot(wt,r?n&1|2:n&1),t):(an(t),null);case 22:case 23:return Nx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Hn&1073741824&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),null;case 24:return null;case 25:return null}throw Error(ue(156,t.tag))}function FL(e,t){switch(lx(t),t.tag){case 1:return Rn(t.type)&&Af(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 23,232 bytes, line 40
40case 3:return Ha(),ft(An),ft(dn),yx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gx(t),null;case 13:if(ft(wt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ue(340));Va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(wt),null;case 4:return Ha(),null;case 10:return fx(t.type._context),null;case 22:case 23:return Nx(),null;case 24:return null;default:return null}}var ad=!1,cn=!1,zL=typeof WeakSet=="function"?WeakSet:Set,Se=null;function ha(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Et(e,t,r)}else n.current=null}function cy(e,t,n){try{n()}catch(r){Et(e,t,r)}}var r1=!1;function BL(e,t){if(qg=Ef,e=Bj(),ox(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.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,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===s&&(a=o),h===i&&++d===r&&(c=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gg={focusedElem:e,selectionRange:n},Ef=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,b=g.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:Sr(t.type,v),b);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var x=t.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(ue(163))}}catch(S){Et(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return g=r1,r1=!1,g}function pc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&cy(t,n,i)}s=s.next}while(s!==r)}}function Oh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function uy(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function LE(e){var t=e.alternate;t!==null&&(e.alternate=null,LE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qr],delete t[$c],delete t[Jg],delete t[kL],delete t[_L])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $E(e){return e.tag===5||e.tag===3||e.tag===4}function s1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$E(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Pf));else if(r!==4&&(e=e.child,e!==null))for(dy(e,t,n),e=e.sibling;e!==null;)dy(e,t,n),e=e.sibling}function fy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(fy(e,t,n),e=e.sibling;e!==null;)fy(e,t,n),e=e.sibling}var Zt=null,_r=!1;function Hs(e,t,n){for(n=n.child;n!==null;)FE(e,t,n),n=n.sibling}function FE(e,t,n){if(Xr&&typeof Xr.onCommitFiberUnmount=="function")try{Xr.onCommitFiberUnmount(Eh,n)}catch{}switch(n.tag){case 5:cn||ha(n,t);case 6:var r=Zt,s=_r;Zt=null,Hs(e,t,n),Zt=r,_r=s,Zt!==null&&(_r?(e=Zt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Zt.removeChild(n.stateNode));break;case 18:Zt!==null&&(_r?(e=Zt,n=n.stateNode,e.nodeType===8?em(e.parentNode,n):e.nodeType===1&&em(e,n),Mc(e)):em(Zt,n.stateNode));break;case 4:r=Zt,s=_r,Zt=n.stateNode.containerInfo,_r=!0,Hs(e,t,n),Zt=r,_r=s;break;case 0:case 11:case 14:case 15:if(!cn&&(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)&&cy(n,t,o),s=s.next}while(s!==r)}Hs(e,t,n);break;case 1:if(!cn&&(ha(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Et(n,t,a)}Hs(e,t,n);break;case 21:Hs(e,t,n);break;case 22:n.mode&1?(cn=(r=cn)||n.memoizedState!==null,Hs(e,t,n),cn=r):Hs(e,t,n);break;default:Hs(e,t,n)}}function i1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zL),t.forEach(function(r){var s=JL.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function xr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Zt=a.stateNode,_r=!1;break e;case 3:Zt=a.stateNode.containerInfo,_r=!0;break e;case 4:Zt=a.stateNode.containerInfo,_r=!0;break e}a=a.return}if(Zt===null)throw Error(ue(160));FE(i,o,s),Zt=null,_r=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){Et(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zE(t,e),t=t.sibling}function zE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xr(t,e),Fr(e),r&4){try{pc(3,e,e.return),Oh(3,e)}catch(v){Et(e,e.return,v)}try{pc(5,e,e.return)}catch(v){Et(e,e.return,v)}}break;case 1:xr(t,e),Fr(e),r&512&&n!==null&&ha(n,n.return);break;case 5:if(xr(t,e),Fr(e),r&512&&n!==null&&ha(n,n.return),e.flags&32){var s=e.stateNode;try{Tc(s,"")}catch(v){Et(e,e.return,v)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&lj(s,i),Dg(a,o);var u=Dg(a,i);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?hj(s,f):d==="dangerouslySetInnerHTML"?dj(s,f):d==="children"?Tc(s,f):Gv(s,d,f,u)}switch(a){case"input":Ag(s,i);break;case"textarea":cj(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Sa(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?Sa(s,!!i.multiple,i.defaultValue,!0):Sa(s,!!i.multiple,i.multiple?[]:"",!1))}s[$c]=i}catch(v){Et(e,e.return,v)}}break;case 6:if(xr(t,e),Fr(e),r&4){if(e.stateNode===null)throw Error(ue(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(v){Et(e,e.return,v)}}break;case 3:if(xr(t,e),Fr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Mc(t.containerInfo)}catch(v){Et(e,e.return,v)}break;case 4:xr(t,e),Fr(e);break;case 13:xr(t,e),Fr(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(jx=Rt())),r&4&&i1(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(cn=(u=cn)||d,xr(t,e),cn=u):xr(t,e),Fr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Se=e,d=e.child;d!==null;){for(f=Se=d;Se!==null;){switch(h=Se,p=h.child,h.tag){case 0:case 11:case 14:case 15:pc(4,h,h.return);break;case 1:ha(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){Et(r,n,v)}}break;case 5:ha(h,h.return);break;case 22:if(h.memoizedState!==null){a1(f);continue}}p!==null?(p.return=h,Se=p):a1(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=fj("display",o))}catch(v){Et(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Et(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:xr(t,e),Fr(e),r&4&&i1(e);break;case 21:break;default:xr(t,e),Fr(e)}}function Fr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if($E(n)){var r=n;break e}n=n.return}throw Error(ue(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Tc(s,""),r.flags&=-33);var i=s1(e);fy(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=s1(e);dy(e,a,o);break;default:throw Error(ue(161))}}catch(c){Et(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function VL(e,t,n){Se=e,BE(e)}function BE(e,t,n){for(var r=(e.mode&1)!==0;Se!==null;){var s=Se,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||ad;if(!o){var a=s.alternate,c=a!==null&&a.memoizedState!==null||cn;a=ad;var u=cn;if(ad=o,(cn=c)&&!u)for(Se=s;Se!==null;)o=Se,c=o.child,o.tag===22&&o.memoizedState!==null?l1(s):c!==null?(c.return=o,Se=c):l1(s);for(;i!==null;)Se=i,BE(i),i=i.sibling;Se=s,ad=a,cn=u}o1(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Se=i):o1(e)}}function o1(e){for(;Se!==null;){var t=Se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:cn||Oh(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!cn)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Sr(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Hb(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Hb(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Mc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ue(163))}cn||t.flags&512&&uy(t)}catch(h){Et(t,t.return,h)}}if(t===e){Se=null;break}if(n=t.sibling,n!==null){n.return=t.return,Se=n;break}Se=t.return}}function a1(e){for(;Se!==null;){var t=Se;if(t===e){Se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Se=n;break}Se=t.return}}function l1(e){for(;Se!==null;){var t=Se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Oh(4,t)}catch(c){Et(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){Et(t,s,c)}}var i=t.return;try{uy(t)}catch(c){Et(t,i,c)}break;case 5:var o=t.return;try{uy(t)}catch(c){Et(t,o,c)}}}catch(c){Et(t,t.return,c)}if(t===e){Se=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Se=a;break}Se=t.return}}var UL=Math.ceil,Bf=$s.ReactCurrentDispatcher,_x=$s.ReactCurrentOwner,pr=$s.ReactCurrentBatchConfig,Xe=0,qt=null,$t=null,rn=0,Hn=0,pa=Mi(0),Ht=0,Hc=null,yo=0,Dh=0,Cx=0,mc=null,Nn=null,jx=0,qa=1/0,us=null,Vf=!1,hy=null,mi=null,ld=!1,ai=null,Uf=0,gc=0,py=null,Xd=-1,Qd=0;function yn(){return Xe&6?Rt():Xd!==-1?Xd:Xd=Rt()}function gi(e){return e.mode&1?Xe&2&&rn!==0?rn&-rn:jL.transition!==null?(Qd===0&&(Qd=Cj()),Qd):(e=tt,e!==0||(e=window.event,e=e===void 0?16:Rj(e.type)),e):1}function Tr(e,t,n,r){if(50<gc)throw gc=0,py=null,Error(ue(185));vu(e,n,r),(!(Xe&2)||e!==qt)&&(e===qt&&(!(Xe&2)&&(Dh|=n),Ht===4&&ei(e,rn)),Mn(e,r),n===1&&Xe===0&&!(t.mode&1)&&(qa=Rt()+500,Rh&&Ii()))}function Mn(e,t){var n=e.callbackNode;jD(e,t);var r=jf(e,e===qt?rn:0);if(r===0)n!==null&&yb(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yb(n),t===1)e.tag===0?CL(c1.bind(null,e)):Xj(c1.bind(null,e)),bL(function(){!(Xe&6)&&Ii()}),n=null;else{switch(jj(r)){case 1:n=Qv;break;case 4:n=kj;break;case 16:n=Cf;break;case 536870912:n=_j;break;default:n=Cf}n=YE(n,VE.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function VE(e,t){if(Xd=-1,Qd=0,Xe&6)throw Error(ue(327));var n=e.callbackNode;if(Ea()&&e.callbackNode!==n)return null;var r=jf(e,e===qt?rn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Hf(e,r);else{t=r;var s=Xe;Xe|=2;var i=HE();(qt!==e||rn!==t)&&(us=null,qa=Rt()+500,ao(e,t));do try{qL();break}catch(a){UE(e,a)}while(!0);dx(),Bf.current=i,Xe=s,$t!==null?t=0:(qt=null,rn=0,t=Ht)}if(t!==0){if(t===2&&(s=Bg(e),s!==0&&(r=s,t=my(e,s))),t===1)throw n=Hc,ao(e,0),ei(e,r),Mn(e,Rt()),n;if(t===6)ei(e,r);else{if(s=e.current.alternate,!(r&30)&&!HL(s)&&(t=Hf(e,r),t===2&&(i=Bg(e),i!==0&&(r=i,t=my(e,i))),t===1))throw n=Hc,ao(e,0),ei(e,r),Mn(e,Rt()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(ue(345));case 2:Gi(e,Nn,us);break;case 3:if(ei(e,r),(r&130023424)===r&&(t=jx+500-Rt(),10<t)){if(jf(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){yn(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Yg(Gi.bind(null,e,Nn,us),t);break}Gi(e,Nn,us);break;case 4:if(ei(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-Nr(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Rt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*UL(r/1960))-r,10<r){e.timeoutHandle=Yg(Gi.bind(null,e,Nn,us),r);break}Gi(e,Nn,us);break;case 5:Gi(e,Nn,us);break;default:throw Error(ue(329))}}}return Mn(e,Rt()),e.callbackNode===n?VE.bind(null,e):null}function my(e,t){var n=mc;return e.current.memoizedState.isDehydrated&&(ao(e,t).flags|=256),e=Hf(e,t),e!==2&&(t=Nn,Nn=n,t!==null&&gy(t)),e}function gy(e){Nn===null?Nn=e:Nn.push.apply(Nn,e)}function HL(e){for(var t=e;;){if(t.flags&16384){var n=t.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(!Rr(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ei(e,t){for(t&=~Cx,t&=~Dh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nr(t),r=1<<n;e[n]=-1,t&=~r}}function c1(e){if(Xe&6)throw Error(ue(327));Ea();var t=jf(e,0);if(!(t&1))return Mn(e,Rt()),null;var n=Hf(e,t);if(e.tag!==0&&n===2){var r=Bg(e);r!==0&&(t=r,n=my(e,r))}if(n===1)throw n=Hc,ao(e,0),ei(e,t),Mn(e,Rt()),n;if(n===6)throw Error(ue(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Gi(e,Nn,us),Mn(e,Rt()),null}function Ex(e,t){var n=Xe;Xe|=1;try{return e(t)}finally{Xe=n,Xe===0&&(qa=Rt()+500,Rh&&Ii())}}function vo(e){ai!==null&&ai.tag===0&&!(Xe&6)&&Ea();var t=Xe;Xe|=1;var n=pr.transition,r=tt;try{if(pr.transition=null,tt=1,e)return e()}finally{tt=r,pr.transition=n,Xe=t,!(Xe&6)&&Ii()}}function Nx(){Hn=pa.current,ft(pa)}function ao(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,wL(n)),$t!==null)for(n=$t.return;n!==null;){var r=n;switch(lx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Af();break;case 3:Ha(),ft(An),ft(dn),yx();break;case 5:gx(r);break;case 4:Ha();break;case 13:ft(wt);break;case 19:ft(wt);break;case 10:fx(r.type._context);break;case 22:case 23:Nx()}n=n.return}if(qt=e,$t=e=yi(e.current,null),rn=Hn=t,Ht=0,Hc=null,Cx=Dh=yo=0,Nn=mc=null,to!==null){for(t=0;t<to.length;t++)if(n=to[t],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}to=null}return e}function UE(e,t){do{var n=$t;try{if(dx(),Kd.current=zf,Ff){for(var r=St.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ff=!1}if(go=0,Wt=Ut=St=null,hc=!1,Bc=0,_x.current=null,n===null||n.return===null){Ht=1,Hc=t,$t=null;break}e:{var i=e,o=n.return,a=n,c=t;if(t=rn,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Jb(o);if(p!==null){p.flags&=-257,Xb(p,o,a,i,t),p.mode&1&&Yb(i,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){Yb(i,u,t),Tx();break e}c=Error(ue(426))}}else if(gt&&a.mode&1){var b=Jb(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Xb(b,o,a,i,t),cx(Wa(c,a));break e}}i=c=Wa(c,a),Ht!==4&&(Ht=2),mc===null?mc=[i]:mc.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=jE(i,c,t);Ub(i,y);break e;case 1:a=c;var w=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(mi===null||!mi.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=EE(i,a,t);Ub(i,S);break e}}i=i.return}while(i!==null)}qE(n)}catch(C){t=C,$t===n&&n!==null&&($t=n=n.return);continue}break}while(!0)}function HE(){var e=Bf.current;return Bf.current=zf,e===null?zf:e}function Tx(){(Ht===0||Ht===3||Ht===2)&&(Ht=4),qt===null||!(yo&268435455)&&!(Dh&268435455)||ei(qt,rn)}function Hf(e,t){var n=Xe;Xe|=2;var r=HE();(qt!==e||rn!==t)&&(us=null,ao(e,t));do try{WL();break}catch(s){UE(e,s)}while(!0);if(dx(),Xe=n,Bf.current=r,$t!==null)throw Error(ue(261));return qt=null,rn=0,Ht}function WL(){for(;$t!==null;)WE($t)}function qL(){for(;$t!==null&&!yD();)WE($t)}function WE(e){var t=KE(e.alternate,e,Hn);e.memoizedProps=e.pendingProps,t===null?qE(e):$t=t,_x.current=null}function qE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=FL(n,t),n!==null){n.flags&=32767,$t=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ht=6,$t=null;return}}else if(n=$L(n,t,Hn),n!==null){$t=n;return}if(t=t.sibling,t!==null){$t=t;return}$t=t=e}while(t!==null);Ht===0&&(Ht=5)}function Gi(e,t,n){var r=tt,s=pr.transition;try{pr.transition=null,tt=1,GL(e,t,n,r)}finally{pr.transition=s,tt=r}return null}function GL(e,t,n,r){do Ea();while(ai!==null);if(Xe&6)throw Error(ue(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ue(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ED(e,i),e===qt&&($t=qt=null,rn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ld||(ld=!0,YE(Cf,function(){return Ea(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=pr.transition,pr.transition=null;var o=tt;tt=1;var a=Xe;Xe|=4,_x.current=null,BL(e,n),zE(n,e),hL(Gg),Ef=!!qg,Gg=qg=null,e.current=n,VL(n),vD(),Xe=a,tt=o,pr.transition=i}else e.current=n;if(ld&&(ld=!1,ai=e,Uf=s),i=e.pendingLanes,i===0&&(mi=null),bD(n.stateNode),Mn(e,Rt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Vf)throw Vf=!1,e=hy,hy=null,e;return Uf&1&&e.tag!==0&&Ea(),i=e.pendingLanes,i&1?e===py?gc++:(gc=0,py=e):gc=0,Ii(),null}function Ea(){if(ai!==null){var e=jj(Uf),t=pr.transition,n=tt;try{if(pr.transition=null,tt=16>e?16:e,ai===null)var r=!1;else{if(e=ai,ai=null,Uf=0,Xe&6)throw Error(ue(331));var s=Xe;for(Xe|=4,Se=e.current;Se!==null;){var i=Se,o=i.child;if(Se.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(Se=u;Se!==null;){var d=Se;switch(d.tag){case 0:case 11:case 15:pc(8,d,i)}var f=d.child;if(f!==null)f.return=d,Se=f;else for(;Se!==null;){d=Se;var h=d.sibling,p=d.return;if(LE(d),d===u){Se=null;break}if(h!==null){h.return=p,Se=h;break}Se=p}}}var g=i.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}Se=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Se=o;else e:for(;Se!==null;){if(i=Se,i.flags&2048)switch(i.tag){case 0:case 11:case 15:pc(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,Se=y;break e}Se=i.return}}var w=e.current;for(Se=w;Se!==null;){o=Se;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,Se=x;else e:for(o=w;Se!==null;){if(a=Se,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Oh(9,a)}}catch(C){Et(a,a.return,C)}if(a===o){Se=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,Se=S;break e}Se=a.return}}if(Xe=s,Ii(),Xr&&typeof Xr.onPostCommitFiberRoot=="function")try{Xr.onPostCommitFiberRoot(Eh,e)}catch{}r=!0}return r}finally{tt=n,pr.transition=t}}return!1}function u1(e,t,n){t=Wa(n,t),t=jE(e,t,1),e=pi(e,t,1),t=yn(),e!==null&&(vu(e,1,t),Mn(e,t))}function Et(e,t,n){if(e.tag===3)u1(e,e,n);else for(;t!==null;){if(t.tag===3){u1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(mi===null||!mi.has(r))){e=Wa(n,e),e=EE(t,e,1),t=pi(t,e,1),e=yn(),t!==null&&(vu(t,1,e),Mn(t,e));break}}t=t.return}}function KL(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yn(),e.pingedLanes|=e.suspendedLanes&n,qt===e&&(rn&n)===n&&(Ht===4||Ht===3&&(rn&130023424)===rn&&500>Rt()-jx?ao(e,0):Cx|=n),Mn(e,t)}function GE(e,t){t===0&&(e.mode&1?(t=Qu,Qu<<=1,!(Qu&130023424)&&(Qu=4194304)):t=1);var n=yn();e=Rs(e,t),e!==null&&(vu(e,t,n),Mn(e,n))}function YL(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),GE(e,n)}function JL(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ue(314))}r!==null&&r.delete(t),GE(e,n)}var KE;KE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||An.current)Tn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Tn=!1,LL(e,t,n);Tn=!!(e.flags&131072)}else Tn=!1,gt&&t.flags&1048576&&Qj(t,If,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Jd(e,t),e=t.pendingProps;var s=Ba(t,dn.current);ja(t,n),s=xx(null,t,r,e,s,n);var i=wx();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Rn(r)?(i=!0,Rf(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,px(t),s.updater=Ih,t.stateNode=s,s._reactInternals=t,ny(t,r,e,n),t=iy(null,t,r,!0,i,n)):(t.tag=0,gt&&i&&ax(t),hn(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Jd(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=QL(r),e=Sr(r,e),s){case 0:t=sy(null,t,r,e,n);break e;case 1:t=e1(null,t,r,e,n);break e;case 11:t=Qb(null,t,r,e,n);break e;case 14:t=Zb(null,t,r,Sr(r.type,e),n);break e}throw Error(ue(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Sr(r,s),sy(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Sr(r,s),e1(e,t,r,s,n);case 3:e:{if(AE(t),e===null)throw Error(ue(387));
vendor: 4,917 bytes, line 40
40r=t.pendingProps,i=t.memoizedState,s=i.element,sE(e,t),Lf(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Wa(Error(ue(423)),t),t=t1(e,t,r,n,s);break e}else if(r!==s){s=Wa(Error(ue(424)),t),t=t1(e,t,r,n,s);break e}else for(Kn=hi(t.stateNode.containerInfo.firstChild),Jn=t,gt=!0,Cr=null,n=nE(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Va(),r===s){t=Ms(e,t,n);break e}hn(e,t,r,n)}t=t.child}return t;case 5:return iE(t),e===null&&Zg(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Kg(r,s)?o=null:i!==null&&Kg(r,i)&&(t.flags|=32),PE(e,t),hn(e,t,o,n),t.child;case 6:return e===null&&Zg(t),null;case 13:return RE(e,t,n);case 4:return mx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ua(t,null,r,n):hn(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Sr(r,s),Qb(e,t,r,s,n);case 7:return hn(e,t,t.pendingProps,n),t.child;case 8:return hn(e,t,t.pendingProps.children,n),t.child;case 12:return hn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,ot(Of,r._currentValue),r._currentValue=o,i!==null)if(Rr(i.value,o)){if(i.children===s.children&&!An.current){t=Ms(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Cs(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),ey(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ue(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ey(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}hn(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,ja(t,n),s=gr(s),r=r(s),t.flags|=1,hn(e,t,r,n),t.child;case 14:return r=t.type,s=Sr(r,t.pendingProps),s=Sr(r.type,s),Zb(e,t,r,s,n);case 15:return NE(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Sr(r,s),Jd(e,t),t.tag=1,Rn(r)?(e=!0,Rf(t)):e=!1,ja(t,n),CE(t,r,s),ny(t,r,s,n),iy(null,t,r,!0,e,n);case 19:return ME(e,t,n);case 22:return TE(e,t,n)}throw Error(ue(156,t.tag))};function YE(e,t){return Sj(e,t)}function XL(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hr(e,t,n,r){return new XL(e,t,n,r)}function Px(e){return e=e.prototype,!(!e||!e.isReactComponent)}function QL(e){if(typeof e=="function")return Px(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yv)return 11;if(e===Jv)return 14}return 2}function yi(e,t){var n=e.alternate;return n===null?(n=hr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Zd(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Px(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case sa:return lo(n.children,s,i,t);case Kv:o=8,s|=8;break;case jg:return e=hr(12,n,t,s|2),e.elementType=jg,e.lanes=i,e;case Eg:return e=hr(13,n,t,s),e.elementType=Eg,e.lanes=i,e;case Ng:return e=hr(19,n,t,s),e.elementType=Ng,e.lanes=i,e;case ij:return Lh(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rj:o=10;break e;case sj:o=9;break e;case Yv:o=11;break e;case Jv:o=14;break e;case Xs:o=16,r=null;break e}throw Error(ue(130,e==null?e:typeof e,""))}return t=hr(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function lo(e,t,n,r){return e=hr(7,e,r,t),e.lanes=n,e}function Lh(e,t,n,r){return e=hr(22,e,r,t),e.elementType=ij,e.lanes=n,e.stateNode={isHidden:!1},e}function lm(e,t,n){return e=hr(6,e,null,t),e.lanes=n,e}function cm(e,t,n){return t=hr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}
vendor: 5,457 bytes, line 40
40function ZL(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Up(0),this.expirationTimes=Up(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Up(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ax(e,t,n,r,s,i,o,a,c){return e=new ZL(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=hr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},px(i),e}function e5(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ra,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function JE(e){if(!e)return ki;e=e._reactInternals;e:{if(Po(e)!==e||e.tag!==1)throw Error(ue(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Rn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ue(171))}if(e.tag===1){var n=e.type;if(Rn(n))return Jj(e,n,t)}return t}function XE(e,t,n,r,s,i,o,a,c){return e=Ax(n,r,!0,e,s,i,o,a,c),e.context=JE(null),n=e.current,r=yn(),s=gi(n),i=Cs(r,s),i.callback=t??null,pi(n,i,s),e.current.lanes=s,vu(e,s,r),Mn(e,r),e}function $h(e,t,n,r){var s=t.current,i=yn(),o=gi(s);return n=JE(n),t.context===null?t.context=n:t.pendingContext=n,t=Cs(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=pi(s,t,o),e!==null&&(Tr(e,s,o,i),Gd(e,s,o)),o}function Wf(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function d1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Rx(e,t){d1(e,t),(e=e.alternate)&&d1(e,t)}function t5(){return null}var QE=typeof reportError=="function"?reportError:function(e){console.error(e)};function Mx(e){this._internalRoot=e}Fh.prototype.render=Mx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ue(409));$h(e,t,null,null)};Fh.prototype.unmount=Mx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vo(function(){$h(null,e,null,null)}),t[As]=null}};function Fh(e){this._internalRoot=e}Fh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Zs.length&&t!==0&&t<Zs[n].priority;n++);Zs.splice(n,0,e),n===0&&Aj(e)}};function Ix(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function f1(){}function n5(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=Wf(o);i.call(u)}}var o=XE(t,r,e,0,null,!1,!1,"",f1);return e._reactRootContainer=o,e[As]=o.current,Dc(e.nodeType===8?e.parentNode:e),vo(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var u=Wf(c);a.call(u)}}var c=Ax(e,0,!1,null,null,!1,!1,"",f1);return e._reactRootContainer=c,e[As]=c.current,Dc(e.nodeType===8?e.parentNode:e),vo(function(){$h(t,c,n,r)}),c}function Bh(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var c=Wf(o);a.call(c)}}$h(t,o,e,s)}else o=n5(n,t,e,s,r);return Wf(o)}Ej=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Yl(t.pendingLanes);n!==0&&(Zv(t,n|1),Mn(t,Rt()),!(Xe&6)&&(qa=Rt()+500,Ii()))}break;case 13:vo(function(){var r=Rs(e,1);if(r!==null){var s=yn();Tr(r,e,1,s)}}),Rx(e,1)}};ex=function(e){if(e.tag===13){var t=Rs(e,134217728);if(t!==null){var n=yn();Tr(t,e,134217728,n)}Rx(e,134217728)}};Nj=function(e){if(e.tag===13){var t=gi(e),n=Rs(e,t);if(n!==null){var r=yn();Tr(n,e,t,r)}Rx(e,t)}};Tj=function(){return tt};Pj=function(e,t){var n=tt;try{return tt=e,t()}finally{tt=n}};$g=function(e,t,n){switch(t){case"input":if(Ag(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Ah(r);if(!s)throw Error(ue(90));aj(r),Ag(r,s)}}}break;case"textarea":cj(e,n);break;case"select":t=n.value,t!=null&&Sa(e,!!n.multiple,t,!1)}};gj=Ex;yj=vo;var r5={usingClientEntryPoint:!1,Events:[wu,la,Ah,pj,mj,Ex]},Nl={findFiberByHostInstance:eo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},s5={bundleType:Nl.bundleType,version:Nl.version,rendererPackageName:Nl.rendererPackageName,rendererConfig:Nl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$s.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=wj(e),e===null?null:e.stateNode},findFiberByHostInstance:Nl.findFiberByHostInstance||t5,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cd.isDisabled&&cd.supportsFiber)try{Eh=cd.inject(s5),Xr=cd}catch{}}nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r5;nr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ix(t))throw Error(ue(200));return e5(e,t,null,n)};nr.createRoot=function(e,t){if(!Ix(e))throw Error(ue(299));var n=!1,r="",s=QE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Ax(e,1,!1,null,null,n,!1,r,s),e[As]=t.current,Dc(e.nodeType===8?e.parentNode:e),new Mx(t)};nr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ue(188)):(e=Object.keys(e).join(","),Error(ue(268,e)));return e=wj(t),e=e===null?null:e.stateNode,e};nr.flushSync=function(e){return vo(e)};nr.hydrate=function(e,t,n){if(!zh(t))throw Error(ue(200));return Bh(null,e,t,!0,n)};nr.hydrateRoot=function(e,t,n){if(!Ix(e))throw Error(ue(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=QE;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=XE(t,null,e,1,n??null,s,!1,i,o),e[As]=t.current,Dc(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Fh(t)};nr.render=function(e,t,n){if(!zh(t))throw Error(ue(200));return Bh(null,e,t,!1,n)};nr.unmountComponentAtNode=function(e){if(!zh(e))throw Error(ue(40));return e._reactRootContainer?(vo(function(){Bh(null,null,e,!1,function(){e._reactRootContainer=null,e[As]=null})}),!0):!1};nr.unstable_batchedUpdates=Ex;nr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!zh(n))throw Error(ue(200));if(e==null||e._reactInternals===void 0)throw Error(ue(38));return Bh(e,t,n,!1,r)};nr.version="18.3.1-next-f1338f8080-20240426";function ZE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ZE)}catch(e){console.error(e)}}ZE(),ZC.exports=nr;var Vh=ZC.exports;const eN=Ai(Vh);var h1=Vh;_g.createRoot=h1.createRoot,_g.hydrateRoot=h1.hydrateRoot;/**
41 * @remix-run/router v1.20.0
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */function Wc(){return Wc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wc.apply(this,arguments)}var li;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(li||(li={}));const p1="popstate";function i5(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:a}=r.location;return yy("",{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:qf(s)}return a5(t,n,null,e)}function Mt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function tN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function o5(){return Math.random().toString(36).substr(2,8)}function m1(e,t){return{usr:e.state,key:e.key,idx:t}}function yy(e,t,n,r){return n===void 0&&(n=null),Wc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?al(t):t,{state:n,key:t&&t.key||r||o5()})}function qf(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function al(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function a5(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=li.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Wc({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=li.Pop;let b=d(),y=b==null?null:b-u;u=b,c&&c({action:a,location:v.location,delta:y})}function h(b,y){a=li.Push;let w=yy(v.location,b,y);u=d()+1;let x=m1(w,u),S=v.createHref(w);try{o.pushState(x,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(S)}i&&c&&c({action:a,location:v.location,delta:1})}function p(b,y){a=li.Replace;let w=yy(v.location,b,y);u=d();let x=m1(w,u),S=v.createHref(w);o.replaceState(x,"",S),i&&c&&c({action:a,location:v.location,delta:0})}function g(b){let y=s.location.origin!=="null"?s.location.origin:s.location.href,w=typeof b=="string"?b:qf(b);return w=w.replace(/ $/,"%20"),Mt(y,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,y)}let v={get action(){return a},get location(){return e(s,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(p1,f),c=b,()=>{s.removeEventListener(p1,f),c=null}},createHref(b){return t(s,b)},createURL:g,encodeLocation(b){let y=g(b);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(b){return o.go(b)}};return v}var g1;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(g1||(g1={}));
vendor: 9,204 bytes, lines 49-58
49function l5(e,t,n){return n===void 0&&(n="/"),c5(e,t,n,!1)}function c5(e,t,n,r){let s=typeof t=="string"?al(t):t,i=Ox(s.pathname||"/",n);if(i==null)return null;let o=nN(e);u5(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let u=b5(i);a=x5(o[c],u,r)}return a}function nN(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Mt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=vi([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Mt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),nN(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:y5(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let c of rN(i.path))s(i,o,c)}),t}function rN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=rN(r.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function u5(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:v5(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const d5=/^:[\w-]+$/,f5=3,h5=2,p5=1,m5=10,g5=-2,y1=e=>e==="*";function y5(e,t){let n=e.split("/"),r=n.length;return n.some(y1)&&(r+=g5),t&&(r+=h5),n.filter(s=>!y1(s)).reduce((s,i)=>s+(d5.test(i)?f5:i===""?p5:m5),r)}function v5(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function x5(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],u=a===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=v1({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=v1({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(s,f.params),o.push({params:s,pathname:vi([i,f.pathname]),pathnameBase:C5(vi([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=vi([i,f.pathnameBase]))}return o}function v1(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=w5(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let v=a[f]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=a[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function w5(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),tN(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function b5(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return tN(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ox(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function S5(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?al(e):e;return{pathname:n?n.startsWith("/")?n:k5(n,t):t,search:j5(r),hash:E5(s)}}function k5(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function um(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` 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 _5(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Dx(e,t){let n=_5(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Lx(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=al(e):(s=Wc({},e),Mt(!s.pathname||!s.pathname.includes("?"),um("?","pathname","search",s)),Mt(!s.pathname||!s.pathname.includes("#"),um("#","pathname","hash",s)),Mt(!s.search||!s.search.includes("#"),um("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}a=f>=0?t[f]:"/"}let c=S5(s,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const vi=e=>e.join("/").replace(/\/\/+/g,"/"),C5=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,E5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function N5(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const sN=["post","put","patch","delete"];new Set(sN);const T5=["get",...sN];new Set(T5);/**
50 * React Router v6.27.0
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qc.apply(this,arguments)}const $x=m.createContext(null),P5=m.createContext(null),Oi=m.createContext(null),Uh=m.createContext(null),Fs=m.createContext({outlet:null,matches:[],isDataRoute:!1}),iN=m.createContext(null);function A5(e,t){let{relative:n}=t===void 0?{}:t;ll()||Mt(!1);let{basename:r,navigator:s}=m.useContext(Oi),{hash:i,pathname:o,search:a}=lN(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:vi([r,o])),s.createHref({pathname:c,search:a,hash:i})}function ll(){return m.useContext(Uh)!=null}function Di(){return ll()||Mt(!1),m.useContext(Uh).location}function oN(e){m.useContext(Oi).static||m.useLayoutEffect(e)}function Kt(){let{isDataRoute:e}=m.useContext(Fs);return e?H5():R5()}function R5(){ll()||Mt(!1);let e=m.useContext($x),{basename:t,future:n,navigator:r}=m.useContext(Oi),{matches:s}=m.useContext(Fs),{pathname:i}=Di(),o=JSON.stringify(Dx(s,n.v7_relativeSplatPath)),a=m.useRef(!1);return oN(()=>{a.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let f=Lx(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:vi([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,i,e])}function aN(){let{matches:e}=m.useContext(Fs),t=e[e.length-1];return t?t.params:{}}function lN(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Oi),{matches:s}=m.useContext(Fs),{pathname:i}=Di(),o=JSON.stringify(Dx(s,r.v7_relativeSplatPath));return m.useMemo(()=>Lx(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function M5(e,t){return I5(e,t)}function I5(e,t,n,r){ll()||Mt(!1);let{navigator:s}=m.useContext(Oi),{matches:i}=m.useContext(Fs),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Di(),d;if(t){var f;let b=typeof t=="string"?al(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||Mt(!1),d=b}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let b=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let g=l5(e,{pathname:p}),v=F5(g&&g.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:vi([c,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:vi([c,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return t&&v?m.createElement(Uh.Provider,{value:{location:qc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:li.Pop}},v):v}function O5(){let e=U5(),t=N5(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application 
58Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const D5=m.createElement(O5,null);class L5 extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Fs.Provider,{value:this.props.routeContext},m.createElement(iN.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $5(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext($x);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Fs.Provider,{value:t},r)}function F5(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Mt(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,g=!1,v=null,b=null;n&&(p=a&&f.route.id?a[f.route.id]:void 0,v=f.route.errorElement||D5,c&&(u<0&&h===0?(g=!0,b=null):u===h&&(g=!0,b=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),w=()=>{let x;return p?x=v:g?x=b:f.route.Component?x=m.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,m.createElement($5,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(L5,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):w()},null)}var cN=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(cN||{}),Gf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Gf||{});function z5(e){let t=m.useContext($x);return t||Mt(!1),t}function B5(e){let t=m.useContext(P5);return t||Mt(!1),t}function V5(e){let t=m.useContext(Fs);return t||Mt(!1),t}function uN(e){let t=V5(),n=t.matches[t.matches.length-1];return n.route.id||Mt(!1),n.route.id}function U5(){var e;let t=m.useContext(iN),n=B5(Gf.UseRouteError),r=uN(Gf.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function H5(){let{router:e}=z5(cN.UseNavigateStable),t=uN(Gf.UseNavigateStable),n=m.useRef(!1);return oN(()=>{n.current=!0}),m.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,qc({fromRouteId:t},i)))},[e,t])}function W5(e){let{to:t,replace:n,state:r,relative:s}=e;ll()||Mt(!1);let{future:i,static:o}=m.useContext(Oi),{matches:a}=m.useContext(Fs),{pathname:c}=Di(),u=Kt(),d=Lx(t,Dx(a,i.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return m.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function ar(e){Mt(!1)}function q5(e){let{basename:t="/",children:n=null,location:r,navigationType:s=li.Pop,navigator:i,static:o=!1,future:a}=e;ll()&&Mt(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:i,static:o,future:qc({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof r=="string"&&(r=al(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,v=m.useMemo(()=>{let b=Ox(d,c);return b==null?null:{location:{pathname:b,search:f,hash:h,state:p,key:g},navigationType:s}},[c,d,f,h,p,g,s]);return v==null?null:m.createElement(Oi.Provider,{value:u},m.createElement(Uh.Provider,{children:n,value:v}))}function G5(e){let{children:t,location:n}=e;return M5(vy(t),n)}new Promise(()=>{});
58function vy(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let i=[...t,s];if(r.type===m.Fragment){n.push.apply(n,vy(r.props.children,i));return}r.type!==ar&&Mt(!1),!r.props.index||!r.props.children||Mt(!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=vy(r.props.children,i)),n.push(o)}),n}/**
59 * React Router DOM v6.27.0
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xy.apply(this,arguments)}function K5(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Y5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function J5(e,t){return e.button===0&&(!t||t==="_self")&&!Y5(e)}function wy(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function X5(e,t){let n=wy(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const Q5=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Z5="6";try{window.__reactRouterVersion=Z5}catch{}const e4="startTransition",x1=jh[e4];function t4(e){let{basename:t,children:n,future:r,window:s}=e,i=m.useRef();i.current==null&&(i.current=i5({window:s,v5Compat:!0}));let o=i.current,[a,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=m.useCallback(f=>{u&&x1?x1(()=>c(f)):c(f)},[c,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.createElement(q5,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const n4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",r4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,s4=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=K5(t,Q5),{basename:p}=m.useContext(Oi),g,v=!1;if(typeof u=="string"&&r4.test(u)&&(g=u,n4))try{let x=new URL(window.location.href),S=u.startsWith("//")?new URL(x.protocol+u):new URL(u),C=Ox(S.pathname,p);S.origin===x.origin&&C!=null?u=C+S.search+S.hash:v=!0}catch{}let b=A5(u,{relative:s}),y=i4(u,{replace:o,state:a,target:c,preventScrollReset:d,relative:s,viewTransition:f});function w(x){r&&r(x),x.defaultPrevented||y(x)}return m.createElement("a",xy({},h,{href:g||b,onClick:v||i?r:w,ref:n,target:c}))});var w1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(w1||(w1={}));var b1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(b1||(b1={}));function i4(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,c=Kt(),u=Di(),d=lN(e,{relative:o});return m.useCallback(f=>{if(J5(f,n)){f.preventDefault();let h=r!==void 0?r:qf(u)===qf(d);c(e,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,c,d,r,s,n,e,i,o,a])}function o4(e){let t=m.useRef(wy(e)),n=m.useRef(!1),r=Di(),s=m.useMemo(()=>X5(r.search,n.current?null:t.current),[r.search]),i=Kt(),o=m.useCallback((a,c)=>{const u=wy(typeof a=="function"?a(s):a);n.current=!0,i("?"+u,c)},[i,s]);return[s,o]}/**
68 * @license lucide-react v0.462.0 - ISC
69 *
70 * This source code is licensed under the ISC license.
71 * See the LICENSE file in the root directory of this source tree.
72 */const a4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dN=(...e)=>
vendor: 5,557 bytes, lines 72-142
72e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
73 * @license lucide-react v0.462.0 - ISC
74 *
75 * This source code is licensed under the ISC license.
76 * See the LICENSE file in the root directory of this source tree.
77 */var l4={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"};/**
78 * @license lucide-react v0.462.0 - ISC
79 *
80 * This source code is licensed under the ISC license.
81 * See the LICENSE file in the root directory of this source tree.
82 */const c4=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>m.createElement("svg",{ref:c,...l4,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:dN("lucide",s),...a},[...o.map(([u,d])=>m.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
83 * @license lucide-react v0.462.0 - ISC
84 *
85 * This source code is licensed under the ISC license.
86 * See the LICENSE file in the root directory of this source tree.
87 */const he=(e,t)=>{const n=m.forwardRef(({className:r,...s},i)=>m.createElement(c4,{ref:i,iconNode:t,className:dN(`lucide-${a4(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
88 * @license lucide-react v0.462.0 - ISC
89 *
90 * This source code is licensed under the ISC license.
91 * See the LICENSE file in the root directory of this source tree.
92 */const S1=he("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
93 * @license lucide-react v0.462.0 - ISC
94 *
95 * This source code is licensed under the ISC license.
96 * See the LICENSE file in the root directory of this source tree.
97 */const u4=he("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
98 * @license lucide-react v0.462.0 - ISC
99 *
100 * This source code is licensed under the ISC license.
101 * See the LICENSE file in the root directory of this source tree.
102 */const d4=he("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
103 * @license lucide-react v0.462.0 - ISC
104 *
105 * This source code is licensed under the ISC license.
106 * See the LICENSE file in the root directory of this source tree.
107 */const fN=he("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
108 * @license lucide-react v0.462.0 - ISC
109 *
110 * This source code is licensed under the ISC license.
111 * See the LICENSE file in the root directory of this source tree.
112 */const hN=he("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
113 * @license lucide-react v0.462.0 - ISC
114 *
115 * This source code is licensed under the ISC license.
116 * See the LICENSE file in the root directory of this source tree.
117 */const f4=he("AudioLines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);/**
118 * @license lucide-react v0.462.0 - ISC
119 *
120 * This source code is licensed under the ISC license.
121 * See the LICENSE file in the root directory of this source tree.
122 */const h4=he("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
123 * @license lucide-react v0.462.0 - ISC
124 *
125 * This source code is licensed under the ISC license.
126 * See the LICENSE file in the root directory of this source tree.
127 */const p4=he("Binoculars",[["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M19 7V4a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v3",key:"3apit1"}],["path",{d:"M20 21a2 2 0 0 0 2-2v-3.851c0-1.39-2-2.962-2-4.829V8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v11a2 2 0 0 0 2 2z",key:"rhpgnw"}],["path",{d:"M 22 16 L 2 16",key:"14lkq7"}],["path",{d:"M4 21a2 2 0 0 1-2-2v-3.851c0-1.39 2-2.962 2-4.829V8a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v11a2 2 0 0 1-2 2z",key:"104b3k"}],["path",{d:"M9 7V4a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v3",key:"14fczp"}]]);/**
128 * @license lucide-react v0.462.0 - ISC
129 *
130 * This source code is licensed under the ISC license.
131 * See the LICENSE file in the root directory of this source tree.
132 */const pN=he("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
133 * @license lucide-react v0.462.0 - ISC
134 *
135 * This source code is licensed under the ISC license.
136 * See the LICENSE file in the root directory of this source tree.
137 */const m4=he("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/**
138 * @license lucide-react v0.462.0 - ISC
139 *
140 * This source code is licensed under the ISC license.
141 * See the LICENSE file in the root directory of this source tree.
142 */const g4=he("Bus",[["path",{d:"M8 6v6",key:"18i7km"}],["path",{d:"M15 6v6",key:"1sg6z9"}],["path",{d:"M2 12h19.6",key:"de5uta"}
142],["path",{d:"M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3",key:"1wwztk"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}],["path",{d:"M9 18h5",key:"lrx6i"}],["circle",{cx:"16",cy:"18",r:"2",key:"1v4tcr"}]]);/**
143 * @license lucide-react v0.462.0 - ISC
144 *
145 * This source code is licensed under the ISC license.
146 * See the LICENSE file in the root directory of this source tree.
147 */const by=he("CalendarCheck",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]);/**
148 * @license lucide-react v0.462.0 - ISC
149 *
150 * This source code is licensed under the ISC license.
151 * See the LICENSE file in the root directory of this source tree.
152 */const mN=he("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
153 * @license lucide-react v0.462.0 - ISC
154 *
155 * This source code is licensed under the ISC license.
156 * See the LICENSE file in the root directory of this source tree.
157 */const y4=he("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);/**
158 * @license lucide-react v0.462.0 - ISC
159 *
160 * This source code is licensed under the ISC license.
161 * See the LICENSE file in the root directory of this source tree.
162 */const Ga=he("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
163 * @license lucide-react v0.462.0 - ISC
164 *
165 * This source code is licensed under the ISC license.
166 * See the LICENSE file in the root directory of this source tree.
167 */const v4=he("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
168 * @license lucide-react v0.462.0 - ISC
169 *
170 * This source code is licensed under the ISC license.
171 * See the LICENSE file in the root directory of this source tree.
172 */const k1=he("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
173 * @license lucide-react v0.462.0 - ISC
174 *
175 * This source code is licensed under the ISC license.
176 * See the LICENSE file in the root directory of this source tree.
177 */const xo=he("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
178 * @license lucide-react v0.462.0 - ISC
179 *
180 * This source code is licensed under the ISC license.
181 * See the LICENSE file in the root directory of this source tree.
182 */const xi=he("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
183 * @license lucide-react v0.462.0 - ISC
184 *
185 * This source code is licensed under the ISC license.
186 * See the LICENSE file in the root directory of this source tree.
187 */const Fx=he("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
188 * @license lucide-react v0.462.0 - ISC
189 *
190 * This source code is licensed under the ISC license.
191 * See the LICENSE file in the root directory of this source tree.
192 */const wo=he("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
193 * @license lucide-react v0.462.0 - ISC
194 *
195 * This source code is licensed under the ISC license.
196 * See the LICENSE file in the root directory of this source tree.
197 */const dm=he("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
198 * @license lucide-react v0.462.0 - ISC
199 *
200 * This source code is licensed under the ISC license.
201 * See the LICENSE file in the root directory of this source tree.
202 */const gN=he("ChevronsDownUp",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);/**
203 * @license lucide-react v0.462.0 - ISC
204 *
205 * This source code is licensed under the ISC license.
206 * See the LICENSE file in the root directory of this source tree.
207 */const yN=he("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
208 * @license lucide-react v0.462.0 - ISC
209 *
210 * This source code is licensed under the ISC license.
211 * See the LICENSE file in the root directory of this source tree.
212 */const _1=he("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
213 * @license lucide-react v0.462.0 - ISC
214 *
215 * This source code is licensed under the ISC license.
216 * See the LICENSE file in the root directory of this source tree.
217 */const Kf=he("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
218 * @license lucide-react v0.462.0 - ISC
219 *
220 * This source code is licensed under the ISC license.
221 * See the LICENSE file in the root directory of this source tree.
222 */const vN=he("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
223 * @license lucide-react v0.462.0 - ISC
224 *
225 * This source code is licensed under the ISC license.
226 * See the LICENSE file in the root directory of this source tree.
227 */const bo=he("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
228 * @license lucide-react v0.462.0 - ISC
229 *
230 * This source code is licensed under the ISC license.
231 * See the LICENSE file in the root directory of this source tree.
232 */const C1=he("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
233 * @license lucide-react v0.462.0 - ISC
234 *
235 * This source code is licensed under the ISC license.
236 * See the LICENSE file in the root directory of this source tree.
237 */const xN=he("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
238 * @license lucide-react v0.462.0 - ISC
239 *
240 * This source code is licensed under the ISC license.
241 * See the LICENSE file in the root directory of this source tree.
242 */const x4=he("Crown",[["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"}]]);/**
243 * @license lucide-react v0.462.0 - ISC
244 *
245 * This source code is licensed under the ISC license.
246 * See the LICENSE file in the root directory of this source tree.
247 */const w4=he("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
248 * @license lucide-react v0.462.0 - ISC
249 *
250 * This source code is licensed under the ISC license.
251 * See the LICENSE file in the root directory of this source tree.
252 */const wN=he("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
253 * @license lucide-react v0.462.0 - ISC
254 *
255 * This source code is licensed under the ISC license.
256 * See the LICENSE file in the root directory of this source tree.
257 */const bN=he("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);/**
258 * @license lucide-react v0.462.0 - ISC
259 *
260 * This source code is licensed under the ISC license.
261 * See the LICENSE file in the root directory of this source tree.
262 */const SN=he("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.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:"1y4qbx"}]]);/**
263 * @license lucide-react v0.462.0 - ISC
264 *
265 * This source code is licensed under the ISC license.
266 * See the LICENSE file in the root directory of this source tree.
267 */const b4=he("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
268 * @license lucide-react v0.462.0 - ISC
269 *
270 * This source code is licensed under the ISC license.
271 * See the LICENSE file in the root directory of this source tree.
272 */const kN=he("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
273 * @license lucide-react v0.462.0 - ISC
274 *
275 * This source code is licensed under the ISC license.
276 * See the LICENSE file in the root directory of this source tree.
277 */const j1=he("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
278 * @license lucide-react v0.462.0 - ISC
279 *
280 * This source code is licensed under the ISC license.
281 * See the LICENSE file in the root directory of this source tree.
282 */const S4=he("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
283 * @license lucide-react v0.462.0 - ISC
284 *
285 * This source code is licensed under the ISC license.
286 * See the LICENSE file in the root directory of this source tree.
287 */const k4=he("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
288 * @license lucide-react v0.462.0 - ISC
289 *
290 * This source code is licensed under the ISC license.
291 * See the LICENSE file in the root directory of this source tree.
292 */const _4=he("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
293 * @license lucide-react v0.462.0 - ISC
294 *
295 * This source code is licensed under the ISC license.
296 * See the LICENSE file in the root directory of this source tree.
297 */const C4=he("ImageOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
298 * @license lucide-react v0.462.0 - ISC
299 *
300 * This source code is licensed under the ISC license.
301 * See the LICENSE file in the root directory of this source tree.
302 */const j4=he("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
303 * @license lucide-react v0.462.0 - ISC
304 *
305 * This source code is licensed under the ISC license.
306 * See the LICENSE file in the root directory of this source tree.
307 */const E4=he("KeyRound",[["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"}]]);/**
308 * @license lucide-react v0.462.0 - ISC
309 *
310 * This source code is licensed under the ISC license.
311 * See the LICENSE file in the root directory of this source tree.
312 */const js=he("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
313 * @license lucide-react v0.462.0 - ISC
314 *
315 * This source code is licensed under the ISC license.
316 * See the LICENSE file in the root directory of this source tree.
317 */const _N=he("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",ke
317y:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
318 * @license lucide-react v0.462.0 - ISC
319 *
320 * This source code is licensed under the ISC license.
321 * See the LICENSE file in the root directory of this source tree.
322 */const zx=he("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
323 * @license lucide-react v0.462.0 - ISC
324 *
325 * This source code is licensed under the ISC license.
326 * See the LICENSE file in the root directory of this source tree.
327 */const Bx=he("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
328 * @license lucide-react v0.462.0 - ISC
329 *
330 * This source code is licensed under the ISC license.
331 * See the LICENSE file in the root directory of this source tree.
332 */const N4=he("MapPinPlus",[["path",{d:"M19.914 11.105A7.298 7.298 0 0 0 20 10a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 1.202 0 32 32 0 0 0 .824-.738",key:"fcdtly"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M16 18h6",key:"987eiv"}],["path",{d:"M19 15v6",key:"10aioa"}]]);/**
333 * @license lucide-react v0.462.0 - ISC
334 *
335 * This source code is licensed under the ISC license.
336 * See the LICENSE file in the root directory of this source tree.
337 */const er=he("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
338 * @license lucide-react v0.462.0 - ISC
339 *
340 * This source code is licensed under the ISC license.
341 * See the LICENSE file in the root directory of this source tree.
342 */const E1=he("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
343 * @license lucide-react v0.462.0 - ISC
344 *
345 * This source code is licensed under the ISC license.
346 * See the LICENSE file in the root directory of this source tree.
347 */const N1=he("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/**
348 * @license lucide-react v0.462.0 - ISC
349 *
350 * This source code is licensed under the ISC license.
351 * See the LICENSE file in the root directory of this source tree.
352 */const Na=he("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
353 * @license lucide-react v0.462.0 - ISC
354 *
355 * This source code is licensed under the ISC license.
356 * See the LICENSE file in the root directory of this source tree.
357 */const Yf=he("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
358 * @license lucide-react v0.462.0 - ISC
359 *
360 * This source code is licensed under the ISC license.
361 * See the LICENSE file in the root directory of this source tree.
362 */const T4=he("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
363 * @license lucide-react v0.462.0 - ISC
364 *
365 * This source code is licensed under the ISC license.
366 * See the LICENSE file in the root directory of this source tree.
367 */const P4=he("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
368 * @license lucide-react v0.462.0 - ISC
369 *
370 * This source code is licensed under the ISC license.
371 * See the LICENSE file in the root directory of this source tree.
372 */const A4=he("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
373 * @license lucide-react v0.462.0 - ISC
374 *
375 * This source code is licensed under the ISC license.
376 * See the LICENSE file in the root directory of this source tree.
377 */const R4=he("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
378 * @license lucide-react v0.462.0 - ISC
379 *
380 * This source code is licensed under the ISC license.
381 * See the LICENSE file in the root directory of this source tree.
382 */const Vx=he("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
383 * @license lucide-react v0.462.0 - ISC
384 *
385 * This source code is licensed under the ISC license.
386 * See the LICENSE file in the root directory of this source tree.
387 */const M4=he("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
388 * @license lucide-react v0.462.0 - ISC
389 *
390 * This source code is licensed under the ISC license.
391 * See the LICENSE file in the root directory of this source tree.
392 */const Hh=he("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
393 * @license lucide-react v0.462.0 - ISC
394 *
395 * This source code is licensed under the ISC license.
396 * See the LICENSE file in the root directory of this source tree.
397 */const I4=he("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
398 * @license lucide-react v0.462.0 - ISC
399 *
400 * This source code is licensed under the ISC license.
401 * See the LICENSE file in the root directory of this source tree.
402 */const O4=he("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}
402],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
403 * @license lucide-react v0.462.0 - ISC
404 *
405 * This source code is licensed under the ISC license.
406 * See the LICENSE file in the root directory of this source tree.
407 */const CN=he("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
408 * @license lucide-react v0.462.0 - ISC
409 *
410 * This source code is licensed under the ISC license.
411 * See the LICENSE file in the root directory of this source tree.
412 */const D4=he("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
413 * @license lucide-react v0.462.0 - ISC
414 *
415 * This source code is licensed under the ISC license.
416 * See the LICENSE file in the root directory of this source tree.
417 */const jN=he("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
418 * @license lucide-react v0.462.0 - ISC
419 *
420 * This source code is licensed under the ISC license.
421 * See the LICENSE file in the root directory of this source tree.
422 */const L4=he("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
423 * @license lucide-react v0.462.0 - ISC
424 *
425 * This source code is licensed under the ISC license.
426 * See the LICENSE file in the root directory of this source tree.
427 */const Sy=he("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
428 * @license lucide-react v0.462.0 - ISC
429 *
430 * This source code is licensed under the ISC license.
431 * See the LICENSE file in the root directory of this source tree.
432 */const EN=he("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
433 * @license lucide-react v0.462.0 - ISC
434 *
435 * This source code is licensed under the ISC license.
436 * See the LICENSE file in the root directory of this source tree.
437 */const $4=he("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
438 * @license lucide-react v0.462.0 - ISC
439 *
440 * This source code is licensed under the ISC license.
441 * See the LICENSE file in the root directory of this source tree.
442 */const F4=he("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
443 * @license lucide-react v0.462.0 - ISC
444 *
445 * This source code is licensed under the ISC license.
446 * See the LICENSE file in the root directory of this source tree.
447 */const So=he("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
448 * @license lucide-react v0.462.0 - ISC
449 *
450 * This source code is licensed under the ISC license.
451 * See the LICENSE file in the root directory of this source tree.
452 */const z4=he("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
452y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
453 * @license lucide-react v0.462.0 - ISC
454 *
455 * This source code is licensed under the ISC license.
456 * See the LICENSE file in the root directory of this source tree.
457 */const Pr=he("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
458 * @license lucide-react v0.462.0 - ISC
459 *
460 * This source code is licensed under the ISC license.
461 * See the LICENSE file in the root directory of this source tree.
462 */const B4=he("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
463 * @license lucide-react v0.462.0 - ISC
464 *
465 * This source code is licensed under the ISC license.
466 * See the LICENSE file in the root directory of this source tree.
467 */const Ux=he("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
468 * @license lucide-react v0.462.0 - ISC
469 *
470 * This source code is licensed under the ISC license.
471 * See the LICENSE file in the root directory of this source tree.
472 */const V4=he("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
473 * @license lucide-react v0.462.0 - ISC
474 *
475 * This source code is licensed under the ISC license.
476 * See the LICENSE file in the root directory of this source tree.
477 */const U4=he("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
478 * @license lucide-react v0.462.0 - ISC
479 *
480 * This source code is licensed under the ISC license.
481 * See the LICENSE file in the root directory of this source tree.
482 */const Gc=he("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
483 * @license lucide-react v0.462.0 - ISC
484 *
485 * This source code is licensed under the ISC license.
486 * See the LICENSE file in the root directory of this source tree.
487 */const wi=he("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
488 * @license lucide-react v0.462.0 - ISC
489 *
490 * This source code is licensed under the ISC license.
491 * See the LICENSE file in the root directory of this source tree.
492 */const NN=he("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
493 * @license lucide-react v0.462.0 - ISC
494 *
495 * This source code is licensed under the ISC license.
496 * See the LICENSE file in the root directory of this source tree.
497 */const Kc=he("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
498 * @license lucide-react v0.462.0 - ISC
499 *
500 * This source code is licensed under the ISC license.
501 * See the LICENSE file in the root directory of this source tree.
502 */const TN=he("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}
502],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
503 * @license lucide-react v0.462.0 - ISC
504 *
505 * This source code is licensed under the ISC license.
506 * See the LICENSE file in the root directory of this source tree.
507 */const H4=he("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
508 * @license lucide-react v0.462.0 - ISC
509 *
510 * This source code is licensed under the ISC license.
511 * See the LICENSE file in the root directory of this source tree.
512 */const W4=he("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
513 * @license lucide-react v0.462.0 - ISC
514 *
515 * This source code is licensed under the ISC license.
516 * See the LICENSE file in the root directory of this source tree.
517 */const q4=he("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
518 * @license lucide-react v0.462.0 - ISC
519 *
520 * This source code is licensed under the ISC license.
521 * See the LICENSE file in the root directory of this source tree.
522 */const Wh=he("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
523 * @license lucide-react v0.462.0 - ISC
524 *
525 * This source code is licensed under the ISC license.
526 * See the LICENSE file in the root directory of this source tree.
527 */const Gt=he("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
528 * @license lucide-react v0.462.0 - ISC
529 *
530 * This source code is licensed under the ISC license.
531 * See the LICENSE file in the root directory of this source tree.
532 */const Dn=he("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function G4(e,t,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(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(e,t||[])).next())})}const K4=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Hx extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class Y4 extends Hx{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class T1 extends Hx{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class P1 extends Hx{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var ky;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(ky||(ky={}));class J4{constructor(t,{headers:n={},customFetch:r,region:s=ky.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=K4(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return G4(this,arguments,void 0,function*(n,r={}){var s;let i,o;try{const{headers:a,method:c,body:u,signal:d,timeout:f}=r;let h={},{region:p}=r;p||(p=this.region);const g=new URL(`${this.url}/${n}`);p&&p!=="any"&&(h["x-region"]=p,g.searchParams.set("forceFunctionRegion",p));let v;u&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",v=u):typeof u=="string"?(h["Content-Type"]="text/plain",v=u):typeof FormData<"u"&&u instanceof FormData?v=u:(h["Content-Type"]="application/json",v=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?v=JSON.stringify(u):v=u;let b=d;f&&(o=new AbortController,i=setTimeout(()=>
532o.abort(),f),d?(b=o.signal,d.addEventListener("abort",()=>o.abort())):b=o.signal);const y=yield this.fetch(g.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:v,signal:b}).catch(C=>{throw new Y4(C)}),w=y.headers.get("x-relay-error");if(w&&w==="true")throw new T1(y);if(!y.ok)throw new P1(y);let x=((s=y.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),S;return x==="application/json"?S=yield y.json():x==="application/octet-stream"||x==="application/pdf"?S=yield y.blob():x==="text/event-stream"?S=y:x==="multipart/form-data"?S=yield y.formData():S=yield y.text(),{data:S,error:null,response:y}}catch(a){return{data:null,error:a,response:a instanceof P1||a instanceof T1?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const PN=3,A1=e=>Math.min(1e3*2**e,3e4),X4=[520,503],AN=["GET","HEAD","OPTIONS"];var Q4=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function R1(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const r=setTimeout(()=>{t==null||t.removeEventListener("abort",s),n()},e);function s(){clearTimeout(r),n()}t==null||t.addEventListener("abort",s)})}function Z4(e,t,n,r){return!(!r||n>=PN||!AN.includes(e)||!X4.includes(t))}var e3=class{constructor(e){var t,n,r,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=e.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=e.retry)!==null&&i!==void 0?i:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let i=(async()=>{let o=0;for(;;){const u=new Headers(n.headers);o>0&&u.set("X-Retry-Count",String(o));let d;try{d=await r(n.url.toString(),{method:n.method,headers:u,body:JSON.stringify(n.body,(f,h)=>typeof h=="bigint"?h.toString():h),signal:n.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!AN.includes(n.method))throw f;if(n.retryEnabled&&o<PN){const h=A1(o);o++,await R1(h,n.signal);continue}throw f}if(Z4(n.method,d.status,o,n.retryEnabled)){var a,c;const f=(a=(c=d.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&a!==void 0?a:null,h=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:A1(o);await d.text(),o++,await R1(h,n.signal);continue}return await n.processResponse(d)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var a;let c="",u="",d="";const f=o==null?void 0:o.cause;if(f){var h,p,g,v;const w=(h=f==null?void 0:f.message)!==null&&h!==void 0?h:"",x=(p=f==null?void 0:f.code)!==null&&p!==void 0?p:"";c=`${(g=o==null?void 0:o.name)!==null&&g!==void 0?g:"FetchError"}: ${o==null?void 0:o.message}`,c+=`
533
534Caused by: ${(v=f==null?void 0:f.name)!==null&&v!==void 0?v:"Error"}: ${w}`,x&&(c+=` (${x})`),f!=null&&f.stack&&(c+=`
535${f.stack}`)}else{var b;c=(b=o==null?void 0:o.stack)!==null&&b!==void 0?b:""}const y=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",y>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${y} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",y>this.urlLengthLimit&&(u+=`. Your request URL is ${y} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:c,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
535)),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,s=null,i=e.status,o=e.statusText;if(e.ok){var a,c;if(t.method!=="HEAD"){var u;const h=await e.text();h===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((u=t.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?r=h:r=JSON.parse(h))}const d=(a=t.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),f=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");d&&f&&f.length>1&&(s=parseInt(f[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,i=406,o="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const d=await e.text();try{n=JSON.parse(d),Array.isArray(n)&&e.status===404&&(r=[],n=null,i=200,o="OK")}catch{e.status===404&&d===""?(i=204,o="No Content"):n={message:d}}if(n&&t.shouldThrowOnError)throw new Q4(n)}return{success:n===null,error:n,data:r,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},t3=class extends e3{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:i="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const M1=new RegExp("[,()]");var Qo=class extends t3{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&M1.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&M1.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const i=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>
535n!==void 0).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},n3=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=n?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:a,headers:c}=this.cloneRequestState();return a.searchParams.set("select",o),r&&c.append("Prefer",`count=${r}`),new Qo({method:s,url:a,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),n||o.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(a.length>
5350){const c=[...new Set(a)].map(u=>`"${u}"`);i.searchParams.set("columns",c.join(","))}}return new Qo({method:s,url:i,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var i;const o="POST",{url:a,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&a.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);a.searchParams.set("columns",d.join(","))}}return new Qo({method:o,url:a,headers:c,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const r="PATCH",{url:s,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new Qo({method:r,url:s,headers:i,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Qo({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Yc(e){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}
535,Yc(e)}function r3(e,t){if(Yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function s3(e){var t=r3(e,"string");return Yc(t)=="symbol"?t:t+""}function i3(e,t,n){return(t=s3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ud(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I1(Object(n),!0).forEach(function(r){i3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var o3=class RN{constructor(t,{headers:n={},schema:r,fetch:s,timeout:i,urlLengthLimit:o=8e3,retry:a}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=o;const c=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(u,d)=>{const f=new AbortController,h=setTimeout(()=>f.abort(),i),p=d==null?void 0:d.signal;if(p){if(p.aborted)return clearTimeout(h),c(u,d);const g=()=>{clearTimeout(h),f.abort()};return p.addEventListener("abort",g,{once:!0}),c(u,ud(ud({},d),{},{signal:f.signal})).finally(()=>{clearTimeout(h),p.removeEventListener("abort",g)})}return c(u,ud(ud({},d),{},{signal:f.signal})).finally(()=>clearTimeout(h))}:this.fetch=c,this.retry=a}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new n3(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new RN(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:r=!1,get:s=!1,count:i}={}){var o;let a;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),f=r&&Object.values(n).some(d);f?(a="POST",u=n):r||s?(a=r?"HEAD":"GET",Object.entries(n).filter(([p,g])=>g!==void 0).map(([p,g])=>[p,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([p,g])=>{c.searchParams.append(p,g)})):(a="POST",u=n);const h=new Headers(this.headers);return f?h.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&h.set("Prefer",`count=${i}`),new Qo({method:a,url:c,headers:h,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class a3{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const s=r.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
536import ws from "ws"
537new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
538
539Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const l3="2.104.1",c3=`realtime-js/${l3}`,u3="1.0.0",MN="2.0.0",d3=MN,f3=1e4,h3=100,ti={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},IN={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},_y={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class p3{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,r){var s,i;const o=t.topic,a=(s=t.ref)!==null&&s!==void 0?s:"",c=(i=t.join_ref)!==null&&i!==void 0?i:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+a.length+o.length+u.length+f.length,p=new ArrayBuffer(this.HEADER_LENGTH+h);let g=new DataView(p),v=0;g.setUint8(v++,this.KINDS.userBroadcastPush),g.setUint8(v++,c.length),g.setUint8(v++,a.length),g.setUint8(v++,o.length),g.setUint8(v++,u.length),g.setUint8(v++,f.length),g.setUint8(v++,n),Array.from(c,y=>
539g.setUint8(v++,y.charCodeAt(0))),Array.from(a,y=>g.setUint8(v++,y.charCodeAt(0))),Array.from(o,y=>g.setUint8(v++,y.charCodeAt(0))),Array.from(u,y=>g.setUint8(v++,y.charCodeAt(0))),Array.from(f,y=>g.setUint8(v++,y.charCodeAt(0)));var b=new Uint8Array(p.byteLength+r.byteLength);return b.set(new Uint8Array(p),0),b.set(new Uint8Array(r),p.byteLength),b.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,i,o,a,c]=r;return n({join_ref:s,ref:i,topic:o,event:a,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,s)}}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),a=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+s));c=c+s;const d=r.decode(t.slice(c,c+i));c=c+i;const f=r.decode(t.slice(c,c+o));c=c+o;const h=t.slice(c,t.byteLength),p=a===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,g={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(g.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}var st;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(st||(st={}));const O1=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=m3(o,e,t,s),i),{}):{}},m3=(e,t,n,r)=>{const s=t.find(a=>a.name===e),i=s==null?void 0:s.type,o=n[e];return i&&!r.includes(i)?ON(i,o):Cy(o)},ON=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return x3(t,n)}switch(e){case st.bool:return g3(t);case st.float4:case st.float8:case st.int2:case st.int4:case st.int8:case st.numeric:case st.oid:return y3(t);case st.json:case st.jsonb:return v3(t);case st.timestamp:return w3(t);case st.abstime:case st.date:case st.daterange:case st.int4range:case st.int8range:case st.money:case st.reltime:case st.text:case st.time:case st.timestamptz:case st.timetz:case st.tsrange:case st.tstzrange:return Cy(t);default:return Cy(t)}},Cy=e=>e,g3=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},y3=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},v3=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},x3=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>ON(t,a))}return e},w3=e=>typeof e=="string"?e.replace(" ","T"):e,DN=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var yc=e=>typeof e=="function"?e:function(){return e},b3=typeof self<"u"?self:null,Zo=typeof window<"u"?window:null,Ur=b3||Zo||globalThis,S3="2.0.0",k3=1e4,_3=1e3,Wr={connecting:0,open:1,closing:2,closed:3},Sn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},ds={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},jy={longpoll:"longpoll",websocket:"websocket"},C3={complete:4},Ey="base64url.bearer.phx.",dd=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHo
vendor: 21,658 bytes, lines 539-540
539oks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},LN=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},j3=class{constructor(e,t,n){this.state=Sn.closed,this.topic=e,this.params=yc(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new dd(this,ds.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new LN(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Sn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=Sn.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Sn.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=Sn.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new dd(this,ds.leave,yc({}),this.timeout).send(),this.state=Sn.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(ds.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Sn.closed,this.bindings=[]}onClose(e){this.on(ds.close,e)}onError(e){return this.on(ds.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new dd(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Sn.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ds.close,"leave")},n=new dd(this,ds.leave,yc({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic!==e?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Sn.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let s=this.onMessage(e,t,n,r);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,n));for(let o=0;o<i.length;o++)i[o].callback(s,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Sn.closed}isErrored(){return this.state===Sn.errored}isJoined(){return this.state===Sn.joined}isJoining(){return this.state===Sn.joining}isLeaving(){return this.state===Sn.leaving}},Jf=class{static request(e,t,n,r,s,i,o){if(Ur.XDomainRequest){let a=new Ur.XDomainRequest;return this.xdomainRequest(a,e,t,r,s,i,o)}else if(Ur.XMLHttpRequest){let a=new Ur.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,s,i,o)}else{if(Ur.fetch&&Ur.AbortController)return this.fetchRequest(e,t,n,r,s,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,r,s,i,o){let a={method:e,headers:n,body:r},c=null;return s&&(c=new AbortController,setTimeout(()=>c.abort(),s),a.signal=c.signal),Ur.fetch(t,a).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),c}static xdomainRequest(e,t,n,r,s,i,o){return e.timeout=s,e.open(t,n),e.onload=()=>{let a=this.parseJSON(e.responseText);o&&o(a)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,s,i,o,a){e.open(t,n,!0),e.timeout=i;for(let[c,u]of Object.entries(r))e.setRequestHeader(c,u);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===C3.complete&&a){let c=this.parseJSON(e.responseText);a(c)}},o&&(e.ontimeout=o),e.send(s),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let s=t?`${t}[${r}]`:r,i=e[r];typeof i=="object"?n.push(this.serialize(i,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},E3=e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let s=0;s<r;s++)t+=String.fromCharCode(n[s]);return btoa(t)},Lo=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Ey)&&(this.authToken=atob(t[1].slice(Ey.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Wr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+jy.websocket),"$1/"+jy.longpoll)}endpointURL(){return Jf.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=Wr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Wr.open||this.readyState===Wr.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:r,messages:s}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Wr.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(e){typeof e!="string"&&(e=E3(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
540`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let s of this.reqs)s.abort();this.readyState=Wr.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,s){let i,o=()=>{this.reqs.delete(i),r()};i=Jf.request(e,this.endpointURL(),t,n,this.timeout,o,a=>{this.reqs.delete(i),this.isActive()&&s(a)}),this.reqs.add(i)}},N3=class Xl{constructor(t,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Xl.syncState(this.state,s,i,o),this.pendingDiffs.forEach(c=>{this.state=Xl.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],a()}),this.channel.on(r.diff,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Xl.syncDiff(this.state,s,i,o),a())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Xl.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,r,s){let i=this.clone(t),o={},a={};return this.map(i,(c,u)=>{n[c]||(a[c]=u)}),this.map(n,(c,u)=>{let d=i[c];if(d){let f=u.metas.map(v=>v.phx_ref),h=d.metas.map(v=>v.phx_ref),p=u.metas.filter(v=>h.indexOf(v.phx_ref)<0),g=d.metas.filter(v=>f.indexOf(v.phx_ref)<0);p.length>0&&(o[c]=u,o[c].metas=p),g.length>0&&(a[c]=this.clone(d),a[c].metas=g)}else o[c]=u}),this.syncDiff(i,{joins:o,leaves:a},r,s)}static syncDiff(t,n,r,s){let{joins:i,leaves:o}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(i,(a,c)=>{let u=t[a];if(t[a]=this.clone(c),u){let d=t[a].metas.map(h=>h.phx_ref),f=u.metas.filter(h=>d.indexOf(h.phx_ref)<0);t[a].metas.unshift(...f)}r(a,u,c)}),this.map(o,(a,c)=>{let u=t[a];if(!u)return;let d=c.metas.map(f=>f.phx_ref);u.metas=u.metas.filter(f=>d.indexOf(f.phx_ref)<0),s(a,u,c),u.metas.length===0&&delete t[a]}),t}static list(t,n){return n||(n=function(r,s){return s}),this.map(t,(r,s)=>n(r,s))}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},fd={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,s,i,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:i,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:s,payload:i}=e,o=this.META_LENGTH+t.length+n.length+s.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(a),u=0;c.setUint8(u++,this.KINDS.push),c.setUint8(u++,t.length),c.setUint8(u++,n.length),c.setUint8(u++,s.length),c.setUint8(u++,r.length),Array.from(t,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(n,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(s,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(r,f=>c.setUint8(u++,f.charCodeAt(0)));var d=new Uint8Array(a.byteLength+i.byteLength);return d.set(new Uint8Array(a),0),d.set(new Uint8Array(i),a.byteLength),d.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(o,o+r));o=o+r;let c=n.decode(e.slice(o,o+s));o=o+s;let u=n.decode(e.slice(o,o+i));o=o+i;let d=e.slice(o,e.byteLength);return{join_ref:a,ref:null,topic:c,event:u,payload:d}},decodeReply(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(a,a+r));a=a+r;let u=n.decode(e.slice(a,a+s));a=a+s;let d=n.decode(e.slice(a,a+i));a=a+i;let f=n.decode(e.slice(a,a+o));a=a+o;let h=e.slice(a,e.byteLength),p={status:f,response:h};return{join_ref:c,ref:u,topic:d,event:ds.reply,payload:p}},decodeBroadcast(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),i=this.HEADER_LENGTH+2,o=n.decode(e.slice(i,i+r));i=i+r;let a=n.decode(e.slice(i,i+s));i=i+s;let c=e.slice(i,e.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:c}}},T3=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||k3,this.transport=t.transport||Ur.WebSocket||Lo,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||Ur&&Ur.sessionStorage,this.establishedConnections=0,this.defaultEncoder=fd.encode.bind(fd),this.defaultDecoder=fd.decode.bind(fd),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Lo?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Zo&&Zo.addEventListener&&(Zo.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Zo.addEventListener("pageshow",r=>{n===this.connectClock&&(n=null,this.connect())}),Zo.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=r=>t.rejoinAfterMs?t.rejoinAfterMs(r):[1e3,2e3,5e3][r-1]||1e4,this.reconnectAfterMs=r=>t.reconnectAfterMs?t.reconnectAfterMs(r):[10,50,100,150,200,250,500,1e3,2e3][r-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(r,s,i)=>{console.log(`${r}: ${s}`,i)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=yc(t.params||{}),this.endPoint=`${e}/${jy.websocket}`,this.vsn=t.vsn||S3,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new LN(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Lo}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Jf.appendParams(Jf.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=yc(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Lo?this.connectWithFallback(Lo,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(s=>{s.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Lo:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Ey}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,s,i,o=this.transportName(e),a=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([s,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),i=this.onError(c=>{this.log("transport","error",c),r&&!n&&(clearTimeout(this.fallbackTimer),a(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),_3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===Wr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError()}
540triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(ds.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Wr.connecting:return"connecting";case Wr.open:return"open";case Wr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new j3(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:s,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${s})`,r)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:n,event:r,payload:s,ref:i,join_ref:o}=t;if(i&&i===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",a)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${n} ${r} ${i&&"("+i+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const c=this.channels[a];c.isMember(n,r,s,o)&&c.trigger(r,s,i,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class vc{constructor(t,n){const r=A3(n);this.presence=new N3(t.getChannel(),r),this.presence.onJoin((s,i,o)=>{const a=vc.onJoinPayload(s,i,o);t.getChannel().trigger("presence",a)}),this.presence.onLeave((s,i,o)=>{const a=vc.onLeavePayload(s,i,o);t.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return vc.transformState(this.presence.state)}static transformState(t){return t=P3(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return n[r]=ef(s),n},{})}static onJoinPayload(t,n,r){const s=D1(n),i=ef(r);return{event:"join",key:t,currentPresences:s,newPresences:i}}static onLeavePayload(t,n,r){const s=D1(n),i=ef(r);return{event:"leave",key:t,currentPresences:s,leftPresences:i}}}function ef(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function P3(e){return JSON.parse(JSON.stringify(e))}function A3(e){return(e==null?void 0:e.events)&&{events:e.events}}function D1(e){return e!=null&&e.metas?ef(e):[]}var L1;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(L1||(L1={}));class R3{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new vc(this.channel.channelAdapter,n)}}class M3{constructor(t,n,r){const s=I3(r);this.channel=t.getSocket().channel(n,s),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,n){return this.channel.on(t,n)}off(t,n){this.channel.off(t,n)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,n,r){let s;try{s=this.channel.push(t,n,r)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>h3){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(t){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),t)}canPush(){return this.socket.isConnected()&&this.state===ti.joined}isJoined(){return this.state===ti.joined}isJoining(){return this.state===ti.joining}isClosed(){return this.state===ti.closed}isLeaving(){return this.state===ti.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function I3(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var $1;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})($1||($1={}));var ma;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ma||(ma={}));var fs;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(fs||(fs={}));class xc{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,n={config:{}},r){var s,i;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new M3(this.socket.socketAdapter,t,this.params),this.presence=new R3(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=DN(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,n=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:a,private:c}}=this.params,u=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[ma.PRESENCE]&&this.bindings[ma.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},h={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(p=>{t==null||t(fs.CHANNEL_ERROR,p)}),this._onClose(()=>t==null?void 0:t(fs.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(fs.SUBSCRIBED);return}this._updatePostgresBindings(p,t)}
540).receive("error",p=>{this.state=ti.errored,t==null||t(fs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(fs.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var r;const s=this.bindings.postgres_changes,i=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,o=[];for(let a=0;a<i;a++){const c=s[a],{filter:{event:u,schema:d,table:f,filter:h}}=c,p=t&&t[a];if(p&&p.event===u&&xc.isFilterValueEqual(p.schema,d)&&xc.isFilterValueEqual(p.table,f)&&xc.isFilterValueEqual(p.filter,h))o.push(Object.assign(Object.assign({},c),{id:p.id}));else{this.unsubscribe(),this.state=ti.errored,n==null||n(fs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=ti.errored&&n&&n(fs.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=t===ma.PRESENCE||t===ma.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,n,r)}async httpSend(t,n,r={}){var s;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let c=a.statusText;try{const u=await a.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var r,s;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
540in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=t,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,c;const u=this.channelAdapter.push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,n,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),o}_on(t,n,r){const s=t.toLocaleLowerCase(),i=this.channelAdapter.on(t,r),o={type:s,filter:n,callback:r,ref:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,r)=>{var s,i,o,a,c,u,d;const f=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,r))return!1;const h=(s=this.bindings[f])===null||s===void 0?void 0:s.find(p=>p.ref===t.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in h){const p=h.id,g=(i=h.filter)===null||i===void 0?void 0:i.event;return p&&((o=n.ids)===null||o===void 0?void 0:o.includes(p))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((a=n.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const p=(u=(c=h==null?void 0:h.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p==="*"||p===((d=n==null?void 0:n.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===f})}_notThisChannelEvent(t,n){const{close:r,error:s,leave:i,join:o}=IN;return n&&[r,s,i,o].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:i,table:o,commit_timestamp:a,type:c,errors:u}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:a,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const r of t.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=O1(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=O1(t.columns,t.old_record)),n}}class O3{constructor(t,n){this.socket=new T3(t,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,n,r,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{t(),i("ok")},n,r)})}push(t){this.socket.push(t)}log(t,n,r){this.socket.log(t,n,r)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==_y.connecting}isDisconnecting(){return this.socket.connectionState()==_y.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const D3={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},L3=[1e3,2e3,5e3,1e4],$3=1e4,F3=`
541  addEventListener("message", (e) => {
542    if (e.data.event === "start") {
543      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
544    }
545  });`;class z3{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
545,this.ref=0,this.serializer=new p3,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const s=this._initializeOptions(n);this.socketAdapter=new O3(t,s),this.httpEndpoint=DN(t),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const n=t.message;throw n.includes("Node.js")?new Error(`${n}
546
547To use Realtime in Node.js, you need to provide a WebSocket implementation:
548
549Option 1: Use Node.js 22+ which has native WebSocket support
550Option 2: Install and provide the "ws" package:
551
552  npm install ws
553
554  import ws from "ws"
555  const client = new RealtimeClient(url, {
556    ...options,
557    transport: ws
558  })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,n)}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return n==="ok"&&t.teardown(),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(t);return this.disconnect(),n}log(t,n,r){this.socketAdapter.log(t,n,r)}connectionState(){return this.socketAdapter.connectionState()||_y.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new xc(`realtime:${t}`,n,this);return this.channels.push(i),i}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const i={access_token:n,version:c3};n&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(IN.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(n,r)=>{n=="sent"&&this._setAuthSafely(),t&&t(n,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([F3],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(t){var n,r,s,i,o,a,c,u,d;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=t==null?void 0:t.accessToken)!==null&&r!==void 0?r:null;const f={};
558f.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:f3,f.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:D3.HEARTBEAT_INTERVAL,f.transport=(o=t==null?void 0:t.transport)!==null&&o!==void 0?o:a3.getWebSocketConstructor(),f.params=t==null?void 0:t.params,f.logger=t==null?void 0:t.logger,f.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),f.reconnectAfterMs=(a=t==null?void 0:t.reconnectAfterMs)!==null&&a!==void 0?a:v=>L3[v-1]||$3;let h,p;const g=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:d3;switch(g){case u3:h=(v,b)=>b(JSON.stringify(v)),p=(v,b)=>b(JSON.parse(v));break;case MN:h=this.serializer.encode.bind(this.serializer),p=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${f.vsn}`)}if(f.vsn=g,f.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:h,f.decode=(d=t==null?void 0:t.decode)!==null&&d!==void 0?d:p,f.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,f.params=Object.assign(Object.assign({},f.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,f.autoSendHeartbeat=!this.worker}return f}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Jc=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function B3(e,t,n){const r=new URL(t,e);if(n)for(const[s,i]of Object.entries(n))i!==void 0&&r.searchParams.set(s,i);return r.toString()}async function V3(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function U3(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=B3(e.baseUrl,r,s),c=await V3(e.auth),u=await t(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),h=f&&d?JSON.parse(d):d;if(!u.ok){const p=f?h:void 0,g=p==null?void 0:p.error;throw new Jc((g==null?void 0:g.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:p})}return{status:u.status,headers:u.headers,data:h}}}}function hd(e){return e.join("�")}var H3=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:hd(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${hd(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${hd(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${hd(e.namespace)}`}),!0}catch(t){if(t instanceof Jc&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Jc&&n.status===409)return;throw n}}};function $o(e){return e.join("�")}var W3=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${$o(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${$o(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${$o(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${$o(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${$o(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${$o(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Jc&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Jc&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},q3=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=U3({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new H3(this.client,t),this.tableOps=new W3(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
558async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function Xc(e){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xc(e)}function G3(e,t){if(Xc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K3(e){var t=G3(e,"string");return Xc(t)=="symbol"?t:t+""}function Y3(e,t,n){return(t=K3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F1(Object(n),!0).forEach(function(r){Y3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var qh=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Gh(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Ny=class extends qh{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return Oe({},super.toJSON())}},$N=class extends qh{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function Wx(e,t,n){const r=Oe({},e),s=t.toLowerCase();for(const i of Object.keys(r))i.toLowerCase()===s&&delete r[i];return r[s]=n,r}function J3(e){const t={};for(const[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}const X3=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Q3=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ty=e=>{if(Array.isArray(e))return e.map(n=>Ty(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[s]=Ty(r)}),t},Z3=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),z1=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},e$=async(e,t,n,r)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const s=e;let i=parseInt(s.status,10);Number.isFinite(i)||(i=500),s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";t(new Ny(z1(o),i,a,r))}).catch(()=>{const o=i+"";t(new Ny(s.statusText||`HTTP ${i} error`,i,o,r))})}else t(new $N(z1(e),e,r))},t$=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!r)return Oe(Oe({},s),n);if(Q3(r)){var i;const o=(t==null?void 0:t.headers)||{};let a;for(const[c,u]of Object.entries(o))c.toLowerCase()==="content-type"&&(a=u);s.headers=Wx(o,"Content-Type",(i=a)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(r)}else s.body=r;return t!=null&&t.duplex&&(s.duplex=t.duplex),Oe(Oe({},s),n)};async function Tl(e,t,n,r,s,i,o){return new Promise((a,c)=>{e(n,t$(t,r,s,i)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>a(u)).catch(u=>e$(u,c,r,o))})}function FN(e="storage"){return{get:async(t,n,r,s)=>Tl(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,i)=>Tl(t,"POST",n,s,i,r,e),put:async(t,n,r,s,i)=>Tl(t,"PUT",n,s,i,r,e),head:async(t,n,r,s)=>Tl(t,"HEAD",n,Oe(Oe({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,i)=>Tl(t,"DELETE",n,s,i,r,e)}}const n$=FN("storage"),{get:Qc,post:kr,put:Py,head:r$,remove:qx}
558=n$,Gn=FN("vectors");var cl=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=J3(t),this.fetch=X3(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Wx(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Gh(n))return{data:null,error:n};throw n}}},s$=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Gh(t))return{data:null,error:t};throw t}}};let zN;zN=Symbol.toStringTag;var i$=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[zN]="BlobDownloadBuilder",this.promise=null}asStream(){return new s$(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Gh(t))return{data:null,error:t};throw t}}};const o$={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},B1={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var a$=class extends cl{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let i;const o=Oe(Oe({},B1),r);let a=Oe(Oe({},s.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;if(typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",s.encodeMetadata(c)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(c))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers)for(const[h,p]of Object.entries(r.headers))a=Wx(a,h,p);const u=s._removeEmptyFolders(t),d=s._getFinalPath(u),f=await(e=="PUT"?Py:kr)(s.fetch,`${s.url}/object/${d}`,i,Oe({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:f.Id,fullPath:f.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const i=s._removeEmptyFolders(e),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",t),s.handleOperation(async()=>{let c;const u=Oe(Oe({},B1),r),d=Oe(Oe({},s.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",u.cacheControl)):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:i,fullPath:(await Py(s.fetch,a.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=Oe({},n.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const i=await kr(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+i.url),a=o.searchParams.get("token");if(!a)throw new qh("No token returned by API");return{signedUrl:o.toString(),path:e,token:a}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await kr(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
558stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await kr(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e);const i=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let o=await kr(r.fetch,`${r.url}/object/sign/${s}`,Oe({expiresIn:t},i?{transform:n.transform}:{}),{headers:r.headers});const a=new URLSearchParams;n!=null&&n.download&&a.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&a.set("cacheNonce",String(n.cacheNonce));const c=a.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await kr(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),i=new URLSearchParams;n!=null&&n.download&&i.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&i.set("cacheNonce",String(n.cacheNonce));const o=i.toString();return s.map(a=>Oe(Oe({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const i=s.toString(),o=this._getFinalPath(e),a=()=>Qc(this.fetch,`${this.url}/${r}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new i$(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>Ty(await Qc(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await r$(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(Gh(s)){var r;const i=s instanceof Ny?s.status:s instanceof $N?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=new URLSearchParams;t!=null&&t.download&&r.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(r,t.transform),(t==null?void 0:t.cacheNonce)!=null&&r.set("cacheNonce",String(t.cacheNonce));const s=r.toString(),i=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await qx(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=Oe(Oe(Oe({},o$),t),{},{prefix:e||""});return await kr(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=Oe({},e);return await kr(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const l$="2.104.1",Su={"X-Client-Info":`storage-js/${l$}`};var c$=class extends cl{constructor(e,t={},n,r){const s=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=Oe(Oe({},Su),t);super(i,o,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await Qc(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Qc(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await kr(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Py(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await kr(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await qx(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},u$=class extends cl{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Oe(Oe({},Su),t);super(r,s,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await kr(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Qc(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await qx(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;
558if(!Z3(e))throw new qh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new q3({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},d$=class extends cl{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Oe(Oe({},Su),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Gn.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Gn.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},f$=class extends cl{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Oe(Oe({},Su),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},h$=class extends cl{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Oe(Oe({},Su),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Gn.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},p$=class extends h${constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new m$(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},m$=class extends d${constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,Oe(Oe({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,Oe(Oe({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new g$(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}
558,g$=class extends f${constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,Oe(Oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,Oe(Oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,Oe(Oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,Oe(Oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,Oe(Oe({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},y$=class extends c${constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new a$(this.url,this.headers,e,this.fetch)}get vectors(){return new p$(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new u$(this.url+"/iceberg",this.headers,this.fetch)}};function Kh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}const BN="2.104.1",ea=30*1e3,Ay=3,fm=Ay*ea,v$="http://localhost:9999",x$="supabase.auth.token",w$={"X-Client-Info":`gotrue-js/${BN}`},Ry="X-Supabase-Api-Version",VN={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},b$=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,S$=10*60*1e3;
558class Zc extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function _e(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class k$ extends Zc{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function _$(e){return _e(e)&&e.name==="AuthApiError"}class Qi extends Zc{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class zs extends Zc{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class Bn extends zs{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function pd(e){return _e(e)&&e.name==="AuthSessionMissingError"}class Fo extends zs{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class md extends zs{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class gd extends zs{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function C$(e){return _e(e)&&e.name==="AuthImplicitGrantRedirectError"}class V1 extends zs{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class j$ extends zs{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class My extends zs{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function hm(e){return _e(e)&&e.name==="AuthRetryableFetchError"}class U1 extends zs{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Iy extends zs{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Xf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),H1=` 	
559\r=`.split(""),E$=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<H1.length;t+=1)e[H1[t].charCodeAt(0)]=-2;for(let t=0;t<Xf.length;t+=1)e[Xf[t].charCodeAt(0)]=t;return e})();function W1(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Xf[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Xf[r]),t.queuedBits-=6}}function UN(e,t,n){const r=E$[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function q1(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{P$(o,r,n)};for(let o=0;o<e.length;o+=1)UN(e.charCodeAt(o),s,i);return t.join("")}function N$(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function T$(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}N$(r,t)}}function P$(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Ta(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)UN(e.charCodeAt(s),n,r);return new Uint8Array(t)}function A$(e){const t=[];return T$(e,n=>t.push(n)),new Uint8Array(t)}function ro(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>W1(s,n,r)),W1(null,n,r),t.join("")}function R$(e){return Math.round(Date.now()/1e3)+e}function M$(){return Symbol("auth-callback")}const Qt=()=>typeof window<"u"&&typeof document<"u",zi={tested:!1,writable:!1},HN=()=>
559{if(!Qt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(zi.tested)return zi.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),zi.tested=!0,zi.writable=!0}catch{zi.tested=!0,zi.writable=!1}return zi.writable};function I$(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,i)=>{t[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const WN=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),O$=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",ta=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Bi=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Xt=async(e,t)=>{await e.removeItem(t)};class Yh{constructor(){this.promise=new Yh.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Yh.promiseConstructor=Promise;function yd(e){const t=e.split(".");if(t.length!==3)throw new Iy("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!b$.test(t[r]))throw new Iy("JWT not in base64url format");return{header:JSON.parse(q1(t[0])),payload:JSON.parse(q1(t[1])),signature:Ta(t[2]),raw:{header:t[0],payload:t[1]}}}async function D$(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function L$(e,t){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){r(o);return}}catch(o){if(!t(i,o)){s(o);return}}})()})}function $$(e){return("0"+e.toString(16)).substr(-2)}function F$(){const t=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(t),Array.from(t,$$).join("")}async function z$(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function B$(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await z$(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function zo(e,t,n=!1){const r=F$();let s=r;n&&(s+="/recovery"),await ta(e,`${t}-code-verifier`,s);const i=await B$(r);return[i,r===i?"plain":"s256"]}const V$=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function U$(e){const t=e.headers.get(Ry);if(!t||!t.match(V$))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function H$(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function W$(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const q$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Bo(e){if(!q$.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function pm(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function G$(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;
559if(typeof r=="symbol"){const i=r.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,s)}})}function G1(e){return JSON.parse(JSON.stringify(e))}const Ki=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),K$=[502,503,504,520,521,522,523,524,530];async function K1(e){var t;if(!O$(e))throw new My(Ki(e),0);if(K$.includes(e.status))throw new My(Ki(e),e.status);let n;try{n=await e.json()}catch(i){throw new Qi(Ki(i),i)}let r;const s=U$(e);if(s&&s.getTime()>=VN["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 U1(Ki(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Bn}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 U1(Ki(n),e.status,n.weak_password.reasons);throw new k$(Ki(n),e.status||500,r)}const Y$=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function Pe(e,t,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[Ry]||(i[Ry]=VN["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await J$(e,t,n+a,{headers:i,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function J$(e,t,n,r,s,i){const o=Y$(t,r,s,i);let a;try{a=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new My(Ki(c),0)}if(a.ok||await K1(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(c){await K1(c)}}function wr(e){var t;let n=null;Z$(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=R$(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function Y1(e){const t=wr(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ni(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function X$(e){return{data:e,error:null}}function Q$(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=e,o=Kh(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},c=Object.assign({},o);return{data:{properties:a,user:c},error:null}}function J1(e){return e}function Z$(e){return e.access_token&&e.refresh_token&&e.expires_in}const mm=["global","local","others"];class eF{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=WN(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(t,n=mm[0]){if(mm.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${mm.join(", ")}`);try{return await Pe(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(_e(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Pe(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:ni})}catch(r){if(_e(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=Kh(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Pe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:Q$,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(_e(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Pe(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ni})}catch(n){if(_e(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,i,o,a,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Pe(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:J1});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return p.length>
5590&&(p.forEach(g=>{const v=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(g.split(";")[1].split("=")[1]);u[`${b}Page`]=v}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(_e(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Bo(t);try{return await Pe(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ni})}catch(n){if(_e(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Bo(t);try{return await Pe(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:ni})}catch(r){if(_e(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){Bo(t);try{return await Pe(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:ni})}catch(r){if(_e(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){Bo(t.userId);try{const{data:n,error:r}=await Pe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Bo(t.userId),Bo(t.id);try{return{data:await Pe(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,i,o,a,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Pe(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:J1});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(g=>{const v=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(g.split(";")[1].split("=")[1]);u[`${b}Page`]=v}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(_e(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await Pe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await Pe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await Pe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(_e(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Pe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await Pe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await Pe(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(_e(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await Pe(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await Pe(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await Pe(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(_e(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{return await Pe(this.fetch,"DELET
559E",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(_e(n))return{data:null,error:n};throw n}}}function X1(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const zr={debug:!!(globalThis&&HN()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class qN extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class Q1 extends qN{}async function tF(e,t,n){zr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;let s;t>0&&(s=setTimeout(()=>{r.abort(),zr.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){clearTimeout(s),zr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{zr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw zr.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Q1(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(zr.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null,"  "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}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"),clearTimeout(s),await n()}})}catch(i){if(t>0&&clearTimeout(s),(i==null?void 0:i.name)==="AbortError"&&t>0){if(r.signal.aborted)return zr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async o=>{if(o){zr.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await n()}finally{zr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw zr.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new Q1(`Lock "${e}" was released because another request stole it`)}throw i}}function nF(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function GN(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function rF(e){return parseInt(e,16)}function sF(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function iF(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:c,resources:u,scheme:d,uri:f,version:h}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);
559if(!((t=e.statement)===null||t===void 0)&&t.includes(`
560`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=GN(e.address),g=d?`${d}://${r}`:r,v=e.statement?`${e.statement}
561`:"",b=`${g} wants you to sign in with your Ethereum account:
562${p}
563
564${v}`;let y=`URI: ${f}
565Version: ${h}
566Chain ID: ${n}${o?`
567Nonce: ${o}`:""}
568Issued At: ${i.toISOString()}`;if(s&&(y+=`
569Expiration Time: ${s.toISOString()}`),a&&(y+=`
570Not Before: ${a.toISOString()}`),c&&(y+=`
571Request ID: ${c}`),u){let w=`
572Resources:`;for(const x of u){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);w+=`
573- ${x}`}y+=w}return`${b}
574${y}`}class Lt extends Error{constructor({message:t,code:n,cause:r,name:s}){var i;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=s??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class Qf extends Lt{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function oF({error:e,options:t}){var n,r,s;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Lt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Lt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Lt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Lt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Lt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Lt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new Lt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Lt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(KN(o)){if(i.rp.id!==o)return new Lt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Lt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Lt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Lt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Lt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function aF({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Lt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Lt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(KN(r)){if(n.rpId!==r)return new Lt({message:`The RP ID "${n.rpId}
574" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Lt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Lt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Lt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class lF{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const cF=new lF;function uF(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=Kh(e,["challenge","user","excludeCredentials"]),i=Ta(t).buffer,o=Object.assign(Object.assign({},n),{id:Ta(n.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];a.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Ta(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function dF(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=Kh(e,["challenge","allowCredentials"]),s=Ta(t).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const a=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},a),{id:Ta(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function fF(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:ro(new Uint8Array(e.response.attestationObject)),clientDataJSON:ro(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function hF(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:ro(new Uint8Array(s.authenticatorData)),clientDataJSON:ro(new Uint8Array(s.clientDataJSON)),signature:ro(new Uint8Array(s.signature)),userHandle:s.userHandle?ro(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function KN(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Z1(){var e,t;return!!(Qt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function pF(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Qf("Browser returned unexpected credential type",t)}:{data:null,error:new Qf("Empty credential response",t)}}catch(t){return{data:null,error:oF({error:t,options:e})}}}async function mF(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Qf("Browser returned unexpected credential type",t)}:{data:null,error:new Qf("Empty credential response",t)}}
574catch(t){return{data:null,error:aF({error:t,options:e})}}}const gF={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},yF={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Zf(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))r[i]=o;else if(n(o))r[i]=o;else if(t(o)){const a=r[i];t(a)?r[i]=Zf(a,o):r[i]=Zf(o)}else r[i]=o}return r}function vF(e,t){return Zf(gF,e,t||{})}function xF(e,t){return Zf(yF,e,t||{})}class wF{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:s},i){var o;try{const{data:a,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!a)return{data:null,error:c};const u=s??cF.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:d}=a.webauthn.credential_options.publicKey;if(!d.name){const f=r;if(f)d.name=`${d.id}:${f}`;else{const p=(await this.client.getUser()).data.user,g=((o=p==null?void 0:p.user_metadata)===null||o===void 0?void 0:o.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${g}`}}d.displayName||(d.displayName=d.name)}switch(a.webauthn.type){case"create":{const d=vF(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:f,error:h}=await pF({publicKey:d,signal:u});return f?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}case"request":{const d=xF(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:f,error:h}=await mF(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:d,signal:u}));return f?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}}}catch(a){return _e(a)?{data:null,error:a}:{data:null,error:new Qi("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new Zc("rpId is required for WebAuthn authentication")};try{if(!Z1())return{data:null,error:new Qi("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:i});if(!o)return{data:null,error:a};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(o){return _e(o)?{data:null,error:o}:{data:null,error:new Qi("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new Zc("rpId is required for WebAuthn registration")};try{if(!Z1())return{data:null,error:new Qi("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:a};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:i});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return _e(o)?{data:null,error:o}:{data:null,error:new Qi("Unexpected error in register",o)}}}}nF();const bF={url:v$,storageKey:x$,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:w$,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};
574async function eS(e,t,n){return await n()}const Vo={};class eu{get jwks(){var t,n;return(n=(t=Vo[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Vo[this.storageKey]=Object.assign(Object.assign({},Vo[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Vo[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Vo[this.storageKey]=Object.assign(Object.assign({},Vo[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},bF),t);if(this.storageKey=i.storageKey,this.instanceID=(n=eu.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,eu.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&Qt()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new eF({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=WN(i.fetch),this.lock=i.lock||eS,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&Qt()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=tF:this.lock=eS,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new wF(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:HN()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=X1(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=X1(this.memoryStorage)),Qt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${BN}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";
574if(Qt()&&(n=I$(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Qt()&&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),C$(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return _e(n)?this._returnResult({error:n}):this._returnResult({error:new Qi("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const i=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:wr}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(_e(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var n,r,s;try{let i;if("email"in t){const{email:d,password:f,options:h}=t;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await zo(this.storage,this.storageKey)),i=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:d,password:f,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:g},xform:wr})}else if("phone"in t){const{phone:d,password:f,options:h}=t;i=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},channel:(s=h==null?void 0:h.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:wr})}else throw new md("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await Xt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),_e(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:o,options:a}=t;n=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Y1})}else if("phone"in t){const{phone:i,password:o,options:a}=t;n=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Y1})}else throw new md("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const i=new Fo;return this._returnResult({data:{user:null,session:null},error:i})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(_e(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,s,i,o,a,c,u,d,f,h;let p,g;if("message"in t)p=t.message,g=t.signature;else{const{chain:v,wallet:b,statement:y,options:w}=t;let x;if(Qt())if(typeof b=="object")x=b;else{const R=window;if("ethereum"in R&&typeof R.ethereum=="object"&&"request"in R.ethereum&&typeof R.ethereum.request=="function")x=R.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=b}const S=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href),C=await x.request({method:"eth_requestAccounts"}).then(R=>R).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!C||C.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=GN(C[0]);let _=(r=w==null?void 0:w.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!_){const R=await x.request({method:"eth_chainId"});_=rF(R)}const j={domain:S.host,address:k,statement:y,uri:S.href,version:"1",chainId:_,nonce:(s=w==null?void 0:w.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=w==null?void 0:w.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=w==null?void 0:w.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(c=w==null?void 0:w.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=w==null?void 0:w.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=w==null?void 0:w.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=iF(j),g=await x.request({method:"personal_sign",params:[sF(p),k]})}try{const{data:v,error:b}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:g},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:wr});if(b)throw b;if(!v||!v.session||!v.user){const y=new Fo;return this._returnResult({data:{user:null,session:null},error:y})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:b})}catch(v){if(_e(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async signInWithSolana(t){var n,r,s,i,o,a,c,u,d,f,h,p;let g,v;if("message"in t)g=t.message,v=t.signature;else{const{chain:b,wallet:y,statement:w,options:x}=t;let S;if(Qt())if(typeof y=="object")S=y;
574else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))S=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=y}const C=new URL((n=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in S&&S.signIn){const k=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:C.host,uri:C.href}),w?{statement:w}:null));let _;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")_=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)_=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)g=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),v=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${C.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${C.href}`,`Issued At: ${(s=(r=x==null?void 0:x.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=x==null?void 0:x.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((u=x==null?void 0:x.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((f=(d=x==null?void 0:x.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...x.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(`
575`);const k=await S.signMessage(new TextEncoder().encode(g),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=k}}try{const{data:b,error:y}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:ro(v)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:wr});if(y)throw y;if(!b||!b.session||!b.user){const w=new Fo;return this._returnResult({data:{user:null,session:null},error:w})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:y})}catch(b){if(_e(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(t){const n=await Bi(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new j$;const{data:i,error:o}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:wr});if(await Xt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new Fo;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),_e(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=t,a=await Pe(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==null?void 0:n.captchaToken}},xform:wr}),{data:c,error:u}=a;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Fo;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(_e(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,i,o;try{if("email"in t){const{email:a,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await zo(this.storage,this.storageKey));const{error:f}=await Pe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:a,options:c}=t,{data:u,error:d}=await Pe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new md("You must provide either an email or phone number.")}catch(a){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),_e(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(t){var n,r;try{let s,i;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await Pe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:wr});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(_e(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,i,o;try{let a=null,c=null;this.flowType==="pkce"&&([a,c]=await zo(this.storage,this.storageKey));const u=await Pe(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:c}),headers:this.headers,xform:X$});return!((i=u.data)===null||i===void 0)&&i.url&&Qt()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(a){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),_e(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new Bn;const{error:s}=await Pe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(_e(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:s,options:i}=t,{error:o}=await Pe(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:r,type:s,options:i}=t,{data:o,error:a}=await Pe(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a})}throw new md("You must provide either an email or phone number and a type")}catch(n){if(_e(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);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}`,t,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(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(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 t=null;const n=await Bi(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
575id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<fm:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await Bi(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=pm()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=G$(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await Pe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:ni}):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 Bn}:await Pe(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:ni})})}catch(n){if(_e(n))return pd(n)&&(await this._removeSession(),await Xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new Bn;const o=s.session;let a=null,c=null;this.flowType==="pkce"&&t.email!=null&&([a,c]=await zo(this.storage,this.storageKey));const{data:u,error:d}=await Pe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:a,code_challenge_method:c}),jwt:o.access_token,xform:ni});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),_e(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Bn;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=yd(t.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){const{data:a,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});i={access_token:t.access_token,refresh_token:t.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 this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(_e(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:a}=n;if(a)throw a;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Bn;const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(_e(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){var r;try{if(!Qt())throw new gd("No browser detected.");
575if(t.error||t.error_description||t.error_code)throw new gd(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new V1("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new gd("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new V1("No code detected.");const{data:x,error:S}=await this._exchangeCodeForSession(t.code);if(S)throw S;const C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:(r=x.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:s,provider_refresh_token:i,access_token:o,refresh_token:a,expires_in:c,expires_at:u,token_type:d}=t;if(!o||!c||!a||!d)throw new gd("No session defined in URL");const f=Math.round(Date.now()/1e3),h=parseInt(c);let p=f+h;u&&(p=parseInt(u));const g=p-f;g*1e3<=ea&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${h}s`);const v=p-h;f-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,p,f):f-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,p,f);const{data:b,error:y}=await this._getUser(o);if(y)throw y;const w={provider_token:s,provider_refresh_token:i,access_token:o,expires_in:h,expires_at:p,refresh_token:a,token_type:d,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:t.type},error:null})}catch(s){if(_e(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await Bi(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i&&!pd(i))return this._returnResult({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,t);if(a&&!(_$(a)&&(a.status===404||a.status===401||a.status===403)||pd(a)))return this._returnResult({error:a})}return t!=="others"&&(await this._removeSession(),await Xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=M$(),r={id:n,callback:t,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(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){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(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),pd(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await zo(this.storage,this.storageKey,!0));try{return await Pe(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),_e(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:s}=await this._useSession(async i=>{var o,a,c,u,d;const{data:f,error:h}=i;if(h)throw h;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Pe(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return Qt()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(_e(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:i}}=n;
575if(s)throw s;const{options:o,provider:a,token:c,access_token:u,nonce:d}=t,f=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=i==null?void 0:i.access_token)!==null&&r!==void 0?r:void 0,body:{provider:a,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:wr}),{data:h,error:p}=f;return p?this._returnResult({data:{user:null,session:null},error:p}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new Fo}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:p}))}catch(s){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),_e(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)throw o;return await Pe(this.fetch,"DELETE",`${this.url}/user/identities/${t.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(_e(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await L$(async s=>(s>0&&await D$(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Pe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:wr})),(s,i)=>{const o=200*Math.pow(2,s);return i&&hm(i)&&Date.now()+o-r<ea})}catch(r){if(this._debug(n,"error",r),_e(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),Qt()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await Bi(this.storage,this.storageKey);if(s&&this.userStorage){let o=await Bi(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await ta(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:pm()}else if(s&&!s.user&&!s.user){const o=await Bi(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await Xt(this.storage,this.storageKey+"-user"),await ta(this.storage,this.storageKey,s)):s.user=pm()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const i=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<fm;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${fm}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),hm(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(s.access_token);!a&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Bn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Yh;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new Bn;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={data:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),_e(i)){const o={data:null,error:i};return hm(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(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(t,n)}catch(c){i.push(c)}});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(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Xt(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await ta(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=G1(s);await ta(this.storage,this.storageKey,i)}else{const s=G1(n);await ta(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Xt(this.storage,this.storageKey),await Xt(this.storage,this.storageKey+"-code-verifier"),await Xt(this.storage,this.storageKey+"-user"),this.userStorage&&await Xt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;
575try{t&&Qt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ea);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async 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-t)/ea);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${ea}ms, refresh threshold is ${Ay} ticks`),s<=Ay&&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(t){if(t.isAcquireTimeout||t instanceof qN)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Qt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(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(t,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await zo(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?this._returnResult({data:null,error:i}):await Pe(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;
575if(o)return this._returnResult({data:null,error:o});const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await Pe(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?fF(t.webauthn.credential_response):hF(t.webauthn.credential_response)})}:{code:t.code}),{data:a,error:c}=await Pe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:c}))})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await Pe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:uF(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:dF(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,s,i;if(t)try{const{payload:p}=yd(t);let g=null;p.aal&&(g=p.aal);let v=g;const{data:{user:b},error:y}=await this.getUser(t);if(y)return this._returnResult({data:null,error:y});((r=(n=b==null?void 0:b.factors)===null||n===void 0?void 0:n.filter(S=>S.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(v="aal2");const x=p.amr||[];return{data:{currentLevel:g,nextLevel:v,currentAuthenticationMethods:x},error:null}}catch(p){if(_e(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:o},error:a}
575=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=yd(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(d="aal2");const h=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await Pe(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Bn})})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new Bn});const o=await Pe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&Qt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(_e(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new Bn});const o=await Pe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&Qt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(_e(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Pe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Bn})})}catch(t){if(_e(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await Pe(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Bn})})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(a=>a.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(a=>a.kid===t),r&&this.jwks_cached_at+S$>s)return r;const{data:i,error:o}=await Pe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,r=i.keys.find(a=>a.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:p,error:g}
575=await this.getSession();if(g||!p.session)return this._returnResult({data:null,error:g});r=p.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:c}}=yd(r);n!=null&&n.allowExpired||H$(i.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:i,header:s,signature:o},error:null}}const d=W$(s.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,o,A$(`${a}.${c}`)))throw new Iy("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(_e(r))return this._returnResult({data:null,error:r});throw r}}}eu.nextInstanceID={};const SF=eu,kF="2.104.1";let Ql="";typeof Deno<"u"?Ql="deno":typeof document<"u"?Ql="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ql="react-native":Ql="node";const _F={"X-Client-Info":`supabase-js-${Ql}/${kF}`},CF={headers:_F},jF={schema:"public"},EF={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},NF={};function tu(e){"@babel/helpers - typeof";return tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tu(e)}function TF(e,t){if(tu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PF(e){var t=TF(e,"string");return tu(t)=="symbol"?t:t+""}function AF(e,t,n){return(t=PF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tS(Object(n),!0).forEach(function(r){AF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const RF=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),MF=()=>Headers,IF=(e,t,n)=>{const r=RF(n),s=MF();return async(i,o)=>{var a;const c=(a=await t())!==null&&a!==void 0?a:e;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(i,Ct(Ct({},o),{},{headers:u}))}};function OF(e){return e.endsWith("/")?e:e+"/"}function DF(e,t){var n,r;const{db:s,auth:i,realtime:o,global:a}=e,{db:c,auth:u,realtime:d,global:f}=t,h={db:Ct(Ct({},c),s),auth:Ct(Ct({},u),i),realtime:Ct(Ct({},d),o),storage:{},global:Ct(Ct(Ct({},f),a),{},{headers:Ct(Ct({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function LF(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(OF(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var $F=class extends SF{constructor(e){super(e)}},FF=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const i=LF(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:jF,realtime:NF,auth:Ct(Ct({},EF),{},{storageKey:o}),global:CF},c=DF(n??{},a);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.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`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=IF(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Ct({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new o3(new URL("rest/v1",i).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new y$(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new J4(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}
575channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:i,flowType:o,lock:a,debug:c,throwOnError:u},d,f){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new $F({url:this.authUrl.href,headers:Ct(Ct({},h),d),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:c,throwOnError:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new z3(this.realtimeUrl.href,Ct(Ct({},e),{},{params:Ct(Ct({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const zF=(e,t,n)=>new FF(e,t,n);function BF(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}BF()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const VF="https://inznlarlalvonceaksoy.supabase.co",UF="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imluem5sYXJsYWx2b25jZWFrc295Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzQxMTQ4NzQsImV4cCI6MjA0OTY5MDg3NH0.LhLIhLIGGZH8rhekJNQ19ChTyGIax0WkKdA6d0RUhUE",q=zF(VF,UF,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0},realtime:{params:{eventsPerSecond:10}}});function HF(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jh(...e){return t=>e.forEach(n=>HF(n,t))}function vt(...e){return m.useCallback(Jh(...e),e)}var _i=m.forwardRef((e,t)=>{const{children:n,...r}=e,s=m.Children.toArray(n),i=s.find(WF);if(i){const o=i.props.children,a=s.map(c=>c===i?m.Children.count(o)>1?m.Children.only(null):m.isValidElement(o)?o.props.children:null:c);return l.jsx(Oy,{...r,ref:t,children:m.isValidElement(o)?m.cloneElement(o,void 0,a):null})}return l.jsx(Oy,{...r,ref:t,children:n})});_i.displayName="Slot";var Oy=m.forwardRef((e,t)=>{const{children:n,...r}=e;if(m.isValidElement(n)){const s=GF(n);return m.cloneElement(n,{...qF(r,n.props),ref:t?Jh(t,s):s})}return m.Children.count(n)>1?m.Children.only(null):null});Oy.displayName="SlotClone";var Gx=({children:e})=>l.jsx(l.Fragment,{children:e});function WF(e){return m.isValidElement(e)&&e.type===Gx}function qF(e,t){const n={...t};for(const r in t){const s=e[r],i=t[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{...e,...n}}function GF(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function YN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=YN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function JN(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=YN(e))&&(r&&(r+=" "),r+=t);return r}const nS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rS=JN,ku=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return rS(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],f=i==null?void 0:i[u];if(d===null)return null;const h=nS(d)||nS(f);return s[u][h]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(g=>{let[v,b]=g;return Array.isArray(b)?b.includes({...i,...a}[v]):{...i,...a}[v]===b})?[...u,f,h]:u},[]);return rS(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Kx="-",KF=e=>{const t=JF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(Kx);return a[0]===""&&a.length!==1&&a.shift(),XN(a,t)||YF(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},XN=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?XN(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Kx);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},sS=/^\[(.+)\]$/,YF=e=>{if(sS.test(e)){const t=sS.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},JF=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};
vendor: 4,572 bytes, line 575
575return QF(Object.entries(e.classGroups),n).forEach(([i,o])=>{Dy(o,r,i,t)}),r},Dy=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:iS(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(XF(s)){Dy(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Dy(o,iS(t,i),n,r)})})},iS=(e,t)=>{let n=e;return t.split(Kx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},XF=e=>e.isThemeGetter,QF=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,ZF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=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)}}},QN="!",ez=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const c=[];let u=0,d=0,f;for(let b=0;b<a.length;b++){let y=a[b];if(u===0){if(y===s&&(r||a.slice(b,b+i)===t)){c.push(a.slice(d,b)),d=b+i;continue}if(y==="/"){f=b;continue}}y==="["?u++:y==="]"&&u--}const h=c.length===0?a:a.substring(d),p=h.startsWith(QN),g=p?h.substring(1):h,v=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:o}):o},tz=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},nz=e=>({cache:ZF(e.cacheSize),parseClassName:ez(e),...KF(e)}),rz=/\s+/,sz=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(rz);let a="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,v=r(g?h.substring(0,p):h);if(!v){if(!g){a=u+(a.length>0?" "+a:a);continue}if(v=r(h),!v){a=u+(a.length>0?" "+a:a);continue}g=!1}const b=tz(d).join(":"),y=f?b+QN:b,w=y+v;if(i.includes(w))continue;i.push(w);const x=s(v,g);for(let S=0;S<x.length;++S){const C=x[S];i.push(y+C)}a=u+(a.length>0?" "+a:a)}return a};function iz(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ZN(t))&&(r&&(r+=" "),r+=n);return r}const ZN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ZN(e[r]))&&(n&&(n+=" "),n+=t);return n};function oz(e,...t){let n,r,s,i=o;function o(c){const u=t.reduce((d,f)=>f(d),e());return n=nz(u),r=n.cache.get,s=n.cache.set,i=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=sz(c,n);return s(c,d),d}return function(){return i(iz.apply(null,arguments))}}const ct=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},eT=/^\[(?:([a-z-]+):)?(.+)\]$/i,az=/^\d+\/\d+$/,lz=new Set(["px","full","screen"]),cz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uz=/\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$/,dz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,is=e=>Pa(e)||lz.has(e)||az.test(e),Ws=e=>ul(e,"length",bz),Pa=e=>!!e&&!Number.isNaN(Number(e)),gm=e=>ul(e,"number",Pa),Pl=e=>!!e&&Number.isInteger(Number(e)),pz=e=>e.endsWith("%")&&Pa(e.slice(0,-1)),Ve=e=>eT.test(e),qs=e=>cz.test(e),mz=new Set(["length","size","percentage"]),gz=e=>ul(e,mz,tT),yz=e=>ul(e,"position",tT),vz=new Set(["image","url"]),xz=e=>ul(e,vz,kz),wz=e=>ul(e,"",Sz),Al=()=>!0,ul=(e,t,n)=>{const r=eT.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},bz=e=>uz.test(e)&&!dz.test(e),tT=()=>!1,Sz=e=>fz.test(e),kz=e=>hz.test(e),_z=()=>{const e=ct("colors"),t=ct("spacing"),n=ct("blur"),r=ct("brightness"),s=ct("borderColor"),i=ct("borderRadius"),o=ct("borderSpacing"),a=ct("borderWidth"),c=ct("contrast"),u=ct("grayscale"),d=ct("hueRotate"),f=ct("invert"),h=ct("gap"),p=ct("gradientColorStops"),g=ct("gradientColorStopPositions"),v=ct("inset"),b=ct("margin"),y=ct("opacity"),w=ct("padding"),x=ct("saturate"),S=ct("scale"),C=ct("sepia"),k=ct("skew"),_=ct("space"),j=ct("translate"),R=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Ve,t],T=()=>[Ve,t],L=()=>["",is,Ws],F=()=>["auto",Pa,Ve],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],
vendor: 6,890 bytes, line 575
575V=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Ve],E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[Pa,Ve];return{cacheSize:500,separator:":",theme:{colors:[Al],spacing:[is,Ws],blur:["none","",qs,Ve],brightness:K(),borderColor:[e],borderRadius:["none","","full",qs,Ve],borderSpacing:T(),borderWidth:L(),contrast:K(),grayscale:D(),hueRotate:K(),invert:D(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[pz,Ws],inset:M(),margin:M(),opacity:K(),padding:T(),saturate:K(),scale:K(),sepia:D(),skew:K(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Ve]}],container:["container"],columns:[{columns:[qs]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:[...z(),Ve]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],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",Pl,Ve]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ve]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",Pl,Ve]}],"grid-cols":[{"grid-cols":[Al]}],"col-start-end":[{col:["auto",{span:["full",Pl,Ve]},Ve]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Al]}],"row-start-end":[{row:["auto",{span:[Pl,Ve]},Ve]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ve]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ve]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ve,t]}],"min-w":[{"min-w":[Ve,t,"min","max","fit"]}],"max-w":[{"max-w":[Ve,t,"none","full","min","max","fit","prose",{screen:[qs]},qs]}],h:[{h:[Ve,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ve,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qs,Ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gm]}],"font-family":[{font:[Al]}],"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",Ve]}],"line-clamp":[{"line-clamp":["none",Pa,gm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",is,Ve]}],"list-image":[{"list-image":["none",Ve]}],"list-style-type":[{list:["none","disc","decimal",Ve]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",is,Ws]}],"underline-offset":[{"underline-offset":["auto",is,Ve]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve]}],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",Ve]}],"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:[...z(),yz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}
575],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"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:[...V(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,467 bytes, line 575
575],"divide-style":[{divide:V()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[is,Ve]}],"outline-w":[{outline:[is,Ws]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[is,Ws]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qs,wz]}],"shadow-color":[{shadow:[Al]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",qs,Ve]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",Ve]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",Ve]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ve]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Pl,Ve]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ve]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Ve]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[is,Ws,gm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
575none"]}]},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"]}}},Cz=oz(_z);function ae(...e){return Cz(JN(e))}const nu=ku("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground rounded-full",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-full px-3",lg:"h-11 rounded-full px-8",icon:"h-10 w-10 rounded-full"}},defaultVariants:{variant:"default",size:"default"}}),Fe=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?_i:"button";return l.jsx(o,{className:ae(nu({variant:t,size:n,className:e})),ref:i,...s})});Fe.displayName="Button";var jz=e=>{switch(e){case"success":return Tz;case"info":return Az;case"warning":return Pz;case"error":return Rz;default:return null}},Ez=Array(12).fill(0),Nz=({visible:e})=>$.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},$.createElement("div",{className:"sonner-spinner"},Ez.map((t,n)=>$.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Tz=$.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"})),Pz=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
575currentColor",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"})),Az=$.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"})),Rz=$.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"})),Mz=()=>{let[e,t]=$.useState(document.hidden);return $.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Ly=1,Iz=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ly++,i=this.toasts.find(a=>a.id===s),o=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...e,id:s,title:n}),{...a,...e,id:s,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
575this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0;return r.then(async i=>{if(Dz(i)&&!i.ok){s=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:o,description:a})}else if(t.success!==void 0){s=!1;let o=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:o,description:a})}}).catch(async i=>{if(t.error!==void 0){s=!1;let o=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:o,description:a})}}).finally(()=>{var i;s&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Ly++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Un=new Iz,Oz=(e,t)=>{let n=(t==null?void 0:t.id)||Ly++;return Un.addToast({title:e,...t,id:n}),n},Dz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Lz=Oz,$z=()=>Un.toasts,J=Object.assign(Lz,{success:Un.success,info:Un.info,warning:Un.warning,error:Un.error,custom:Un.custom,message:Un.message,promise:Un.promise,dismiss:Un.dismiss,loading:Un.loading},{getHistory:$z});function Fz(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Fz(`: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;
575left: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}
575: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%)}
576`);function vd(e){return e.label!==void 0}var zz=3,Bz="32px",Vz=4e3,Uz=356,Hz=14,Wz=20,qz=200;function Gz(...e){return e.filter(Boolean).join(" ")}var Kz=e=>{var t,n,r,s,i,o,a,c,u,d;let{invert:f,toast:h,unstyled:p,interacting:g,setHeights:v,visibleToasts:b,heights:y,index:w,toasts:x,expanded:S,removeToast:C,defaultRichColors:k,closeButton:_,style:j,cancelButtonStyle:R,actionButtonStyle:P,className:M="",descriptionClassName:T="",duration:L,position:F,gap:z,loadingIcon:V,expandByDefault:I,classNames:A,icons:D,closeButtonAriaLabel:E="Close toast",pauseWhenPageIsHidden:K,cn:te}=e,[N,ee]=$.useState(!1),[ie,U]=$.useState(!1),[W,ne]=$.useState(!1),[oe,Z]=$.useState(!1),[se,re]=$.useState(0),[Y,Ee]=$.useState(0),He=$.useRef(null),Re=$.useRef(null),Nt=w===0,O=w+1<=b,B=h.type,G=h.dismissible!==!1,pe=h.className||"",ce=h.descriptionClassName||"",le=$.useMemo(()=>y.findIndex(Q=>Q.toastId===h.id)||0,[y,h.id]),Ce=$.useMemo(()=>{var Q;return(Q=h.closeButton)!=null?Q:_},[h.closeButton,_]),Me=$.useMemo(()=>h.duration||L||Vz,[h.duration,L]),H=$.useRef(0),X=$.useRef(0),ve=$.useRef(0),Ne=$.useRef(null),[Le,Qe]=F.split("-"),_t=$.useMemo(()=>y.reduce((Q,ge,ye)=>ye>=le?Q:Q+ge.height,0),[y,le]),nt=Mz(),xe=h.invert||f,me=B==="loading";X.current=$.useMemo(()=>le*z+_t,[le,_t]),$.useEffect(()=>{ee(!0)},[]),$.useLayoutEffect(()=>{if(!N)return;let Q=Re.current,ge=Q.style.height;Q.style.height="auto";let ye=Q.getBoundingClientRect().height;Q.style.height=ge,Ee(ye),v(Te=>Te.find(je=>je.toastId===h.id)?Te.map(je=>je.toastId===h.id?{...je,height:ye}:je):[{toastId:h.id,height:ye,position:h.position},...Te])},[N,h.title,h.description,v,h.id]);let be=$.useCallback(()=>{U(!0),re(X.current),v(Q=>Q.filter(ge=>ge.toastId!==h.id)),setTimeout(()=>{C(h)},qz)},[h,C,v,X]);$.useEffect(()=>{if(h.promise&&B==="loading"||h.duration===1/0||h.type==="loading")return;let Q,ge=Me;return S||g||K&&nt?(()=>{if(ve.current<H.current){let ye=new Date().getTime()-H.current;ge=ge-ye}
576ve.current=new Date().getTime()})():ge!==1/0&&(H.current=new Date().getTime(),Q=setTimeout(()=>{var ye;(ye=h.onAutoClose)==null||ye.call(h,h),be()},ge)),()=>clearTimeout(Q)},[S,g,I,h,Me,be,h.promise,B,K,nt]),$.useEffect(()=>{let Q=Re.current;if(Q){let ge=Q.getBoundingClientRect().height;return Ee(ge),v(ye=>[{toastId:h.id,height:ge,position:h.position},...ye]),()=>v(ye=>ye.filter(Te=>Te.toastId!==h.id))}},[v,h.id]),$.useEffect(()=>{h.delete&&be()},[be,h.delete]);function Ge(){return D!=null&&D.loading?$.createElement("div",{className:"sonner-loader","data-visible":B==="loading"},D.loading):V?$.createElement("div",{className:"sonner-loader","data-visible":B==="loading"},V):$.createElement(Nz,{visible:B==="loading"})}return $.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Re,className:te(M,pe,A==null?void 0:A.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,A==null?void 0:A.default,A==null?void 0:A[B],(n=h==null?void 0:h.classNames)==null?void 0:n[B]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":N,"data-promise":!!h.promise,"data-removed":ie,"data-visible":O,"data-y-position":Le,"data-x-position":Qe,"data-index":w,"data-front":Nt,"data-swiping":W,"data-dismissible":G,"data-type":B,"data-invert":xe,"data-swipe-out":oe,"data-expanded":!!(S||I&&N),style:{"--index":w,"--toasts-before":w,"--z-index":x.length-w,"--offset":`${ie?se:X.current}px`,"--initial-height":I?"auto":`${Y}px`,...j,...h.style},onPointerDown:Q=>{me||!G||(He.current=new Date,re(X.current),Q.target.setPointerCapture(Q.pointerId),Q.target.tagName!=="BUTTON"&&(ne(!0),Ne.current={x:Q.clientX,y:Q.clientY}))},onPointerUp:()=>{var Q,ge,ye,Te;if(oe||!G)return;Ne.current=null;let je=Number(((Q=Re.current)==null?void 0:Q.style.getPropertyValue("--swipe-amount").replace("px",""))||0),we=new Date().getTime()-((ge=He.current)==null?void 0:ge.getTime()),We=Math.abs(je)/we;if(Math.abs(je)>=Wz||We>.11){re(X.current),(ye=h.onDismiss)==null||ye.call(h,h),be(),Z(!0);return}(Te=Re.current)==null||Te.style.setProperty("--swipe-amount","0px"),ne(!1)},onPointerMove:Q=>{var ge;if(!Ne.current||!G)return;let ye=Q.clientY-Ne.current.y,Te=Q.clientX-Ne.current.x,je=(Le==="top"?Math.min:Math.max)(0,ye),we=Q.pointerType==="touch"?10:2;Math.abs(je)>we?(ge=Re.current)==null||ge.style.setProperty("--swipe-amount",`${ye}px`):Math.abs(Te)>we&&(Ne.current=null)}},Ce&&!h.jsx?$.createElement("button",{"aria-label":E,"data-disabled":me,"data-close-button":!0,onClick:me||!G?()=>{}:()=>{var Q;be(),(Q=h.onDismiss)==null||Q.call(h,h)},className:te(A==null?void 0:A.closeButton,(s=h==null?void 0:h.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,h.jsx||$.isValidElement(h.title)?h.jsx||h.title:$.createElement($.Fragment,null,B||h.icon||h.promise?$.createElement("div",{"data-icon":"",className:te(A==null?void 0:A.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Ge():null,h.type!=="loading"?h.icon||(D==null?void 0:D[B])||jz(B):null):null,$.createElement("div",{"data-content":"",className:te(A==null?void 0:A.content,(o=h==null?void 0:h.classNames)==null?void 0:o.content)},$.createElement("div",{"data-title":"",className:te(A==null?void 0:A.title,(a=h==null?void 0:h.classNames)==null?void 0:a.title)},h.title),h.description?$.createElement("div",{"data-description":"",className:te(T,ce,A==null?void 0:A.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},h.description):null),$.isValidElement(h.cancel)?h.cancel:h.cancel&&vd(h.cancel)?$.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:Q=>{var ge,ye;vd(h.cancel)&&G&&((ye=(ge=h.cancel).onClick)==null||ye.call(ge,Q),be())},className:te(A==null?void 0:A.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,$.isValidElement(h.action)?h.action:h.action&&vd(h.action)?$.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||P,onClick:Q=>{var ge,ye;vd(h.action)&&(Q.defaultPrevented||((ye=(ge=h.action).onClick)==null||ye.call(ge,Q),be()))},className:te(A==null?void 0:A.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function oS(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var Yz=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:o,offset:a,theme:c="light",richColors:u,duration:d,style:f,visibleToasts:h=zz,toastOptions:p,dir:g=oS(),gap:v=Hz,loadingIcon:b,icons:y,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:x,cn:S=Gz}=e,[C,k]=$.useState([]),_=$.useMemo(()=>Array.from(new Set([n].concat(C.filter(K=>K.position).map(K=>K.position)))),[C,n]),[j,R]=$.useState([]),[P,M]=$.useState(!1),[T,L]=$.useState(!1),[F,z]=$.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
576k":"light"),V=$.useRef(null),I=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=$.useRef(null),D=$.useRef(!1),E=$.useCallback(K=>{var te;(te=C.find(N=>N.id===K.id))!=null&&te.delete||Un.dismiss(K.id),k(N=>N.filter(({id:ee})=>ee!==K.id))},[C]);return $.useEffect(()=>Un.subscribe(K=>{if(K.dismiss){k(te=>te.map(N=>N.id===K.id?{...N,delete:!0}:N));return}setTimeout(()=>{eN.flushSync(()=>{k(te=>{let N=te.findIndex(ee=>ee.id===K.id);return N!==-1?[...te.slice(0,N),{...te[N],...K},...te.slice(N+1)]:[K,...te]})})})}),[]),$.useEffect(()=>{if(c!=="system"){z(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:K})=>{z(K?"dark":"light")})},[c]),$.useEffect(()=>{C.length<=1&&M(!1)},[C]),$.useEffect(()=>{let K=te=>{var N,ee;r.every(ie=>te[ie]||te.code===ie)&&(M(!0),(N=V.current)==null||N.focus()),te.code==="Escape"&&(document.activeElement===V.current||(ee=V.current)!=null&&ee.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[r]),$.useEffect(()=>{if(V.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,D.current=!1)}},[V.current]),C.length?$.createElement("section",{"aria-label":`${w} ${I}`,tabIndex:-1},_.map((K,te)=>{var N;let[ee,ie]=K.split("-");return $.createElement("ol",{key:K,dir:g==="auto"?oS():g,tabIndex:-1,ref:V,className:o,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":ee,"data-x-position":ie,style:{"--front-toast-height":`${((N=j[0])==null?void 0:N.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||Bz,"--width":`${Uz}px`,"--gap":`${v}px`,...f},onBlur:U=>{D.current&&!U.currentTarget.contains(U.relatedTarget)&&(D.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||D.current||(D.current=!0,A.current=U.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{T||M(!1)},onPointerDown:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},C.filter(U=>!U.position&&te===0||U.position===K).map((U,W)=>{var ne,oe;return $.createElement(Kz,{key:U.id,icons:y,index:W,toast:U,defaultRichColors:u,duration:(ne=p==null?void 0:p.duration)!=null?ne:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:h,closeButton:(oe=p==null?void 0:p.closeButton)!=null?oe:i,interacting:T,position:K,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:E,toasts:C.filter(Z=>Z.position==U.position),heights:j.filter(Z=>Z.position==U.position),setHeights:R,expandByDefault:s,gap:v,loadingIcon:b,expanded:P,pauseWhenPageIsHidden:x,cn:S})}))})):null};function Jz(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}function Xh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const $y=e=>Array.isArray(e);function nT(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function ru(e){return typeof e=="string"||Array.isArray(e)}function aS(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Yx(e,t,n,r){if(typeof t=="function"){const[s,i]=aS(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=aS(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Qh(e,t,n){const r=e.getProps();return Yx(r,t,n!==void 0?n:r.custom,e)}const Jx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Xx=["initial",...Jx],_u=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ao=new Set(_u),Es=e=>e*1e3,Ns=e=>e/1e3,Xz={type:"spring",stiffness:500,damping:25,restSpeed:10},Qz=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Zz={type:"keyframes",duration:.8},e6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},t6=(e,{keyframes:t})=>t.length>2?Zz:Ao.has(e)?e.startsWith("scale")?Qz(t[1]):Xz:e6;function Qx(e,t){return e?e[t]||e.default||e:void 0}const n6={skipAnimations:!1,useManualTiming:!1},r6=e=>e!==null;function Zh(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(r6),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Xn=e=>e;let Fy=Xn;function s6(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){i.has(u)&&(c.schedule(u),e()),u(o)}const c={schedule:(u,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&i.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(o=u,r){s=!0;return}r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,s&&(s=!1,c.process(u))}};return c}const xd=["read","resolveKeyframes","update","preRender","render","postRender"],i6=40;function rT(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=xd.reduce((y,w)=>(y[w]=s6(i),y),{}),{read:a,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=o,p=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,i6),1),s.timestamp=y,s.isProcessing=!0,a.process(s),c.process(s),u.process(s),d.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},g=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:xd.reduce((y,w)=>{const x=o[w];return y[w]=(S,C=!1,k=!1)=>(n||g(),x.schedule(S,C,k)),y},{}),cancel:y=>{for(let w=0;w<xd.length;w++)o[xd[w]].cancel(y)},state:s,steps:o}}const{schedule:ht,cancel:Ci,state:en,steps:ym}=rT(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xn,!0),sT=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,o6=1e-7,a6=12;
vendor: 17,016 bytes, line 576
576function l6(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=sT(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>o6&&++a<a6);return o}function Cu(e,t,n,r){if(e===t&&n===r)return Xn;const s=i=>l6(i,0,1,e,n);return i=>i===0||i===1?i:sT(s(i),t,r)}const iT=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,oT=e=>t=>1-e(1-t),aT=Cu(.33,1.53,.69,.99),Zx=oT(aT),lT=iT(Zx),cT=e=>(e*=2)<1?.5*Zx(e):.5*(2-Math.pow(2,-10*(e-1))),e0=e=>1-Math.sin(Math.acos(e)),uT=oT(e0),dT=iT(e0),fT=e=>/^0[^.\s]+$/u.test(e);function c6(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fT(e):!0}const hT=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),pT=e=>t=>typeof t=="string"&&t.startsWith(e),mT=pT("--"),u6=pT("var(--"),t0=e=>u6(e)?d6.test(e.split("/*")[0].trim()):!1,d6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,f6=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function h6(e){const t=f6.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function gT(e,t,n=1){const[r,s]=h6(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return hT(o)?parseFloat(o):o}return t0(s)?gT(s,t,n+1):s}const Is=(e,t,n)=>n>t?t:n<e?e:n,dl={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},su={...dl,transform:e=>Is(0,1,e)},wd={...dl,default:1},ju=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ys=ju("deg"),Zr=ju("%"),Ie=ju("px"),p6=ju("vh"),m6=ju("vw"),lS={...Zr,parse:e=>Zr.parse(e)/100,transform:e=>Zr.transform(e*100)},g6=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),cS=e=>e===dl||e===Ie,uS=(e,t)=>parseFloat(e.split(", ")[t]),dS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return uS(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?uS(i[1],e):0}},y6=new Set(["x","y","z"]),v6=_u.filter(e=>!y6.has(e));function x6(e){const t=[];return v6.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ka={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:dS(4,13),y:dS(5,14)};Ka.translateX=Ka.x;Ka.translateY=Ka.y;const yT=e=>t=>t.test(e),w6={test:e=>e==="auto",parse:e=>e},vT=[dl,Ie,Zr,Ys,m6,p6,w6],fS=e=>vT.find(yT(e)),co=new Set;let zy=!1,By=!1;function xT(){if(By){const e=Array.from(co).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=x6(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}By=!1,zy=!1,co.forEach(e=>e.complete()),co.clear()}function wT(){co.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(By=!0)})}function b6(){wT(),xT()}class n0{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(co.add(this),zy||(zy=!0,ht.read(wT),ht.resolveKeyframes(xT))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const c=r.readValue(n,a);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),co.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,co.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const wc=e=>Math.round(e*1e5)/1e5,r0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function S6(e){return e==null}const k6=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,s0=(e,t)=>n=>!!(typeof n=="string"&&k6.test(n)&&n.startsWith(e)||t&&!S6(n)&&Object.prototype.hasOwnProperty.call(n,t)),bT=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(r0);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},_6=e=>Is(0,255,e),vm={...dl,transform:e=>Math.round(_6(e))},so={test:s0("rgb","red"),parse:bT("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+vm.transform(e)+", "+vm.transform(t)+", "+vm.transform(n)+", "+wc(su.transform(r))+")"};function C6(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Vy={test:s0("#"),parse:C6,transform:so.transform},ga={test:s0("hsl","hue"),parse:bT("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Zr.transform(wc(t))+", "+Zr.transform(wc(n))+", "+wc(su.transform(r))+")"},ln={test:e=>so.test(e)||Vy.test(e)||ga.test(e),parse:e=>so.test(e)?so.parse(e):ga.test(e)?ga.parse(e):Vy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?so.transform(e):ga.transform(e)},j6=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function E6(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(r0))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(j6))===null||n===void 0?void 0:n.length)||0)>0}const ST="number",kT="color",N6="var",T6="var(",hS="${}",P6=/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 iu(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(P6,c=>(ln.test(c)?(r.color.push(i),s.push(kT),n.push(ln.parse(c))):c.startsWith(T6)?(r.var.push(i),s.push(N6),n.push(c)):(r.number.push(i),s.push(ST),n.push(parseFloat(c))),++i,hS)).split(hS);return{values:n,split:a,indexes:r,types:s}}function _T(e){return iu(e).values}function CT(e){const{split:t,types:n}=iu(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===ST?i+=wc(s[o]):a===kT?i+=ln.transform(s[o]):i+=s[o]}return i}}const A6=e=>typeof e=="number"?0:e;function R6(e){const t=_T(e);return CT(e)(t.map(A6))}const ji={test:E6,parse:_T,createTransformer:CT,getAnimatableNone:R6},M6=new Set(["brightness","contrast","saturate","opacity"]);function I6(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(r0)||[];if(!r)return e;const s=n.replace(r,"");let i=M6.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const O6=/\b([a-z-]*)\(.*?\)/gu,Uy={...ji,getAnimatableNone:e=>{const t=e.match(O6);return t?t.map(I6).join(" "):e}},D6={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,radius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,backgroundPositionX:Ie,backgroundPositionY:Ie},L6={rotate:Ys,rotateX:Ys,rotateY:Ys,rotateZ:Ys,scale:wd,scaleX:wd,scaleY:wd,scaleZ:wd,skew:Ys,skewX:Ys,skewY:Ys,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:su,originX:lS,originY:lS,originZ:Ie},pS={...dl,transform:Math.round},i0={...D6,...L6,zIndex:pS,size:Ie,fillOpacity:su,strokeOpacity:su,numOctaves:pS},$6={...i0,color:ln,backgroundColor:ln,outlineColor:ln,fill:ln,stroke:ln,borderColor:ln,borderTopColor:ln,borderRightColor:ln,borderBottomColor:ln,borderLeftColor:ln,filter:Uy,WebkitFilter:Uy},o0=e=>$6[e];function jT(e,t){let n=o0(e);return n!==Uy&&(n=ji),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const F6=new Set(["auto","none","0"]);function z6(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!F6.has(i)&&iu(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=jT(n,s)}class ET extends n0{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),t0(u))){const d=gT(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!g6.has(r)||t.length!==2)return;const[s,i]=t,o=fS(s),a=fS(i);if(o!==a)if(cS(o)&&cS(a))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)c6(t[s])&&r.push(s);r.length&&z6(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ka[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=Ka[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,u])=>{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function a0(e){return typeof e=="function"}let tf;function B6(){tf=void 0}const es={now:()=>(tf===void 0&&es.set(en.isProcessing||n6.useManualTiming?en.timestamp:performance.now()),tf),set:e=>{tf=e,queueMicrotask(B6)}},mS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ji.test(e)||e==="0")&&!e.startsWith("url("));function V6(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function U6(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=mS(s,t),a=mS(i,t);return!o||!a?!1:V6(e)||(n==="spring"||a0(n))&&r}const H6=40;class NT{constructor({autoplay:t=!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=es.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>H6?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&b6(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=es.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:c,isGenerator:u}=this.options;if(!u&&!U6(t,r,s,i))if(o)this.options.duration=0;else{c==null||c(Zh(t,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Ya=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},TT=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Ya(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function PT(e,t){return t?e*(1e3/t):0}const W6=5;function AT(e,t,n){const r=Math.max(t-W6,0);return PT(n-e(r),t-r)}const jt={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},xm=.001;function q6({duration:e=jt.duration,bounce:t=jt.bounce,velocity:n=jt.velocity,mass:r=jt.mass}){let s,i,o=1-t;o=Is(jt.minDamping,jt.maxDamping,o),e=Is(jt.minDuration,jt.maxDuration,Ns(e)),o<1?(s=u=>{const d=u*o,f=d*e,h=d-n,p=Hy(u,o),g=Math.exp(-f);return xm-h/p*g},i=u=>{const f=u*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-f),v=Hy(Math.pow(u,2),o);return(-s(u)+xm>0?-1:1)*((h-p)*g)/v}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-xm+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const a=5/e,c=K6(s,i,a);if(e=Es(e),isNaN(c))return{stiffness:jt.stiffness,damping:jt.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const G6=12;function K6(e,t,n){let r=n;for(let s=1;s<G6;s++)r=r-e(r)/t(r);return r}function Hy(e,t){return e*Math.sqrt(1-t*t)}const Wy=2e4;function RT(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Wy;)t+=n,r=e.next(t);return t>=Wy?1/0:t}const Y6=["duration","bounce"],J6=["stiffness","damping","mass"];function gS(e,t){return t.some(n=>e[n]!==void 0)}function X6(e){let t={velocity:jt.velocity,stiffness:jt.stiffness,damping:jt.damping,mass:jt.mass,isResolvedFromDuration:!1,...e};if(!gS(e,J6)&&gS(e,Y6))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Is(.05,1,1-e.bounce)*Math.sqrt(s);t={...t,mass:jt.mass,stiffness:s,damping:i}}else{const n=q6(e);t={...t,...n,mass:jt.mass},t.isResolvedFromDuration=!0}return t}function MT(e=jt.visualDuration,t=jt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=X6({...n,velocity:-Ns(n.velocity||0)}),g=h||0,v=u/(2*Math.sqrt(c*d)),b=o-i,y=Ns(Math.sqrt(c/d)),w=Math.abs(b)<5;r||(r=w?jt.restSpeed.granular:jt.restSpeed.default),s||(s=w?jt.restDelta.granular:jt.restDelta.default);let x;if(v<1){const C=Hy(y,v);x=k=>{const _=Math.exp(-v*y*k);return o-_*((g+v*y*b)/C*Math.sin(C*k)+b*Math.cos(C*k))}}else if(v===1)x=C=>o-Math.exp(-y*C)*(b+(g+y*b)*C);else{const C=y*Math.sqrt(v*v-1);x=k=>{const _=Math.exp(-v*y*k),j=Math.min(C*k,300);return o-_*((g+v*y*b)*Math.sinh(j)+C*b*Math.cosh(j))/C}}const S={calculatedDuration:p&&f||null,next:C=>{const k=x(C);if(p)a.done=C>=f;else{let _=0;v<1&&(_=C===0?Es(g):AT(x,C,k));const j=Math.abs(_)<=r,R=Math.abs(o-k)<=s;a.done=j&&R}return a.value=a.done?o:k,a},toString:()=>{const C=Math.min(RT(S),Wy),k=TT(_=>S.next(C*_).value,C,30);return C+"ms "+k}};return S}function yS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=j=>a!==void 0&&j<a||c!==void 0&&j>c,g=j=>a===void 0?c:c===void 0||Math.abs(a-j)<Math.abs(c-j)?a:c;let v=n*t;const b=f+v,y=o===void 0?b:o(b);y!==b&&(v=y-f);const w=j=>-v*Math.exp(-j/r),x=j=>y+w(j),S=j=>{const R=w(j),P=x(j);h.done=Math.abs(R)<=u,h.value=h.done?y:P};let C,k;const _=j=>{p(h.value)&&(C=j,k=MT({keyframes:[h.value,g(h.value)],velocity:AT(x,j,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return _(0),{calculatedDuration:null,next:j=>{let R=!1;return!k&&C===void 0&&(R=!0,S(j),_(j)),C!==void 0&&j>=C?k.next(j-C):(!R&&S(j),h)}}}const Q6=Cu(.42,0,1,1),Z6=Cu(0,0,.58,1),IT=Cu(.42,0,.58,1),eB=e=>Array.isArray(e)&&typeof e[0]!="number",l0=e=>Array.isArray(e)&&typeof e[0]=="number",vS={linear:Xn,easeIn:Q6,easeInOut:IT,easeOut:Z6,circIn:e0,circInOut:dT,circOut:uT,backIn:Zx,backInOut:lT,backOut:aT,anticipate:cT},xS=e=>{if(l0(e)){Fy(e.length===4);const[t,n,r,s]=e;return Cu(t,n,r,s)}else if(typeof e=="string")return Fy(vS[e]!==void 0),vS[e];return e},tB=(e,t)=>n=>t(e(n)),Eu=(...e)=>e.reduce(tB),bt=(e,t,n)=>e+(t-e)*n;function wm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function nB({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;s=wm(c,a,e+1/3),i=wm(c,a,e),o=wm(c,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function eh(e,t){return n=>n>0?t:e}
vendor: 5,043 bytes, line 576
576const bm=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},rB=[Vy,so,ga],sB=e=>rB.find(t=>t.test(e));function wS(e){const t=sB(e);if(!t)return!1;let n=t.parse(e);return t===ga&&(n=nB(n)),n}const bS=(e,t)=>{const n=wS(e),r=wS(t);if(!n||!r)return eh(e,t);const s={...n};return i=>(s.red=bm(n.red,r.red,i),s.green=bm(n.green,r.green,i),s.blue=bm(n.blue,r.blue,i),s.alpha=bt(n.alpha,r.alpha,i),so.transform(s))},qy=new Set(["none","hidden"]);function iB(e,t){return qy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function oB(e,t){return n=>bt(e,t,n)}function c0(e){return typeof e=="number"?oB:typeof e=="string"?t0(e)?eh:ln.test(e)?bS:cB:Array.isArray(e)?OT:typeof e=="object"?ln.test(e)?bS:aB:eh}function OT(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>c0(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function aB(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=c0(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function lB(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][s[o]],c=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=c,s[o]++}return r}const cB=(e,t)=>{const n=ji.createTransformer(t),r=iu(e),s=iu(t);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?qy.has(e)&&!s.values.length||qy.has(t)&&!r.values.length?iB(e,t):Eu(OT(lB(r,s),s.values),n):eh(e,t)};function DT(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?bt(e,t,n):c0(e)(e,t)}function uB(e,t,n){const r=[],s=n||DT,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||Xn:t;a=Eu(c,a)}r.push(a)}return r}function dB(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Fy(i===t.length),i===1)return()=>t[0];if(i===2&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=uB(t,r,s),a=o.length,c=u=>{let d=0;if(a>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=Ya(e[d],e[d+1],u);return o[d](f)};return n?u=>c(Is(e[0],e[i-1],u)):c}function fB(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Ya(0,t,r);e.push(bt(n,1,s))}}function hB(e){const t=[0];return fB(t,e.length-1),t}function pB(e,t){return e.map(n=>n*t)}function mB(e,t){return e.map(()=>t||IT).splice(0,e.length-1)}function th({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=eB(r)?r.map(xS):xS(r),i={done:!1,value:t[0]},o=pB(n&&n.length===t.length?n:hB(t),e),a=dB(o,t,{ease:Array.isArray(s)?s:mB(t,s)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const gB=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ht.update(t,!0),stop:()=>Ci(t),now:()=>en.isProcessing?en.timestamp:es.now()}},yB={decay:yS,inertia:yS,tween:th,keyframes:th,spring:MT},vB=e=>e/100;class u0 extends NT{constructor(t){super(t),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:c}=this.options;c&&c()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||n0,a=(c,u)=>this.onKeyframesResolved(c,u);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(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,a=a0(n)?n:yB[n]||th;let c,u;a!==th&&typeof t[0]!="number"&&(c=Eu(vB,DT(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});i==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=RT(d));const{calculatedDuration:f}=d,h=f+s,p=h*(r+1)-s;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:j}=this.options;return{done:!0,value:j[j.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:v,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,S=i;
vendor: 77,622 bytes, line 576
576if(p){const j=Math.min(this.currentTime,d)/f;let R=Math.floor(j),P=j%1;!P&&j>=1&&(P=1),P===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(g==="reverse"?(P=1-P,v&&(P-=v/f)):g==="mirror"&&(S=o)),x=Is(0,1,P)*f}const C=w?{done:!1,value:c[0]}:S.next(x);a&&(C.value=a(C.value));let{done:k}=C;!w&&u!==null&&(k=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return _&&s!==void 0&&(C.value=Zh(c,this.options,s)),b&&b(C.value),_&&this.finish(),C}get duration(){const{resolved:t}=this;return t?Ns(t.calculatedDuration):0}get time(){return Ns(this.currentTime)}set time(t){t=Es(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Ns(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=gB,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(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(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}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(t){return this.startTime=0,this.tick(t,!0)}}const xB=new Set(["opacity","clipPath","filter","transform"]);function d0(e){let t;return()=>(t===void 0&&(t=e()),t)}const wB={linearEasing:void 0};function bB(e,t){const n=d0(e);return()=>{var r;return(r=wB[t])!==null&&r!==void 0?r:n()}}const nh=bB(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function LT(e){return!!(typeof e=="function"&&nh()||!e||typeof e=="string"&&(e in Gy||nh())||l0(e)||Array.isArray(e)&&e.every(LT))}const Zl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Gy={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 $T(e,t){if(e)return typeof e=="function"&&nh()?TT(e,t):l0(e)?Zl(e):Array.isArray(e)?e.map(n=>$T(n,t)||Gy.easeOut):Gy[e]}function SB(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=$T(a,s);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}function SS(e,t){e.timeline=t,e.onfinish=null}const kB=d0(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),rh=10,_B=2e4;function CB(e){return a0(e.type)||e.type==="spring"||!LT(e.ease)}function jB(e,t){const n=new u0({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<_B;)r=n.sample(i),s.push(r.value),i+=rh;return{times:void 0,keyframes:s,duration:i-rh,ease:"linear"}}const FT={anticipate:cT,backInOut:lT,circInOut:dT};function EB(e){return e in FT}class kS extends NT{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ET(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:s=300,times:i,ease:o,type:a,motionValue:c,name:u,startTime:d}=this.options;if(!(!((r=c.owner)===null||r===void 0)&&r.current))return!1;if(typeof o=="string"&&nh()&&EB(o)&&(o=FT[o]),CB(this.options)){const{onComplete:h,onUpdate:p,motionValue:g,element:v,...b}=this.options,y=jB(t,b);t=y.keyframes,t.length===1&&(t[1]=t[0]),s=y.duration,i=y.times,o=y.ease,a="keyframes"}const f=SB(c.owner.current,u,t,{...this.options,duration:s,times:i,ease:o});return f.startTime=d??this.calcStartTime(),this.pendingTimeline?(SS(f,this.pendingTimeline),this.pendingTimeline=void 0):f.onfinish=()=>{const{onComplete:h}=this.options;c.set(Zh(t,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:f,duration:s,times:i,type:a,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Ns(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Ns(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Es(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Xn;const{animation:r}=n;SS(r,t)}return Xn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...p}=this.options,g=new u0({...p,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),v=Es(this.time);u.setWithVelocity(g.sample(v-rh).value,g.sample(v).value,rh)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:a}=t;return kB()&&r&&xB.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const NB=d0(()=>window.ScrollTimeline!==void 0);class TB{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>NB()&&s.attachTimeline?s.attachTimeline(t):n(s));return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function PB({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const f0=(e,t,n,r={},s,i)=>o=>{const a=Qx(r,e)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Es(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};PB(a)||(d={...d,...t6(e,d)}),d.duration&&(d.duration=Es(d.duration)),d.repeatDelay&&(d.repeatDelay=Es(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!i&&t.get()!==void 0){const h=Zh(d.keyframes,a);if(h!==void 0)return ht.update(()=>{d.onUpdate(h),d.onComplete()}),new TB([])}return!i&&kS.supports(d)?new kS(d):new u0(d)},AB=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),RB=e=>$y(e)?e[e.length-1]||0:e;function h0(e,t){e.indexOf(t)===-1&&e.push(t)}function p0(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class m0{constructor(){this.subscriptions=[]}add(t){return h0(this.subscriptions,t),()=>p0(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _S=30,MB=e=>!isNaN(parseFloat(e));class IB{constructor(t,n={}){this.version="11.14.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=es.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(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=es.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=MB(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new m0);const r=this.events[t].add(n);return t==="change"?()=>{r(),ht.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=es.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>_S)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,_S);return PT(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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 ou(e,t){return new IB(e,t)}function OB(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ou(n))}function DB(e,t){const n=Qh(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=RB(i[o]);OB(e,o,a)}}const g0=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),LB="framerAppearId",zT="data-"+g0(LB);function BT(e){return e.props[zT]}const un=e=>!!(e&&e.getVelocity);function $B(e){return!!(un(e)&&e.add)}function Ky(e,t){const n=e.getValue("willChange");if($B(n))return n.add(t)}function FB({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function VT(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...c}=t;r&&(o=r);const u=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const f in c){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),p=c[f];if(p===void 0||d&&FB(d,f))continue;const g={delay:n,...Qx(o||{},f)};let v=!1;if(window.MotionHandoffAnimation){const y=BT(e);if(y){const w=window.MotionHandoffAnimation(y,f,ht);w!==null&&(g.startTime=w,v=!0)}}Ky(e,f),h.start(f0(f,h,p,e.shouldReduceMotion&&Ao.has(f)?{type:!1}:g,e,v));const b=h.animation;b&&u.push(b)}return a&&Promise.all(u).then(()=>{ht.update(()=>{a&&DB(e,a)})}),u}function Yy(e,t,n={}){var r;const s=Qh(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(VT(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return zB(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[o,a]:[a,o];return u().then(()=>d())}else return Promise.all([o(),a(n.delay)])}function zB(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(BB).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(Yy(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function BB(e,t){return e.sortNodePosition(t)}function VB(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Yy(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Yy(e,t,n);else{const s=typeof t=="function"?Qh(e,t,n.custom):t;r=Promise.all(VT(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const UB=Xx.length;function UT(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?UT(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<UB;n++){const r=Xx[n],s=e.props[r];(ru(s)||s===!1)&&(t[r]=s)}return t}const HB=[...Jx].reverse(),WB=Jx.length;function qB(e){return t=>Promise.all(t.map(({animation:n,options:r})=>VB(e,n,r)))}function GB(e){let t=qB(e),n=CS(),r=!0;const s=c=>(u,d)=>{var f;const h=Qh(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...v}=h;u={...u,...v,...g}}return u};function i(c){t=c(e)}function o(c){const{props:u}=e,d=UT(e.parent)||{},f=[],h=new Set;let p={},g=1/0;for(let b=0;b<WB;b++){const y=HB[b],w=n[y],x=u[y]!==void 0?u[y]:d[y],S=ru(x),C=y===c?w.isActive:null;C===!1&&(g=b);let k=x===d[y]&&x!==u[y]&&S;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),w.protectedKeys={...p},!w.isActive&&C===null||!x&&!w.prevProp||Xh(x)||typeof x=="boolean")continue;const _=KB(w.prevProp,x);let j=_||y===c&&w.isActive&&!k&&S||b>g&&S,R=!1;const P=Array.isArray(x)?x:[x];let M=P.reduce(s(y),{});C===!1&&(M={});const{prevResolvedValues:T={}}=w,L={...T,...M},F=I=>{j=!0,h.has(I)&&(R=!0,h.delete(I)),w.needsAnimating[I]=!0;const A=e.getValue(I);A&&(A.liveStyle=!1)};for(const I in L){const A=M[I],D=T[I];if(p.hasOwnProperty(I))continue;let E=!1;$y(A)&&$y(D)?E=!nT(A,D):E=A!==D,E?A!=null?F(I):h.add(I):A!==void 0&&h.has(I)?F(I):w.protectedKeys[I]=!0}w.prevProp=x,w.prevResolvedValues=M,w.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(j=!1),j&&(!(k&&_)||R)&&f.push(...P.map(I=>({animation:I,options:{type:y}})))}if(h.size){const b={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),b[y]=w??null}),f.push({animation:b})}let v=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(f):Promise.resolve()}function a(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,u)}),n[c].isActive=u;const f=o(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=CS(),r=!0}}}function KB(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nT(t,e):!1}function Vi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function CS(){return{animate:Vi(!0),whileInView:Vi(),whileHover:Vi(),whileTap:Vi(),whileDrag:Vi(),whileFocus:Vi(),exit:Vi()}}class Li{constructor(t){this.isMounted=!1,this.node=t}update(){}}class YB extends Li{constructor(t){super(t),t.animationState||(t.animationState=GB(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let JB=0;class XB extends Li{constructor(){super(...arguments),this.id=JB++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const QB={animation:{Feature:YB},exit:{Feature:XB}},br={x:!1,y:!1};function HT(){return br.x||br.y}function ZB(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const i=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function WT(e,t){const n=ZB(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function jS(e){return t=>{t.pointerType==="touch"||HT()||e(t)}}function e8(e,t,n={}){const[r,s,i]=WT(e,n),o=jS(a=>{const{target:c}=a,u=t(a);if(!u||!c)return;const d=jS(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}const y0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ec=new WeakSet;function ES(e){return t=>{t.key==="Enter"&&e(t)}}function Sm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const t8=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ES(()=>{if(ec.has(n))return;Sm(n,"down");const s=ES(()=>{Sm(n,"up")}),i=()=>Sm(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)},n8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function r8(e){return n8.has(e.tagName)||e.tabIndex!==-1}const qT=(e,t)=>t?e===t?!0:qT(e,t.parentElement):!1;function NS(e){return y0(e)&&!HT()}function s8(e,t,n={}){const[r,s,i]=WT(e,n),o=a=>{const c=a.currentTarget;if(!NS(a)||ec.has(c))return;ec.add(c);const u=t(a),d=(p,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!NS(p)||!ec.has(c))&&(ec.delete(c),u&&u(p,{success:g}))},f=p=>{d(p,n.useGlobalTarget||qT(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{r8(a)||(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),a.addEventListener("focus",u=>t8(u,s),s)}),i}function i8(e){return e==="x"||e==="y"?br[e]?null:(br[e]=!0,()=>{br[e]=!1}):br.x||br.y?null:(br.x=br.y=!0,()=>{br.x=br.y=!1})}function Nu(e){return{point:{x:e.pageX,y:e.pageY}}}const o8=e=>t=>y0(t)&&e(t,Nu(t));function au(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function bc(e,t,n,r){return au(e,t,o8(n),r)}const TS=(e,t)=>Math.abs(e-t);function a8(e,t){const n=TS(e.x,t.x),r=TS(e.y,t.y);return Math.sqrt(n**2+r**2)}class GT{constructor(t,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 f=_m(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=a8(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=f,{timestamp:v}=en;this.history.push({...g,timestamp:v});const{onStart:b,onMove:y}=this.handlers;h||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=km(h,this.transformPagePoint),ht.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=_m(f.type==="pointercancel"?this.lastMoveEventInfo:km(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,b),g&&g(f,b)},!y0(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const o=Nu(t),a=km(o,this.transformPagePoint),{point:c}=a,{timestamp:u}=en;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,_m(a,this.history)),this.removeListeners=Eu(bc(this.contextWindow,"pointermove",this.handlePointerMove),bc(this.contextWindow,"pointerup",this.handlePointerUp),bc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ci(this.updatePoint)}}function km(e,t){return t?{point:t(e.point)}:e}function PS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _m({point:e},t){return{point:e,delta:PS(e,KT(t)),offset:PS(e,l8(t)),velocity:c8(t,.1)}}function l8(e){return e[0]}function KT(e){return e[e.length-1]}function c8(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=KT(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Es(t)));)n--;if(!r)return{x:0,y:0};const i=Ns(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 ya(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const YT=1e-4,u8=1-YT,d8=1+YT,JT=.01,f8=0-JT,h8=0+JT;function tr(e){return e.max-e.min}function p8(e,t,n){return Math.abs(e-t)<=n}function AS(e,t,n,r=.5){e.origin=r,e.originPoint=bt(t.min,t.max,e.origin),e.scale=tr(n)/tr(t),e.translate=bt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=u8&&e.scale<=d8||isNaN(e.scale))&&(e.scale=1),(e.translate>=f8&&e.translate<=h8||isNaN(e.translate))&&(e.translate=0)}function Sc(e,t,n,r){AS(e.x,t.x,n.x,r?r.originX:void 0),AS(e.y,t.y,n.y,r?r.originY:void 0)}function RS(e,t,n){e.min=n.min+t.min,e.max=e.min+tr(t)}function m8(e,t,n){RS(e.x,t.x,n.x),RS(e.y,t.y,n.y)}function MS(e,t,n){e.min=t.min-n.min,e.max=e.min+tr(t)}function kc(e,t,n){MS(e.x,t.x,n.x),MS(e.y,t.y,n.y)}function g8(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?bt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?bt(n,e,r.max):Math.min(e,n)),e}function IS(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function y8(e,{top:t,left:n,bottom:r,right:s}){return{x:IS(e.x,n,s),y:IS(e.y,t,r)}}function OS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function v8(e,t){return{x:OS(e.x,t.x),y:OS(e.y,t.y)}}function x8(e,t){let n=.5;const r=tr(e),s=tr(t);return s>r?n=Ya(t.min,t.max-r,e.min):r>s&&(n=Ya(e.min,e.max-s,t.min)),Is(0,1,n)}function w8(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Jy=.35;function b8(e=Jy){return e===!1?e=0:e===!0&&(e=Jy),{x:DS(e,"left","right"),y:DS(e,"top","bottom")}}function DS(e,t,n){return{min:LS(e,t),max:LS(e,n)}}function LS(e,t){return typeof e=="number"?e:e[t]||0}const $S=()=>({translate:0,scale:1,origin:0,originPoint:0}),va=()=>({x:$S(),y:$S()}),FS=()=>({min:0,max:0}),Pt=()=>({x:FS(),y:FS()});function cr(e){return[e("x"),e("y")]}function XT({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function S8({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function k8(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Cm(e){return e===void 0||e===1}function Xy({scale:e,scaleX:t,scaleY:n}){return!Cm(e)||!Cm(t)||!Cm(n)}function Yi(e){return Xy(e)||QT(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function QT(e){return zS(e.x)||zS(e.y)}function zS(e){return e&&e!=="0%"}function sh(e,t,n){const r=e-n,s=t*r;return n+s}function BS(e,t,n,r,s){return s!==void 0&&(e=sh(e,s,r)),sh(e,n,r)+t}function Qy(e,t=0,n=1,r,s){e.min=BS(e.min,t,n,r,s),e.max=BS(e.max,t,n,r,s)}function ZT(e,{x:t,y:n}){Qy(e.x,t.translate,t.scale,t.originPoint),Qy(e.y,n.translate,n.scale,n.originPoint)}const VS=.999999999999,US=1.0000000000001;function _8(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&wa(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ZT(e,o)),r&&Yi(i.latestValues)&&wa(e,i.latestValues))}t.x<US&&t.x>VS&&(t.x=1),t.y<US&&t.y>VS&&(t.y=1)}function xa(e,t){e.min=e.min+t,e.max=e.max+t}function HS(e,t,n,r,s=.5){const i=bt(e.min,e.max,s);Qy(e,t,n,i,r)}function wa(e,t){HS(e.x,t.x,t.scaleX,t.scale,t.originX),HS(e.y,t.y,t.scaleY,t.scale,t.originY)}function eP(e,t){return XT(k8(e.getBoundingClientRect(),t))}function C8(e,t,n){const r=eP(e,n),{scroll:s}=t;return s&&(xa(r.x,s.offset.x),xa(r.y,s.offset.y)),r}const tP=({current:e})=>e?e.ownerDocument.defaultView:null,j8=new WeakMap;class E8{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Pt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Nu(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=i8(h),!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),cr(b=>{let y=this.getAxisMotionValue(b).get()||0;if(Zr.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[b];x&&(y=tr(x)*(parseFloat(y)/100))}}this.originPoint[b]=y}),g&&ht.postRender(()=>g(d,f)),Ky(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:v}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=f;if(p&&this.currentDirection===null){this.currentDirection=N8(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),v&&v(d,f)},a=(d,f)=>this.stop(d,f),c=()=>cr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new GT(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:tP(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ht.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:s}=this.getProps();if(!r||!bd(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=g8(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&ya(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=y8(s.layoutBox,n):this.constraints=!1,this.elastic=b8(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&cr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=w8(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ya(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=C8(r,s.root,this.visualElement.getTransformPagePoint());let o=v8(s.layout.layoutBox,i);if(n){const a=n(S8(o));this.hasMutatedConstraints=!!a,a&&(o=XT(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=cr(d=>{if(!bd(d,n,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ky(this.visualElement,t),r.start(f0(t,r,0,n,this.visualElement,!1))}stopAnimation(){cr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){cr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){cr(n=>{const{drag:r}=this.getProps();if(!bd(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(t[n]-bt(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ya(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};cr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();s[o]=x8({min:c,max:c},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(),cr(o=>{if(!bd(o,t,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(bt(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;j8.set(this.visualElement,this);const t=this.visualElement.current,n=bc(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();ya(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ht.read(r);const o=au(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(cr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Jy,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function bd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function N8(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class T8 extends Li{constructor(t){super(t),this.removeGroupControls=Xn,this.removeListeners=Xn,this.controls=new E8(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xn}unmount(){this.removeGroupControls(),this.removeListeners()}}const WS=e=>(t,n)=>{e&&ht.postRender(()=>e(t,n))};class P8 extends Li{constructor(){super(...arguments),this.removePointerDownListener=Xn}onPointerDown(t){this.session=new GT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tP(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:WS(t),onStart:WS(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&ht.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=bc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ep=m.createContext(null);function A8(){const e=m.useContext(ep);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,s=m.useId();m.useEffect(()=>r(s),[]);const i=m.useCallback(()=>n&&n(s),[s,n]);return!t&&n?[!1,i]:[!0]}const v0=m.createContext({}),nP=m.createContext({}),nf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function qS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ie.test(e))e=parseFloat(e);else return e;const n=qS(e,t.target.x),r=qS(e,t.target.y);return`${n}% ${r}%`}},R8={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ji.parse(e);if(s.length>5)return r;const i=ji.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=c;const u=bt(a,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}},ih={};function M8(e){Object.assign(ih,e)}const{schedule:x0,cancel:mie}=rT(queueMicrotask,!1);class I8 extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;M8(O8),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()})),nf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ht.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),x0.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rP(e){const[t,n]=A8(),r=m.useContext(v0);return l.jsx(I8,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(nP),isPresent:t,safeToRemove:n})}const O8={borderRadius:{...Rl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rl,borderTopRightRadius:Rl,borderBottomLeftRadius:Rl,borderBottomRightRadius:Rl,boxShadow:R8},sP=["TopLeft","TopRight","BottomLeft","BottomRight"],D8=sP.length,GS=e=>typeof e=="string"?parseFloat(e):e,KS=e=>typeof e=="number"||Ie.test(e);function L8(e,t,n,r,s,i){s?(e.opacity=bt(0,n.opacity!==void 0?n.opacity:1,$8(r)),e.opacityExit=bt(t.opacity!==void 0?t.opacity:1,0,F8(r))):i&&(e.opacity=bt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<D8;o++){const a=`border${sP[o]}Radius`;let c=YS(t,a),u=YS(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||KS(c)===KS(u)?(e[a]=Math.max(bt(GS(c),GS(u),r),0),(Zr.test(u)||Zr.test(c))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=bt(t.rotate||0,n.rotate||0,r))}function YS(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $8=iP(0,.5,uT),F8=iP(.5,.95,Xn);function iP(e,t,n){return r=>r<e?0:r>t?1:n(Ya(e,t,r))}function JS(e,t){e.min=t.min,e.max=t.max}function or(e,t){JS(e.x,t.x),JS(e.y,t.y)}function XS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function QS(e,t,n,r,s){return e-=t,e=sh(e,1/n,r),s!==void 0&&(e=sh(e,1/s,r)),e}function z8(e,t=0,n=1,r=.5,s,i=e,o=e){if(Zr.test(t)&&(t=parseFloat(t),t=bt(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=bt(i.min,i.max,r);e===i&&(a-=t),e.min=QS(e.min,t,n,a,s),e.max=QS(e.max,t,n,a,s)}function ZS(e,t,[n,r,s],i,o){z8(e,t[n],t[r],t[s],t.scale,i,o)}const B8=["x","scaleX","originX"],V8=["y","scaleY","originY"];function ek(e,t,n,r){ZS(e.x,t,B8,n?n.x:void 0,r?r.x:void 0),ZS(e.y,t,V8,n?n.y:void 0,r?r.y:void 0)}function tk(e){return e.translate===0&&e.scale===1}function oP(e){return tk(e.x)&&tk(e.y)}function nk(e,t){return e.min===t.min&&e.max===t.max}function U8(e,t){return nk(e.x,t.x)&&nk(e.y,t.y)}function rk(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aP(e,t){return rk(e.x,t.x)&&rk(e.y,t.y)}function sk(e){return tr(e.x)/tr(e.y)}function ik(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class H8{constructor(){this.members=[]}add(t){h0(this.members,t),t.scheduleRender()}remove(t){if(p0(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===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(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function W8(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const q8=(e,t)=>e.depth-t.depth;class G8{constructor(){this.children=[],this.isDirty=!1}add(t){h0(this.children,t),this.isDirty=!0}remove(t){p0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(q8),this.isDirty=!1,this.children.forEach(t)}}function rf(e){const t=un(e)?e.get():e;return AB(t)?t.toValue():t}function K8(e,t){const n=es.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ci(r),e(i-t))};return ht.read(r,!0),()=>Ci(r)}function Y8(e){return e instanceof SVGElement&&e.tagName!=="svg"}function J8(e,t,n){const r=un(e)?e:ou(e);return r.start(f0("",r,t,n)),r.animation}const Ji={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tc=typeof window<"u"&&window.MotionDebug!==void 0,jm=["","X","Y","Z"],X8={visibility:"hidden"},ok=1e3;let Q8=0;function Em(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function lP(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=BT(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ht,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&lP(r)}function cP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Q8++,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,tc&&(Ji.totalNodes=Ji.resolvedTargetDeltas=Ji.recalculatedProjection=0),this.nodes.forEach(tV),this.nodes.forEach(oV),this.nodes.forEach(aV),this.nodes.forEach(nV),tc&&window.MotionDebug.record(Ji)},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 c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new G8)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new m0),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Y8(o),this.instance=o;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||c)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=K8(h,250),nf.hasAnimatedSinceResize&&(nf.hasAnimatedSinceResize=!1,this.nodes.forEach(lk))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||d.getDefaultTransition()||fV,{onLayoutAnimationStart:b,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!aP(this.targetLayout,g)||p,x=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const S={...Qx(v,"layout"),onPlay:b,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else h||lk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}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,Ci(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(lV),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&&lP(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ak);return}this.isUpdating||this.nodes.forEach(sV),this.isUpdating=!1,this.nodes.forEach(iV),this.nodes.forEach(Z8),this.nodes.forEach(eV),this.clearAllSnapshots();const a=es.now();en.delta=Is(0,1e3/60,a-en.timestamp),en.timestamp=a,en.isProcessing=!0,ym.update.process(en),ym.preRender.process(en),ym.render.process(en),en.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,x0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rV),this.sharedNodes.forEach(cV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ht.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ht.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Pt(),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 c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!oP(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&(a||Yi(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),hV(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return Pt();const c=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(pV))){const{scroll:d}=this.root;d&&(xa(c.x,d.offset.x),xa(c.y,d.offset.y))}return c}removeElementScroll(o){var a;const c=Pt();if(or(c,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return c;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&or(c,o),xa(c.x,f.offset.x),xa(c.y,f.offset.y))}return c}applyTransform(o,a=!1){const c=Pt();or(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&wa(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Yi(d.latestValues)&&wa(c,d.latestValues)}return Yi(this.latestValues)&&wa(c,this.latestValues),c}removeTransform(o){const a=Pt();or(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Yi(u.latestValues))continue;Xy(u.latestValues)&&u.updateSnapshot();const d=Pt(),f=u.measurePageBox();or(d,f),ek(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Yi(this.latestValues)&&ek(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!==en.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=en.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pt(),this.relativeTargetOrigin=Pt(),kc(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),or(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Pt(),this.targetWithTransforms=Pt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),m8(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):or(this.target,this.layout.layoutBox),ZT(this.target,this.targetDelta)):or(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pt(),this.relativeTargetOrigin=Pt(),kc(this.relativeTargetOrigin,this.target,p.target),or(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}tc&&Ji.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Xy(this.parent.latestValues)||QT(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),c=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===en.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;or(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;_8(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Pt());const{target:g}=a;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(XS(this.prevProjectionDelta.x,this.projectionDelta.x),XS(this.prevProjectionDelta.y,this.projectionDelta.y)),Sc(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!ik(this.projectionDelta.x,this.prevProjectionDelta.x)||!ik(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),tc&&Ji.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=va(),this.projectionDelta=va(),this.projectionDeltaWithTransform=va()}setAnimationOrigin(o,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=va();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Pt(),p=c?c.source:void 0,g=this.layout?this.layout.source:void 0,v=p!==g,b=this.getStack(),y=!b||b.members.length<=1,w=!!(v&&!y&&this.options.crossfade===!0&&!this.path.some(dV));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const C=S/1e3;ck(f.x,o.x,C),ck(f.y,o.y,C),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),uV(this.relativeTarget,this.relativeTargetOrigin,h,C),x&&U8(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Pt()),or(x,this.relativeTarget)),v&&(this.animationValues=d,L8(d,u,this.latestValues,C,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},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&&(Ci(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ht.update(()=>{nf.hasAnimatedSinceResize=!0,this.currentAnimation=J8(0,ok,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},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(ok),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:d}=o;if(!(!a||!c||!u)){if(this!==o&&this.layout&&u&&uP(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Pt();const f=tr(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=tr(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}or(a,c),wa(a,d),Sc(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new H8),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),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:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&Em("z",o,u,this.animationValues);for(let d=0;d<jm.length;d++)Em(`rotate${jm[d]}`,o,u,this.animationValues),Em(`skew${jm[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}getProjectionStyles(o){var a,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return X8;const u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=rf(o==null?void 0:o.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const v={};return this.options.layoutId&&(v.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,v.pointerEvents=rf(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Yi(this.latestValues)&&(v.transform=d?d({},""):"none",this.hasProjected=!1),v}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=W8(this.projectionDeltaWithTransform,this.treeScale,h),d&&(u.transform=d(h,u.transform));const{x:p,y:g}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,f.animationValues?u.opacity=f===this?(c=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const v in ih){if(h[v]===void 0)continue;const{correct:b,applyTo:y}=ih[v],w=u.transform==="none"?h[v]:b(h[v],f);if(y){const x=y.length;for(let S=0;S<x;S++)u[y[S]]=w}else u[v]=w}return this.options.layoutId&&(u.pointerEvents=f===this?rf(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(ak),this.root.sharedNodes.clear()}}}function Z8(e){e.updateLayout()}function eV(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?cr(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=tr(h);h.min=r[f].min,h.max=h.min+p}):uP(i,n.layoutBox,r)&&cr(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=tr(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=va();Sc(a,r,n.layoutBox);const c=va();o?Sc(c,e.applyTransform(s,!0),n.measuredBox):Sc(c,r,n.layoutBox);const u=!oP(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const g=Pt();kc(g,n.layoutBox,h.layoutBox);const v=Pt();kc(v,r,p.layoutBox),aP(g,v)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function tV(e){tc&&Ji.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function nV(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rV(e){e.clearSnapshot()}function ak(e){e.clearMeasurements()}function sV(e){e.isLayoutDirty=!1}function iV(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function lk(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function oV(e){e.resolveTargetDelta()}function aV(e){e.calcProjection()}function lV(e){e.resetSkewAndRotation()}function cV(e){e.removeLeadSnapshot()}function ck(e,t,n){e.translate=bt(t.translate,0,n),e.scale=bt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function uk(e,t,n,r){e.min=bt(t.min,n.min,r),e.max=bt(t.max,n.max,r)}function uV(e,t,n,r){uk(e.x,t.x,n.x,r),uk(e.y,t.y,n.y,r)}function dV(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const fV={duration:.45,ease:[.4,0,.1,1]},dk=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fk=dk("applewebkit/")&&!dk("chrome/")?Math.round:Xn;function hk(e){e.min=fk(e.min),e.max=fk(e.max)}function hV(e){hk(e.x),hk(e.y)}function uP(e,t,n){return e==="position"||e==="preserve-aspect"&&!p8(sk(t),sk(n),.2)}function pV(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const mV=cP({attachResizeListener:(e,t)=>au(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Nm={current:void 0},dP=cP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Nm.current){const e=new mV({});e.mount(window),e.setOptions({layoutScroll:!0}),Nm.current=e}return Nm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),gV={pan:{Feature:P8},drag:{Feature:T8,ProjectionNode:dP,MeasureLayout:rP}};function pk(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ht.postRender(()=>i(t,Nu(t)))}class yV extends Li{mount(){const{current:t}=this.node;t&&(this.unmount=e8(t,n=>(pk(this.node,n,"Start"),r=>pk(this.node,r,"End"))))}unmount(){}}class vV extends Li{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Eu(au(this.node.current,"focus",()=>this.onFocus()),au(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function mk(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ht.postRender(()=>i(t,Nu(t)))}class xV extends Li{mount(){const{current:t}=this.node;t&&(this.unmount=s8(t,n=>(mk(this.node,n,"Start"),(r,{success:s})=>mk(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Zy=new WeakMap,Tm=new WeakMap,wV=e=>{const t=Zy.get(e.target);t&&t(e)},bV=e=>{e.forEach(wV)};function SV({root:e,...t}){const n=e||document;Tm.has(n)||Tm.set(n,{});const r=Tm.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(bV,{root:e,...t})),r[s]}function kV(e,t,n){const r=SV(t);return Zy.set(e,n),r.observe(e),()=>{Zy.delete(e),r.unobserve(e)}}const _V={some:0,all:1};class CV extends Li{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:_V[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return kV(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(jV(t,n))&&this.startObserver()}unmount(){}}function jV({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const EV={inView:{Feature:CV},tap:{Feature:xV},focus:{Feature:vV},hover:{Feature:yV}},NV={layout:{ProjectionNode:dP,MeasureLayout:rP}},w0=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),tp=m.createContext({}),b0=typeof window<"u",fP=b0?m.useLayoutEffect:m.useEffect,hP=m.createContext({strict:!1});function TV(e,t,n,r,s){var i,o;const{visualElement:a}=m.useContext(tp),c=m.useContext(hP),u=m.useContext(ep),d=m.useContext(w0).reducedMotion,f=m.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=m.useContext(nP);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&PV(f.current,n,s,p);const g=m.useRef(!1);m.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const v=n[zT],b=m.useRef(!!v&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,v))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,v)));return fP(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),x0.render(h.render),b.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,v)}),b.current=!1))}),h}function PV(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:pP(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&ya(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function pP(e){if(e)return e.options.allowProjection!==!1?e.projection:pP(e.parent)}function AV(e,t,n){return m.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):ya(n)&&(n.current=r))},[t])}function np(e){return Xh(e.animate)||Xx.some(t=>ru(e[t]))}function mP(e){return!!(np(e)||e.variants)}function RV(e,t){if(np(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ru(n)?n:void 0,animate:ru(r)?r:void 0}}return e.inherit!==!1?t:{}}function MV(e){const{initial:t,animate:n}=RV(e,m.useContext(tp));return m.useMemo(()=>({initial:t,animate:n}),[gk(t),gk(n)])}function gk(e){return Array.isArray(e)?e.join(" "):e}const yk={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"]},Ja={};for(const e in yk)Ja[e]={isEnabled:t=>yk[e].some(n=>!!t[n])};function IV(e){for(const t in e)Ja[t]={...Ja[t],...e[t]}}const OV=Symbol.for("motionComponentSymbol");function DV({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){e&&IV(e);function i(a,c){let u;const d={...m.useContext(w0),...a,layoutId:LV(a)},{isStatic:f}=d,h=MV(a),p=r(a,f);if(!f&&b0){$V();const g=FV(d);u=g.MeasureLayout,h.visualElement=TV(s,p,d,t,g.ProjectionNode)}return l.jsxs(tp.Provider,{value:h,children:[u&&h.visualElement?l.jsx(u,{visualElement:h.visualElement,...d}):null,n(s,a,AV(p,h.visualElement,c),p,f,h.visualElement)]})}const o=m.forwardRef(i);return o[OV]=s,o}function LV({layoutId:e}){const t=m.useContext(v0).id;return t&&e!==void 0?t+"-"+e:e}function $V(e,t){m.useContext(hP).strict}function FV(e){const{drag:t,layout:n}=Ja;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const zV=["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 S0(e){return typeof e!="string"||e.includes("-")?!1:!!(zV.indexOf(e)>-1||/[A-Z]/u.test(e))}function gP(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const yP=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 vP(e,t,n,r){gP(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(yP.has(s)?s:g0(s),t.attrs[s])}function xP(e,{layout:t,layoutId:n}){return Ao.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ih[e]||e==="opacity")}function k0(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(un(s[o])||t.style&&un(t.style[o])||xP(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}function wP(e,t,n){const r=k0(e,t,n);for(const s in e)if(un(e[s])||un(t[s])){const i=_u.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function _0(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}function BV({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,s,i){const o={latestValues:VV(r,s,i,e),renderState:t()};return n&&(o.mount=a=>n(r,a,o)),o}const bP=e=>(t,n)=>{const r=m.useContext(tp),s=m.useContext(ep),i=()=>BV(e,t,r,s);return n?i():_0(i)};function VV(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=rf(i[h]);let{initial:o,animate:a}=e;const c=np(e),u=mP(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?a:o;if(f&&typeof f!="boolean"&&!Xh(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const g=Yx(e,h[p]);if(g){const{transitionEnd:v,transition:b,...y}=g;for(const w in y){let x=y[w];if(Array.isArray(x)){const S=d?x.length-1:0;x=x[S]}x!==null&&(s[w]=x)}for(const w in v)s[w]=v[w]}}}return s}const C0=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),SP=()=>({...C0(),attrs:{}}),kP=(e,t)=>t&&typeof e=="number"?t.transform(e):e,UV={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HV=_u.length;function WV(e,t,n){let r="",s=!0;for(let i=0;i<HV;i++){const o=_u[i],a=e[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const u=kP(a,i0[o]);if(!c){s=!1;const d=UV[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function j0(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const c in t){const u=t[c];if(Ao.has(c)){o=!0;continue}else if(mT(c)){s[c]=u;continue}else{const d=kP(u,i0[c]);c.startsWith("origin")?(a=!0,i[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=WV(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;r.transformOrigin=`${c} ${u} ${d}`}}function vk(e,t,n){return typeof e=="string"?e:Ie.transform(t+n*e)}function qV(e,t,n){const r=vk(t,e.x,e.width),s=vk(n,e.y,e.height);return`${r} ${s}`}const GV={offset:"stroke-dashoffset",array:"stroke-dasharray"},KV={offset:"strokeDashoffset",array:"strokeDasharray"};function YV(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?GV:KV;e[i.offset]=Ie.transform(-r);const o=Ie.transform(t),a=Ie.transform(n);e[i.array]=`${o} ${a}`}function E0(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...u},d,f){if(j0(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:g}=e;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(s!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=qV(g,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&YV(h,o,a,c,!1)}const N0=e=>typeof e=="string"&&e.toLowerCase()==="svg",JV={useVisualState:bP({scrapeMotionValuesFromProps:wP,createRenderState:SP,onMount:(e,t,{renderState:n,latestValues:r})=>{ht.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),ht.render(()=>{E0(n,r,N0(t.tagName),e.transformTemplate),vP(t,n)})}})},XV={useVisualState:bP({scrapeMotionValuesFromProps:k0,createRenderState:C0})};function _P(e,t,n){for(const r in t)!un(t[r])&&!xP(r,n)&&(e[r]=t[r])}function QV({transformTemplate:e},t){return m.useMemo(()=>{const n=C0();return j0(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ZV(e,t){const n=e.style||{},r={};return _P(r,n,e),Object.assign(r,QV(e,t)),r}function eU(e,t){const n={},r=ZV(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const tU=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 oh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||tU.has(e)}let CP=e=>!oh(e);function nU(e){e&&(CP=t=>t.startsWith("on")?!oh(t):e(t))}try{nU(require("@emotion/is-prop-valid").default)}catch{}function rU(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(CP(s)||n===!0&&oh(s)||!t&&!oh(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function sU(e,t,n,r){const s=m.useMemo(()=>{const i=SP();return E0(i,t,N0(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};_P(i,e.style,e),s.style={...i,...s.style}}return s}function iU(e=!1){return(n,r,s,{latestValues:i},o)=>{const c=(S0(n)?sU:eU)(r,i,o,n),u=rU(r,typeof n=="string",e),d=n!==m.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=m.useMemo(()=>un(f)?f.get():f,[f]);return m.createElement(n,{...d,children:h})}}function oU(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...S0(r)?JV:XV,preloadedFeatures:e,useRender:iU(s),createVisualElement:t,Component:r};return DV(o)}}const ev={current:null},jP={current:!1};function aU(){if(jP.current=!0,!!b0)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ev.current=e.matches;e.addListener(t),t()}else ev.current=!1}
vendor: 4,946 bytes, line 576
576function lU(e,t,n){for(const r in t){const s=t[r],i=n[r];if(un(s))e.addValue(r,s);else if(un(i))e.addValue(r,ou(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,ou(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const xk=new WeakMap,cU=[...vT,ln,ji],uU=e=>cU.find(yT(e)),wk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class dU{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,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=n0,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 h=es.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ht.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=np(n),this.isVariantNode=mP(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const p=f[h];c[h]!==void 0&&un(p)&&p.set(c[h],!1)}}mount(t){this.current=t,xk.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),jP.current||aU(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ev.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){xk.delete(this.current),this.projection&&this.projection.unmount(),Ci(this.notifyUpdate),Ci(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ao.has(t),s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ht.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ja){const n=Ja[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];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):Pt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<wk.length;r++){const s=wk[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=lU(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}
vendor: 5,004 bytes, lines 576-584
576addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ou(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(hT(s)||fT(s))?s=parseFloat(s):!uU(s)&&ji.test(n)&&(s=jT(t,n)),this.setBaseTarget(t,un(s)?s.get():s)),un(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Yx(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!un(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new m0),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class EP extends dU{constructor(){super(...arguments),this.KeyframeResolver=ET}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function fU(e){return window.getComputedStyle(e)}class hU extends EP{constructor(){super(...arguments),this.type="html",this.renderInstance=gP}readValueFromInstance(t,n){if(Ao.has(n)){const r=o0(n);return r&&r.default||0}else{const r=fU(t),s=(mT(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return eP(t,n)}build(t,n,r){j0(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return k0(t,n,r)}}class pU extends EP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ao.has(n)){const r=o0(n);return r&&r.default||0}return n=yP.has(n)?n:g0(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return wP(t,n,r)}build(t,n,r){E0(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){vP(t,n,r,s)}mount(t){this.isSVGTag=N0(t.tagName),super.mount(t)}}const mU=(e,t)=>S0(e)?new pU(t):new hU(t,{allowProjection:e!==m.Fragment}),gU=oU({...QB,...EV,...gV,...NV},mU),de=Jz(gU);class yU extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function vU({children:e,isPresent:t}){const n=m.useId(),r=m.useRef(null),s=m.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=m.useContext(w0);return m.useInsertionEffect(()=>{const{width:o,height:a,top:c,left:u}=s.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return i&&(d.nonce=i),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
577          [data-motion-pop-id="${n}"] {
578            position: absolute !important;
579            width: ${o}px !important;
580            height: ${a}px !important;
581            top: ${c}px !important;
582            left: ${u}px !important;
583          }
584        `),()=>{document.head.removeChild(d)}},[t]),l.jsx(yU,{isPresent:t,childRef:r,sizeRef:s,children:m.cloneElement(e,{ref:r})})}const xU=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o})=>{const a=_0(wU),c=m.useId(),u=m.useCallback(f=>{a.set(f,!0);for(const h of a.values())if(!h)return;r&&r()},[a,r]),d=m.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(a.set(f,!1),()=>a.delete(f))}),i?[Math.random(),u]:[n,u]);return m.useMemo(()=>{a.forEach((f,h)=>a.set(h,!1))},[n]),m.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=l.jsx(vU,{isPresent:n,children:e})),l.jsx(ep.Provider,{value:d,children:e})};function wU(){return new Map}const Sd=e=>e.key||"";function bk(e){const t=[];
584return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const yt=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync"})=>{const a=m.useMemo(()=>bk(e),[e]),c=a.map(Sd),u=m.useRef(!0),d=m.useRef(a),f=_0(()=>new Map),[h,p]=m.useState(a),[g,v]=m.useState(a);fP(()=>{u.current=!1,d.current=a;for(let w=0;w<g.length;w++){const x=Sd(g[w]);c.includes(x)?f.delete(x):f.get(x)!==!0&&f.set(x,!1)}},[g,c.length,c.join("-")]);const b=[];if(a!==h){let w=[...a];for(let x=0;x<g.length;x++){const S=g[x],C=Sd(S);c.includes(C)||(w.splice(x,0,S),b.push(S))}o==="wait"&&b.length&&(w=b),v(bk(w)),p(a);return}const{forceRender:y}=m.useContext(v0);return l.jsx(l.Fragment,{children:g.map(w=>{const x=Sd(w),S=a===g||c.includes(x),C=()=>{if(f.has(x))f.set(x,!0);else return;let k=!0;f.forEach(_=>{_||(k=!1)}),k&&(y==null||y(),v(d.current),s&&s())};return l.jsx(xU,{isPresent:S,initial:!u.current||r?void 0:!1,custom:S?void 0:n,presenceAffectsLayout:i,mode:o,onExitComplete:S?void 0:C,children:w},x)})})},lu=({size:e="md",showText:t=!0})=>{const n={sm:"w-8 h-8",md:"w-12 h-12",lg:"w-16 h-16"};return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(de.div,{className:`relative ${n[e]}`,animate:{scale:[1,1.02,1],rotate:[0,2,-2,0]},transition:{duration:3,repeat:1/0,repeatType:"reverse",ease:"easeInOut"},children:l.jsx("div",{className:"relative w-full h-full",children:l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.jsxs("div",{className:"relative w-full h-full",children:[l.jsx(de.div,{className:"absolute inset-0 rounded-full bg-gradient-to-br from-[#1A1F2C] via-[#333333] to-[#555555]",animate:{opacity:[.8,1,.8]},transition:{duration:4,repeat:1/0,repeatType:"reverse"}}),l.jsx(de.div,{className:"absolute right-0 top-0 w-[70%] h-[70%] rounded-full bg-gradient-to-br from-[#ea384c] via-[#ea384c]/80 to-transparent opacity-80",animate:{opacity:[.6,.8,.6]},transition:{duration:3,repeat:1/0,repeatType:"reverse"}}),l.jsx(de.div,{className:"absolute top-1 right-1 w-[20%] h-[20%]",animate:{scale:[1,1.2,1],opacity:[.8,1,.8]},transition:{duration:2,repeat:1/0,repeatType:"reverse"},children:l.jsx("div",{className:"w-full h-full bg-gradient-to-br from-white via-[#ea384c] to-[#ea384c]/80 rounded-full"})})]})})})}),t&&l.jsx(de.span,{className:"text-2xl font-bold text-white whitespace-nowrap",animate:{opacity:[1,.8,1]},transition:{duration:3,repeat:1/0,repeatType:"reverse"},children:"Ask EZY"})]})},bU=({isOpen:e,onClose:t,isIOS:n,onInstall:r})=>(m.useEffect(()=>{const s=i=>{i.key==="Escape"&&t()};return e&&(document.addEventListener("keydown",s),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",s),document.body.style.overflow=""}},[e,t]),e?l.jsx(yt,{children:l.jsx(de.div,{initial:{opacity:0}
584,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-[100] flex items-center justify-center p-4",onClick:t,children:l.jsxs(de.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"max-w-md w-full space-y-6 text-center relative bg-card p-6 rounded-2xl border border-border/20 shadow-xl",onClick:s=>s.stopPropagation(),children:[l.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-muted-foreground hover:text-foreground transition-colors rounded-full hover:bg-primary/10","aria-label":"Close dialog",children:l.jsx(Dn,{className:"w-5 h-5"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"w-20 h-20 mx-auto bg-primary/10 rounded-2xl flex items-center justify-center",children:l.jsx("img",{src:"/app-icon.png",alt:"EZY App Icon",className:"w-14 h-14"})}),l.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Install EZY"}),l.jsx("p",{className:"text-muted-foreground",children:"Add to your home screen for the best experience"})]}),l.jsx("div",{className:"space-y-4",children:n?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-3 text-left p-3 rounded-lg bg-muted/30",children:[l.jsx("div",{className:"w-7 h-7 rounded-full bg-primary flex items-center justify-center text-primary-foreground text-sm font-medium shrink-0",children:"1"}),l.jsxs("p",{className:"text-sm text-foreground",children:["Tap the Share button ",l.jsx(So,{className:"inline-block w-4 h-4 mx-1"})]})]}),l.jsxs("div",{className:"flex items-center gap-3 text-left p-3 rounded-lg bg-muted/30",children:[l.jsx("div",{className:"w-7 h-7 rounded-full bg-primary flex items-center justify-center text-primary-foreground text-sm font-medium shrink-0",children:"2"}),l.jsx("p",{className:"text-sm text-foreground",children:'Select "Add to Home Screen"'})]})]}):l.jsx("p",{className:"text-sm text-muted-foreground",children:"Click Install to add EZY to your home screen"})}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx("button",{onClick:t,className:"flex-1 py-3 px-4 rounded-xl border border-border/40 text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors text-sm font-medium",children:"Not now"}),l.jsxs(de.button,{whileHover:{scale:1.02},whileTap:{scale:.98},className:"flex-1 bg-primary hover:bg-primary/90 text-primary-foreground py-3 px-4 rounded-xl flex items-center justify-center gap-2 text-sm font-medium transition-colors",onClick:n?t:r,children:[l.jsx(Hh,{className:"w-4 h-4"}),n?"Got it":"Install"]})]})]})})}):null),SU=()=>{const[e,t]=m.useState(null),[n,r]=m.useState(!1),[s,i]=m.useState(!1),[o,a]=m.useState(!1);m.useEffect(()=>{const f=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;if(i(f),window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone)return;f&&(localStorage.getItem("pwa-prompt-dismissed")||a(!0));const p=g=>{g.preventDefault(),t(g),a(!0)};return window.addEventListener("beforeinstallprompt",p),()=>{window.removeEventListener("beforeinstallprompt",p)}},[]);const c=m.useCallback(()=>{o&&r(!0)},[o]),u=async()=>{if(!e){d();return}try{const f=await e.prompt();console.log(`Install prompt was: ${f.outcome}`),f.outcome==="accepted"&&localStorage.setItem("pwa-prompt-dismissed","true")}catch(f){console.error("Install prompt error:",f)}finally{t(null),r(!1)}},d=m.useCallback(()=>{r(!1),localStorage.setItem("pwa-prompt-dismissed","true")},[]);return{showPrompt:n,handleInstall:u,closePrompt:d,isIOS:s,canInstall:o,triggerInstallPrompt:c}},kU=()=>l.jsx("footer",{className:"w-full py-6 mt-12 border-t border-border/5",children:l.jsx("div",{className:"container mx-auto px-4",children:l.jsxs(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," EZY. All rights reserved."]}),l.jsxs("div",{className:"text-sm text-muted-foreground",children:["Created with ❤️ by"," ",l.jsx("a",{href:"https://unstucklabs.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 transition-colors underline underline-offset-4",children:"Unstuck Labs"})]})]})})});function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function _U(e,t){const n=m.createContext(t),r=i=>{const{children:o,...a}=i,c=m.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function Bs(e,t=[]){let n=[];function r(i,o){const a=m.createContext(o),c=n.length;n=[...n,o];const u=f=>{var y;const{scope:h,children:p,...g}=f,v=((y=h==null?void 0:h[e])==null?void 0:y[c])||a,b=m.useMemo(()=>g,Object.values(g));return l.jsx(v.Provider,{value:b,children:p})};u.displayName=i+"Provider";function d(f,h){var v;const p=((v=h==null?void 0:h[e])==null?void 0:v[c])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,CU(s,...t)]}function CU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function vr(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ro({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=jU({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,a=vr(n),c=m.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else s(u)},[i,e,s,a]);return[o,c]}function jU({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,s=m.useRef(r),i=vr(t);return m.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var EU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Je=EU.reduce((e,t)=>
vendor: 21,845 bytes, line 584
584{const n=m.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?_i:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function NP(e,t){e&&Vh.flushSync(()=>e.dispatchEvent(t))}function NU(e,t=[]){let n=[];function r(i,o){const a=m.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][c])||a,b=m.useMemo(()=>g,Object.values(g));return l.jsx(v.Provider,{value:b,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,TU(s,...t)]}function TU(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function TP(e){const t=e+"CollectionProvider",[n,r]=NU(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:v}=p,b=$.useRef(null),y=$.useRef(new Map).current;return l.jsx(s,{scope:g,itemMap:y,collectionRef:b,children:v})};o.displayName=t;const a=e+"CollectionSlot",c=$.forwardRef((p,g)=>{const{scope:v,children:b}=p,y=i(a,v),w=vt(g,y.collectionRef);return l.jsx(_i,{ref:w,children:b})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=$.forwardRef((p,g)=>{const{scope:v,children:b,...y}=p,w=$.useRef(null),x=vt(g,w),S=i(u,v);return $.useEffect(()=>(S.itemMap.set(w,{ref:w,...y}),()=>void S.itemMap.delete(w))),l.jsx(_i,{[d]:"",ref:x,children:b})});f.displayName=u;function h(p){const g=i(e+"CollectionConsumer",p);return $.useCallback(()=>{const b=g.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((S,C)=>y.indexOf(S.ref.current)-y.indexOf(C.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},h,r]}var PU=m.createContext(void 0);function T0(e){const t=m.useContext(PU);return e||t||"ltr"}function AU(e,t=globalThis==null?void 0:globalThis.document){const n=vr(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var RU="DismissableLayer",tv="dismissableLayer.update",MU="dismissableLayer.pointerDownOutside",IU="dismissableLayer.focusOutside",Sk,PP=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tu=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=e,u=m.useContext(PP),[d,f]=m.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),g=vt(t,_=>f(_)),v=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(b),w=d?v.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,C=LU(_=>{const j=_.target,R=[...u.branches].some(P=>P.contains(j));!S||R||(s==null||s(_),o==null||o(_),_.defaultPrevented||a==null||a())},h),k=$U(_=>{const j=_.target;[...u.branches].some(P=>P.contains(j))||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},h);return AU(_=>{w===u.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},h),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Sk=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),kk(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Sk)}},[d,h,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),kk())},[d,u]),m.useEffect(()=>{const _=()=>p({});return document.addEventListener(tv,_),()=>document.removeEventListener(tv,_)},[]),l.jsx(Je.div,{...c,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,C.onPointerDownCapture)})});Tu.displayName=RU;var OU="DismissableLayerBranch",DU=m.forwardRef((e,t)=>{const n=m.useContext(PP),r=m.useRef(null),s=vt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),l.jsx(Je.div,{...e,ref:s})});DU.displayName=OU;function LU(e,t=globalThis==null?void 0:globalThis.document){const n=vr(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){AP(MU,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $U(e,t=globalThis==null?void 0:globalThis.document){const n=vr(e),r=m.useRef(!1);return m.useEffect(()=>{const s=i=>{i.target&&!r.current&&AP(IU,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kk(){const e=new CustomEvent(tv);document.dispatchEvent(e)}function AP(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?NP(s,i):s.dispatchEvent(i)}var Pm=0;function P0(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_k()),document.body.insertAdjacentElement("beforeend",e[1]??_k()),Pm++,()=>{Pm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Pm--}},[])}function _k(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Am="focusScope.autoFocusOnMount",Rm="focusScope.autoFocusOnUnmount",Ck={bubbles:!1,cancelable:!0},FU="FocusScope",rp=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,c]=m.useState(null),u=vr(s),d=vr(i),f=m.useRef(null),h=vt(t,v=>c(v)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(x){if(p.paused||!a)return;const S=x.target;a.contains(S)?f.current=S:Js(f.current,{select:!0})},b=function(x){if(p.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||Js(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&Js(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),w.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){Ek.add(p);const v=document.activeElement;if(!a.contains(v)){const y=new CustomEvent(Am,Ck);a.addEventListener(Am,u),a.dispatchEvent(y),y.defaultPrevented||(zU(WU(RP(a)),{select:!0}),document.activeElement===v&&Js(a))}return()=>{a.removeEventListener(Am,u),setTimeout(()=>{const y=new CustomEvent(Rm,Ck);a.addEventListener(Rm,d),a.dispatchEvent(y),y.defaultPrevented||Js(v??document.body,{select:!0}),a.removeEventListener(Rm,d),Ek.remove(p)},0)}}},[a,u,d,p]);const g=m.useCallback(v=>{if(!n&&!r||p.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(b&&y){const w=v.currentTarget,[x,S]=BU(w);x&&S?!v.shiftKey&&y===S?(v.preventDefault(),n&&Js(x,{select:!0})):v.shiftKey&&y===x&&(v.preventDefault(),n&&Js(S,{select:!0})):y===w&&v.preventDefault()}},[n,r,p.paused]);return l.jsx(Je.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});rp.displayName=FU;function zU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Js(r,{select:t}),document.activeElement!==n)return}function BU(e){const t=RP(e),n=jk(t,e),r=jk(t.reverse(),e);return[n,r]}function RP(e){const t=[],n=document.createTreeWalker(e,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();)t.push(n.currentNode);return t}function jk(e,t){for(const n of e)if(!VU(n,{upTo:t}))return n}function VU(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function UU(e){return e instanceof HTMLInputElement&&"select"in e}function Js(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&UU(e)&&t&&e.select()}}var Ek=HU();function HU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Nk(e,t),e.unshift(t)},remove(t){var n;e=Nk(e,t),(n=e[0])==null||n.resume()}}}function Nk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function WU(e){return e.filter(t=>t.tagName!=="A")}var Os=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},qU=jh.useId||(()=>{}),GU=0;function Ts(e){const[t,n]=m.useState(qU());return Os(()=>{e||n(r=>r??String(GU++))},[e]),e||(t?`radix-${t}`:"")}const KU=["top","right","bottom","left"],Ei=Math.min,qn=Math.max,ah=Math.round,kd=Math.floor,Ni=e=>({x:e,y:e}),YU={left:"right",right:"left",bottom:"top",top:"bottom"},JU={start:"end",end:"start"};function nv(e,t,n){return qn(e,Ei(t,n))}function Ds(e,t){return typeof e=="function"?e(t):e}function Ls(e){return e.split("-")[0]}function fl(e){return e.split("-")[1]}function A0(e){return e==="x"?"y":"x"}function R0(e){return e==="y"?"height":"width"}function Ti(e){return["top","bottom"].includes(Ls(e))?"y":"x"}function M0(e){return A0(Ti(e))}function XU(e,t,n){n===void 0&&(n=!1);const r=fl(e),s=M0(e),i=R0(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=lh(o)),[o,lh(o)]}function QU(e){const t=lh(e);return[rv(e),t,rv(t)]}function rv(e){return e.replace(/start|end/g,t=>JU[t])}function ZU(e,t,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?i:o;default:return[]}}function e9(e,t,n,r){const s=fl(e);let i=ZU(Ls(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(rv)))),i}function lh(e){return e.replace(/left|right|bottom|top/g,t=>YU[t])}function t9(e){return{top:0,right:0,bottom:0,left:0,...e}}function MP(e){return typeof e!="number"?t9(e):{top:e,right:e,bottom:e,left:e}}function ch(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Tk(e,t,n){let{reference:r,floating:s}=e;const i=Ti(t),o=M0(t),a=R0(o),c=Ls(t),u=i==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,h=r[a]/2-s[a]/2;let p;switch(c){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-s.width,y:f};break;default:p={x:r.x,y:r.y}}switch(fl(t)){case"start":p[o]-=h*(n&&u?-1:1);break;case"end":p[o]+=h*(n&&u?-1:1);break}return p}const n9=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Tk(u,r,c),h=r,p={},g=0;for(let v=0;v<a.length;v++){const{name:b,fn:y}=a[v],{x:w,y:x,data:S,reset:C}=await y({x:d,y:f,initialPlacement:r,placement:h,strategy:s,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});d=w??d,f=x??f,p={...p,[b]:{...p[b],...S}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:d,y:f}=Tk(u,h,c)),v=-1)}return{x:d,y:f,placement:h,strategy:s,middlewareData:p}};async function cu(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ds(t,e),g=MP(p),b=a[h?f==="floating"?"reference":"floating":f],y=ch(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="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)),S=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},C=ch(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-C.top+g.top)/S.y,bottom:(C.bottom-y.bottom+g.bottom)/S.y,left:(y.left-C.left+g.left)/S.x,right:(C.right-y.right+g.right)/S.x}}const r9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=Ds(e,t)||{};if(u==null)return{};const f=MP(d),h={x:n,y:r},p=M0(s),g=R0(p),v=await o.getDimensions(u),b=p==="y",y=b?"top":"left",w=b?"bottom":"right",x=b?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[p]-h[p]-i.floating[g],C=h[p]-i.reference[p],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let _=k?k[x]:0;(!_||!await(o.isElement==null?void 0:o.isElement(k)))&&(_=a.floating[x]||i.floating[g]);const j=S/2-C/2,R=_/2-v[g]/2-1,P=Ei(f[y],R),M=Ei(f[w],R),T=P,L=_-v[g]-M,F=_/2-v[g]/2+j,z=nv(T,F,L),V=!c.arrow&&fl(s)!=null&&F!==z&&i.reference[g]/2-(F<T?P:M)-v[g]/2<0,I=V?F<T?F-T:F-L:0;return{[p]:h[p]+I,data:{[p]:z,centerOffset:F-z-I,...V&&{alignmentOffset:I}},reset:V}}}),s9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...b}=Ds(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Ls(s),w=Ti(a),x=Ls(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=h||(x||!v?[lh(a)]:QU(a)),k=g!=="none";!h&&k&&C.push(...e9(a,v,g,S));const _=[a,...C],j=await cu(t,b),R=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&R.push(j[y]),f){const F=XU(s,o,S);R.push(j[F[0]],j[F[1]])}if(P=[...P,{placement:s,overflows:R}],!R.every(F=>F<=0)){var M,T;const F=(((M=i.flip)==null?void 0:M.index)||0)+1,z=_[F];if(z)return{data:{index:F,overflows:P},reset:{placement:z}};let V=(T=P.filter(I=>I.overflows[0]<=0).sort((I,A)=>I.overflows[1]-A.overflows[1])[0])==null?void 0:T.placement;if(!V)switch(p){case"bestFit":{var L;const I=(L=P.filter(A=>{if(k){const D=Ti(A.placement);return D===w||D==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(D=>D>0).reduce((D,E)=>D+E,0)]).sort((A,D)=>A[1]-D[1])[0])==null?void 0:L[0];I&&(V=I);break}case"initialPlacement":V=a;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function Pk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ak(e){return KU.some(t=>e[t]>=0)}const i9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Ds(e,t);switch(r){case"referenceHidden":{const i=await cu(t,{...s,elementContext:"reference"}),o=Pk(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Ak(o)}}}case"escaped":{const i=await cu(t,{...s,altBoundary:!0}),o=Pk(i,n.floating);return{data:{escapedOffsets:o,escaped:Ak(o)}}}default:return{}}}}};async function o9(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Ls(n),a=fl(n),c=Ti(n)==="y",u=["left","top"].includes(o)?-1:1,d=i&&c?-1:1,f=Ds(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const a9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=t,c=await o9(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},l9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:y,y:w}=b;return{x:y,y:w}}},...c}=Ds(e,t),u={x:n,y:r},d=await cu(t,c),f=Ti(Ls(s)),h=A0(f);let p=u[h],g=u[f];if(i){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",w=p+d[b],x=p-d[y];p=nv(w,p,x)}if(o){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=g+d[b],x=g-d[y];g=nv(w,g,x)}const v=a.fn({...t,[h]:p,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[f]:o}}}}}},c9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Ds(e,t),d={x:n,y:r},f=Ti(s),h=A0(f);let p=d[h],g=d[f];const v=Ds(a,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const x=h==="y"?"height":"width",S=i.reference[h]-i.floating[x]+b.mainAxis,C=i.reference[h]+i.reference[x]-b.mainAxis;p<S?p=S:p>C&&(p=C)}if(u){var y,w;const x=h==="y"?"width":"height",S=["top","left"].includes(Ls(s)),C=i.reference[f]-i.floating[x]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:b.crossAxis),k=i.reference[f]+i.reference[x]+(S?0:((w=o.offset)==null?void 0:w[f])||0)-(S?b.crossAxis:0);g<C?g=C:g>k&&(g=k)}return{[h]:p,[f]:g}}}},u9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:o,elements:a}=t,{apply:c=()=>{},...u}=Ds(e,t),d=await cu(t,u),f=Ls(s),h=fl(s),p=Ti(s)==="y",{width:g,height:v}=i.floating;let b,y;f==="top"||f==="bottom"?(b=f,y=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,b=h==="end"?"top":"bottom");const w=v-d.top-d.bottom,x=g-d.left-d.right,S=Ei(v-d[b],w),C=Ei(g-d[y],x),k=!t.middlewareData.shift;let _=S,j=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=w),k&&!h){const P=qn(d.left,0),M=qn(d.right,0),T=qn(d.top,0),L=qn(d.bottom,0);p?j=g-2*(P!==0||M!==0?P+M:qn(d.left,d.right)):_=v-2*(T!==0||L!==0?T+L:qn(d.top,d.bottom))}await c({...t,availableWidth:j,availableHeight:_});const R=await o.getDimensions(a.floating);return g!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function sp(){return typeof window<"u"}function hl(e){return IP(e)?(e.nodeName||"").toLowerCase():"#document"}function Qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ss(e){var t;return(t=(IP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function IP(e){return sp()?e instanceof Node||e instanceof Qn(e).Node:!1}function Mr(e){return sp()?e instanceof Element||e instanceof Qn(e).Element:!1}function ts(e){return sp()?e instanceof HTMLElement||e instanceof Qn(e).HTMLElement:!1}function Rk(e){return!sp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qn(e).ShadowRoot}function Pu(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function d9(e){return["table","td","th"].includes(hl(e))}function ip(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function I0(e){const t=O0(),n=Mr(e)?Ir(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 f9(e){let t=Pi(e);for(;ts(t)&&!Xa(t);){if(I0(t))return t;if(ip(t))return null;t=Pi(t)}return null}function O0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xa(e){return["html","body","#document"].includes(hl(e))}function Ir(e){return Qn(e).getComputedStyle(e)}function op(e){return Mr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pi(e){if(hl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rk(e)&&e.host||ss(e);return Rk(t)?t.host:t}function OP(e){const t=Pi(e);return Xa(t)?e.ownerDocument?e.ownerDocument.body:e.body:ts(t)&&Pu(t)?t:OP(t)}function uu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=OP(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=Qn(s);if(i){const a=sv(o);
vendor: 6,878 bytes, line 584
584return t.concat(o,o.visualViewport||[],Pu(s)?s:[],a&&n?uu(a):[])}return t.concat(s,uu(s,[],n))}function sv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function DP(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=ts(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,a=ah(n)!==i||ah(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function D0(e){return Mr(e)?e:e.contextElement}function Aa(e){const t=D0(e);if(!ts(t))return Ni(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=DP(t);let o=(i?ah(n.width):n.width)/r,a=(i?ah(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const h9=Ni(0);function LP(e){const t=Qn(e);return!O0()||!t.visualViewport?h9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function p9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qn(e)?!1:t}function ko(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=D0(e);let o=Ni(1);t&&(r?Mr(r)&&(o=Aa(r)):o=Aa(e));const a=p9(i,n,r)?LP(i):Ni(0);let c=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(i){const h=Qn(i),p=r&&Mr(r)?Qn(r):r;let g=h,v=sv(g);for(;v&&r&&p!==g;){const b=Aa(v),y=v.getBoundingClientRect(),w=Ir(v),x=y.left+(v.clientLeft+parseFloat(w.paddingLeft))*b.x,S=y.top+(v.clientTop+parseFloat(w.paddingTop))*b.y;c*=b.x,u*=b.y,d*=b.x,f*=b.y,c+=x,u+=S,g=Qn(v),v=sv(g)}}return ch({width:d,height:f,x:c,y:u})}function m9(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=ss(r),a=t?ip(t.floating):!1;if(r===o||a&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ni(1);const d=Ni(0),f=ts(r);if((f||!f&&!i)&&((hl(r)!=="body"||Pu(o))&&(c=op(r)),ts(r))){const h=ko(r);u=Aa(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function g9(e){return Array.from(e.getClientRects())}function iv(e,t){const n=op(e).scrollLeft;return t?t.left+n:ko(ss(e)).left+n}function y9(e){const t=ss(e),n=op(e),r=e.ownerDocument.body,s=qn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=qn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+iv(e);const a=-n.scrollTop;return Ir(r).direction==="rtl"&&(o+=qn(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function v9(e,t){const n=Qn(e),r=ss(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const u=O0();(!u||u&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}function x9(e,t){const n=ko(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=ts(e)?Aa(e):Ni(1),o=e.clientWidth*i.x,a=e.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:o,height:a,x:c,y:u}}function Mk(e,t,n){let r;if(t==="viewport")r=v9(e,n);else if(t==="document")r=y9(ss(e));else if(Mr(t))r=x9(t,n);else{const s=LP(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return ch(r)}function $P(e,t){const n=Pi(e);return n===t||!Mr(n)||Xa(n)?!1:Ir(n).position==="fixed"||$P(n,t)}function w9(e,t){const n=t.get(e);if(n)return n;let r=uu(e,[],!1).filter(a=>Mr(a)&&hl(a)!=="body"),s=null;const i=Ir(e).position==="fixed";let o=i?Pi(e):e;for(;Mr(o)&&!Xa(o);){const a=Ir(o),c=I0(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Pu(o)&&!c&&$P(e,o))?r=r.filter(d=>d!==o):s=a,o=Pi(o)}return t.set(e,r),r}function b9(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?ip(t)?[]:w9(t,this._c):[].concat(n),r],a=o[0],c=o.reduce((u,d)=>{const f=Mk(t,d,s);return u.top=qn(f.top,u.top),u.right=Ei(f.right,u.right),u.bottom=Ei(f.bottom,u.bottom),u.left=qn(f.left,u.left),u},Mk(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function S9(e){const{width:t,height:n}=DP(e);return{width:t,height:n}}function k9(e,t,n){const r=ts(t),s=ss(t),i=n==="fixed",o=ko(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Ni(0);if(r||!r&&!i)if((hl(t)!=="body"||Pu(s))&&(a=op(t)),r){const p=ko(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&(c.x=iv(s));let u=0,d=0;if(s&&!r&&!i){const p=s.getBoundingClientRect();d=p.top+a.scrollTop,u=p.left+a.scrollLeft-iv(s,p)}const f=o.left+a.scrollLeft-c.x-u,h=o.top+a.scrollTop-c.y-d;return{x:f,y:h,width:o.width,height:o.height}}function Mm(e){return Ir(e).position==="static"}function Ik(e,t){if(!ts(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ss(e)===n&&(n=n.ownerDocument.body),n}function FP(e,t){const n=Qn(e);if(ip(e))return n;if(!ts(e)){let s=Pi(e);for(;s&&!Xa(s);){if(Mr(s)&&!Mm(s))return s;s=Pi(s)}return n}let r=Ik(e,t);for(;r&&d9(r)&&Mm(r);)r=Ik(r,t);return r&&Xa(r)&&Mm(r)&&!I0(r)?n:r||f9(e)||n}const _9=async function(e){const t=this.getOffsetParent||FP,n=this.getDimensions,r=await n(e.floating);return{reference:k9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function C9(e){return Ir(e).direction==="rtl"}const j9={convertOffsetParentRelativeRectToViewportRelativeRect:m9,getDocumentElement:ss,getClippingRect:b9,getOffsetParent:FP,getElementRects:_9,getClientRects:g9,getDimensions:S9,getScale:Aa,isElement:Mr,isRTL:C9};function E9(e,t){let n=null,r;const s=ss(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(a||t(),!f||!h)return;const p=kd(d),g=kd(s.clientWidth-(u+f)),v=kd(s.clientHeight-(d+h)),b=kd(u),w={rootMargin:-p+"px "+-g+"px "+-v+"px "+-b+"px",threshold:qn(0,Ei(1,c))||1};let x=!0;function S(C){const k=C[0].intersectionRatio;if(k!==c){if(!x)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(S,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return o(!0),i}function N9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=D0(e),d=s||i?[...u?uu(u):[],...uu(t)]:[];d.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&a?E9(u,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let g,v=c?ko(e):null;c&&b();function b(){const y=ko(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,g=requestAnimationFrame(b)}return n(),()=>{var y;d.forEach(w=>{s&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(g)}}
vendor: 2,894 bytes, line 584
584const T9=a9,P9=l9,A9=s9,R9=u9,M9=i9,Ok=r9,I9=c9,O9=(e,t,n)=>{const r=new Map,s={platform:j9,...n},i={...s.platform,_c:r};return n9(e,t,{...s,platform:i})};var sf=typeof document<"u"?m.useLayoutEffect:m.useEffect;function uh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uh(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!uh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dk(e,t){const n=zP(e);return Math.round(t*n)/n}function Im(e){const t=m.useRef(e);return sf(()=>{t.current=e}),t}function D9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);uh(h,r)||p(r);const[g,v]=m.useState(null),[b,y]=m.useState(null),w=m.useCallback(A=>{A!==k.current&&(k.current=A,v(A))},[]),x=m.useCallback(A=>{A!==_.current&&(_.current=A,y(A))},[]),S=i||g,C=o||b,k=m.useRef(null),_=m.useRef(null),j=m.useRef(d),R=c!=null,P=Im(c),M=Im(s),T=Im(u),L=m.useCallback(()=>{if(!k.current||!_.current)return;const A={placement:t,strategy:n,middleware:h};M.current&&(A.platform=M.current),O9(k.current,_.current,A).then(D=>{const E={...D,isPositioned:T.current!==!1};F.current&&!uh(j.current,E)&&(j.current=E,Vh.flushSync(()=>{f(E)}))})},[h,t,n,M,T]);sf(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[u]);const F=m.useRef(!1);sf(()=>(F.current=!0,()=>{F.current=!1}),[]),sf(()=>{if(S&&(k.current=S),C&&(_.current=C),S&&C){if(P.current)return P.current(S,C,L);L()}},[S,C,L,P,R]);const z=m.useMemo(()=>({reference:k,floating:_,setReference:w,setFloating:x}),[w,x]),V=m.useMemo(()=>({reference:S,floating:C}),[S,C]),I=m.useMemo(()=>{const A={position:n,left:0,top:0};if(!V.floating)return A;const D=Dk(V.floating,d.x),E=Dk(V.floating,d.y);return a?{...A,transform:"translate("+D+"px, "+E+"px)",...zP(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:E}},[n,a,V.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:L,refs:z,elements:V,floatingStyles:I}),[d,L,z,V,I])}const L9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ok({element:r.current,padding:s}).fn(n):{}:r?Ok({element:r,padding:s}).fn(n):{}}}},$9=(e,t)=>
vendor: 4,848 bytes, line 584
584({...T9(e),options:[e,t]}),F9=(e,t)=>({...P9(e),options:[e,t]}),z9=(e,t)=>({...I9(e),options:[e,t]}),B9=(e,t)=>({...A9(e),options:[e,t]}),V9=(e,t)=>({...R9(e),options:[e,t]}),U9=(e,t)=>({...M9(e),options:[e,t]}),H9=(e,t)=>({...L9(e),options:[e,t]});var W9="Arrow",BP=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return l.jsx(Je.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});BP.displayName=W9;var q9=BP;function G9(e,t=[]){let n=[];function r(i,o){const a=m.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][c])||a,b=m.useMemo(()=>g,Object.values(g));return l.jsx(v.Provider,{value:b,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,K9(s,...t)]}function K9(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function VP(e){const[t,n]=m.useState(void 0);return Os(()=>{if(e){n({width:e.offsetWidth,height:e.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 c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,a=u.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var L0="Popper",[UP,pl]=G9(L0),[Y9,HP]=UP(L0),WP=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return l.jsx(Y9,{scope:t,anchor:r,onAnchorChange:s,children:n})};WP.displayName=L0;var qP="PopperAnchor",GP=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=HP(qP,n),o=m.useRef(null),a=vt(t,o);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:l.jsx(Je.div,{...s,ref:a})});GP.displayName=qP;var $0="PopperContent",[J9,X9]=UP($0),KP=m.forwardRef((e,t)=>{var W,ne,oe,Z,se,re;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...v}=e,b=HP($0,n),[y,w]=m.useState(null),x=vt(t,Y=>w(Y)),[S,C]=m.useState(null),k=VP(S),_=(k==null?void 0:k.width)??0,j=(k==null?void 0:k.height)??0,R=r+(i!=="center"?"-"+i:""),P=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(u)?u:[u],T=M.length>0,L={padding:P,boundary:M.filter(Z9),altBoundary:T},{refs:F,floatingStyles:z,placement:V,isPositioned:I,middlewareData:A}=D9({strategy:"fixed",placement:R,whileElementsMounted:(...Y)=>N9(...Y,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[$9({mainAxis:s+j,alignmentAxis:o}),c&&F9({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?z9():void 0,...L}),c&&B9({...L}),V9({...L,apply:({elements:Y,rects:Ee,availableWidth:He,availableHeight:Re})=>{const{width:Nt,height:O}=Ee.reference,B=Y.floating.style;B.setProperty("--radix-popper-available-width",`${He}px`),B.setProperty("--radix-popper-available-height",`${Re}px`),B.setProperty("--radix-popper-anchor-width",`${Nt}px`),B.setProperty("--radix-popper-anchor-height",`${O}px`)}}),S&&H9({element:S,padding:a}),eH({arrowWidth:_,arrowHeight:j}),h&&U9({strategy:"referenceHidden",...L})]}),[D,E]=XP(V),K=vr(g);Os(()=>{I&&(K==null||K())},[I,K]);const te=(W=A.arrow)==null?void 0:W.x,N=(ne=A.arrow)==null?void 0:ne.y,ee=((oe=A.arrow)==null?void 0:oe.centerOffset)!==0,[ie,U]=m.useState();return Os(()=>{y&&U(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:I?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(Z=A.transformOrigin)==null?void 0:Z.x,(se=A.transformOrigin)==null?void 0:se.y].join(" "),...((re=A.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(J9,{scope:n,placedSide:D,onArrowChange:C,arrowX:te,arrowY:N,shouldHideArrow:ee,children:l.jsx(Je.div,{"data-side":D,"data-align":E,...v,ref:x,style:{...v.style,animation:I?void 0:"none"}})})})});KP.displayName=$0;var YP="PopperArrow",Q9={top:"bottom",right:"left",bottom:"top",left:"r
584ight"},JP=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=X9(YP,r),o=Q9[i.placedSide];return l.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:l.jsx(q9,{...s,ref:n,style:{...s.style,display:"block"}})})});JP.displayName=YP;function Z9(e){return e!==null}var eH=e=>({name:"transformOrigin",options:e,fn(t){var b,y,w;const{placement:n,rects:r,middlewareData:s}=t,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,a=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=XP(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=s.arrow)==null?void 0:y.x)??0)+a/2,p=(((w=s.arrow)==null?void 0:w.y)??0)+c/2;let g="",v="";return u==="bottom"?(g=o?f:`${h}px`,v=`${-c}px`):u==="top"?(g=o?f:`${h}px`,v=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,v=o?f:`${p}px`):u==="left"&&(g=`${r.floating.width+c}px`,v=o?f:`${p}px`),{data:{x:g,y:v}}}});function XP(e){const[t,n="center"]=e.split("-");return[t,n]}var F0=WP,ap=GP,z0=KP,B0=JP,tH="Portal",Au=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=m.useState(!1);Os(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?eN.createPortal(l.jsx(Je.div,{...r,ref:t}),o):null});Au.displayName=tH;function nH(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var sr=e=>{const{present:t,children:n}=e,r=rH(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=vt(r.ref,sH(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null};sr.displayName="Presence";function rH(e){const[t,n]=m.useState(),r=m.useRef({}),s=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[a,c]=nH(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=_d(r.current);i.current=a==="mounted"?u:"none"},[a]),Os(()=>{const u=r.current,d=s.current;if(d!==e){const h=i.current,p=_d(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Os(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const v=_d(r.current).includes(p.animationName);if(p.target===t&&v&&(c("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(i.current=_d(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function _d(e){return(e==null?void 0:e.animationName)||"none"}function sH(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function iH(e,t=[]){let n=[];function r(i,o){const a=m.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][c])||a,b=m.useMemo(()=>g,Object.values(g));return l.jsx(v.Provider,{value:b,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,oH(s,...t)]}function oH(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Om="rovingFocusGroup.onEntryFocus",aH={bubbles:!1,cancelable:!0},lp="RovingFocusGroup",[ov,QP,lH]=TP(lp),[cH,cp]=iH(lp,[lH]),[uH,dH]=cH(lp),ZP=m.forwardRef((e,t)=>
vendor: 5,097 bytes, line 584
584l.jsx(ov.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(ov.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(fH,{...e,ref:t})})}));ZP.displayName=lp;var fH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=m.useRef(null),p=vt(t,h),g=T0(i),[v=null,b]=Ro({prop:o,defaultProp:a,onChange:c}),[y,w]=m.useState(!1),x=vr(u),S=QP(n),C=m.useRef(!1),[k,_]=m.useState(0);return m.useEffect(()=>{const j=h.current;if(j)return j.addEventListener(Om,x),()=>j.removeEventListener(Om,x)},[x]),l.jsx(uH,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:v,onItemFocus:m.useCallback(j=>b(j),[b]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>_(j=>j+1),[]),onFocusableItemRemove:m.useCallback(()=>_(j=>j-1),[]),children:l.jsx(Je.div,{tabIndex:y||k===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{C.current=!0}),onFocus:Ae(e.onFocus,j=>{const R=!C.current;if(j.target===j.currentTarget&&R&&!y){const P=new CustomEvent(Om,aH);if(j.currentTarget.dispatchEvent(P),!P.defaultPrevented){const M=S().filter(V=>V.focusable),T=M.find(V=>V.active),L=M.find(V=>V.id===v),z=[T,L,...M].filter(Boolean).map(V=>V.ref.current);n2(z,d)}}C.current=!1}),onBlur:Ae(e.onBlur,()=>w(!1))})})}),e2="RovingFocusGroupItem",t2=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...o}=e,a=Ts(),c=i||a,u=dH(e2,n),d=u.currentTabStopId===c,f=QP(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=u;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),l.jsx(ov.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:l.jsx(Je.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:Ae(e.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:Ae(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:Ae(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=mH(g,u.orientation,u.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=f().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const w=y.indexOf(g.currentTarget);y=u.loop?gH(y,w+1):y.slice(w+1)}setTimeout(()=>n2(y))}})})})});t2.displayName=e2;var hH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function pH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mH(e,t,n){const r=pH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return hH[r]}function n2(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function gH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var r2=ZP,s2=t2,yH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Uo=new WeakMap,Cd=new WeakMap,jd={},Dm=0,i2=function(e){return e&&(e.host||i2(e.parentNode))},vH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=i2(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},xH=function(e,t,n,r){var s=vH(t,Array.isArray(e)?e:[e]);jd[n]||(jd[n]=new WeakMap);var i=jd[n],o=[],a=new Set,c=new Set(s),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",v=(Uo.get(h)||0)+1,b=(i.get(h)||0)+1;Uo.set(h,v),i.set(h,b),o.push(h),v===1&&g&&Cd.set(h,!0),b===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),a.clear(),Dm++,function(){o.forEach(function(f){var h=Uo.get(f)-1,p=i.get(f)-1;Uo.set(f,h),i.set(f,p),h||(Cd.has(f)||f.removeAttribute(r),Cd.delete(f)),p||f.removeAttribute(n)}),Dm--,Dm||(Uo=new WeakMap,Uo=new WeakMap,Cd=new WeakMap,jd={})}},V0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=yH(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),xH(r,s,n,"aria-hidden")):function(){return null}},Gr=function(){return Gr=Object.assign||function(t){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)&&(t[i]=n[i])}return t},Gr.apply(this,arguments)};function o2(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}
vendor: 5,007 bytes, lines 584-599
584function wH(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var of="right-scroll-bar-position",af="width-before-scroll-bar",bH="with-scroll-bars-hidden",SH="--removed-body-scroll-bar-size";function Lm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function kH(e,t){var n=m.useState(function(){return{value:e,callback:t,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=t,n.facade}var _H=typeof window<"u"?m.useLayoutEffect:m.useEffect,Lk=new WeakMap;function CH(e,t){var n=kH(null,function(r){return e.forEach(function(s){return Lm(s,r)})});return _H(function(){var r=Lk.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(a){i.has(a)||Lm(a,null)}),i.forEach(function(a){s.has(a)||Lm(a,o)})}Lk.set(n,e)},[e]),n}function jH(e){return e}function EH(e,t){t===void 0&&(t=jH);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]:e},useMedium:function(i){var o=t(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 c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return s}function NH(e){e===void 0&&(e={});var t=EH(null);return t.options=Gr({async:!0,ssr:!1},e),t}var a2=function(e){var t=e.sideCar,n=o2(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Gr({},n))};a2.isSideCarExport=!0;function TH(e,t){return e.useMedium(t),a2}var l2=NH(),$m=function(){},up=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:$m,onWheelCapture:$m,onTouchMoveCapture:$m}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noIsolation,g=e.inert,v=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,w=e.gapMode,x=o2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,C=CH([n,t]),k=Gr(Gr({},x),s);return m.createElement(m.Fragment,null,d&&m.createElement(S,{sideCar:l2,removeScrollBar:u,shards:f,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),o?m.cloneElement(m.Children.only(a),Gr(Gr({},k),{ref:C})):m.createElement(y,Gr({},k,{className:c,ref:C}),a))});up.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};up.classNames={fullWidth:af,zeroRight:of};var PH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=PH();return t&&e.setAttribute("nonce",t),e}function RH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function MH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var IH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AH())&&(RH(t,n),MH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},OH=function(){var e=IH();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},c2=function(){var e=OH(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},DH={left:0,top:0,right:0,gap:0},Fm=function(e){return parseInt(e||"",10)||0},LH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Fm(n),Fm(r),Fm(s)]},$H=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return DH;var t=LH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},FH=c2(),Ra="data-scroll-locked",zH=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
585  .`.concat(bH,` {
586   overflow: hidden `).concat(r,`;
587   padding-right: `).concat(a,"px ").concat(r,`;
588  }
589  body[`).concat(Ra,`] {
590    overflow: hidden `).concat(r,`;
591    overscroll-behavior: contain;
592    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
593    padding-left: `.concat(s,`px;
594    padding-top: `).concat(i,`px;
595    padding-right: `).concat(o,`px;
596    margin-left:0;
597    margin-top:0;
598    margin-right: `).concat(a,"px ").concat(r,`;
599    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";
599")].filter(Boolean).join(""),`
600  }
601  
602  .`).concat(of,` {
603    right: `).concat(a,"px ").concat(r,`;
604  }
605  
606  .`).concat(af,` {
607    margin-right: `).concat(a,"px ").concat(r,`;
608  }
609  
610  .`).concat(of," .").concat(of,` {
611    right: 0 `).concat(r,`;
612  }
613  
614  .`).concat(af," .").concat(af,` {
615    margin-right: 0 `).concat(r,`;
616  }
617  
618  body[`).concat(Ra,`] {
619    `).concat(SH,": ").concat(a,`px;
620  }
621`)},$k=function(){var e=parseInt(document.body.getAttribute(Ra)||"0",10);return isFinite(e)?e:0},BH=function(){m.useEffect(function(){return document.body.setAttribute(Ra,($k()+1).toString()),function(){var e=$k()-1;e<=0?document.body.removeAttribute(Ra):document.body.setAttribute(Ra,e.toString())}},[])},VH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;BH();var i=m.useMemo(function(){return $H(s)},[s]);return m.createElement(FH,{styles:zH(i,!t,s,n?"":"!important")})},av=!1;if(typeof window<"u")try{var Ed=Object.defineProperty({},"passive",{get:function(){return av=!0,!0}});window.addEventListener("test",Ed,Ed),window.removeEventListener("test",Ed,Ed)}catch{av=!1}var Ho=av?{passive:!1}:!1,UH=function(e){return e.tagName==="TEXTAREA"},u2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!UH(e)&&n[t]==="visible")},HH=function(e){return u2(e,"overflowY")},WH=function(e){return u2(e,"overflowX")},Fk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=d2(e,r);if(s){var i=f2(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},GH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},d2=function(e,t){return e==="v"?HH(t):WH(t)},f2=function(e,t){return e==="v"?qH(t):GH(t)},KH=function(e,t){return e==="h"&&t==="rtl"?-1:1},YH=function(e,t,n,r,s){var i=KH(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,c=t.contains(a),u=!1,d=o>0,f=0,h=0;do{var p=f2(e,a),g=p[0],v=p[1],b=p[2],y=v-b-i*g;(g||y)&&d2(e,a)&&(f+=y,h+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(h)<1||!s))&&(u=!0),u},Nd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zk=function(e){return[e.deltaX,e.deltaY]},Bk=function(e){return e&&"current"in e?e.current:e},JH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},XH=function(e){return`
622  .block-interactivity-`.concat(e,` {pointer-events: none;}
623  .allow-interactivity-`).concat(e,` {pointer-events: all;}
624`)},QH=0,Wo=[];function ZH(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(QH++)[0],i=m.useState(c2)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=wH([e.lockRef.current],(e.shards||[]).map(Bk),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var y=Nd(v),w=n.current,x="deltaX"in v?v.deltaX:w[0]-y[0],S="deltaY"in v?v.deltaY:w[1]-y[1],C,k=v.target,_=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in v&&_==="h"&&k.type==="range")return!1;var j=Fk(_,k);if(!j)return!0;if(j?C=_:(C=_==="v"?"h":"v",j=Fk(_,k)),!j)return!1;if(!r.current&&"changedTouches"in v&&(x||S)&&(r.current=C),!C)return!0;var R=r.current||C;return YH(R,b,v,R==="h"?x:S,!0)},[]),c=m.useCallback(function(v){var b=v;if(!(!Wo.length||Wo[Wo.length-1]!==i)){var y="deltaY"in b?zk(b):Nd(b),w=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&JH(C.delta,y)})[0];if(w&&w.should){b.cancelable&&b.preventDefault();return}
vendor: 17,649 bytes, line 624
624if(!w){var x=(o.current.shards||[]).map(Bk).filter(Boolean).filter(function(C){return C.contains(b.target)}),S=x.length>0?a(b,x[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=m.useCallback(function(v,b,y,w){var x={name:v,delta:b,target:y,should:w,shadowParent:e7(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),d=m.useCallback(function(v){n.current=Nd(v),r.current=void 0},[]),f=m.useCallback(function(v){u(v.type,zk(v),v.target,a(v,e.lockRef.current))},[]),h=m.useCallback(function(v){u(v.type,Nd(v),v.target,a(v,e.lockRef.current))},[]);m.useEffect(function(){return Wo.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ho),document.addEventListener("touchmove",c,Ho),document.addEventListener("touchstart",d,Ho),function(){Wo=Wo.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ho),document.removeEventListener("touchmove",c,Ho),document.removeEventListener("touchstart",d,Ho)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(i,{styles:XH(s)}):null,p?m.createElement(VH,{gapMode:e.gapMode}):null)}function e7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const t7=TH(l2,ZH);var dp=m.forwardRef(function(e,t){return m.createElement(up,Gr({},e,{ref:t,sideCar:t7}))});dp.classNames=up.classNames;var lv=["Enter"," "],n7=["ArrowDown","PageUp","Home"],h2=["ArrowUp","PageDown","End"],r7=[...n7,...h2],s7={ltr:[...lv,"ArrowRight"],rtl:[...lv,"ArrowLeft"]},i7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ru="Menu",[du,o7,a7]=TP(Ru),[Mo,p2]=Bs(Ru,[a7,pl,cp]),fp=pl(),m2=cp(),[l7,Io]=Mo(Ru),[c7,Mu]=Mo(Ru),g2=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=e,a=fp(t),[c,u]=m.useState(null),d=m.useRef(!1),f=vr(i),h=T0(s);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),l.jsx(F0,{...a,children:l.jsx(l7,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:l.jsx(c7,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};g2.displayName=Ru;var u7="MenuAnchor",U0=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=fp(n);return l.jsx(ap,{...s,...r,ref:t})});U0.displayName=u7;var H0="MenuPortal",[d7,y2]=Mo(H0,{forceMount:void 0}),v2=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=Io(H0,t);return l.jsx(d7,{scope:t,forceMount:n,children:l.jsx(sr,{present:n||i.open,children:l.jsx(Au,{asChild:!0,container:s,children:r})})})};v2.displayName=H0;var mr="MenuContent",[f7,W0]=Mo(mr),x2=m.forwardRef((e,t)=>{const n=y2(mr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Io(mr,e.__scopeMenu),o=Mu(mr,e.__scopeMenu);return l.jsx(du.Provider,{scope:e.__scopeMenu,children:l.jsx(sr,{present:r||i.open,children:l.jsx(du.Slot,{scope:e.__scopeMenu,children:o.modal?l.jsx(h7,{...s,ref:t}):l.jsx(p7,{...s,ref:t})})})})}),h7=m.forwardRef((e,t)=>{const n=Io(mr,e.__scopeMenu),r=m.useRef(null),s=vt(t,r);return m.useEffect(()=>{const i=r.current;if(i)return V0(i)},[]),l.jsx(q0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),p7=m.forwardRef((e,t)=>{const n=Io(mr,e.__scopeMenu);return l.jsx(q0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),q0=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...v}=e,b=Io(mr,n),y=Mu(mr,n),w=fp(n),x=m2(n),S=o7(n),[C,k]=m.useState(null),_=m.useRef(null),j=vt(t,_,b.onContentChange),R=m.useRef(0),P=m.useRef(""),M=m.useRef(0),T=m.useRef(null),L=m.useRef("right"),F=m.useRef(0),z=g?dp:m.Fragment,V=g?{as:_i,allowPinchZoom:!0}:void 0,I=D=>{var W,ne;const E=P.current+D,K=S().filter(oe=>!oe.disabled),te=document.activeElement,N=(W=K.find(oe=>oe.ref.current===te))==null?void 0:W.textValue,ee=K.map(oe=>oe.textValue),ie=j7(ee,E,N),U=(ne=K.find(oe=>oe.textValue===ie))==null?void 0:ne.ref.current;(function oe(Z){P.current=Z,window.clearTimeout(R.current),Z!==""&&(R.current=window.setTimeout(()=>oe(""),1e3))})(E),U&&setTimeout(()=>U.focus())};m.useEffect(()=>()=>window.clearTimeout(R.current),[]),P0();const A=m.useCallback(D=>{var K,te;return L.current===((K=T.current)==null?void 0:K.side)&&N7(D,(te=T.current)==null?void 0:te.area)},[]);return l.jsx(f7,{scope:n,searchRef:P,onItemEnter:m.useCallback(D=>{A(D)&&D.preventDefault()},[A]),onItemLeave:m.useCallback(D=>{var E;A(D)||((E=_.current)==null||E.focus(),k(null))},[A]),onTriggerLeave:m.useCallback(D=>{A(D)&&D.preventDefault()},[A]),pointerGraceTimerRef:M,onPointerGraceIntentChange:m.useCallback(D=>{T.current=D},[]),children:l.jsx(z,{...V,children:l.jsx(rp,{asChild:!0,trapped:s,onMountAutoFocus:Ae(i,D=>{var E;D.preventDefault(),(E=_.current)==null||E.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:l.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:l.jsx(r2,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Ae(c,D=>{y.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(z0,{role:"menu","aria-orientation":"vertical","data-state":O2(b.open),"data-radix-menu-content":"",dir:y.dir,...w,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Ae(v.onKeyDown,D=>{const K=D.target.closest("[data-radix-menu-content]")===D.currentTarget,te=D.ctrlKey||D.altKey||D.metaKey,N=D.key.length===1;K&&(D.key==="Tab"&&D.preventDefault(),!te&&N&&I(D.key));const ee=_.current;if(D.target!==ee||!r7.includes(D.key))return;D.preventDefault();const U=S().filter(W=>!W.disabled).map(W=>W.ref.current);h2.includes(D.key)&&U.reverse(),_7(U)}),onBlur:Ae(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(R.current),P.current="")}),onPointerMove:Ae(e.onPointerMove,fu(D=>{const E=D.target,K=F.current!==D.clientX;if(D.currentTarget.contains(E)&&K){const te=D.clientX>F.current?"right":"left";L.current=te,F.current=D.clientX}}))})})})})})})});x2.displayName=mr;var m7="MenuGroup",G0=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Je.div,{role:"group",...r,ref:t})});G0.displayName=m7;var g7="MenuLabel",w2=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Je.div,{...r,ref:t})});w2.displayName=g7;var dh="MenuItem",Vk="menu.itemSelect",hp=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=m.useRef(null),o=Mu(dh,e.__scopeMenu),a=W0(dh,e.__scopeMenu),c=vt(t,i),u=m.useRef(!1),d=()=>{const f=i.current;if(!n&&f){const h=new CustomEvent(Vk,{bubbles:!0,cancelable:!0});f.addEventListener(Vk,p=>r==null?void 0:r(p),{once:!0}),NP(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return l.jsx(b2,{...s,ref:c,disabled:n,onClick:Ae(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:Ae(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:Ae(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||lv.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});hp.displayName=dh;var b2=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,o=W0(dh,n),a=m2(n),c=m.useRef(null),u=vt(t,c),[d,f]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{const g=c.current;g&&p((g.textContent??"").trim())},[i.children]),l.jsx(du.ItemSlot,{scope:n,disabled:r,textValue:s??h,children:l.jsx(s2,{asChild:!0,...a,focusable:!r,children:l.jsx(Je.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:Ae(e.onPointerMove,fu(g=>{r?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,fu(g=>o.onItemLeave(g))),onFocus:Ae(e.onFocus,()=>f(!0)),onBlur:Ae(e.onBlur,()=>f(!1))})})})}),y7="MenuCheckboxItem",S2=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return l.jsx(E2,{scope:e.__scopeMenu,checked:n,children:l.jsx(hp,{role:"menuitemcheckbox","aria-checked":fh(n)?"mixed":n,...s,ref:t,"data-state":Y0(n),onSelect:Ae(s.onSelect,()=>r==null?void 0:r(fh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});S2.displayName=y7;var k2="MenuRadioGroup",[v7,x7]=Mo(k2,{value:void 0,onValueChange:()=>{}}),_2=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=vr(r);return l.jsx(v7,{scope:e.__scopeMenu,value:n,onValueChange:i,children:l.jsx(G0,{...s,ref:t})})});_2.displayName=k2;var C2="MenuRadioItem",j2=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=x7(C2,e.__scopeMenu),i=n===s.value;return l.jsx(E2,{scope:e.__scopeMenu,checked:i,children:l.jsx(hp,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Y0(i),onSelect:Ae(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});j2.displayName=C2;var K0="MenuItemIndicator",[E2,w7]=Mo(K0,{checked:!1}),N2=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=w7(K0,n);return l.jsx(sr,{present:r||fh(i.checked)||i.checked===!0,children:l.jsx(Je.span,{...s,ref:t,"data-state":Y0(i.checked)})})});N2.displayName=K0;var b7="MenuSeparator",T2=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});T2.displayName=b7;var S7="MenuArrow",P2=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=fp(n);return l.jsx(B0,{...s,...r,ref:t})});P2.displayName=S7;var k7="MenuSub",[yie,A2]=Mo(k7),nc="MenuSubTrigger",R2=m.forwardRef((e,t)=>{const n=Io(nc,e.__scopeMenu),r=Mu(nc,e.__scopeMenu),s=A2(nc,e.__scopeMenu),i=W0(nc,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),l.jsx(U0,{asChild:!0,...u,children:l.jsx(b2,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":O2(n.open),...e,ref:Jh(t,s.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,fu(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ae(e.onPointerLeave,fu(f=>{var p,g;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const v=(g=n.content)==null?void 0:g.dataset.side,b=v==="right",y=b?-5:5,w=h[b?"left":"right"],x=h[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:w,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:w,y:h.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,f=>{var p;const h=i.searchRef.current!=="";e.disabled||h&&f.key===" "||s7[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});R2.displayName=nc;var M2="MenuSubContent",I2=m.forwardRef((e,t)=>{const n=y2(mr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Io(mr,e.__scopeMenu),o=Mu(mr,e.__scopeMenu),a=A2(M2,e.__scopeMenu),c=m.useRef(null),u=vt(t,c);return l.jsx(du.Provider,{scope:e.__scopeMenu,children:l.jsx(sr,{present:r||i.open,children:l.jsx(du.Slot,{scope:e.__scopeMenu,children:l.jsx(q0,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:Ae(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=i7[o.dir].includes(d.key);f&&h&&(i.onOpenChange(!1),(p=a.trigger)==null||p.focus(),d.preventDefault())})})})})})});I2.displayName=M2;function O2(e){return e?"open":"closed"}function fh(e){return e==="indeterminate"}function Y0(e){return fh(e)?"indeterminate":e?"checked":"unchecked"}function _7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function C7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function j7(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=C7(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function E7(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const a=t[i].x,c=t[i].y,u=t[o].x,d=t[o].y;c>r!=d>r&&n<(u-a)*(r-c)/(d-c)+a&&(s=!s)}return s}function N7(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return E7(n,t)}function fu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var T7=g2,P7=U0,A7=v2,R7=x2,M7=G0,I7=w2,O7=hp,D7=S2,L7=_2,$7=j2,F7=N2,z7=T2,B7=P2,V7=R2,U7=I2,J0="DropdownMenu",[H7,vie]=Bs(J0,[p2]),bn=p2(),[W7,D2]=H7(J0),L2=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,c=bn(t),u=m.useRef(null),[d=!1,f]=Ro({prop:s,defaultProp:i,onChange:o});return l.jsx(W7,{scope:t,triggerId:Ts(),triggerRef:u,contentId:Ts(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a,children:l.jsx(T7,{...c,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};L2.displayName=J0;var $2="DropdownMenuTrigger",F2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=D2($2,n),o=bn(n);return l.jsx(P7,{asChild:!0,...o,children:l.jsx(Je.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:Jh(t,i.triggerRef),onPointerDown:Ae(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Ae(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});F2.displayName=$2;var q7="DropdownMenuPortal",z2=e=>{const{__scopeDropdownMenu:t,...n}=e,r=bn(t);return l.jsx(A7,{...r,...n})};z2.displayName=q7;var B2="DropdownMenuContent",V2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=D2(B2,n),i=bn(n),o=m.useRef(!1);return l.jsx(R7,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});V2.displayName=B2;var G7="DropdownMenuGroup",K7=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(M7,{...s,...r,ref:t})});K7.displayName=G7;var Y7="DropdownMenuLabel",U2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(I7,{...s,...r,ref:t})});U2.displayName=Y7;var J7="DropdownMenuItem",H2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(O7,{...s,...r,ref:t})});H2.displayName=J7;var X7="DropdownMenuCheckboxItem",W2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(D7,{...s,...r,ref:t})});W2.displayName=X7;var Q7="DropdownMenuRadioGroup",Z7=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(L7,{...s,...r,ref:t})});Z7.displayName=Q7;var eW="DropdownMenuRadioItem",q2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx($7,{...s,...r,ref:t})});q2.displayName=eW;var tW="DropdownMenuItemIndicator",G2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(F7,{...s,...r,ref:t})});G2.displayName=tW;var nW="DropdownMenuSeparator",K2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(z7,{...s,...r,ref:t})});K2.displayName=nW;var rW="DropdownMenuArrow",sW=m.forwardRef((e,t)=>
624{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(B7,{...s,...r,ref:t})});sW.displayName=rW;var iW="DropdownMenuSubTrigger",Y2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(V7,{...s,...r,ref:t})});Y2.displayName=iW;var oW="DropdownMenuSubContent",J2=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=bn(n);return l.jsx(U7,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});J2.displayName=oW;var aW=L2,lW=F2,cW=z2,X2=V2,Q2=U2,Z2=H2,eA=W2,tA=q2,nA=G2,rA=K2,sA=Y2,iA=J2;const oA=aW,aA=lW,uW=m.forwardRef(({className:e,inset:t,children:n,...r},s)=>l.jsxs(sA,{ref:s,className:ae("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,l.jsx(wo,{className:"ml-auto h-4 w-4"})]}));uW.displayName=sA.displayName;const dW=m.forwardRef(({className:e,...t},n)=>l.jsx(iA,{ref:n,className:ae("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));dW.displayName=iA.displayName;const X0=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(cW,{children:l.jsx(X2,{ref:r,sideOffset:t,className:ae("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",e),...n})}));X0.displayName=X2.displayName;const ci=m.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(Z2,{ref:r,className:ae("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ci.displayName=Z2.displayName;const fW=m.forwardRef(({className:e,children:t,checked:n,...r},s)=>l.jsxs(eA,{ref:s,className:ae("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(nA,{children:l.jsx(xo,{className:"h-4 w-4"})})}),t]}));fW.displayName=eA.displayName;const hW=m.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(tA,{ref:r,className:ae("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(nA,{children:l.jsx(vN,{className:"h-2 w-2 fill-current"})})}),t]}));hW.displayName=tA.displayName;const pW=m.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(Q2,{ref:r,className:ae("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));pW.displayName=Q2.displayName;const cv=m.forwardRef(({className:e,...t},n)=>l.jsx(rA,{ref:n,className:ae("-mx-1 my-1 h-px bg-muted",e),...t}));cv.displayName=rA.displayName;
624var Q0="Avatar",[mW,xie]=Bs(Q0),[gW,lA]=mW(Q0),cA=m.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,i]=m.useState("idle");return l.jsx(gW,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:l.jsx(Je.span,{...r,ref:t})})});cA.displayName=Q0;var uA="AvatarImage",dA=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=e,o=lA(uA,n),a=yW(r,i.referrerPolicy),c=vr(u=>{s(u),o.onImageLoadingStatusChange(u)});return Os(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?l.jsx(Je.img,{...i,ref:t,src:r}):null});dA.displayName=uA;var fA="AvatarFallback",hA=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,i=lA(fA,n),[o,a]=m.useState(r===void 0);return m.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?l.jsx(Je.span,{...s,ref:t}):null});hA.displayName=fA;function yW(e,t){const[n,r]=m.useState("idle");return Os(()=>{if(!e){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=e,t&&(i.referrerPolicy=t),()=>{s=!1}},[e,t]),n}var pA=cA,mA=dA,gA=hA;const ml=m.forwardRef(({className:e,...t},n)=>l.jsx(pA,{ref:n,className:ae("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ml.displayName=pA.displayName;const _o=m.forwardRef(({className:e,...t},n)=>l.jsx(mA,{ref:n,className:ae("aspect-square h-full w-full",e),...t}));_o.displayName=mA.displayName;const gl=m.forwardRef(({className:e,...t},n)=>l.jsx(gA,{ref:n,className:ae("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));gl.displayName=gA.displayName;const Or=({children:e,fullHeight:t=!1})=>{var v,b,y,w,x;const n=Kt(),r=Di(),[s,i]=$.useState(null),[o,a]=$.useState(!0),{showPrompt:c,closePrompt:u,isIOS:d,handleInstall:f}=SU();$.useEffect(()=>{let S=!0;const C=setTimeout(()=>{S&&o&&a(!1)},5e3),{data:{subscription:k}}=q.auth.onAuthStateChange((_,j)=>{_==="SIGNED_IN"&&r.pathname==="/login"&&n("/profile"),_==="SIGNED_OUT"&&(["/","/login","/discover","/shared"].some(M=>r.pathname===M||r.pathname.startsWith("/shared/"))||n("/login")),S&&(i(j),a(!1))});return q.auth.getSession().then(({data:{session:_}})=>{var j;S&&(i(_),a(!1),_&&((j=r.state)==null?void 0:j.from)==="/login"&&n("/profile",{replace:!0}))}).catch(()=>{S&&a(!1)}),()=>{S=!1,clearTimeout(C),k.unsubscribe()}},[n,r.pathname,r.state]);const h=async()=>{try{a(!0),await q.auth.signOut(),n("/"),J.success("Logged out successfully")}catch(S){console.error("Logout error:",S),J.error(S.message||"Error logging out")}finally{a(!1)}};r.pathname;const p=(v=s==null?void 0:s.user)==null?void 0:v.email,g=p?p[0].toUpperCase():"U";return o?l.jsx("div",{className:"dark min-h-screen bg-background flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse",children:l.jsx(lu,{size:"sm"})})}):l.jsxs("div",{className:"dark min-h-screen bg-background flex flex-col",children:[l.jsx(bU,{isOpen:c,onClose:u,isIOS:d,onInstall:f}),l.jsx("nav",{className:"fixed top-0 w-full bg-background/80 backdrop-blur-xl border-b border-border/5 z-50",children:l.jsxs("div",{className:"container mx-auto px-4 h-16 flex items-center justify-between",children:[l.jsx(s4,{to:"/",className:"group relative",children:l.jsx(lu,{size:"sm"})}),l.jsxs("div",{className:"flex items-center gap-1 sm:gap-4",children:[l.jsxs(Fe,{variant:"ghost",size:"sm",onClick:()=>J("Coming soon",{description:"Discover is currently under development."}),className:"gap-2 text-foreground/80 hover:text-primary",children:[l.jsx(C1,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:"Discover"})]}),l.jsxs(Fe,{variant:"ghost",size:"sm",onClick:()=>n("/new-plan"),className:"gap-2 text-foreground/80 hover:text-primary",children:[l.jsx(Hh,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:"New Plan"})]}),s&&l.jsxs(Fe,{variant:"ghost",size:"sm",onClick:()=>n("/my-plans"),className:"gap-2 text-foreground/80 hover:text-primary",children:[l.jsx(kN,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:"My Plans"})]}),s?l.jsxs(oA,{children:[l.jsx(aA,{asChild:!0,children:l.jsx(Fe,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:l.jsxs(ml,{className:"h-10 w-10",children:[l.jsx(_o,{src:(y=(b=s==null?void 0:s.user)==null?void 0:b.user_metadata)==null?void 0:y.avatar_url}),l.jsx(gl,{className:"bg-primary/10 text-primary",children:g})]})})}),l.jsxs(X0,{align:"end",className:"w-56 bg-card border-border shadow-2xl",children:[l.jsx("div",{className:"flex items-center justify-between px-2 py-1.5",children:l.jsx("div",{className:"text-sm font-medium",children:((x=(w=s==null?void 0:s.user)==null?void 0:w.user_metadata)==null?void 0:x.full_name)||p})}),l.jsx(cv,{}),l.jsxs(ci,{onClick:()=>n("/profile"),children:[l.jsx(Wh,{className:"mr-2 h-4 w-4"}),"Profile"]}),l.jsxs(ci,{onClick:()=>J("Coming soon",{description:"Discover is currently under development."}),children:[l.jsx(C1,{className:"mr-2 h-4 w-4"}),"Discover Venues"]}),l.jsxs(ci,{onClick:()=>n("/settings"),children:[l.jsx(F4,{className:"mr-2 h-4 w-4"}),"Settings"]}),l.jsx(cv,{}),l.jsxs(ci,{onClick:h,children:[l.jsx(zx,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]}):l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>
624n("/login"),className:"text-foreground/80 hover:text-primary hover:bg-primary/10 transition-colors",children:"Login"}),l.jsx(Fe,{onClick:()=>n("/login"),size:"sm",className:"bg-primary hover:bg-primary/90 transition-colors",children:"Sign Up"})]})]})]})}),l.jsx("main",{className:`flex-1 ${t?"pt-[var(--header-height)]":"pt-24 pb-20"}`,children:l.jsx("div",{className:t?void 0:"relative",children:e})}),!t&&l.jsx(kU,{})]})};var yA={exports:{}},vW="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xW=vW,wW=xW;function vA(){}function xA(){}xA.resetWarningCache=vA;var bW=function(){function e(r,s,i,o,a,c){if(c!==wW){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:xA,resetWarningCache:vA};return n.PropTypes=n,n};yA.exports=bW();var SW=yA.exports;const pt=Ai(SW);function kW(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var wA=m,_W=kW(wA);function Uk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CW(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var jW=!!(typeof window<"u"&&window.document&&window.document.createElement);function EW(e,t,n){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof n<"u"&&typeof n!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function r(s){return s.displayName||s.name||"Component"}return function(i){if(typeof i!="function")throw new Error("Expected WrappedComponent to be a React component.");var o=[],a;function c(){a=e(o.map(function(d){return d.props})),u.canUseDOM?t(a):n&&(a=n(a))}var u=function(d){CW(f,d);function f(){return d.apply(this,arguments)||this}f.peek=function(){return a},f.rewind=function(){if(f.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var g=a;return a=void 0,o=[],g};var h=f.prototype;return h.UNSAFE_componentWillMount=function(){o.push(this),c()},h.componentDidUpdate=function(){c()},h.componentWillUnmount=function(){var g=o.indexOf(this);o.splice(g,1),c()},h.render=function(){return _W.createElement(i,this.props)},f}(wA.PureComponent);return Uk(u,"displayName","SideEffect("+r(i)+")"),Uk(u,"canUseDOM",jW),u}}var NW=EW;const TW=Ai(NW);var PW=typeof Element<"u",AW=typeof Map=="function",RW=typeof Set=="function",MW=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function lf(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!lf(e[r],t[r]))return!1;return!0}var i;if(AW&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!lf(r.value[1],t.get(r.value[0])))return!1;return!0}if(RW&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(MW&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;if(PW&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&e.$$typeof)&&!lf(e[s[r]],t[s[r]]))return!1;return!0}return e!==e&&t!==t}var IW=function(t,n){try{return lf(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const OW=Ai(IW);/*
625object-assign
626(c) Sindre Sorhus
627@license MIT
628*/var Hk=Object.getOwnPropertySymbols,DW=Object.prototype.hasOwnProperty,LW=Object.prototype.propertyIsEnumerable;function $W(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function FW(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(i){s[i]=i}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var zW=FW()?Object.assign:function(e,t){for(var n,r=$W(e),s,i=1;i<arguments.length;i++){n=Object(arguments[i]);for(var o in n)DW.call(n,o)&&(r[o]=n[o]);if(Hk){s=Hk(n);for(var a=0;a<s.length;a++)LW.call(n,s[a])&&(r[s[a]]=n[s[a]])}}return r};const BW=Ai(zW);var uo={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},Be={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(Be).map(function(e){return Be[e]});var mt={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},hh={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},hu={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},VW=Object.keys(hh).reduce(function(e,t){return e[hh[t]]=t,e},{}),UW=[Be.NOSCRIPT,Be.SCRIPT,Be.STYLE],Er="data-react-helmet",HW=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},WW=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qW=function(){function e(t,n){for(var r=0;r<n.length;r++){var s=n[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GW=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Wk=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},KW=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},uv=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},YW=function(t){var n=Ma(t,Be.TITLE),r=Ma(t,hu.TITLE_TEMPLATE);if(r&&n)return r.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var s=Ma(t,hu.DEFAULT_TITLE);return n||s||void 0},JW=function(t){return Ma(t,hu.ON_CHANGE_CLIENT_STATE)||function(){}},zm=function(t,n){return n.filter(function(r){return typeof r[t]<"u"}).map(function(r){return r[t]}).reduce(function(r,s){return kn({},r,s)},{})},XW=function(t,n){return n.filter(function(r){return typeof r[Be.BASE]<"u"}).map(function(r){return r[Be.BASE]}).reverse().reduce(function(r,s){if(!r.length)for(var i=Object.keys(s),o=0;o<i.length;o++){var a=i[o],c=a.toLowerCase();if(t.indexOf(c)!==-1&&s[c])return r.concat(s)}return r},[])},Ml=function(t,n,r){var s={};return r.filter(function(i){return Array.isArray(i[t])?!0:(typeof i[t]<"u"&&tq("Helmet: "+t+' should be of type "Array". Instead found type "'+HW(i[t])+'"'),!1)}).map(function(i){return i[t]}).reverse().reduce(function(i,o){var a={};o.filter(function(h){for(var p=void 0,g=Object.keys(h),v=0;v<g.length;v++){var b=g[v],y=b.toLowerCase();n.indexOf(y)!==-1&&!(p===mt.REL&&h[p].toLowerCase()==="canonical")&&!(y===mt.REL&&h[y].toLowerCase()==="stylesheet")&&(p=y),n.indexOf(b)!==-1&&(b===mt.INNER_HTML||b===mt.CSS_TEXT||b===mt.ITEM_PROP)&&(p=b)}if(!p||!h[p])return!1;var w=h[p].toLowerCase();return s[p]||(s[p]={}),a[p]||(a[p]={}),s[p][w]?!1:(a[p][w]=!0,!0)}
628).reverse().forEach(function(h){return i.push(h)});for(var c=Object.keys(a),u=0;u<c.length;u++){var d=c[u],f=BW({},s[d],a[d]);s[d]=f}return i},[]).reverse()},Ma=function(t,n){for(var r=t.length-1;r>=0;r--){var s=t[r];if(s.hasOwnProperty(n))return s[n]}return null},QW=function(t){return{baseTag:XW([mt.HREF,mt.TARGET],t),bodyAttributes:zm(uo.BODY,t),defer:Ma(t,hu.DEFER),encode:Ma(t,hu.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:zm(uo.HTML,t),linkTags:Ml(Be.LINK,[mt.REL,mt.HREF],t),metaTags:Ml(Be.META,[mt.NAME,mt.CHARSET,mt.HTTPEQUIV,mt.PROPERTY,mt.ITEM_PROP],t),noscriptTags:Ml(Be.NOSCRIPT,[mt.INNER_HTML],t),onChangeClientState:JW(t),scriptTags:Ml(Be.SCRIPT,[mt.SRC,mt.INNER_HTML],t),styleTags:Ml(Be.STYLE,[mt.CSS_TEXT],t),title:YW(t),titleAttributes:zm(uo.TITLE,t)}},dv=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){dv(t)},0)}}(),qk=function(t){return clearTimeout(t)},ZW=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||dv:global.requestAnimationFrame||dv,eq=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||qk:global.cancelAnimationFrame||qk,tq=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},Il=null,nq=function(t){Il&&eq(Il),t.defer?Il=ZW(function(){Gk(t,function(){Il=null})}):(Gk(t),Il=null)},Gk=function(t,n){var r=t.baseTag,s=t.bodyAttributes,i=t.htmlAttributes,o=t.linkTags,a=t.metaTags,c=t.noscriptTags,u=t.onChangeClientState,d=t.scriptTags,f=t.styleTags,h=t.title,p=t.titleAttributes;fv(Be.BODY,s),fv(Be.HTML,i),rq(h,p);var g={baseTag:qo(Be.BASE,r),linkTags:qo(Be.LINK,o),metaTags:qo(Be.META,a),noscriptTags:qo(Be.NOSCRIPT,c),scriptTags:qo(Be.SCRIPT,d),styleTags:qo(Be.STYLE,f)},v={},b={};Object.keys(g).forEach(function(y){var w=g[y],x=w.newTags,S=w.oldTags;x.length&&(v[y]=x),S.length&&(b[y]=g[y].oldTags)}),n&&n(),u(t,v,b)},bA=function(t){return Array.isArray(t)?t.join(""):t},rq=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=bA(t)),fv(Be.TITLE,n)},fv=function(t,n){var r=document.getElementsByTagName(t)[0];if(r){for(var s=r.getAttribute(Er),i=s?s.split(","):[],o=[].concat(i),a=Object.keys(n),c=0;c<a.length;c++){var u=a[c],d=n[u]||"";r.getAttribute(u)!==d&&r.setAttribute(u,d),i.indexOf(u)===-1&&i.push(u);var f=o.indexOf(u);f!==-1&&o.splice(f,1)}for(var h=o.length-1;h>=0;h--)r.removeAttribute(o[h]);i.length===o.length?r.removeAttribute(Er):r.getAttribute(Er)!==a.join(",")&&r.setAttribute(Er,a.join(","))}},qo=function(t,n){var r=document.head||document.querySelector(Be.HEAD),s=r.querySelectorAll(t+"["+Er+"]"),i=Array.prototype.slice.call(s),o=[],a=void 0;return n&&n.length&&n.forEach(function(c){var u=document.createElement(t);for(var d in c)if(c.hasOwnProperty(d))if(d===mt.INNER_HTML)u.innerHTML=c.innerHTML;else if(d===mt.CSS_TEXT)u.styleSheet?u.styleSheet.cssText=c.cssText:u.appendChild(document.createTextNode(c.cssText));else{var f=typeof c[d]>"u"?"":c[d];u.setAttribute(d,f)}u.setAttribute(Er,"true"),i.some(function(h,p){return a=p,u.isEqualNode(h)})?i.splice(a,1):o.push(u)}),i.forEach(function(c){return c.parentNode.removeChild(c)}),o.forEach(function(c){return r.appendChild(c)}),{oldTags:i,newTags:o}},SA=function(t){return Object.keys(t).reduce(function(n,r){var s=typeof t[r]<"u"?r+'="'+t[r]+'"':""+r;return n?n+" "+s:s},"")},sq=function(t,n,r,s){var i=SA(r),o=bA(n);return i?"<"+t+" "+Er+'="true" '+i+">"+uv(o,s)+"</"+t+">":"<"+t+" "+Er+'="true">'+uv(o,s)+"</"+t+">"},iq=function(t,n,r){return n.reduce(function(s,i){var o=Object.keys(i).filter(function(u){return!(u===mt.INNER_HTML||u===mt.CSS_TEXT)}).reduce(function(u,d){var f=typeof i[d]>"u"?d:d+'="'+uv(i[d],r)+'"';return u?u+" "+f:f},""),a=i.innerHTML||i.cssText||"",c=UW.indexOf(t)===-1;return s+"<"+t+" "+Er+'="true" '+o+(c?"/>":">"+a+"</"+t+">")},"")},kA=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,s){return r[hh[s]||s]=t[s],r},n)},oq=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,s){return r[VW[s]||s]=t[s],r},n)},aq=function(t,n,r){var s,i=(s={key:n},s[Er]=!0,s),o=kA(r,i);return[$.createElement(Be.TITLE,o,n)]},lq=function(t,n){return n.map(function(r,s){var i,o=(i={key:s},i[Er]=!0,i);return Object.keys(r).forEach(function(a){var c=hh[a]||a;if(c===mt.INNER_HTML||c===mt.CSS_TEXT){var u=r.innerHTML||r.cssText;o.dangerouslySetInnerHTML={__html:u}}else o[c]=r[a]}),$.createElement(t,o)})},os=function(t,n,r){switch(t){case Be.TITLE:return{toComponent:function(){return aq(t,n.title,n.titleAttributes)},toString:function(){return sq(t,n.title,n.titleAttributes,r)}};case uo.BODY:case uo.HTML:return{toComponent:function(){return kA(n)},toString:function(){return SA(n)}};default:return{toComponent:function(){return lq(t,n)},toString:function(){return iq(t,n,r)}}}},_A=function(t){var n=t.baseTag,r=t.bodyAttributes,s=t.encode,i=t.htmlAttributes,o=t.linkTags,a=t.metaTags,c=t.noscriptTags,u=t.scriptTags,d=t.styleTags,f=t.title,h=f===void 0?"":f,p=t.titleAttributes;return{base:os(Be.BASE,n,s),bodyAttributes:os(uo.BODY,r,s),htmlAttributes:os(uo.HTML,i,s),link:os(Be.LINK,o,s),meta:os(Be.META,a,s),noscript:os(Be.NOSCRIPT,c,s),script:os(Be.SCRIPT,u,s),style:os(Be.STYLE,d,s),title:os(Be.TITLE,{title:h,titleAttributes:p},s)}},cq=function(t){var n,r;return r=n=function(s){GW(i,s);function i(){return WW(this,i),KW(this,s.apply(this,arguments))}return i.prototype.shouldComponentUpdate=function(a){return!OW(this.props,a)},i.prototype.mapNestedChildrenToProps=function(a,c){if(!c)return null;switch(a.type){case Be.SCRIPT:case Be.NOSCRIPT:return{innerHTML:c};case Be.STYLE:return{cssText:c}}throw new Error("<"+a.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},i.prototype.flattenArrayTypeChildren=function(a){var c,u=a.child,d=a.arrayTypeChildren,f=a.newChildProps,h=a.nestedChildren;return kn({},d,(c={},c[u.type]=[].concat(d[u.type]||[],[kn({},f,this.mapNestedChildrenToProps(u,h))]),c))},i.prototype.mapObjectTypeChildren=function(a){var c,u,d=a.child,f=a.newProps,h=a.newChildProps,p=a.nestedChildren;switch(d.type){case Be.TITLE:return kn({},f,(c={},c[d.type]=p,c.titleAttributes=kn({},h),c));case Be.BODY:return kn({},f,{bodyAttributes:kn({},h)});case Be.HTML:return kn({},f,{htmlAttributes:kn({},h)})}return kn({},f,(u={},u[d.type]=kn({},h),u))},i.prototype.mapArrayTypeChildrenToProps=function(a,c){var u=kn({},c);
628return Object.keys(a).forEach(function(d){var f;u=kn({},u,(f={},f[d]=a[d],f))}),u},i.prototype.warnOnInvalidChildren=function(a,c){return!0},i.prototype.mapChildrenToProps=function(a,c){var u=this,d={};return $.Children.forEach(a,function(f){if(!(!f||!f.props)){var h=f.props,p=h.children,g=Wk(h,["children"]),v=oq(g);switch(u.warnOnInvalidChildren(f,p),f.type){case Be.LINK:case Be.META:case Be.NOSCRIPT:case Be.SCRIPT:case Be.STYLE:d=u.flattenArrayTypeChildren({child:f,arrayTypeChildren:d,newChildProps:v,nestedChildren:p});break;default:c=u.mapObjectTypeChildren({child:f,newProps:c,newChildProps:v,nestedChildren:p});break}}}),c=this.mapArrayTypeChildrenToProps(d,c),c},i.prototype.render=function(){var a=this.props,c=a.children,u=Wk(a,["children"]),d=kn({},u);return c&&(d=this.mapChildrenToProps(c,d)),$.createElement(t,d)},qW(i,null,[{key:"canUseDOM",set:function(a){t.canUseDOM=a}}]),i}($.Component),n.propTypes={base:pt.object,bodyAttributes:pt.object,children:pt.oneOfType([pt.arrayOf(pt.node),pt.node]),defaultTitle:pt.string,defer:pt.bool,encodeSpecialCharacters:pt.bool,htmlAttributes:pt.object,link:pt.arrayOf(pt.object),meta:pt.arrayOf(pt.object),noscript:pt.arrayOf(pt.object),onChangeClientState:pt.func,script:pt.arrayOf(pt.object),style:pt.arrayOf(pt.object),title:pt.string,titleAttributes:pt.object,titleTemplate:pt.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var s=t.rewind();return s||(s=_A({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),s},r},uq=function(){return null},dq=TW(QW,nq,_A)(uq),hv=cq(dq);hv.renderStatic=hv.rewind;const bi={default:{city:"your city",country:"your country",names:["Alex","Sam","Jordan","Taylor","Morgan"],venues:{japanese:"Sakura House",mediterranean:"Olive Grove",mexican:"El Camino"}}},CA=()=>new Promise((e,t)=>{navigator.geolocation.getCurrentPosition(e,n=>{console.warn(`Geolocation error (${n.code}): ${n.message}`),t(n)},{timeout:1e4,maximumAge:3e5})}),jA=async(e,t)=>{var n,r,s,i,o,a;try{const c=await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${t}`);if(!c.ok)throw new Error("Failed to fetch location data from Nominatim");const u=await c.json(),d=((n=u.address)==null?void 0:n.city)||((r=u.address)==null?void 0:r.town)||((s=u.address)==null?void 0:s.municipality)||((i=u.address)==null?void 0:i.village)||((o=u.address)==null?void 0:o.suburb)||bi.default.city;return{...bi.default,city:d,country:((a=u.address)==null?void 0:a.country)||bi.default.country}}catch(c){throw console.error("Reverse geocoding failed:",c),c}},fq=async()=>{try{const e=await fetch("https://ipapi.co/json/");if(!e.ok)throw new Error("IP location service unavailable");const t=await e.json();return{...bi.default,city:t.city||bi.default.city,country:t.country_name||bi.default.country}}catch(e){throw console.error("IP-based location failed:",e),e}},hq=()=>{try{const e=sessionStorage.getItem("userLocation");if(!e)return null;const t=JSON.parse(e),n=sessionStorage.getItem("userLocationTime");return n&&Date.now()-Number(n)<36e5?t:null}catch{return null}},pv=e=>{try{sessionStorage.setItem("userLocation",JSON.stringify(e)),sessionStorage.setItem("userLocationTime",Date.now().toString())}catch(t){console.warn("Failed to cache location:",t)}},EA=async()=>{try{const e=hq();if(e)return e;try{const t=await fq();return pv(t),t}catch(t){console.warn("IP-based location failed:",t)}try{const t=await CA(),n=await jA(t.coords.latitude,t.coords.longitude);return pv(n),n}catch(t){console.warn("Browser geolocation failed:",t)}return bi.default}catch(e){return console.error("Location detection failed completely:",e),bi.default}},pq=async()=>{try{const e=await CA(),t=await jA(e.coords.latitude,e.coords.longitude);return pv(t),t}catch(e){throw console.error("Precise location detection failed:",e),e}},NA=m.createContext({cityName:"your city",setCityName:()=>{},isLoading:!0,requestPreciseLocation:async()=>{}}),TA=()=>m.useContext(NA),mq=({children:e})=>{const[t,n]=m.useState("your city"),[r,s]=m.useState(!0);m.useEffect(()=>{(async()=>{try{s(!0);const a=await EA();n(a.city)}catch(a){console.error("Error fetching location:",a),J.error("Could not detect your location")}finally{s(!1)}})()},[]);const i=async()=>{try{s(!0);const o=await pq();n(o.city),J.success("Location updated successfully")}catch(o){console.error("Error getting precise location:",o),J.error("Could not get precise location")}finally{s(!1)}};return l.jsx(NA.Provider,{value:{cityName:t,setCityName:n,isLoading:r,requestPreciseLocation:i},children:e})},gq=({currentUseCase:e,useCases:t})=>{const n=Kt(),{cityName:r}=TA(),s=()=>{n("/new-plan")};return l.jsxs(de.div,{initial:{opacity:0,y:20}
628,animate:{opacity:1,y:0},className:"flex flex-col items-center text-center space-y-8 max-w-4xl mx-auto",children:[l.jsxs(de.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.2},className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-[#ea384c]/10 text-[#ea384c] text-sm",children:[l.jsx(Pr,{className:"w-4 h-4"}),l.jsx("span",{className:"font-medium",children:"Plan in 60 seconds ✨"})]}),l.jsx("div",{className:"space-y-4",children:l.jsxs("h1",{className:"text-4xl sm:text-7xl lg:text-8xl font-bold leading-tight",children:[l.jsx("span",{children:"Plan your"}),l.jsx("br",{}),l.jsx(yt,{mode:"wait",children:l.jsx(de.span,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.5},className:"bg-clip-text text-transparent bg-gradient-to-r from-[#ea384c] to-[#ea384c]/80 animate-text-gradient inline-block min-h-[1.2em]",children:t[e]},e)}),l.jsx("br",{}),l.jsxs("span",{children:["in ",r]})]})}),l.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Not just AI suggestions - get complete, shareable plans with real venues, live availability, and group coordination."}),l.jsx("div",{className:"flex flex-wrap gap-4 justify-center items-center mt-8",children:l.jsxs(Fe,{onClick:s,size:"lg",className:"bg-[#ea384c] hover:bg-[#ea384c]/90 transition-all duration-300 text-lg px-8 h-14 shadow-lg hover:shadow-xl group",children:["Start Planning",l.jsx(fN,{className:"ml-2 w-5 h-5 group-hover:translate-x-1 transition-transform"})]})}),l.jsx(de.p,{initial:{opacity:0}
628,animate:{opacity:1},transition:{delay:.8},className:"text-sm text-muted-foreground pt-4",children:"No signup required to start planning 🌟"})]})},yq=({sender:e,type:t})=>{const n=r=>({Alice:"/lovable-uploads/6456d738-4a73-4f5f-8b08-1daf5149fbb9.png",Bob:"/lovable-uploads/2c01e03e-9553-4265-bfce-e37c1ebd4d21.png",Charlie:"/lovable-uploads/c65f4e5e-7897-49c2-ad85-7434a94bf5ee.png",David:"/lovable-uploads/0e313dd4-2aa0-49c3-8b36-623baefc7497.png",Eva:"/lovable-uploads/a8cedd50-3aab-456e-9987-96d0124da2ae.png",Alex:"/lovable-uploads/1784494e-04f8-43cd-8320-957de930fc5a.png",Sam:"/lovable-uploads/96a44778-004b-442b-b7cf-476fac45d89b.png"})[r]||"/lovable-uploads/1fbf87e9-ceb0-46f3-977f-44b478de8d7e.png";return l.jsxs(ml,{className:"h-8 w-8 ring-2 ring-primary/20",children:[t==="bot"?l.jsx(_o,{src:"/lovable-uploads/97453f95-fe01-43b0-b88d-ef2c2b70a86f.png",alt:"EZY Bot",className:"object-cover"}):l.jsx(_o,{src:n(e),alt:`${e}'s avatar`,className:"object-cover"}),l.jsx(gl,{children:l.jsx(Wh,{className:"h-4 w-4"})})]})},vq=({sender:e,message:t,time:n,type:r})=>l.jsxs(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:`flex items-start gap-3 ${r==="received"?"flex-row-reverse":"flex-row"}`,children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx(yq,{sender:e,type:r})}),l.jsxs("div",{className:`max-w-[80%] ${r==="bot"?"bg-gradient-to-r from-[#D946EF] to-[#0EA5E9] text-white":r==="received"?"bg-[#D946EF]/90 text-white":"bg-[#0EA5E9]/90 text-white"} rounded-[1.5rem] px-4 py-3 shadow-lg backdrop-blur-sm border border-white/10`,children:[l.jsx("p",{className:"text-xs font-semibold mb-1 text-white/90",children:e}),l.jsx("p",{className:"text-base leading-relaxed",children:t}),l.jsx("p",{className:"text-xs text-right mt-1 text-white/70",children:n})]})]}),xq=({currentTyper:e})=>l.jsxs(de.div,{initial:{opacity:0}
628,animate:{opacity:1},exit:{opacity:0},className:"flex items-center space-x-2 text-sm text-[#D946EF] p-2",children:[l.jsxs("span",{children:[e," is typing"]}),l.jsxs("div",{className:"flex space-x-1",children:[l.jsx(de.div,{animate:{scale:[1,1.2,1],opacity:[.4,1,.4]},transition:{duration:1,repeat:1/0},className:"w-2 h-2 bg-[#D946EF] rounded-full"}),l.jsx(de.div,{animate:{scale:[1,1.2,1],opacity:[.4,1,.4]},transition:{duration:1,repeat:1/0,delay:.2},className:"w-2 h-2 bg-[#D946EF] rounded-full"}),l.jsx(de.div,{animate:{scale:[1,1.2,1],opacity:[.4,1,.4]},transition:{duration:1,repeat:1/0,delay:.4},className:"w-2 h-2 bg-[#D946EF] rounded-full"})]})]});function wq(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Z0="Switch",[bq,wie]=Bs(Z0),[Sq,kq]=bq(Z0),PA=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=m.useState(null),g=vt(t,x=>p(x)),v=m.useRef(!1),b=h?d||!!h.closest("form"):!0,[y=!1,w]=Ro({prop:s,defaultProp:i,onChange:u});return l.jsxs(Sq,{scope:n,checked:y,disabled:a,children:[l.jsx(Je.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":MA(y),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:g,onClick:Ae(e.onClick,x=>{w(S=>!S),b&&(v.current=x.isPropagationStopped(),v.current||x.stopPropagation())})}),b&&l.jsx(_q,{control:h,bubbles:!v.current,name:r,value:c,checked:y,required:o,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});PA.displayName=Z0;var AA="SwitchThumb",RA=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=kq(AA,n);return l.jsx(Je.span,{"data-state":MA(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});RA.displayName=AA;var _q=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,i=m.useRef(null),o=wq(n),a=VP(t);return m.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&f){const h=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(h)}},[o,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function MA(e){return e?"checked":"unchecked"}var IA=PA,Cq=RA;const Iu=m.forwardRef(({className:e,...t},n)=>l.jsx(IA,{className:ae("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:l.jsx(Cq,{className:ae("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Iu.displayName=IA.displayName;var jq="Label",OA=m.forwardRef((e,t)=>l.jsx(Je.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));OA.displayName=jq;var DA=OA;const Eq=ku("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),tn=m.forwardRef(({className:e,...t},n)=>l.jsx(DA,{ref:n,className:ae(Eq(),e),...t}));tn.displayName=DA.displayName;const Nq=({messages:e,currentMessageIndex:t,isTyping:n,typingUser:r,ezyMode:s,setEzyMode:i})=>{const o=m.useRef(null),a=()=>{if(o.current){const c=o.current.scrollHeight,u=o.current.clientHeight,d=c-u;o.current.scrollTo({top:d+100,behavior:"smooth"})}};return m.useEffect(()=>{a()},[t,n]),l.jsxs("div",{className:"space-y-4 backdrop-blur-sm",children:[l.jsxs("div",{className:"flex items-center justify-end space-x-2 mb-4",children:[l.jsxs(tn,{htmlFor:"ezy-mode",className:s?"text-[#D946EF]":"text-muted-foreground",children:["EZY Mode ",s?"ON":"OFF"]}),l.jsx(Iu,{id:"ezy-mode",checked:s,onCheckedChange:i,className:"data-[state=checked]:bg-[#D946EF]"})]}),l.jsx("div",{ref:o,className:"space-y-4 max-h-[600px] overflow-y-auto pr-4 scroll-smooth pb-4 -mx-2",children:l.jsxs(yt,{mode:"sync",children:[e.slice(0,t+1).map((c,u)=>l.jsx(vq,{...c},u)),n&&l.jsx(xq,{currentTyper:r})]})})]})},Kk=(e,t)=>{const[n,r,s,i,o]=e.names,a=[{sender:n,message:`Hey everyone! Let's plan a night out this Frid
628ay in ${e.city}! What should we do? 🎉`,time:"6:30 PM",type:"sent"},{sender:r,message:"I'm down! What kind of vibe are we going for?",time:"6:32 PM",type:"received"},{sender:s,message:"Maybe start with dinner? I know a few good spots!",time:"6:33 PM",type:"received"},{sender:i,message:`How about ${e.venues.japanese}? Their food is amazing!`,time:"6:35 PM",type:"received"},{sender:o,message:"What time works for everyone? And what about after dinner?",time:"6:36 PM",type:"received"},{sender:r,message:"We could do drinks after? There's that new rooftop bar...",time:"6:38 PM",type:"received"},{sender:n,message:"This is getting complicated... when should we meet?",time:"6:40 PM",type:"sent"},{sender:s,message:`Or we could try ${e.venues.mediterranean}? More casual maybe?`,time:"6:41 PM",type:"received"},{sender:i,message:"What about parking though? Downtown is always a mess on Fridays",time:"6:42 PM",type:"received"},{sender:o,message:"Maybe we should just do something simple...",time:"6:43 PM",type:"received"}],c=[{sender:n,message:`Hey EZY! Can you help plan a fun night out in ${e.city}
628 this Friday? Looking for dinner and drinks! 🎉`,time:"6:30 PM",type:"sent"},{sender:"EZY Bot",message:`Of course! I'd love to help plan your Friday night in ${e.city}! What time would you like to start, and what kind of vibe are you going for? 🌟`,time:"6:31 PM",type:"bot"},{sender:n,message:"Let's start at 7 PM! Looking for good food and maybe some cool bars after. Something fun but not too crazy!",time:"6:32 PM",type:"sent"},{sender:"EZY Bot",message:`Great! I'll create a custom plan for your night out. Here's what I suggest:
629
630🍽️ 7:00 PM - ${e.venues.japanese}
631- Modern Japanese fusion
632- Known for their creative cocktails
633- Perfect for starting the night
634
635🍸 9:00 PM - ${e.venues.mediterranean} Lounge
636- Trendy Mediterranean tapas
637- Great wine selection
638- Relaxed atmosphere
639
640Want me to generate this plan with more details? I can include photos, reviews, and descriptions for each spot! 🎯`,time:"6:33 PM",type:"bot"},{sender:n,message:"Yes, please! That sounds perfect!",time:"6:34 PM",type:"sent"},{sender:"EZY Bot",message:"Great! I'm generating your detailed itinerary now. You'll be able to see photos, reviews, and all the important details for each venue! 🎨",time:"6:35 PM",type:"bot"}];return t?c:a},nn=m.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ae("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));nn.displayName="Card";const mv=m.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ae("flex flex-col space-y-1.5 p-6",e),...t}));mv.displayName="CardHeader";const gv=m.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:ae("text-2xl font-semibold leading-none tracking-tight",e),...t}));gv.displayName="CardTitle";const yv=m.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));yv.displayName="CardDescription";const rc=m.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ae("p-6 pt-0",e),...t}));rc.displayName="CardContent";const Tq=m.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ae("flex items-center p-6 pt-0",e),...t}));Tq.displayName="CardFooter";const Td=({time:e,title:t,description:n,icon:r,isLast:s=!1})=>l.jsxs("div",{className:"relative flex gap-2 sm:gap-4 pb-6 sm:pb-8",children:[!s&&l.jsx("div",{className:"absolute left-[1.25rem] sm:left-[1.75rem] top-10 h-full w-[2px] bg-gradient-to-b from-primary via-primary/50 to-transparent"}),l.jsxs("div",{className:"relative min-w-[2.5rem] sm:min-w-[3.5rem]",children:[l.jsx("div",{className:"flex h-10 w-10 sm:h-14 sm:w-14 items-center justify-center rounded-xl sm:rounded-2xl bg-primary/10 backdrop-blur-xl border border-primary/20 shadow-lg shadow-primary/10",children:l.jsx(r,{className:"h-4 w-4 sm:h-6 sm:w-6 text-primary"})}),l.jsx("span",{className:"absolute -left-8 sm:-left-16 top-3 sm:top-4 text-xs sm:text-sm font-medium text-muted-foreground",children:e})]}),l.jsx("div",{className:"flex-1",children:l.jsxs(de.div,{whileHover:{scale:1.01},className:"glass-card rounded-lg sm:rounded-xl p-3 sm:p-4 hover:bg-primary/5 transition-all duration-300 border border-primary/10",children:[l.jsx("h4",{className:"text-sm sm:text-base font-semibold text-foreground mb-1 sm:mb-2",children:t}),n&&l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:n}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:[l.jsxs(de.button,{whileHover:{scale:1.05},className:"flex items-center gap-1 rounded-lg px-2 py-1 sm:px-3 sm:py-1.5 bg-primary/10 hover:bg-primary/20 transition-colors text-primary text-xs",children:[l.jsx(xo,{className:"h-3 w-3"}),l.jsx("span",{children:"Save"})]}),l.jsxs(de.button,{whileHover:{scale:1.05},className:"flex items-center gap-1 rounded-lg px-2 py-1 sm:px-3 sm:py-1.5 bg-primary/10 hover:bg-primary/20 transition-colors text-primary text-xs",children:[l.jsx(k4,{className:"h-3 w-3"}),l.jsx("span",{children:"Like"})]})]})]})})]}),LA=()=>l.jsx(de.div,{initial:{opacity:0}
640,animate:{opacity:1},transition:{duration:.5},className:"w-full max-w-2xl mx-auto",children:l.jsxs(nn,{className:"glass-card overflow-hidden",children:[l.jsxs("div",{className:"relative h-32 sm:h-48",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/5 to-destructive/5 animate-gradient-x",children:l.jsx("div",{className:"absolute inset-0 bg-[url('/lovable-uploads/79efdff6-ab60-4051-9cef-94c0b062cbb6.png')] bg-cover bg-center opacity-90 mix-blend-overlay"})}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/80 to-transparent"}),l.jsx("div",{className:"absolute bottom-3 sm:bottom-4 left-3 sm:left-6 right-3 sm:right-6",children:l.jsxs("div",{className:"flex justify-between items-end",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg sm:text-2xl font-bold text-white mb-1",children:"Perfect Day in the City"}),l.jsxs("p",{className:"text-white/80 flex items-center gap-1 text-xs sm:text-sm",children:[l.jsx(by,{className:"h-3 w-3 sm:h-4 sm:w-4"}),"Family Adventure"]})]}),l.jsx(Ux,{className:"h-5 w-5 sm:h-6 sm:w-6 text-primary animate-pulse"})]})})]}),l.jsxs("div",{className:"p-3 sm:p-6 pl-12 sm:pl-20",children:[l.jsx(Td,{time:"10:00 AM",title:"Science Museum Visit",description:"Interactive exhibits and IMAX theater experience",icon:bo}),l.jsx(Td,{time:"12:30 PM",title:"Lunch at Family Bistro",description:"Kid-friendly menu with outdoor playground",icon:er}),l.jsx(Td,{time:"2:30 PM",title:"City Park Adventure",description:"Botanical gardens and paddle boats",icon:by}),l.jsx(Td,{time:"5:00 PM",title:"Sunset Ice Cream Stop",description:"Award-winning local ice cream parlor",icon:Bx,isLast:!0})]}),l.jsxs("div",{className:"px-3 sm:px-6 pb-3 sm:pb-6 space-y-3",children:[l.jsxs(de.button,{whileHover:{scale:1.01},className:"w-full glass-card bg-primary/10 hover:bg-primary/20 text-primary py-2 sm:py-3 rounded-lg sm:rounded-xl transition-all duration-300 font-medium flex items-center justify-center gap-2 text-xs sm:text-sm",children:[l.jsx(So,{className:"h-3 w-3 sm:h-4 sm:w-4"}),"Share with Friends"]}),l.jsxs(de.button,{whileHover:{scale:1.01},className:"w-full glass-card bg-primary/5 hover:bg-primary/10 text-primary/80 py-2 sm:py-3 rounded-lg sm:rounded-xl transition-all duration-300 font-medium flex items-center justify-center gap-2 text-xs sm:text-sm",children:[l.jsx(Gt,{className:"h-3 w-3 sm:h-4 sm:w-4"}),"Plan Together"]})]})]})}),Pq=()=>{const[e,t]=m.useState(-1),[n,r]=m.useState(!1),[s,i]=m.useState(""),[o,a]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(!1);return m.useEffect(()=>{(async()=>{const p=await EA();u(p)})()},[]),m.useEffect(()=>c?((async()=>{const p=Kk(c,o);t(-1),f(!1);for(let g=0;g<p.length;g++){const v=p[g];(o||v.type!=="bot")&&(i(v.sender),r(!0),await new Promise(b=>setTimeout(b,Math.min(1500+v.message.length*25,3e3))),r(!1),t(g),o&&v.sender==="EZY Bot"&&g===p.length-1&&f(!0),await new Promise(b=>setTimeout(b,1e3)))}})(),()=>{t(-1),r(!1),f(!1)}):void 0,[o,c]),c?l.jsxs("div",{className:"space-y-8",children:[l.jsx(Nq,{messages:Kk(c,o),currentMessageIndex:e,isTyping:n,typingUser:s,ezyMode:o,setEzyMode:a}),d&&l.jsx(LA,{})]}):null},Aq=()=>l.jsx("div",{className:"container mx-auto px-4 py-24",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs(de.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"text-center mb-16",children:[l.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Beyond Basic AI Suggestions"}),l.jsx("p",{className:"text-xl text-muted-foreground",children:"See how EZY transforms your ideas into complete, actionable plans"})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[l.jsx(de.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},className:"space-y-8",children:l.jsx("div",{className:"space-y-6",children:[{title:"Smart Venue Selection",description:"Real-time availability, ratings, and curated recommendations based on your preferences"},{title:"Seamless Group Planning",description:"Share plans, collect votes, and coordinate with friends - all in one place"},{title:"Local Expertise",description:"Discover hidden gems and trending spots in your city, updated daily"},{title:"Complete Details",description:"Get travel times, booking links, and insider tips for each venue"}].map((e,t)=>l.jsxs(de.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:t*.1},className:"glass-card p-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:e.title}),l.jsx("p",{className:"text-muted-foreground",children:e.description})]},e.title))})}),l.jsx(de.div,{initial:{opacity:0,x:20},whileInView:{opacity:1,x:0},viewport:{once:!0},className:"lg:pl-8 space-y-8",children:l.jsx("div",{className:"glass-card p-6",children:l.jsx(Pq,{})})})]})]})}),Pd=({children:e,position:t,icon:n=fN})=>l.jsxs(de.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:.2},className:`absolute ${t} flex items-center gap-2 text-sm font-medium text-primary`,children:[l.jsx("span",{className:"p-1 rounded-full bg-primary/10 backdrop-blur-sm",children:l.jsx(n,{className:"h-4 w-4"})}),l.jsx("span",{className:"glass-card px-3 py-1.5 rounded-lg backdrop-blur-sm",children:e})]}),Rq=()=>l.jsx("div",{className:"container mx-auto px-4 py-24 relative",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs(de.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"text-center mb-16",children:[l.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Beautiful Itineraries at Your Fingertips"}),l.jsx("p",{className:"text-xl text-muted-foreground",children:"Turn your ideas into shareable visual experiences with just a few taps"})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center relative",children:[l.jsx(de.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},className:"space-y-8",children:l.jsx("div",{className:"space-y-6",children:[{title:"Visual Timeline",description:"See your entire day laid out in a beautiful, easy-to-follow timeline"},{title:"Instant Sharing",description:"Share your plans with friends instantly via link or text message"},{title:"Group Planning",description:"Invite others to collaborate and vote on venue suggestions"},{title:"Smart Recommendations",description:"EZY suggests optimal times between venues based on travel distance"}].map((e,t)=>l.jsxs(de.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:t*.1},className:"glass-card p-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:e.title}),l.jsx("p",{className:"text-muted-foreground",children:e.description})]},e.title))})}),l.jsx(de.div,{initial:{opacity:0,x:20},whileInView:{opacity:1,x:0},viewport:{once:!0},className:"lg:pl-8 space-y-8 relative",children:l.jsxs("div",{className:"glass-card p-6 relative",children:[l.jsx(LA,{}),l.jsx(Pd,{position:"top-20 -left-40",icon:wo,children:"Interactive Timeline"}),l.jsx(Pd,{position:"top-64 -right-44",children:"Venue Details & Ratings"}),l.jsx(Pd,{position:"bottom-40 -left-36",icon:wo,children:"One-Click Save"}),l.jsx(Pd,{position:"bottom-16 -right-36",children:"Sharing Options"}),l.jsx(de.div,{initial:{opacity:0}
640,whileInView:{opacity:1},viewport:{once:!0},transition:{delay:.5},className:"absolute -top-10 left-1/2 transform -translate-x-1/2",children:l.jsx(u4,{className:"h-8 w-8 text-primary animate-bounce"})})]})})]})]})}),Mq=()=>l.jsx("div",{className:"container mx-auto px-4 py-24 relative",children:l.jsxs("div",{className:"max-w-6xl mx-auto",children:[l.jsxs(de.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"text-center mb-16",children:[l.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Plan Together, Decide Together"}),l.jsx("p",{className:"text-xl text-muted-foreground",children:"Collaborate with friends in real-time to create the perfect outing"})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center",children:[l.jsxs(de.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},className:"relative",children:[l.jsxs("div",{className:"glass-card p-8 rounded-xl bg-background/95 backdrop-blur-xl border border-primary/10 relative z-10 overflow-hidden",children:[l.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-primary/10 to-primary/5 rounded-bl-full"}),l.jsxs("h3",{className:"text-2xl font-bold mb-6 flex items-center gap-3",children:[l.jsx(Gt,{className:"h-6 w-6 text-primary"}),"Collaborative Planning"]}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex gap-4 items-start",children:[l.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:l.jsx(So,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold mb-1",children:"Share & Invite"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Invite friends to join your planning session with a simple link"})]})]}),l.jsxs("div",{className:"flex gap-4 items-start",children:[l.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:l.jsx(B4,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold mb-1",children:"Real-time Editing"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Suggest and modify plans together in real-time"})]})]}),l.jsxs("div",{className:"flex gap-4 items-start",children:[l.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:l.jsx(Yf,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold mb-1",children:"Feedback & Discussion"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Comment on venue suggestions and discuss options"})]})]}),l.jsxs("div",{className:"flex gap-4 items-start",children:[l.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:l.jsx(wi,{className:"h-5 w-5 text-primary"})}),l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold mb-1",children:"Voting System"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Let everyone vote on their favorite venues and activities"})]})]})]})]}),l.jsx("div",{className:"absolute -bottom-8 -left-8 w-40 h-40 bg-gradient-to-tr from-destructive/10 to-transparent rounded-full blur-xl"})]}),l.jsxs(de.div,{initial:{opacity:0,x:20},whileInView:{opacity:1,x:0},viewport:{once:!0},className:"space-y-4",children:[l.jsxs(nn,{className:"p-4 bg-background/60 backdrop-blur-lg border-white/10 relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 to-transparent"}),l.jsxs("div",{className:"relative z-10",children:[l.jsxs("div",{className:"flex justify-between items-center mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"bg-primary/20 h-8 w-8 rounded-full flex items-center justify-center",children:l.jsx(Gt,{className:"h-4 w-4 text-primary"})}),l.jsx("span",{className:"font-medium",children:"Group Planning Session"})]}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"Active"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[l.jsxs("div",{className:"bg-primary/5 rounded-lg p-3 text-center",children:[l.jsx("div",{className:"text-2xl font-bold",children:"3"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"Participants"})]}),l.jsxs("div",{className:"bg-primary/5 rounded-lg p-3 text-center",children:[l.jsx("div",{className:"text-2xl font-bold",children:"6"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"Suggestions"})]})]}),l.jsxs("div",{className:"flex gap-2 mb-3",children:[l.jsx("div",{className:"bg-primary/15 text-primary text-xs py-1 px-2 rounded-full",children:"Night Out"}),l.jsx("div",{className:"bg-primary/15 text-primary text-xs py-1 px-2 rounded-full",children:"Downtown"}),l.jsx("div",{className:"bg-primary/15 text-primary text-xs py-1 px-2 rounded-full",children:"Group"})]}),l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{className:"flex -sp
640ace-x-2",children:[l.jsx("div",{className:"h-8 w-8 rounded-full bg-primary/20 flex items-center justify-center z-30",children:l.jsx("span",{className:"text-xs",children:"J"})}),l.jsx("div",{className:"h-8 w-8 rounded-full bg-purple-500/20 flex items-center justify-center z-20",children:l.jsx("span",{className:"text-xs",children:"S"})}),l.jsx("div",{className:"h-8 w-8 rounded-full bg-green-500/20 flex items-center justify-center z-10",children:l.jsx("span",{className:"text-xs",children:"M"})})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{className:"p-1.5 rounded-md bg-primary/10 hover:bg-primary/20 transition-colors",children:l.jsx(So,{className:"h-4 w-4 text-primary"})}),l.jsx("button",{className:"p-1.5 rounded-md bg-primary/10 hover:bg-primary/20 transition-colors",children:l.jsx(Yf,{className:"h-4 w-4 text-primary"})})]})]})]})]}),l.jsxs(nn,{className:"p-4 bg-background/60 backdrop-blur-lg border-white/10 relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 to-transparent"}),l.jsxs("div",{className:"relative z-10",children:[l.jsx("h4",{className:"font-medium mb-3",children:"Venue Voting"}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"p-3 rounded-lg bg-primary/10",children:[l.jsxs("div",{className:"flex justify-between mb-1",children:[l.jsx("span",{className:"font-medium",children:"Skyline Lounge"}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-xs text-green-500 font-medium",children:"+5"}),l.jsx(wi,{className:"h-3 w-3 text-green-500"}),l.jsx("span",{className:"text-xs text-destructive font-medium ml-1",children:"-1"}),l.jsx(Gc,{className:"h-3 w-3 text-destructive"})]})]}),l.jsx("div",{className:"relative h-2 w-full bg-primary/5 rounded-full overflow-hidden",children:l.jsx("div",{className:"absolute top-0 left-0 h-full bg-primary rounded-full",style:{width:"83%"}})})]}),l.jsxs("div",{className:"p-3 rounded-lg bg-primary/10",children:[l.jsxs("div",{className:"flex justify-between mb-1",children:[l.jsx("span",{className:"font-medium",children:"Urban Bistro"}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-xs text-green-500 font-medium",children:"+3"}),l.jsx(wi,{className:"h-3 w-3 text-green-500"}),l.jsx("span",{className:"text-xs text-destructive font-medium ml-1",children:"-2"}),l.jsx(Gc,{className:"h-3 w-3 text-destructive"})]})]}),l.jsx("div",{className:"relative h-2 w-full bg-primary/5 rounded-full overflow-hidden",children:l.jsx("div",{className:"absolute top-0 left-0 h-full bg-primary rounded-full",style:{width:"60%"}})})]})]})]})]})]})]})]})}),Yk=["Night Out","Date Night","Business Meeting","Family Fun","Tourist Adventure","Group Celebration","Local Experience","Weekend Plans"],Iq=()=>{const[e,t]=$.useState(0);return $.useEffect(()=>{const n=setInterval(()=>{t(r=>(r+1)%Yk.length)},2e3);return()=>clearInterval(n)},[]),l.jsxs(Or,{children:[l.jsxs(hv,{children:[l.jsx("title",{children:"Ask EZY - AI Night Out Planner | Create Your Perfect Evening"}),l.jsx("meta",{name:"description",content:"Transform your nights out with Ask EZY's AI-powered platform. Plan unforgettable evenings in minutes."})]}),l.jsxs("div",{className:"min-h-screen flex flex-col relative",children:[l.jsxs("div",{className:"flex-1 flex items-center relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-background via-background/95 to-background/90"}),l.jsx("div",{className:"container relative mx-auto px-4",children:l.jsx(gq,{currentUseCase:e,useCases:Yk})})]}),l.jsx(Aq,{}),l.jsx(Rq,{}),l.jsx(Mq,{})]})]})};function Oq(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Dq=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lq=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$q={};function Jk(e,t){return($q.jsx?Lq:Dq).test(e)}const Fq=/[ \t\n\f\r]/g;function zq(e){return typeof e=="object"?e.type==="text"?Xk(e.value):!1:Xk(e)}function Xk(e){return e.replace(Fq,"")===""}class Ou{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ou.prototype.normal={};Ou.prototype.property={};Ou.prototype.space=void 0;function $A(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ou(n,r,t)}function vv(e){return e.toLowerCase()}class Fn{constructor(t,n){this.attribute=n,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let Bq=0;const Ue=Oo(),Dt=Oo(),xv=Oo(),fe=Oo(),it=Oo(),Ia=Oo(),Vn=Oo();function Oo(){return 2**++Bq}const wv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Dt,commaOrSpaceSeparated:Vn,commaSeparated:Ia,number:fe,overloadedBoolean:xv,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),Bm=Object.keys(wv);class ew extends Fn{constructor(t,n,r,s){let i=-1;
vendor: 4,263 bytes, line 640
640if(super(t,n),Qk(this,"space",s),typeof r=="number")for(;++i<Bm.length;){const o=Bm[i];Qk(this,Bm[i],(r&wv[o])===wv[o])}}}ew.prototype.defined=!0;function Qk(e,t,n){n&&(e[t]=n)}function yl(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new ew(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[vv(r)]=r,n[vv(i.attribute)]=r}return new Ou(t,n,e.space)}const FA=yl({properties:{ariaActiveDescendant:null,ariaAtomic:Dt,ariaAutoComplete:null,ariaBusy:Dt,ariaChecked:Dt,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:Dt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:Dt,ariaFlowTo:it,ariaGrabbed:Dt,ariaHasPopup:null,ariaHidden:Dt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:fe,ariaLive:null,ariaModal:Dt,ariaMultiLine:Dt,ariaMultiSelectable:Dt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:Dt,ariaReadOnly:Dt,ariaRelevant:null,ariaRequired:Dt,ariaRoleDescription:it,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:Dt,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function zA(e,t){return t in e?e[t]:t}function BA(e,t){return zA(e,t.toLowerCase())}const Vq=yl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ia,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:it,autoFocus:Ue,autoPlay:Ue,blocking:it,capture:null,charSet:null,checked:Ue,cite:null,className:it,cols:fe,colSpan:null,content:null,contentEditable:Dt,controls:Ue,controlsList:it,coords:fe|Ia,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:xv,draggable:Dt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:it,height:fe,hidden:xv,high:fe,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:it,itemRef:it,itemScope:Ue,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ue,optimum:fe,pattern:null,ping:it,placeholder:null,playsInl
640ine:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:it,required:Ue,reversed:Ue,rows:fe,rowSpan:fe,sandbox:it,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:Dt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Dt,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:Dt,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:BA}),Uq=yl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
640-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Vn,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:it,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ia,g2:Ia,glyphName:Ia,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:Vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:fe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 4,581 bytes, lines 640-641
640Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vn,rev:Vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vn,requiredFeatures:Vn,requiredFonts:Vn,requiredFormats:Vn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:Vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vn,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zA}),VA=yl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),UA=yl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:BA}),HA=yl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Hq={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Wq=/[A-Z]/g,Zk=/-[a-z]/g,qq=/^data[-\w.:]+$/i;function Gq(e,t){const n=vv(t);let r=t,s=Fn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&qq.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Zk,Yq);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Zk.test(i)){let o=i.replace(Wq,Kq);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=ew}return new s(r,t)}function Kq(e){return"-"+e.toLowerCase()}function Yq(e){return e.charAt(1).toUpperCase()}const Jq=$A([FA,Vq,VA,UA,HA],"html"),tw=$A([FA,Uq,VA,UA,HA],"svg");function Xq(e){return e.join(" ").trim()}var nw={},e_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Qq=/\n/g,Zq=/^\s*/,eG=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,tG=/^:\s*/,nG=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,rG=/^[;\s]*/,sG=/^\s+|\s+$/g,iG=`
641`,t_="/",n_="*",Zi="",oG="comment",aG="declaration";function lG(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(g){var v=g.match(Qq);v&&(n+=v.length);var b=g.lastIndexOf(iG);r=~b?g.length-b:r+g.length}function i(){var g={line:n,column:r};return function(v){return v.position=new o(g),u(),v}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(g){var v=new Error(t.source+":"+n+":"+r+": "+g);if(v.reason=g,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function c(g){var v=g.exec(e);if(v){var b=v[0];return s(b),e=e.slice(b.length),v}}function u(){c(Zq)}function d(g){var v;
vendor: 4,362 bytes, line 641
641for(g=g||[];v=f();)v!==!1&&g.push(v);return g}function f(){var g=i();if(!(t_!=e.charAt(0)||n_!=e.charAt(1))){for(var v=2;Zi!=e.charAt(v)&&(n_!=e.charAt(v)||t_!=e.charAt(v+1));)++v;if(v+=2,Zi===e.charAt(v-1))return a("End of comment missing");var b=e.slice(2,v-2);return r+=2,s(b),e=e.slice(v),r+=2,g({type:oG,comment:b})}}function h(){var g=i(),v=c(eG);if(v){if(f(),!c(tG))return a("property missing ':'");var b=c(nG),y=g({type:aG,property:r_(v[0].replace(e_,Zi)),value:b?r_(b[0].replace(e_,Zi)):Zi});return c(rG),y}}function p(){var g=[];d(g);for(var v;v=h();)v!==!1&&(g.push(v),d(g));return g}return u(),p()}function r_(e){return e?e.replace(sG,Zi):Zi}var cG=lG,uG=bf&&bf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nw,"__esModule",{value:!0});nw.default=fG;const dG=uG(cG);function fG(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,dG.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:a}=i;s?t(o,a,i):a&&(n=n||{},n[o]=a)}),n}var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.camelCase=void 0;var hG=/^--[a-zA-Z0-9_-]+$/,pG=/-([a-z])/g,mG=/^[^-]+$/,gG=/^-(webkit|moz|ms|o|khtml)-/,yG=/^-(ms)-/,vG=function(e){return!e||mG.test(e)||hG.test(e)},xG=function(e,t){return t.toUpperCase()},s_=function(e,t){return"".concat(t,"-")},wG=function(e,t){return t===void 0&&(t={}),vG(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(yG,s_):e=e.replace(gG,s_),e.replace(pG,xG))};pp.camelCase=wG;var bG=bf&&bf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},SG=bG(nw),kG=pp;function bv(e,t){var n={};return!e||typeof e!="string"||(0,SG.default)(e,function(r,s){r&&s&&(n[(0,kG.camelCase)(r,t)]=s)}),n}bv.default=bv;var _G=bv;const CG=Ai(_G),WA=qA("end"),rw=qA("start");function qA(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function jG(e){const t=rw(e),n=WA(e);if(t&&n)return{start:t,end:n}}function _c(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?i_(e.position):"start"in e||"end"in e?i_(e):"line"in e||"column"in e?Sv(e):""}function Sv(e){return o_(e&&e.line)+":"+o_(e&&e.column)}function i_(e){return Sv(e&&e.start)+"-"+Sv(e&&e.end)}function o_(e){return e&&typeof e=="number"?e:1}class fn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(o=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=_c(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fn.prototype.file="";fn.prototype.name="";fn.prototype.reason="";fn.prototype.message="";fn.prototype.stack="";fn.prototype.column=void 0;fn.prototype.line=void 0;fn.prototype.ancestors=void 0;fn.prototype.cause=void 0;fn.prototype.fatal=void 0;fn.prototype.place=void 0;fn.prototype.ruleId=void 0;fn.prototype.source=void 0;const sw={}.hasOwnProperty,EG=new Map,NG=/[A-Z]/g,TG=new Set(["table","tbody","thead","tfoot","tr"]),PG=new Set(["td","th"]),GA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AG(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=FG(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,302 bytes, line 641
641if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$G(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?tw:Jq,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=KA(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function KA(e,t,n){if(t.type==="element")return RG(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return MG(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return OG(e,t,n);if(t.type==="mdxjsEsm")return IG(e,t);if(t.type==="root")return DG(e,t,n);if(t.type==="text")return LG(e,t)}function RG(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=tw,e.schema=s),e.ancestors.push(t);const i=JA(e,t.tagName,!1),o=zG(e,t);let a=ow(e,t);return TG.has(t.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!zq(c):!0})),YA(e,o,i,t),iw(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function MG(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pu(e,t.position)}function IG(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pu(e,t.position)}function OG(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=tw,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:JA(e,t.name,!0),o=BG(e,t),a=ow(e,t);return YA(e,o,i,t),iw(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function DG(e,t,n){const r={};return iw(r,ow(e,t)),e.create(t,e.Fragment,r,n)}function LG(e,t){return t.value}function YA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function iw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $G(e,t,n){return r;function r(s,i,o,a){const u=Array.isArray(o.children)?n:t;return a?u(i,o,a):u(i,o)}}function FG(e,t){return n;function n(r,s,i,o){const a=Array.isArray(i.children),c=rw(r);return t(s,i,o,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function zG(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&sw.call(t.properties,s)){const i=VG(e,s,t.properties[s]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&PG.has(t.tagName)?r=a:n[o]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function BG(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else pu(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else pu(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function ow(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:EG;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const u=s.get(c)||0;o=c+"-"+u,s.set(c,u+1)}}const a=KA(e,i,o);a!==void 0&&n.push(a)}return n}function VG(e,t,n){const r=Gq(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Oq(n):Xq(n)),r.property==="style"){let s=typeof n=="object"?n:UG(e,String(n));return e.stylePropertyNameCase==="css"&&(s=HG(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?Hq[r.property]||r.property:r.attribute,n]}}function UG(e,t){try{return CG(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=GA+"#cannot-parse-style-attribute",s}}function JA(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,o;for(;++i<s.length;){const a=Jk(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=o}else r=Jk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return sw.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);pu(e)}function pu(e,t){const n=new fn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=GA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function HG(e){const t={};let n;for(n in e)sw.call(e,n)&&(t[WG(n)]=e[n]);return t}function WG(e){let t=e.replace(NG,qG);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qG(e){return"-"+e.toLowerCase()}const Vm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},GG={};function KG(e,t){const n=GG,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return XA(e,r,s)}function XA(e,t,n){if(YG(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return a_(e.children,t,n)}return Array.isArray(e)?a_(e,t,n):""}function a_(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=XA(e[s],t,n);return r.join("")}function YG(e){return!!(e&&typeof e=="object")}const l_=document.createElement("i");function aw(e){const t="&"+e+";";l_.innerHTML=t;const n=l_.textContent;
vendor: 11,998 bytes, line 641
641return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ns(e,t,n,r){const s=e.length;let i=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function fr(e,t){return e.length>0?(ns(e,e.length,0,t),e):t}const c_={}.hasOwnProperty;function JG(e){const t={};let n=-1;for(;++n<e.length;)XG(t,e[n]);return t}function XG(e,t){let n;for(n in t){const s=(c_.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){c_.call(s,o)||(s[o]=[]);const a=i[o];QG(s[o],Array.isArray(a)?a:a?[a]:[])}}}function QG(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ns(e,0,0,r)}function QA(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Oa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Kr=$i(/[A-Za-z]/),Yn=$i(/[\dA-Za-z]/),ZG=$i(/[#-'*+\--9=?A-Z^-~]/);function kv(e){return e!==null&&(e<32||e===127)}const _v=$i(/\d/),eK=$i(/[\dA-Fa-f]/),tK=$i(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function In(e){return e!==null&&(e<0||e===32)}function Ze(e){return e===-2||e===-1||e===32}const nK=$i(new RegExp("\\p{P}|\\p{S}","u")),rK=$i(/\s/);function $i(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function vl(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&Yn(e.charCodeAt(n+1))&&Yn(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(o=String.fromCharCode(i,a),s=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function at(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(c){return Ze(c)?(e.enter(n),a(c)):t(c)}function a(c){return Ze(c)&&i++<s?(e.consume(c),a):(e.exit(n),t(c))}}const sK={tokenize:iK};function iK(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),at(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),i(a)}function i(a){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return $e(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),o)}}const oK={tokenize:aK},u_={tokenize:lK};function aK(e){const t=this,n=[];let r=0,s,i,o;return a;function a(x){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(x)}return u(x)}function c(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&w();const S=t.events.length;let C=S,k;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){k=t.events[C][1].end;break}y(r);let _=S;for(;_<t.events.length;)t.events[_][1].end={...k},_++;return ns(t.events,C+1,0,t.events.slice(S)),t.events.length=_,u(x)}return a(x)}function u(x){if(r===n.length){if(!s)return h(x);if(s.currentConstruct&&s.currentConstruct.concrete)return g(x);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(u_,d,f)(x)}function d(x){return s&&w(),y(r),h(x)}function f(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(x)}function h(x){return t.containerState={},e.attempt(u_,p,g)(x)}function p(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function g(x){if(x===null){s&&w(),y(0),e.consume(x);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),v(x)}function v(x){if(x===null){b(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return $e(x)?(e.consume(x),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(x),v)}function b(x,S){const C=t.sliceStream(x);if(S&&C.push(null),x.previous=i,i&&(i.next=x),i=x,s.defineSkip(x.start),s.write(C),t.parser.lazy[x.start.line]){let k=s.events.length;for(;k--;)if(s.events[k][1].start.offset<o&&(!s.events[k][1].end||s.events[k][1].end.offset>o))return;const _=t.events.length;let j=_,R,P;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(R){P=t.events[j][1].end;break}R=!0}for(y(r),k=_;k<t.events.length;)t.events[k][1].end={...P},k++;ns(t.events,j+1,0,t.events.slice(_)),t.events.length=k}}function y(x){let S=n.length;for(;S-- >x;){const C=n[S];t.containerState=C[1],C[0].exit.call(t,e)}n.length=x}function w(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function lK(e,t,n){return at(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function d_(e){if(e===null||In(e)||rK(e))return 1;if(nK(e))return 2}function lw(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Cv={name:"attention",resolveAll:cK,tokenize:uK};function cK(e,t){let n=-1,r,s,i,o,a,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};f_(f,-c),f_(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=fr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=fr(u,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),u=fr(u,lw(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=fr(u,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=fr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ns(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uK(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=d_(r);let i;return o;function o(c){return i=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===i)return e.consume(c),a;const u=e.exit("attentionSequence"),d=d_(c),f=!d||d===2&&s||n.includes(c),h=!s||s===2&&d||n.includes(r);return u._open=!!(i===42?f:f&&(s||!h)),u._close=!!(i===42?h:h&&(d||!f)),t(c)}}function f_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const dK={name:"autolink",tokenize:fK};function fK(e,t,n){let r=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return Kr(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||Yn(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||Yn(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||kv(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):ZG(p)?(e.consume(p),u):n(p)}function d(p){return Yn(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Yn(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const mp={partial:!0,tokenize:hK};function hK(e,t,n){return r;function r(i){return Ze(i)?at(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||$e(i)?t(i):n(i)}}const ZA={continuation:{tokenize:mK},exit:gK,name:"blockQuote",tokenize:pK};function pK(e,t,n){const r=this;return s;function s(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return Ze(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function mK(e,t,n){const r=this;return s;function s(o){return Ze(o)?at(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(ZA,t,n)(o)}}function gK(e){e.exit("blockQuote")}const eR={name:"characterEscape",tokenize:yK};function yK(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return tK(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const tR={name:"characterReference",tokenize:vK};function vK(e,t,n){const r=this;let s=0,i,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,o=Yn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=eK,d):(e.enter("characterReferenceValue"),i=7,o=_v,d(f))}function d(f){if(f===59&&s){const h=e.exit("characterReferenceValue");return o===Yn&&!aw(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(f)&&s++<i?(e.consume(f),d):n(f)}}const h_={partial:!0,tokenize:wK},p_={concrete:!0,name:"codeFenced",tokenize:xK};function xK(e,t,n){const r=this,s={partial:!0,tokenize:C};let i=0,o=0,a;return c;function c(k){return u(k)}function u(k){const _=r.events[r.events.length-1];return i=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(o++,e.consume(k),d):o<3?n(k):(e.exit("codeFencedFenceSequence"),Ze(k)?at(e,f,"whitespace")(k):f(k))}function f(k){return k===null||$e(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(h_,v,S)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||$e(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):Ze(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),h)}function p(k){return k===null||$e(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||$e(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),g)}function v(k){return e.attempt(s,S,b)(k)}function b(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return i>0&&Ze(k)?at(e,w,"linePrefix",i+1)(k):w(k)}function w(k){return k===null||$e(k)?e.check(h_,v,S)(k):(e.enter("co
641deFlowValue"),x(k))}function x(k){return k===null||$e(k)?(e.exit("codeFlowValue"),w(k)):(e.consume(k),x)}function S(k){return e.exit("codeFenced"),t(k)}function C(k,_,j){let R=0;return P;function P(z){return k.enter("lineEnding"),k.consume(z),k.exit("lineEnding"),M}function M(z){return k.enter("codeFencedFence"),Ze(z)?at(k,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):T(z)}function T(z){return z===a?(k.enter("codeFencedFenceSequence"),L(z)):j(z)}function L(z){return z===a?(R++,k.consume(z),L):R>=o?(k.exit("codeFencedFenceSequence"),Ze(z)?at(k,F,"whitespace")(z):F(z)):j(z)}function F(z){return z===null||$e(z)?(k.exit("codeFencedFence"),_(z)):j(z)}}}function wK(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Um={name:"codeIndented",tokenize:SK},bK={partial:!0,tokenize:kK};function SK(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),at(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):$e(u)?e.attempt(bK,o,c)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||$e(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function c(u){return e.exit("codeIndented"),t(u)}}function kK(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):$e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):at(e,i,"linePrefix",5)(o)}function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):$e(o)?s(o):n(o)}}const _K={name:"codeText",previous:jK,resolve:CK,tokenize:EK};function CK(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function jK(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function EK(e,t,n){let r=0,s,i;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(i=e.enter("codeTextSequence"),s=0,d(f)):$e(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||$e(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),s++,d):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",u(f))}}class NK{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Ol(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ol(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ol(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ol(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ol(this.left,n.reverse())}}}function Ol(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function nR(e){const t={};let n=-1,r,s,i,o,a,c,u;const d=new NK(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,TK(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(o=d.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...d.get(s)[1].start},a=d.slice(s,n),a.unshift(r),d.splice(s,n-s+1,a))}}return ns(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function TK(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,c=[],u={};let d,f,h=-1,p=n,g=0,v=0;const b=[v];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&o.defineSki
vendor: 18,564 bytes, line 641
641p(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(v=h+1,b.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),h=b.length;h--;){const y=a.slice(b[h],b[h+1]),w=i.pop();c.push([w,w+y.length-1]),e.splice(w,2,y)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const PK={resolve:RK,tokenize:MK},AK={partial:!0,tokenize:IK};function RK(e){return nR(e),e}function MK(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?i(a):$e(a)?e.check(AK,o,i)(a):(e.consume(a),s)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function IK(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),at(e,i,"linePrefix")}function i(o){if(o===null||$e(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function rR(e,t,n,r,s,i,o,a,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||kv(y)?n(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||$e(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function v(y){return!d&&(y===null||y===41||In(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(y)):d<u&&y===40?(e.consume(y),d++,v):y===41?(e.consume(y),d--,v):y===null||y===32||y===40||kv(y)?n(y):(e.consume(y),y===92?b:v)}function b(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}function sR(e,t,n,r,s,i){const o=this;let a=0,c;return u;function u(p){return e.enter(r),e.enter(s),e.consume(p),e.exit(s),e.enter(i),d}function d(p){return a>999||p===null||p===91||p===93&&!c||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(r),t):$e(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||$e(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Ze(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function iR(e,t,n,r,s,i){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,c):n(h)}function c(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===o?(e.exit(i),c(o)):h===null?n(h):$e(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),at(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||$e(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===o||h===92?(e.consume(h),d):d(h)}}function Cc(e,t){let n;return r;function r(s){return $e(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Ze(s)?at(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const OK={name:"definition",tokenize:LK},DK={partial:!0,tokenize:$K};function LK(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return sR.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return s=Oa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return In(p)?Cc(e,u)(p):u(p)}function u(p){return rR(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(DK,f,f)(p)}function f(p){return Ze(p)?at(e,h,"whitespace")(p):h(p)}function h(p){return p===null||$e(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function $K(e,t,n){return r;function r(a){return In(a)?Cc(e,s)(a):n(a)}function s(a){return iR(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Ze(a)?at(e,o,"whitespace")(a):o(a)}function o(a){return a===null||$e(a)?t(a):n(a)}}const FK={name:"hardBreakEscape",tokenize:zK};function zK(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return $e(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const BK={name:"headingAtx",resolve:VK,tokenize:UK};function VK(e,t){let n=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ns(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function UK(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||In(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||$e(d)?(e.exit("atxHeading"),t(d)):Ze(d)?at(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||In(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const HK=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],m_=["pre","script","style","textarea"],WK={concrete:!0,name:"htmlFlow",resolveTo:KK,tokenize:YK},qK={partial:!0,tokenize:XK},GK={partial:!0,tokenize:JK};function KK(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function YK(e,t,n){const r=this;let s,i,o,a,c;return u;function u(N){return d(N)}function d(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),i=!0,v):N===63?(e.consume(N),s=3,r.interrupt?t:E):Kr(N)?(e.consume(N),o=String.fromCharCode(N),b):n(N)}function h(N){return N===45?(e.consume(N),s=2,p):N===91?(e.consume(N),s=5,a=0,g):Kr(N)?(e.consume(N),s=4,r.interrupt?t:E):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:E):n(N)}function g(N){const ee="CDATA[";return N===ee.charCodeAt(a++)?(e.consume(N),a===ee.length?r.interrupt?t:T:g):n(N)}function v(N){return Kr(N)?(e.consume(N),o=String.fromCharCode(N),b):n(N)}function b(N){if(N===null||N===47||N===62||In(N)){const ee=N===47,ie=o.toLowerCase();return!ee&&!i&&m_.includes(ie)?(s=1,r.interrupt?t(N):T(N)):HK.includes(o.toLowerCase())?(s=6,ee?(e.consume(N),y):r.interrupt?t(N):T(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?w(N):x(N))}return N===45||Yn(N)?(e.consume(N),o+=String.fromCharCode(N),b):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:T):n(N)}function w(N){return Ze(N)?(e.consume(N),w):P(N)}function x(N){return N===47?(e.consume(N),P):N===58||N===95||Kr(N)?(e.consume(N),S):Ze(N)?(e.consume(N),x):P(N)}function S(N){return N===45||N===46||N===58||N===95||Yn(N)?(e.consume(N),S):C(N)}function C(N){return N===61?(e.consume(N),k):Ze(N)?(e.consume(N),C):x(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),c=N,_):Ze(N)?(e.consume(N),k):j(N)}function _(N){return N===c?(e.consume(N),c=null,R):N===null||$e(N)?n(N):(e.consume(N),_)}function j(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||In(N)?C(N):(e.consume(N),j)}function R(N){return N===47||N===62||Ze(N)?x(N):n(N)}function P(N){return N===62?(e.consume(N),M):n(N)}function M(N){return N===null||$e(N)?T(N):Ze(N)?(e.consume(N),M):n(N)}function T(N){return N===45&&s===2?(e.consume(N),V):N===60&&s===1?(e.consume(N),I):N===62&&s===4?(e.consume(N),K):N===63&&s===3?(e.consume(N),E):N===93&&s===5?(e.consume(N),D):$e(N)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(qK,te,L)(N)):N===null||$e(N)?(e.exit("htmlFlowData"),L(N)):(e.consume(N),T)}function L(N){return e.check(GK,F,te)(N)}function F(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),z}function z(N){return N===null||$e(N)?L(N):(e.enter("htmlFlowData"),T(N))}function V(N){return N===45?(e.consume(N),E):T(N)}function I(N){return N===47?(e.consume(N),o="",A):T(N)}function A(N){if(N===62){const ee=o.toLowerCase();return m_.includes(ee)?(e.consume(N),K):T(N)}return Kr(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),A):T(N)}function D(N){return N===93?(e.consume(N),E):T(N)}function E(N){return N===62?(e.consume(N),K):N===45&&s===2?(e.consume(N),E):T(N)}function K(N){return N===null||$e(N)?(e.exit("htmlFlowData"),te(N)):(e.consume(N),K)}function te(N){return e.exit("htmlFlow"),t(N)}}function JK(e,t,n){const r=this;return s;function s(o){return $e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function XK(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(mp,t,n)}}const QK={name:"htmlText",tokenize:ZK};function ZK(e,t,n){const r=this;let s,i,o;return a;function a(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),c}function c(E){return E===33?(e.consume(E),u):E===47?(e.consume(E),C):E===63?(e.consume(E),x):Kr(E)?(e.consume(E),j):n(E)}function u(E){return E===45?(e.consume(E),d):E===91?(e.consume(E),i=0,g):Kr(E)?(e.consume(E),w):n(E)}function d(E){return E===45?(e.consume(E),p):n(E)}function f(E){return E===null?n(E):E===45?(e.consume(E),h):$e(E)?(o=f,I(E)):(e.consume(E),f)}function h(E){return E===45?(e.consume(E),p):f(E)}function p(E){return E===62?V(E):E===45?h(E):f(E)}function g(E){const K="CDATA[";return E===K.charCodeAt(i++)?(e.consume(E),i===K.length?v:g):n(E)}function v(E){return E===null?n(E):E===93?(e.consume(E),b):$e(E)?(o=v,I(E)):(e.consume(E),v)}function b(E){return E===93?(e.consume(E),y):v(E)}function y(E){return E===62?V(E):E===93?(e.consume(E),y):v(E)}function w(E){return E===null||E===62?V(E):$e(E)?(o=w,I(E)):(e.consume(E),w)}function x(E){return E===null?n(E):E===63?(e.consume(E),S):$e(E)?(o=x,I(E)):(e.consume(E),x)}function S(E){return E===62?V(E):x(E)}function C(E){return Kr(E)?(e.consume(E),k):n(E)}function k(E){return E===45||Yn(E)?(e.consume(E),k):_(E)}function _(E){return $e(E)?(o=_,I(E)):Ze(E)?(e.consume(E),_):V(E)}function j(E){return E===45||Yn(E)?(e.consume(E),j):E===47||E===62||In(E)?R(E):n(E)}function R(E){return E===47?(e.consume(E),V):E===58||E===95||Kr(E)?(e.consume(E),P):$e(E)?(o=R,I(E)):Ze(E)?(e.consume(E),R):V(E)}function P(E){return E===45||E===46||E===58||E===95||Yn(E)?(e.consume(E),P):M(E)}function M(E){return E===61?(e.consume(E),T):$e(E)?(o=M,I(E)):Ze(E)?(e.consume(E),M):R(E)}function T(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),s=E,L):$e(E)?(o=T,I(E)):Ze(E)?(e.consume(E),T):(e.consume(E),F)}function L(E){return E===s?(e.consume(E),s=void 0,z):E===null?n(E):$e(E)?(o=L,I(E)):(e.consume(E),L)}function F(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||In(E)?R(E):(e.consume(E),F)}function z(E){return E===47||E===62||In(E)?R(E):n(E)}function V(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function I(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),A}function A(E){return Ze(E)?at(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):D(E)}function D(E){return e.enter("htmlTextData"),o(E)}}const cw={name:"labelEnd",resolveAll:rY,resolveTo:sY,tokenize:iY},eY={tokenize:oY},tY={tokenize:aY},nY={tokenize:lY};function rY(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&ns(e,0,e.length,n),e}function sY(e,t){let n=e.length,r=0,s,i,o,a;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const c={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",c,t],["enter",u,t]],a=fr(a,e.slice(i+1,i+r+3)),a=fr(a,[["enter",d,t]]),a=fr(a,lw(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),a=fr(a,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),a=fr(a,e.slice(o+1)),a=fr(a,[["exit",c,t]]),ns(e,i,e.length,a),e}function iY(e,t,n){const r=this;let s=r.events.length,i,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return a;function a(h){return i?i._inactive?f(h):(o=r.parser.defined.includes(Oa(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(eY,d,o?d:f)(h):h===91?e.attempt(tY,d,o?u:f)(h):o?d(h):f(h)}function u(h){return e.attempt(nY,d,f)(h)}function d(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function oY(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),s}function s(f){return In(f)?Cc(e,i)(f):i(f)}function i(f){return f===41?d(f):rR(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return In(f)?Cc(e,c)(f):d(f)}function a(f){return n(f)}function c(f){return f===34||f===39||f===40?iR(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return In(f)?Cc(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function aY(e,t,n){const r=this;return s;function s(a){return sR.call(r,e,i,o,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Oa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function lY(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const cY={name:"labelStartImage",resolveAll:cw.resolveAll,tokenize:uY};function uY(e,t,n){const r=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const dY={name:"labelStartLink",resolveAll:cw.resolveAll,tokenize:fY};function fY(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Hm={name:"lineEnding",tokenize:hY};function hY(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),at(e,t,"linePrefix")}}const cf={name:"thematicBreak",tokenize:pY};function pY(e,t,n){let r=0,s;return i;function i(u){return e.enter("thematicBreak"),o(u)}function o(u){return s=u,a(u)}function a(u){return u===s?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||$e(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Ze(u)?at(e,a,"whitespace")(u):a(u))}}const _n={continuation:{tokenize:vY},exit:wY,name:"list",tokenize:yY},mY={partial:!0,tokenize:bY},gY={partial:!0,tokenize:xY};function yY(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:_v(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(cf,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return _v(p)&&++o<10?(e.consume(p),c):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(mp,r.interrupt?n:d,e.attempt(mY,h,f))}
vendor: 5,359 bytes, line 641
641function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return Ze(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function vY(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(mp,s,i);function s(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,at(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Ze(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(gY,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,at(e,e.attempt(_n,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function xY(e,t,n){const r=this;return at(e,s,"listItemIndent",r.containerState.size+1);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(i):n(i)}}function wY(e){e.exit(this.containerState.type)}function bY(e,t,n){const r=this;return at(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const o=r.events[r.events.length-1];return!Ze(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const g_={name:"setextUnderline",resolveTo:SY,tokenize:kY};function SY(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function kY(e,t,n){const r=this;let s;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===s?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Ze(u)?at(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||$e(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const _Y={tokenize:CY};function CY(e){const t=this,n=e.attempt(mp,r,e.attempt(this.parser.constructs.flowInitial,s,at(e,e.attempt(this.parser.constructs.flow,s,e.attempt(PK,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const jY={resolveAll:aR()},EY=oR("string"),NY=oR("text");function oR(e){return{resolveAll:aR(e==="text"?TY:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,o,a);return o;function o(d){return u(d)?i(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=s[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function aR(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function TY(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let i=s.length,o=-1,a=0,c;for(;i--;){const u=s[i];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)c=!0,a++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:r.start._bufferIndex+o,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const PY={42:_n,43:_n,45:_n,48:_n,49:_n,50:_n,51:_n,52:_n,53:_n,54:_n,55:_n,56:_n,57:_n,62:ZA},AY={91:OK},RY={[-2]:Um,[-1]:Um,32:Um},MY={35:BK,42:cf,45:[g_,cf],60:WK,61:g_,95:cf,96:p_,126:p_},IY={38:tR,92:eR},OY={[-5]:Hm,[-4]:Hm,[-3]:Hm,33:cY,38:tR,42:Cv,60:[dK,QK],91:dY,92:[FK,eR],93:cw,95:Cv,96:_K},DY={null:[Cv,jY]},LY={null:[42,95]},$Y={null:[]},FY=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:LY,contentInitial:AY,disable:$Y,document:PY,flow:MY,flowInitial:RY,insideSpan:DY,string:IY,text:OY},Symbol.toStringTag,{value:"Module"}));function zY(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
vendor: 14,185 bytes, lines 641-643
641olumn:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let o=[],a=[];const c={attempt:_(C),check:_(k),consume:w,enter:x,exit:S,interrupt:_(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&i.push(t),u;function f(M){return o=fr(o,M),b(),o[o.length-1]!==null?[]:(j(t,0),u.events=lw(i,u.events,u),u.events)}function h(M,T){return VY(p(M),T)}function p(M){return BY(o,M)}function g(){const{_bufferIndex:M,_index:T,line:L,column:F,offset:z}=r;return{_bufferIndex:M,_index:T,line:L,column:F,offset:z}}function v(M){s[M.line]=M.column,P()}function b(){let M;for(;r._index<o.length;){const T=o[r._index];if(typeof T=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<T.length;)y(T.charCodeAt(r._bufferIndex));else y(T)}}function y(M){d=d(M)}function w(M){$e(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,P()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=M}function x(M,T){const L=T||{};return L.type=M,L.start=g(),u.events.push(["enter",L,u]),a.push(L),L}function S(M){const T=a.pop();return T.end=g(),u.events.push(["exit",T,u]),T}function C(M,T){j(M,T.from)}function k(M,T){T.restore()}function _(M,T){return L;function L(F,z,V){let I,A,D,E;return Array.isArray(F)?te(F):"tokenize"in F?te([F]):K(F);function K(U){return W;function W(ne){const oe=ne!==null&&U[ne],Z=ne!==null&&U.null,se=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(Z)?Z:Z?[Z]:[]];return te(se)(ne)}}function te(U){return I=U,A=0,U.length===0?V:N(U[A])}function N(U){return W;function W(ne){return E=R(),D=U,U.partial||(u.currentConstruct=U),U.name&&u.parser.constructs.disable.null.includes(U.name)?ie():U.tokenize.call(T?Object.assign(Object.create(u),T):u,c,ee,ie)(ne)}}function ee(U){return M(D,E),z}function ie(U){return E.restore(),++A<I.length?N(I[A]):V}}}function j(M,T){M.resolveAll&&!i.includes(M)&&i.push(M),M.resolve&&ns(u.events,T,u.events.length-T,M.resolve(u.events.slice(T),u)),M.resolveTo&&(u.events=M.resolveTo(u.events,u))}function R(){const M=g(),T=u.previous,L=u.currentConstruct,F=u.events.length,z=Array.from(a);return{from:F,restore:V};function V(){r=M,u.previous=T,u.currentConstruct=L,u.events.length=F,a=z,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function BY(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,i)];else{if(o=e.slice(n,s),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}i>0&&o.push(e[s].slice(0,i))}return o}function VY(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
642`;break}case-3:{o=`\r
643`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,r.push(o)}return r.join("")}function UY(e){const r={constructs:JG([FY,...(e||{}).extensions||[]]),content:s(sK),defined:[],document:s(oK),flow:s(_Y),lazy:{},string:s(EY),text:s(NY)};return r;function s(i){return o;function o(a){return zY(r,i,a)}}}function HY(e){for(;!nR(e););return e}const y_=/[\0\t\n\r]/g;function WY(){let e=1,t="",n=!0,r;return s;function s(i,o,a){const c=[];let u,d,f,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(y_.lastIndex=f,u=y_.exec(i),h=u&&u.index!==void 0?u.index:i.length,p=i.charCodeAt(h),!u){t=i.slice(f);break}if(p===10&&f===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<h&&(c.push(i.slice(f,h)),e+=h-f),p){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const qY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GY(e){return e.replace(qY,KY)}function KY(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return QA(n.slice(i?2:1),i?16:10)}return aw(n)||e}const lR={}.hasOwnProperty;function YY(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),JY(n)(HY(UY(n).document().write(WY()(e,t,!0))))}function JY(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(B),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(He),blockQuote:i(Z),characterEscape:R,characterReference:R,codeFenced:i(se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(se,o),codeText:i(re,o),codeTextData:R,data:R,codeFlowValue:R,definition:i(Y),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Ee),hardBreakEscape:i(Re),hardBreakTrailing:i(Re),htmlFlow:i(Nt,o),htmlFlowData:R,htmlText:i(Nt,o),htmlTextData:R,image:i(O),label:o,link:i(B),listItem:i(pe),listItemValue:h,listOrdered:i(G,f),listUnordered:i(G),paragraph:i(ce),reference:N,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(He),strong:i(le),thematicBreak:i(Me)},exit:{atxHeading:c(),atxHeadingSequence:C,autolink:c(),autolinkEmail:oe,autolinkProtocol:ne,blockQuote:c(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:U,characterReference:W,codeFenced:c(b),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:c(y),codeText:c(z),codeTextData:P,data:P,definition:c(),definitionDestinationString:S,definitionLabelString:w,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(T),hardBreakTrailing:c(T),htmlFlow:c(L),htmlFlowData:P,htmlText:c(F),htmlTextData:P,image:c(I),label:D,labelText:A,lineEnding:M,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ee,resourceDestinationString:E,resourceTitleString:K,resource:te,setextHeading:c(j),setextHeadingLineSequence:_,setextHeadingText:k,strong:c(),thematicBreak:c()}};cR(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(H){let X={type:"root",children:[]};const ve={stack:[X],tokenStack:[],config:t,enter:a,exit:u,buffer:o,resume:d,data:n},Ne=[];let Le=-1;for(;++Le<H.length;)if(H[Le][1].type==="listOrdered"||H[Le][1].type==="listUnordered")if(H[Le][0]==="enter")Ne.push(Le);else{const Qe=Ne.pop();Le=s(H,Qe,Le)}for(Le=-1;++Le<H.length;){const Qe=t[H[Le][0]];lR.call(Qe,H[Le][1].type)&&Qe[H[Le][1].type].call(Object.assign({sliceSerialize:H[Le][2].sliceSerialize},ve),H[Le][1])}if(ve.tokenStack.length>0){const Qe=ve.tokenStack[ve.tokenStack.length-1];(Qe[1]||v_).call(ve,void 0,Qe[0])}for(X.position={start:Gs(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:Gs(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},Le=-1;++Le<t.transforms.length;)X=t.transforms[Le](X)||X;return X}function s(H,X,ve){let Ne=X-1,Le=-1,Qe=!1,_t,nt,xe,me;for(;++Ne<=ve;){const be=H[Ne];switch(be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{be[0]==="enter"?Le++:Le--,me=void 0;break}case"lineEndingBlank":{be[0]==="enter"&&(_t&&!me&&!Le&&!xe&&(xe=Ne),me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:me=void 0}if(!Le&&be[0]==="enter"&&be[1].type==="listItemPrefix"||Le===-1&&be[0]==="exit"&&(be[1].type==="listUnordered"||be[1].type==="listOrdered")){if(_t){let Ge=Ne;for(nt=void 0;Ge--;){const Q=H[Ge];if(Q[1].type==="lineEnding"||Q[1].type==="lineEndingBlank"){if(Q[0]==="exit")continue;nt&&(H[nt][1].type="lineEndingBlank",Qe=!0),Q[1].type="lineEnding",nt=Ge}else if(!(Q[1].type==="linePrefix"||Q[1].type==="blockQuotePrefix"||Q[1].type==="blockQuotePrefixWhitespace"||Q[1].type==="blockQuoteMarker"||Q[1].type==="listItemIndent"))break}xe&&(!nt||xe<nt)&&(_t._spread=!0),_t.end=Object.assign({},nt?H[nt][1].start:be[1].end),H.splice(nt||Ne,0,["exit",_t,be[2]]),Ne++,ve++}if(be[1].type==="listItemPrefix"){const Ge={type:"listItem",_spread:!1,start:Object.assign({},be[1].start),end:void 0};_t=Ge,H.splice(Ne,0,["enter",Ge,be[2]]),Ne++,ve++,xe=void 0,me=!0}}}return H[X][1]._spread=Qe,ve}function i(H,X){return ve;function ve(Ne){a.call(this,H(Ne),Ne),X&&X.call(this,Ne)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(H,X,ve){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([X,ve||void 0]),H.position={start:Gs(X.start),end:void 0}}function c(H){return X;function X(ve){H&&H.call(this,ve),u.call(this,ve)}}function u(H,X){const ve=this.stack.pop(),Ne=this.tokenStack.pop();if(Ne)Ne[0].type!==H.type&&(X?X.call(this,H,Ne[0]):(Ne[1]||v_).call(this,H,Ne[0]));else throw new Error("Cannot close `"+H.type+"` ("+_c({start:H.start,end:H.end})+"): it’s not open");ve.position.end=Gs(H.end)}function d(){return KG(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(H){if(this.data.expectingFirstListItemValue){const X=this.stack[this.stack.length-2];X.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function p(){const H=this.resume(),X=this.stack[this.stack.length-1];X.lang=H}function g(){const H=this.resume(),X=this.stack[this.stack.length-1];X.meta=H}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const H=this.resume(),X=this.stack[this.stack.length-1];X.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const H=this.resume(),X=this.stack[this.stack.length-1];X.value=H.replace(/(\r?\n|\r)$/g,"")}function w(H){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.label=X,ve.identifier=Oa(this.sliceSerialize(H)).toLowerCase()}function x(){const H=this.resume(),X=this.stack[this.stack.length-1];X.title=H}function S(){const H=this.resume(),X=this.stack[this.stack.length-1];X.url=H}function C(H){const X=this.stack[this.stack.length-1];if(!X.depth){const ve=this.sliceSerialize(H).length;X.depth=ve}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function _(H){const X=this.stack[this.stack.length-1];X.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function R(H){const ve=this.stack[this.stack.length-1].children;let Ne=ve[ve.length-1];(!Ne||Ne.type!=="text")&&(Ne=Ce(),Ne.position={start:Gs(H.start),end:void 0},ve.push(Ne)),this.stack.push(Ne)}function P(H){const X=this.stack.pop();X.value+=this.sliceSerialize(H),X.position.end=Gs(H.end)}function M(H){const X=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=X.children[X.children.length-1];ve.position.end=Gs(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(X.type)&&(R.call(this,H),P.call(this,H))}function T(){this.data.atHardBreak=!0}function L(){const H=this.resume(),X=this.stack[this.stack.length-1];X.value=H}function F(){const H=this.resume(),X=this.stack[this.stack.length-1];X.value=H}function z(){const H=this.resume(),X=this.stack[this.stack.length-1];X.value=H}function V(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const X=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=X,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function I(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const X=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=X,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function A(H){const X=this.sliceSerialize(H),ve=this.stack[this.stack.length-2];ve.label=GY(X),ve.identifier=Oa(X).toLowerCase()}function D(){const H=this.stack[this.stack.length-1],X=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const Ne=H.children;ve.children=Ne}else ve.alt=X}function E(){const H=this.resume(),X=this.stack[this.stack.length-1];X.url=H}function K(){const H=this.resume(),X=this.stack[this.stack.length-1];X.title=H}function te(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ee(H){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.label=X,ve.identifier=Oa(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function ie(H){this.data.characterReferenceType=H.type}function U(H){const X=this.sliceSerialize(H),ve=this.data.characterReferenceType;let Ne;ve?(Ne=QA(X,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ne=aw(X);const Le=this.stack[this.stack.length-1];Le.value+=Ne}function W(H){const X=this.stack.pop();X.position.end=Gs(H.end)}function ne(H){P.call(this,H);const X=this.stack[this.stack.length-1];X.url=this.sliceSerialize(H)}function oe(H){P.call(this,H);const X=this.stack[this.stack.length-1];X.url="mailto:"+this.sliceSerialize(H)}function Z(){return{type:"blockquote",children:[]}}function se(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function Y(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function Re(){return{type:"break"}}function Nt(){return{type:"html",value:""}}function O(){return{type:"image",title:null,url:"",alt:null}}function B(){return{type:"link",title:null,url:"",children:[]}}function G(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function pe(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function ce(){return{type:"paragraph",children:[]}}function le(){return{type:"strong",children:[]}}function Ce(){return{type:"text",value:""}}function Me(){return{type:"thematicBreak"}}}function Gs(e){return{line:e.line,column:e.column,offset:e.offset}}function cR(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?cR(e,r):XY(e,r)}}function XY(e,t){let n;
vendor: 12,541 bytes, lines 643-648
643for(n in t)if(lR.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function v_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_c({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_c({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_c({start:t.start,end:t.end})+") is still open")}function QY(e){const t=this;t.parser=n;function n(r){return YY(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ZY(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function eJ(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
644`}]}function tJ(e,t){const n=t.value?t.value+`
645`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function nJ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rJ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sJ(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=vl(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=i+1,a+=1,e.footnoteCounts.set(r,a);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function iJ(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oJ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function uR(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function aJ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uR(e,t);const s={src:vl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function lJ(e,t){const n={src:vl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cJ(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function uJ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uR(e,t);const s={href:vl(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function dJ(e,t){const n={href:vl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fJ(e,t,n){const r=e.all(t),s=n?hJ(n):dR(t),i={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(s||a!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
646`}),d.type==="element"&&d.tagName==="p"&&!s?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(s||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
647`});const u={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,u),e.applyData(t,u)}function hJ(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=dR(n[r])}return t}function dR(e){const t=e.spread;return t??e.children.length>1}function pJ(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function mJ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gJ(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function yJ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vJ(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=rw(t.children[1]),c=WA(t.children[t.children.length-1]);a&&c&&(o.position={start:a,end:c}),s.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function xJ(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let c=-1;const u=[];for(;++c<a;){const f=t.children[c],h={},p=o?o[c]:void 0;p&&(h.align=p);let g={type:"element",tagName:i,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function wJ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const x_=9,w_=32;function bJ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(b_(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(b_(t.slice(s),s>0,!1)),i.join("")}function b_(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===x_||i===w_;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===x_||i===w_;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function SJ(e,t){const n={type:"text",value:bJ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function kJ(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _J={blockquote:ZY,break:eJ,code:tJ,delete:nJ,emphasis:rJ,footnoteReference:sJ,heading:iJ,html:oJ,imageReference:aJ,image:lJ,inlineCode:cJ,linkReference:uJ,link:dJ,listItem:fJ,list:pJ,paragraph:mJ,root:gJ,strong:yJ,table:vJ,tableCell:wJ,tableRow:xJ,text:SJ,thematicBreak:kJ,toml:Ad,yaml:Ad,definition:Ad,footnoteDefinition:Ad};function Ad(){}const fR=-1,gp=0,jc=1,ph=2,uw=3,dw=4,fw=5,hw=6,hR=7,pR=8,S_=typeof self=="object"?self:globalThis,CJ=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,o]=t[s];switch(i){case gp:case fR:return n(o,s);case jc:{const a=n([],s);for(const c of o)a.push(r(c));return a}case ph:{const a=n({},s);for(const[c,u]of o)a[r(c)]=r(u);return a}case uw:return n(new Date(o),s);case dw:{const{source:a,flags:c}=o;return n(new RegExp(a,c),s)}case fw:{const a=n(new Map,s);for(const[c,u]of o)a.set(r(c),r(u));return a}case hw:{const a=n(new Set,s);for(const c of o)a.add(r(c));return a}case hR:{const{name:a,message:c}=o;return n(new S_[a](c),s)}case pR:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new S_[i](o),s)};return r},k_=e=>CJ(new Map,e)(0),Go="",{toString:jJ}={},{keys:EJ}=Object,Dl=e=>{const t=typeof e;if(t!=="object"||!e)return[gp,t];const n=jJ.call(e).slice(8,-1);switch(n){case"Array":return[jc,Go];case"Object":return[ph,Go];case"Date":return[uw,Go];case"RegExp":return[dw,Go];case"Map":return[fw,Go];case"Set":return[hw,Go];case"DataView":return[jc,n]}return n.includes("Array")?[jc,n]:n.includes("Error")?[hR,n]:[ph,n]},Rd=([e,t])=>e===gp&&(t==="function"||t==="symbol"),NJ=(e,t,n,r)=>{const s=(o,a)=>{const c=r.push(o)-1;return n.set(a,c),c},i=o=>{if(n.has(o))return n.get(o);let[a,c]=Dl(o);switch(a){case gp:{let d=o;switch(c){case"bigint":a=pR,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([fR],o)}return s([a,d],o)}case jc:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),s([c,[...h]],o)}const d=[],f=s([a,d],o);for(const h of o)d.push(i(h));return f}case ph:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const d=[],f=s([a,d],o);for(const h of EJ(o))(e||!Rd(Dl(o[h])))&&d.push([i(h),i(o[h])]);return f}case uw:return s([a,o.toISOString()],o);case dw:{const{source:d,flags:f}=o;return s([a,{source:d,flags:f}],o)}case fw:{const d=[],f=s([a,d],o);for(const[h,p]of o)(e||!(Rd(Dl(h))||Rd(Dl(p))))&&d.push([i(h),i(p)]);return f}case hw:{const d=[],f=s([a,d],o);for(const h of o)(e||!Rd(Dl(h)))&&d.push(i(h));return f}}const{message:u}=o;return s([a,{name:c,message:u}],o)};return i},__=(e,{json:t,lossy:n}={})=>{const r=[];return NJ(!(t||n),!!t,new Map,r)(e),r},mh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?k_(__(e,t)):structuredClone(e):(e,t)=>k_(__(e,t));function TJ(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function PJ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function AJ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||TJ,r=e.options.footnoteBackLabel||PJ,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=vl(f.toLowerCase());let p=0;const g=[],v=e.footnoteCounts.get(f);for(;v!==void 0&&++p<=v;){g.length>0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,p);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const w=b.children[b.children.length-1];w&&w.type==="text"?w.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...mh(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
648`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)}
vendor: 17,925 bytes, lines 648-653
648,{type:"text",value:`
649`}]}}const mR=function(e){if(e==null)return OJ;if(typeof e=="function")return yp(e);if(typeof e=="object")return Array.isArray(e)?RJ(e):MJ(e);if(typeof e=="string")return IJ(e);throw new Error("Expected function, string, or object as test")};function RJ(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=mR(e[n]);return yp(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function MJ(e){const t=e;return yp(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function IJ(e){return yp(t);function t(n){return n&&n.type===e}}function yp(e){return t;function t(n,r,s){return!!(DJ(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function OJ(){return!0}function DJ(e){return e!==null&&typeof e=="object"&&"type"in e}const gR=[],LJ=!0,C_=!1,$J="skip";function FJ(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=mR(s),o=r?-1:1;a(e,void 0,[])();function a(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=gR,g,v,b;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=zJ(n(c,d)),p[0]===C_))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==$J)for(v=(r?y.children.length:-1)+o,b=d.concat(y);v>-1&&v<y.children.length;){const w=y.children[v];if(g=a(w,v,b)(),g[0]===C_)return g;v=typeof g[1]=="number"?g[1]:v+o}}return p}}}function zJ(e){return Array.isArray(e)?e:typeof e=="number"?[LJ,e]:e==null?gR:[e]}function yR(e,t,n,r){let s,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,s=n):(i=t,o=n,s=r),FJ(e,i,a,s);function a(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return o(c,f,d)}}const jv={}.hasOwnProperty,BJ={};function VJ(e,t){const n=t||BJ,r=new Map,s=new Map,i=new Map,o={..._J,...n.handlers},a={all:u,applyData:HJ,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:c,options:n,patch:UJ,wrap:qJ};return yR(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:s,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),a;function c(d,f){const h=d.type,p=a.handlers[h];if(jv.call(a.handlers,h)&&p)return p(a,d,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in d){const{children:v,...b}=d,y=mh(b);return y.children=a.all(d),y}return mh(d)}return(a.options.unknownHandler||WJ)(a,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=a.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=j_(g.value)),!Array.isArray(g)&&g.type==="element")){const v=g.children[0];v&&v.type==="text"&&(v.value=j_(v.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function UJ(e,t){e.position&&(t.position=jG(e))}function HJ(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&i&&Object.assign(n.properties,mh(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function WJ(e,t){const n=t.data||{},r="value"in t&&!(jv.call(n,"hProperties")||jv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function qJ(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
650`});++r<e.length;)r&&n.push({type:"text",value:`
651`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
652`}),n}function j_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function E_(e,t){const n=VJ(e,t),r=n.one(e,void 0),s=AJ(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
653`},s),i}function GJ(e,t){return e&&"run"in e?async function(n,r){const s=E_(n,{file:r,...t});await e.run(s,r)}:function(n,r){return E_(n,{file:r,...e||t})}}function N_(e){if(e)throw e}var uf=Object.prototype.hasOwnProperty,vR=Object.prototype.toString,T_=Object.defineProperty,P_=Object.getOwnPropertyDescriptor,A_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):vR.call(t)==="[object Array]"},R_=function(t){if(!t||vR.call(t)!=="[object Object]")return!1;var n=uf.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&uf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||uf.call(t,s)},M_=function(t,n){T_&&n.name==="__proto__"?T_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},I_=function(t,n){if(n==="__proto__")if(uf.call(t,n)){if(P_)return P_(t,n).value}else return;return t[n]},KJ=function e(){var t,n,r,s,i,o,a=arguments[0],c=1,u=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},c=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=I_(a,n),s=I_(t,n),a!==s&&(d&&s&&(R_(s)||(i=A_(s)))?(i?(i=!1,o=r&&A_(r)?r:[]):o=r&&R_(r)?r:{},M_(a,{name:n,newValue:e(d,o,s)})):typeof s<"u"&&M_(a,{name:n,newValue:s}));return a};const Wm=Ai(KJ);function Ev(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function YJ(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(c,...u){const d=e[++i];let f=-1;if(c){o(c);return}for(;++f<s.length;)(u[f]===null||u[f]===void 0)&&(u[f]=s[f]);s=u,d?JJ(d,a)(...u):o(null,...u)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function JJ(e,t){let n;return r;function r(...o){const a=e.length>o.length;let c;a&&o.push(s);try{c=e.apply(this,o)}catch(u){const d=u;if(a&&n)throw d;return s(d)}a||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(o,...a){n||(n=!0,t(o,...a))}function i(o){s(null,o)}}const Vr={basename:XJ,dirname:QJ,extname:ZJ,join:eX,sep:"/"};function XJ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Du(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else o<0&&(i=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(r=s):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function QJ(e){if(Du(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ZJ(e){Du(e);let t=e.length,n=-1,r=0,s=-1,i=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function eX(...e){let t=-1,n;for(;++t<e.length;)Du(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":tX(n)}function tX(e){Du(e);const t=e.codePointAt(0)===47;let n=nX(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function nX(e,t){let n="",r=0,s=-1,i=0,o=-1,a,c;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||i===1))if(s!==o-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=o,i=0;continue}}else if(n.length>0){n="",r=0,s=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,i=0}else a===46&&i>-1?i++:i=-1}return n}function Du(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rX={cwd:sX};function sX(){return"/"}function Nv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function iX(e){if(typeof e=="string")e=new URL(e);else if(!Nv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return oX(e)}function oX(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const qm=["history","path","basename","stem","extname","dirname"];class xR{constructor(t){let n;t?Nv(t)?n={path:t}:typeof t=="string"||aX(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":rX.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qm.length;){const i=qm[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)qm.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Vr.basename(this.path):void 0}set basename(t){Km(t,"basename"),Gm(t,"basename"),this.path=Vr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Vr.dirname(this.path):void 0}set dirname(t){O_(this.basename,"dirname"),this.path=Vr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Vr.extname(this.path):void 0}set extname(t){if(Gm(t,"extname"),O_(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Vr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Nv(t)&&(t=iX(t)),Km(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Vr.basename(this.path,this.extname):void 0}set stem(t){Km(t,"stem"),Gm(t,"stem"),this.path=Vr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new fn(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Gm(e,t){if(e&&e.includes(Vr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Vr.sep+"`")}function Km(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function O_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function aX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lX=function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},cX={}.hasOwnProperty;class pw extends lX{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=YJ()}copy(){const t=new pw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Wm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Xm("data",this.frozen),this.namespace[t]=n,this):cX.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Xm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Md(t),r=this.parser||this.Parser;return Ym("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ym("process",this.parser||this.Parser),Jm("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,o){const a=Md(t),c=r.parse(a);r.run(c,a,function(d,f,h){if(d||!f||!h)return u(d);const p=f,g=r.stringify(p,h);fX(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?o(d):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Ym("processSync",this.parser||this.Parser),Jm("processSync",this.compiler||this.Compiler),this.process(t,s),L_("processSync","process",n),r;function s(i,o){n=!0,N_(i),r=o}}run(t,n,r){D_(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(o,a){const c=Md(n);s.run(t,c,u);function u(d,f,h){const p=f||t;d?a(d):o?o(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),L_("runSync","run",r),s;function i(o,a){N_(o),s=a,r=!0}}stringify(t,n){this.freeze();const r=Md(n),s=this.compiler||this.Compiler;return Jm("stringify",s),D_(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Xm("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(s.settings=Wm(!0,s.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[p,...g]=d;const v=r[h][1];Ev(v)&&Ev(p)&&(p=Wm(!0,v,p)),r[h]=[u,p,...g]}}}}const uX=new pw().freeze();function Ym(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function D_(e){if(!Ev(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function L_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Md(e){return dX(e)?e:new xR(e)}function dX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fX(e){return typeof e=="string"||hX(e)}function hX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$_=[],F_={allowDangerousHtml:!0},mX=/^(https?|ircs?|mailto|xmpp)$/i,gX=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wR(e){const t=yX(e),n=vX(e);return xX(t.runSync(t.parse(n),n),e)}function yX(e){const t=e.rehypePlugins||$_,n=e.remarkPlugins||$_,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...F_}:F_;return uX().use(QY).use(n).use(GJ,r).use(t)}function vX(e){const t=e.children||"",n=new xR;return typeof t=="string"&&(n.value=t),n}function xX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,c=t.urlTransform||wX;for(const d of gX)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+pX+d.id,void 0);return yR(e,u),AG(e,{Fragment:l.Fragment,components:s,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return o?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;
653if(d.type==="element"){let p;for(p in Vm)if(Object.hasOwn(Vm,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],v=Vm[p];(v===null||v.includes(d.tagName))&&(d.properties[p]=c(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return a&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function wX(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||mX.test(e.slice(0,t))?e:""}const z_=/\[\[MORE_OBS(?:\s+title="([^"]*)")?\]\]([\s\S]*?)\[\[\/MORE_OBS\]\]/g;function bX(e){var s;const t=[];let n=0;z_.lastIndex=0;let r;for(;(r=z_.exec(e))!==null;)r.index>n&&t.push({kind:"md",content:e.slice(n,r.index).trim()}),t.push({kind:"more",title:((s=r[1])==null?void 0:s.trim())||"More observations",content:r[2].trim()}),n=r.index+r[0].length;return n<e.length&&t.push({kind:"md",content:e.slice(n).trim()}),t.filter(i=>i.kind!=="md"||i.content.length>0)}const SX=({title:e,content:t})=>{const[n,r]=m.useState(!1);return l.jsxs("div",{className:"not-prose my-2",children:[l.jsxs("button",{type:"button",onClick:()=>r(s=>!s),className:"inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors","aria-expanded":n,children:[l.jsx(xi,{className:`h-3 w-3 transition-transform ${n?"rotate-180":""}`}),l.jsx("span",{children:e})]}),n&&l.jsx(de.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mt-1.5 rounded-lg border border-border/60 bg-muted/40 px-3 py-2 text-xs",children:l.jsx("div",{className:"prose prose-xs dark:prose-invert max-w-none [&_ul]:my-0 [&_li]:my-0.5 [&_p]:my-0",children:l.jsx(wR,{children:t})})})]})};function kX(e){const t=Math.floor((Date.now()-e.getTime())/1e3);if(t<10)return"just now";if(t<60)return`${t}s ago`;const n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}const Ui=28,_X=8,CX=12,jX=({message:e,currentUserId:t,onEdit:n,onRevert:r,canRevert:s,canEdit:i,awaitingEditConfirm:o=!1,senderAvatarUrl:a,currentUserAvatarUrl:c,senderIsHost:u=!1,effectiveSnapshotId:d=null})=>{var A,D;const[f,h]=m.useState(!1),[p,g]=m.useState(e.content),v=m.useRef(null),b=m.useRef(null),y=m.useRef(!1);m.useEffect(()=>{if(o&&!y.current)b.current=e.content;else if(!o&&y.current){const E=b.current;b.current=null,E!==null&&e.content!==E?h(!1):requestAnimationFrame(()=>{const K=v.current;if(K){K.focus();const te=K.value.length;K.setSelectionRange(te,te)}})}y.current=o},[o,e.content]);const w=e.role==="user",x=e.role==="group",S=e.role==="assistant",C=x&&e.senderId===t,k=e.target||(w?"ai":void 0),_=k==="ai",j=k==="group",R=w||C&&_,P=w||C,M=x&&!C&&!!e.senderName||S,T=S?"EZY":e.senderName,F=S?{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",hasBorder:!0,textClass:"text-card-foreground"}:w||C?j?{backgroundColor:"hsl(var(--chat-group))",borderColor:"transparent",hasBorder:!1,textClass:"text-[hsl(var(--chat-group-foreground))]"}:{backgroundColor:"hsl(var(--chat-ai))",borderColor:"transparent",hasBorder:!1,textClass:"text-[hsl(var(--chat-ai-foreground))]"}:x?_?{backgroundColor:"hsl(var(--chat-ai) / 0.15)",borderColor:"transparent",hasBorder:!1,textClass:"text-foreground"}:{backgroundColor:"hsl(var(--chat-group) / 0.15)",borderColor:"transparent",hasBorder:!1,textClass:"text-foreground"}:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",hasBorder:!0,textClass:"text-card-foreground"},z=Ui/2,V=()=>{if(S||!j&&!_||!x&&!w)return null;const E=w||C,K=_?l.jsx(pN,{className:"h-3.5 w-3.5"}):l.jsx(Gt,{className:"h-3.5 w-3.5"}),te=E?"text-white/70":_?"text-[hsl(var(--chat-ai))]":"text-[hsl(var(--chat-group))]";return l.jsxs("span",{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase tracking-wide ${te} mr-1.5`,children:["TO",K]})},I=()=>{const E=_X,K=CX,te=1;if(P){const N=`M0,0 L${E},0 L0,${K} Z`;return l.jsx("div",{className:"absolute pointer-events-none z-10",style:{right:-(E-te),top:0},"aria-hidden":"true",children:l.jsxs("svg",{width:E,height:K,viewBox:`0 0 ${E} ${K}`,className:"block",children:[l.jsx("path",{d:N,fill:F.backgroundColor,stroke:F.hasBorder?F.borderColor:"none",strokeWidth:F.hasBorder?1:0,strokeLinejoin:"round"}),F.hasBorder&&l.jsx("line",{x1:0,y1:1,x2:0,y2:K-1,stroke:F.backgroundColor,strokeWidth:2})]})})}else{const N=`M${E},0 L0,0 L${E},${K} Z`;return l.jsx("div",{className:"absolute pointer-events-none z-10",style:{left:-(E-te),top:0},"aria-hidden":"true",children:l.jsxs("svg",{width:E,height:K,viewBox:`0 0 ${E} ${K}`,className:"block",children:[l.jsx("path",{d:N,fill:F.backgroundColor,stroke:F.hasBorder?F.borderColor:"none",strokeWidth:F.hasBorder?1:0,strokeLinejoin:"round"}),F.hasBorder&&l.jsx("line",{x1:E,y1:1,x2:E,y2:K-1,stroke:F.backgroundColor,strokeWidth:2})]})})}};return l.jsxs(de.div,{initial:{opacity:0,y:12}
653,animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:`group/msg flex gap-3 ${P?"flex-row-reverse":"flex-row"} items-start pb-5`,children:[!P&&(x?l.jsxs(ml,{className:"flex-shrink-0 ring-1 ring-border",style:{width:Ui,height:Ui,marginTop:z-Ui/2},children:[a?l.jsx(_o,{src:a,alt:e.senderName||"User",className:"object-cover"}):null,l.jsx(gl,{className:`text-xs ${_?"bg-[hsl(var(--chat-ai)/0.2)] text-[hsl(var(--chat-ai))]":"bg-[hsl(var(--chat-group)/0.2)] text-[hsl(var(--chat-group))]"}`,children:((D=(A=e.senderName)==null?void 0:A[0])==null?void 0:D.toUpperCase())||l.jsx(Gt,{className:"h-3.5 w-3.5"})})]}):l.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",style:{width:Ui,height:Ui,marginTop:z-Ui/2},children:l.jsx(lu,{size:"sm",showText:!1})})),l.jsxs("div",{className:"max-w-[75%]",children:[M&&l.jsxs("p",{className:"text-[10px] font-medium text-muted-foreground mb-0.5 truncate",style:{marginTop:z-14},children:[T,u&&!S?l.jsxs(l.Fragment,{children:[" (",l.jsx("span",{className:"font-bold",children:"host"}),")"]}):null]}),l.jsxs("div",{className:`flex items-end gap-1.5 ${P?"flex-row-reverse":"flex-row"}`,style:{marginTop:M?0:z},children:[l.jsxs("div",{className:"relative min-w-0",children:[I(),l.jsx("div",{className:`relative p-2.5 text-sm leading-snug break-words [overflow-wrap:anywhere] ${F.textClass} ${F.hasBorder?"border":""} ${P?"rounded-2xl rounded-tr-none":"rounded-2xl rounded-tl-none"}`,style:{backgroundColor:F.backgroundColor,borderColor:F.hasBorder?F.borderColor:void 0},children:f&&R&&i?l.jsxs("div",{className:`flex flex-col gap-1 min-w-[180px] transition-opacity ${o?"opacity-70":""}`,children:[l.jsx("textarea",{ref:v,value:p,onChange:E=>g(E.target.value),rows:2,disabled:o,className:"resize-none rounded-md bg-white/10 text-current placeholder:text-current/60 px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-white/40 disabled:cursor-not-allowed",autoFocus:!0}),l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[l.jsx("button",{type:"button",disabled:o,onClick:()=>{h(!1),g(e.content)},className:"p-1 rounded hover:bg-white/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",title:"Cancel",children:l.jsx(Dn,{className:"h-3.5 w-3.5"})}),l.jsx("button",{type:"button",disabled:o,onClick:()=>{const E=p.trim();E&&(n==null||n(e.id,E))},className:"p-1 rounded hover:bg-white/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",title:"Save & resend",children:l.jsx(xo,{className:"h-3.5 w-3.5"})})]})]}):w||x?l.jsxs("p",{children:[(x||w&&e.target)&&V(),e.content]}):l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&>p]:my-0 [&>p+p]:mt-3 [&>ul]:my-2 [&>ul]:pl-5 [&>ul]:list-disc [&_li]:my-0.5 [&>p+ul]:mt-3 [&>ul+p]:mt-3",children:bX(e.content).map((E,K)=>E.kind==="md"?l.jsx(wR,{children:E.content},K):l.jsx(SX,{title:E.title,content:E.content},K))})}),(()=>{const E=e.snapshotId??d??null,K=S&&s&&!!E&&!!r,te=R&&i&&!!n;return f||!te&&!K?null:l.jsxs("div",{className:`absolute -bottom-5 ${P?"right-1":"left-1"} flex items-center gap-0.5 transition-opacity`,children:[te&&l.jsx("button",{type:"button",onClick:()=>{g(e.content),h(!0)},className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted",title:"Edit & resend",children:l.jsx(Vx,{className:"h-3 w-3"})}),K&&l.jsxs("button",{type:"button",onClick:()=>r(E,e.id),className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted inline-flex items-center gap-1",title:"Revert to this version",children:[l.jsx(H4,{className:"h-3 w-3"}),l.jsx("span",{className:"text-[10px]",children:"Revert"})]})]})})()]}),l.jsx("p",{className:"text-[10px] opacity-50 whitespace-nowrap flex-shrink-0 leading-none pb-1",children:kX(e.timestamp)})]})]})]})},B_=["Thinking…","Reading your request…","Checking venues…","Verifying opening hours…","Optimizing the schedule…","Polishing details…"],EX=()=>{const[e,t]=m.useState(0);return m.useEffect(()=>{const n=setInterval(()=>{t(r=>(r+1)%B_.length)},1800);return()=>clearInterval(n)},[]),l.jsxs(de.div,{initial:{opacity:0,y:8}
653,animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25},className:"flex gap-3 items-start",children:[l.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",style:{width:28,height:28},children:l.jsx(lu,{size:"sm",showText:!1})}),l.jsxs("div",{className:"flex-1 min-w-0 max-w-[80%]",children:[l.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border bg-card/70 backdrop-blur-sm px-4 py-3",style:{boxShadow:"0 4px 20px -8px hsl(var(--primary) / 0.25)"},children:[l.jsx(de.div,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(110deg, transparent 30%, hsl(var(--primary) / 0.18) 50%, transparent 70%)"},animate:{x:["-120%","120%"]},transition:{duration:1.8,repeat:1/0,ease:"easeInOut"}}),l.jsxs("div",{className:"space-y-2 relative",children:[l.jsx("div",{className:"h-2.5 w-[88%] rounded-full bg-muted/70"}),l.jsx("div",{className:"h-2.5 w-[72%] rounded-full bg-muted/60"}),l.jsx("div",{className:"h-2.5 w-[55%] rounded-full bg-muted/50"})]})]}),l.jsx("div",{className:"mt-1.5 ml-1 h-4 overflow-hidden",children:l.jsx(yt,{mode:"wait",children:l.jsx(de.span,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.3},className:"block text-[11px] font-medium bg-clip-text text-transparent",style:{backgroundImage:"linear-gradient(90deg, hsl(var(--primary)), hsl(var(--foreground)), hsl(var(--primary)))",backgroundSize:"200% 100%"},children:l.jsx(de.span,{animate:{backgroundPosition:["0% 50%","200% 50%"]},transition:{duration:3,repeat:1/0,ease:"linear"},children:B_[e]})},e)})})]})]})},Ll="ezy_planning_state",bR=m.createContext(void 0),NX=({children:e})=>{const[t,n]=m.useState(""),[r,s]=m.useState([]),[i,o]=m.useState(""),[a,c]=m.useState(!1),[u,d]=m.useState(""),[f,h]=m.useState(!1),[p,g]=m.useState(""),[v,b]=m.useState(!1),[y,w]=m.useState(()=>{const Z=new Date;return new Date(Z.getFullYear(),Z.getMonth(),Z.getDate())}),[x,S]=m.useState(2),[C,k]=m.useState(null),[_,j]=m.useState(!1),[R,P]=m.useState([]),[M,T]=m.useState(!1),[L,F]=m.useState(null),z=Z=>{F(Z)},[V,I]=m.useState(null),[A,D]=m.useState([]),[E,K]=m.useState(null),[te,N]=m.useState(!1),ee=()=>N(!0),ie=()=>N(!1),U=()=>{const Z={prompt:t,selectedTags:r,location:i,locationModified:a,startTime:u,startTimeModified:f,endTime:p,endTimeModified:v,date:y==null?void 0:y.toISOString(),peopleCount:x,suggestedVenues:R,isReviewing:M,plannedCity:L,planIntent:V,generationWarnings:A};sessionStorage.setItem(Ll,JSON.stringify(Z))},W=()=>{const Z=sessionStorage.getItem(Ll);if(!Z)return!1;try{const se=JSON.parse(Z);return n(se.prompt),s(se.selectedTags),o(se.location),c(se.locationModified),d(se.startTime),h(se.startTimeModified),g(se.endTime),b(se.endTimeModified),w(se.date?new Date(se.date):void 0),S(se.peopleCount),P(se.suggestedVenues),T(se.isReviewing),z(se.plannedCity||null),I(se.planIntent||null),D(se.generationWarnings||[]),sessionStorage.removeItem(Ll),!0}catch(se){return console.error("Failed to restore planning state:",se),sessionStorage.removeItem(Ll),!1}},ne=()=>{sessionStorage.removeItem(Ll)};m.useEffect(()=>{W()&&console.log("Planning state restored from session")},[]);const oe=Z=>{s(se=>typeof Z=="string"?se.includes(Z)?se.filter(re=>re!==Z):[...se,Z]:Z)};return l.jsx(bR.Provider,{value:{prompt:t,setPrompt:n,selectedTags:r,setSelectedTags:oe,location:i,setLocation:o,locationModified:a,setLocationModified:c,startTime:u,setStartTime:d,startTimeModified:f,setStartTimeModified:h,endTime:p,setEndTime:g,endTimeModified:v,setEndTimeModified:b,date:y,setDate:w,peopleCount:x,setPeopleCount:S,itineraryId:C,setItineraryId:k,isGenerating:_,setIsGenerating:j,suggestedVenues:R,setSuggestedVenues:P,isReviewing:M,setIsReviewing:T,plannedCity:L,setPlannedCity:z,planIntent:V,setPlanIntent:I,generationWarnings:A,setGenerationWarnings:D,narrativeSummary:E,setNarrativeSummary:K,generateRequested:te,requestGeneration:ee,clearGenerateRequest:ie,persistToSession:U,restoreFromSession:W,clearSessionState:ne},children:e})},vn=()=>{const e=m.useContext(bR);if(e===void 0)throw new Error("usePlanningContext must be used within a PlanningProvider");return e},TX="https://inznlarlalvonceaksoy.supabase.co",V_="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imluem5sYXJsYWx2b25jZWFrc295Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzQxMTQ4NzQsImV4cCI6MjA0OTY5MDg3NH0.LhLIhLIGGZH8rhekJNQ19ChTyGIax0WkKdA6d0RUhUE";function PX(){const[e,t]=m.useState(!1),[n,r]=m.useState(null),[s,i]=m.useState(null),o=m.useRef(null),a=m.useCallback(()=>{r(null),i(null)},[]);return{modify:m.useCallback(async u=>{var h;(h=o.current)==null||h.abort();const d=new AbortController;o.current=d,t(!0),r(null),i(null);const f=`${TX}/functions/v1/modify-itinerary`;try{const p=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${V_}`,apikey:V_},body:JSON.stringify(u),signal:d.signal});if(!p.ok){const v=await p.text();throw new Error(v||`Server error: ${p.status}`)}const g=await p.json();return r(g),g}catch(p){return p.name==="AbortError"||(console.error("[useModifyItinerary] Error:",p),i(p.message||"Couldn't apply your edit. Please try again.")),null}finally{o.current===d&&(o.current=null),t(!1)}},[]),isModifying:e,result:n,error:s,reset:a}}function AX(e){const{itineraryId:t,sessionId:n,maxHistory:r=30}=e,[s,i]=m.useState([]),[o,a]=m.useState(-1),c=m.useRef(null);m.useEffect(()=>{if(!t||!n)return;const y=`${t}::${n}`;c.current!==y&&(c.current=y,(async()=>{const{data:w,error:x}=await q.from("itinerary_snapshots").select("*").eq("itinerary_id",t).order("created_at",{ascending:!0}).limit(r);if(x){console.warn("[snapshots] hydrate failed:",x.message);return}w&&w.length&&(i(w),a(w.length-1))})())},[t,n,r]);const u=m.useCallback(async(y,w,x,S)=>{const C=`local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,k={id:C,itinerary_id:t??"",session_id:n??null,message_id:x??null,label:w,venues:JSON.parse(JSON.stringify(y)),created_by:null,created_at:new Date().toISOString(),user_message_id:S??x??null};if(i(_=>{const R=[..._.slice(0,o+1),k];return R.length>r?R.slice(R.length-r):R}),a(_=>Math.min(_+1,r-1)),t)try{const{data:{user:_}}
653=await q.auth.getUser(),{data:j,error:R}=await q.from("itinerary_snapshots").insert({itinerary_id:t,session_id:n,message_id:x??null,label:w,venues:k.venues,created_by:(_==null?void 0:_.id)??null}).select().single();if(!R&&j){const P=j;return P.user_message_id=k.user_message_id,i(M=>M.map(T=>T.id===C?P:T)),P.id}else R&&console.warn("[snapshots] persist failed:",R.message)}catch(_){console.warn("[snapshots] persist threw:",_.message)}return C},[t,n,o,r]),d=o>0,f=o>=0&&o<s.length-1,h=m.useCallback(()=>{var w;if(!d)return null;const y=o-1;return a(y),((w=s[y])==null?void 0:w.venues)??null},[d,o,s]),p=m.useCallback(()=>{var w;if(!f)return null;const y=o+1;return a(y),((w=s[y])==null?void 0:w.venues)??null},[f,o,s]),g=m.useCallback(y=>{const w=s.findIndex(x=>x.id===y);return w<0?null:(a(w),s[w].venues)},[s]),v=m.useCallback(async(y,w)=>{i(x=>x.map(S=>S.id===y?{...S,message_id:w}:S));try{const{error:x}=await q.from("itinerary_snapshots").update({message_id:w}).eq("id",y);x&&console.warn("[snapshots] relink failed:",x.message)}catch(x){console.warn("[snapshots] relink threw:",x.message)}},[]),b=m.useCallback(()=>{i([]),a(-1),c.current=null},[]);return{history:s,cursor:o,current:o>=0?s[o]??null:null,canUndo:d,canRedo:f,push:u,undo:h,redo:p,goTo:g,relink:v,reset:b}}const RX=30;let MX=0;const zn=()=>`msg-${Date.now()}-${++MX}`,mw=m.createContext(void 0),IX=({children:e})=>{const{prompt:t,setPrompt:n,isGenerating:r,suggestedVenues:s,setSuggestedVenues:i,requestGeneration:o,planIntent:a,plannedCity:c,location:u,date:d,peopleCount:f,startTime:h,endTime:p,itineraryId:g,narrativeSummary:v}=vn(),{modify:b,isModifying:y}=PX(),[w,x]=m.useState([]),[S,C]=m.useState(!1),[k,_]=m.useState(null),[j,R]=m.useState([]),[P,M]=m.useState(null),[T,L]=m.useState(!0),[F,z]=m.useState(null),[V,I]=m.useState(!1),[A,D]=m.useState(!1),[E,K]=m.useState(!1),[te,N]=m.useState(!1),[ee,ie]=m.useState(null),U=m.useCallback(()=>ie(Date.now()),[]),W=m.useRef(null),ne=m.useRef(!1),oe=m.useRef(!1),Z=m.useRef(!1);m.useEffect(()=>{if(!P){W.current&&(q.removeChannel(W.current),W.current=null),D(!1),K(!1),N(!1);return}const xe=q.channel(`modify_lock_${P}`,{config:{broadcast:{self:!1}}}).on("broadcast",{event:"lock"},({payload:me})=>{D(!!(me!=null&&me.locked))}).on("broadcast",{event:"preview"},({payload:me})=>{K(!!(me!=null&&me.open))}).on("broadcast",{event:"ai_responding"},({payload:me})=>{N(!!(me!=null&&me.responding))}).subscribe();return W.current=xe,()=>{q.removeChannel(xe),W.current=null}},[P]);const se=y||V;m.useEffect(()=>{if(!(!P||!W.current)&&ne.current!==se){ne.current=se;try{W.current.send({type:"broadcast",event:"lock",payload:{locked:se}})}catch(xe){console.warn("[modify_lock] broadcast failed:",xe)}}},[se,P]);const re=!!F;m.useEffect(()=>{if(!(!P||!W.current)&&oe.current!==re){oe.current=re;try{W.current.send({type:"broadcast",event:"preview",payload:{open:re}})}catch(xe){console.warn("[modify_lock] preview broadcast failed:",xe)}}},[re,P]),m.useEffect(()=>{if(!(!P||!W.current)&&Z.current!==S){Z.current=S;try{W.current.send({type:"broadcast",event:"ai_responding",payload:{responding:S}})}catch(xe){console.warn("[modify_lock] ai_responding broadcast failed:",xe)}}},[S,P]);const Y=AX({itineraryId:g,sessionId:P}),Ee=m.useCallback(async xe=>{if(g)try{const{error:me}=await q.from("venues").delete().eq("itinerary_id",g);if(me)throw me;const be=Date.now(),Ge=xe.map((ge,ye)=>{const{votes:Te,comments:je,holiday_info:we,hours_source:We,estimated_price_range_source:rt,openNow_at_query_time:Ye,open_at_visit:Ot,special_days:Yt,live_status_label:Jt,id:Tt,created_at:ir,...qu}=ge;return{itinerary_id:g,...qu,hours_source:We??null,open_now_at_query_time:Ye??null,open_at_visit:Ot??null,special_days:Yt??null,holiday_info:we??null,live_status_label:Jt??null,created_at:new Date(be+ye).toISOString()}}),{error:Q}=await q.from("venues").insert(Ge);if(Q)throw Q}catch(me){console.error("[PlanningChatContext] persist venues failed:",me)}},[g]),He=m.useRef(!1),Re=m.useRef(null),Nt=m.useRef(!1),O=m.useRef([]);m.useEffect(()=>{O.current=w},[w]);const B=m.useRef([]);m.useEffect(()=>{B.current=s},[s]);const G=m.useCallback(xe=>{if(Nt.current)return;const me=xe.trim();if(!me)return;const be={id:zn(),role:"user",content:me,timestamp:new Date};x(Ge=>Ge.length===0?[be]:Ge),C(!0)},[]);m.useEffect(()=>{r&&w.length===0&&G(t)},[r,w.length,t,G]),m.useEffect(()=>{if(He.current&&!r){C(!1);const xe=()=>{if(v&&v.trim())return v.trim();const Ge=(c==null?void 0:c.name)||(c==null?void 0:c.description)||u||"your destination";let Q="";if(d)try{Q=d.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}catch{Q=String(d)}const ge=a!=null&&a.vibe?`a **${a.vibe}** day`:"your day",ye=Q?`Your ${Q} in ${Ge} is ready! 🎉`:`Your plan for ${Ge} is ready! 🎉`,Te=`Here's ${ge} mapped out.`,je=s.map(we=>
653`- **${we.name}**`).join(`
654`);return`${ye}
655${Te}
656
657${je}
658
659Want to tweak anything? Just say the word.`},me=s.length>0?{id:zn(),role:"assistant",content:xe(),timestamp:new Date,metadata:{type:"itinerary_updated"}}:{id:zn(),role:"assistant",content:"I had trouble finding venues for that request. Could you try rephrasing or providing more details about what you're looking for? 🤔",timestamp:new Date,metadata:{type:"error"}},be=me.id;(async()=>{if(Re.current){const Ge=await Re.current(me.content,{senderName:"EZY Assistant",senderId:null});s.length>0&&Y.push(s,"Initial itinerary",Ge??null,null)}else s.length>0&&Y.push(s,"Initial itinerary",be,null),x(Ge=>[...Ge,me])})()}He.current=r},[r,s.length]),m.useEffect(()=>{r&&C(!0)},[r]);const pe=m.useCallback(async(xe,me)=>{var ge,ye,Te,je;const be=B.current;if(!a||be.length===0||!c)return!1;C(!0);const Ge=O.current.filter(we=>(we.role==="user"||we.role==="assistant")&&we.id!==me.id).slice(-RX).map(we=>({role:we.role,content:we.content})),Q=d?`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`:void 0;try{const we=await b({message:xe,current_itinerary:be,plan_intent:a,location:u,date:Q,peopleCount:f,conversation_history:Ge,plannedCity:{place_id:c.place_id,description:c.description,name:c.name,lat:c.lat,lng:c.lng,utcOffsetMinutes:c.utcOffsetMinutes,countryCode:c.countryCode,placeTypes:c.placeTypes},effective_start_time:h||void 0,effective_end_time:p||void 0});if(!we)return x(Tt=>[...Tt,{id:zn(),role:"assistant",content:"I had trouble applying that edit. Could you rephrase or try a different change?",timestamp:new Date,metadata:{type:"error"}}]),!0;if(we.requires_regeneration)return x(Tt=>[...Tt,{id:zn(),role:"assistant",content:we.assistant_message||`Restyling your itinerary as "${we.requires_regeneration.new_vibe}" — regenerating from scratch...`,timestamp:new Date,metadata:{type:"itinerary_updated"}}]),n(we.requires_regeneration.regeneration_prompt),o(),!0;if(we.needs_clarification===!0||!((ge=we.changelog)!=null&&ge.trim())&&!we.requires_regeneration&&we.updated_itinerary.length===be.length){const Tt=((ye=we.assistant_message)==null?void 0:ye.trim())||"Could you clarify what you'd like to change?";return Re.current?await Re.current(Tt,{senderName:"EZY Assistant",senderId:null}):x(ir=>[...ir,{id:zn(),role:"assistant",content:Tt,timestamp:new Date,metadata:{type:"text"}}]),!0}const rt=we.updated_itinerary.map(Tt=>{const ir=be.find(qu=>qu.place_id&&Tt.place_id&&qu.place_id===Tt.place_id);return{...Tt,votes:(ir==null?void 0:ir.votes)??{up:0,down:0},comments:(ir==null?void 0:ir.comments)??[]}}),Ye=we.assistant_message||we.changelog||"Done!";if(T)return z({userMessageId:me.id,assistantMessage:Ye,changelog:we.changelog||"",venuesBefore:be,venuesAfter:rt,closureAlerts:we.closure_alerts??[],warnings:we.warnings??[],riskAudit:we.risk_audit??""}),!0;i(rt),(Te=we.closure_alerts)!=null&&Te.length&&R(we.closure_alerts);const Yt=((je=we.changelog)==null?void 0:je.trim())||"AI edit",Jt=await Y.push(rt,Yt,me.id,me.id);if(ie(null),Re.current&&g&&await Ee(rt),Re.current){const Tt=await Re.current(Ye,{senderName:"EZY Assistant",senderId:null});Tt&&Y.relink(Jt,Tt)}else x(Tt=>[...Tt,{id:zn(),role:"assistant",content:Ye,timestamp:new Date,snapshotId:Jt,metadata:{type:"itinerary_updated"}}]);return!0}catch(we){return console.error("[PlanningChatContext] modify-itinerary failed:",we),_((we==null?void 0:we.message)||"Couldn't apply your edit."),x(We=>[...We,{id:zn(),role:"assistant",content:"Something went wrong while editing your plan. Please try again.",timestamp:new Date,metadata:{type:"error"}}]),!0}finally{C(!1)}},[a,c,u,d,f,h,p,b,i,n,o,g,T,Y,Ee]),ce=m.useCallback((xe,me="ai")=>{const be=xe.trim();if(!be)return;if(me==="group"){Re.current&&Re.current(be,{messageTarget:"group"});return}if(S||y)return;if(Re.current){const Q=Re.current(be,{messageTarget:"ai"});if(_(null),a&&B.current.length>0&&c&&g){(async()=>{const ye={id:await Q??zn(),role:"user",content:be,timestamp:new Date,target:"ai"};await pe(be,ye)})();return}n(be),o();return}const Ge={id:zn(),role:"user",content:be,timestamp:new Date,target:"ai"};if(x(Q=>[...Q,Ge]),_(null),a&&B.current.length>0&&c){pe(be,Ge);return}n(be),o()},[S,y,n,o,a,c,pe,g]),le=m.useCallback(xe=>{x(me=>me.some(be=>be.id===xe.id)?me:[...me,xe])},[]),Ce=m.useCallback(xe=>{x(xe)},[]),Me=m.useCallback(()=>{x([]),_(null),z(null),R([]),ie(null),Y.reset()},[Y]),H=m.useCallback(()=>{const xe=[...w].reverse().find(me=>me.role==="user");xe&&(x(me=>{let be=-1;for(let Ge=me.length-1;Ge>=0;Ge--)if(me[Ge].role==="user"){be=Ge;break}return be>=0?me.slice(0,be):me}),ce(xe.content,"ai"))},[w,ce]),X=m.useCallback(()=>R([]),[]),ve=m.useCallback(async(xe,me)=>{if(S||y||V)return;I(!0);const be=900,Ge=Date.now();try{const Q=Y.goTo(xe);if(!Q)return;const ge=Y.history.find(We=>We.id===xe),ye=(ge==null?void 0:ge.message_id)??null,Te=O.current;let je=me?Te.findIndex(We=>We.id===me):-1;je<0&&(je=Te.findIndex(We=>We.snapshotId===xe)),je<0&&ye&&(je=Te.findIndex(We=>We.id===ye));const we=je>=0?Te.slice(je+1).map(We=>We.id):[];if(x(We=>je>=0?We.slice(0,je+1):We),i(Q),ie(null),Re.current&&g&&(await Ee(Q),P&&we.length)){const We=we.filter(rt=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(rt));if(We.length)try{await q.from("planning_messages").delete().eq("session_id",P).in("id",We)}catch(rt){console.warn("[revert] collab chat truncate failed:",rt)}}}finally{const Q=Date.now()-Ge,ge=Math.max(0,be-Q);ge>0&&await new Promise(ye=>setTimeout(ye,ge)),I(!1)}},[Y,S,y,V,i,g,Ee,P]),Ne=m.useCallback(async(xe,me)=>{if(S||y||V)return;const be=me.trim();if(!be)return;I(!0);const Ge=600,Q=Date.now();let ge=null;try{const ye=O.current,Te=ye.findIndex(Ye=>Ye.id===xe),je=Y.history.findIndex(Ye=>Ye.user_message_id===xe);let we=je>0?Y.history[je-1]:null;if(!we&&Te>0)for(let Ye=Te-1;Ye>=0;Ye--){const Ot=ye[Ye];if(Ot.role!=="assistant")continue;const Yt=Y.history.find(Jt=>Jt.message_id===Ot.id);if(Yt){we=Yt;break}}!we&&Y.history.length>0&&je!==0&&(we=Y.history[0]);const We=O.current,rt=Te>=0?We.slice(Te).map(Ye=>Ye.id):[];if(we?(Y.goTo(we.id),i(we.venues),B.current=we.venues,ie(null),R([]),Re.current&&g&&await Ee(we.venues)):ge="I couldn't find a saved version to revert to before resending. Please try a fresh edit instead.",ge)Re.current?Re.current(ge,{senderName:"EZY Assistant",senderId:null}):x(Ye=>[...Ye,{id:zn(),role:"assistant",content:ge,timestamp:new Date,metadata:{type:"error"}}]);else if(x(Ye=>{const Ot=Ye.findIndex(Yt=>Yt.id===xe);return Ot<0?Ye:Ye.slice(0,Ot)}),Re.current&&P&&rt.length){const Ye=rt.filter(Ot=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(Ot));if(Ye.length)try{await q.from("planning_messages").delete().eq("session_id",P).in("id",Ye)}catch(Ot){console.warn("[editAndResend] collab chat truncate failed:",Ot)}}}finally{const ye=Date.now()-Q,Te=Math.max(0,Ge-ye);Te>0&&await new Promise(je=>setTimeout(je,Te)),I(!1)}ge||setTimeout(()=>ce(be,"ai"),0)},[S,y,V,ce,Y,i,g,Ee,P]),Le=m.useCallback(async()=>{const xe=F;if(!xe)return;z(null),i(xe.venuesAfter),ie(null),xe.closureAlerts.length&&R(xe.closureAlerts);const me=await Y.push(xe.venuesAfter,xe.changelog||"AI edit",xe.userMe
659ssageId,xe.userMessageId);if(Re.current){g&&await Ee(xe.venuesAfter);const be=await Re.current(xe.assistantMessage,{senderName:"EZY Assistant",senderId:null});be&&Y.relink(me,be)}else x(be=>[...be,{id:zn(),role:"assistant",content:xe.assistantMessage,timestamp:new Date,snapshotId:me,metadata:{type:"itinerary_updated"}}])},[F,Y,i,g,Ee]),Qe=m.useCallback(()=>{if(!F)return;z(null);const me="Okay, I discarded that change. Want to try a different edit?";Re.current?Re.current(me,{senderName:"EZY Assistant",senderId:null}):x(be=>[...be,{id:zn(),role:"assistant",content:me,timestamp:new Date,metadata:{type:"text"}}])},[F]),_t=$.useMemo(()=>{if(!Y.history.length)return w;const xe=new Map;for(const me of Y.history)me.message_id&&xe.set(me.message_id,me.id);return w.map(me=>me.role==="assistant"&&!me.snapshotId&&xe.has(me.id)?{...me,snapshotId:xe.get(me.id)}:me)},[w,Y.history]),nt=$.useMemo(()=>({messages:_t,isAiResponding:S||te,error:k,sendMessage:ce,seedInitialMessage:G,clearChat:Me,retryLastMessage:H,appendGroupMessage:le,setMessagesFromDb:Ce,closureAlerts:j,dismissClosureAlerts:X,revertToSnapshot:ve,editAndResend:Ne,pendingPreview:F,acceptPreview:Le,rejectPreview:Qe,previewEnabled:T,setPreviewEnabled:L,isReverting:V,isModifying:y||A||E,remotePreviewOpen:E,isCollabSession:!!P,lastManualEditAt:ee,notifyManualEdit:U,_setGroupSender:xe=>{Re.current=xe},_setCollabMode:xe=>{Nt.current=xe},_setCollabSessionId:xe=>{M(xe)}}),[_t,S,te,k,ce,G,Me,H,le,Ce,j,X,ve,Ne,F,Le,Qe,T,V,y,A,E,P,ee,U]);return l.jsx(mw.Provider,{value:nt,children:e})},Lu=()=>{const e=m.useContext(mw);if(e===void 0)throw new Error("usePlanningChatContext must be used within a PlanningChatProvider");return e},OX=()=>{const e=m.useContext(mw);return{_setGroupSender:e==null?void 0:e._setGroupSender,_setCollabMode:e==null?void 0:e._setCollabMode,_setCollabSessionId:e==null?void 0:e._setCollabSessionId,appendGroupMessage:e==null?void 0:e.appendGroupMessage,setMessagesFromDb:e==null?void 0:e.setMessagesFromDb}},df=new Map,Qm=new Map,Tv=new Set;function DX(){Tv.forEach(e=>e())}async function LX(e){const t=e.filter(r=>!df.has(r)&&!Qm.has(r));if(t.length===0)return;const n=(async()=>{const{data:r}=await q.from("profiles").select("id, avatar_url").in("id",t),s=new Set;(r??[]).forEach(i=>{df.set(i.id,i.avatar_url??null),s.add(i.id)}),t.forEach(i=>{s.has(i)||df.set(i,null)}),DX()})();t.forEach(r=>Qm.set(r,n));try{await n}finally{t.forEach(r=>Qm.delete(r))}}function $X(e){const t=Array.from(new Set(e.filter(s=>!!s))),[,n]=m.useState(0);m.useEffect(()=>{const s=()=>n(i=>i+1);return Tv.add(s),()=>{Tv.delete(s)}},[]),m.useEffect(()=>{t.length!==0&&LX(t)},[t.join(",")]);const r={};return t.forEach(s=>{r[s]=df.get(s)??null}),r}const sc=e=>e.place_id||e.name,U_=e=>{if(!e||typeof e!="object")return"";const t=e.transit;return typeof t=="string"?t:t&&typeof t=="object"&&"duration"in t?String(t.duration??""):""},FX=(e,t)=>{const n=new Set;return(e.time??"")!==(t.time??"")&&n.add("time"),(e.duration_minutes??null)!==(t.duration_minutes??null)&&n.add("duration_minutes"),(e.name??"")!==(t.name??"")&&n.add("name"),(e.description??"")!==(t.description??"")&&n.add("description"),U_(e.travel_time_to_next)!==U_(t.travel_time_to_next)&&n.add("travel_to_next"),n},SR=(e,t)=>{const n=new Map,r=new Map(e.map((i,o)=>[sc(i),{v:i,i:o}])),s=new Map(t.map((i,o)=>[sc(i),{v:i,i:o}]));return e.forEach(i=>{const o=sc(i);s.has(o)||n.set(o,{kind:"removed",changedFields:new Set})}),t.forEach((i,o)=>{const a=sc(i),c=r.get(a);if(!c){n.set(a,{kind:"added",changedFields:new Set});return}const u=FX(c.v,i);if(u.size>0){n.set(a,{kind:"modified",changedFields:u});return}if(c.i!==o){n.set(a,{kind:"modified",changedFields:new Set});return}n.set(a,{kind:"unchanged",changedFields:new Set})}),{byKey:n}},zX=(e,t)=>e==null?void 0:e.byKey.get(sc(t)),BX=()=>l.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center px-6",children:[l.jsx("div",{className:"rounded-full bg-muted p-3",children:l.jsx(Na,{className:"h-6 w-6 text-muted-foreground"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"Start a conversation"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Ask me to plan your outing, add venues, or adjust the schedule."})]})]}),VX=({messages:e,isAiResponding:t,currentUserId:n,isCollaborative:r=!1,hostId:s=null})=>{var P,M;const i=m.useRef(null),{editAndResend:o,revertToSnapshot:a,isReverting:c,pendingPreview:u,acceptPreview:d,rejectPreview:f,lastManualEditAt:h}=Lu(),[p,g]=m.useState(null),v=e.map(T=>T.senderId).filter(T=>!!T),b=$X([...v,n]),y=n?b[n]??null:null;if(m.useEffect(()=>{var T;(T=i.current)==null||T.scrollIntoView({behavior:"smooth"})},[e.length,t]),e.length===0&&!t)return l.jsx(BX,{});const w=(P=e.find(T=>T.role==="user"))==null?void 0:P.id,x=(M=e[e.length-1])==null?void 0:M.id,S=new Map;let C=null;for(const T of e)T.snapshotId&&(C=T.snapshotId),T.role==="assistant"&&S.set(T.id,T.snapshotId??C);const k=(T,L)=>{g({type:"edit",messageId:T,newText:L,isSeed:T===w})},_=(T,L)=>{g({type:"revert",snapshotId:T,anchorMessageId:L})},j=p?p.type==="revert"?{title:"Revert to this version?",desc:r?"All chat messages and itinerary changes after this point will be removed for everyone in the session. This cannot be undone (you'll still see them in chat history below until refresh).":"All chat messages and itinerary changes after this point will be removed. You can still redo from here.",action:"Revert"}:p.isSeed?{title:"Restart from scratch?",desc:"Editing your initial prompt will discard the current itinerary and all chat messages, then generate a brand-new plan from your edited prompt.",action:"Start over"}:{title:"Edit and resend?",desc:r?"All chat messages and itinerary changes after this point will be removed for everyone in the session, then your edited prompt will be re-sent.":"All chat messages and itinerary changes after this point will be removed, then your edited prompt will be re-sent.",action:"Save & resend"}:null,R=T=>{var z;if(!p||!j)return null;const L=p.type==="edit"?p.messageId:p.anchorMessageId;if(L!==T)return null;const F=((z=e.find(V=>V.id===L))==null?void 0:z.role)==="user";return l.jsxs(de.div,{initial:{opacity:0,y:-4}
659,animate:{opacity:1,y:0},className:`${F?"mr-10 ml-auto":"ml-10"} -mt-1 max-w-md rounded-2xl border border-primary/40 bg-primary/10 p-3`,children:[l.jsx("p",{className:"text-xs font-semibold text-primary mb-0.5",children:j.title}),l.jsx("p",{className:"text-xs text-foreground/80 mb-2",children:j.desc}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx("button",{type:"button",onClick:()=>g(null),className:"text-xs font-medium px-3 py-1 rounded-md border border-border hover:bg-muted",children:"Cancel"}),l.jsx("button",{type:"button",onClick:()=>{p&&(p.type==="revert"?a(p.snapshotId,p.anchorMessageId):p.type==="edit"&&(p.isSeed?window.dispatchEvent(new CustomEvent("ezy:restart-from-scratch",{detail:{newPrompt:p.newText}})):o(p.messageId,p.newText)),g(null))},className:"text-xs font-medium px-3 py-1 rounded-md bg-primary text-primary-foreground hover:bg-primary/90",children:j.action})]})]})};return l.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[l.jsxs(yt,{mode:"popLayout",children:[e.map(T=>l.jsxs($.Fragment,{children:[l.jsx(jX,{message:T,currentUserId:n,canEdit:!t&&!c,canRevert:!t&&!c&&!(T.id===x&&h===null),onEdit:k,onRevert:_,effectiveSnapshotId:S.get(T.id)??null,awaitingEditConfirm:(p==null?void 0:p.type)==="edit"&&p.messageId===T.id,senderAvatarUrl:T.senderId?b[T.senderId]??null:null,currentUserAvatarUrl:y,senderIsHost:!!s&&!!T.senderId&&T.senderId===s&&T.senderId!==n}),R(T.id),u&&u.userMessageId===T.id&&(()=>{var I,A,D;const L=(I=u.assistantMessage)==null?void 0:I.trim(),F=((A=u.changelog)==null?void 0:A.trim())??"",z=F?F.split(/\s*;\s+/).map(E=>E.replace(/;$/,"").trim()).filter(Boolean):[],V=((D=u.riskAudit)==null?void 0:D.trim())??"";return l.jsxs(de.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"ml-10 -mt-1 rounded-2xl border border-primary/40 bg-primary/10 p-3 space-y-2.5",children:[l.jsx("p",{className:"text-xs font-semibold text-primary",children:"✨ Preview of AI edit"}),L&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-primary/80 mb-0.5",children:"Why"}),l.jsx("p",{className:"text-xs text-foreground/90 leading-relaxed",children:L})]}),z.length>0&&(()=>{const E=SR(u.venuesBefore,u.venuesAfter);let K=0;E.byKey.forEach(ee=>{ee.kind!=="unchanged"&&(K+=1)});const te=z.length,N=K!==te?`${K} affected venue${K===1?"":"s"} · ${te} explicit change${te===1?"":"s"}`:`${te} change${te===1?"":"s"}`;return l.jsxs("details",{className:"group",children:[l.jsxs("summary",{className:"text-[10px] font-semibold uppercase tracking-wide text-primary/80 cursor-pointer select-none flex items-center gap-1 hover:text-primary",children:[l.jsx("span",{className:"inline-block transition-transform group-open:rotate-90",children:"▶"}),"Changes (",N,")"]}),l.jsx("ul",{className:"mt-1.5 ml-4 space-y-1 list-disc text-xs text-foreground/80",children:z.map((ee,ie)=>l.jsx("li",{className:"leading-snug",children:ee},ie))})]})})(),V&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-destructive/90 mb-0.5",children:"Possible risks"}),l.jsx("p",{className:"text-xs text-foreground/90 leading-relaxed whitespace-pre-wrap",children:V})]}),l.jsxs("div",{className:"flex gap-2 pt-0.5",children:[l.jsx("button",{type:"button",onClick:d,className:"text-xs font-medium px-3 py-1 rounded-md bg-primary text-primary-foreground hover:bg-primary/90",children:"✓ Accept"}),l.jsx("button",{type:"button",onClick:f,className:"text-xs font-medium px-3 py-1 rounded-md border border-border hover:bg-muted",children:"✕ Reject"})]})]})})()]},T.id)),t&&l.jsx(EX,{},"thinking")]}),l.jsx("div",{ref:i})]})},UX=({onSend:e,disabled:t=!1,showTargetSelector:n=!1,onTypingChange:r})=>{const[s,i]=m.useState(""),[o,a]=m.useState("ai"),c=m.useRef(null),u=m.useRef(null),d=m.useCallback(()=>{const v=c.current;if(!v)return;v.style.height="auto";const b=Math.min(v.scrollHeight,120);v.style.height=`${b}px`,v.style.overflowY=v.scrollHeight>120?"auto":"hidden"},[]);m.useEffect(()=>{d()},[s,d]);const f=m.useCallback(()=>{const v=s.trim();!v||t||(e(v,n?o:"ai"),i(""),r==null||r(!1),u.current&&clearTimeout(u.current),requestAnimationFrame(()=>{c.current&&(c.current.style.height="auto")}))},[s,t,e,o,n,r]),h=v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),f())},p=v=>{i(v.target.value),r&&(r(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>r(!1),2e3))},g=n?o==="ai"?"Ask EZY to plan your outing…":"Message the group…":"Ask EZY to plan your outing…";return l.jsxs("div",{className:"sticky bottom-0 border-t border-border bg-background p-3",children:[n&&l.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[l.jsx("span",{className:"text-[10px] text-muted-foreground mr-1",children:"Send to:"}),l.jsxs("button",{type:"button",onClick:()=>a("ai"),className:`flex items-center gap-1 rounded-full px-2.5 py-1 text-[11px] font-medium transition-colors ${o==="ai"?"bg-[hsl(var(--chat-ai))] text-[hsl(var(--chat-ai-foreground))]":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[l.jsx(pN,{className:"h-3 w-3"}),"AI"]}),l.jsxs("button",{type:"button",onClick:()=>a("group"),className:`flex items-center gap-1 rounded-full px-2.5 py-1 text-[11px] font-medium transition-colors ${o==="group"?"bg-[hsl(var(--chat-group))] text-[hsl(var(--chat-group-foreground))]":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[l.jsx(Gt,{className:"h-3 w-3"}),"Group"]})]}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("textarea",{ref:c,value:s,onChange:p,onKeyDown:h,placeholder:g,disabled:t,rows:1,className:"flex-1 resize-none rounded-xl border border-input bg-background px-3 py-2.5 text-sm r
659ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"}),l.jsx(Fe,{size:"icon",onClick:f,disabled:t||!s.trim(),className:"h-10 w-10 flex-shrink-0","aria-label":"Send message",children:l.jsx(EN,{className:"h-4 w-4"})})]})]})},HX=ku("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Qa({className:e,variant:t,...n}){return l.jsx("div",{className:ae(HX({variant:t}),e),...n})}const WX=({showCollaborateCard:e=!1,onDismissCollaborate:t,onStartCollaborate:n,isAuthenticated:r,isCollaborative:s=!1,participants:i=[],currentUserId:o=null,onTypingChange:a})=>{var v;const c=Kt(),{messages:u,isAiResponding:d,sendMessage:f}=Lu(),[h,p]=m.useState("chat"),g=(b,y)=>{d||f(b,y)};return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsx("div",{className:"flex-shrink-0 border-b border-border",children:s?l.jsxs("div",{className:"flex",children:[l.jsxs("button",{onClick:()=>p("chat"),className:ae("flex-1 px-4 py-2.5 text-sm font-medium transition-colors relative",h==="chat"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:["Chat",h==="chat"&&l.jsx(de.div,{layoutId:"chat-tab-indicator",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),l.jsxs("button",{onClick:()=>p("participants"),className:ae("flex-1 px-4 py-2.5 text-sm font-medium transition-colors relative flex items-center justify-center gap-1.5",h==="participants"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:["Participants",l.jsx(Qa,{variant:"secondary",className:"text-[10px] h-4 px-1.5",children:i.length}),h==="participants"&&l.jsx(de.div,{layoutId:"chat-tab-indicator",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]})]}):l.jsxs("div",{className:"px-4 py-3",children:[l.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"EZY Assistant"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Plan your perfect outing"})]})}),!s&&l.jsx(yt,{children:e&&l.jsx(de.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"flex-shrink-0 overflow-hidden",children:l.jsx(nn,{className:"m-3 p-3 border border-primary/20 bg-primary/5 rounded-xl",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"rounded-full bg-primary/20 p-1.5",children:l.jsx(Gt,{className:"h-4 w-4 text-primary"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h3",{className:"font-medium text-xs",children:"Plan with friends"}),l.jsx("p",{className:"text-[11px] text-muted-foreground leading-tight",children:"Collaborate in real-time"})]}),l.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[l.jsx(Fe,{size:"sm",variant:"ghost",className:"text-[11px] h-7 px-2",onClick:t,children:"Dismiss"}),l.jsx(Fe,{size:"sm",className:"text-[11px] h-7 px-2",onClick:()=>{if(r===!1){c("/login",{state:{message:"Sign in to start collaborative planning",returnTo:"/new-plan"}});return}n==null||n()},children:"Start"})]})]})})})}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:h==="chat"?l.jsx(VX,{messages:u,isAiResponding:d,currentUserId:o,isCollaborative:s,hostId:((v=i.find(b=>b.role==="host"))==null?void 0:v.id)??null}):l.jsx(qX,{participants:i,currentUserId:o})}),s&&(()=>{const b=i.filter(x=>x.isTyping&&x.id!==o);if(b.length===0)return null;const y=b.map(x=>x.name),w=y.length===1?`${y[0]} is typing…`:y.length===2?`${y[0]} and ${y[1]} are typing…`:`${y[0]} and ${y.length-1} others are typing…`;return l.jsx("div",{className:"flex-shrink-0 px-4 py-1.5 border-t border-border",children:l.jsx("p",{className:"text-[11px] text-muted-foreground animate-pulse",children:w})})})(),l.jsx(UX,{onSend:g,disabled:d,showTargetSelector:s,onTypingChange:a}),d&&l.jsx("div",{className:"flex-shrink-0 px-4 py-1 border-t border-border bg-muted/40",children:l.jsx("p",{className:"text-[11px] text-muted-foreground animate-pulse",children:"Applying your last change…"})})]})},qX=({participants:e,currentUserId:t})=>e.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center px-6",children:[l.jsx("div",{className:"rounded-full bg-muted p-3",children:l.jsx(Gt,{className:"h-6 w-6 text-muted-foreground"})}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"No participants yet"})]}):l.jsx("div",{className:"p-4 space-y-2",children:e.map(n=>{const r=n.id===t,s=n.role==="host";return l.jsxs("div",{className:ae("flex items-center gap-3 rounded-lg px-3 py-2.5 transition-colors",r?"bg-primary/5 border border-primary/10":"hover:bg-muted/50"),children:[l.jsxs("div",{className:"relative",children:[s?l.jsx(x4,{className:"h-4 w-4 text-primary"}):l.jsx(Wh,{className:"h-4 w-4 text-muted-foreground"}),n.isOnline&&l.jsx(vN,{className:"absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 fill-green-500 text-green-500"})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("p",{className:"text-sm font-medium truncate",children:[n.name,r&&l.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"(you)"})]}),n.isTyping&&l.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"typing…"})]}),l.jsx(Qa,{variant:s?"default":"secondary",className:"text-[10px] h-5",children:s?"Host":"Participant"})]},n.id)})}),Zm=768;function $u(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Zm-1}px)`),r=()=>{t(window.innerWidth<Zm)};return n.addEventListener("change",r),t(window.innerWidth<Zm),()=>n.removeEventListener("change",r)},[]),!!e}const{createElement:Za,createContext:GX,createRef:bie,forwardRef:kR,useCallback:Cn,useContext:_R,useEffect:fo,useImperativeHandle:CR,useLayoutEffect:KX,useMemo:YX,useRef
659:En,useState:Da}=jh,H_=jh[`useId${Math.random()}`.slice(0,5)],JX=KX,vp=GX(null);vp.displayName="PanelGroupContext";const ho=JX,XX=typeof H_=="function"?H_:()=>null;let QX=0;function gw(e=null){const t=XX(),n=En(e||t||null);return n.current===null&&(n.current=""+QX++),e??n.current}function jR({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:u,onExpand:d,onResize:f,order:h,style:p,tagName:g="div",...v}){const b=_R(vp);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:w,getPanelSize:x,getPanelStyle:S,groupId:C,isPanelCollapsed:k,reevaluatePanelConstraints:_,registerPanel:j,resizePanel:R,unregisterPanel:P}=b,M=gw(o),T=En({callbacks:{onCollapse:u,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:a,minSize:c},id:M,idIsFromProps:o!==void 0,order:h});En({didLogMissingDefaultSizeWarning:!1}),ho(()=>{const{callbacks:F,constraints:z}=T.current,V={...z};T.current.id=M,T.current.idIsFromProps=o!==void 0,T.current.order=h,F.onCollapse=u,F.onExpand=d,F.onResize=f,z.collapsedSize=n,z.collapsible=r,z.defaultSize=s,z.maxSize=a,z.minSize=c,(V.collapsedSize!==z.collapsedSize||V.collapsible!==z.collapsible||V.maxSize!==z.maxSize||V.minSize!==z.minSize)&&_(T.current,V)}),ho(()=>{const F=T.current;return j(F),()=>{P(F)}},[h,M,j,P]),CR(i,()=>({collapse:()=>{y(T.current)},expand:F=>{w(T.current,F)},getId(){return M},getSize(){return x(T.current)},isCollapsed(){return k(T.current)},isExpanded(){return!k(T.current)},resize:F=>{R(T.current,F)}}),[y,w,x,k,M,R]);const L=S(T.current,s);return Za(g,{...v,children:e,className:t,id:o,style:{...L,...p},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":M,"data-panel-size":parseFloat(""+L.flexGrow).toFixed(1)})}const ER=kR((e,t)=>Za(jR,{...e,forwardedRef:t}));jR.displayName="Panel";ER.displayName="forwardRef(Panel)";let Pv=null,io=null;function ZX(e,t){if(t){const n=(t&RR)!==0,r=(t&MR)!==0,s=(t&IR)!==0,i=(t&OR)!==0;if(n)return s?"se-resize":i?"ne-resize":"e-resize";if(r)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function eQ(){io!==null&&(document.head.removeChild(io),Pv=null,io=null)}function eg(e,t){const n=ZX(e,t);Pv!==n&&(Pv=n,io===null&&(io=document.createElement("style"),document.head.appendChild(io)),io.innerHTML=`*{cursor: ${n}!important;}`)}function NR(e){return e.type==="keydown"}function TR(e){return e.type.startsWith("pointer")}function PR(e){return e.type.startsWith("mouse")}function xp(e){if(TR(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(PR(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function tQ(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function nQ(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function rQ(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:G_(e),b:G_(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;qe(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:q_(W_(n.a)),b:q_(W_(n.b))};if(s.a===s.b){const i=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(s.a-s.b)}const sQ=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function iQ(e){var t;const n=getComputedStyle((t=AR(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function oQ(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||iQ(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||sQ.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function W_(e){let t=e.length;for(;t--;){const n=e[t];if(qe(n,"Missing node"),oQ(n))return n}return null}function q_(e){return e&&Number(getComputedStyle(e).zIndex)||0}function G_(e){const t=[];for(;e;)t.push(e),e=AR(e);return t}function AR(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const RR=1,MR=2,IR=4,OR=8,aQ=tQ()==="coarse";let Ar=[],La=!1,ri=new Map,wp=new Map;const mu=new Set;
659function lQ(e,t,n,r,s){var i;const{ownerDocument:o}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},c=(i=ri.get(o))!==null&&i!==void 0?i:0;return ri.set(o,c+1),mu.add(a),gh(),function(){var d;wp.delete(e),mu.delete(a);const f=(d=ri.get(o))!==null&&d!==void 0?d:1;if(ri.set(o,f-1),gh(),f===1&&ri.delete(o),Ar.includes(a)){const h=Ar.indexOf(a);h>=0&&Ar.splice(h,1),vw(),s("up",!0,null)}}}function K_(e){const{target:t}=e,{x:n,y:r}=xp(e);La=!0,yw({target:t,x:n,y:r}),gh(),Ar.length>0&&(yh("down",e),e.preventDefault(),e.stopPropagation())}function $l(e){const{x:t,y:n}=xp(e);if(La&&e.buttons===0&&(La=!1,yh("up",e)),!La){const{target:r}=e;yw({target:r,x:t,y:n})}yh("move",e),vw(),Ar.length>0&&e.preventDefault()}function Ko(e){const{target:t}=e,{x:n,y:r}=xp(e);wp.clear(),La=!1,Ar.length>0&&e.preventDefault(),yh("up",e),yw({target:t,x:n,y:r}),vw(),gh()}function yw({target:e,x:t,y:n}){Ar.splice(0);let r=null;e instanceof HTMLElement&&(r=e),mu.forEach(s=>{const{element:i,hitAreaMargins:o}=s,a=i.getBoundingClientRect(),{bottom:c,left:u,right:d,top:f}=a,h=aQ?o.coarse:o.fine;if(t>=u-h&&t<=d+h&&n>=f-h&&n<=c+h){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&rQ(r,i)>0){let g=r,v=!1;for(;g&&!g.contains(i);){if(nQ(g.getBoundingClientRect(),a)){v=!0;break}g=g.parentElement}if(v)return}Ar.push(s)}})}function tg(e,t){wp.set(e,t)}function vw(){let e=!1,t=!1;Ar.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;wp.forEach(r=>{n|=r}),e&&t?eg("intersection",n):e?eg("horizontal",n):t?eg("vertical",n):eQ()}function gh(){ri.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",Ko),n.removeEventListener("pointerdown",K_),n.removeEventListener("pointerleave",$l),n.removeEventListener("pointermove",$l)}),window.removeEventListener("pointerup",Ko),window.removeEventListener("pointercancel",Ko),mu.size>0&&(La?(Ar.length>0&&ri.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",Ko),n.addEventListener("pointerleave",$l),n.addEventListener("pointermove",$l))}),window.addEventListener("pointerup",Ko),window.addEventListener("pointercancel",Ko)):ri.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",K_,{capture:!0}),n.addEventListener("pointermove",$l))}))}function yh(e,t){mu.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ar.includes(n);r(e,s,t)})}function cQ(){const[e,t]=Da(0);return Cn(()=>t(n=>n+1),[])}function qe(e,t){if(!e)throw console.error(t),Error(t)}const xw=10;function Co(e,t,n=xw){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function ps(e,t,n=xw){return Co(e,t,n)===0}function Wn(e,t,n){return Co(e,t,n)===0}function uQ(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],i=t[r];if(!Wn(s,i,n))return!1}return!0}function ba({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];qe(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:s=0,collapsible:i,maxSize:o=100,minSize:a=0}=r;if(Co(n,a)<0)if(i){const c=(s+a)/2;Co(n,c)<0?n=s:n=a}else n=a;return n=Math.min(o,n),n=parseFloat(n.toFixed(xw)),n}function ic({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if(Wn(e,0))return t;const o=[...t],[a,c]=r;qe(a!=null,"Invalid first pivot index"),qe(c!=null,"Invalid second pivot index");let u=0;if(i==="keyboard"){{const f=e<0?c:a,h=n[f];qe(h,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:g,minSize:v=0}=h;if(g){const b=t[f];if(qe(b!=null,`Previous layout not found for panel index ${f}`),Wn(b,p)){const y=v-b;Co(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}{const f=e<0?a:c,h=n[f];qe(h,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:g,minSize:v=0}=h;if(g){const b=t[f];if(qe(b!=null,`Previous layout not found for panel index ${f}`),Wn(b,v)){const y=b-p;Co(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const f=e<0?1:-1;let h=e<0?c:a,p=0;for(;;){const v=t[h];qe(v!=null,`Previous layout not found for panel index ${h}`);const y=ba({panelConstraints:n,panelIndex:h,size:100})-v;if(p+=y,h+=f,h<0||h>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let h=e<0?a:c;for(;h>=0&&h<n.length;){const p=Math.abs(e)-Math.abs(u),g=t[h];qe(g!=null,`Previous layout not found for panel index ${h}`);const v=g-p,b=ba({panelConstraints:n,panelIndex:h,size:v});if(!Wn(g,b)&&(u+=g-b,o[h]=b,u.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(uQ(s,o))return s;{const f=e<0?c:a,h=t[f];qe(h!=null,`Previous layout not found for panel index ${f}`);const p=h+u,g=ba({panelConstraints:n,panelIndex:f,size:p});if(o[f]=g,!Wn(g,p)){let v=p-g,y=e<0?c:a;for(;y>=0&&y<n.length;){const w=o[y];qe(w!=null,`Previous layout not found for panel index ${y}`);const x=w+v,S=ba({panelConstraints:n,panelIndex:y,size:x});if(Wn(w,S)||(v-=S-w,o[y]=S),Wn(v,0))break;e>0?y--:y++}}}const d=o.reduce((f,h)=>h+f,0);return Wn(d,100)?o:s}function dQ({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,o=0;const a=n[0];qe(a!=null,"No pivot index found"),t.forEach((f,h)=>{const{constraints:p}=f,{maxSize:g=100,minSize:v=0}=p;h===a?(r=v,s=g):(i+=v,o+=g)});const c=Math.min(s,100-i),u=Math.max(r,100-o),d=e[a];return{valueMax:c,valueMin:u,valueNow:d}}function gu(e,t=document){return Array.from(t.querySelectorAll(`[data-
659panel-resize-handle-id][data-panel-group-id="${e}"]`))}function DR(e,t,n=document){const s=gu(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return s??null}function LR(e,t,n){const r=DR(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function $R(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function bp(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function fQ(e,t,n,r=document){var s,i,o,a;const c=bp(t,r),u=gu(e,r),d=c?u.indexOf(c):-1,f=(s=(i=n[d])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,h=(o=(a=n[d+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[f,h]}function hQ({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:o}){En({didWarnAboutMissingResizeHandle:!1}),ho(()=>{if(!i)return;const a=gu(n,i);for(let c=0;c<s.length-1;c++){const{valueMax:u,valueMin:d,valueNow:f}=dQ({layout:r,panelsArray:s,pivotIndices:[c,c+1]}),h=a[c];if(h!=null){const p=s[c];qe(p,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(u)),h.setAttribute("aria-valuemin",""+Math.round(d)),h.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{a.forEach((c,u)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),fo(()=>{if(!i)return;const a=t.current;qe(a,"Eager values not found");const{panelDataArray:c}=a,u=$R(n,i);qe(u!=null,`No group found for id "${n}"`);const d=gu(n,i);qe(d,`No resize handles found for group id "${n}"`);const f=d.map(h=>{const p=h.getAttribute("data-panel-resize-handle-id");qe(p,"Resize handle element has no handle id attribute");const[g,v]=fQ(n,p,c,i);if(g==null||v==null)return()=>{};const b=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const w=c.findIndex(x=>x.id===g);if(w>=0){const x=c[w];qe(x,`No panel data found for index ${w}`);const S=r[w],{collapsedSize:C=0,collapsible:k,minSize:_=0}=x.constraints;if(S!=null&&k){const j=ic({delta:Wn(S,C)?_-C:C-S,initialLayout:r,panelConstraints:c.map(R=>R.constraints),pivotIndices:LR(n,p,i),prevLayout:r,trigger:"keyboard"});r!==j&&o(j)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{f.forEach(h=>h())}},[i,e,t,n,r,s,o])}function Y_(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function FR(e,t){const n=e==="horizontal",{x:r,y:s}=xp(t);return n?r:s}function pQ(e,t,n,r,s){const i=n==="horizontal",o=bp(t,s);qe(o,`No resize handle element found for id "${t}"`);const a=o.getAttribute("data-panel-group-id");qe(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=r;const u=FR(n,e),d=$R(a,s);qe(d,`No group element found for id "${a}"`);const f=d.getBoundingClientRect(),h=i?f.width:f.height;return(u-c)/h*100}function mQ(e,t,n,r,s,i){if(NR(e)){const o=n==="horizontal";let a=0;e.shiftKey?a=100:s!=null?a=s:a=10;let c=0;switch(e.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return r==null?0:pQ(e,t,n,r,i)}function gQ({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,s=100;for(let i=0;i<e.length;i++){const o=n[i];qe(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(r++,t[i]=a,s-=a)}for(let i=0;i<e.length;i++){const o=n[i];qe(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=e.length-r,u=s/c;r++,t[i]=u,s-=u}return t}function Yo(e,t,n){t.forEach((r,s)=>{const i=e[s];qe(i,`Panel data not found for index ${s}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:u=0,collapsible:d}=a,f=n[c];if(f==null||r!==f){n[c]=r;const{onCollapse:h,onExpand:p,onResize:g}=o;g&&g(r,f),d&&(h||p)&&(p&&(f==null||ps(f,u))&&!ps(r,u)&&p(),h&&(f==null||!ps(f,u))&&ps(r,u)&&h())}})}function Id(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function yQ({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:s,precision:i=3}){const o=n[s];let a;return o==null?a=e!=null?e.toPrecision(i):"1":r.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function vQ(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function J_(e){try{if(typeof localStorage<"u")e.getItem=t=>
659localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function zR(e){return`react-resizable-panels:${e}`}function BR(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=t;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function VR(e,t){try{const n=zR(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function xQ(e,t,n){var r,s;const i=(r=VR(e,n))!==null&&r!==void 0?r:{},o=BR(t);return(s=i[o])!==null&&s!==void 0?s:null}function wQ(e,t,n,r,s){var i;const o=zR(e),a=BR(t),c=(i=VR(e,s))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(o,JSON.stringify(c))}catch(u){console.error(u)}}function X_({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,o)=>i+o,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Wn(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const o=n[i];qe(o!=null,`No layout data found for index ${i}`);const a=100/r*o;n[i]=a}let s=0;for(let i=0;i<t.length;i++){const o=n[i];qe(o!=null,`No layout data found for index ${i}`);const a=ba({panelConstraints:t,panelIndex:i,size:o});o!=a&&(s+=o-a,n[i]=a)}if(!Wn(s,0))for(let i=0;i<t.length;i++){const o=n[i];qe(o!=null,`No layout data found for index ${i}`);const a=o+s,c=ba({panelConstraints:t,panelIndex:i,size:a});if(o!==c&&(s-=c-o,n[i]=c,Wn(s,0)))break}return n}const bQ=100,oc={getItem:e=>(J_(oc),oc.getItem(e)),setItem:(e,t)=>{J_(oc),oc.setItem(e,t)}},Q_={};function UR({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=oc,style:u,tagName:d="div",...f}){const h=gw(i),p=En(null),[g,v]=Da(null),[b,y]=Da([]),w=cQ(),x=En({}),S=En(new Map),C=En(0),k=En({autoSaveId:e,direction:r,dragState:g,id:h,keyboardResizeBy:a,onLayout:o,storage:c}),_=En({layout:b,panelDataArray:[],panelDataArrayChanged:!1});En({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),CR(s,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:N}=_.current;return N},setLayout:N=>{const{onLayout:ee}=k.current,{layout:ie,panelDataArray:U}=_.current,W=X_({layout:N,panelConstraints:U.map(ne=>ne.constraints)});Y_(ie,W)||(y(W),_.current.layout=W,ee&&ee(W),Yo(U,W,x.current))}}),[]),ho(()=>{k.current.autoSaveId=e,k.current.direction=r,k.current.dragState=g,k.current.id=h,k.current.onLayout=o,k.current.storage=c}),hQ({committedValuesRef:k,eagerValuesRef:_,groupId:h,layout:b,panelDataArray:_.current.panelDataArray,setLayout:y,panelGroupElement:p.current}),fo(()=>{const{panelDataArray:N}=_.current;if(e){if(b.length===0||b.length!==N.length)return;let ee=Q_[e];ee==null&&(ee=vQ(wQ,bQ),Q_[e]=ee);const ie=[...N],U=new Map(S.current);ee(e,ie,U,b,c)}},[e,b,c]),fo(()=>{});const j=Cn(N=>{const{onLayout:ee}=k.current,{layout:ie,panelDataArray:U}=_.current;if(N.constraints.collapsible){const W=U.map(se=>se.constraints),{collapsedSize:ne=0,panelSize:oe,pivotIndices:Z}=Hi(U,N,ie);if(qe(oe!=null,`Panel size not found for panel "${N.id}"`),!ps(oe,ne)){S.current.set(N.id,oe);const re=na(U,N)===U.length-1?oe-ne:ne-oe,Y=ic({delta:re,initialLayout:ie,panelConstraints:W,pivotIndices:Z,prevLayout:ie,trigger:"imperative-api"});Id(ie,Y)||(y(Y),_.current.layout=Y,ee&&ee(Y),Yo(U,Y,x.current))}}},[]),R=Cn((N,ee)=>{const{onLayout:ie}=k.current,{layout:U,panelDataArray:W}=_.current;if(N.constraints.collapsible){const ne=W.map(Ee=>Ee.constraints),{collapsedSize:oe=0,panelSize:Z=0,minSize:se=0,pivotIndices:re}=Hi(W,N,U),Y=ee??se;if(ps(Z,oe)){const Ee=S.current.get(N.id),He=Ee!=null&&Ee>=Y?Ee:Y,Nt=na(W,N)===W.length-1?Z-He:He-Z,O=ic({delta:Nt,initialLayout:U,panelConstraints:ne,pivotIndices:re,prevLayout:U,trigger:"imperative-api"});Id(U,O)||(y(O),_.current.layout=O,ie&&ie(O),Yo(W,O,x.current))}}},[]),P=Cn(N=>{const{layout:ee,panelDataArray:ie}=_.current,{panelSize:U}=Hi(ie,N,ee);return qe(U!=null,`Panel size not found for panel "${N.id}"`),U},[]),M=Cn((N,ee)=>{const{panelDataArray:ie}=_.current,U=na(ie,N);return yQ({defaultSize:ee,dragState:g,layout:b,panelData:ie,panelIndex:U})},[g,b]),T=Cn(N=>{const{layout:ee,panelDataArray:ie}=_.current,{collapsedSize:U=0,collapsible:W,panelSize:ne}=Hi(ie,N,ee);return qe(ne!=null,`Panel size not found for panel "${N.id}"`),W===!0&&ps(ne,U)},[]),L=Cn(N=>{const{layout:ee,panelDataArray:ie}=_.current,{collapsedSize:U=0,collapsible:W,panelSize:ne}=Hi(ie,N,ee);return qe(ne!=null,`Panel size not found for panel "${N.id}"`),!W||Co(ne,U)>0},[]),F=Cn(N=>{const{panelDataArray:ee}=_.current;ee.push(N),ee.sort((ie,U)=>{const W=ie.order,ne=U.order;return W==null&&ne==null?0:W==null?-1:ne==null?1:W-ne}),_.current.panelDataArrayChanged=!0,w()},[w]);ho(()=>
659{if(_.current.panelDataArrayChanged){_.current.panelDataArrayChanged=!1;const{autoSaveId:N,onLayout:ee,storage:ie}=k.current,{layout:U,panelDataArray:W}=_.current;let ne=null;if(N){const Z=xQ(N,W,ie);Z&&(S.current=new Map(Object.entries(Z.expandToSizes)),ne=Z.layout)}ne==null&&(ne=gQ({panelDataArray:W}));const oe=X_({layout:ne,panelConstraints:W.map(Z=>Z.constraints)});Y_(U,oe)||(y(oe),_.current.layout=oe,ee&&ee(oe),Yo(W,oe,x.current))}}),ho(()=>{const N=_.current;return()=>{N.layout=[]}},[]);const z=Cn(N=>function(ie){ie.preventDefault();const U=p.current;if(!U)return()=>null;const{direction:W,dragState:ne,id:oe,keyboardResizeBy:Z,onLayout:se}=k.current,{layout:re,panelDataArray:Y}=_.current,{initialLayout:Ee}=ne??{},He=LR(oe,N,U);let Re=mQ(ie,N,W,ne,Z,U);const Nt=W==="horizontal";document.dir==="rtl"&&Nt&&(Re=-Re);const O=Y.map(pe=>pe.constraints),B=ic({delta:Re,initialLayout:Ee??re,panelConstraints:O,pivotIndices:He,prevLayout:re,trigger:NR(ie)?"keyboard":"mouse-or-touch"}),G=!Id(re,B);(TR(ie)||PR(ie))&&C.current!=Re&&(C.current=Re,!G&&Re!==0?Nt?tg(N,Re<0?RR:MR):tg(N,Re<0?IR:OR):tg(N,0)),G&&(y(B),_.current.layout=B,se&&se(B),Yo(Y,B,x.current))},[]),V=Cn((N,ee)=>{const{onLayout:ie}=k.current,{layout:U,panelDataArray:W}=_.current,ne=W.map(Ee=>Ee.constraints),{panelSize:oe,pivotIndices:Z}=Hi(W,N,U);qe(oe!=null,`Panel size not found for panel "${N.id}"`);const re=na(W,N)===W.length-1?oe-ee:ee-oe,Y=ic({delta:re,initialLayout:U,panelConstraints:ne,pivotIndices:Z,prevLayout:U,trigger:"imperative-api"});Id(U,Y)||(y(Y),_.current.layout=Y,ie&&ie(Y),Yo(W,Y,x.current))},[]),I=Cn((N,ee)=>{const{layout:ie,panelDataArray:U}=_.current,{collapsedSize:W=0,collapsible:ne}=ee,{collapsedSize:oe=0,collapsible:Z,maxSize:se=100,minSize:re=0}=N.constraints,{panelSize:Y}=Hi(U,N,ie);Y!=null&&(ne&&Z&&ps(Y,W)?ps(W,oe)||V(N,oe):Y<re?V(N,re):Y>se&&V(N,se))},[V]),A=Cn((N,ee)=>{const{direction:ie}=k.current,{layout:U}=_.current;if(!p.current)return;const W=bp(N,p.current);qe(W,`Drag handle element not found for id "${N}"`);const ne=FR(ie,ee);v({dragHandleId:N,dragHandleRect:W.getBoundingClientRect(),initialCursorPosition:ne,initialLayout:U})},[]),D=Cn(()=>{v(null)},[]),E=Cn(N=>{const{panelDataArray:ee}=_.current,ie=na(ee,N);ie>=0&&(ee.splice(ie,1),delete x.current[N.id],_.current.panelDataArrayChanged=!0,w())},[w]),K=YX(()=>({collapsePanel:j,direction:r,dragState:g,expandPanel:R,getPanelSize:P,getPanelStyle:M,groupId:h,isPanelCollapsed:T,isPanelExpanded:L,reevaluatePanelConstraints:I,registerPanel:F,registerResizeHandle:z,resizePanel:V,startDragging:A,stopDragging:D,unregisterPanel:E,panelGroupElement:p.current}),[j,g,r,R,P,M,h,T,L,I,F,z,V,A,D,E]),te={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Za(vp.Provider,{value:K},Za(d,{...f,children:t,className:n,id:i,ref:p,style:{...te,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const HR=kR((e,t)=>Za(UR,{...e,forwardedRef:t}));UR.displayName="PanelGroup";HR.displayName="forwardRef(PanelGroup)";function na(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Hi(e,t,n){const r=na(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],o=n[r];return{...t.constraints,panelSize:o,pivotIndices:i}}function SQ({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){fo(()=>{if(e||n==null||r==null)return;const s=bp(t,r);if(s==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=s.getAttribute("data-panel-group-id");qe(a,`No group element found for id "${a}"`);const c=gu(a,r),u=DR(a,t,r);qe(u!==null,`No resize element found for id "${t}"`);const d=o.shiftKey?u>0?u-1:c.length-1:u+1<c.length?u+1:0;c[d].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function WR({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:o,onFocus:a,style:c={},tabIndex:u=0,tagName:d="div",...f}){var h,p;const g=En(null),v=En({onDragging:o});fo(()=>{v.current.onDragging=o});const b=_R(vp);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:w,registerResizeHandle:x,startDragging:S,stopDragging:C,panelGroupElement:k}=b,_=gw(s),[j,R]=Da("inactive"),[P,M]=Da(!1),[T,L]=Da(null),F=En({state:j});ho(()=>{F.current.state=j}),fo(()=>
659{if(n)L(null);else{const A=x(_);L(()=>A)}},[n,_,x]);const z=(h=r==null?void 0:r.coarse)!==null&&h!==void 0?h:15,V=(p=r==null?void 0:r.fine)!==null&&p!==void 0?p:5;return fo(()=>{if(n||T==null)return;const A=g.current;return qe(A,"Element ref not attached"),lQ(_,A,y,{coarse:z,fine:V},(E,K,te)=>{if(K)switch(E){case"down":{R("drag"),qe(te,'Expected event to be defined for "down" action'),S(_,te);const{onDragging:N}=v.current;N&&N(!0);break}case"move":{const{state:N}=F.current;N!=="drag"&&R("hover"),qe(te,'Expected event to be defined for "move" action'),T(te);break}case"up":{R("hover"),C();const{onDragging:N}=v.current;N&&N(!1);break}}else R("inactive")})},[z,y,n,V,x,_,T,S,C]),SQ({disabled:n,handleId:_,resizeHandler:T,panelGroupElement:k}),Za(d,{...f,children:e,className:t,id:s,onBlur:()=>{M(!1),i==null||i()},onFocus:()=>{M(!0),a==null||a()},ref:g,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:u,"data-panel-group-direction":y,"data-panel-group-id":w,"data-resize-handle":"","data-resize-handle-active":j==="drag"?"pointer":P?"keyboard":void 0,"data-resize-handle-state":j,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}WR.displayName="PanelResizeHandle";const kQ=({className:e,...t})=>l.jsx(HR,{className:ae("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),Z_=ER,_Q=({withHandle:e,className:t,...n})=>l.jsx(WR,{className:ae("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&l.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:l.jsx(S4,{className:"h-2.5 w-2.5"})})});var ww="Dialog",[qR,GR]=Bs(ww),[CQ,$r]=qR(ww),KR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=m.useRef(null),c=m.useRef(null),[u=!1,d]=Ro({prop:r,defaultProp:s,onChange:i});return l.jsx(CQ,{scope:t,triggerRef:a,contentRef:c,contentId:Ts(),titleId:Ts(),descriptionId:Ts(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};KR.displayName=ww;var YR="DialogTrigger",JR=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=$r(YR,n),i=vt(t,s.triggerRef);return l.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":kw(s.open),...r,ref:i,onClick:Ae(e.onClick,s.onOpenToggle)})});JR.displayName=YR;var bw="DialogPortal",[jQ,XR]=qR(bw,{forceMount:void 0}),QR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=$r(bw,t);return l.jsx(jQ,{scope:t,forceMount:n,children:m.Children.map(r,o=>l.jsx(sr,{present:n||i.open,children:l.jsx(Au,{asChild:!0,container:s,children:o})}))})};QR.displayName=bw;var vh="DialogOverlay",ZR=m.forwardRef((e,t)=>{const n=XR(vh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=$r(vh,e.__scopeDialog);return i.modal?l.jsx(sr,{present:r||i.open,children:l.jsx(EQ,{...s,ref:t})}):null});ZR.displayName=vh;var EQ=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=$r(vh,n);return l.jsx(dp,{as:_i,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(Je.div,{"data-state":kw(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),jo="DialogContent",eM=m.forwardRef((e,t)=>{const n=XR(jo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=$r(jo,e.__scopeDialog);return l.jsx(sr,{present:r||i.open,children:i.modal?l.jsx(NQ,{...s,ref:t}):l.jsx(TQ,{...s,ref:t})})});eM.displayName=jo;var NQ=m.forwardRef((e,t)=>{const n=$r(jo,e.__scopeDialog),r=m.useRef(null),s=vt(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return V0(i)},[]),l.jsx(tM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,i=>i.preventDefault())})}),TQ=m.forwardRef((e,t)=>
vendor: 7,002 bytes, lines 659-665
659{const n=$r(jo,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return l.jsx(tM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),tM=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=$r(jo,n),c=m.useRef(null),u=vt(t,c);return P0(),l.jsxs(l.Fragment,{children:[l.jsx(rp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Tu,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":kw(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(AQ,{titleId:a.titleId}),l.jsx(MQ,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Sw="DialogTitle",nM=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=$r(Sw,n);return l.jsx(Je.h2,{id:s.titleId,...r,ref:t})});nM.displayName=Sw;var rM="DialogDescription",sM=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=$r(rM,n);return l.jsx(Je.p,{id:s.descriptionId,...r,ref:t})});sM.displayName=rM;var iM="DialogClose",oM=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=$r(iM,n);return l.jsx(Je.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});oM.displayName=iM;function kw(e){return e?"open":"closed"}var aM="DialogTitleWarning",[PQ,lM]=_U(aM,{contentName:jo,titleName:Sw,docsSlug:"dialog"}),AQ=({titleId:e})=>{const t=lM(aM),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
660
661If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
662
663For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},RQ="DialogDescriptionWarning",MQ=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${lM(RQ).contentName}}.`;return m.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_w=KR,cM=JR,Cw=QR,Sp=ZR,kp=eM,_p=nM,Cp=sM,jp=oM;function IQ(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const uM=$.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),xl=()=>{const e=$.useContext(uM);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};IQ(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
664[data-state=closed]
665){opacity:0}
665[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const OQ=24,DQ=typeof window<"u"?m.useLayoutEffect:m.useEffect;function eC(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function LQ(){return jw(/^Mac/)}function $Q(){return jw(/^iPhone/)}function tC(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function FQ(){return jw(/^iPad/)||LQ()&&navigator.maxTouchPoints>1}function dM(){return $Q()||FQ()}function jw(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const ng=typeof document<"u"&&window.visualViewport;function nC(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function fM(e){for(nC(e)&&(e=e.parentElement);e&&!nC(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const zQ=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Od=0,rg;function BQ(e={}){let{isDisabled:t}=e;DQ(()=>{if(!t)return Od++,Od===1&&dM()&&(rg=VQ()),()=>{Od--,Od===0&&(rg==null||rg())}},[t])}function VQ(){let e,t=0,n=f=>{e=fM(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},r=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let h=f.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&h>t||p>=g&&h<t)&&f.preventDefault(),t=h)},s=f=>{let h=f.target;Av(h)&&h!==document.activeElement&&(f.preventDefault(),h.style.transform="translateY(-2000px)",h.focus(),requestAnimationFrame(()=>{h.style.transform=""}))},i=f=>{let h=f.target;Av(h)&&(h.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{h.style.transform="",ng&&(ng.height<window.innerHeight?requestAnimationFrame(()=>{rC(h)}):ng.addEventListener("resize",()=>rC(h),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,u=eC(UQ(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=eC(Fl(document,"touchstart",n,{passive:!1,capture:!0}),Fl(document,"touchmove",r,{passive:!1,capture:!0}),Fl(document,"touchend",s,{passive:!1,capture:!0}),Fl(document,"focus",i,!0),Fl(window,"scroll",o));return()=>{u(),d(),window.scrollTo(a,c)}}function UQ(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Fl(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function rC(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=fM(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,s=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const o=n.getBoundingClientRect().bottom+OQ;i>o&&(n.scrollTop+=s-r)}e=n.parentElement}}function Av(e){return e instanceof HTMLInputElement&&!zQ.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function HQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function WQ(...e){return t=>e.forEach(n=>HQ(n,t))}function hM(...e){return m.useCallback(WQ(...e),e)}const pM=new WeakMap;function zt(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([s,i])=>{if(s.startsWith("--")){e.style.setProperty(s,i);return}r[s]=e.style[s],e.style[s]=i}),!n&&pM.set(e,r)}function qQ(e,t){if(!e||!(e instanceof HTMLElement))return;let n=pM.get(e);n&&(e.style[t]=n[t])}const Bt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Dd(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Bt(t)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Bt(t)?5:4]):null)}function GQ(e){return 8*(Math.log(e+1)-2)}function sg(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function KQ(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const xt={DURATION:.5,EASE:[.32,.72,0,1]},mM=.4,YQ=.25,JQ=100,gM=8,Wi=16,Rv=26,ig="vaul-dragging";function yM(e){const t=$.useRef(e);return $.useEffect(()=>{t.current=e}),$.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function XQ({defaultProp:e,onChange:t}){const n=$.useState(e),[r]=n,s=$.useRef(r),i=yM(t);return $.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function vM({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=XQ({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,a=yM(n),c=$.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else s(u)},[i,e,s,a]);return[o,c]}function QQ({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:a="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=vM({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[h,p]=$.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);$.useEffect(()=>{function _(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const g=$.useMemo(()=>d===(n==null?void 0:n[n.length-1])||null,[n,d]),v=$.useMemo(()=>n==null?void 0:n.findIndex(_=>_===d),[n,d]),b=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===d||!n,y=$.useMemo(()=>{const _=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var j;return(j=n==null?void 0:n.map(R=>
665{const P=typeof R=="string";let M=0;if(P&&(M=parseInt(R,10)),Bt(a)){const L=P?M:h?R*_.height:0;return h?a==="bottom"?_.height-L:-_.height+L:L}const T=P?M:h?R*_.width:0;return h?a==="right"?_.width-T:-_.width+T:T}))!=null?j:[]},[n,h,c]),w=$.useMemo(()=>v!==null?y==null?void 0:y[v]:null,[y,v]),x=$.useCallback(_=>{var j;const R=(j=y==null?void 0:y.findIndex(P=>P===_))!=null?j:null;o(R),zt(r.current,{transition:`transform ${xt.DURATION}s cubic-bezier(${xt.EASE.join(",")})`,transform:Bt(a)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`}),y&&R!==y.length-1&&R!==i&&R<i?zt(s.current,{transition:`opacity ${xt.DURATION}s cubic-bezier(${xt.EASE.join(",")})`,opacity:"0"}):zt(s.current,{transition:`opacity ${xt.DURATION}s cubic-bezier(${xt.EASE.join(",")})`,opacity:"1"}),f(n==null?void 0:n[Math.max(R,0)])},[r.current,n,y,i,s,f]);$.useEffect(()=>{if(d||e){var _;const j=(_=n==null?void 0:n.findIndex(R=>R===e||R===d))!=null?_:-1;y&&j!==-1&&typeof y[j]=="number"&&x(y[j])}},[d,e,n,y,x]);function S({draggedDistance:_,closeDrawer:j,velocity:R,dismissible:P}){if(i===void 0)return;const M=a==="bottom"||a==="right"?(w??0)-_:(w??0)+_,T=v===i-1,L=v===0,F=_>0;if(T&&zt(s.current,{transition:`opacity ${xt.DURATION}s cubic-bezier(${xt.EASE.join(",")})`}),!u&&R>2&&!F){P?j():x(y[0]);return}if(!u&&R>2&&F&&y&&n){x(y[n.length-1]);return}const z=y==null?void 0:y.reduce((I,A)=>typeof I!="number"||typeof A!="number"?I:Math.abs(A-M)<Math.abs(I-M)?A:I),V=Bt(a)?window.innerHeight:window.innerWidth;if(R>mM&&Math.abs(_)<V*.4){const I=F?1:-1;if(I>0&&g){x(y[n.length-1]);return}if(L&&I<0&&P&&j(),v===null)return;x(y[v+I]);return}x(z)}function C({draggedDistance:_}){if(w===null)return;const j=a==="bottom"||a==="right"?w-_:w+_;(a==="bottom"||a==="right")&&j<y[y.length-1]||(a==="top"||a==="left")&&j>y[y.length-1]||zt(r.current,{transform:Bt(a)?`translate3d(0, ${j}px, 0)`:`translate3d(${j}px, 0, 0)`})}function k(_,j){if(!n||typeof v!="number"||!y||i===void 0)return null;const R=v===i-1;if(v>=i&&j)return 0;if(R&&!j)return 1;if(!b&&!R)return null;const M=R?v+1:v-1,T=R?y[M]-y[M-1]:y[M+1]-y[M],L=_/Math.abs(T);return R?1-L:L}return{isLastSnapPoint:g,activeSnapPoint:d,shouldFade:b,getPercentageDragged:k,setActiveSnapPoint:f,activeSnapPointIndex:v,onRelease:S,onDrag:C,snapPointsOffset:y}}const ZQ=()=>()=>{};function eZ(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=xl(),i=$.useRef(null),o=m.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-Rv)/window.innerWidth}$.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;KQ(r&&!s?sg(document.body,{background:"black"}):ZQ,sg(c,{transformOrigin:Bt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${xt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${xt.EASE.join(",")})`}));const u=sg(c,{borderRadius:`${gM}px`,overflow:"hidden",...Bt(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},xt.DURATION*1e3)}}},[t,n,o])}let zl=null;function tZ({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[o,a]=$.useState(()=>typeof window<"u"?window.location.href:""),c=$.useRef(0),u=$.useCallback(()=>{if(tC()&&zl===null&&e&&!i){zl={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:h}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=h-window.innerHeight;p&&c.current>=h&&(document.body.style.top=`${-(c.current+p)}px`)}),300)}},[e]),d=$.useCallback(()=>
665{if(tC()&&zl!==null&&!i){const f=-parseInt(document.body.style.top,10),h=-parseInt(document.body.style.left,10);Object.assign(document.body.style,zl),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){a(window.location.href);return}window.scrollTo(h,f)}),zl=null}},[o]);return $.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),$.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,o,t,n,u,d]),{restorePositionSetting:d}}function xM({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:a=!0,closeThreshold:c=YQ,scrollLockTimeout:u=JQ,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:h=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:v,modal:b=!0,onClose:y,nested:w,noBodyStyles:x,direction:S="bottom",defaultOpen:C=!1,disablePreventScroll:k=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:j=!1,repositionInputs:R=!0,onAnimationEnd:P,container:M,autoFocus:T=!1}){var L,F;const[z=!1,V]=vM({defaultProp:C,prop:e,onChange:Q=>{t==null||t(Q),!Q&&!w&&H(),setTimeout(()=>{P==null||P(Q)},xt.DURATION*1e3),Q&&!b&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Q||(document.body.style.pointerEvents="auto")}}),[I,A]=$.useState(!1),[D,E]=$.useState(!1),[K,te]=$.useState(!1),N=$.useRef(null),ee=$.useRef(null),ie=$.useRef(null),U=$.useRef(null),W=$.useRef(null),ne=$.useRef(!1),oe=$.useRef(null),Z=$.useRef(0),se=$.useRef(!1),re=$.useRef(0),Y=$.useRef(null),Ee=$.useRef(((L=Y.current)==null?void 0:L.getBoundingClientRect().height)||0),He=$.useRef(((F=Y.current)==null?void 0:F.getBoundingClientRect().width)||0),Re=$.useRef(0),Nt=$.useCallback(Q=>{i&&Q===ce.length-1&&(ee.current=new Date)},[]),{activeSnapPoint:O,activeSnapPointIndex:B,setActiveSnapPoint:G,onRelease:pe,snapPointsOffset:ce,onDrag:le,shouldFade:Ce,getPercentageDragged:Me}=QQ({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:Y,fadeFromIndex:h,overlayRef:N,onSnapPointChange:Nt,direction:S,container:M,snapToSequentialPoint:_});BQ({isDisabled:!z||D||!b||K||!I||!R||!k});const{restorePositionSetting:H}=tZ({isOpen:z,modal:b,nested:w,hasBeenOpened:I,preventScrollRestoration:j,noBodyStyles:x});function X(){return(window.innerWidth-Rv)/window.innerWidth}function ve(Q){var ge,ye;!d&&!i||Y.current&&!Y.current.contains(Q.target)||(Ee.current=((ge=Y.current)==null?void 0:ge.getBoundingClientRect().height)||0,He.current=((ye=Y.current)==null?void 0:ye.getBoundingClientRect().width)||0,E(!0),ie.current=new Date,dM()&&window.addEventListener("touchend",()=>ne.current=!1,{once:!0}),Q.target.setPointerCapture(Q.pointerId),Z.current=Bt(S)?Q.pageY:Q.pageX)}function Ne(Q,ge){var ye,Te;let je=Q;const we=(ye=window.getSelection())==null?void 0:ye.toString(),We=Y.current?Dd(Y.current,S):null,rt=new Date;if(je.hasAttribute("data-vaul-no-drag")||je.closest("[data-vaul-no-drag]"))return!1;if(S==="right"||S==="left")return!0;if(ee.current&&rt.getTime()-ee.current.getTime()<500)return!1;if(We!==null&&(S==="bottom"?We>0:We<0))return!0;if(we&&we.length>0)return!1;if(rt.getTime()-((Te=W.current)==null?void 0:Te.getTime())<u&&We===0||ge)return W.current=rt,!1;for(;je;){if(je.scrollHeight>je.clientHeight){if(je.scrollTop!==0)return W.current=new Date,!1;if(je.getAttribute("role")==="dialog")return!0}je=je.parentNode}return!0}function Le(Q){if(Y.current&&D){const ge=S==="bottom"||S==="right"?1:-1,ye=(Z.current-(Bt(S)?Q.pageY:Q.pageX))*ge,Te=ye>0,je=i&&!d&&!Te;if(je&&B===0)return;const we=Math.abs(ye),We=document.querySelector("[data-vaul-drawer-wrapper]"),rt=S==="bottom"||S==="top"?Ee.current:He.current;let Ye=we/rt;const Ot=Me(we,Te);if(Ot!==null&&(Ye=Ot),je&&Ye>=1||!ne.current&&!Ne(Q.target,Te))return;if(Y.current.classList.add(ig),ne.current=!0,zt(Y.current,{transition:"none"}),zt(N.current,{transition:"none"}),i&&le({draggedDistance:ye}),Te&&!i){const Jt=GQ(ye),Tt=Math.min(Jt*-1,0)*ge;zt(Y.current,{transform:Bt(S)?`translate3d(0, ${Tt}px, 0)`:`translate3d(${Tt}px, 0, 0)`});return}const Yt=1-Ye;if((Ce||h&&B===h-1)&&(r==null||r(Q,Ye),zt(N.current,{opacity:`${Yt}`,transition:"none"},!0)),We&&N.current&&o){const Jt=Math.min(X()+Ye*(1-X()),1),Tt=8-Ye*8,ir=Math.max(0,14-Ye*14);zt(We,{borderRadius:`${Tt}px`,transform:Bt(S)?`scale(${Jt}) translate3d(0, ${ir}px, 0)`:`scale(${Jt}) translate3d(${ir}px, 0, 0)`,transition:"none"},!0)}if(!i){const Jt=we*ge;zt(Y.current,{transform:Bt(S)?`translate3d(0, ${Jt}px, 0)`:`translate3d(${Jt}px, 0, 0)`})}}}$.useEffect(()=>{var Q;function ge(){if(!Y.current||!R)return;const ye=document.activeElement;if(Av(ye)||se.current){var Te;
665const je=((Te=window.visualViewport)==null?void 0:Te.height)||0,we=window.innerHeight;let We=we-je;const rt=Y.current.getBoundingClientRect().height||0,Ye=rt>we*.8;Re.current||(Re.current=rt);const Ot=Y.current.getBoundingClientRect().top;if(Math.abs(re.current-We)>60&&(se.current=!se.current),i&&i.length>0&&ce&&B){const Yt=ce[B]||0;We+=Yt}if(re.current=We,rt>je||se.current){const Yt=Y.current.getBoundingClientRect().height;let Jt=Yt;Yt>je&&(Jt=je-(Ye?Ot:Rv)),v?Y.current.style.height=`${Yt-Math.max(We,0)}px`:Y.current.style.height=`${Math.max(Jt,je-Ot)}px`}else Y.current.style.height=`${Re.current}px`;i&&i.length>0&&!se.current?Y.current.style.bottom="0px":Y.current.style.bottom=`${Math.max(We,0)}px`}}return(Q=window.visualViewport)==null||Q.addEventListener("resize",ge),()=>{var ye;return(ye=window.visualViewport)==null?void 0:ye.removeEventListener("resize",ge)}},[B,i,ce]);function Qe(Q){nt(),y==null||y(),Q||V(!1),setTimeout(()=>{i&&G(i[0])},xt.DURATION*1e3)}function _t(){if(!Y.current)return;const Q=document.querySelector("[data-vaul-drawer-wrapper]"),ge=Dd(Y.current,S);zt(Y.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${xt.DURATION}s cubic-bezier(${xt.EASE.join(",")})`}),zt(N.current,{transition:`opacity ${xt.DURATION}s cubic-bezier(${xt.EASE.join(",")})`,opacity:"1"}),o&&ge&&ge>0&&z&&zt(Q,{borderRadius:`${gM}px`,overflow:"hidden",...Bt(S)?{transform:`scale(${X()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${X()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${xt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${xt.EASE.join(",")})`},!0)}function nt(){!D||!Y.current||(Y.current.classList.remove(ig),ne.current=!1,E(!1),U.current=new Date)}function xe(Q){if(!D||!Y.current)return;Y.current.classList.remove(ig),ne.current=!1,E(!1),U.current=new Date;const ge=Dd(Y.current,S);
665if(!Ne(Q.target,!1)||!ge||Number.isNaN(ge)||ie.current===null)return;const ye=U.current.getTime()-ie.current.getTime(),Te=Z.current-(Bt(S)?Q.pageY:Q.pageX),je=Math.abs(Te)/ye;if(je>.05&&(te(!0),setTimeout(()=>{te(!1)},200)),i){pe({draggedDistance:Te*(S==="bottom"||S==="right"?1:-1),closeDrawer:Qe,velocity:je,dismissible:d}),s==null||s(Q,!0);return}if(S==="bottom"||S==="right"?Te>0:Te<0){_t(),s==null||s(Q,!0);return}if(je>mM){Qe(),s==null||s(Q,!1);return}var we;const We=Math.min((we=Y.current.getBoundingClientRect().height)!=null?we:0,window.innerHeight);var rt;const Ye=Math.min((rt=Y.current.getBoundingClientRect().width)!=null?rt:0,window.innerWidth),Ot=S==="left"||S==="right";if(Math.abs(ge)>=(Ot?Ye:We)*c){Qe(),s==null||s(Q,!1);return}s==null||s(Q,!0),_t()}$.useEffect(()=>(z&&(zt(document.documentElement,{scrollBehavior:"auto"}),ee.current=new Date),()=>{qQ(document.documentElement,"scrollBehavior")}),[z]);function me(Q){const ge=Q?(window.innerWidth-Wi)/window.innerWidth:1,ye=Q?-Wi:0;oe.current&&window.clearTimeout(oe.current),zt(Y.current,{transition:`transform ${xt.DURATION}s cubic-bezier(${xt.EASE.join(",")})`,transform:`scale(${ge}) translate3d(0, ${ye}px, 0)`}),!Q&&Y.current&&(oe.current=setTimeout(()=>{const Te=Dd(Y.current,S);zt(Y.current,{transition:"none",transform:Bt(S)?`translate3d(0, ${Te}px, 0)`:`translate3d(${Te}px, 0, 0)`})},500))}function be(Q,ge){if(ge<0)return;const ye=(window.innerWidth-Wi)/window.innerWidth,Te=ye+ge*(1-ye),je=-Wi+ge*Wi;zt(Y.current,{transform:Bt(S)?`scale(${Te}) translate3d(0, ${je}px, 0)`:`scale(${Te}) translate3d(${je}px, 0, 0)`,transition:"none"})}function Ge(Q,ge){const ye=Bt(S)?window.innerHeight:window.innerWidth,Te=ge?(ye-Wi)/ye:1,je=ge?-Wi:0;ge&&zt(Y.current,{transition:`transform ${xt.DURATION}s cubic-bezier(${xt.EASE.join(",")})`,transform:Bt(S)?`scale(${Te}) translate3d(0, ${je}px, 0)`:`scale(${Te}) translate3d(${je}px, 0, 0)`})}return $.createElement(_w,{defaultOpen:C,onOpenChange:Q=>{!d&&!Q||(Q?A(!0):Qe(!0),V(Q))},open:z},$.createElement(uM.Provider,{value:{activeSnapPoint:O,snapPoints:i,setActiveSnapPoint:G,drawerRef:Y,overlayRef:N,onOpenChange:t,onPress:ve,onRelease:xe,onDrag:Le,dismissible:d,handleOnly:f,isOpen:z,isDragging:D,shouldFade:Ce,closeDrawer:Qe,onNestedDrag:be,onNestedOpenChange:me,onNestedRelease:Ge,keyboardIsOpen:se,modal:b,snapPointsOffset:ce,direction:S,shouldScaleBackground:o,setBackgroundColorOnScale:a,noBodyStyles:x,container:M,autoFocus:T}},n))}const wM=$.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:o,modal:a}=xl(),c=hM(t,n),u=r&&r.length>0;return a?$.createElement(Sp,{onMouseUp:s,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":o&&u?"true":"false","data-vaul-snap-points-overlay":o&&i?"true":"false",...e}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});wM.displayName="Drawer.Overlay";const bM=$.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},s){const{drawerRef:i,onPress:o,onRelease:a,onDrag:c,keyboardIsOpen:u,snapPointsOffset:d,modal:f,isOpen:h,direction:p,snapPoints:g,container:v,handleOnly:b,autoFocus:y}=xl(),[w,x]=$.useState(!1),S=hM(s,i),C=$.useRef(null),k=$.useRef(null),_=$.useRef(!1),j=g&&g.length>0;eZ();
665const R=(M,T,L=0)=>{if(_.current)return!0;const F=Math.abs(M.y),z=Math.abs(M.x),V=z>F,I=["bottom","right"].includes(T)?1:-1;if(T==="left"||T==="right"){if(!(M.x*I<0)&&z>=0&&z<=L)return V}else if(!(M.y*I<0)&&F>=0&&F<=L)return!V;return _.current=!0,!0};$.useEffect(()=>{j&&window.requestAnimationFrame(()=>{x(!0)})},[]);function P(M){C.current=null,_.current=!1,a(M)}return $.createElement(kp,{"data-vaul-drawer-direction":p,"data-vaul-drawer":"","data-vaul-delayed-snap-points":w?"true":"false","data-vaul-snap-points":h&&j?"true":"false","data-vaul-custom-container":v?"true":"false",...r,ref:S,style:d&&d.length>0?{"--snap-point-height":`${d[0]}px`,...t}:t,onPointerDown:M=>{b||(r.onPointerDown==null||r.onPointerDown.call(r,M),C.current={x:M.pageX,y:M.pageY},o(M))},onOpenAutoFocus:M=>{n==null||n(M),y||M.preventDefault()},onPointerDownOutside:M=>{if(e==null||e(M),!f||M.defaultPrevented){M.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:M=>{if(!f){M.preventDefault();return}},onPointerMove:M=>{if(k.current=M,b||(r.onPointerMove==null||r.onPointerMove.call(r,M),!C.current))return;const T=M.pageY-C.current.y,L=M.pageX-C.current.x,F=M.pointerType==="touch"?10:2;R({x:L,y:T},p,F)?c(M):(Math.abs(L)>F||Math.abs(T)>F)&&(C.current=null)},onPointerUp:M=>{r.onPointerUp==null||r.onPointerUp.call(r,M),C.current=null,_.current=!1,a(M)},onPointerOut:M=>{r.onPointerOut==null||r.onPointerOut.call(r,M),P(k.current)},onContextMenu:M=>{r.onContextMenu==null||r.onContextMenu.call(r,M),P(k.current)}})});bM.displayName="Drawer.Content";const nZ=250,rZ=120,SM=$.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:s,isDragging:i,snapPoints:o,activeSnapPoint:a,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:h,onDrag:p}=xl(),g=$.useRef(null),v=$.useRef(!1);function b(){if(v.current){x();return}window.setTimeout(()=>{y()},rZ)}function y(){if(i||e||v.current){x();return}if(x(),(!o||o.length===0)&&u){s();return}if(a===o[o.length-1]&&u){s();return}const C=o.findIndex(_=>_===a);if(C===-1)return;const k=o[C+1];c(k)}function w(){g.current=window.setTimeout(()=>{v.current=!0},nZ)}function x(){window.clearTimeout(g.current),v.current=!1}return $.createElement("div",{onClick:b,onPointerCancel:x,onPointerDown:S=>{d&&h(S),w()},onPointerMove:S=>{d&&p(S)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},$.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});SM.displayName="Drawer.Handle";function sZ({onDrag:e,onOpenChange:t,...n}){const{onNestedDrag:r,onNestedOpenChange:s,onNestedRelease:i}=xl();if(!r)throw new Error("Drawer.NestedRoot must be placed in another drawer");return $.createElement(xM,{nested:!0,onClose:()=>{s(!1)},onDrag:(o,a)=>{r(o,a),e==null||e(o,a)},onOpenChange:o=>{o&&s(o)},onRelease:i,...n})}function iZ(e){const t=xl(),{container:n=t.container,...r}=e;return $.createElement(Cw,{container:n,...r})}const Vs={Root:xM,NestedRoot:sZ,Content:bM,Overlay:wM,Trigger:cM,Portal:iZ,Handle:SM,Close:jp,Title:_p,Description:Cp},kM=({shouldScaleBackground:e=!0,...t})=>l.jsx(Vs.Root,{shouldScaleBackground:e,...t});kM.displayName="Drawer";const oZ=Vs.Portal,_M=m.forwardRef(({className:e,...t},n)=>l.jsx(Vs.Overlay,{ref:n,className:ae("fixed inset-0 z-50 bg-black/80",e),...t}));_M.displayName=Vs.Overlay.displayName;const CM=m.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(oZ,{children:[l.jsx(_M,{}),l.jsxs(Vs.Content,{ref:r,className:ae("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[l.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));CM.displayName="DrawerContent";const aZ=m.forwardRef(({className:e,...t},n)=>l.jsx(Vs.Title,{ref:n,className:ae("text-lg font-semibold leading-none tracking-tight",e),...t}));aZ.displayName=Vs.Title.displayName;const lZ=m.forwardRef(({className:e,...t},n)=>l.jsx(Vs.Description,{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));lZ.displayName=Vs.Description.displayName;const cZ=({onClick:e,unreadCount:t=0,isPulsing:n=!1})=>l.jsxs("div",{className:"fixed bottom-6 right-6 z-40",children:[l.jsx(yt,{children:n&&l.jsx(de.span,{className:"absolute inset-0 rounded-full bg-primary/30",initial:{scale:1,op
665acity:.6},animate:{scale:1.6,opacity:0},transition:{duration:1.4,repeat:1/0,ease:"easeOut"}})}),l.jsx(Fe,{size:"icon",onClick:e,className:"relative h-14 w-14 rounded-full shadow-lg shadow-primary/25","aria-label":"Open chat",children:l.jsx(Na,{className:"h-6 w-6"})}),l.jsx(yt,{children:t>0&&l.jsx(de.span,{initial:{scale:0},animate:{scale:1},exit:{scale:0},className:ae("absolute -top-1 -right-1 flex items-center justify-center","h-5 min-w-5 rounded-full bg-destructive px-1","text-[11px] font-bold text-destructive-foreground"),children:t>9?"9+":t})})]}),uZ=1024,dZ=()=>{const[e,t]=$.useState(!1);return $.useEffect(()=>{const n=()=>{const r=window.innerWidth;t(r>=768&&r<uZ)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e},fZ=({chatSlot:e,canvasSlot:t,headerSlot:n,unreadCount:r=0,isAiResponding:s=!1})=>{const i=$u(),o=dZ(),[a,c]=$.useState(!1),[u,d]=$.useState(!1);if($.useEffect(()=>{r>0&&!a&&d(!0)},[r,a]),$.useEffect(()=>{a&&d(!1)},[a]),i)return l.jsxs("div",{className:"relative h-[calc(100vh-var(--header-height))] flex flex-col",children:[n&&l.jsx("div",{className:"flex-shrink-0 border-b border-border",children:n}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:t}),l.jsx(cZ,{onClick:()=>c(!0),unreadCount:r,isPulsing:u}),l.jsx(kM,{open:a,onOpenChange:c,children:l.jsx(CM,{className:"h-[85vh] max-h-[85vh]",children:l.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e})})})]});const f=o?30:35,h=o?70:65;return l.jsxs("div",{className:"h-[calc(100vh-var(--header-height))] flex flex-col",children:[n&&l.jsx("div",{className:"flex-shrink-0 border-b border-border",children:n}),l.jsxs(kQ,{direction:"horizontal",className:"flex-1 min-h-0",children:[l.jsx(Z_,{defaultSize:f,minSize:25,maxSize:50,className:"flex flex-col",children:l.jsx("div",{className:"flex-1 overflow-y-auto",children:e})}),l.jsx(_Q,{withHandle:!0,className:"hover:bg-primary/20 transition-colors data-[resize-handle-active]:bg-primary/30"}),l.jsx(Z_,{defaultSize:h,minSize:50,className:"flex flex-col",children:l.jsx("div",{className:"flex-1 overflow-y-auto",children:t})})]})]})},og=[{title:"Date Night",icon:"💑",prompts:["Plan a romantic dinner for two","Sunset drinks and fine dining evening","Cozy wine bar hopping experience","Rooftop dinner with a view","Surprise anniversary night out"]},{title:"Family Fun",icon:"👨‍👩‍👧‍👦",prompts:["Create a family-friendly day out with lunch","Kid-friendly activities and ice cream stops","Outdoor park day with picnic spots","Museum visits and educational fun","Family brunch and playground adventure"]},{title:"Tourist Adventure",icon:"🗺️",prompts:["Design a full day of sightseeing","Local hidden gems walking tour","Historical landmarks and street food","Photo-worthy spots and cafés","Cultural immersion day trip"]},{title:"Night Out",icon:"🌙",prompts:["Organize an exciting nightlife evening","Live music venues and cocktail bars","Dinner and late-night entertainment","Bar crawl with the best vibes","Comedy 
665show and after-party plan"]}],hZ=({onSelect:e})=>{var o,a;const[t,n]=m.useState(null),r=m.useRef(null);m.useEffect(()=>{const c=u=>{r.current&&!r.current.contains(u.target)&&n(null)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]);const s=c=>{n(t===c?null:c)},i=c=>{e(c),n(null)};return l.jsxs("div",{className:"space-y-3",ref:r,children:[l.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:og.map((c,u)=>l.jsxs(de.button,{type:"button",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:u*.08},onClick:()=>s(c.title),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md
666                                   border transition-all duration-200 text-sm font-medium
667                                   ${t===c.title?"border-primary/40 bg-primary/10 text-foreground":"border-border bg-card/60 hover:bg-muted text-foreground/80 hover:text-foreground"}`,children:[l.jsx("span",{children:c.icon}),l.jsx("span",{children:c.title})]},c.title))}),l.jsx(yt,{children:t&&l.jsx(de.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},className:"overflow-hidden",children:l.jsxs("div",{className:"border border-border rounded-xl bg-card/80 backdrop-blur-sm",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[l.jsx("span",{children:(o=og.find(c=>c.title===t))==null?void 0:o.icon}),l.jsx("span",{children:t})]}),l.jsx("button",{type:"button",onClick:()=>n(null),className:"text-muted-foreground hover:text-foreground transition-colors",children:l.jsx(Dn,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"divide-y divide-border",children:(a=og.find(c=>c.title===t))==null?void 0:a.prompts.map(c=>l.jsx("button",{type:"button",onClick:()=>i(c),className:`w-full text-left px-4 py-3 text-sm text-foreground
668                                                       hover:bg-muted/60 transition-colors`,children:c},c))})]})})})]})};function ze(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ln(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function pn(e,t){const n=ze(e);return isNaN(t)?Ln(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Dr(e,t){const n=ze(e);if(isNaN(t))return Ln(e,NaN);if(!t)return n;const r=n.getDate(),s=Ln(e,n.getTime());s.setMonth(n.getMonth()+t+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const Ew=6048e5,pZ=864e5,mZ=6e4,Ld=43200,sC=1440;let gZ={};function wl(){return gZ}function rs(e,t){var a,c,u,d;const n=wl(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=ze(e),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Eo(e){return rs(e,{weekStartsOn:1})}function jM(e){const t=ze(e),n=t.getFullYear(),r=Ln(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Eo(r),i=Ln(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=Eo(i);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function No(e){const t=ze(e);return t.setHours(0,0,0,0),t}function el(e){const t=ze(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Yr(e,t){const n=No(e),r=No(t),s=+n-el(n),i=+r-el(r);return Math.round((s-i)/pZ)}function yZ(e){const t=jM(e),n=Ln(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Eo(n)}function Mv(e,t){const n=t*7;return pn(e,n)}function vZ(e,t){return Dr(e,t*12)}function xZ(e){let t;return e.forEach(function(n){const r=ze(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function wZ(e){let t;return e.forEach(n=>{const r=ze(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function ff(e,t){const n=ze(e),r=ze(t),s=n.getTime()-r.getTime();return s<0?-1:s>0?1:s}function bZ(e){return Ln(e,Date.now())}function Pn(e,t){const n=No(e),r=No(t);return+n==+r}function Nw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function SZ(e){if(!Nw(e)&&typeof e!="number")return!1;const t=ze(e);return!isNaN(Number(t))}function tl(e,t){const n=ze(e),r=ze(t),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}
vendor: 4,378 bytes, line 668
668function kZ(e,t,n){const r=rs(e,n),s=rs(t,n),i=+r-el(r),o=+s-el(s);return Math.round((i-o)/Ew)}function EM(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function NM(e,t){return+ze(e)-+ze(t)}function _Z(e,t,n){const r=NM(e,t)/mZ;return EM(n==null?void 0:n.roundingMethod)(r)}function CZ(e){const t=ze(e);return t.setHours(23,59,59,999),t}function Ep(e){const t=ze(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function jZ(e){const t=ze(e);return+CZ(t)==+Ep(t)}function EZ(e,t){const n=ze(e),r=ze(t),s=ff(n,r),i=Math.abs(tl(n,r));let o;if(i<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*i);let a=ff(n,r)===-s;jZ(ze(e))&&i===1&&ff(e,r)===1&&(a=!1),o=s*(i-Number(a))}return o===0?0:o}function NZ(e,t,n){const r=NM(e,t)/1e3;return EM(n==null?void 0:n.roundingMethod)(r)}function On(e){const t=ze(e);return t.setDate(1),t.setHours(0,0,0,0),t}function TM(e){const t=ze(e),n=Ln(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Tw(e,t){var a,c,u,d;const n=wl(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=ze(e),i=s.getDay(),o=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function PM(e){return Tw(e,{weekStartsOn:1})}const TZ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},PZ=(e,t,n)=>{let r;const s=TZ[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ag(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const AZ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},RZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},MZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},IZ={date:ag({formats:AZ,defaultWidth:"full"}),time:ag({formats:RZ,defaultWidth:"full"}),dateTime:ag({formats:MZ,defaultWidth:"full"})},OZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},DZ=(e,t,n,r)=>OZ[e];function Bl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const LZ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$Z={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},FZ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},zZ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
668ay","Saturday"]},BZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},VZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},UZ=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},HZ={ordinalNumber:UZ,era:Bl({values:LZ,defaultWidth:"wide"}),quarter:Bl({values:$Z,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Bl({values:FZ,defaultWidth:"wide"}),day:Bl({values:zZ,defaultWidth:"wide"}),dayPeriod:Bl({values:BZ,defaultWidth:"wide",formattingValues:VZ,defaultFormattingWidth:"wide"})};function Vl(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?qZ(a,f=>f.test(o)):WZ(a,f=>f.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function WZ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function qZ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function GZ(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const KZ=/^(\d+)(th|st|nd|rd)?/i,YZ=/\d+/i,JZ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},XZ={any:[/^b/i,/^(a|c)/i]},QZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ZZ={any:[/1/i,/2/i,/3/i,/4/i]},eee={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},tee={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nee={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ree={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},see={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},iee={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},oee={ordinalNumber:GZ({matchPattern:KZ,parsePattern:YZ,valueCallback:e=>parseInt(e,10)}),era:Vl({matchPatterns:JZ,defaultMatchWidth:"wide",parsePatterns:XZ,defaultParseWidth:"any"}),quarter:Vl({matchPatterns:QZ,defaultMatchWidth:"wide",parsePatterns:ZZ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Vl({matchPatterns:eee,defaultMatchWidth:"wide",parsePatterns:tee,defaultParseWidth:"any"}),day:Vl({matchPatterns:nee,defaultMatchWidth:"wide",parsePatterns:ree,defaultParseWidth:"any"}),dayPeriod:Vl({matchPatterns:see,defaultMatchWidth:"any",parsePatterns:iee,defaultParseWidth:"any"})},Pw={code:"en-US",formatDistance:PZ,formatLong:IZ,formatRelative:DZ,localize:HZ,match:oee,options:{weekStartsOn:0,firstWeekContainsDate:1}};function aee(e){const t=ze(e);return Yr(t,TM(t))+1}function AM(e){const t=ze(e),n=+Eo(t)-+yZ(t);return Math.round(n/Ew)+1}function RM(e,t){var d,f,h,p;const n=ze(e),r=n.getFullYear(),s=wl(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(h=s.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=Ln(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=rs(o,t),c=Ln(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=rs(c,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function lee(e,t){var a,c,u,d;const n=wl(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,s=RM(e,t),i=Ln(e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),rs(i,t)}function MM(e,t){const n=ze(e),r=+rs(n,t)-+lee(n,t);return Math.round(r/Ew)+1}function et(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ks={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return et(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):et(n+1,2)},d(e,t){return et(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return et(e.getHours()%12||12,t.length)},H(e,t){return et(e.getHours(),t.length)},m(e,t){return et(e.getMinutes(),t.length)},s(e,t){return et(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return et(s,t.length)}},Jo={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}
vendor: 4,662 bytes, line 668
668,iC={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Ks.y(e,t)},Y:function(e,t,n,r){const s=RM(e,r),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return et(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):et(i,t.length)},R:function(e,t){const n=jM(e);return et(n,t.length)},u:function(e,t){const n=e.getFullYear();return et(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return et(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return et(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ks.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return et(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=MM(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):et(s,t.length)},I:function(e,t,n){const r=AM(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):et(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ks.d(e,t)},D:function(e,t,n){const r=aee(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):et(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return et(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return et(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return et(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Jo.noon:r===0?s=Jo.midnight:s=r/12>
vendor: 4,716 bytes, line 668
668=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Jo.evening:r>=12?s=Jo.afternoon:r>=4?s=Jo.morning:s=Jo.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ks.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ks.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):et(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):et(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ks.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ks.s(e,t)},S:function(e,t){return Ks.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return aC(r);case"XXXX":case"XX":return Xi(r);case"XXXXX":case"XXX":default:return Xi(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return aC(r);case"xxxx":case"xx":return Xi(r);case"xxxxx":case"xxx":default:return Xi(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+oC(r,":");case"OOOO":default:return"GMT"+Xi(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+oC(r,":");case"zzzz":default:return"GMT"+Xi(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return et(r,t.length)},T:function(e,t,n){const r=e.getTime();return et(r,t.length)}};function oC(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+t+et(i,2)}function aC(e,t){return e%60===0?(e>0?"-":"+")+et(Math.abs(e)/60,2):Xi(e,t)}function Xi(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=et(Math.trunc(r/60),2),i=et(r%60,2);return n+s+t+i}const lC=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},IM=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},cee=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return lC(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",lC(r,t)).replace("{{time}}",IM(s,t))},uee={p:IM,P:cee},dee=/^D+$/,fee=/^Y+$/,hee=["D","DD","YY","YYYY"];function pee(e){return dee.test(e)}function mee(e){return fee.test(e)}function gee(e,t,n){const r=yee(e,t,n);if(console.warn(r),hee.includes(e))throw new RangeError(r)}function yee(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vee=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xee=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wee=/^'([^]*?)'?$/,bee=/''/g,See=/[a-zA-Z]/;function $n(e,t,n){var d,f,h,p,g,v,b,y;const r=wl(),s=(n==null?void 0:n.locale)??r.locale??Pw,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((y=(b=r.locale)==null?void 0:b.options)==null?void 0:y.weekStartsOn)??0,a=ze(e);if(!SZ(a))throw new RangeError("Invalid time value");let c=t.match(xee).map(w=>{const x=w[0];if(x==="p"||x==="P"){const S=uee[x];return S(w,s.formatLong)}return w}).join("").match(vee).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const x=w[0];if(x==="'")return{isToken:!1,value:kee(w)};if(iC[x])return{isToken:!0,value:w};
668if(x.match(See))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:w}});s.localize.preprocessor&&(c=s.localize.preprocessor(a,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(w=>{if(!w.isToken)return w.value;const x=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&mee(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&pee(x))&&gee(x,t,String(e));const S=iC[x[0]];return S(a,x,s.localize,u)}).join("")}function kee(e){const t=e.match(wee);return t?t[1].replace(bee,"'"):e}function _ee(e,t,n){const r=wl(),s=(n==null?void 0:n.locale)??r.locale??Pw,i=2520,o=ff(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o});let c,u;o>0?(c=ze(t),u=ze(e)):(c=ze(e),u=ze(t));const d=NZ(u,c),f=(el(u)-el(c))/1e3,h=Math.round((d-f)/60);let p;if(h<2)return n!=null&&n.includeSeconds?d<5?s.formatDistance("lessThanXSeconds",5,a):d<10?s.formatDistance("lessThanXSeconds",10,a):d<20?s.formatDistance("lessThanXSeconds",20,a):d<40?s.formatDistance("halfAMinute",0,a):d<60?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",1,a):h===0?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",h,a);if(h<45)return s.formatDistance("xMinutes",h,a);if(h<90)return s.formatDistance("aboutXHours",1,a);if(h<sC){const g=Math.round(h/60);return s.formatDistance("aboutXHours",g,a)}else{if(h<i)return s.formatDistance("xDays",1,a);if(h<Ld){const g=Math.round(h/sC);return s.formatDistance("xDays",g,a)}else if(h<Ld*2)return p=Math.round(h/Ld),s.formatDistance("aboutXMonths",p,a)}if(p=EZ(u,c),p<12){const g=Math.round(h/Ld);return s.formatDistance("xMonths",g,a)}else{const g=p%12,v=Math.trunc(p/12);return g<3?s.formatDistance("aboutXYears",v,a):g<9?s.formatDistance("overXYears",v,a):s.formatDistance("almostXYears",v+1,a)}}function OM(e,t){return _ee(e,bZ(e),t)}function Cee(e){const t=ze(e),n=t.getFullYear(),r=t.getMonth(),s=Ln(e,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function jee(e){return Math.trunc(+ze(e)/1e3)}function Eee(e){const t=ze(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Nee(e,t){return kZ(Eee(e),On(e),t)+1}function Iv(e,t){const n=ze(e),r=ze(t);return n.getTime()>r.getTime()}function DM(e,t){const n=ze(e),r=ze(t);return+n<+r}function Aw(e,t){const n=ze(e),r=ze(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Tee(e,t){const n=ze(e),r=ze(t);return n.getFullYear()===r.getFullYear()}function lg(e,t){return pn(e,-t)}function cg(e,t){const n=ze(e),r=n.getFullYear(),s=n.getDate(),i=Ln(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const o=Cee(i);return n.setMonth(t,Math.min(s,o)),n}function cC(e,t){const n=ze(e);return isNaN(+n)?Ln(e,NaN):(n.setFullYear(t),n)}function Pee(){return No(Date.now())}var De=function(){return De=Object.assign||function(t){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)&&(t[i]=n[i])}return t},De.apply(this,arguments)};function Aee(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function LM(e,t,n){for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Fu(e){return e.mode==="multiple"}function zu(e){return e.mode==="range"}function Np(e){return e.mode==="single"}var Ree={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rd
668p-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Mee(e,t){return $n(e,"LLLL y",t)}function Iee(e,t){return $n(e,"d",t)}function Oee(e,t){return $n(e,"LLLL",t)}function Dee(e){return"".concat(e)}function Lee(e,t){return $n(e,"cccccc",t)}function $ee(e,t){return $n(e,"yyyy",t)}var Fee=Object.freeze({__proto__:null,formatCaption:Mee,formatDay:Iee,formatMonthCaption:Oee,formatWeekNumber:Dee,formatWeekdayName:Lee,formatYearCaption:$ee}),zee=function(e,t,n){return $n(e,"do MMMM (EEEE)",n)},Bee=function(){return"Month: "},Vee=function(){return"Go to next month"},Uee=function(){return"Go to previous month"},Hee=function(e,t){return $n(e,"cccc",t)},Wee=function(e){return"Week n. ".concat(e)},qee=function(){return"Year: "},Gee=Object.freeze({__proto__:null,labelDay:zee,labelMonthDropdown:Bee,labelNext:Vee,labelPrevious:Uee,labelWeekNumber:Wee,labelWeekday:Hee,labelYearDropdown:qee});function Kee(){var e="buttons",t=Ree,n=Pw,r={},s={},i=1,o={},a=new Date;return{captionLayout:e,classNames:t,formatters:Fee,labels:Gee,locale:n,modifiersClassNames:r,modifiers:s,numberOfMonths:i,styles:o,today:a,mode:"default"}}function Yee(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,s=e.toMonth,i=e.fromDate,o=e.toDate;return r?i=On(r):t&&(i=new Date(t,0,1)),s?o=Ep(s):n&&(o=new Date(n,11,31)),{fromDate:i?No(i):void 0,toDate:o?No(o):void 0}}var $M=m.createContext(void 0);function Jee(e){var t,n=e.initialProps,r=Kee(),s=Yee(n),i=s.fromDate,o=s.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!o)&&(a="buttons");var c;(Np(n)||Fu(n)||zu(n))&&(c=n.onSelect);var u=De(De(De({},r),n),{captionLayout:a,classNames:De(De({},r.classNames),n.classNames),components:De({},n.components),formatters:De(De({},r.formatters),n.formatters),fromDate:i,labels:De(De({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:De(De({},r.modifiers),n.modifiers),modifiersClassNames:De(De({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:De(De({},r.styles),n.styles),toDate:o});return l.jsx($M.Provider,{value:u,children:e.children})}function lt(){var e=m.useContext($M);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function FM(e){var t=lt(),n=t.locale,r=t.classNames,s=t.styles,i=t.formatters.formatCaption;return l.jsx("div",{className:r.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Xee(e){return l.jsx("svg",De({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:l.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function zM(e){var t,n,r=e.onChange,s=e.value,i=e.children,o=e.caption,a=e.className,c=e.style,u=lt(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Xee;return l.jsxs("div",{className:a,style:c,children:[l.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),l.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:s,onChange:r,children:i}),l.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[o,l.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function Qee(e){var t,n=lt(),r=n.fromDate,s=n.toDate,i=n.styles,o=n.locale,a=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return l.jsx(l.Fragment,{});if(!s)return l.jsx(l.Fragment,{});var f=[];if(Tee(r,s))for(var h=On(r),p=r.getMonth();p<=s.getMonth();p++)f.push(cg(h,p));else for(var h=On(new Date),p=0;p<=11;p++)f.push(cg(h,p));var g=function(b){var y=Number(b.target.value),w=cg(On(e.displayMonth),y);e.onChange(w)},v=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:zM;return l.jsx(v,{name:"months","aria-label":d(),className:c.dropdown_month,style:i.dropdown_month,onChange:g,value:e.displayMonth.getMonth(),c
668aption:a(e.displayMonth,{locale:o}),children:f.map(function(b){return l.jsx("option",{value:b.getMonth(),children:a(b,{locale:o})},b.getMonth())})})}function Zee(e){var t,n=e.displayMonth,r=lt(),s=r.fromDate,i=r.toDate,o=r.locale,a=r.styles,c=r.classNames,u=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,h=[];if(!s)return l.jsx(l.Fragment,{});if(!i)return l.jsx(l.Fragment,{});for(var p=s.getFullYear(),g=i.getFullYear(),v=p;v<=g;v++)h.push(cC(TM(new Date),v));var b=function(w){var x=cC(On(n),Number(w.target.value));e.onChange(x)},y=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:zM;return l.jsx(y,{name:"years","aria-label":f(),className:c.dropdown_year,style:a.dropdown_year,onChange:b,value:n.getFullYear(),caption:d(n,{locale:o}),children:h.map(function(w){return l.jsx("option",{value:w.getFullYear(),children:d(w,{locale:o})},w.getFullYear())})})}function ete(e,t){var n=m.useState(e),r=n[0],s=n[1],i=t===void 0?r:t;return[i,s]}function tte(e){var t=e.month,n=e.defaultMonth,r=e.today,s=t||n||r||new Date,i=e.toDate,o=e.fromDate,a=e.numberOfMonths,c=a===void 0?1:a;if(i&&tl(i,s)<0){var u=-1*(c-1);s=Dr(i,u)}return o&&tl(s,o)<0&&(s=o),On(s)}function nte(){var e=lt(),t=tte(e),n=ete(t,e.month),r=n[0],s=n[1],i=function(o){var a;if(!e.disableNavigation){var c=On(o);s(c),(a=e.onMonthChange)===null||a===void 0||a.call(e,c)}};return[r,i]}function rte(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,s=On(e),i=On(Dr(s,r)),o=tl(i,s),a=[],c=0;c<o;c++){var u=Dr(s,c);a.push(u)}return n&&(a=a.reverse()),a}function ste(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,s=t.numberOfMonths,i=s===void 0?1:s,o=r?i:1,a=On(e);if(!n)return Dr(a,o);var c=tl(n,e);if(!(c<i))return Dr(a,o)}}function ite(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,s=t.numberOfMonths,i=s===void 0?1:s,o=r?i:1,a=On(e);if(!n)return Dr(a,-o);var c=tl(a,n);if(!(c<=0))return Dr(a,-o)}}var BM=m.createContext(void 0);function ote(e){var t=lt(),n=nte(),r=n[0],s=n[1],i=rte(r,t),o=ste(r,t),a=ite(r,t),c=function(f){return i.some(function(h){return Aw(f,h)})},u=function(f,h){c(f)||(h&&DM(f,h)?s(Dr(f,1+t.numberOfMonths*-1)):s(f))},d={currentMonth:r,displayMonths:i,goToMonth:s,goToDate:u,previousMonth:a,nextMonth:o,isDateDisplayed:c};return l.jsx(BM.Provider,{value:d,children:e.children})}function Bu(){var e=m.useContext(BM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function uC(e){var t,n=lt(),r=n.classNames,s=n.styles,i=n.components,o=Bu().goToMonth,a=function(d){o(Dr(d,e.displayIndex?-e.dis
668playIndex:0))},c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:FM,u=l.jsx(c,{id:e.id,displayMonth:e.displayMonth});return l.jsxs("div",{className:r.caption_dropdowns,style:s.caption_dropdowns,children:[l.jsx("div",{className:r.vhidden,children:u}),l.jsx(Qee,{onChange:a,displayMonth:e.displayMonth}),l.jsx(Zee,{onChange:a,displayMonth:e.displayMonth})]})}function ate(e){return l.jsx("svg",De({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function lte(e){return l.jsx("svg",De({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:l.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var xh=m.forwardRef(function(e,t){var n=lt(),r=n.classNames,s=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var o=i.join(" "),a=De(De({},s.button_reset),s.button);return e.style&&Object.assign(a,e.style),l.jsx("button",De({},e,{ref:t,type:"button",className:o,style:a}))});function cte(e){var t,n,r=lt(),s=r.dir,i=r.locale,o=r.classNames,a=r.styles,c=r.labels,u=c.labelPrevious,d=c.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return l.jsx(l.Fragment,{});var h=u(e.previousMonth,{locale:i}),p=[o.nav_button,o.nav_button_previous].join(" "),g=d(e.nextMonth,{locale:i}),v=[o.nav_button,o.nav_button_next].join(" "),b=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:lte,y=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:ate;return l.jsxs("div",{className:o.nav,style:a.nav,children:[!e.hidePrevious&&l.jsx(xh,{name:"previous-month","aria-label":h,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?l.jsx(b,{className:o.nav_icon,style:a.nav_icon}):l.jsx(y,{className:o.nav_icon,style:a.nav_icon})}),!e.hideNext&&l.jsx(xh,{name:"next-month","aria-label":g,className:v,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?l.jsx(y,{className:o.nav_icon,style:a.nav_icon}):l.jsx(b,{className:o.nav_icon,style:a.nav_icon})})]})}function dC(e){var t=lt().numberOfMonths,n=Bu(),r=n.previousMonth,s=n.nextMonth,i=n.goToMonth,o=n.displayMonths,a=o.findIndex(function(g){return Aw(e.displayMonth,g)}),c=a===0,u=a===o.length-1,d=t>1&&(c||!u),f=t>1&&(u||!c),h=function(){r&&i(r)},p=function(){s&&i(s)};return l.jsx(cte,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:s,previousMonth:r,onPreviousClick:h,onNextClick:p})}function ute(e){var t,n=lt(),r=n.classNames,s=n.disableNavigation,i=n.styles,o=n.captionLayout,a=n.components,c=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:FM,u;return s?u=l.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?u=l.jsx(uC,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?u=l.jsxs(l.Fragment,{children:[l.jsx(uC,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),l.jsx(dC,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=l.jsxs(l.Fragment,{children:[l.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(dC,{displayMonth:e.displayMonth,id:e.id})]}),l.jsx("div",{className:r.caption,style:i.caption,children:u})}function dte(e){var t=lt(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?l.jsx("tfoot",{className:s,style:r.tfoot,children:l.jsx("tr",{children:l.jsx("td",{colSpan:8,children:n})})}):l.jsx(l.Fragment,{})}function fte(e,t,n){for(var r=n?Eo(new Date):rs(new Date,{locale:e,weekStartsOn:t}),s=[],i=0;i<7;i++){var o=pn(r,i);s.push(o)}return s}function hte(){var e=lt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,i=e.weekStartsOn,o=e.ISOWeek,a=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=fte(s,i,o);return l.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&l.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(d,f){return l.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(d,{locale:s}),children:a(d,{locale:s})},f)})]})}function pte(){var e,t=lt(),n=t.classNames,r=t.styles,s=t.components,i=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:hte;return l.jsx("thead",{style:r.head,className:n.head,children:l.jsx(i,{})})}function mte(e){var t=lt(),n=t.locale,r=t.formatters.formatDay;return l.jsx(l.Fragment,{children:r(e.date,{locale:n})})}var Rw=m.createContext(void 0);function gte(e){if(!Fu(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return l.jsx(Rw.Provider,{value:t,children:e.children})}return l.jsx(yte,{initialProps:e.initialProps,children:e.children})}function yte(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,i=t.max,o=function(u,d,f){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,u,d,f);var g=!!(d.selected&&s&&(r==null?void 0:r.length)===s);if(!g){var v=!!(!d.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var b=r?LM([],r):[];if(d.selected){var y=b.findIndex(function(w){return Pn(u,w)});b.splice(y,1)}else b.push(u);(p=t.onSelect)===null||p===void 0||p.call(t,b,u,d,f)}}},a={disabled:[]};r&&a.disabled.push(function(u){var d=i&&r.length>i-1,f=r.some(function(h){return Pn(h,u)});return!!(d&&!f)});var c={selected:r,onDayClick:o,modifiers:a};return l.jsx(Rw.Provider,{value:c,children:n})}function Mw(){var e=m.useContext(Rw);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function vte(e,t){var n=t||{},r=n.from,s=n.to;return r&&s?Pn(s,e)&&Pn(r,e)?void 0:Pn(s,e)?{from:s,to:void 0}:Pn(r,e)?void 0:Iv(r,e)?{from:e,to:s}:{from:r,to:e}:s?Iv(e,s)?{from:s,to:e}:{from:e,to:s}:r?DM(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Iw=m.createContext(void 0);function xte(e){if(!zu(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return l.jsx(Iw.Provider,{value:t,children:e.children})}return l.jsx(wte,{initialProps:e.initialProps,children:e.children})}function wte(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},i=s.from,o=s.to,a=t.min,c=t.max,u=function(p,g,v){var b,y;(b=t.onDayClick)===null||b===void 0||b.call(t,p,g,v);var w=vte(p,r);(y=t.onSelect)===null||y===void 0||y.call(t,w,p,g,v)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],o?(d.range_end=[o],Pn(i,o)||(d.range_middle=[{after:i,before:o}])):d.range_end=[i]):o&&(d.range_start=[o],d.range_end=[o]),a&&(i&&!o&&d.disabled.push({after:lg(i,a-1),before:pn(i,a-1)}),i&&o&&d.disabled.push({after:i,before:pn(i,a-1)}),!i&&o&&d.disabled.push({after:lg(o,a-1),before:pn(o,a-1)})),c){if(i&&!o&&(d.disabled.push({before:pn(i,-c+1)}),d.disabled.push({after:pn(i,c-1)})),i&&o){var f=Yr(o,i)+1,h=c-f;d.disabled.push({before:lg(i,h)}),d.disabled.push({after:pn(o,h)})}!i&&o&&(d.disabled.push({before:pn(o,-c+1)}),d.disabled.push({after:pn(o,c-1)}))}return l.jsx(Iw.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function Ow(){var e=m.useContext(Iw);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function hf(e){return Array.isArray(e)?LM([],e):e!==void 0?[e]:[]}function bte(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];
668t[r]=hf(s)}),t}var Lr;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Lr||(Lr={}));var Ste=Lr.Selected,as=Lr.Disabled,kte=Lr.Hidden,_te=Lr.Today,ug=Lr.RangeEnd,dg=Lr.RangeMiddle,fg=Lr.RangeStart,Cte=Lr.Outside;function jte(e,t,n){var r,s=(r={},r[Ste]=hf(e.selected),r[as]=hf(e.disabled),r[kte]=hf(e.hidden),r[_te]=[e.today],r[ug]=[],r[dg]=[],r[fg]=[],r[Cte]=[],r);return e.fromDate&&s[as].push({before:e.fromDate}),e.toDate&&s[as].push({after:e.toDate}),Fu(e)?s[as]=s[as].concat(t.modifiers[as]):zu(e)&&(s[as]=s[as].concat(n.modifiers[as]),s[fg]=n.modifiers[fg],s[dg]=n.modifiers[dg],s[ug]=n.modifiers[ug]),s}var VM=m.createContext(void 0);function Ete(e){var t=lt(),n=Mw(),r=Ow(),s=jte(t,n,r),i=bte(t.modifiers),o=De(De({},s),i);return l.jsx(VM.Provider,{value:o,children:e.children})}function UM(){var e=m.useContext(VM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Nte(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Tte(e){return!!(e&&typeof e=="object"&&"from"in e)}function Pte(e){return!!(e&&typeof e=="object"&&"after"in e)}function Ate(e){return!!(e&&typeof e=="object"&&"before"in e)}function Rte(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Mte(e,t){var n,r=t.from,s=t.to;if(r&&s){var i=Yr(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var o=Yr(e,r)>=0&&Yr(s,e)>=0;return o}return s?Pn(s,e):r?Pn(r,e):!1}function Ite(e){return Nw(e)}function Ote(e){return Array.isArray(e)&&e.every(Nw)}function Dte(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Ite(n))return Pn(e,n);if(Ote(n))return n.includes(e);if(Tte(n))return Mte(e,n);if(Rte(n))return n.dayOfWeek.includes(e.getDay());if(Nte(n)){var r=Yr(n.before,e),s=Yr(n.after,e),i=r>0,o=s<0,a=Iv(n.before,n.after);return a?o&&i:i||o}return Pte(n)?Yr(e,n.after)>0:Ate(n)?Yr(n.before,e)>0:typeof n=="function"?n(e):!1})}function Dw(e,t,n){var r=Object.keys(t).reduce(function(i,o){var a=t[o];return Dte(e,a)&&i.push(o),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!Aw(e,n)&&(s.outside=!0),s}function Lte(e,t){for(var n=On(e[0]),r=Ep(e[e.length-1]),s,i,o=n;o<=r;){var a=Dw(o,t),c=!a.disabled&&!a.hidden;if(!c){o=pn(o,1);continue}if(a.selected)return o;a.today&&!i&&(i=o),s||(s=o),o=pn(o,1)}return i||s}var $te=365;function HM(e,t){var n=t.moveBy,r=t.direction,s=t.context,i=t.modifiers,o=t.retry,a=o===void 0?{count:0,lastFocused:e}:o,c=s.weekStartsOn,u=s.fromDate,d=s.toDate,f=s.locale,h={day:pn,week:Mv,month:Dr,year:vZ,startOfWeek:function(b){return s.ISOWeek?Eo(b):rs(b,{locale:f,weekStartsOn:c})},endOfWeek:function(b){return s.ISOWeek?PM(b):Tw(b,{locale:f,weekStartsOn:c})}},p=h[n](e,r==="after"?1:-1);r==="before"&&u?p=xZ([u,p]):r==="after"&&d&&(p=wZ([d,p]));var g=!0;if(i){var v=Dw(p,i);g=!v.disabled&&!v.hidden}return g?p:a.count>$te?a.lastFocused:HM(p,{moveBy:n,direction:r,context:s,modifiers:i,retry:De(De({},a),{count:a.count+1})})}var WM=m.createContext(void 0);function Fte(e){var t=Bu(),n=UM(),r=m.useState(),s=r[0],i=r[1],o=m.useState(),a=o[0],c=o[1],u=Lte(t.displayMonths,n),d=s??(a&&t.isDateDisplayed(a))?a:u,f=function(){c(s),i(void 0)},h=function(b){i(b)},p=lt(),g=function(b,y){if(s){var w=HM(s,{moveBy:b,direction:y,context:p,modifiers:n});Pn(s,w)||(t.goToDate(w,s),h(w))}},v={focusedDay:s,focusTarget:d,blur:f,focus:h,focusDayAfter:function(){return g("day","after")},focusDayBefore:function(){return g("day","before")},focusWeekAfter:function(){return g("week","after")},focusWeekBefore:function(){return g("week","before")},focusMonthBefore:function(){return g("month","before")},focusMonthAfter:function(){return g("month","after")},focusYearBefore:function(){return g("year","before")},focusYearAfter:function(){return g("year","after")},focusStartOfWeek:function(){return g("startOfWeek","before")},focusEndOfWeek:function(){return g("endOfWeek","after")}};return l.jsx(WM.Provider,{value:v,children:e.children})}function Lw(){var e=m.useContext(WM);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function zte(e,t){var n=UM(),r=Dw(e,n,t);return r}var $w=m.createContext(void 0);function Bte(e){if(!Np(e.initialProps)){var t={selected:void 0};return l.jsx($w.Provider,{value:t,children:e.children})}return l.jsx(Vte,{initialProps:e.initialProps,children:e.children})}function Vte(e){var t=e.initialProps,n=e.children,r=function(i,o,a){var c,u,d;
668if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,a),o.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,i,o,a);return}(d=t.onSelect)===null||d===void 0||d.call(t,i,i,o,a)},s={selected:t.selected,onDayClick:r};return l.jsx($w.Provider,{value:s,children:n})}function qM(){var e=m.useContext($w);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Ute(e,t){var n=lt(),r=qM(),s=Mw(),i=Ow(),o=Lw(),a=o.focusDayAfter,c=o.focusDayBefore,u=o.focusWeekAfter,d=o.focusWeekBefore,f=o.blur,h=o.focus,p=o.focusMonthBefore,g=o.focusMonthAfter,v=o.focusYearBefore,b=o.focusYearAfter,y=o.focusStartOfWeek,w=o.focusEndOfWeek,x=function(I){var A,D,E,K;Np(n)?(A=r.onDayClick)===null||A===void 0||A.call(r,e,t,I):Fu(n)?(D=s.onDayClick)===null||D===void 0||D.call(s,e,t,I):zu(n)?(E=i.onDayClick)===null||E===void 0||E.call(i,e,t,I):(K=n.onDayClick)===null||K===void 0||K.call(n,e,t,I)},S=function(I){var A;h(e),(A=n.onDayFocus)===null||A===void 0||A.call(n,e,t,I)},C=function(I){var A;f(),(A=n.onDayBlur)===null||A===void 0||A.call(n,e,t,I)},k=function(I){var A;(A=n.onDayMouseEnter)===null||A===void 0||A.call(n,e,t,I)},_=function(I){var A;(A=n.onDayMouseLeave)===null||A===void 0||A.call(n,e,t,I)},j=function(I){var A;(A=n.onDayPointerEnter)===null||A===void 0||A.call(n,e,t,I)},R=function(I){var A;(A=n.onDayPointerLeave)===null||A===void 0||A.call(n,e,t,I)},P=function(I){var A;(A=n.onDayTouchCancel)===null||A===void 0||A.call(n,e,t,I)},M=function(I){var A;(A=n.onDayTouchEnd)===null||A===void 0||A.call(n,e,t,I)},T=function(I){var A;(A=n.onDayTouchMove)===null||A===void 0||A.call(n,e,t,I)},L=function(I){var A;(A=n.onDayTouchStart)===null||A===void 0||A.call(n,e,t,I)},F=function(I){var A;(A=n.onDayKeyUp)===null||A===void 0||A.call(n,e,t,I)},z=function(I){var A;switch(I.key){case"ArrowLeft":I.preventDefault(),I.stopPropagation(),n.dir==="rtl"?a():c();break;case"ArrowRight":I.preventDefault(),I.stopPropagation(),n.dir==="rtl"?c():a();break;case"ArrowDown":I.preventDefault(),I.stopPropagation(),u();break;case"ArrowUp":I.preventDefault(),I.stopPropagation(),d();break;case"PageUp":I.preventDefault(),I.stopPropagation(),I.shiftKey?v():p();break;case"PageDown":I.preventDefault(),I.stopPropagation(),I.shiftKey?b():g();break;case"Home":I.preventDefault(),I.stopPropagation(),y();break;case"End":I.preventDefault(),I.stopPropagation(),w();break}(A=n.onDayKeyDown)===null||A===void 0||A.call(n,e,t,I)},V={onClick:x,onFocus:S,onBlur:C,onKeyDown:z,onKeyUp:F,onMouseEnter:k,onMouseLeave:_,onPointerEnter:j,onPointerLeave:R,onTouchCancel:P,onTouchEnd:M,onTouchMove:T,onTouchStart:L};return V}function Hte(){var e=lt(),t=qM(),n=Mw(),r=Ow(),s=Np(e)?t.selected:Fu(e)?n.selected:zu(e)?r.selected:void 0;return s}function Wte(e){return Object.values(Lr).includes(e)}function qte(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(Wte(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Gte(e,t){var n=De({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=De(De({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function Kte(e,t,n){var r,s,i,o=lt(),a=Lw(),c=zte(e,t),u=Ute(e,c),d=Hte(),f=!!(o.onDayCl
668ick||o.mode!=="default");m.useEffect(function(){var k;c.outside||a.focusedDay&&f&&Pn(a.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[a.focusedDay,e,n,f,c.outside]);var h=qte(o,c).join(" "),p=Gte(o,c),g=!!(c.outside&&!o.showOutsideDays||c.hidden),v=(i=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:mte,b=l.jsx(v,{date:e,displayMonth:t,activeModifiers:c}),y={style:p,className:h,children:b,role:"gridcell"},w=a.focusTarget&&Pn(a.focusTarget,e)&&!c.outside,x=a.focusedDay&&Pn(a.focusedDay,e),S=De(De(De({},y),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=x||w?0:-1,r)),u),C={isButton:f,isHidden:g,activeModifiers:c,selectedDays:d,buttonProps:S,divProps:y};return C}function Yte(e){var t=m.useRef(null),n=Kte(e.date,e.displayMonth,t);return n.isHidden?l.jsx("div",{role:"gridcell"}):n.isButton?l.jsx(xh,De({name:"day",ref:t},n.buttonProps)):l.jsx("div",De({},n.divProps))}function Jte(e){var t=e.number,n=e.dates,r=lt(),s=r.onWeekNumberClick,i=r.styles,o=r.classNames,a=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(t),{locale:a});if(!s)return l.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:d});var f=c(Number(t),{locale:a}),h=function(p){s(t,n,p)};return l.jsx(xh,{name:"week-number","aria-label":f,className:o.weeknumber,style:i.weeknumber,onClick:h,children:d})}function Xte(e){var t,n,r=lt(),s=r.styles,i=r.classNames,o=r.showWeekNumber,a=r.components,c=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:Yte,u=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Jte,d;return o&&(d=l.jsx("td",{className:i.cell,style:s.cell,children:l.jsx(u,{number:e.weekNumber,dates:e.dates})})),l.jsxs("tr",{className:i.row,style:s.row,children:[d,e.dates.map(function(f){return l.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:l.jsx(c,{displayMonth:e.displayMonth,date:f})},jee(f))})]})}function fC(e,t,n){for(var r=n!=null&&n.ISOWeek?PM(t):Tw(t,n),s=n!=null&&n.ISOWeek?Eo(e):rs(e,n),i=Yr(r,s),o=[],a=0;a<=i;a++)o.push(pn(s,a));var c=o.reduce(function(u,d){var f=n!=null&&n.ISOWeek?AM(d):MM(d,n),h=u.find(function(p){return p.weekNumber===f});return h?(h.dates.push(d),u):(u.push({weekNumber:f,dates:[d]}),u)},[]);return c}function Qte(e,t){var n=fC(On(e),Ep(e),t);if(t!=null&&t.useFixedWeeks){var r=Nee(e,t);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],o=Mv(i,6-r),a=fC(Mv(i,1),o,t);n.push.apply(n,a)}}return n}function Zte(e){var t,n,r,s=lt(),i=s.locale,o=s.classNames,a=s.styles,c=s.hideHead,u=s.fixedWeeks,d=s.components,f=s.weekStartsOn,h=s.firstWeekContainsDate,p=s.ISOWeek,g=Qte(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:p,locale:i,weekStartsOn:f,firstWeekContainsDate:h}),v=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:pte,b=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:Xte,y=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:dte;return l.jsxs("table",{id:e.id,className:o.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&l.jsx(v,{}),l.jsx("tbody",{className:o.tbody,style:a.tbody,children:g.map(function(w){return l.jsx(b,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),l.jsx(y,{displayMonth:e.displayMonth})]})}function ene(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var tne=ene()?m.useLayoutEffect:m.useEffect,hg=!1,nne=0;function hC(){return"react-day-picker-".concat(++nne)}function rne(e){var t,n=e??(hg?hC():null),r=m.useState(n),s=r[0],i=r[1];return tne(function(){s===null&&i(hC())},[]),m.useEffect(function(){hg===!1&&(hg=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function sne(e){var t,n,r=lt(),s=r.dir,i=r.classNames,o=r.styles,a=r.components,c=Bu().displayMonths,u=rne(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],h=o.month,p=e.displayIndex===0,g=e.displayIndex===c.length-1,v=!p&&!g;s==="rtl"&&(t=[p,g],g=t[0],p=t[1]),p&&(f.push(i.caption_start),h=De(De({},h),o.caption_start)),g&&(f.push(i.caption_end),h=De(De({}
vendor: 4,297 bytes, line 668
668,h),o.caption_end)),v&&(f.push(i.caption_between),h=De(De({},h),o.caption_between));var b=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:ute;return l.jsxs("div",{className:f.join(" "),style:h,children:[l.jsx(b,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),l.jsx(Zte,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function ine(e){var t=lt(),n=t.classNames,r=t.styles;return l.jsx("div",{className:n.months,style:r.months,children:e.children})}function one(e){var t,n,r=e.initialProps,s=lt(),i=Lw(),o=Bu(),a=m.useState(!1),c=a[0],u=a[1];m.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),u(!0)))},[s.initialFocus,c,i.focus,i.focusTarget,i]);var d=[s.classNames.root,s.className];s.numberOfMonths>1&&d.push(s.classNames.multiple_months),s.showWeekNumber&&d.push(s.classNames.with_weeknumber);var f=De(De({},s.styles.root),s.style),h=Object.keys(r).filter(function(g){return g.startsWith("data-")}).reduce(function(g,v){var b;return De(De({},g),(b={},b[v]=r[v],b))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:ine;return l.jsx("div",De({className:d.join(" "),style:f,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:l.jsx(p,{children:o.displayMonths.map(function(g,v){return l.jsx(sne,{displayIndex:v,displayMonth:g},v)})})}))}function ane(e){var t=e.children,n=Aee(e,["children"]);return l.jsx(Jee,{initialProps:n,children:l.jsx(ote,{children:l.jsx(Bte,{initialProps:n,children:l.jsx(gte,{initialProps:n,children:l.jsx(xte,{initialProps:n,children:l.jsx(Ete,{children:l.jsx(Fte,{children:t})})})})})})})}function lne(e){return l.jsx(ane,De({},e,{children:l.jsx(one,{initialProps:e})}))}function GM({className:e,classNames:t,showOutsideDays:n=!0,...r}){return l.jsx(lne,{showOutsideDays:n,className:ae("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ae(nu({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ae(nu({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...s})=>l.jsx(Fx,{className:"h-4 w-4"}),IconRight:({...s})=>l.jsx(wo,{className:"h-4 w-4"})},...r})}GM.displayName="Calendar";var Fw="Popover",[KM,Sie]=Bs(Fw,[pl]),Vu=pl(),[cne,Fi]=KM(Fw),YM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,a=Vu(t),c=m.useRef(null),[u,d]=m.useState(!1),[f=!1,h]=Ro({prop:r,defaultProp:s,onChange:i});return l.jsx(F0,{...a,children:l.jsx(cne,{scope:t,contentId:Ts(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:o,children:n})})};YM.displayName=Fw;var JM="PopoverAnchor",une=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Fi(JM,n),i=Vu(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=s;return m.useEffect(()=>(o(),()=>a()),[o,a]),l.jsx(ap,{...i,...r,ref:t})});une.displayName=JM;var XM="PopoverTrigger",QM=m.forwardRef((e,t)=>
vendor: 4,189 bytes, line 668
668{const{__scopePopover:n,...r}=e,s=Fi(XM,n),i=Vu(n),o=vt(t,s.triggerRef),a=l.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":rI(s.open),...r,ref:o,onClick:Ae(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:l.jsx(ap,{asChild:!0,...i,children:a})});QM.displayName=XM;var zw="PopoverPortal",[dne,fne]=KM(zw,{forceMount:void 0}),ZM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Fi(zw,t);return l.jsx(dne,{scope:t,forceMount:n,children:l.jsx(sr,{present:n||i.open,children:l.jsx(Au,{asChild:!0,container:s,children:r})})})};ZM.displayName=zw;var nl="PopoverContent",eI=m.forwardRef((e,t)=>{const n=fne(nl,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Fi(nl,e.__scopePopover);return l.jsx(sr,{present:r||i.open,children:i.modal?l.jsx(hne,{...s,ref:t}):l.jsx(pne,{...s,ref:t})})});eI.displayName=nl;var hne=m.forwardRef((e,t)=>{const n=Fi(nl,e.__scopePopover),r=m.useRef(null),s=vt(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return V0(o)},[]),l.jsx(dp,{as:_i,allowPinchZoom:!0,children:l.jsx(tI,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Ae(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),pne=m.forwardRef((e,t)=>{const n=Fi(nl,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return l.jsx(tI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),tI=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Fi(nl,n),p=Vu(n);return P0(),l.jsx(rp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:l.jsx(z0,{"data-state":rI(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),nI="PopoverClose",mne=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Fi(nI,n);return l.jsx(Je.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});mne.displayName=nI;var gne="PopoverArrow",yne=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Vu(n);return l.jsx(B0,{...s,...r,ref:t})});yne.displayName=gne;function rI(e){return e?"open":"closed"}var sI=YM,iI=QM,oI=ZM,Bw=eI;const Tp=sI,Pp=iI,Uu=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>l.jsx(oI,{children:l.jsx(Bw,{ref:s,align:t,sideOffset:n,className:ae("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
668de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Uu.displayName=Bw.displayName;const vne=({value:e,onLocationChange:t,onPlaceSelect:n,onPlaceClear:r,onLocationModified:s,inputClass:i})=>{const[o,a]=m.useState([]),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[h,p]=m.useState(!1),g=m.useRef(null),v=m.useRef(null),{cityName:b}=TA();m.useEffect(()=>{const k=_=>{g.current&&!g.current.contains(_.target)&&f(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);const y=m.useCallback(async(k,_)=>{if(k.trim().length<2){a([]),f(!1);return}u(!0);try{const{data:j,error:R}=await q.functions.invoke("places-autocomplete",{body:{input:k,locationBias:_}});if(R)throw R;const P=(j==null?void 0:j.predictions)||[];a(P),f(P.length>0)}catch(j){console.error("Autocomplete error:",j),a([])}finally{u(!1)}},[]),w=k=>{const _=k.target.value;t(_),s==null||s(),r==null||r(),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{y(_)},300)},x=k=>{var _;t(k.description),s==null||s(),f(!1),a([]),k.lat!==null&&k.lng!==null&&n({place_id:k.place_id,description:k.description,name:k.name,lat:k.lat,lng:k.lng,utcOffsetMinutes:k.utcOffsetMinutes??void 0,countryCode:k.countryCode??void 0,placeTypes:((_=k.placeTypes)==null?void 0:_.length)>0?k.placeTypes:void 0})},S=async()=>{var k;p(!0);try{const _=b&&b!=="your city"?b:"";if(!_){J.error("Could not detect your location. Please type it manually.");return}let j;try{const T=await new Promise((L,F)=>{navigator.geolocation.getCurrentPosition(L,F,{timeout:5e3})});j={lat:T.coords.latitude,lng:T.coords.longitude}}catch{}const{data:R,error:P}=await q.functions.invoke("places-autocomplete",{body:{input:_,locationBias:j}});if(P)throw P;const M=(R==null?void 0:R.predictions)||[];if(M.length>0){const T=M[0];t(T.description),s==null||s(),T.lat!==null&&T.lng!==null&&n({place_id:T.place_id,description:T.description,name:T.name,lat:T.lat,lng:T.lng,utcOffsetMinutes:T.utcOffsetMinutes??void 0,countryCode:T.countryCode??void 0,placeTypes:((k=T.placeTypes)==null?void 0:k.length)>0?T.placeTypes:void 0}),J.success("Location updated! 📍")}else t(_),s==null||s(),J.info("Set to detected city. Pick from suggestions for better accuracy.")}catch(_){console.error("Geo-detect error:",_),J.error("Could not detect location.")}finally{p(!1)}};return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:["Location ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsxs("div",{className:"flex gap-1.5",children:[l.jsxs("div",{className:"relative flex-1",ref:g,children:[l.jsx(er,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),l.jsx("input",{value:e,onChange:w,onFocus:()=>o.length>0&&f(!0),placeholder:"Search city or neighborhood...",className:ae(i||"h-8 w-full rounded-lg border border-border bg-background px-2.5 text-sm focus:outline-none focus:ring-1 focus:ring-ring transition-colors","pl-7"),autoComplete:"off"}),c&&l.jsx(js,{className:"absolute right-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground animate-spin"}),l.jsx(yt,{children:d&&o.length>0&&l.jsx(de.ul,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.12},className:"absolute left-0 right-0 top-full mt-1 z-[60] bg-card border border-border rounded-lg shadow-lg overflow-hidden",children:o.map(k=>l.jsxs("li",{onClick:()=>x(k),className:"px-3 py-2 text-sm cursor-pointer hover:bg-accent transition-colors flex items-start gap-2",children:[l.jsx(er,{className:"h-3.5 w-3.5 mt-0.5 text-muted-foreground shrink-0"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:k.name}),k.description!==k.name&&l.jsx("span",{className:"text-muted-foreground text-xs block",children:k.description})]})]},k.place_id))})})]}),l.jsx("button",{type:"button",onClick:S,disabled:h,className:"h-8 w-8 flex items-center justify-center rounded-lg border border-border bg-background hover:bg-accent transition-colors shrink-0 disabled:opacity-50",children:h?l.jsx(js,{className:"h-3.5 w-3.5 text-muted-foreground animate-spin"}):l.jsx(A4,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})};function xne(e){const t=new Date,n=t.getTime()+t.getTimezoneOffset()*6e4;return new Date(n+e*6e4)}function Vw(e){const t=xne(e),n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}function wne(e,t){const n=Vw(t);return e<n}const bne=({location:e,onLocationChange:t,onLocationModified:n,onPlaceSelect:r,onPlaceClear:s,startTime:i,onStartTimeChange:o,onStartTimeModified:a,endTime:c,onEndTimeChange:u,onEndTimeModified:d,date:f,onDateChange:h,peopleCount:p,onPeopleCountChange:g})=>{const{plannedCity:v}=vn(),[b,y]=m.useState(!1),w=m.useRef(null),x=_=>{if((v==null?void 0:v.utcOffsetMinutes)!=null){const j=Vw(v.utcOffsetMinutes),R=new Date(j+"T00:00:00");return _<R}return _<Pee()};m.useEffect(()=>{const _=j=>{w.current&&!w.current.contains(j.target)&&y(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);const S=()=>{const _=[];return e&&_.push(e),f&&_.push(f.toLocaleDateString("en-US",{month:"short",day:"numeric"})),(i||c)&&_.push(`${i||"--:--"} - ${c||"--:--"}`),_.push(`${p} ${p===1?"person":"people"}`),_.join(" · ")},C=Array.from({length:20},(_,j)=>j+1),k="h-8 w-full rounded-lg border border-border bg-background px-2.5 text-sm focus:outline-none focus:ring-1 focus:ring-ring transition-colors";return l.jsxs("div",{className:"relative",ref:w,children:[l.jsxs("button",{type:"button",onClick:()=>y(!b),className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer select-none",children:[l.jsx("span",{className:"truncate max-w-[200px] sm:max-w-[300px]",children:S()}),l.jsx(xi,{className:`h-3 w-3 transition-transform ${b?"rotate-180":""}`})]}),l.jsx(yt,{children:b&&l.jsxs(de.div,{initial:{opacity:0,y:-4}
668,animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:`absolute right-0 top-full mt-2 w-[300px] z-50
669                                   bg-card border border-border rounded-xl shadow-xl p-3`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:"Trip Details"}),l.jsx("button",{type:"button",onClick:()=>y(!1),className:"text-muted-foreground hover:text-foreground transition-colors",children:l.jsx(Dn,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx(vne,{value:e,onLocationChange:t,onPlaceSelect:r,onPlaceClear:s,onLocationModified:n,inputClass:k}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Time"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("input",{type:"time",value:i,onChange:_=>{o(_.target.value),a==null||a()},className:ae(k,"flex-1 [&::-webkit-calendar-picker-indicator]:invert [&::-webkit-calendar-picker-indicator]:opacity-50 [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:scale-75")}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"to"}),l.jsx("input",{type:"time",value:c,onChange:_=>{u(_.target.value),d==null||d()},className:ae(k,"flex-1 [&::-webkit-calendar-picker-indicator]:invert [&::-webkit-calendar-picker-indicator]:opacity-50 [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:scale-75")})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Date"}),l.jsxs(Tp,{children:[l.jsx(Pp,{asChild:!0,children:l.jsxs("button",{type:"button",className:ae(k,"flex items-center gap-1.5 text-left",!f&&"text-muted-foreground"),children:[l.jsx(Ga,{className:"h-3 w-3 shrink-0"}),l.jsx("span",{className:"truncate",children:f?$n(f,"MMM d"):"Pick"})]})}),l.jsx(Uu,{className:"w-auto p-0 bg-card border-border",align:"start",children:l.jsx(GM,{mode:"single",selected:f,onSelect:h,disabled:x,initialFocus:!0,className:ae("bg-card pointer-events-auto")})})]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"People"}),l.jsx("select",{value:p,onChange:_=>g(Number(_.target.value)),className:ae(k,"appearance-none cursor-pointer"),children:C.map(_=>l.jsxs("option",{value:_,children:[_," ",_===1?"person":"people"]},_))})]})]})]})]})})]})},Sne=({applyPreferences:e,onApplyPreferencesChange:t})=>{const[n,r]=m.useState(!1),s=m.useRef(null);return m.useEffect(()=>{const i=o=>{s.current&&!s.current.contains(o.target)&&r(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]),l.jsxs("div",{className:"relative",ref:s,children:[l.jsx("button",{type:"button",onClick:()=>r(!n),className:`flex items-center justify-center h-8 w-8 rounded-lg
670                           border border-border bg-background hover:bg-muted
671                           text-muted-foreground hover:text-foreground
672                           transition-colors`,children:l.jsx(Hh,{className:"h-4 w-4"})}),l.jsx(yt,{children:n&&l.jsxs(de.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.15},className:`absolute left-0 top-full mt-2 w-[260px] z-50
673                                   bg-card border border-border rounded-xl shadow-xl p-2`,children:[l.jsxs("button",{type:"button",className:`flex items-center gap-3 w-full px-3 py-2.5 rounded-lg
674                                       hover:bg-muted transition-colors text-left`,onClick:()=>{t(!e)},children:[l.jsx($4,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-[13px] text-foreground flex-1",children:"Apply my preferences"}),l.jsx(Iu,{checked:e,onCheckedChange:t,className:"scale-75"})]}),l.jsxs("button",{type:"button",className:`flex items-center gap-3 w-full px-3 py-2.5 rounded-lg
675                                       hover:bg-muted transition-colors text-left`,onClick:()=>{r(!1)},children:[l.jsx(N4,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-[13px] text-foreground",children:"Add must-include venues"})]})]})})]})},kne=({prompt:e,onPromptChange:t,onSubmit:n,isLoading:r,selectedTags:s,onTagSelect:i,location:o,onLocationChange:a,onLocationModified:c,startTime:u,onStartTimeChange:d,onStartTimeModified:f,endTime:h,onEndTimeChange:p,onEndTimeModified:g,date:v,onDateChange:b,peopleCount:y,onPeopleCountChange:w})=>{const{setPlannedCity:x}=vn(),[S,C]=m.useState(!1),k=m.useRef(null),_=e.trim().length>0;m.useEffect(()=>{k.current&&(k.current.style.height="auto",k.current.style.height=`${Math.min(k.current.scrollHeight,160)}px`)},[e]);const j=P=>{P.preventDefault(),P.stopPropagation();const M=document.getElementById("generate-venues-trigger");M&&M.click()},R=P=>{if(P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),_&&!r)){const M=document.getElementById("generate-venues-trigger");M&&M.click()}};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"border border-border rounded-2xl bg-card/80 backdrop-blur-sm shadow-lg overflow-visible",children:[l.jsx("div",{className:"px-4 pt-4 pb-2",children:l.jsx("textarea",{ref:k,value:e,onCh
675ange:P=>t(P.target.value),onKeyDown:R,placeholder:"Tell me what you're looking for...",disabled:r,rows:1,className:`w-full bg-transparent text-foreground placeholder:text-muted-foreground/60
676                                   text-sm sm:text-base resize-none outline-none min-h-[28px]`})}),l.jsxs("div",{className:"flex items-center justify-between px-3 pb-3",children:[l.jsx(Sne,{applyPreferences:S,onApplyPreferencesChange:C}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(bne,{location:o,onLocationChange:a,onLocationModified:c,onPlaceSelect:x,onPlaceClear:()=>x(null),startTime:u,onStartTimeChange:d,onStartTimeModified:f,endTime:h,onEndTimeChange:p,onEndTimeModified:g,date:v,onDateChange:b,peopleCount:y,onPeopleCountChange:w}),l.jsx("button",{type:"button",onClick:j,disabled:r||!_,className:`flex items-center justify-center h-8 w-8 rounded-lg transition-all
677                                       ${_?"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer":"bg-muted text-muted-foreground cursor-default"}
678                                       disabled:opacity-50`,children:r?l.jsx(js,{className:"h-4 w-4 animate-spin"}):_?l.jsx(hN,{className:"h-4 w-4"}):l.jsx(f4,{className:"h-4 w-4"})})]})]})]}),l.jsx(hZ,{onSelect:t})]})},_ne=({prompt:e,onPromptChange:t,onSubmit:n,isLoading:r,selectedTags:s,onTagSelect:i,location:o,onLocationChange:a,onLocationModified:c,startTime:u,onStartTimeChange:d,onStartTimeModified:f,endTime:h,onEndTimeChange:p,onEndTimeModified:g,date:v,onDateChange:b,peopleCount:y,onPeopleCountChange:w})=>{const x=S=>{S.preventDefault(),n()};return l.jsxs("form",{onSubmit:x,className:"space-y-8 max-w-2xl mx-auto",children:[l.jsxs(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"text-center space-y-4",children:[l.jsx("h2",{className:"text-3xl sm:text-4xl font-bold gradient-text animate-text-gradient",children:"Hey there! I'm EZY 👋"}),l.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground",children:"Tell me what you're looking for, and I'll craft the perfect plan just for you!"})]}),l.jsx(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.5},className:"space-y-6",children:l.jsx(kne,{prompt:e,onPromptChange:t,location:o,onLocationChange:a,onLocationModified:c,startTime:u,onStartTimeChange:d,onStartTimeModified:f,endTime:h,onEndTimeChange:p,onEndTimeModified:g,onSubmit:n,isLoading:r,selectedTags:s,onTagSelect:i,date:v,onDateChange:b,peopleCount:y,onPeopleCountChange:w})})]})},Cne=120,jne=100;let Ul=null,pg=null;const Vt=({content:e,variant:t="icon",children:n,className:r,contentClassName:s,side:i="top",align:o="center",iconClassName:a,ariaLabel:c="More info",stopPropagation:u=!0})=>{const d=m.useRef(Symbol("info-hint")),[f,h]=m.useState(!1),p=m.useCallback(k=>{k?(Ul==null||Ul(),Ul=()=>h(!1),pg=d.current):pg===d.current&&(Ul=null,pg=null),h(k)},[]),g=m.useRef(null),v=m.useRef(null),b=m.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(hover: hover) and (pointer: fine)").matches,[]),y=()=>{g.current&&(window.clearTimeout(g.current),g.current=null),v.current&&(window.clearTimeout(v.current),v.current=null)},w=()=>{b&&(y(),g.current=window.setTimeout(()=>p(!0),Cne))},x=()=>{b&&(y(),v.current=window.setTimeout(()=>p(!1),jne))};m.useEffect(()=>()=>y(),[]),m.useEffect(()=>{if(!f)return;const k=()=>p(!1);return window.addEventListener("touchmove",k,{passive:!0}),window.addEventListener("scroll",k,!0),window.addEventListener("wheel",k,{passive:!0}),()=>{window.removeEventListener("touchmove",k),window.removeEventListener("scroll",k,!0),window.removeEventListener("wheel",k)}},[f]);const S=k=>{u&&k.stopPropagation()};let C;return t==="icon"?C=l.jsx("button",{type:"button","aria-label":c,onClick:S,onMouseEnter:w,onMouseLeave:x,className:ae("inline-flex items-center justify-center text-muted-foreground/70 hover:text-foreground transition-colors cursor-help align-middle",r),children:l.jsx(j4,{className:ae("h-3.5 w-3.5",a)})}):t==="underline"?C=l.jsx("button",{type:"button","aria-label":c,onClick:S,onMouseEnter:w,onMouseLeave:x,className:ae("inline border-b border-dotted border-muted-foreground
678/60 hover:border-foreground/80 cursor-help bg-transparent p-0 text-left",r),children:n}):C=l.jsx("span",{onClick:S,onMouseEnter:w,onMouseLeave:x,className:ae("inline-flex cursor-help border-b border-dotted border-muted-foreground/50 hover:border-foreground/80 transition-colors leading-none pb-px",r),children:n}),l.jsxs(sI,{open:f,onOpenChange:p,children:[l.jsx(iI,{asChild:!0,children:C}),l.jsx(oI,{children:l.jsx(Bw,{side:i,align:o,sideOffset:6,collisionPadding:8,onMouseEnter:w,onMouseLeave:x,onOpenAutoFocus:k=>k.preventDefault(),className:ae("z-[100] max-w-[260px] rounded-none border border-border/80 bg-[hsl(var(--popover)/0.8)] px-3 py-2 text-xs text-[hsl(var(--popover-foreground))] shadow-lg outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),children:e})})]})};function Ene(e,t,n){const r=e&&e.trim()||n&&n.trim()||"",s=new URLSearchParams({api:"1"});return r&&s.set("query",r),t&&s.set("query_place_id",t),`https://www.google.com/maps/search/?${s.toString()}`}function Nne(e){const{originName:t,originPlaceId:n,destinationName:r,destinationPlaceId:s,travelMode:i="transit"}=e;return!n||!s?null:`https://www.google.com/maps/dir/?${new URLSearchParams({api:"1",origin:t&&t.trim()||" ",origin_place_id:n,destination:r&&r.trim()||" ",destination_place_id:s,travelmode:i}).toString()}`}const pC=e=>e?typeof e=="string"?{drive:e}:typeof e=="object"?e:null:null,Tne=({travelTimes:e,travelDistances:t,compact:n=!1,originName:r,originPlaceId:s,destinationName:i,destinationPlaceId:o})=>{const a=pC(e);if(!a)return null;const c=pC(t),u=a.transit;if(!u)return null;const d=c==null?void 0:c.transit,f=Nne({originName:r,originPlaceId:s,destinationName:i,destinationPlaceId:o,travelMode:"transit"}),h=!d,p=l.jsxs(l.Fragment,{children:[l.jsx(g4,{className:"inline-block align-[-0.15em] h-3 w-3 mr-1 text-muted-foreground"}),u,!n&&d&&l.jsxs("span",{className:"text-muted-foreground/60",children:[" (",d,")"]})]}),g=`Transit: ${u}${d?` (${d})`:""}${h?" (AI estimate)":""}`,v=h&&l.jsx(Vt,{variant:"icon",iconClassName:"h-3 w-3 text-yellow-500/80",side:"right",ariaLabel:"About this travel estimate",content:"AI-estimated travel time — transit API unavailable for this region"});return f?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline decoration-primary",onClick:b=>b.stopPropagation(),children:p}),l.jsx(Vt,{variant:"icon",content:g,ariaLabel:"Travel details"}),v]}):l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:p}),l.jsx(Vt,{variant:"icon",content:g,ariaLabel:"Travel details"})]}),v]})};function Pne(){const e=m.useRef(null),[t,n]=m.useState(void 0);return m.useEffect(()=>{const r=e.current;if(!r||typeof ResizeObserver>"u")return;const s=new ResizeObserver(i=>{for(const o of i){const a=o.contentRect.width;n(a)}});return s.observe(r),n(r.getBoundingClientRect().width),()=>s.disconnect()},[]),[e,t]}const Ane=ku("inline-flex items-center gap-1 h-5 rounded-full border px-2 text-[10px] font-medium leading-none whitespace-nowrap",{variants:{variant:{success:"bg-green-500/15 text-green-400 border-green-500/20",danger:"bg-red-500/15 text-red-400 border-red-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",info:"bg-blue-500/15 text-blue-400 border-blue-500/20",neutral:"bg-muted/50 text-muted-foreground border-border",accent:"bg-primary/10 text-primary border-primary/20",outline:"bg-transparent text-muted-foreground border-border",muted:"bg-muted text-muted-foreground border-border italic"}},defaultVariants:{variant:"neutral"}}),wh=m.forwardRef(({className:e,variant:t,leading:n,children:r,...s},i)=>l.jsxs("span",{ref:i,className:ae(Ane({variant:t}),e),...s,children:[n,r]}));wh.displayName="Pill";const Rne=({images:e=[],compact:t,isMobile:n=!1})=>{const r=t??n,[s,i]=m.useState(0),o=()=>{e!=null&&e.length&&i(d=>(d+1)%e.length)},a=()=>{e!=null&&e.length&&i(d=>(d-1+e.length)%e.length)},c=r?"h-[8.64rem]":"h-full min-h-[16rem]",u=r?"rounded-t-[1.5rem]":"rounded-tl-[1.5rem] rounded-bl-[1.5rem]";return!e||e.length===0?l.jsxs("div",{className:ae("w-full bg-secondary/40 border border-dashed border-border/50 flex flex-col items-center justify-center gap-2",u,c),children:[l.jsx(C4,{className:"h-6 w-6 text-muted-foreground
678/60"}),l.jsx("p",{className:"text-xs text-muted-foreground/70",children:"No image available"})]}):l.jsxs("div",{className:ae("relative w-full overflow-hidden",u,c),children:[l.jsx("img",{src:e[s],alt:"Venue",className:ae("absolute inset-0 w-full h-full object-cover",u),onError:d=>{d.currentTarget.src="/placeholder.svg"}}),e.length>1&&l.jsxs(l.Fragment,{children:[l.jsx(Fe,{variant:"ghost",size:"icon",className:"absolute left-1 top-1/2 transform -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white rounded-full shadow-sm h-7 w-7",onClick:a,children:l.jsx(Fx,{className:"h-4 w-4"})}),l.jsx(Fe,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 transform -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white rounded-full shadow-sm h-7 w-7",onClick:o,children:l.jsx(wo,{className:"h-4 w-4"})}),l.jsx("div",{className:"absolute bottom-3 left-1/2 transform -translate-x-1/2 flex gap-1.5 bg-black/30 rounded-full px-2 py-1",children:e.map((d,f)=>l.jsx("div",{className:ae("w-2 h-2 rounded-full transition-colors",f===s?"bg-white":"bg-white/40")},f))})]})]})},Mne=(e=6e3)=>new Promise(t=>{if(typeof navigator>"u"||!navigator.geolocation){t(null);return}let n=!1;const r=s=>{n||(n=!0,t(s))};navigator.geolocation.getCurrentPosition(s=>r({latitude:s.coords.latitude,longitude:s.coords.longitude,addressLine1:"Current location"}),()=>r(null),{timeout:e,maximumAge:6e4,enableHighAccuracy:!1}),setTimeout(()=>r(null),e+500)}),aI=({venueName:e,address:t,latitude:n,longitude:r,pickup:s})=>{const i={},o=(e||"").trim(),a=(t||"").trim();o&&(i.addressLine1=o),a&&(i.addressLine2=a),typeof n=="number"&&typeof r=="number"&&Number.isFinite(n)&&Number.isFinite(r)&&(i.latitude=n,i.longitude=r);const c=new URLSearchParams;if(c.set("drop[0]",JSON.stringify(i)),s&&Number.isFinite(s.latitude)&&Number.isFinite(s.longitude)){const u={latitude:s.latitude,longitude:s.longitude};s.addressLine1&&(u.addressLine1=s.addressLine1),s.addressLine2&&(u.addressLine2=s.addressLine2),c.set("pickup",JSON.stringify(u))}return`https://m.uber.com/looking?${c.toString()}`},Ine=({venueName:e,address:t,location:n,latitude:r,longitude:s,pickup:i})=>{const o=(t==null?void 0:t.trim())||(n==null?void 0:n.trim())||"",a=aI({venueName:e,address:o,latitude:r,longitude:s,pickup:i}),c=`https://www.opentable.com/restref/client/?restref=${encodeURIComponent(e)}&ref=ezy_nightlife`;return{uber:a,openTable:c}},mC=async(e,t,n)=>{try{const{data:r,error:s}=await q.from("venue_interactions").insert([{venue_id:e,user_id:n,type:`affiliate_click_${t}`}]);if(s)throw s;return r}catch(r){console.error("Error tracking affiliate click:",r)}},One=e=>{if(!e)return!1;try{const t=new URL(e);return!t.hostname.endsWith("uber.com")||!t.pathname.startsWith("/looking")?!1:t.searchParams.has("drop[0]")}catch{return!1}},Dne=({venue:e})=>{const[t,n]=m.useState();m.useEffect(()=>{q.auth.getSession().then(({data:{session:o}})=>{var a;n((a=o==null?void 0:o.user)==null?void 0:a.id)})},[]);const r=async()=>{const o=await Mne();let a;o?a=aI({venueName:e.name,address:e.address||e.location,latitude:e.latitude??null,longitude:e.longitude??null,pickup:o}):a=One(e.uber_link)?e.uber_link:Ine({venueName:e.name,address:e.address||"",location:e.location,latitude:e.latitude??null,longitude:e.longitude??null}).uber,e.id&&await mC(e.id,"uber",t),window.open(a,"_blank","noopener,noreferrer"),J.success(o?"Opening Uber with your current location as pickup… 🚗":"Opening Uber… Enjoy your ride! 🚗")},s=async()=>{if(!e.reservation_link){J.error("Reservations not available for this venue");return}e.id&&await mC(e.id,"openTable",t),window.open(e.reservation_link,"_blank"),J.success("Opening reservations... Bon appétit! 🍽️")},i=()=>{e.website_url?(window.open(e.website_url,"_blank"),J.success("Opening venue website...")):J.error("Website not available")};return l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.jsxs(Fe,{variant:"outline",onClick:r,className:"h-6 px-2 text-[10px] bg-primary/5 hover:bg-primary/10 text-primary",children:[l.jsx(v4,{className:"h-3 w-3 mr-0.5"}),"Get a Ride"]}),e.reservation_link&&l.jsxs(Fe,{variant:"outline",onClick:s,className:"h-6 px-2 text-[10px] bg-primary/5 hover:bg-primary/10 text-primary",children:[l.jsx(y4,{className:"h-3 w-3 mr-0.5"}),"Reserve"]}),e.website_url&&l.jsxs(Fe,{variant:"outline",onClick:i,className:"h-6 px-2 text-[10px] bg-primary/5 hover:bg-primary/10 text-primary",children:[l.jsx(wN,{className:"h-3 w-3 mr-0.5"}),"Website"]})]})},Lne=({badges:e,className:t})=>{const n=m.useRef(null),[r,s]=m.useState(!1),[i,o]=m.useState(!1),a=m.useCallback(()=>{const u=n.current;if(!u)return;const{scrollLeft:d,scrollWidth:f,clientWidth:h}=u;s(d>1),o(d+h<f-1)},[]);m.useEffect(()=>{a();const u=n.current;if(!u)return;u.addEventListener("scroll",a,{passive:!0});const d=new ResizeObserver(a);return d.observe(u),()=>{u.removeEventListener("scroll",a),d.disconnect()}},[a,e]);const c=u=>{const d=n.current;d&&d.scrollBy({left:u*d.clientWidth*.8,behavior:"smooth"})};return!e||e.length===0?null:l.jsxs("div",{className:ae("group/badges relative",t),children:[r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pointer-events-none absolute left-0 top-0 bottom-0 w-6 bg-gradient-to-r from-card to-transparent z-10"}),l.jsx("button",{type:"button",onClick:()=>c(-1),"aria-label":"Scroll badges left",className:"hidden md:group-hover/badges:flex absolute left-0 top-1/2 -translate-y-1/2 z-20 h-5 w-5 items-center justify-center rounded-full bg-background/90 border border-border shadow-sm hover:bg-accent transition-colors",children:l.jsx(Fx,{className:"h-3 w-3"})})]}),l.jsx("div",{ref:n,className:"flex gap-1 overflow-x-auto snap-x snap-mandatory scrollbar-hide scroll-smooth",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((u,d)=>l.jsx(wh,{variant:"accent",className:"flex-shrink-0 snap-start",children:u},d))}),i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pointer-events-none absolute right-0 top-0 bottom-0 w-6 bg-gradient-to-l from-card to-transparent z-10"}),l.jsx("button",{type:"button",onClick:()=>c(1),"aria-label":"Scroll badges right",className:"hidden md:group-hover/badges:flex absolute right-0 top-1/2 -translate-y-1/2 z-20 h-5 w-5 items-center justify-center rounded-full bg-background/90 border border-border shadow-sm hover:bg-accent transition-colors",children:l.jsx(wo,{className:"h-3 w-3"})})]})]})};
678function gC(e,t,n){const r=t==null?void 0:t.find(i=>i.date===e),s=n==null?void 0:n.find(i=>i.date===e);return r&&s?{holidayName:r.name,label:"Holiday hours",color:"green"}:r&&!s?{holidayName:r.name,label:"Hours might differ",color:"gray"}:!r&&s?{label:"Special hours",color:"green"}:null}function $d(e){let t=e.replace(/\s*-\s*/g," – ");return t=t.replace(/:00(\s*(AM|PM|am|pm))/g,"$1"),t}function lI(e){return e.split(", ").filter(Boolean).map(t=>{if(t.indexOf("|")===10){const o=t.substring(0,10),a=t.substring(11),c=a.indexOf(":"),u=c>0?a.substring(0,c).trim():"",d=c>0?a.substring(c+1).trim():a;return{dayName:u,hoursText:d,dateStr:o}}const r=t.indexOf(":"),s=r>0?t.substring(0,r).trim():"",i=r>0?t.substring(r+1).trim():t;return{dayName:s,hoursText:i}})}const $ne=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];function Fne(e){const t=new Date(e+"T12:00:00"),n=t.getDay(),r=n===0?6:n-1,s={};for(let i=0;i<7;i++){const o=i-r,a=new Date(t.getTime()+o*864e5),c=a.getFullYear(),u=String(a.getMonth()+1).padStart(2,"0"),d=String(a.getDate()).padStart(2,"0");s[$ne[i]]=`${c}-${u}-${d}`}return s}function Ov(e){return new Date(e+"T12:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric"})}function zne(e,t){if(!e||!(t!=null&&t.length))return null;const n=Fne(e),r=new Date(e+"T12:00:00"),s=r.toLocaleDateString("en-US",{weekday:"long"}),i=n[s];if(!i)return null;const o=t.find(c=>c.date===i);if(!o)return null;const a=r.toLocaleDateString("en-US",{weekday:"short"});return{holidayName:o.name,shortDay:a,dateLabel:Ov(i)}}function Bne(e,t){const n=lI(e);if(t&&n.some(a=>a.dateStr)){const a=n.find(c=>c.dateStr===t);if(a)return{label:a.dayName,dayName:a.dayName,hours:a.hoursText,dateStr:a.dateStr}}const s=(t?new Date(t+"T12:00:00"):new Date).toLocaleDateString("en-US",{weekday:"long"}),i=n.find(a=>a.dayName===s);if(i)return{label:t?s:"Today",dayName:s,hours:i.hoursText,dateStr:i.dateStr};const o=n[0];return{label:(o==null?void 0:o.dayName)||s,dayName:(o==null?void 0:o.dayName)||s,hours:(o==null?void 0:o.hoursText)||e,dateStr:o==null?void 0:o.dateStr}}const Vne=({level:e})=>l.jsx(Vt,{variant:"wrap",content:`Price level: ${e}/4`,ariaLabel:"Price level",children:l.jsx("span",{className:"flex items-center text-sm",children:Array.from({length:4},(t,n)=>l.jsx("span",{className:ae("text-xs font-bold -mx-px",n<e?"text-primary":"text-muted-foreground/20"),children:"$"},n))})}),Une=e=>{switch(e==null?void 0:e.toLowerCase()){case"open at visit time":case"open now":return"success";case"closed at visit time":case"closed":return"danger";case"closes during visit":case"closes soon":return"warning";case"opens during visit":case"opens soon":return"warning";case"hours unavailable":return"muted";default:return"neutral"}},Hne=e=>{switch(e==null?void 0:e.toLowerCase()){case"closes during visit":return"This venue closes before your visit ends — you may have less time here than planned.";case"opens during visit":return"This venue is closed when your visit starts and only opens partway through — you may need to wait or arrive later.";default:return null}},Wne=({venue:e,selectedDate:t,defaultCollapsed:n=!1,compact:r,renderActions:s,renderTopActions:i,expandSignal:o,cardDiff:a,diffVariant:c="after",className:u})=>{const d=$u(),f=r??d,[h,p]=m.useState(!n),[g,v]=m.useState(!1);m.useEffect(()=>{o&&p(o.expanded)},[o==null?void 0:o.nonce]);const b=e.image_urls&&e.image_urls.length>0;return l.jsxs("div",{id:e.id?`venue-card-${e.id}`:void 0,className:ae("relative overflow-visible rounded-xl"),children:[i&&l.jsx("div",{className:"absolute -top-4 -right-4 z-20 flex items-center gap-1",children:i(e)}),l.jsx("div",{className:ae("group glass-card overflow-hidden transition-all duration-300 relative","border-primary/10 hover:border-primary/20",(a==null?void 0:a.kind)==="added"&&"diff-glow-card diff-a
678dded",(a==null?void 0:a.kind)==="removed"&&"diff-glow-card diff-removed",u),children:l.jsxs("div",{className:ae("flex",f?"flex-col":"flex-row"),children:[(b||!f)&&l.jsx("div",{className:ae("relative flex-shrink-0 overflow-hidden",f?"w-full":"w-64 min-h-[16rem]"),children:l.jsx(Rne,{images:e.image_urls??[],isMobile:f})}),l.jsxs("div",{className:"flex flex-1 flex-col min-w-0",children:[l.jsx("div",{className:"relative p-4 pb-0",children:l.jsxs("div",{className:"min-w-0 space-y-1.5 pr-1",children:[l.jsxs("div",{className:"flex gap-2 items-start justify-between",children:[l.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[l.jsx("h3",{className:ae("text-base font-semibold leading-tight",(a==null?void 0:a.kind)==="modified"&&a.changedFields.has("name")&&`diff-glow-field diff-modified-${c}`),children:e.name}),e.venue_category&&l.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[l.jsx(U4,{className:"h-3 w-3 flex-shrink-0"}),l.jsx("span",{children:e.venue_category})]})]}),l.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[e.opening_status&&(()=>{const y=Hne(e.opening_status),w=l.jsxs(wh,{variant:Une(e.opening_status),className:"mt-0.5",children:[y&&l.jsx(Kc,{className:"h-3 w-3 mr-1"}),e.opening_status]});return y?l.jsx(Vt,{variant:"wrap",side:"bottom",ariaLabel:"Status warning",content:y,children:w}):w})(),e.openNow_at_query_time!=null&&(()=>{const y=e.live_status_label,w=y||(e.openNow_at_query_time?"Open now":"Closed"),x=y?`${y} — based on Google's live status right now.`:e.openNow_at_query_time?"Open right now — you can call or message the venue.":"Closed right now — calls or messages may go unanswered.",S=(y==null?void 0:y.toLowerCase())??"",C=S.includes("closes soon")?"bg-amber-400":S.includes("opens soon")?"bg-blue-400":e.openNow_at_query_time?"bg-green-400":"bg-muted-foreground/60";return l.jsx(Vt,{variant:"wrap",side:"bottom",ariaLabel:"Live status",content:x,children:l.jsxs(wh,{variant:"neutral",leading:l.jsx("span",{className:ae("h-1.5 w-1.5 rounded-full",C)}),children:["Live: ",w]})})})()]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[e.google_rating!=null&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Ux,{className:"h-3.5 w-3.5 fill-yellow-500 text-yellow-500"}),l.jsx("span",{className:"text-sm font-medium text-foreground",children:e.google_rating.toFixed(1)}),e.google_reviews_count!=null&&l.jsxs("span",{children:["(",e.google_reviews_count.toLocaleString(),")"]})]}),e.google_rating!=null&&(e.price_level!=null&&e.price_level>0||e.estimated_price_range)&&l.jsx("span",{className:"text-muted-foreground/40",children:"·"}),e.price_level!=null&&e.price_level>0&&l.jsxs("div",{className:"flex items-center gap-1",children:[e.price_level_source==="google"?l.jsx(Vt,{variant:"wrap",side:"top",ariaLabel:"Source",content:"Sourced from Google Places",children:l.jsx(j1,{className:"h-3 w-3 text-blue-400 shrink-0"})}):l.jsx(Vt,{variant:"wrap",side:"top",ariaLabel:"Source",content:"AI-estimated",children:l.jsx(Pr,{className:"h-3 w-3 text-amber-400 shrink-0"})}),l.jsx(Vne,{level:e.price_level})]}),e.price_level!=null&&e.price_level>0&&e.estimated_price_range&&l.jsx("span",{className:"text-muted-foreground/40",children:"·"}),e.estimated_price_range&&l.jsxs("div",{className:"flex items-center gap-1",children:[e.estimated_price_range_source==="google"?l.jsx(Vt,{variant:"wrap",side:"top",ariaLabel:"Source",content:"Sourced from Google Places",children:l.jsx(j1,{className:"h-3 w-3 text-blue-400 shrink-0"})}):l.jsx(Vt,{variant:"wrap",side:"top",ariaLabel:"Source",content:"AI-estimated",children:l.jsx(Pr,{className:"h-3 w-3 text-amber-400 shrink-0"})}),l.jsx("span",{children:e.estimated_price_range})]})]}),e.description&&l.jsx("p",{className:ae("text-sm text-muted-foreground leading-relaxed",(a==null?void 0:a.kind)==="modified"&&a.changedFields.has("description")&&`diff-glow-field diff-modified-${c}`),children:e.description}),e.badges&&e.badges.length>0&&l.jsx(Lne,{badges:e.badges})]})}),l.jsx(yt,{initial:!1,children:h&&l.jsx(de.div,{initial:{height:0,opacity:0}
678,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:l.jsxs("div",{className:"px-4 pb-1 pt-3 space-y-3",children:[(e.address||e.location)&&l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(er,{className:"h-3.5 w-3.5 flex-shrink-0"}),l.jsx("a",{href:Ene(e.name,e.place_id,e.address||e.location),target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline transition-colors",children:e.address||e.location})]}),e.phone_number&&l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(M4,{className:"h-3.5 w-3.5 flex-shrink-0"}),l.jsx("a",{href:`tel:${e.phone_number}`,className:"text-primary hover:underline",children:e.phone_number})]}),e.hours&&(()=>{const y=(e.hours_source||"regular")==="current",w=lI(e.hours),x=w.length>1,S=Bne(e.hours,t);if(!y){const k=zne(t,e.holiday_info);return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("button",{type:"button",onClick:_=>{_.stopPropagation(),v(j=>!j)},className:"grid w-full grid-cols-[0.875rem_1fr] items-start gap-x-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",children:[l.jsx(bo,{className:"mt-0.5 h-3.5 w-3.5 flex-shrink-0"}),g?l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"text-[11px] leading-snug text-foreground flex items-center gap-1",children:["Opening hours",l.jsx(Vt,{side:"top",iconClassName:"h-3 w-3",className:"text-muted-foreground/50 hover:text-foreground",content:"Typical weekly hours"})]}),l.jsx(dm,{className:"mt-0.5 h-3 w-3 flex-shrink-0"})]}):l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("span",{className:"text-[11px] leading-snug font-bold text-foreground",children:S.dayName}),l.jsx("span",{className:"text-[11px] leading-snug font-bold text-foreground",children:$d(S.hours)}),k&&l.jsx(Vt,{variant:"wrap",side:"top",ariaLabel:"Holiday alert",content:`Holiday Alert: Your visit day (${k.shortDay}, ${k.dateLabel}) is ${k.holidayName}, so hours might differ!`,children:l.jsx(Kc,{className:"h-3 w-3 flex-shrink-0 text-amber-400"})})]}),x&&l.jsx(xi,{className:"mt-0.5 h-3 w-3 flex-shrink-0"})]})]}),l.jsx(yt,{children:g&&x&&l.jsxs(de.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"grid grid-cols-[0.875rem_1fr] gap-x-2 overflow-hidden pt-1",children:[l.jsx("div",{"aria-hidden":"true"}),l.jsx("div",{className:"space-y-1.5 text-[11px] text-muted-foreground",children:w.map((_,j)=>{const R=_.dayName===S.dayName;return l.jsxs("div",{className:"grid grid-cols-[6rem_1fr] gap-x-3 items-start",children:[l.jsx("div",{className:ae("text-[11px] leading-snug",R?"font-bold text-foreground":"text-muted-foreground"),children:_.dayName}),l.jsx("div",{className:ae("text-[11px] leading-snug",R?"font-bold text-foreground":"text-muted-foreground"),children:$d(_.hoursText)})]},j)})})]})})]})}const C=S.dateStr?gC(S.dateStr,e.holiday_info,e.special_days):null;return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("button",{type:"button",onClick:k=>{k.stopPropagation(),v(_=>!_)},className:"grid w-full grid-cols-[0.875rem_1fr] items-start gap-x-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground",children:[l.jsx(bo,{className:"mt-0.5 h-3.5 w-3.5 flex-shrink-0"}),g?l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"text-[11px] leading-snug text-foreground flex items-center gap-1",children:["Opening hours",l.jsx(Vt,{side:"top",iconClassName:"h-3 w-3",className:"text-muted-foreground/50 hover:text-foreground",content:"Live hours for your visit dates"})]}),l.jsx(dm,{className:"mt-0.5 h-3 w-3 flex-shrink-0"})]}):l.jsxs("div",{className:"grid grid-cols-[6rem_1fr] items-start gap-x-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[11px] leading-snug font-bold text-foreground",children:S.dayName}),S.dateStr&&l.jsxs("div",{className:"text-[10px] leading-tight text-muted-foreground
678/50",children:[Ov(S.dateStr),(C==null?void 0:C.holidayName)&&` · ${C.holidayName}`]})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsx("div",{className:"text-[11px] leading-snug font-bold text-foreground",children:$d(S.hours)}),x&&l.jsx(xi,{className:"mt-0.5 h-3 w-3 flex-shrink-0"})]}),C&&l.jsx("span",{className:ae("text-[10px] leading-tight",C.color==="green"?"text-green-400":"text-muted-foreground/50"),children:C.label})]})]})]}),l.jsx(yt,{children:g&&x&&l.jsxs(de.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"grid grid-cols-[0.875rem_1fr] gap-x-2 overflow-hidden pt-1",children:[l.jsx("div",{"aria-hidden":"true"}),l.jsx("div",{className:"space-y-1.5 text-[11px] text-muted-foreground",children:w.map((k,_)=>{const j=k.dateStr?k.dateStr===t:k.dayName===S.dayName,R=k.dateStr?gC(k.dateStr,e.holiday_info,e.special_days):null;return l.jsxs("div",{className:"grid grid-cols-[6rem_1fr] gap-x-3 items-start",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:ae("text-[11px] leading-snug",j?"font-bold text-foreground":"text-muted-foreground"),children:k.dayName}),k.dateStr&&l.jsxs("div",{className:"text-[10px] text-muted-foreground/50 leading-tight",children:[Ov(k.dateStr),(R==null?void 0:R.holidayName)&&` · ${R.holidayName}`]})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:ae("text-[11px] leading-snug",j?"font-bold text-foreground":"text-muted-foreground"),children:$d(k.hoursText)}),R&&l.jsx("span",{className:ae("text-[10px] leading-tight",R.color==="green"?"text-green-400":"text-muted-foreground/50"),children:R.label})]})]},k.dateStr||_)})})]})})]})})(),e.fun_fact&&l.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 rounded-md bg-primary/5 border border-primary/10",children:[l.jsx("span",{className:"flex-shrink-0 text-[10px] leading-none",children:"✦"}),l.jsx("p",{className:"text-xs text-primary/80 italic leading-snug",children:e.fun_fact})]}),l.jsx(Dne,{venue:e})]})},"details")}),s&&l.jsx("div",{className:"mt-auto px-3 py-1.5 border-t border-border/30",children:s(e)}),l.jsx("button",{type:"button",onClick:()=>p(y=>!y),className:"mt-auto w-full flex items-center justify-center gap-1 py-0 leading-none text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70 hover:text-muted-foreground hover:bg-muted/30 border-t border-border/40 transition-colors cursor-pointer","aria-label":h?"Collapse details":"Expand details","aria-expanded":h,children:h?l.jsxs(l.Fragment,{children:["Less info ",l.jsx(dm,{className:"h-3 w-3",strokeWidth:2})]}):l.jsxs(l.Fragment,{children:["More info ",l.jsx(xi,{className:"h-3 w-3",strokeWidth:2})]})})]})]})})]})},qne=760,Gne={duration:.28,ease:"easeOut"},Uw=({venues:e,mode:t="saved",selectedDate:n,utcOffsetMinutes:r,renderVenueActions:s,renderTopVenueActions:i,diff:o=null,diffVariant:a="after",renderFooter:c,className:u,hideBulkToggle:d=!1,bulkSignalControlled:f})=>{const h=$u(),[p,g]=Pne(),v=g!=null?g<qne:h,b=e,y=t==="planning",[w,x]=m.useState(null),S=f!==void 0?f:w,C=(S==null?void 0:S.expanded)??!y,k=()=>{x(_=>({expanded:!((_==null?void 0:_.expanded)??!y),nonce:((_==null?void 0:_.nonce)??0)+1}))};return l.jsx("div",{ref:p,className:ae("w-full",u),children:l.jsxs("div",{className:"w-full",children:[!d&&b.length>1&&l.jsx("div",{className:"flex justify-start sm:justify-end px-3 sm:px-6 pt-3",children:l.jsx("button",{type:"button",onClick:k,className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1 rounded-md hover:bg-muted/50","aria-label":C?"Collapse all venue details":"Expand all venue details",children:C?l.jsxs(l.Fragment,{children:[l.jsx(gN,{className:"h-3.5 w-3.5"}),"Collapse all"]}):l.jsxs(l.Fragment,{children:[l.jsx(yN,{className:"h-3.5 w-3.5"}),"Expand all"]})})}),l.jsx("div",{className:ae("pr-3 sm:pr-6 py-4 sm:py-6",v?"pl-3":"pl-10 sm:pl-12"),children:l.jsx(yt,{initial:!1,children:b.map((_,j)=>{var A,D;const R=j===0,P=j===b.length-1,M=b.length===1,T=typeof _.travel_time_to_next=="object"&&_.travel_time_to_next?_.travel_time_to_next:null,L=!P&&T&&(T.transit||typeof _.travel_time_to_next=="string"),F=zX(o,_),z=E=>(F==null?void 0:F.kind)==="modified"&&F.changedFields.has(E),V=`diff-glow-field diff-modified-${a}`,I=E=>`${E}-${a}
678`;return l.jsxs(de.div,{layout:!0,initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:Gne,style:{overflow:"visible"},children:[l.jsxs("div",{className:"flex gap-3 sm:gap-4",children:[l.jsxs("div",{className:"relative flex-shrink-0 w-8 sm:w-9",children:[!M&&l.jsx("div",{className:ae("absolute left-1/2 -translate-x-1/2 w-[3px] bg-primary/60",R&&"top-1/2 bottom-0",P&&"top-0 bottom-1/2",!R&&!P&&"top-0 bottom-0"),"aria-hidden":!0}),l.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-10 flex items-center justify-center w-8 h-8 sm:w-9 sm:h-9 rounded-full bg-primary/25 border-2 border-primary/70 backdrop-blur-sm shadow-sm shadow-primary/20",children:l.jsx(er,{className:"h-4 w-4 sm:h-5 sm:w-5 text-primary fill-primary/30"})})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx("span",{className:ae("text-xs sm:text-sm font-semibold text-primary",z("time")&&V),children:_.time},z("time")?I("time"):"time"),_.duration_minutes&&l.jsxs("span",{className:ae("text-[10px] sm:text-xs text-muted-foreground bg-muted/50 px-2 py-0.5 rounded-full",z("duration_minutes")&&V),children:[_.duration_minutes," min"]},z("duration_minutes")?I("dur"):"dur")]}),l.jsx(Wne,{venue:_,selectedDate:n,defaultCollapsed:y,compact:v,cardDiff:F,diffVariant:a,renderActions:s?E=>s(E,j):void 0,renderTopActions:i?E=>i(E,j):void 0,expandSignal:S,className:"border-primary/5"})]})]}),L&&l.jsxs("div",{className:"flex gap-3 sm:gap-4",children:[l.jsxs("div",{className:"relative flex-shrink-0 w-8 sm:w-9 overflow-visible min-h-[4rem] sm:min-h-[5rem]",children:[l.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 w-[3px] bg-primary/60 top-0 bottom-0","aria-hidden":!0}),l.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 z-10",children:l.jsx("div",{className:ae("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-background border border-border shadow-sm whitespace-nowrap",z("travel_to_next")&&V),children:l.jsx(Tne,{travelTimes:_.travel_time_to_next,travelDistances:_.travel_distance_to_next,compact:h,originName:_.name,originPlaceId:_.place_id,destinationName:(A=b[j+1])==null?void 0:A.name,destinationPlaceId:(D=b[j+1])==null?void 0:D.place_id})},z("travel_to_next")?I("travel"):"travel")})]}),l.jsx("div",{className:"flex-1 min-w-0"})]}),!P&&!L&&l.jsx("div",{className:"flex gap-3 sm:gap-4 py-4 sm:py-6",children:l.jsx("div",{className:"relative flex-shrink-0 w-8 sm:w-9",children:l.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 w-[3px] bg-primary/60 top-0 bottom-0","aria-hidden":!0})})})]},_.id)})})}),c&&l.jsx("div",{className:"px-3 sm:px-6 pb-4 sm:pb-6",children:c()})]})})};var Kne="VisuallyHidden",cI=m.forwardRef((e,t)=>l.jsx(Je.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));cI.displayName=Kne;var Yne=cI,[Ap,kie]=Bs("Tooltip",[pl]),Rp=pl(),uI="TooltipProvider",Jne=700,Dv="tooltip.open",[Xne,Hw]=Ap(uI),dI=e=>{const{__scopeTooltip:t,delayDuration:n=Jne,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,[o,a]=m.useState(!0),c=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),l.jsx(Xne,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:m.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:i})};dI.displayName=uI;var Mp="Tooltip",[Qne,Hu]=Ap(Mp),fI=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=e,c=Hw(Mp,e.__scopeTooltip),u=Rp(t),[d,f]=m.useState(null),h=Ts(),p=m.useRef(0),g=o??c.disableHoverableContent,v=a??c.delayDuration,b=m.useRef(!1),[y=!1,w]=Ro({prop:r,defaultProp:s,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Dv))):c.onClose(),i==null||i(_)}}),x=m.useMemo(()=>y?b.current?"delayed-open":"instant-open":"closed",[y]),S=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,w(!0)},[w]),C=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w(!1)},[w]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,w(!0),p.current=0},v)},[v,w]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),l.jsx(F0,{...u,children:l.jsx(Qne,{scope:t,contentId:h,open:y,stateAttribute:x,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayed?k():S()},[c.isOpenDelayed,k,S]),onTriggerLeave:m.useCallback(()=>{g?C():(window.clearTimeout(p.current),p.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};fI.displayName=Mp;var Lv="TooltipTrigger",hI=m.forwardRef((e,t)=>
vendor: 5,910 bytes, line 678
678{const{__scopeTooltip:n,...r}=e,s=Hu(Lv,n),i=Hw(Lv,n),o=Rp(n),a=m.useRef(null),c=vt(t,a,s.onTriggerChange),u=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(ap,{asChild:!0,...o,children:l.jsx(Je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Ae(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ae(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:Ae(e.onBlur,s.onClose),onClick:Ae(e.onClick,s.onClose)})})});hI.displayName=Lv;var Ww="TooltipPortal",[Zne,ere]=Ap(Ww,{forceMount:void 0}),pI=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Hu(Ww,t);return l.jsx(Zne,{scope:t,forceMount:n,children:l.jsx(sr,{present:n||i.open,children:l.jsx(Au,{asChild:!0,container:s,children:r})})})};pI.displayName=Ww;var rl="TooltipContent",mI=m.forwardRef((e,t)=>{const n=ere(rl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=Hu(rl,e.__scopeTooltip);return l.jsx(sr,{present:r||o.open,children:o.disableHoverableContent?l.jsx(gI,{side:s,...i,ref:t}):l.jsx(tre,{side:s,...i,ref:t})})}),tre=m.forwardRef((e,t)=>{const n=Hu(rl,e.__scopeTooltip),r=Hw(rl,e.__scopeTooltip),s=m.useRef(null),i=vt(t,s),[o,a]=m.useState(null),{trigger:c,onClose:u}=n,d=s.current,{onPointerInTransitChange:f}=r,h=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((g,v)=>{const b=g.currentTarget,y={x:g.clientX,y:g.clientY},w=ire(y,b.getBoundingClientRect()),x=ore(y,w),S=are(v.getBoundingClientRect()),C=cre([...x,...S]);a(C),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(c&&d){const g=b=>p(b,d),v=b=>p(b,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",v)}}},[c,d,p,h]),m.useEffect(()=>{if(o){const g=v=>{const b=v.target,y={x:v.clientX,y:v.clientY},w=(c==null?void 0:c.contains(b))||(d==null?void 0:d.contains(b)),x=!lre(y,o);w?h():x&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,o,u,h]),l.jsx(gI,{...e,ref:i})}),[nre,rre]=Ap(Mp,{isInside:!1}),gI=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=e,c=Hu(rl,n),u=Rp(n),{onClose:d}=c;return m.useEffect(()=>(document.addEventListener(Dv,d),()=>document.removeEventListener(Dv,d)),[d]),m.useEffect(()=>{if(c.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),l.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:l.jsxs(z0,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Gx,{children:r}),l.jsx(nre,{scope:n,isInside:!0,children:l.jsx(Yne,{id:c.contentId,role:"tooltip",children:s||r})})]})})});mI.displayName=rl;var yI="TooltipArrow",sre=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Rp(n);return rre(yI,n).isInside?null:l.jsx(B0,{...s,...r,ref:t})});sre.displayName=yI;function ire(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.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 ore(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function are(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function lre(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const a=t[i].x,c=t[i].y,u=t[o].x,d=t[o].y;c>r!=d>r&&n<(u-a)*(r-c)/(d-c)+a&&(s=!s)}return s}function cre(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ure(t)}function ure(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[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(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var dre=dI,fre=fI,hre=hI,pre=pI,vI=mI;const mre=dre,yC=fre,vC=hre,$v=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(pre,{children:l.jsx(vI,{ref:r,sideOffset:t,className:ae("z-50 overflow-hidden rounded-md border border-border/50 bg-popover/95 backdrop-blur-sm px-3 py-1.5 text-sm text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
678de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));$v.displayName=vI.displayName;const gre=({venues:e,onRejectVenue:t,onRegenerateVenue:n,selectedDate:r,utcOffsetMinutes:s,isHost:i=!0,renderVenueExtra:o,diff:a=null,diffVariant:c="after",hideBulkToggle:u,bulkSignalControlled:d})=>l.jsx(mre,{delayDuration:300,children:l.jsx(Uw,{venues:e,diff:a,diffVariant:c,mode:"planning",selectedDate:r,utcOffsetMinutes:s,hideBulkToggle:u,bulkSignalControlled:d,renderTopVenueActions:i?(f,h)=>l.jsxs(l.Fragment,{children:[l.jsxs(yC,{children:[l.jsx(vC,{asChild:!0,children:l.jsx(Fe,{size:"icon",variant:"outline",onClick:()=>{J.promise(Promise.resolve(n(h)),{loading:"Finding you something even better...",success:"How about this instead? 🎯",error:"Oops! Let me try that again!"})},className:"h-8 w-8 bg-primary/60 hover:bg-primary/80 text-primary-foreground border-primary/40 shadow-md",children:l.jsx(I4,{className:"h-4 w-4"})})}),l.jsx($v,{side:"bottom",children:l.jsx("p",{children:"Swap venue"})})]}),l.jsxs(yC,{children:[l.jsx(vC,{asChild:!0,children:l.jsx(Fe,{size:"icon",variant:"outline",onClick:()=>{t(h),J.success("No worries! Removed from your plan 😅")},className:"h-8 w-8 bg-destructive/60 hover:bg-destructive/80 text-destructive-foreground border-destructive/40 shadow-md",children:l.jsx(Dn,{className:"h-4 w-4"})})}),l.jsx($v,{side:"bottom",children:l.jsx("p",{children:"Remove venue"})})]})]}):void 0,renderVenueActions:o?f=>l.jsx(l.Fragment,{children:o(f)}):void 0})}),yre=ku("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),xI=m.forwardRef(({className:e,variant:t,...n},r)=>l.jsx("div",{ref:r,role:"alert",className:ae(yre({variant:t}),e),...n}));xI.displayName="Alert";const wI=m.forwardRef(({className:e,...t},n)=>l.jsx("h5",{ref:n,className:ae("mb-1 font-medium leading-none tracking-tight",e),...t}));wI.displayName="AlertTitle";const bI=m.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ae("text-sm [&_p]:leading-relaxed",e),...t}));bI.displayName="AlertDescription";const SI=({suggestedVenues:e,setSuggestedVenues:t,itineraryId:n,prompt:r,location:s,isHost:i=!0,renderVenueExtra:o,persistToDb:a=!1})=>{const{plannedCity:c,date:u,generationWarnings:d}=vn(),{sendMessage:f,isAiResponding:h,closureAlerts:p,dismissClosureAlerts:g,pendingPreview:v,previewEnabled:b,setPreviewEnabled:y,isReverting:w,notifyManualEdit:x}=Lu(),[S,C]=$.useState("after");$.useEffect(()=>{v&&C("after")},[v==null?void 0:v.userMessageId]);const[k,_]=$.useState(null),j=(k==null?void 0:k.expanded)??!1,R=()=>{_(V=>({expanded:!((V==null?void 0:V.expanded)??!1),nonce:((V==null?void 0:V.nonce)??0)+1}))},P=v?S==="after"?v.venuesAfter:v.venuesBefore:e,M=$.useMemo(()=>v?SR(v.venuesBefore,v.venuesAfter):null,[v]),T=$.useMemo(()=>{if(!M)return 0;let V=0;return M.byKey.forEach(I=>{(I.kind==="added"||I.kind==="removed"||I.kind==="modified")&&V++}),V},[M]),L=h||w||!!v,F=async V=>{if(L)return;const I=e[V],A=e.filter((D,E)=>E!==V);if(t(A),x(),a&&n&&(I!=null&&I.id)){const{error:D}=await q.from("venues").delete().eq("id",I.id).eq("itinerary_id",n);D&&console.error("Error deleting rejected venue from DB:",D)}A.length===0&&J("You've removed all venues. Regenerate some spots or go back!",{icon:"🤔"})},z=async V=>{const I=e[V];if(!I)return;if(L){J("Hold on — already working on a change...",{icon:"⏳"});return}const A=`Replace ${I.name} with a similar alternative.`;await f(A)};return P.length===0?l.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[l.jsx("p",{className:"text-lg",children:"You've removed all venues."}),l.jsx("p",{className:"text-sm mt-1",children:"Go back to your prompt and generate a new plan!"})]}):l.jsxs("div",{className:"relative space-y-3",children:[p.length>0&&(()=>{const V=p.every(D=>D.severity==="minor"),I=p.length===1,A=V?I?"A venue is just outside its open hours":`${p.length} venues are just outside their open hours`:I?"A venue is closed at its visit time":`${p.length} venues are closed at their visit times`;return l.jsx("div",{className:"sticky top-0 z-30",children:l.jsxs(xI,{variant:V?"default":"destructive",className:V?"border-amber-500/50 bg-amber-500/10 text-amber-100 backdrop-blur shadow-lg":"border-destructive/50 bg-destructive/10 backdrop-blur shadow-lg",children:[l.jsx(Kc,{className:"h-4 w-4"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs(wI,{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:"truncate",children:A}),l.jsx(Fe,{variant:"ghost",size:"icon",className:"h-6 w-6 -mr-1 flex-shrink-0",onClick:g,"aria-label":"Dismiss closure alerts",children:l.jsx(Dn,{className:"h-4 w-4"})})]}),l.jsx(bI,{className:"mt-1.5",children:l.jsx("ul",{className:"space-y-2 text-sm",children:p.map(D=>{const E=D.severity==="minor",K=(ee,ie)=>{var Y;const U=ee.trim().match(/^(\d{1,2}):(\d{2})\s*(AM|PM)?$/i);if(!U)return null;let W=parseInt(U[1],10);const ne=parseInt(U[2],10),oe=(Y=U[3])==null?void 0:Y.toUpperCase();oe==="PM"&&W<12&&(W+=12),oe==="AM"&&W===12&&(W=0);let Z=W*60+ne+ie;Z=(Z%1440+1440)%1440;let se=Math.floor(Z/60);const re=Z%60;if(oe){const Ee=se>=12?"PM":"AM";let He=se%12;return He===0&&(He=12),`${He}:${String(re).padStart(2,"0")} ${Ee}`}return`${String(se).padStart(2,"0")}
678:${String(re).padStart(2,"0")}`},te=D.duration_minutes?K(D.time,D.duration_minutes):null,N=D.duration_minutes?`${D.time} – ${te??"?"} · ${D.duration_minutes} min`:D.time;return l.jsxs("li",{className:"rounded-md border border-current/20 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("div",{className:"flex items-baseline justify-between gap-2 flex-wrap",children:[l.jsx("strong",{className:"font-semibold",children:D.name}),D.is_new&&l.jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-70",children:"new"})]}),l.jsxs("div",{className:"mt-0.5 text-xs opacity-90 grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5",children:[l.jsx("span",{className:"opacity-70",children:"Visit:"}),l.jsx("span",{children:N}),D.day_hours&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"opacity-70",children:"Open:"}),l.jsx("span",{children:D.day_hours})]})]}),E&&D.overshoot_minutes!=null&&l.jsxs("p",{className:"mt-1 text-xs italic opacity-90",children:["Only ",D.overshoot_minutes," min outside open hours — easily fixed by trimming the visit or shifting it slightly."]})]},`${D.name}-${D.time}`)})})})]})]})})})(),v&&l.jsxs("div",{className:"sticky top-0 z-30",children:[l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border-2 border-primary/50 bg-card px-3 py-2 shadow-lg",children:[l.jsx(Pr,{className:"h-4 w-4 text-primary flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("p",{className:"text-xs font-semibold text-primary truncate",children:["Previewing AI edit · ",T," change",T===1?"":"s"]}),l.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:"Decide in chat ↙ — toggle below to compare"})]}),l.jsxs("div",{className:"flex items-center rounded-md border border-primary/40 bg-background/60 p-0.5 flex-shrink-0",children:[l.jsx("button",{type:"button",onClick:()=>C("before"),className:`px-2.5 py-1 text-[11px] font-medium rounded ${S==="before"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Before"}),l.jsx("button",{type:"button",onClick:()=>C("after"),className:`px-2.5 py-1 text-[11px] font-medium rounded ${S==="after"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"After"})]})]}),l.jsxs("div",{className:"mt-1.5 flex items-center justify-end gap-3 text-[10px] text-muted-foreground",children:[l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:"hsl(var(--diff-removed))"}}),"Before / removed"]}),l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:"hsl(var(--diff-added))"}}),"After / added"]})]})]}),!v&&l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("div",{children:P.length>1&&l.jsx("button",{type:"button",onClick:R,className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1 rounded-md hover:bg-muted/50","aria-label":j?"Collapse all venue details":"Expand all venue details",children:j?l.jsxs(l.Fragment,{children:[l.jsx(gN,{className:"h-3.5 w-3.5"}),"Collapse all"]}):l.jsxs(l.Fragment,{children:[l.jsx(yN,{className:"h-3.5 w-3.5"}),"Expand all"]})})}),l.jsxs("label",{className:`flex items-center gap-2 h-7 px-2 rounded-full text-xs select-none ${h||w||v?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[l.jsx(p4,{className:`h-3.5 w-3.5 ${b?"text-primary":"text-muted-foreground"}`}),l.jsxs("span",{className:b?"text-foreground font-medium":"text-muted-foreground",children:[l.jsx("span",{className:"sm:hidden",children:"Preview"}),l.jsxs("span",{className:"hidden sm:inline",children:["Preview Mode ",b?"ON":"OFF"]})]}),l.jsx(Iu,{checked:b,onCheckedChange:y,disabled:h||w||!!v,className:"scale-75 -ml-1"}),l.jsx(Vt,{side:"bottom",iconClassName:"h-3.5 w-3.5",content:"Stage AI edits as previews before applying"})]})]}),l.jsx(gre,{venues:P,onRejectVenue:F,onRegenerateVenue:z,selectedDate:u?u.toISOString().split("T")[0]:null,utcOffsetMinutes:c==null?void 0:c.utcOffsetMinutes,isHost:i,hideBulkToggle:!0,bulkSignalControlled:k,renderVenueExtra:o,diff:M,diffVariant:S})]})},vre="https://inznlarlalvonceaksoy.supabase.co",xC="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imluem5sYXJsYWx2b25jZWFrc295Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzQxMTQ4NzQsImV4cCI6MjA0OTY5MDg3NH0.LhLIhLIGGZH8rhekJNQ19ChTyGIax0WkKdA6d0RUhUE";function xre(){const[e,t]=m.useState(!1),[n,r]=m.useState(null),[s,i]=m.useState([]),[o,a]=m.useState(null),[c,u]=m.useState(null),d=m.useRef(null),f=m.useRef(0),h=m.useCallback(()=>{r(null),i([]),a(null),u(null),f.current=0},[]);return{generate:m.useCallback(async g=>{var y,w;(y=d.current)==null||y.abort();const v=new AbortController;d.current=v,t(!0),r(null),i([]),a(null),u(null),f.current=0;const b=`${vre}/functions/v1/generate-itinerary-v2`;try{const x=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${xC}`,apikey:xC},body:JSON.stringify(g),signal:v.signal});if(!x.ok){const _=await x.text();throw new Error(_||`Server error: ${x.status}`)}const S=(w=x.body)==null?void 0:w.getReader();if(!S)throw new Error("No response stream available");const C=new TextDecoder;let k="";for(;;){const{done:_,value:j}=await S.read();if(_)break;k+=C.decode(j,{stream:!0});const R=k.split(`
679`);k=R.pop()||"";for(const P of R){if(!P.startsWith("data: "))continue;const M=P.slice(6).trim();if(M!=="[DONE]")try{const T=JSON.parse(M);if(T.type==="progress"){const L=T;r(L),f.current+=1;const F=f.current;i(z=>[...z,{seq:F,event:L}])}else if(T.type==="result")a(T.data);else if(T.type==="error")throw new Error(T.message||"Server reported an error")}catch(T){if(T.message&&T.message!=="Unexpected token"&&(M.includes('"type":"error"')||M.includes('"type": "error"')))throw T;console.warn("[SSE] Skipping malformed event:",M)}}}v.signal.aborted||a(_=>(_||(console.warn("[SSE] Stream ended without a result event"),u("Generation completed but no results were received. Please try again.")),_))}
679catch(x){if(x.name==="AbortError")return;console.error("[useSSEGeneration] Error:",x),u(x.message||"Something went wrong generating your plan")}finally{d.current===v&&(d.current=null),t(!1)}},[]),isGenerating:e,progress:n,progressEvents:s,result:o,error:c,reset:h}}const kI=({prompt:e,location:t,locationModified:n,selectedTags:r,date:s,onDateChange:i,peopleCount:o,startTime:a,startTimeModified:c,endTime:u,endTimeModified:d,onVenuesGenerated:f,onItineraryIdSet:h,isGenerating:p,setIsGenerating:g,showLoginPrompt:v,setShowLoginPrompt:b,onProgress:y,onProgressEvents:w,onResult:x,onError:S,persistToDb:C=!1,collabSessionId:k=null,onCollabLinked:_})=>{const{generate:j,isGenerating:R,progress:P,progressEvents:M,result:T,error:L,reset:F}=xre(),{plannedCity:z,generateRequested:V,clearGenerateRequest:I,setPlanIntent:A,setGenerationWarnings:D,setNarrativeSummary:E}=vn(),[K,te]=m.useState(!1),N=m.useRef(!1);m.useEffect(()=>{y==null||y(P)},[P,y]),m.useEffect(()=>{w==null||w(M)},[M,w]),m.useEffect(()=>{x==null||x(T)},[T,x]),m.useEffect(()=>{S==null||S(L)},[L,S]),m.useEffect(()=>{if(!T)return;(async()=>{var U;try{console.log("V2 pipeline result received:",T.suggestions.length,"venues"),T.plan_intent&&(A(T.plan_intent),console.log("Plan intent stored:",T.plan_intent.vibe));const W=T.suggestions.map(oe=>({...oe,votes:{up:0,down:0},comments:[]}));D(T.warnings||[]),E(T.narrative_summary??null),f(W,T),(U=T.warnings)!=null&&U.length&&J.warning("Some venues may need attention",{description:T.warnings.slice(0,2).join(" · "),duration:7e3});const{data:{session:ne}}=await q.auth.getSession();if(C&&ne){console.log("Persisting itinerary to DB for collab mode");const{data:oe,error:Z}=await q.from("itineraries").insert({title:e,description:`Crafted specially for ${t}`,user_id:ne.user.id,planned_city:z||null,plan_intent:T.plan_intent??null}).select().single();if(Z)throw Z;console.log("Created itinerary:",oe),h(oe.id);const se=T.suggestions.map(({votes:Y,comments:Ee,holiday_info:He,hours_source:Re,estimated_price_range_source:Nt,openNow_at_query_time:O,open_at_visit:B,special_days:G,live_status_label:pe,...ce})=>({itinerary_id:oe.id,...ce,hours_source:Re??null,open_now_at_query_time:O??null,open_at_visit:B??null,special_days:G??null,holiday_info:He??null,live_status_label:pe??null})),{error:re}=await q.from("venues").insert(se);if(re&&(console.error("Error saving venues:",re),J.error("Some venues couldn't be saved, but your plan is ready!")),k){const{error:Y}=await q.from("planning_sessions").update({itinerary_id:oe.id}).eq("id",k);Y?console.error("Error linking itinerary to session:",Y):(console.log("Linked itinerary to session:",k),_==null||_())}J.success("Your plan has been saved! 🎉")}else ne||(te(!0),setTimeout(()=>{b(!0)},3e3))}catch(W){console.error("Error processing V2 result:",W),J.error(W.message||"Oops! Something went wrong saving your plan.")}finally{g(!1),N.current=!1}})()},[T]),m.useEffect(()=>{L&&(console.error("V2 generation error:",L),J.error(L||"Oops! Something went wrong. Please try again!"),g(!1),N.current=!1)},[L]),m.useEffect(()=>{V&&!N.current&&(I(),ee())},[V]);const ee=async()=>{if(!e.trim()){J.error("Please tell me what you're looking for!");return}if(!z){J.error("Please set your destination in the dropdown menu! 📍",{duration:4e3});return}if(N.current)return;N.current=!0,g(!0),D([]),E(null),F();let ie=s;if((z==null?void 0:z.utcOffsetMinutes)!==void 0&&ie){const W=ie.getFullYear(),ne=String(ie.getMonth()+1).padStart(2,"0"),oe=String(ie.getDate()).padStart(2,"0"),Z=`${W}-${ne}-${oe}`,se=Vw(z.utcOffsetMinutes);if(wne(Z,z.utcOffsetMinutes)){const re=$n(new Date(se+"T12:00:00"),"MMM d");J.warning(`It's already ${re} in ${z.name}. Planning for today instead.`,{duration:5e3}),ie=new Date(se+"T12:00:00"),i==null||i(ie)}}const U={prompt:e,location:t,plannedCity:{place_id:z.place_id,description:z.description,name:z.name,lat:z.lat,lng:z.lng,utcOffsetMinutes:z.utcOffsetMinutes,countryCode:z.countryCode,placeTypes:z.placeTypes},preferences:{date:ie?`${ie.getFullYear()}-${String(ie.getMonth()+1).padStart(2,"0")}-${String(ie.getDate()).padStart(2,"0")}`:void 0,peopleCount:o,startTime:a||void 0,startTimeModified:c,endTime:u||void 0,endTimeModified:d,tags:r.length>0?r:void 0}};console.log("Generating V2 itinerary with request:",U),j(U)};return l.jsx("input",{type:"hidden",id:"generate-venues-trigger",onClick:ee})},ac=e=>{if(!e)return null;const t=e.trim();if(!t)return null;if(/[ap]m/i.test(t))return t.toUpperCase().replace(/\s+/g," ");const n=t.match(/^(\d{1,2}):(\d{2})$/);if(n){const r=parseInt(n[1],10),s=n[2],i=r>=12?"PM":"AM";return`${(r+11)%12+1}:${s} ${i}`}return t},Fd=e=>{const t=ac(e);return t?t.replace(/:00\s*(?=[AP]M)/i,""):null},wre=e=>e.split(",")[0].trim(),_I=({plannedCity:e,date:t,peopleCount:n,startTime:r,endTime:s,aiStartTime:i,aiEndTime:o})=>{const a=ac(r)||ac(i),c=ac(s)||ac(o),u=!r&&!!i,d=!s&&!!o,f=!r&&!i,h=!s&&!o;return l.jsxs(de.div,{initial:{opacity:0,y:-4}
679,animate:{opacity:1,y:0},className:"flex items-center justify-center flex-nowrap sm:flex-wrap gap-x-3 xs:gap-x-5 gap-y-1.5 px-3 sm:px-6 py-2 border-t border-b border-border/40 bg-muted/10 min-w-0 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-1 xs:gap-1.5 text-sm font-medium min-w-0",children:[l.jsx(er,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),l.jsx("span",{className:"truncate hidden sm:inline",children:e.description}),l.jsx("span",{className:"truncate sm:hidden",children:wre(e.description)})]}),l.jsxs("div",{className:"flex items-center gap-1 xs:gap-1.5 text-sm text-muted-foreground flex-shrink-0",children:[l.jsx(mN,{className:"w-3.5 h-3.5"}),l.jsx("span",{className:"whitespace-nowrap hidden sm:inline",children:$n(t,"EEE, MMM d")}),l.jsx("span",{className:"whitespace-nowrap sm:hidden",children:$n(t,"MMM d")})]}),l.jsxs("div",{className:"flex items-center gap-1 xs:gap-1.5 text-sm text-muted-foreground flex-shrink-0 min-w-0",children:[l.jsx(bo,{className:"w-3.5 h-3.5 flex-shrink-0"}),l.jsxs("span",{className:"whitespace-nowrap hidden sm:inline",children:[(()=>{const p=u?"Inferred by AI from your prompt":f?"AI is inferring this…":null,g=l.jsx("span",{className:f?"italic opacity-60":u?"italic text-primary/80":"",children:f?"AI-derived":a});return p?l.jsx(Vt,{variant:"underline",content:p,ariaLabel:"About this time",children:g}):g})(),l.jsx("span",{className:"mx-1 opacity-60",children:"–"}),(()=>{const p=d?"Inferred by AI from your prompt":h?"AI is inferring this…":null,g=l.jsx("span",{className:h?"italic opacity-60":d?"italic text-primary/80":"",children:h?"AI-derived":c});return p?l.jsx(Vt,{variant:"underline",content:p,ariaLabel:"About this time",children:g}):g})()]}),l.jsx("span",{className:"whitespace-nowrap sm:hidden truncate",children:f&&h?l.jsx(Vt,{variant:"underline",content:"AI is inferring this…",ariaLabel:"About this time",children:l.jsx("span",{className:"italic opacity-60",children:"AI inferring"})}):l.jsxs(l.Fragment,{children:[(()=>{const p=u?"Inferred by AI":f?"AI inferring":null,g=l.jsx("span",{className:f?"italic opacity-60":u?"italic text-primary/80":"",children:f?"AI infer.":Fd(r)||Fd(i)});return p?l.jsx(Vt,{variant:"underline",content:p,ariaLabel:"About this time",children:g}):g})(),l.jsx("span",{className:"opacity-60",children:"-"}),(()=>{const p=d?"Inferred by AI":h?"AI inferring":null,g=l.jsx("span",{className:h?"italic opacity-60":d?"italic text-primary/80":"",children:h?"AI infer.":Fd(s)||Fd(o)});return p?l.jsx(Vt,{variant:"underline",content:p,ariaLabel:"About this time",children:g}):g})()]})})]}),n!=null&&l.jsxs("div",{className:"flex items-center gap-1 xs:gap-1.5 text-sm text-muted-foreground flex-shrink-0",children:[l.jsx(Gt,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:n})]})]})},bre=({initialPrompt:e="",onGenerationStart:t,isHost:n=!0,renderVenueExtra:r})=>{const{prompt:s,setPrompt:i,selectedTags:o,setSelectedTags:a,location:c,setLocation:u,locationModified:d,setLocationModified:f,startTime:h,setStartTime:p,startTimeModified:g,setStartTimeModified:v,endTime:b,setEndTime:y,endTimeModified:w,setEndTimeModified:x,date:S,setDate:C,peopleCount:k,setPeopleCount:_,itineraryId:j,setItineraryId:R,isGenerating:P,setIsGenerating:M,isReviewing:T,suggestedVenues:L,setSuggestedVenues:F,setIsReviewing:z,plannedCity:V}=vn(),[I,A]=$.useState(!1);$.useEffect(()=>{P&&t&&t()},[P,t]);const D=E=>{F(E),z(!0),e&&z(!1)};return l.jsxs("div",{className:"space-y-8",children:[!T&&!L.length&&l.jsx("div",{className:"pt-8 sm:pt-12",children:l.jsx(_ne,{prompt:s,onPromptChange:i,onSubmit:()=>{},isLoading:P,selectedTags:o,onTagSelect:a,location:c,onLocationChange:u,onLocationModified:()=>f(!0),startTime:h,onStartTimeChange:p,onStartTimeModified:()=>v(!0),endTime:b,onEndTimeChange:y,onEndTimeModified:()=>x(!0),date:S,onDateChange:C,peopleCount:k,onPeopleCountChange:_})}),l.jsx(kI,{prompt:s,location:c,locationModified:d,selectedTags:o,date:S,onDateChange:C,peopleCount:k,startTime:h,startTimeModified:g,endTime:b,endTimeModified:w,onVenuesGenerated:D,onItineraryIdSet:R,isGenerating:P,setIsGenerating:M,showLoginPrompt:I,setShowLoginPrompt:A}),L.length>0&&l.jsxs("div",{className:"space-y-4",children:[(V==null?void 0:V.description)&&l.jsx(_I,{plannedCity:V,date:S,peopleCount:k}),l.jsx(SI,{suggestedVenues:L,setSuggestedVenues:F,itineraryId:j,prompt:s,location:c,isHost:n,renderVenueExtra:r})]})]})};function Sre(e,t=[]){let n=[];function r(i,o){const a=m.createContext(o),c=n.length;n=[...n,o];function u(f){const{scope:h,children:p,...g}=f,v=(h==null?void 0:h[e][c])||a,b=m.useMemo(()=>g,Object.values(g));return l.jsx(v.Provider,{value:b,children:p})}function d(f,h){const p=(h==null?void 0:h[e][c])||a,g=m.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,kre(s,...t)]}function kre(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var qw="Progress",Gw=100,[_re,_ie]=Sre(qw),[Cre,jre]=_re(qw),CI=m.forwardRef((e,t)=>
679{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=Ere,...o}=e;(s||s===0)&&!wC(s)&&console.error(Nre(`${s}`,"Progress"));const a=wC(s)?s:Gw;r!==null&&!bC(r,a)&&console.error(Tre(`${r}`,"Progress"));const c=bC(r,a)?r:null,u=bh(c)?i(c,a):void 0;return l.jsx(Cre,{scope:n,value:c,max:a,children:l.jsx(Je.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":bh(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":NI(c,a),"data-value":c??void 0,"data-max":a,...o,ref:t})})});CI.displayName=qw;var jI="ProgressIndicator",EI=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=jre(jI,n);return l.jsx(Je.div,{"data-state":NI(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});EI.displayName=jI;function Ere(e,t){return`${Math.round(e/t*100)}%`}function NI(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function bh(e){return typeof e=="number"}function wC(e){return bh(e)&&!isNaN(e)&&e>0}function bC(e,t){return bh(e)&&!isNaN(e)&&e<=t&&e>=0}function Nre(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Gw}\`.`}function Tre(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
680  - a positive number
681  - less than the value passed to \`max\` (or ${Gw} if no \`max\` prop is set)
682  - \`null\` or \`undefined\` if the progress is indeterminate.
683
684Defaulting to \`null\`.`}var TI=CI,Pre=EI;const PI=m.forwardRef(({className:e,value:t,...n},r)=>l.jsx(TI,{ref:r,className:ae("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:l.jsx(Pre,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));PI.displayName=TI.displayName;function Are({className:e,...t}){return l.jsx("div",{className:ae("animate-pulse rounded-md bg-muted",e),...t})}const Rre={1:{label:"Understanding your vibe",emoji:"🧠",icon:Pr},2:{label:"Finding perfect venues",emoji:"🔍",icon:Sy},3:{label:"Verifying with Google",emoji:"📍",icon:er},4:{label:"Optimizing your route",emoji:"🗺️",icon:D4},5:{label:"Checking feasibility",emoji:"✅",icon:Kf},6:{label:"Enriching with details",emoji:"⭐",icon:Ux},7:{label:"Packaging your plan",emoji:"📦",icon:R4}},SC=7,Mre=({progress:e,isGenerating:t})=>{if(!t)return null;const n=(e==null?void 0:e.stage)??0,r=Rre[n],s=n>0?Math.min(n/SC*100,100):5;return l.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 py-12 px-4",children:[l.jsx(lu,{size:"lg",showText:!1}),l.jsx(yt,{mode:"wait",children:l.jsx(de.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.3},className:"flex flex-col items-center gap-2 text-center",children:r?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xl",children:r.emoji}),l.jsx("span",{className:"text-lg font-medium text-foreground",children:r.label})]}),l.jsx("p",{className:"text-sm text-muted-foreground max-w-xs",children:(e==null?void 0:e.message)||"Starting up..."})]}):l.jsx("p",{className:"text-lg text-muted-foreground animate-pulse",children:"Hold tight! Crafting something amazing... 🎨✨"})},n)}),l.jsxs("div",{className:"w-full max-w-sm space-y-1",children:[l.jsx(PI,{value:s,className:"h-2"}),l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:["Stage ",n||1," of ",SC]}),(e==null?void 0:e.progress)&&l.jsx("span",{children:e.progress})]})]}),l.jsx(yt,{children:(e==null?void 0:e.status)==="retry"&&e.retry_round!=null&&l.jsxs(de.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0},className:"flex items-center gap-1.5 text-xs text-muted-foreground bg-muted/50 px-3 py-1.5 rounded-full",children:[l.jsx(CN,{className:"w-3 h-3 animate-spin"}),l.jsxs("span",{children:["Retry round ",e.retry_round]})]})}),l.jsx(yt,{children:(e==null?void 0:e.venue_names)&&e.venue_names.length>0&&l.jsxs(de.div,{initial:{opacity:0,y:10}
684,animate:{opacity:1,y:0},exit:{opacity:0},className:"flex flex-col items-center gap-2 w-full max-w-sm",children:[l.jsx("p",{className:"text-xs text-muted-foreground font-medium uppercase tracking-wider",children:"Your venues"}),l.jsx("div",{className:"flex flex-wrap justify-center gap-1.5",children:e.venue_names.map((i,o)=>l.jsx(de.span,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:o*.08},className:"text-xs bg-primary/10 text-primary px-2.5 py-1 rounded-full border border-primary/20",children:i},i))})]})}),n<3&&l.jsx("div",{className:"w-full max-w-sm space-y-3 mt-2",children:[...Array(3)].map((i,o)=>l.jsx(Are,{className:"h-12 w-full rounded-lg"},o))})]})},Ire=1,Ore=1e6;let mg=0;function Dre(){return mg=(mg+1)%Number.MAX_SAFE_INTEGER,mg.toString()}const gg=new Map,kC=e=>{if(gg.has(e))return;const t=setTimeout(()=>{gg.delete(e),pf({type:"REMOVE_TOAST",toastId:e})},Ore);gg.set(e,t)},Lre=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Ire)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?kC(n):e.toasts.forEach(r=>{kC(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},$re=[];let yg={toasts:[]};function pf(e){yg=Lre(yg,e),$re.forEach(t=>{t(yg)})}function _C({...e}){const t=Dre(),n=s=>pf({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>pf({type:"DISMISS_TOAST",toastId:t});return pf({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}const Fre={idle:{label:"Idle",tone:"bg-muted text-muted-foreground",icon:bo},streaming:{label:"Streaming",tone:"bg-primary/15 text-primary",icon:js},complete:{label:"Complete",tone:"bg-emerald-500/15 text-emerald-500",icon:Kf},error:{label:"Error",tone:"bg-destructive/15 text-destructive",icon:_1},stalled:{label:"Stalled",tone:"bg-amber-500/15 text-amber-500",icon:_1}};function Hl(e){return e==null||Number.isNaN(e)||e<=0?"—":e<1e3?`${e} ms`:`${(e/1e3).toFixed(2)} s`}function mf(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return`${n}:${r}:${s}`}const zre=({timeline:e,defaultCollapsed:t=!0,className:n=""})=>{var c,u,d;const[r,s]=m.useState(!t);if(m.useEffect(()=>{s(!t)},[e.runId,t]),e.streamStatus==="idle"&&e.runId===0)return null;const i=Fre[e.streamStatus],o=i.icon,a=e.streamStatus==="streaming";return l.jsxs(Tp,{open:r,onOpenChange:s,children:[l.jsx(Pp,{asChild:!0,children:l.jsxs("button",{type:"button",className:`inline-flex items-center gap-1.5 h-7 px-2 rounded-full border border-border bg-card/40 backdrop-blur-sm hover:bg-muted/30 transition-colors text-xs ${n}`,title:"Show generation diagnostics",children:[l.jsx(S1,{className:"w-3 h-3 text-primary"}),l.jsx("span",{className:"text-muted-foreground hidden sm:inline",children:"Diagnostics"}),l.jsx("span",{className:"text-muted-foreground/70 tabular-nums",children:Hl(e.totalDurationMs)}),l.jsx(o,{className:`w-3 h-3 ${i.tone.split(" ").find(f=>f.startsWith("text-"))??"text-muted-foreground"} ${a?"animate-spin":""}`})]})}),l.jsx(Uu,{align:"end",sideOffset:8,className:"w-[min(92vw,720px)] p-0 bg-card border border-border shadow-xl overflow-hidden",children:l.jsxs("div",{className:"flex flex-col max-h-[70vh]",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 h-9 border-b border-border bg-muted/20 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(S1,{className:"w-3.5 h-3.5 text-primary"}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:"Diagnostics"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:Hl(e.totalDurationMs)}),l.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${i.tone}`,children:[l.jsx(o,{className:`w-3 h-3 ${a?"animate-spin":""}`}),i.label]}),l.jsx("button",{type:"button",onClick:()=>s(!1),className:"ml-1 p-0.5 rounded hover:bg-muted/40 text-muted-foreground",title:"Close",children:l.jsx(Dn,{className:"w-3.5 h-3.5"})})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 px-4 py-2 text-xs border-b border-border bg-muted/20",children:[l.jsx(zd,{label:"Server total",value:Hl(e.serverTotalDurationMs)}),l.jsx(zd,{label:"AI calls",value:((c=e.totalAiCalls)==null?void 0:c.toString())??"—"}),l.jsx(zd,{label:"Places calls",value:((u=e.totalPlacesApiCalls)==null?void 0:u.toString())??"—"}),l.jsx(zd,{label:"Routes calls",value:((d=e.totalRoutesApiCalls)==null?void 0:d.toString())??"—"})]}),e.errorMessage&&l.jsx("div",{className:"px-4 py-2 text-xs bg-destructive/10 text-destructive border-b border-border",children:e.errorMessage}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{className:"bg-muted/30 text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left font-medium px-3 py-1.5",children:"Stage"}),l.jsx("th",{className:"text-right font-medium px-3 py-1.5",title:"Wall-clock time observed on the client (between SSE events)",children:"Client"}),l.jsx("th",{className:"text-right font-medium px-3 py-1.5",title:"Authoritative duration reported by the edge function",children:"Server"}),l.jsx("th",{className:"text-right font-medium px-3 py-1.5",title:"Number of SSE progress events received for this stage",children:"Events"}),l.jsx("th",{className:"text-right font-medium px-3 py-1.5",children:"Retries"}),l.jsx("th",{className:"text-right font-medium px-3 py-1.5",children:"Replaced"}),l.jsx("th",{className:"text-left font-medium px-3 py-1.5",children:"Status"})]})}),l.jsx("tbody",{children:e.stages.map(f=>{const h=f.startedAt!==null&&f.endedAt===null&&e.streamStatus==="streaming",p=f.startedAt===null,g=e.streamStatus==="complete"||e.streamStatus==="error",v=p&&g;return l.jsxs("tr",{className:`border-t border-border/50 ${h?"bg-primary/5":""}`,children:[l.jsx("td",{className:"px-3 py-1 align-middle",children:l.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[l.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded-full text-[9px] font-semibold shrink-0 self-center ${f.endedAt?"bg-emerald-500/15 text-emerald-500":h?"bg-primary/15 text-primary":v?"bg-emerald-500/10 text-emerald-500/70":"bg-muted text-muted-foreground"}`,children:f.stage}),l.jsx("span",{className:p&&!v?"text-muted-foreground":"text-foreground",children:f.name}),f.lastMessage&&l.jsx("span",{className:"text-[10px] text-muted-foreground truncate",title:f.lastMessage,children:f.lastMessage})]})}),l.jsx("td",{className:"px-3 py-1 text-right tabular-nums align-middle",children:l.jsx("span",{className:"text-muted-foreground",title:"Client wall-clock (gap between SSE events for this stage)",children:Hl(f.clientDurationMs)})}),l.jsx("td",{className:"px-3 py-1 text-right tabular-nums align-middle",children:l.jsx("span",{className:f.serverDurationMs&&f.serverDurationMs>
6840?"text-foreground":"text-muted-foreground/60",title:f.serverDurationMs&&f.serverDurationMs>0?"Server-reported (authoritative)":"Server did not report (stage may have been skipped)",children:Hl(f.serverDurationMs)})}),l.jsx("td",{className:"px-3 py-1 text-right tabular-nums align-middle",children:l.jsx("span",{className:f.eventCount>0?"text-foreground":"text-muted-foreground/60",title:"SSE progress events received for this stage",children:f.eventCount||"—"})}),l.jsx("td",{className:"px-3 py-1 text-right align-middle",children:f.retries>0?l.jsxs(Qa,{variant:"secondary",className:"gap-1 h-5 px-1.5",children:[l.jsx(CN,{className:"w-3 h-3"}),f.retries]}):l.jsx("span",{className:"text-muted-foreground",children:"0"})}),l.jsx("td",{className:"px-3 py-1 text-right tabular-nums text-muted-foreground align-middle",children:f.venuesReplaced||"—"}),l.jsx("td",{className:"px-3 py-1 align-middle",children:h?l.jsxs("span",{className:"inline-flex items-center gap-1 text-primary",children:[l.jsx(js,{className:"w-3 h-3 animate-spin"}),f.lastStatus??"running"]}):f.endedAt?l.jsxs("span",{className:"inline-flex items-center gap-1 text-emerald-500",children:[l.jsx(Kf,{className:"w-3 h-3"}),"done"]}):v?l.jsxs("span",{className:"inline-flex items-center gap-1 text-emerald-500/70",title:"Stage ran without emitting progress events (fast path)",children:[l.jsx(Kf,{className:"w-3 h-3"}),"skipped"]}):l.jsx("span",{className:"text-muted-foreground",children:"pending"})})]},f.stage)})})]})}),l.jsx(Hre,{events:e.events,isStreaming:e.streamStatus==="streaming"})]})]})})]})},zd=({label:e,value:t})=>l.jsxs("div",{className:"flex items-baseline gap-1.5",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:e}),l.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:t})]}),Bre={info:"border-l-primary/40 bg-primary/5",retry:"border-l-amber-500/60 bg-amber-500/5",success:"border-l-emerald-500/60 bg-emerald-500/5",error:"border-l-destructive/60 bg-destructive/5"},Vre={info:"bg-primary",retry:"bg-amber-500",success:"bg-emerald-500",error:"bg-destructive"};function Ure(e){return e<1e3?`+${e}ms`:`+${(e/1e3).toFixed(1)}s`}const Hre=({events:e,isStreaming:t})=>{const n=m.useRef(null),[r,s]=m.useState(!0),[i,o]=m.useState("all"),[a,c]=m.useState(!1),u=m.useMemo(()=>{const g={all:e.length,info:0,retry:0,success:0,error:0};for(const v of e)g[v.severity]+=1;return g},[e]),d=m.useMemo(()=>[...i==="all"?e:e.filter(v=>v.severity===i)].sort((v,b)=>v.id-b.id),[e,i]);m.useEffect(()=>{!r||!n.current||(n.current.scrollTop=n.current.scrollHeight)},[d.length,r]);const f=()=>{const g=n.current;if(!g)return;const v=g.scrollHeight-g.scrollTop-g.clientHeight<16;s(v)},h=async()=>{const v=[...e].sort((b,y)=>b.id-y.id).map(b=>{var x;const y=[];b.progress&&y.push(`[${b.progress}]`),b.retryRound!=null&&y.push(`retry#${b.retryRound}`),b.venueCount!=null&&y.push(`${b.venueCount} venues`),(x=b.venueNames)!=null&&x.length&&y.push(`(${b.venueNames.join(", ")})`);const w=`#${b.id}  ${mf(b.at)}  +${(b.elapsedMs/1e3).toFixed(2)}s  S${b.stage}·${b.status.padEnd(10)} ${b.kind?`[${b.kind}] `:""}${b.message}${y.length?"  "+y.join(" "):""}`;return b.details&&Object.keys(b.details).length>0?`${w}
685${AI(b.details)}`:w}).join(`
686`);try{await navigator.clipboard.writeText(v),c(!0),_C({title:"Activity log copied",description:`${e.length} events copied to clipboard.`}),setTimeout(()=>c(!1),1500)}catch{_C({title:"Copy failed",description:"Could not access clipboard.",variant:"destructive"})}};if(e.length===0)return l.jsx("div",{className:"px-4 py-6 text-xs text-muted-foreground text-center border-t border-border",children:"Waiting for pipeline events…"});const p=[{key:"all",label:"All",tone:"bg-muted text-foreground"},{key:"info",label:"Info",tone:"bg-primary/15 text-primary"},{key:"retry",label:"Retry",tone:"bg-amber-500/15 text-amber-500"},{key:"success",label:"Success",tone:"bg-emerald-500/15 text-emerald-500"},{key:"error",label:"Error",tone:"bg-destructive/15 text-destructive"}];return l.jsxs("div",{className:"border-t border-border",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 h-7 bg-muted/20 border-b border-border flex-wrap",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-foreground",children:[l.jsx(L4,{className:"w-3.5 h-3.5 text-primary"}),"Event Log",l.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",d.length,i!=="all"?`/${e.length}`:"",")"]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx(b4,{className:"w-3 h-3 text-muted-foreground"}),p.map(g=>{const v=i===g.key,b=u[g.key],y=b===0&&g.key!=="all";return l.jsxs("button",{type:"button",onClick:()=>o(g.key),disabled:y,className:`text-[10px] px-1.5 py-0.5 rounded-full border transition-colors ${v?`${g.tone} border-transparent`:"bg-transparent text-muted-foreground border-border hover:text-foreground"} ${y?"opacity-40 cursor-not-allowed":""}`,children:[g.label,b>0?l.jsx("span",{className:"ml-0.5 opacity-70",children:b}):null]},g.key)}),l.jsxs("button",{type:"button",onClick:h,className:"ml-1 inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full border border-border text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors",title:"Copy full log to clipboard",children:[a?l.jsx(xo,{className:"w-3 h-3 text-emerald-500"}):l.jsx(xN,{className:"w-3 h-3"}),a?"Copied":"Copy log"]}),t&&!r&&l.jsx("button",{type:"button",onClick:()=>s(!0),className:"text-[10px] text-primary hover:underline ml-1",children:"Jump ↓"})]})]}),l.jsx("div",{ref:n,onScroll:f,className:"h-[210px] overflow-y-scroll font-mono text-[11px] leading-relaxed bg-background/40",children:d.map(g=>l.jsx(Wre,{ev:g},g.id))}),l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-1.5 bg-muted/10 border-t border-border text-[10px] text-muted-foreground tabular-nums flex-wrap",children:[l.jsxs("span",{children:[l.jsx("span",{className:"font-semibold text-foreground",children:e.length})," event",e.length===1?"":"s",i!=="all"&&l.jsxs("span",{className:"ml-1 opacity-70",children:["· showing ",l.jsx("span",{className:"text-foreground",children:d.length})]})]}),e.length>0&&l.jsxs("span",{children:["first ",l.jsx("span",{className:"text-foreground",children:mf(e[0].at)}),l.jsx("span",{className:"mx-1.5 opacity-50",children:"→"}),"last ",l.jsx("span",{className:"text-foreground",children:mf(e[e.length-1].at)}),l.jsxs("span",{className:"ml-1.5 opacity-70",children:["(span ",((e[e.length-1].at-e[0].at)/1e3).toFixed(1),"s)"]})]})]})]})},Wre=({ev:e})=>{const[t,n]=m.useState(!1),r=e.details&&Object.keys(e.details).length>0,s=r?qre(e.kind,e.details):null;return l.jsxs("div",{className:`flex gap-2 px-3 py-1.5 border-l-2 border-b border-border/40 ${Bre[e.severity]}
686`,children:[l.jsxs("span",{className:"text-muted-foreground/60 tabular-nums shrink-0 w-10 text-right",title:"Event sequence number",children:["#",e.id]}),l.jsx("span",{className:"text-muted-foreground/70 tabular-nums shrink-0 w-16",title:"Wall-clock timestamp",children:mf(e.at)}),l.jsx("span",{className:"text-muted-foreground tabular-nums shrink-0 w-12",children:Ure(e.elapsedMs)}),l.jsxs("span",{className:"flex items-center gap-1 shrink-0 w-20",children:[l.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${Vre[e.severity]}`}),l.jsxs("span",{className:"text-muted-foreground",children:["S",e.stage,"·",e.status]})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"text-foreground break-words",children:[e.kind&&l.jsx("span",{className:"mr-1.5 text-[10px] text-muted-foreground/80 font-semibold uppercase tracking-wide",children:e.kind}),e.message||l.jsx("span",{className:"text-muted-foreground italic",children:"(no message)"}),e.progress&&l.jsxs("span",{className:"ml-2 text-muted-foreground",children:["[",e.progress,"]"]}),e.retryRound!=null&&l.jsxs("span",{className:"ml-2 text-amber-500",children:["retry #",e.retryRound]}),e.venueCount!=null&&l.jsxs("span",{className:"ml-2 text-muted-foreground",children:["· ",e.venueCount," venues"]}),e.venueNames&&e.venueNames.length>0&&e.venueNames.map((i,o)=>l.jsx("span",{className:"ml-1 text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20 align-baseline",children:i},`${e.id}-${o}`))]}),s&&l.jsx("div",{className:"mt-0.5 text-[10px] text-muted-foreground break-words",children:s}),r&&l.jsxs("button",{type:"button",onClick:()=>n(i=>!i),className:"mt-1 inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:[t?l.jsx(xi,{className:"w-3 h-3"}):l.jsx(wo,{className:"w-3 h-3"}),t?"Hide details":"Show details"]}),t&&r&&l.jsx("pre",{className:"mt-1 max-h-72 overflow-auto rounded border border-border bg-muted/40 p-2 text-[10px] leading-snug text-foreground whitespace-pre-wrap break-words",children:AI(e.details)})]})]})};function AI(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function qre(e,t){var n,r,s,i;if(!e)return null;try{if(e.includes("replace")||e==="venue.replaced"){const o=((n=t.from)==null?void 0:n.name)??t.replaced_from??t.old_name,a=((r=t.to)==null?void 0:r.name)??t.replaced_to??t.new_name,c=t.reason??t.cause;if(o||a)return`${o??"?"} → ${a??"?"}${c?` · ${c}`:""}`}if(e.includes("drop")||e.includes("remove")||e==="venue.dropped"||e==="venue.rejected"){const o=((s=t.venue)==null?void 0:s.name)??t.name,a=t.reason??t.cause;if(o)return`Removed ${o}${a?` · ${a}`:""}`}if(e.startsWith("verify.")){const o=t.venueName??t.query,a=Array.isArray(t.candidates)?t.candidates.length:t.candidateCount,c=((i=t.accepted)==null?void 0:i.name)??t.acceptedName,u=t.path??t.acceptancePath,d=[];if(o&&d.push(`"${o}"`),a!=null&&d.push(`${a} candidate${a===1?"":"s"}`),c&&d.push(`✓ ${c}`),u&&d.push(`via ${u}`),d.length)return d.join(" · ")}}catch{}return null}const Fv={1:"Intent",2:"Candidates",3:"Verification",4:"Routing",5:"Feasibility",6:"Enrichment",7:"Assembly"},gf=7;function CC(){return Array.from({length:gf},(e,t)=>({stage:t+1,name:Fv[t+1],startedAt:null,endedAt:null,clientDurationMs:null,serverDurationMs:null,retries:0,venuesReplaced:0,lastStatus:null,lastMessage:null,eventCount:0}))}function RI({isGenerating:e,progress:t,progressEvents:n,result:r,error:s}){const[i,o]=m.useState(()=>({runId:0,startedAt:null,endedAt:null,totalDurationMs:null,streamStatus:"idle",errorMessage:null,stages:CC(),events:[],serverTotalDurationMs:null,totalAiCalls:null,totalPlacesApiCalls:null,totalRoutesApiCalls:null})),a=m.useRef(!1),c=m.useRef(0),u=m.useRef(0),d=(h,p)=>h.runId>0||h.streamStatus!=="idle"?h:{...h,runId:1,startedAt:p,streamStatus:"streaming"};m.useEffect(()=>{e&&!a.current&&(c.current=0,u.current=0,o(h=>({runId:h.runId+1,startedAt:Date.now(),endedAt:null,totalDurationMs:null,streamStatus:"streaming",errorMessage:null,stages:CC(),events:[],serverTotalDurationMs:null,totalAiCalls:null,totalPlacesApiCalls:null,totalRoutesApiCalls:null}))),a.current=e},[e]);const f=(h,p,g)=>{if(h.streamStatus==="idle")return h;const v=h.stages.map(C=>({...C})),b=p.stage-1;if(b<0||b>=v.length)return h;const y=v[b];y.startedAt===null&&(y.startedAt=g),y.lastStatus=p.status,y.lastMessage=p.message??y.lastMessage,y.eventCount+=1,p.status==="retry"&&(y.retries+=1);for(let C=0;C<b;C++){const k=v[C];k.startedAt!==null&&k.endedAt===null&&(k.endedAt=g,k.clientDurationMs=g-k.startedAt)}p.status==="complete"&&p.stage===gf&&(y.endedAt=g,y.clientDurationMs=g-(y.startedAt??g));const w=p.severity??(p.status==="retry"?"retry":p.status==="complete"?"success":"info");c.current+=1;const x={id:c.current,at:g,elapsedMs:h.startedAt?g-h.startedAt:0,stage:p.stage,stageName:Fv[p.stage]??`Stage ${p.stage}`,status:p.status,message:p.message??"",progress:p.progress,venueCount:p.venue_count,venueNames:p.venue_names,retryRound:p.retry_round,severity:w,kind:p.kind,details:p.details},S=[...h.events,x].slice(-2e3);return{...h,stages:v,events:S}};return m.useEffect(()=>{if(!n||n.length===0)return;const h=n.filter(g=>g.seq>u.current);if(h.length===0)return;u.current=h[h.length-1].seq;const p=Date.now();o(g=>{let v=d(g,p);for(const b of h)v=f(v,b.event,p);return v})},[n]),m.useEffect(()=>{if(n||!t)return;const h=Date.now();o(p=>f(d(p,h),t,h))},[t,n]),m.useEffect(()=>{if(!r)return;const h=Date.now();o(p=>{var w,x,S,C,k,_,j,R;const g=d(p,h),v=g.stages.map(P=>({...P}));for(const P of v)P.startedAt!==null&&P.endedAt===null&&(P.endedAt=h,P.clientDurationMs=h-P.startedAt);const b=((w=r.pipeline_stats)==null?void 0:w.stages)??[];for(const P of b){const M=v.find(T=>T.stage===P.stage);M&&(M.serverDurationMs=P.duration_ms,M.retries=Math.max(M.retries,P.retries??0),M.venuesReplaced=P.venues_replaced??0,!M.name&&P.name&&(M.name=P.name))}c.current+=1;const y={id:c.current,at:h,elapsedMs:g.startedAt?h-g.startedAt:0,stage:gf,stageName:Fv[gf],status:"complete",message:`Pipeline complete — ${r.suggestions.length} venues · ${((x=r.pipeline_stats)==null?void 0:x.total_ai_calls)??0} AI / ${((S=r.pipeline_stats)==null?void 0:S.total_places_api_calls)??0} Places / ${((C=r.pipeline_stats)==null?void 0:C.total_routes_api_calls)??0} Routes`,venueCount:r.suggestions.length,venueNames:r.suggestions.map(P=>P.name),severity:"success"};return{...g,endedAt:h,totalDurationMs:g.startedAt?h-g.startedAt:null,streamStatus:"complete",stages:v,events:[...g.events,y].slice(-300),serverTotalDurationMs:((k=r.pipeline_stats)==null?void 0:k.total_duration_ms)??null,totalAiCalls:((_=r.pipeline_stats)==null?void 0:_.total_ai_calls)??null,totalPlacesApiCalls:((j=r.pipeline_stats)==null?void 0:j.total_places_api_calls)??null,totalRoutesApiCalls:((R=r.pipeline_stats)==null?void 0:R.total_routes_api_calls)??null}})},[r]),m.useEffect(()=>{if(!s)return;const h=Date.now();o(p=>{if(p.streamStatus==="complete")return p;const g=p.stages.map(b=>({...b}));for(const b of g)b.startedAt!==null&&b.endedAt===null&&(b.endedAt=h,b.clientDurationMs=h-b.startedAt);c.current+=1;const v={id:c.current,at:h,elapsedMs:p.startedAt?h-p.startedAt:0,stage:0,stageName:"Error",status:"complete",message:s,severity:"error"};return{...p,endedAt:h,totalDurationMs:p.startedAt?h-p.startedAt:null,streamStatus:"error",errorMessage:s,stages:g,events:[...p.events,v].slice(-300)}})},[s]),m.useEffect(()=>{e||o(h=>{if(h.streamStatus!=="streaming")return h;const p=Date.now();return{...h,endedAt:p,totalDurationMs:h.startedAt?p-h.startedAt:null,streamStatus:"stalled"}})},[e]),i}const Gre=()=>{const e=Kt(),{persistToSession:t}=vn(),n=()=>{t(),e("/login",{state:{returnTo:"/new-plan"}})};return l.jsxs("div",{className:"glass-card p-3 sm:p-4 flex flex-col sm:flex-row items-center justify-center gap-2 sm:gap-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-1 sm:gap-2 text-center sm:text-left min-w-0",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Want to save your plan?"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Create an account to save and share your itineraries!"})]}),l.jsxs(Fe,{onClick:n,size:"sm",className:"bg-primary hover:bg-primary/90 shrink-0",children:[l.jsx(_N,{className:"w-4 h-4 mr-2"}),"Sign Up or Login"]})]})},MI=m.createContext(null),Kw=()=>m.useContext(MI),Kre=({venueIds:e,children:t})=>{const[n,r]=m.useState(null),[s,i]=m.useState({}),[o,a]=m.useState({}),[c,u]=m.useState(!1),d=m.useMemo(()=>Array.from(new Set(e.filter(Boolean))).sort().join(","),[e]),f=m.useRef([]);m.useEffect(()=>{f.current=d?d.split(","):[]},[d]),m.useEffect(()=>{q.auth.getUser().then(({data:g})=>{var v;return r(((v=g.user)==null?void 0:v.id)??null)})},[]);const h=m.useCallback(async()=>{const g=f.current;if(!g.length){i({}),a({}),u(!0);return}try{const[v,b]=await Promise.all([q.from("venue_votes").select("id, venue_id, user_id, vote_type, created_at").in("venue_id",g),q.from("venue_comments").select("id, venue_id, user_id, comment, created_at, updated_at, parent_id").in("venue_id",g).order("created_at",{ascending:!0})]),y=b.data??[],w=v.data??[],x=Array.from(new Set([...y.map(_=>_.user_id),...w.map(_=>
686_.user_id)].filter(Boolean))),S={};if(x.length){const{data:_}=await q.from("profiles").select("id, display_name, avatar_url").in("id",x);_==null||_.forEach(j=>{S[j.id]={display_name:j.display_name??void 0,avatar_url:j.avatar_url}})}const C={};g.forEach(_=>C[_]=[]),w.forEach(_=>{var j;_.venue_id&&C[_.venue_id]&&C[_.venue_id].push({id:_.id,user_id:_.user_id,vote_type:_.vote_type,created_at:_.created_at,display_name:_.user_id?((j=S[_.user_id])==null?void 0:j.display_name)??"Anonymous":"Anonymous"})});const k={};g.forEach(_=>k[_]=[]),y.forEach(_=>{var R,P;const j={..._,display_name:_.user_id?((R=S[_.user_id])==null?void 0:R.display_name)??"Anonymous":"Anonymous",avatar_url:_.user_id?((P=S[_.user_id])==null?void 0:P.avatar_url)??null:null};_.venue_id&&k[_.venue_id]&&k[_.venue_id].push(j)}),i(C),a(k)}catch(v){console.error("[VenueSocialProvider] fetch failed:",v)}finally{u(!0)}},[]);m.useEffect(()=>{h()},[d,h]),m.useEffect(()=>{if(!d)return;const g=q.channel(`venue_social:${d.slice(0,64)}:${Math.random().toString(36).slice(2,8)}`).on("postgres_changes",{event:"*",schema:"public",table:"venue_votes"},v=>{var y,w;const b=((y=v.new)==null?void 0:y.venue_id)??((w=v.old)==null?void 0:w.venue_id)??null;(!b||f.current.includes(b))&&h()}).on("postgres_changes",{event:"*",schema:"public",table:"venue_comments"},v=>{var y,w;const b=((y=v.new)==null?void 0:y.venue_id)??((w=v.old)==null?void 0:w.venue_id)??null;(!b||f.current.includes(b))&&h()}).subscribe();return()=>{q.removeChannel(g)}},[d,h]);const p=m.useMemo(()=>{let g=0,v=0;return Object.values(s).forEach(b=>g+=b.length),Object.values(o).forEach(b=>v+=b.length),{isReady:c,currentUserId:n,getVotes:b=>{const y=s[b]??[];let w=0,x=0;return y.forEach(S=>S.vote_type==="up"?w++:S.vote_type==="down"?x++:null),{up:w,down:x,rows:y}},getUserVote:b=>{var w;return n?((w=(s[b]??[]).find(x=>x.user_id===n))==null?void 0:w.vote_type)??null:null},getComments:b=>o[b]??[],getCommentCount:b=>(o[b]??[]).length,totalVotes:g,totalComments:v,refresh:h}},[c,n,s,o,h]);return l.jsx(MI.Provider,{value:p,children:t})},Yre=e=>{const t=document.getElementById(`venue-card-${e}`);if(!t)return;t.scrollIntoView({behavior:"smooth",block:"center"});const n=["ring-2","ring-primary","ring-offset-2","ring-offset-background","transition-all"];t.classList.add(...n),window.setTimeout(()=>t.classList.remove(...n),1800)},Jre=({venues:e,className:t=""})=>{const n=Kw(),r=m.useMemo(()=>{const c=e.map(u=>{const d=n?n.getVotes(u.id):{up:0,down:0},f=n?n.getCommentCount(u.id):0;return{...u,upVotes:d.up,downVotes:d.down,netVotes:d.up-d.down,commentCount:f}});return c.sort((u,d)=>d.netVotes!==u.netVotes?d.netVotes-u.netVotes:d.upVotes!==u.upVotes?d.upVotes-u.upVotes:d.commentCount-u.commentCount),c},[e,n]),s=(n==null?void 0:n.totalVotes)??0,i=(n==null?void 0:n.totalComments)??0,o=s>0||i>0,a=(c,u)=>c===0?l.jsx(TN,{className:"h-3.5 w-3.5 text-yellow-500"}):c===1?l.jsx(N1,{className:"h-3.5 w-3.5 text-gray-400"}):c===2&&u>3?l.jsx(N1,{className:"h-3.5 w-3.5 text-amber-600"}):l.jsxs("span",{className:"text-[10px] font-medium text-muted-foreground w-3.5 text-center",children:["#",c+1]});return r.length?l.jsxs(Tp,{children:[l.jsx(Pp,{asChild:!0,children:l.jsxs("button",{type:"button",className:`inline-flex items-center gap-1.5 h-7 px-2 rounded-full border border-border bg-card/40 backdrop-blur-sm hover:bg-muted/30 transition-colors text-xs ${t}`,title:"Show vote & comment rankings",children:[l.jsxs("span",{className:"sm:hidden inline-flex items-center gap-1",children:[l.jsx(wi,{className:"w-3 h-3 text-muted-foreground"}),l.jsx("span",{className:"tabular-nums text-muted-foreground",children:s}),l.jsx("span",{className:"text-muted-foreground/60",children:"/"}),l.jsx(Na,{className:"w-3 h-3 text-muted-foreground"}),l.jsx("span",{className:"tabular-nums text-muted-foreground",children:i})]}),l.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1.5",children:[l.jsx(k1,{className:"w-3 h-3 text-primary"}),l.jsx("span",{className:"text-muted-foreground",children:"Votes"}),l.jsx("span",{className:"text-foreground tabular-nums font-medium",children:s}
686),l.jsx("span",{className:"text-muted-foreground/40",children:"/"}),l.jsx("span",{className:"text-muted-foreground",children:"Comments"}),l.jsx("span",{className:"text-foreground tabular-nums font-medium",children:i}),l.jsx(xi,{className:"w-3 h-3 text-muted-foreground"})]})]})}),l.jsxs(Uu,{align:"start",className:"w-96 p-3 bg-card border border-border shadow-lg",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(k1,{className:"w-4 h-4 text-primary shrink-0"}),l.jsx("span",{className:"text-sm font-semibold",children:"Venue rankings"}),l.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground inline-flex items-center gap-1",children:[l.jsx(wi,{className:"w-3 h-3"}),s,l.jsx(Na,{className:"w-3 h-3 ml-1"}),i]})]}),o?l.jsx("div",{className:"space-y-1 max-h-[60vh] overflow-y-auto",children:r.map((c,u)=>l.jsxs(de.button,{type:"button",initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:u*.02},onClick:()=>c.id&&Yre(c.id),className:`w-full text-left flex items-center gap-2 px-2 py-1 rounded-md hover:bg-muted/60 transition-colors ${u===0&&c.netVotes>0?"bg-yellow-500/10 border border-yellow-500/20":"bg-muted/30"}`,children:[l.jsx("div",{className:"flex items-center justify-center w-5 shrink-0",children:a(u,r.length)}),c.time&&l.jsx("span",{className:"text-[10px] text-muted-foreground tabular-nums shrink-0 w-14 truncate",children:c.time}),l.jsx("p",{className:"text-xs font-medium truncate flex-1 min-w-0",children:c.name}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 text-xs tabular-nums",children:[l.jsxs("span",{className:"inline-flex items-center gap-0.5 text-green-500 font-medium",children:[l.jsx(wi,{className:"w-3 h-3"}),c.upVotes]}),l.jsxs("span",{className:"inline-flex items-center gap-0.5 text-red-500 font-medium",children:[l.jsx(Gc,{className:"w-3 h-3"}),c.downVotes]}),l.jsxs("span",{className:"inline-flex items-center gap-0.5 text-muted-foreground font-medium",children:[l.jsx(Na,{className:"w-3 h-3"}),c.commentCount]})]})]},c.id))}):l.jsx("p",{className:"text-sm text-muted-foreground text-center py-3",children:"No votes or comments yet. Engage with venues below to see rankings!"})]})]}):null},Xre=({warnings:e,className:t=""})=>e.length===0?null:l.jsxs(Tp,{children:[l.jsx(Pp,{asChild:!0,children:l.jsxs("button",{type:"button",className:`inline-flex items-center gap-1.5 h-7 px-2 rounded-full border border-primary/30 bg-primary/10 hover:bg-primary/15 transition-colors text-xs ${t}`,title:"Show schedule alerts",children:[l.jsx(Kc,{className:"w-3 h-3 text-primary"}),l.jsxs("span",{className:"text-foreground font-medium",children:[l.jsx("span",{className:"sm:hidden",children:e.length}),l.jsxs("span",{className:"hidden sm:inline",children:[e.length," ",e.length===1?"alert":"alerts"]})]}),l.jsx(xi,{className:"w-3 h-3 text-muted-foreground hidden sm:inline"})]})}),l.jsxs(Uu,{align:"end",className:"w-80 p-3 bg-card border border-border shadow-lg",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(Kc,{className:"w-4 h-4 text-primary shrink-0"}),l.jsxs("span",{className:"text-sm font-semibold",children:["Schedule ",e.length===1?"alert":"alerts"]})]}),l.jsx("ul",{className:"list-disc space-y-1 pl-4 text-xs text-muted-foreground",children:e.map(n=>l.jsx("li",{className:"leading-relaxed",children:n},n))})]})]}),Qre=({className:e="",isHost:t=!0,renderVenueExtra:n,sseProgress:r=null,sseProgressEvents:s,sseResult:i=null,sseError:o=null,timeline:a,persistToDb:c=!1,collabSessionId:u=null,showVotingRanking:d=!1,voteRefreshKey:f=0})=>{const{prompt:h,location:p,itineraryId:g,isGenerating:v,suggestedVenues:b,setSuggestedVenues:y,isReviewing:w,plannedCity:x,generationWarnings:S}=vn(),{isReverting:C,isModifying:k,pendingPreview:_,remotePreviewOpen:j}=Lu(),[R,P]=$.useState(null);$.useEffect(()=>{q.auth.getSession().then(({data:{session:V}})=>{P(!!V)})},[]);const M=RI({isGenerating:v,progress:r,progressEvents:s,result:i,error:o}),T=a??M,L=b.length>0,F=!v&&!L,z=T.runId>0;return l.jsxs("div",{className:`relative flex flex-col h-full ${e}`,children:[(C||k)&&l.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-background/70 backdrop-blur-md animate-fade-in",children:[l.jsx(js,{className:"h-8 w-8 text-primary animate-spin"}),l.jsx("p",{className:"text-sm font-medium text-foreground",children:C?"Reverting itinerary…":j?"Another participant is reviewing an AI edit…":"Updating itinerary…"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:C?"Restoring this version of your plan":j?"The canvas is locked until they accept or reject the change":"Applying your edit to the plan"})]}
686),_&&l.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-[5] opacity-[0.07]",style:{backgroundImage:"repeating-linear-gradient(45deg, hsl(var(--primary)) 0 12px, transparent 12px 28px)"}}),l.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-6",children:l.jsxs("div",{className:"mx-auto max-w-4xl",children:[(z||S.length>0||d&&u&&w&&L)&&l.jsxs("div",{className:"relative z-20 pt-3 pb-2 flex items-center justify-between gap-2 flex-wrap",children:[l.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:d&&u&&w&&L&&l.jsx(Jre,{venues:b,sessionId:u,refreshTrigger:f})}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[z&&l.jsx(zre,{timeline:T,defaultCollapsed:!0}),l.jsx(Xre,{warnings:S})]})]}),l.jsx("div",{className:"relative z-0",children:l.jsxs(yt,{mode:"wait",children:[v&&l.jsx(de.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:l.jsx(Mre,{progress:r,isGenerating:v})},"generating"),F&&l.jsxs(de.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0},className:"flex flex-col items-center justify-center py-16 text-center gap-4",children:[l.jsx("div",{className:"rounded-full bg-primary/10 p-4",children:l.jsx(er,{className:"w-8 h-8 text-primary"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold",children:"Your itinerary will appear here"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-sm",children:"Use the chat to describe your ideal outing and I'll build a personalized plan for you."})]})]},"empty"),L&&!v&&l.jsx(de.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.4,ease:"easeOut"},children:l.jsx(SI,{suggestedVenues:b,setSuggestedVenues:y,itineraryId:g,prompt:h,location:p,isHost:t,renderVenueExtra:n,persistToDb:c})},"content")]})})]})}),L&&!v&&R===!1&&l.jsx("div",{className:"flex-shrink-0 border-t border-border p-3",children:l.jsx("div",{className:"mx-auto max-w-4xl",children:l.jsx(Gre,{})})})]})}
686,Zre={solo:{icon:Pr,title:"Plan Your Outing",subtitle:"Craft the perfect plan, your way",accentClass:"text-primary bg-primary/10 border border-primary/20"},collaborative:{icon:Gt,title:"Planning Together",subtitle:"Collaborate with friends in real-time",accentClass:"text-primary bg-primary/10 border border-primary/20"}},II=({mode:e,compact:t=!1})=>{const n=Zre[e],r=n.icon;return t?l.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[l.jsx("div",{className:`flex items-center justify-center w-8 h-8 sm:w-10 sm:h-10 rounded-lg sm:rounded-xl ${n.accentClass}`,children:l.jsx(r,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:"text-sm sm:text-xl font-bold whitespace-nowrap block leading-tight",children:n.title}),l.jsx("span",{className:"text-xs text-muted-foreground leading-tight hidden sm:block",children:n.subtitle})]})]}):l.jsxs(de.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.3},className:"flex items-center gap-3.5",children:[l.jsx("div",{className:`flex items-center justify-center w-10 h-10 rounded-xl ${n.accentClass}`,children:l.jsx(r,{className:"w-5 h-5"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h1",{className:"text-xl sm:text-2xl font-bold leading-tight tracking-tight",children:n.title}),l.jsx("p",{className:"text-sm text-muted-foreground leading-tight",children:n.subtitle})]})]})},ese=({mode:e,controlButtons:t})=>{const{plannedCity:n,date:r,peopleCount:s,startTime:i,endTime:o,planIntent:a}=vn();return l.jsxs("div",{className:"w-full min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 px-3 sm:px-6 py-2 sm:py-3 min-w-0",children:[l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx(II,{mode:e,compact:!0})}),t&&l.jsx("div",{className:"flex-shrink-0",children:t})]}),n&&l.jsx(_I,{plannedCity:n,date:r,peopleCount:s,startTime:i,endTime:o,aiStartTime:(a==null?void 0:a.inferred_start_time)??null,aiEndTime:(a==null?void 0:a.inferred_end_time)??null})]})};var OI="AlertDialog",[tse,Cie]=Bs(OI,[GR]),Us=GR(),DI=e=>{const{__scopeAlertDialog:t,...n}=e,r=Us(t);return l.jsx(_w,{...r,...n,modal:!0})};DI.displayName=OI;var nse="AlertDialogTrigger",LI=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Us(n);return l.jsx(cM,{...s,...r,ref:t})});LI.displayName=nse;var rse="AlertDialogPortal",$I=e=>{const{__scopeAlertDialog:t,...n}=e,r=Us(t);return l.jsx(Cw,{...r,...n})};$I.displayName=rse;var sse="AlertDialogOverlay",FI=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Us(n);return l.jsx(Sp,{...s,...r,ref:t})});FI.displayName=sse;var $a="AlertDialogContent",[ise,ose]=tse($a),zI=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=Us(n),o=m.useRef(null),a=vt(t,o),c=m.useRef(null);return l.jsx(PQ,{contentName:$a,titleName:BI,docsSlug:"alert-dialog",children:l.jsx(ise,{scope:n,cancelRef:c,children:l.jsxs(kp,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:Ae(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[l.jsx(Gx,{children:r}),l.jsx(lse,{contentRef:o})]})})})});zI.displayName=$a;var BI="AlertDialogTitle",VI=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Us(n);return l.jsx(_p,{...s,...r,ref:t})});VI.displayName=BI;var UI="AlertDialogDescription",HI=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Us(n);return l.jsx(Cp,{...s,...r,ref:t})});HI.displayName=UI;var ase="AlertDialogAction",WI=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Us(n);return l.jsx(jp,{...s,...r,ref:t})});WI.displayName=ase;var qI="AlertDialogCancel",GI=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=ose(qI,n),i=Us(n),o=vt(t,s);return l.jsx(jp,{...i,...r,ref:o})});GI.displayName=qI;var lse=({contentRef:e})=>{const t=`\`${$a}\` requires a description for the component to be accessible for screen reader users.
687
688You can add a description to the \`${$a}\` by passing a \`${UI}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
689
690Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${$a}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
691
692For more information, see https://radix-ui.com/primitives/docs/components/
692alert-dialog`;return m.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},cse=DI,use=LI,dse=$I,KI=FI,YI=zI,JI=WI,XI=GI,QI=VI,ZI=HI;const si=cse,eO=use,fse=dse,tO=m.forwardRef(({className:e,...t},n)=>l.jsx(KI,{className:ae("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));tO.displayName=KI.displayName;const ms=m.forwardRef(({className:e,...t},n)=>l.jsxs(fse,{children:[l.jsx(tO,{}),l.jsx(YI,{ref:n,className:ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));ms.displayName=YI.displayName;const gs=({className:e,...t})=>l.jsx("div",{className:ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});gs.displayName="AlertDialogHeader";const ys=({className:e,...t})=>l.jsx("div",{className:ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ys.displayName="AlertDialogFooter";const vs=m.forwardRef(({className:e,...t},n)=>l.jsx(QI,{ref:n,className:ae("text-lg font-semibold",e),...t}));vs.displayName=QI.displayName;const xs=m.forwardRef(({className:e,...t},n)=>l.jsx(ZI,{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));xs.displayName=ZI.displayName;const ws=m.forwardRef(({className:e,...t},n)=>l.jsx(JI,{ref:n,className:ae(nu(),e),...t}));ws.displayName=JI.displayName;const bs=m.forwardRef(({className:e,...t},n)=>l.jsx(XI,{ref:n,className:ae(nu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));bs.displayName=XI.displayName;const Yw=_w,hse=Cw,nO=m.forwardRef(({className:e,...t},n)=>l.jsx(Sp,{ref:n,className:ae("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));nO.displayName=Sp.displayName;const Ip=m.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(hse,{children:[l.jsx(nO,{}),l.jsxs(kp,{ref:r,className:ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(jp,{className:"absolute right-4 top-4 roun
692ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(Dn,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ip.displayName=kp.displayName;const Op=({className:e,...t})=>l.jsx("div",{className:ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Op.displayName="DialogHeader";const Dp=m.forwardRef(({className:e,...t},n)=>l.jsx(_p,{ref:n,className:ae("text-lg font-semibold leading-none tracking-tight",e),...t}));Dp.displayName=_p.displayName;const Jw=m.forwardRef(({className:e,...t},n)=>l.jsx(Cp,{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));Jw.displayName=Cp.displayName;const gn=m.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:ae("flex h-10 w-full rounded-[1.5rem] border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));gn.displayName="Input";const pse=()=>{const e=Kt(),{persistToSession:t,setItineraryId:n,itineraryId:r}=vn(),[s,i]=m.useState(!1),[o,a]=m.useState(!1),c=o||!!r,[u,d]=m.useState(r||null),f=m.useCallback(()=>{t(),sessionStorage.setItem("ezy_return_to","/new-plan"),e("/login",{state:{returnTo:"/new-plan"}})},[e,t]);return{saveItinerary:m.useCallback(async({itineraryId:p,venues:g,title:v,description:b,plannedCity:y})=>{const{data:{session:w}}=await q.auth.getSession();if(!w)return J.error("Please sign in to save your plan!",{action:{label:"Sign In",onClick:f}}),null;if(!p&&(!g||g.length===0))return J.error("No plan to save. Generate a plan first!"),null;i(!0);try{let x=p;if(!x&&g&&g.length>0){const{data:S,error:C}=await q.from("itineraries").insert({title:v||"My Plan",description:b||null,user_id:w.user.id,status:"final",planned_city:y||null}).select().single();if(C)throw C;x=S.id;const k=g.map(({votes:j,comments:R,holiday_info:P,hours_source:M,estimated_price_range_source:T,openNow_at_query_time:L,open_at_visit:F,special_days:z,live_status_label:V,...I})=>({...I,itinerary_id:x,hours_source:M??null,open_now_at_query_time:L??null,open_at_visit:F??null,special_days:z??null,holiday_info:P??null,live_status_label:V??null})),{error:_}=await q.from("venues").insert(k);_&&(console.error("Error saving venues:",_),J.error("Some venues couldn't be saved, but your plan is ready!")),n(x)}else if(x&&g&&g.length>0){const{error:S}=await q.from("itineraries").update({status:"final",title:v||void 0,description:b||void 0}).eq("id",x);if(S)throw S;const{error:C}=await q.from("venues").delete().eq("itinerary_id",x);if(C)throw console.error("Error deleting old venues:",C),C;const k=g.map(({votes:j,comments:R,holiday_info:P,hours_source:M,estimated_price_range_source:T,openNow_at_query_time:L,open_at_visit:F,special_days:z,live_status_label:V,...I})=>({...I,itinerary_id:x,hours_source:M??null,open_now_at_query_time:L??null,open_at_visit:F??null,special_days:z??null,holiday_info:P??null,live_status_label:V??null})),{error:_}=await q.from("venues").insert(k);_&&(console.error("Error re-inserting venues:",_),J.error("Some venues couldn't be saved, but your plan is ready!"))}else{const{error:S}=await q.from("itineraries").update({status:"final"}).eq("id",x);if(S)throw S}return d(x),a(!0),J.success("Plan saved to your collection! 🎉"),x}catch(x){return console.error("Error saving itinerary:",x),J.error("Couldn't save your plan. Please try again!"),null}finally{i(!1)}},[f,n]),isSaving:s,isSaved:c,savedItineraryId:u}},mse=({sessionId:e,isHost:t,isCollaborative:n,participants:r,onStartCollab:s,onLeaveSession:i})=>{const o=Kt(),a=$u(),{prompt:c,suggestedVenues:u,itineraryId:d,location:f,plannedCity:h}=vn(),{saveItinerary:p,isSaving:g,isSaved:v}=pse(),[b,y]=m.useState(!1),[w,x]=m.useState(!1),[S,C]=m.useState(!1),[k,_]=m.useState(!1),[j,R]=m.useState(!1),[P,M]=m.useState(!1),[T,L]=m.useState(!1),[F,z]=m.useState(c||""),[V,I]=m.useState(h?`Adventure in ${h.name}`:`Adventure in ${f}`),A="inline-flex items-center rounded-lg border border-border/60 bg-card/40 backdrop-blur-sm divide-x divide-border/40 overflow-hidden",D="inline-flex items-center justify-center gap-1.5 h-8 px-2 sm:px-3 text-xs font-medium transition-colors hover:bg-muted/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:pointer-events-none",E=async()=>
692{if(!v&&!d){M(!0);return}await p({itineraryId:d,venues:u,title:c,description:V,plannedCity:h})},K=async()=>{M(!1),await p({itineraryId:d,venues:u,title:F||c||"My Plan",description:V||void 0,plannedCity:h})},te=()=>{o("/new-plan",{replace:!0}),window.location.reload()},N=async()=>{if(e)try{await q.rpc("cleanup_planning_session",{p_session_id:e}),J.success("Collaborative session ended"),o("/new-plan",{replace:!0}),window.location.reload()}catch(W){console.error("Error ending session:",W),J.error("Failed to end session")}},ee=async()=>{if(e)try{await q.rpc("cleanup_planning_session",{p_session_id:e}),J.success("Switched back to solo planning"),i()}catch(W){console.error("Error switching to solo:",W),J.error("Failed to switch to solo mode")}},ie=async()=>{if(!e)return;const W=`${window.location.origin}/new-plan?session=${e}`;if(navigator.share&&a)try{await navigator.share({title:"Join my planning session",text:"Let's plan together on Ask EZY!",url:W})}catch{L(!0)}else L(!0)},U=async()=>{i()};if(!n)return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:A,children:[l.jsxs("button",{type:"button",title:"Switch to collaborative session",className:`${D} text-primary hover:text-primary`,onClick:()=>y(!0),disabled:u.length===0,children:[l.jsx(Gt,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"Collaborate"})]}),l.jsxs("button",{type:"button",title:g?"Saving…":v?"Saved":"Save plan",className:`${D} text-foreground/80`,onClick:E,disabled:g||u.length===0,children:[l.jsx(jN,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:g?"Saving…":v?"Saved":"Save"})]}),l.jsxs("button",{type:"button",title:"Exit planning",className:`${D} text-destructive hover:text-destructive`,onClick:()=>x(!0),children:[l.jsx(Dn,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"Exit"})]})]}),l.jsx(si,{open:b,onOpenChange:y,children:l.jsxs(ms,{children:[l.jsxs(gs,{children:[l.jsx(vs,{children:"Switch to Collaborative Session?"}),l.jsx(xs,{children:"Are you sure you want to change to a collaborative session? After changing, you can only revert to solo mode when there are no other participants."})]}),l.jsxs(ys,{children:[l.jsx(bs,{children:"Cancel"}),l.jsx(ws,{onClick:s,children:"Proceed"})]})]})}),l.jsx(si,{open:w,onOpenChange:x,children:l.jsxs(ms,{children:[l.jsxs(gs,{children:[l.jsx(vs,{children:"Exit Planning?"}),l.jsx(xs,{children:"All unsaved changes will be lost. Are you sure you want to exit?"})]}),l.jsxs(ys,{children:[l.jsx(bs,{children:"Cancel"}),l.jsx(ws,{onClick:te,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Exit"})]})]})}),l.jsx(Yw,{open:P,onOpenChange:M,children:l.jsxs(Ip,{className:"sm:max-w-md",children:[l.jsxs(Op,{children:[l.jsx(Dp,{children:"Save Your Plan"}),l.jsx(Jw,{children:"Give your itinerary a title and description before saving."})]}),l.jsxs("div",{className:"space-y-4 pt-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(tn,{htmlFor:"save-title",children:"Title"}),l.jsx(gn,{id:"save-title",value:F,onChange:W=>z(W.target.value),placeholder:"My awesome plan"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(tn,{htmlFor:"save-desc",children:"Description (optional)"}),l.jsx(gn,{id:"save-desc",value:V,onChange:W=>I(W.target.value),placeholder:"A fun day out in the city"})]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Fe,{variant:"outline",onClick:()=>M(!1),children:"Cancel"}),l.jsx(Fe,{onClick:K,disabled:g,children:g?"Saving…":"Save"})]})]})]})})]});if(t){const W=r.length>1;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:A,children:[l.jsxs("button",{type:"button",title:"Switch to solo planning",className:`${D} text-foreground/80`,onClick:()=>{W?_(!0):ee()},children:[l.jsx(q4,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"Plan Alone"})]}),l.jsxs("button",{type:"button",title:"Invite to session",className:`${D} text-primary hover:text-primary`,onClick:ie,children:[l.jsx(So,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"Invite"}),r.length>1&&l.jsx("span",{className:"ml-0.5 bg-primary/20 rounded-full px-1.5 py-0.5 text-[10px] leading-none",children:r.length})]}),l.jsxs("button",{type:"button",title:"End session",className:`${D} text-destructive hover:text-destructive`,onClick:()=>C(!0),children:[l.jsx(Dn,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"End"})]})]}),l.jsx(si,{open:k,onOpenChange:_,children:l.jsxs(ms,{children:[l.jsxs(gs,{children:[l.jsx(vs,{children:"Switch to Solo Mode?"}),l.jsxs(xs,{children:["There are ",r.length-1," other participant(s) in this session. Switching to solo will end the collaborative session for everyone and remove all session data (votes, messages), but keep the itinerary."]})]}),l.jsxs(ys,{children:[l.jsx(bs,{children:"Cancel"}),l.jsx(ws,{onClick:ee,children:"Switch to Solo"})]})]})}),l.jsx(si,{open:S,onOpenChange:C,children:l.jsxs(ms,{children:[l.jsxs(gs,{children:[l.jsx(vs,{children:"End Collaborative Session?"}),l.jsx(xs,{children:"This will end the session for all participants, remove session data (messages, votes), and redirect everyone. The itinerary will be kept."})]}),l.jsxs(ys,{children:[l.jsx(bs,{children:"Cancel"}),l.jsx(ws,{onClick:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"End Session"})]})]})}),l.jsx(jC,{open:T,onOpenChange:L,sessionId:e,participantCount:r.length})]})}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:A,children:[l.jsxs("button",{type:"button",title:"Invite to session",className:`${D} text-primary hover:text-primary`,onClick:ie,children:[l.jsx(So,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"Invite"})]}),l.jsxs("button",{type:"button",title:"Leave session",className:`${D} text-destructive hover:text-destructive`,onClick:()=>R(!0),children:[l.jsx(zx,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"hidden sm:inline",children:"Leave"})]})]}),l.jsx(si,{open:j,onOpenChange:R,children:l.jsxs(ms,{children:[l.jsxs(gs,{children:[l.jsx(vs,{children:"Leave Session?"}),l.jsx(xs,{children:"You will be removed from the participant list. You can rejoin later with the session link."})]}),l.jsxs(ys,{children:[l.jsx(bs,{children:"Cancel"}),l.jsx(ws,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Leave"})]})]})}),l.jsx(jC,{open:T,onOpenChange:L,sessionId:e,participantCount:r.length})]})},jC=({open:e,onOpenChange:t,sessionId:n,participantCount:r})=>{const s=n?`${window.location.origin}/new-plan?session=${n}`:"";return l.jsx(Yw,{open:e,onOpenChange:t,children:l.jsxs(Ip,{className:"sm:max-w-md",children:[l.jsxs(Op,{children:[l.jsx(Dp,{children:"Invite to Session"}),l.jsx(Jw,{children:"Share this link with friends to plan together."})]}),l.jsxs("div",{className:"space-y-4 pt-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(tn,{children:"Session Link"}),l.jsxs(Fe,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{navigator.clipboard.writeText(s),J.success("Link copied to clipboard!")},children:[l.jsx(xN,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})]}),l.jsx(gn,{value:s,readOnly:!0,className:"text-xs bg-muted font-mono"})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Currently ",r," ",r===1?"person":"people"," in this session."]})]})]})})},gse=()=>{const[e,t]=m.useState(null),[n,r]=m.useState([]),[s,i]=m.useState(!1);return{sessionId:e,participants:n,isHost:s,createSession:async(u,d)=>{try{const{data:{user:f}}=await q.auth.getUser();if(!f)throw J.error("Please log in to create a session"),new Error("Not authenticated");const h=crypto.randomUUID(),{error:p}=await q.from("planning_sessions").insert({id:h,title:u,description:d,status:"active"});if(p)throw console.error("Error creating session:",p),J.error("Failed to create planning session"),p;const{error:g}=await q.from("planning_participants").insert({session_id:h,user_id:f.id,role:"host"});if(g)throw console.error("Error adding participant:",g),J.error("Failed to set up session participation"),g;return t(h),i(!0),J.success("Created new planning session!"),h}catch(f){throw console.error("Error creating session:",f),J.error(f.message||"Failed to create planning session"),f}},joinSession:async u=>{try{const{data:{user:d}}=await q.auth.getUser();if(!d)throw J.error("Please log in to join a session"),new Error("Not authenticated");const f=u.trim(),{data:h}=await q.from("planning_participants").select("role").eq("session_id",f).eq("user_id",d.id).maybeSingle();if(h){t(f),i(h.role==="host"),J.success("Rejoined planning session!");return}const{error:p}=await q.from("planning_participants").insert({session_id:f,user_id:d.id,role:"participant"});if(p)throw p.code==="23503"?(J.error("Invalid or expired session code"),new Error("Session not found")):(console.error("Error joining session:",p),J.error("Failed to join session"),p);t(f),i(!1),J.success("Joined planning session!")}catch(d){throw console.error("Error joining session:",d),J.error(d.message||"Failed to join session"),d}},leaveSession:async()=>{try{if(!e)return;const{data:{user:u}}=await q.auth.getUser();if(!u)return;const{error:d}=await q.from("planning_participants").delete().match({session_id:e,user_id:u.id});if(d)throw console.error("Error leaving session:",d),J.error("Failed to leave session"),d;t(null),i(!1),r([]),J.success("Left planning session")}catch(u){console.error("Error leaving session:",u),J.error(u.message||"Failed to leave session")}}}},rO=18*60*1e3,sO=20*60*1e3,yse=Math.floor((sO-rO)/1e3),vse=({enabled:e,onTimeout:t,onReconnect:n})=>{const r=m.useRef(null),s=m.useRef(null),i=m.useRef(null),o=m.useRef(t),a=m.useRef(n),c=m.useRef(!1);m.useEffect(()=>{o.current=t},[t]),m.useEffect(()=>{a.current=n},[n]);const u=m.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),s.current&&(clearTimeout(s.current),s.current=null),i.current&&(clearInterval(i.current),i.current=null),J.dismiss("session-timeout-warning")},[]),d=p=>{const g=Math.floor(p/60),v=p%60;return`${g}:${v.toString().padStart(2,"0")}`},f=m.useCallback(()=>{u(),c.current=!1,r.current=setTimeout(()=>{let p=yse;J.warning(`You will be set to offline in ${d(p)} due to inactivity`,{id:"session-timeout-warning",duration:1/0}),i.current=setInterval(()=>{if(p-=1,p<=0){i.current&&(clearInterval(i.current),i.current=null),J.dismiss("session-timeout-warning");return}J.warning(`You will be set to offline in ${d(p)} due to inactivity`,{id:"session-timeout-warning",duration:1/0})},1e3)},rO),s.current=setTimeout(()=>{c.current=!0,o.current()},sO)},[u]),h=m.useCallback(()=>{var p;e&&(c.current&&(c.current=!1,(p=a.current)==null||p.call(a)),f())},[e,f]);return m.useEffect(()=>{if(!e){u();return}f();const p=["mousedown","keydown","touchstart"];return p.forEach(g=>window.addEventListener(g,h,{passive:!0})),()=>{u(),p.forEach(g=>window.removeEventListener(g,h))}},[e,f,u,h]),{resetActivity:h}};typeof window<"u"&&(window.__HAS_GROUP_PLANNING__=!0);const iO=m.createContext(null),oO=()=>{const e=m.useContext(iO);if(!e)throw new Error("useGroupPlanning must be used within a GroupPlanningProvider");return e},xse=({children:e})=>{const{sessionId:t,isHost:n,createSession:r,joinSession:s,leaveSession:i}=gse(),[o,a]=m.useState(!1),[c,u]=m.useState([]),[d,f]=m.useState([]),[h,p]=m.useState(null),[g,v]=m.useState(null),[b,y]=m.useState(null),[w,x]=m.useState(null),[S,C]=m.useState(null),[k,_]=m.useState({}),j=m.useRef(null),[R,P]=m.useState([]),[M,T]=m.useState(null),[L,F]=m.useState(!1),z=m.useCallback(()=>{F(!0),J.warning("You went offline due to inactivity. Any interaction will reconnect you.",{id:"session-timed-out",duration:1/0}),window.scrollTo({top:0,behavior:"smooth"}),j.current&&(q.removeChannel(j.current),j.current=null)},[]),V=m.useCallback(()=>{F(!1),J.dismiss("session-timed-out"),J.success("You are back online!",{duration:3e3})},[]),{resetActivity:I}=vse({enabled:!!t,onTimeout:z,onReconnect:V});m.useEffect(()=>{(async()=>{const{data:{user:W}}=await q.auth.getUser();T((W==null?void 0:W.id)??null)})()},[]),m.useEffect(()=>{if(!t){P([]);return}const U=async()=>{const{data:oe,error:Z}=await q.from("planning_participants").select("user_id, role, profiles(display_name)").eq("session_id",t);if(Z){console.error("Error fetching participants:",Z);return}if(oe){const se=oe.map(re=>{var Y;return{id:re.user_id,name:((Y=re.profiles)==null?void 0:Y.display_name)||"User",role:re.role||"participant",isOnline:!1,isTyping:!1}});P(se)}};U();const W=q.channel(`participants_insert_${t}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"planning_participants",filter:`session_id=eq.${t}`},async oe=>{const Z=oe.new;console.log("[Participants] INSERT event received:",Z);const{data:se}=await q.from("profiles").select("display_name").eq("id",Z.user_id
692).maybeSingle();P(re=>re.some(Y=>Y.id===Z.user_id)?re:[...re,{id:Z.user_id,name:(se==null?void 0:se.display_name)||"User",role:Z.role||"participant",isOnline:!1,isTyping:!1}])}).subscribe(),ne=q.channel(`participants_delete_${t}`).on("postgres_changes",{event:"DELETE",schema:"public",table:"planning_participants"},oe=>{const Z=oe.old;console.log("[Participants] DELETE event received:",JSON.stringify(Z)),U()}).subscribe();return()=>{q.removeChannel(W),q.removeChannel(ne)}},[t]);const A=R.map(U=>{var W;return{...U,isOnline:!!k[U.id],isTyping:((W=k[U.id])==null?void 0:W.is_typing)||!1}}),D=async U=>{a(!0);try{await s(U)}finally{a(!1)}},E=async U=>{if(!t){J.error("No active session to send messages to");return}try{I();const{error:W}=await q.from("planning_messages").insert({session_id:t,message:U,sender_name:"System"});if(W)throw W}catch(W){console.error("Error sending message:",W),J.error(W.message||"Failed to send message")}},K=async(U,W)=>{var oe;if(!t)return J.error("No active session to send messages to"),null;const ne=U.trim();if(!ne)return null;try{I();const{data:{user:Z}}=await q.auth.getUser();if(!Z)return J.error("You must be logged in to send messages"),null;let se=W==null?void 0:W.senderName;if(!se){const{data:He}=await q.from("profiles").select("display_name").eq("id",Z.id).maybeSingle();se=(He==null?void 0:He.display_name)||((oe=Z.email)==null?void 0:oe.split("@")[0])||"User"}const re=(W==null?void 0:W.senderId)===void 0?Z.id:W.senderId,{data:Y,error:Ee}=await q.from("planning_messages").insert({session_id:t,message:ne,sender_name:se,user_id:re,message_target:(W==null?void 0:W.messageTarget)||null}).select("id").single();if(Ee)throw Ee;return(Y==null?void 0:Y.id)??null}catch(Z){return console.error("Error sending chat message:",Z),J.error(Z.message||"Failed to send message"),null}},te=async U=>{var W;if(j.current)try{const{data:{user:ne}}=await q.auth.getUser();if(!ne)return;const{data:oe}=await q.from("profiles").select("display_name").eq("id",ne.id).single();await j.current.track({online_at:new Date().toISOString(),user_id:ne.id,user_name:(oe==null?void 0:oe.display_name)||((W=ne.email)==null?void 0:W.split("@")[0])||"User",is_typing:U})}catch(ne){console.error("Error updating typing status:",ne)}},N=async()=>{if(t){a(!0);try{const{data:U,error:W}=await q.from("planning_sessions").select("title, description, itinerary_id").eq("id",t).single();if(W){console.error("Error fetching session:",W);return}if(p((U==null?void 0:U.title)||null),v((U==null?void 0:U.description)||null),x((U==null?void 0:U.itinerary_id)||null),U!=null&&U.itinerary_id){const{data:ne}=await q.from("itineraries").select("planned_city, plan_intent").eq("id",U.itinerary_id).single();ne!=null&&ne.planned_city&&y(ne.planned_city),ne!=null&&ne.plan_intent&&C(ne.plan_intent);const{data:oe,error:Z}=await q.from("venues").select("*").eq("itinerary_id",U.itinerary_id).order("created_at",{ascending:!0});if(Z){console.error("Error fetching venues:",Z);return}if(oe){const se=oe.map(re=>({id:re.id,name:re.name,time:re.time,location:re.location,description:re.description,fun_fact:re.fun_fact,badges:re.badges,venue_category:re.venue_category,opening_status:re.opening_status??re.operating_status,price_level:re.price_level,hours:re.hours,reservation_link:re.reservation_link,uber_link:re.uber_link,website_url:re.website_url,travel_time_to_next:re.travel_time_to_next,travel_distance_to_next:re.travel_distance_to_next,google_rating:re.google_rating,google_reviews_count:re.google_reviews_count,image_urls:re.image_urls,phone_number:re.phone_number,place_id:re.place_id,address:re.address,latitude:re.latitude??null,longitude:re.longitude??null,itinerary_id:re.itinerary_id,duration_minutes:re.duration_minutes,estimated_price_range:re.estimated_price_range,price_level_source:re.price_level_source,hours_source:re.hours_source??void 0,openNow_at_query_time:re.open_now_at_query_time??null,open_at_visit:re.open_at_visit??null,special_days:re.special_days??null,holiday_info:re.holiday_info??null,live_status_label:re.live_status_label??null,votes:{up:0,down:0},comments:[]}));f(se)}}}catch(U){console.error("Error loading session data:",U)}finally{a(!1)}}};m.useEffect(()=>{if(!t){f([]),p(null),v(null),C(null);return}N();let U=null,W=null;const ne=async se=>{U&&q.removeChannel(U),W&&q.removeChannel(W),U=q.channel(`session_venues_insert_${t}_${se}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"venues",filter:`itinerary_id=eq.${se}`},()=>{N()}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"venues",filter:`itinerary_id=eq.${se}`},()=>{N()}).subscribe(),W=q.channel(`session_venues_delete_${t}_${se}`).on("postgres_changes",{event:"DELETE",schema:"public",table:"venues"},()=>{N()}).subscribe()};(async()=>{const{data:se}=await q.from("planning_sessions").select("itinerary_id").eq("id",t).single();se!=null&&se.itinerary_id&&await ne(se.itinerary_id)})();const Z=q.channel(`session_updates_${t}`).on("postgres_changes",{event:"UPDATE",schema:"public",table:"planning_sessions",filter:`id=eq.${t}`},se=>{const re=se.new;!se.old.itinerary_id&&re.itinerary_id&&(console.log("Session linked to itinerary:",re.itinerary_id),N(),ne(re.itinerary_id))}).subscribe();return()=>{U&&q.removeChannel(U),W&&q.removeChannel(W),q.removeChannel(Z)}},[t]),m.useEffect(()=>{if(!t||L){j.current&&(q.removeChannel(j.current),j.current=null),_({});return}return(async()=>{var se;const{data:{user:W}}=await q.auth.getUser();if(!W)return;const{data:ne}=await q.from("profiles").select("display_name").eq("id",W.id).single(),oe=(ne==null?void 0:ne.display_name)||((se=W.email)==null?void 0:se.split("@")[0])||"User",Z=q.channel(`presence_${t}`).on("presence",{event:"sync"},()=>{const re=Z.presenceState(),Y={};Object.values(re).forEach(Ee=>{Ee.forEach(He=>{He.user_id&&(Y[He.user_id]=He)})}),_(Y)}).on("presence",{event:"join"},({key:re,newPresences:Y})=>{console.log("User joined:",Y)}).on("presence",{event:"leave"},({key:re,leftPresences:Y})=>{console.log("User left:",Y)}).subscribe(async re=>{re==="SUBSCRIBED"&&await Z.track({online_at:new Date().toISOString(),user_id:W.id,user_name:oe,is_typing:!1})});j.current=Z})(),()=>{j.current&&(q.removeChannel(j.current),j.current=null)}},[t,L]),m.useEffect(()=>{if(!t){u([]);return}const U=async()=>{try{const{data:oe,error:Z}=await q.from("planning_messages").select("*").eq("session_id",t).order("created_at",{ascending:!0});if(Z)throw Z;if(oe){const se=oe.map(re=>({id:re.id,message:re.message,sender:re.sender_name,senderId:re.user_id??null,timestamp:re.created_at||"",messageTarget:re.message_target??null}));u(se)}}catch(oe){console.error("Error fetching chat messages:",oe)}};U();const W=q.channel(`planning_messages_insert_${t}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"planning_messages",filter:`session_id=eq.${t}`},oe=>{const Z=oe.new;u(se=>se.some(re=>re.id===Z.id)?se:[...se,{id:Z.id,message:Z.message,sender:Z.sender_name,senderId:Z.user_id??null,timestamp:Z.created_at,messageTarget:Z.message_target??null}])}).subscribe(),ne=q.channel(`planning_messages_delete_${t}`).on("postgres_changes",{event:"DELETE",schema:"public",table:"planning_messages"},()=>{U()}).subscribe();return()=>{q.removeChannel(W),q.removeChannel(ne)}},[t]),m.useEffect(()=>{typeof window<"u"&&(window.__GROUP_PLANNING_CONTEXT__={sessionId:t,isHost:n,participants:A,sendMessage:E,chatMessages:c,sessionVenues:d})},[t,n,A,c,d]);const ie={sessionId:t,isHost:n,participants:A,currentUserId:M,isLoading:o,chatMessages:c,sessionVenues:d,sessionTitle:h,sessionDescription:g,sessionPlannedCity:b,sessionItineraryId:w,sessionPlanIntent:S,joinSession:D,leaveSession:i,sendMessage:E,sendChatMessage:K,createSession:r,setTyping:te,removeVenueLocally:U=>{f(W=>W.filter(ne=>ne.id!==U))},refetchVenues:N,sessionTimedOut:L,reconnectSession:V};return l.jsx(iO.Provider,{value:ie,children:e})},wse=({venueId:e,refreshTrigger:t,onVoteComplete:n})=>{const r=Kw(),s=r?r.getVotes(e):null,i=r?r.getUserVote(e):null,[o,a]=m.useState({up:0,down:0}),[c,u]=m.useState([]),[d,f]=m.useState(null),[h,p]=m.useState(null),[g,v]=m.useState(!1);m.useEffect(()=>{r||q.auth.getUser().then(({data:{user:x}})=>{p((x==null?void 0:x.id)||null)})},[r]);const b=async()=>
692{if(!(r||!e))try{const{data:x,error:S}=await q.from("venue_votes").select("id, vote_type, user_id, created_at").eq("venue_id",e);if(S)throw S;if(x){if(a({up:x.filter(k=>k.vote_type==="up").length,down:x.filter(k=>k.vote_type==="down").length}),h){const k=x.find(_=>_.user_id===h);f((k==null?void 0:k.vote_type)||null)}const C=x.map(k=>k.user_id).filter(Boolean);if(C.length>0){const{data:k}=await q.from("profiles").select("id, display_name").in("id",C);u(x.map(_=>{var j;return{..._,display_name:((j=k==null?void 0:k.find(R=>R.id===_.user_id))==null?void 0:j.display_name)||"Anonymous"}}).slice(-5))}else u([])}}catch(x){console.error("Error fetching votes:",x)}};m.useEffect(()=>{r||!e||b()},[r,e,h,t]);const y=async x=>{if(!e)return;const{data:{user:S}}=await q.auth.getUser();if(!S){J.error("Please sign in to vote");return}v(!0);try{const{data:C,error:k}=await q.from("venue_votes").select("id, vote_type").eq("venue_id",e).eq("user_id",S.id);if(k)throw k;if(C&&C.length>0){const _=C[0];if(_.vote_type===x){const{error:j}=await q.from("venue_votes").delete().eq("id",_.id);if(j)throw j;r||f(null),J.success("Vote removed")}else{const{error:j}=await q.from("venue_votes").update({vote_type:x}).eq("id",_.id);if(j)throw j;r||f(x),J.success(`Changed vote to ${x==="up"?"👍":"👎"}`)}}else{const{error:_}=await q.from("venue_votes").insert({venue_id:e,user_id:S.id,vote_type:x});if(_)throw _;r||f(x),J.success(`Voted ${x==="up"?"👍":"👎"}`)}r?r.refresh():await b(),n==null||n()}catch(C){console.error("Error voting:",C),J.error(C.message||"Failed to vote")}finally{v(!1)}},w=m.useMemo(()=>r?((s==null?void 0:s.rows)??[]).slice(-5).map(x=>({id:x.id,vote_type:x.vote_type,user_id:x.user_id,created_at:x.created_at??"",display_name:x.display_name??"Anonymous"})):c,[r,s,c]);return{votes:r?{up:s.up,down:s.down}:o,recentVoters:w,userVote:r?i:d,isVoting:g,handleVote:y}},bse=({venueId:e,refreshTrigger:t,onVoteComplete:n})=>{const{votes:r,recentVoters:s,userVote:i,isVoting:o,handleVote:a}=wse({venueId:e,refreshTrigger:t,onVoteComplete:n}),[c,u]=m.useState(!1),d=r.up+r.down,f=d>0?r.up/d*100:50;return l.jsx("div",{className:"space-y-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"inline-flex flex-col gap-1",children:[l.jsxs("div",{className:"inline-flex items-center bg-card/80 backdrop-blur-sm border border-border/50 rounded-full overflow-hidden",children:[l.jsxs(de.button,{whileTap:{scale:.9},onClick:()=>a("up"),disabled:o,className:`flex items-center gap-0.5 px-2 py-1 transition-colors disabled:opacity-50 ${i==="up"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[l.jsx(wi,{className:"h-3.5 w-3.5",fill:i==="up"?"currentColor":"none",strokeWidth:2}),l.jsx("span",{className:"text-xs font-semibold tabular-nums",children:r.up})]}),l.jsx("div",{className:"w-px h-4 bg-border/50"}),l.jsxs(de.button,{whileTap:{scale:.9},onClick:()=>a("down"),disabled:o,className:`flex items-center gap-0.5 px-2 py-1 transition-colors disabled:opacity-50 ${i==="down"?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[l.jsx(Gc,{className:"h-3.5 w-3.5",fill:i==="down"?"currentColor":"none",strokeWidth:2}),l.jsx("span",{className:"text-xs font-semibold tabular-nums",children:r.down})]})]}),d>0&&l.jsxs("div",{className:"flex h-0.5 rounded-full overflow-hidden w-full",children:[l.jsx("div",{className:"bg-green-500 transition-all duration-300",style:{width:`${f}%`}}),l.jsx("div",{className:"bg-red-500 transition-all duration-300",style:{width:`${100-f}%`}})]})]}),s.length>0&&l.jsx("button",{onClick:()=>u(!c),className:"text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Toggle recent voters",children:l.jsx(Gt,{className:"h-3.5 w-3.5"})}),c&&s.length>0&&l.jsx(de.div,{initial:{opacity:0,x:-4},animate:{opacity:1,x:0},className:"flex items-center gap-1.5 overflow-x-auto whitespace-nowrap min-w-0 flex-1 scrollbar-none",children:s.map(h=>l.jsxs("div",{className:`flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] shrink-0 ${h.vote_type==="up"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:[h.vote_type==="up"?l.jsx(wi,{className:"h-2.5 w-2.5",fill:"currentColor"}
692):l.jsx(Gc,{className:"h-2.5 w-2.5",fill:"currentColor"}),l.jsx("span",{children:h.display_name})]},h.id))})]})})},Sse=e=>{const t=Kw(),[n,r]=m.useState([]),[s,i]=m.useState(null),[o,a]=m.useState(!0),[c,u]=m.useState(!1);m.useEffect(()=>{t||q.auth.getUser().then(({data:b})=>{var y;return i(((y=b.user)==null?void 0:y.id)??null)})},[t]);const d=m.useCallback(async()=>{if(!(t||!e))try{const{data:b,error:y}=await q.from("venue_comments").select("id, venue_id, user_id, comment, created_at, updated_at, parent_id").eq("venue_id",e).order("created_at",{ascending:!0});if(y)throw y;const w=Array.from(new Set((b??[]).map(S=>S.user_id).filter(Boolean))),x={};if(w.length){const{data:S}=await q.from("profiles").select("id, display_name, avatar_url").in("id",w);S==null||S.forEach(C=>{x[C.id]={display_name:C.display_name??void 0,avatar_url:C.avatar_url}})}r((b??[]).map(S=>{var C,k;return{...S,display_name:S.user_id?((C=x[S.user_id])==null?void 0:C.display_name)??"Anonymous":"Anonymous",avatar_url:S.user_id?((k=x[S.user_id])==null?void 0:k.avatar_url)??null:null}}))}catch(b){console.error("Error fetching comments:",b)}finally{a(!1)}},[t,e]);m.useEffect(()=>{if(t){a(!t.isReady);return}d()},[t,d,t==null?void 0:t.isReady]),m.useEffect(()=>{if(t||!e)return;const b=q.channel(`venue_comments:${e}`).on("postgres_changes",{event:"*",schema:"public",table:"venue_comments",filter:`venue_id=eq.${e}`},()=>d()).subscribe();return()=>{q.removeChannel(b)}},[t,e,d]);const f=async(b,y)=>{const w=b.trim();if(!w)return;const{data:{user:x}}=await q.auth.getUser();if(!x){J.error("Please sign in to comment");return}u(!0);try{const{error:S}=await q.from("venue_comments").insert({venue_id:e,user_id:x.id,comment:w,parent_id:y??null});if(S)throw S;t&&t.refresh()}catch(S){console.error("Error posting comment:",S),J.error(S.message||"Failed to post comment")}finally{u(!1)}},h=async(b,y)=>{const w=y.trim();if(w)try{const{error:x}=await q.from("venue_comments").update({comment:w,updated_at:new Date().toISOString()}).eq("id",b);if(x)throw x;t&&t.refresh()}catch(x){console.error("Error updating comment:",x),J.error(x.message||"Failed to update comment")}},p=async b=>{try{const{error:y}=await q.from("venue_comments").delete().eq("id",b);if(y)throw y;t&&t.refresh()}catch(y){console.error("Error deleting comment:",y),J.error(y.message||"Failed to delete comment")}},g=t?t.getComments(e):n,v=t?t.currentUserId:s;return{comments:g,currentUserId:v,isLoading:o,isPosting:c,postComment:f,updateComment:h,deleteComment:p}},EC=e=>{if(!e)return"";const t=new Date(e);return _Z(new Date,t)<60?OM(t,{addSuffix:!1}):new Date().toDateString()===t.toDateString()?$n(t,"HH:mm"):$n(t,"MMM d, HH:mm")},yf=$.forwardRef(({maxHeight:e=120,value:t,onChange:n,className:r,...s},i)=>{const o=m.useRef(null),a=u=>{o.current=u,typeof i=="function"?i(u):i&&(i.current=u)},c=m.useCallback(()=>{const u=o.current;if(!u)return;u.style.height="auto";const d=Math.min(u.scrollHeight,e);u.style.height=`${d}px`,u.style.overflowY=u.scrollHeight>e?"auto":"hidden"},[e]);return m.useEffect(()=>{c()},[t,c]),l.jsx("textarea",{ref:a,rows:1,value:t,onChange:u=>{n==null||n(u),c()},className:r,style:{resize:"none",overflowY:"hidden"},...s})});yf.displayName="AutoTextarea";const kse=({venueId:e})=>{const{comments:t,currentUserId:n,isPosting:r,postComment:s,updateComment:i,deleteComment:o}=Sse(e),[a,c]=m.useState(!1),[u,d]=m.useState(""),[f,h]=m.useState(null),[p,g]=m.useState(""),[v,b]=m.useState(null),[y,w]=m.useState(""),[x,S]=m.useState(null),C=m.useRef(null),k=m.useRef(!1),_=m.useRef(new Set),j=I=>{var D;const A=(D=C.current)==null?void 0:D.querySelector(`[data-comment-id="${I}"]`);A&&A.scrollIntoView({block:"nearest",behavior:"smooth"})};m.useEffect(()=>{const I=_.current,A=t.find(D=>!I.has(D.id)&&D.user_id===n);_.current=new Set(t.map(D=>D.id)),k.current&&A&&(k.current=!1,requestAnimationFrame(()=>j(A.id)))},[t,n]);const{topLevel:R,repliesByParent:P}=m.useMemo(()=>{const I=[],A={};return t.forEach(D=>{var E;D.parent_id?(A[E=D.parent_id]||(A[E]=[])).push(D):I.push(D)}),{topLevel:I,repliesByParent:A}},[t]),M=async()=>{u.trim()&&(k.current=!0,await s(u),d(""))},T=async I=>{y.trim()&&(k.current=!0,await s(y,I),w(""),b(null))},L=async()=>{!f||!p.trim()||(await i(f,p),h(null),g(""))},F=async()=>{x&&(await o(x),S(null))},z=(I,A)=>
692{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),A())},V=(I,A=0)=>{const D=I.user_id===n,E=f===I.id,K=(I.display_name||"?").charAt(0).toUpperCase(),te=A>0?"pl-2 border-l border-border/40":"",N=A>0?{marginLeft:`${Math.min(A,4)*1.25}rem`}:void 0;return l.jsxs("li",{"data-comment-id":I.id,className:te,style:N,children:[l.jsxs("div",{className:"flex gap-2 text-sm leading-snug items-start",children:[l.jsxs(ml,{className:"h-6 w-6 shrink-0 mt-0.5",children:[I.avatar_url?l.jsx(_o,{src:I.avatar_url,alt:I.display_name}):null,l.jsx(gl,{className:"text-[10px]",children:I.avatar_url?K:l.jsx(Wh,{className:"h-3 w-3"})})]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[l.jsx("span",{className:"font-medium text-foreground/90 text-xs",children:I.display_name}),l.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:[EC(I.created_at),I.updated_at&&I.created_at&&I.updated_at!==I.created_at&&l.jsxs("span",{className:"ml-1 italic",children:["(edited ",EC(I.updated_at),")"]})]})]}),E?l.jsxs("div",{className:"mt-1 flex items-center gap-1.5",children:[l.jsx(yf,{autoFocus:!0,value:p,onChange:ee=>g(ee.target.value),onKeyDown:ee=>z(ee,L),className:"flex-1 min-w-0 bg-background/60 border border-border/50 rounded px-2 py-1 text-sm leading-snug focus:outline-none focus:border-primary/50"}),l.jsx("button",{onClick:L,className:"text-muted-foreground hover:text-primary","aria-label":"Save edit",children:l.jsx(xo,{className:"h-4 w-4"})}),l.jsx("button",{onClick:()=>{h(null),g("")},className:"text-muted-foreground hover:text-foreground","aria-label":"Cancel edit",children:l.jsx(Dn,{className:"h-4 w-4"})})]}):l.jsx("p",{className:"text-foreground/80 break-words text-sm",children:I.comment})]}),!E&&n&&l.jsxs(oA,{children:[l.jsx(aA,{asChild:!0,children:l.jsx("button",{className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted/40","aria-label":"Comment options",children:l.jsx(w4,{className:"h-4 w-4"})})}),l.jsxs(X0,{align:"end",className:"min-w-[140px] bg-popover/95 backdrop-blur-md border-border shadow-lg",children:[l.jsxs(ci,{onClick:()=>{b(I.id),w("")},children:[l.jsx(O4,{className:"h-4 w-4 mr-2"})," Reply"]}),D&&l.jsxs(l.Fragment,{children:[l.jsxs(ci,{onClick:()=>{h(I.id),g(I.comment)},children:[l.jsx(Vx,{className:"h-4 w-4 mr-2"})," Edit"]}),l.jsxs(ci,{onClick:()=>S(I.id),className:"text-destructive focus:text-destructive",children:[l.jsx(NN,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})]})]}),(P[I.id]??[]).length>0&&l.jsx("ul",{className:"mt-2 space-y-2",children:P[I.id].map(ee=>V(ee,A+1))}),v===I.id&&l.jsxs("div",{className:"ml-8 mt-2 flex items-center gap-1.5",children:[l.jsx(yf,{autoFocus:!0,value:y,onChange:ee=>w(ee.target.value),onKeyDown:ee=>z(ee,()=>T(I.id)),placeholder:"Write a reply…",className:"flex-1 min-w-0 bg-background/60 border border-border/50 rounded-2xl px-3 py-1.5 text-sm leading-snug focus:outline-none focus:border-primary/50"}),l.jsx("button",{onClick:()=>T(I.id),disabled:!y.trim()||r,className:"shrink-0 inline-flex items-center justify-center h-7 w-7 rounded-full bg-primary text-primary-foreground disabled:opacity-40","aria-label":"Send reply",children:l.jsx(EN,{className:"h-3.5 w-3.5"})}),l.jsx("button",{onClick:()=>{b(null),w("")},className:"shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Cancel reply",children:l.jsx(Dn,{className:"h-4 w-4"})})]})]},I.id)};return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",onClick:()=>c(I=>!I),className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-card/80 backdrop-blur-sm border border-border/50 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Toggle comments",children:[l.jsx(Na,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"text-xs font-semibold tabular-nums",children:t.length})]}),l.jsx(yt,{initial:!1,children:a&&l.jsx(de.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.18},className:"basis-full w-full overflow-hidden",children:l.jsxs("div",{className:"mt-1 px-2 py-1.5 rounded-lg bg-card/60 border border-border/50 space-y-1.5 max-h-[25vh] flex flex-col",children:[R.length===0?l.jsx("p",{className:"text-xs text-muted-foreground text-center py-1",children:"No comments yet."}):l.jsx("ul",{ref:C,className:"space-y-1.5 flex-1 min-h-0 overflow-y-auto pr-1",children:R.map(I=>
692V(I))}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(yf,{value:u,onChange:I=>d(I.target.value),onKeyDown:I=>z(I,M),placeholder:n?"Write a comment…":"Sign in to comment",disabled:!n||r,className:"flex-1 min-w-0 bg-background/60 border border-border/50 rounded-2xl px-3 py-1.5 text-sm leading-snug text-foreground placeholder:text-muted-foreground/60 focus:outline-none focus:border-primary/50 disabled:opacity-50"}),l.jsx("button",{type:"button",onClick:M,disabled:!n||r||!u.trim(),className:"shrink-0 inline-flex items-center justify-center h-7 w-7 rounded-full bg-primary text-primary-foreground disabled:opacity-40 hover:opacity-90 transition-opacity","aria-label":"Send comment",children:l.jsx(hN,{className:"h-4 w-4"})})]})]})},"thread")}),l.jsx(si,{open:!!x,onOpenChange:I=>!I&&S(null),children:l.jsxs(ms,{children:[l.jsxs(gs,{children:[l.jsx(vs,{children:"Delete this comment?"}),l.jsx(xs,{children:"This action cannot be undone. The comment and any replies will be permanently removed."})]}),l.jsxs(ys,{children:[l.jsx(bs,{children:"Cancel"}),l.jsx(ws,{onClick:F,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},_se=({children:e})=>{const{sessionId:t,sessionVenues:n,sessionPlannedCity:r,sessionItineraryId:s,sessionTitle:i,sessionPlanIntent:o,chatMessages:a,sendChatMessage:c,currentUserId:u}=oO(),{setSuggestedVenues:d,setIsReviewing:f,setPlannedCity:h,setLocation:p,setItineraryId:g,setPrompt:v,setPlanIntent:b}=vn(),{_setGroupSender:y,_setCollabMode:w,_setCollabSessionId:x,appendGroupMessage:S,setMessagesFromDb:C}=OX();m.useEffect(()=>w?(w(!!t),()=>w(!1)):void 0,[w,t]),m.useEffect(()=>{if(x)return x(t??null),()=>x(null)},[x,t]),m.useEffect(()=>{n.length>0&&(d(n),f(!0))},[n]),m.useEffect(()=>{r&&(h(r),r.description&&p(r.description))},[r]),m.useEffect(()=>{s&&g(s)},[s]),m.useEffect(()=>{i&&v(i)},[i]),m.useEffect(()=>{o&&b(o)},[o]),m.useEffect(()=>{if(y&&t)return y(c),()=>y(null)},[y,c,t]);const k=$.useRef([]),_=$.useRef(null);return m.useEffect(()=>{_.current!==(t??null)&&(_.current=t??null,k.current=[],t&&C&&C([]))},[t,C]),m.useEffect(()=>{if(!C||!S||a.length===0)return;const j=T=>{const L=!T.senderId&&T.sender==="EZY Assistant",F=L?void 0:T.messageTarget||"group";return{id:T.id,role:L?"assistant":"group",content:T.message,timestamp:new Date(T.timestamp),senderName:L?void 0:T.sender,senderId:T.senderId??void 0,target:F??void 0}},R=a.map(T=>T.id),P=k.current;let M=R.length<P.length;if(!M){for(let T=0;T<P.length;T++)if(P[T]!==R[T]){M=!0;break}}M?C(a.map(j)):R.length>P.length&&a.slice(P.length).forEach(L=>S(j(L))),k.current=R},[a,C,S]),l.jsx(l.Fragment,{children:e})},Cse=()=>{const e=Kt(),[t]=o4(),n=t.get("session"),r="ezy_collab_card_dismissed",[s,i]=m.useState(()=>{try{return localStorage.getItem(r)!=="1"}catch{return!0}}),o=m.useCallback(()=>{i(!1);try{localStorage.setItem(r,"1")}catch{}},[]),[a,c]=m.useState(!1),[u,d]=m.useState(null),[f,h]=m.useState(0),[p,g]=m.useState(!1),[v,b]=m.useState(null),[y,w]=m.useState([]),[x,S]=m.useState(null),[C,k]=m.useState(null),{isGenerating:_,setIsGenerating:j,suggestedVenues:R,setSuggestedVenues:P,isReviewing:M,setIsReviewing:T,itineraryId:L,setItineraryId:F,prompt:z,setPrompt:V,location:I,locationModified:A,selectedTags:D,date:E,setDate:K,peopleCount:te,startTime:N,startTimeModified:ee,endTime:ie,endTimeModified:U,plannedCity:W,setPlannedCity:ne}=vn(),oe=RI({isGenerating:_,progress:v,progressEvents:y,result:x,error:C}),{messages:Z,clearChat:se}=Lu(),{requestGeneration:re}=vn(),Y=!!n,Ee=oO(),He=Ee.sessionId,Re=Y?Ee.isHost:!0,Nt=Ee.participants,O=Ee.currentUserId;$.useEffect(()=>{const H=async X=>{var Ne;const ve=(Ne=X.detail)==null?void 0:Ne.newPrompt;if(!(!ve||Y)){try{L&&(await q.from("venues").delete().eq("itinerary_id",L),await q.from("itinerary_snapshots").delete().eq("itinerary_id",L))}catch(Le){console.warn("[restart] DB wipe failed:",Le)}P([]),T(!1),b(null),w([]),S(null),k(null),se(),V(ve),re()}};return window.addEventListener("ezy:restart-from-scratch",H),()=>window.removeEventListener("ezy:restart-from-scratch",H)},[L,Y,se,V,P,T,re]),m.useEffect(()=>{q.auth.getSession().then(({data:{session:H}})=>{d(!!H)})},[]),m.useEffect(()=>{!n||Ee.sessionId||Ee.isLoading||q.auth.getSession().then(({data:{session:H}})=>{if(!H){e("/login",{state:{returnTo:`/new-plan?session=${n}`},replace:!0});return}Ee.joinSession(n).catch(console.error)})},[n,Ee.sessionId,Ee.isLoading]),m.useEffect(()=>{(_||R.length>0)&&!a&&c(!0)},[_,R.length,a]),m.useEffect(()=>{Y&&Ee.sessionVenues&&Ee.sessionVenues.length>0&&!a&&c(!0)},[Y,Ee.sessionVenues,a]);const B=m.useCallback(async()=>{var X;const{data:{session:H}}=await q.auth.getSession();if(!H){e("/login",{state:{returnTo:"/new-plan"}});return}try{let ve=L;if(!ve&&R.length>0){const{data:Le,error:Qe}=await q.from("itineraries").insert({title:z||"My Plan",description:W?`Adventure in ${W.name}`:`Adventure in ${I}`,user_id:H.user.id,planned_city:W||null,status:"draft"}).select().single();if(Qe)throw Qe;ve=Le.id;const _t=R.map(({votes:nt,comments:xe,holiday_info:me,hours_source:be,estimated_price_range_source:Ge,openNow_at_query_time:Q,open_at_visit:ge,special_days:ye,live_status_label:Te,...je})=>({...je,itinerary_id:ve,hours_source:be??null,open_now_at_query_time:Q??null,open_at_visit:ge??null,special_days:ye??null,holiday_info:me??null,live_status_label:Te??null}));await q.from("venues").insert(_t)}const Ne=await Ee.createSession(z||"Planning Session");if(ve&&await q.from("planning_sessions").update({itinerary_id:ve}).eq("id",Ne),Z.length>0){const{data:Le}=await q.from("profiles").select("display_name").eq("id",H.user.id).maybeSingle(),Qe=(Le
692==null?void 0:Le.display_name)||((X=H.user.email)==null?void 0:X.split("@")[0])||"User",_t=Z.map(nt=>({session_id:Ne,message:nt.content,sender_name:nt.role==="assistant"?"EZY Assistant":Qe,user_id:nt.role==="assistant"?null:H.user.id,created_at:nt.timestamp.toISOString(),message_target:nt.role==="assistant"?null:nt.target||"ai"}));await q.from("planning_messages").insert(_t)}e(`/new-plan?session=${Ne}`,{replace:!0}),J.success("Collaborative session started! Share the link to invite friends.")}catch(ve){console.error("Error starting collab:",ve),J.error("Failed to start collaborative session")}},[Ee,L,R,z,I,W,e,Z,se]),G=m.useCallback(async()=>{await Ee.leaveSession(),e("/new-plan",{replace:!0})},[Ee,e]);m.useEffect(()=>{if(!He)return;const H=q.channel(`venue_votes_${He}`).on("postgres_changes",{event:"*",schema:"public",table:"venue_votes"},()=>{h(X=>X+1)}).subscribe();return()=>{q.removeChannel(H)}},[He]);const pe=a?l.jsx(mse,{sessionId:He,isHost:Re,isCollaborative:Y,participants:Nt,onStartCollab:B,onLeaveSession:G}):null,ce=l.jsxs("div",{className:"container mx-auto px-4 py-6 max-w-4xl space-y-4",children:[l.jsx(II,{mode:"solo"}),l.jsx(bre,{})]}),le=Y?"collaborative":"solo",Ce=m.useCallback(H=>{P(H),T(!0)},[P,T]),Me=m.useMemo(()=>R.map(H=>H.id).filter(Boolean),[R]);return l.jsx(Kre,{venueIds:Me,children:l.jsxs(l.Fragment,{children:[l.jsx(kI,{prompt:z,location:I,locationModified:A,selectedTags:D,date:E,onDateChange:K,peopleCount:te,startTime:N,startTimeModified:ee,endTime:ie,endTimeModified:U,onVenuesGenerated:Ce,onItineraryIdSet:F,isGenerating:_,setIsGenerating:j,showLoginPrompt:p,setShowLoginPrompt:g,onProgress:b,onProgressEvents:w,onResult:S,onError:k,persistToDb:Y,collabSessionId:He,onCollabLinked:()=>Ee.refetchVenues()}),l.jsx(yt,{mode:"wait",children:a?l.jsx(de.div,{initial:{opacity:0}
692,animate:{opacity:1},transition:{duration:.5,ease:"easeOut",delay:.15},className:"h-full",children:l.jsx(fZ,{headerSlot:l.jsx(ese,{mode:le,controlButtons:pe}),chatSlot:l.jsx(WX,{showCollaborateCard:!Y&&s&&R.length>0,onDismissCollaborate:o,onStartCollaborate:B,isAuthenticated:u,isCollaborative:Y,participants:Nt,currentUserId:O,onTypingChange:Ee.setTyping}),canvasSlot:l.jsx(Qre,{isHost:Re,sseProgress:v,sseProgressEvents:y,sseResult:x,sseError:C,timeline:oe,persistToDb:Y,collabSessionId:He,showVotingRanking:Y,voteRefreshKey:f,renderVenueExtra:Y?H=>l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-1",children:[l.jsx(bse,{venueId:H.id,refreshTrigger:f,onVoteComplete:()=>h(X=>X+1)}),l.jsx(kse,{venueId:H.id})]}):void 0})})},"split-view"):l.jsx(de.div,{initial:{opacity:1},exit:{opacity:0,scale:.98},transition:{duration:.4,ease:"easeInOut"},children:ce},"full-page")})]})})},NC=()=>l.jsx(NX,{children:l.jsx(IX,{children:l.jsx(xse,{children:l.jsx(_se,{children:l.jsx(jse,{})})})})}),jse=()=>{const{isGenerating:e,suggestedVenues:t}=vn(),[n,r]=m.useState(!1);return m.useEffect(()=>{(e||t.length>0)&&r(!0)},[e,t.length]),l.jsx(Or,{fullHeight:n,children:l.jsx(Cse,{})})},aO=$.forwardRef(({className:e,icon:t,...n},r)=>l.jsxs("div",{className:"relative",children:[t&&l.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:t}),l.jsx(gn,{ref:r,className:ae(t&&"pl-10",e),...n})]}));aO.displayName="InputWithIcon";const Bd="ezy_return_to",Ese=()=>{const e=Kt(),t=Di(),[n,r]=m.useState(""),[s,i]=m.useState(""),[o,a]=m.useState(!1),[c,u]=m.useState("login"),d=()=>{var w;const v=(w=t.state)==null?void 0:w.returnTo;if(v)return sessionStorage.setItem(Bd,v),v;const y=new URLSearchParams(t.search).get("redirect");return y?(sessionStorage.setItem(Bd,y),y):sessionStorage.getItem(Bd)||"/"},f=()=>{const v=d();sessionStorage.removeItem(Bd),e(v)},h=async()=>{const v=d(),{error:b}=await q.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}${v}`}});b&&J.error(b.message)},p=async v=>{v.preventDefault(),a(!0);try{if(c==="login"){const{data:b,error:y}=await q.auth.signInWithPassword({email:n,password:s});if(y)throw y;b.session&&await new Promise(w=>setTimeout(w,100)),J.success("Welcome back to EZY! Let's plan something amazing! 🎉"),f()}else{const{data:b,error:y}=await q.auth.signUp({email:n,password:s,options:{emailRedirectTo:`${window.location.origin}${d()}`}});if(y)throw y;b.session?(await new Promise(w=>setTimeout(w,100)),J.success("Welcome to EZY! Let's plan something amazing! 🎉"),f()):J.success("Welcome to EZY! Please check your email to confirm your account.")}}catch(b){J.error(b.message)}finally{a(!1)}},g=[{icon:m4,label:"Business Meetings",count:"5K+",description:"Corporate events & client meetings",gradient:"from-blue-500 to-cyan-400"},{icon:_4,label:"Family Activities",count:"8K+",description:"Kid-friendly adventures",gradient:"from-green-500 to-emerald-400"},{icon:Ga,label:"Date Nights",count:"12K+",description:"Romantic experiences",gradient:"from-pink-500 to-rose-400"},{icon:E1,label:"City Explorations",count:"15K+",description:"Local discoveries & tourism",gradient:"from-purple-500 to-violet-400"}];return l.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-background via-background/95 to-background/90 flex items-center justify-center p-4",children:[l.jsxs("div",{className:"w-full max-w-md 
692space-y-8",children:[l.jsxs(de.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"text-center space-y-4",children:[l.jsx("h1",{className:"text-4xl font-bold mb-2 bg-gradient-to-r from-primary via-destructive to-primary bg-clip-text text-transparent animate-text-gradient",children:"Plan Amazing Experiences"}),l.jsx("p",{className:"text-xl text-muted-foreground",children:"Your all-in-one platform for creating memorable moments"}),l.jsx("div",{className:"grid grid-cols-2 gap-4 mt-8",children:g.map((v,b)=>l.jsxs(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:b*.1},className:"relative overflow-hidden glass-card p-4 hover:scale-105 transition-all duration-300",children:[l.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${v.gradient} opacity-5`}),l.jsx(v.icon,{className:"w-8 h-8 mx-auto mb-3 text-primary"}),l.jsx("p",{className:"text-base font-semibold text-foreground mb-1",children:v.label}),l.jsx("p",{className:"text-lg font-bold text-primary mb-2",children:v.count}),l.jsx("p",{className:"text-sm text-muted-foreground",children:v.description})]},v.label))})]}),l.jsx(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"glass-card p-8 border border-primary/10 shadow-xl",children:l.jsxs("form",{onSubmit:p,className:"space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"block text-sm font-medium mb-2 text-foreground",children:"Email"}),l.jsx(aO,{id:"email",type:"email",value:n,onChange:v=>r(v.target.value),placeholder:"[email protected]",required:!0,className:"w-full bg-background/50",icon:l.jsx(Bx,{className:"w-4 h-4"})})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"block text-sm font-medium mb-2 text-foreground",children:"Password"}),l.jsx(gn,{id:"password",type:"password",value:s,onChange:v=>i(v.target.value),placeholder:"••••••••",required:!0,className:"w-full bg-background/50"})]})]}),l.jsx(Fe,{type:"submit",className:"w-full bg-gradient-to-r from-primary to-destructive hover:opacity-90 transition-all duration-300",disabled:o,children:o?l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-t-2 border-white mr-2"}),"Processing..."]}):l.jsxs("div",{className:"flex items-center",children:[l.jsx(_N,{className:"w-4 h-4 mr-2"}),c==="login"?"Sign In":"Create Account"]})}),l.jsxs("div",{className:"relative my-4",children:[l.jsx("div",{className:"absolute inset-0 flex items-center",children:l.jsx("span",{className:"w-full border-t border-border"})}),l.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:l.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"or continue with"})})]}),l.jsxs(Fe,{type:"button",variant:"outline",className:"w-full",onClick:h,disabled:o,children:[l.jsxs("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",children:[l.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),l.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),l.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),l.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]}),l.jsx("div",{className:"text-center pt-2",children:l.jsx("button",{type:"button",onClick:()=>u(c==="login"?"signup":"login"),className:"text-sm text-muted-foreground hover:text-primary transition-colors",children:c==="login"?"Don't have an account? Sign up":"Already have an account? Sign in"})}),l.jsxs("div",{className:"mt-8 space-y-4",children:[l.jsxs("h3",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[l.jsx(Pr,{className:"w-5 h-5 text-primary animate-pulse"}),"Join EZY and unlock:"]}),l.jsxs("ul",{className:"space-y-3",children:[l.jsxs("li",{className:"flex items-center gap-3 p-2 rounded-lg bg-primary/5 hover:bg-primary/10 transition-colors",children:[l.jsx(Gt,{className:"w-5 h-5 text-primary"}),l.jsx("span",{className:"text-sm text-foreground",children:"Smart planning for any occasion"})]}),l.jsxs("li",{className:"flex items-center gap-3 p-2 rounded-lg bg-primary/5 hover:bg-primary/10 transition-colors",children:[l.jsx(Ga,{className:"w-5 h-5 text-primary"}),l.jsx("span",{className:"text-sm text-foreground",children:"Personalized recommendations"})]}),l.jsxs("li",{className:"flex items-center gap-3 p-2 rounded-lg bg-primary/5 hover:bg-primary/10 transition-colors",children:[l.jsx(E1,{className:"w-5 h-5 text-primary"}),l.jsx("span",{className:"text-sm text-foreground",children:"Local insights & hidden gems"})]})]})]})]})}),l.jsx(de.p,{initial:{opacity:0}
692,animate:{opacity:1},transition:{delay:.4},className:"text-center text-sm text-muted-foreground",children:"By continuing, you agree to our Terms of Service and Privacy Policy"})]}),l.jsx("div",{className:"fixed inset-0 -z-10",children:l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-destructive/5 to-primary/5 animate-gradient-x"})})]})},Xw=m.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:ae("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Xw.displayName="Textarea";const Nse=({totalItineraries:e,totalVenues:t,timeSaved:n,joinDate:r})=>{const[s,i]=$.useState({itineraries:e,venues:t,timeSaved:n,joinDate:r});$.useEffect(()=>{(async()=>{try{const{data:{session:c}}=await q.auth.getSession();if(!c)return;const{count:u}=await q.from("itineraries").select("*",{count:"exact",head:!0}).eq("user_id",c.user.id),{data:d}=await q.from("itineraries").select("id").eq("user_id",c.user.id),f=(d==null?void 0:d.map(v=>v.id))||[],{count:h}=await q.from("venues").select("*",{count:"exact",head:!0}).in("itinerary_id",f),g=(h||0)*30;i({itineraries:u||0,venues:h||0,timeSaved:g,joinDate:r})}catch(c){console.error("Error fetching stats:",c)}})()},[r]);const o=[{icon:er,value:s.itineraries,label:"Itineraries Created",description:"Your journey planning count"},{icon:TN,value:s.venues,label:"Places Discovered",description:"Unique venues in your plans"},{icon:bo,value:Math.round(s.timeSaved/60),label:"Hours Saved",description:"Time saved with AI planning"},{icon:Ga,value:new Date(s.joinDate).toLocaleDateString("en-US",{month:"long",year:"numeric"}),label:"Member Since",description:"Your planning journey began"}];return l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:o.map((a,c)=>l.jsx(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:c*.1},children:l.jsx(nn,{className:"p-6 bg-card/50 backdrop-blur-sm border-primary/10 hover:border-primary/20 transition-all",children:l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"p-3 rounded-full bg-primary/10",children:l.jsx(a.icon,{className:"w-6 h-6 text-primary"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-2xl font-bold",children:a.value}),l.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:a.label}),l.jsx("div",{className:"text-xs text-muted-foreground/80",children:a.description})]})]})})},a.label))})},Tse=()=>{const e=Kt(),[t,n]=m.useState(null),[r,s]=m.useState(""),[i,o]=m.useState(!1),[a,c]=m.useState(!1),[u,d]=m.useState(!0),[f,h]=m.useState(""),[p,g]=m.useState(""),[v,b]=m.useState(""),[y,w]=m.useState(""),x={totalItineraries:0,totalVenues:0,timeSaved:0,joinDate:(t==null?void 0:t.created_at)||new Date().toISOString()},S=m.useCallback(async()=>{try{const{data:{user:j}}=await q.auth.getUser();if(!j){e("/login");return}s(j.email||"");const{data:R,error:P}=await q.from("profiles").select("*").eq("id",j.id).single();if(P)throw P;if(R){const M=R;n(M),h(M.display_name||""),g(M.username||""),b(M.bio||""),w(M.home_city||"")}}catch(j){console.error("Error loading profile:",j),J.error("Error loading profile")}finally{d(!1)}},[e]);m.useEffect(()=>{S()},[S]);const C=async()=>{if(!t)return;if(!f.trim()){J.error("Display name is required");return}const j=p.trim().toLowerCase();if(!/^[a-z0-9_]{3,20}$/.test(j)){J.error("Username must be 3-20 characters: lowercase letters, numbers, underscore");return}c(!0);try{if(j!==t.username){const{data:P}=await q.from("profiles").select("id").eq("username",j).neq("id",t.id).maybeSingle();if(P){J.error("That username is already taken"),c(!1);return}}const{error:R}=await q.from("profiles").update({display_name:f.trim(),username:j,bio:v.trim()||null,home_city:y.trim()||null}).eq("id",t.id);if(R)throw R;n({...t,display_name:f.trim(),username:j,bio:v.trim()||null,home_city:y.trim()||null}),o(!1),J.success("Profile updated")}catch(R){console.error("Error saving profile:",R),J.error(R.message||"Error saving profile")}finally{c(!1)}},k=()=>{t&&(h(t.display_name||""),g(t.username||""),b(t.bio||""),w(t.home_city||""),o(!1))},_=async j=>{var M;const R=(M=j.target.files)==null?void 0:M[0];if(!R||!t)return;if(!R.type.startsWith("image/")){J.error("Please upload an image file");return}if(R.size>5*1024*1024){J.error("File size must be less than 5MB");return}const P=J.loading("Uploading avatar...");try{const T=R.name.split(".").pop(),L=`${t.id}/${crypto.randomUUID()}.${T}`,{error:F}=await q.storage.from("avatars").upload(L,R);if(F)throw F;const{data:{publicUrl:z}}=q.storage.from("avatars").getPublicUrl(L),{error:V}=await q.from("profiles").update({avatar_url:z}).eq("id",t.id);if(V)throw V;J.dismiss(P),J.success("Avatar updated"),n({...t,avatar_url:z})}catch(T){J.dismiss(P),console.error(T),J.error("Failed to upload avatar")}};return u?l.jsx(Or,{children:l.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-primary"})})}):l.jsx(Or,{children:l.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-3xl space-y-6",children:[l.jsx(nn,{className:"p-6 glass-card",children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"relative group",children:[l.jsxs(ml,{className:"h-20 w-20",children:[l.jsx(_o,{src:(t==null?void 0:t.avatar_url)||void 0}),l.jsx(gl,{className:"bg-primary/20",children:((t==null?void 0:t.display_name)||"U").charAt(0).toUpperCase()})]}),l.jsxs("label",{className:"absolute inset-0 flex items-center justify-center bg-black/50 rounded-full opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:[l.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:_}),l.jsx(W4,{className:"h-5 w-5 text-white"})]})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold",children:(t==null?void 0:t.display_name)||"Anonymous"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["@",(t==null?void 0:t.username)||"user"]})]})]}),!i&&l.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>o(!0),className:"gap-2",children:[l.jsx(Vx,{className:"h-4 w-4"})," Edit Profile"]})]})}),l.jsxs(nn,{className:"p-6 glass-card space-y-5",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"Profile Details"}),i?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(tn,{htmlFor:"displayName",children:"Display name"}),l.jsx(gn,{id:"displayName",value:f,onChange:j=>h(j.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(tn,{htmlFor:"username",children:"Username"}),l.jsx(gn,{id:"username",value:p,onChange:j=>g(j.target.value),className:"mt-1",placeholder:"lowercase, 3-20 chars"})]}),l.jsxs("div",{children:[l.jsx(tn,{htmlFor:"homeCity",children:"Home city"}),l.jsx(gn,{id:"homeCity",value:y,onChange:j=>w(j.target.value),className:"mt-1",placeholder:"e.g. New York"})]}),l.jsxs("div",{children:[l.jsx(tn,{htmlFor:"bio",children:"Bio"}
692),l.jsx(Xw,{id:"bio",value:v,onChange:j=>b(j.target.value.slice(0,280)),className:"mt-1",placeholder:"A short note about you",rows:3}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[v.length,"/280"]})]}),l.jsxs("div",{children:[l.jsx(tn,{children:"Email"}),l.jsx(gn,{value:r,disabled:!0,className:"mt-1"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Email is managed via your account settings."})]}),l.jsxs("div",{className:"flex gap-2 pt-2",children:[l.jsx(Fe,{onClick:C,disabled:a,children:a?"Saving...":"Save Changes"}),l.jsx(Fe,{variant:"outline",onClick:k,disabled:a,children:"Cancel"})]})]}):l.jsxs("div",{className:"space-y-3 text-sm",children:[l.jsx(vg,{icon:l.jsx(Bx,{className:"h-4 w-4"}),label:"Email",value:r||"—"}),l.jsx(vg,{icon:l.jsx(er,{className:"h-4 w-4"}),label:"Home city",value:(t==null?void 0:t.home_city)||"Not set"}),l.jsx(vg,{icon:l.jsx(Ga,{className:"h-4 w-4"}),label:"Member since",value:new Date((t==null?void 0:t.created_at)||Date.now()).toLocaleDateString()}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Bio"}),l.jsx("p",{className:"whitespace-pre-wrap",children:(t==null?void 0:t.bio)||l.jsx("span",{className:"text-muted-foreground italic",children:"No bio yet."})})]})]})]}),l.jsx(Nse,{...x}),l.jsxs(Fe,{onClick:()=>e("/my-plans"),variant:"outline",className:"w-full gap-2 border-border/50 hover:bg-primary/10 hover:text-primary",children:[l.jsx(kN,{className:"h-4 w-4"}),"View My Plans"]})]})})},vg=({icon:e,label:t,value:n})=>l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.jsx("span",{className:"text-muted-foreground w-28",children:t}),l.jsx("span",{className:"text-foreground",children:n})]}),ls={theme:"ezy:theme",notifyCollab:"ezy:notify:collab",notifyToasts:"ezy:notify:toasts",pace:"ezy:pref:pace",party:"ezy:pref:party"};function Pse(e){const t=document.documentElement,n=window.matchMedia("(prefers-color-scheme: dark)").matches,r=e==="dark"||e==="system"&&n;t.classList.toggle("dark",r)}const Ase=()=>{const e=Kt(),[t,n]=m.useState(""),[r,s]=m.useState(localStorage.getItem(ls.theme)||"dark"),[i,o]=m.useState(localStorage.getItem(ls.notifyCollab)!=="false"),[a,c]=m.useState(localStorage.getItem(ls.notifyToasts)!=="false"),[u,d]=m.useState(localStorage.getItem(ls.pace)||"balanced"),[f,h]=m.useState(Number(localStorage.getItem(ls.party))||2);m.useEffect(()=>{q.auth.getUser().then(({data:{user:x}})=>{if(!x){e("/login");return}n(x.email||"")})},[e]);const p=x=>{s(x),localStorage.setItem(ls.theme,x),Pse(x),J.success(`Theme set to ${x}`)},g=(x,S,C)=>{C(S),localStorage.setItem(ls[x],String(S))},v=x=>{d(x),localStorage.setItem(ls.pace,x)},b=x=>{const S=Math.max(1,Math.min(10,x||1));h(S),localStorage.setItem(ls.party,String(S))},y=async()=>{if(!t)return;const{error:x}=await q.auth.resetPasswordForEmail(t,{redirectTo:`${window.location.origin}/login`});x?J.error(x.message):J.success("Password reset email sent",{description:`Check ${t}`})},w=async()=>{await q.auth.signOut(),e("/"),J.success("Signed out")};return l.jsx(Or,{children:l.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-3xl space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-semibold",children:"Settings"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Tune the app to match how you plan trips."})]}),l.jsxs(nn,{className:"p-6 glass-card space-y-4",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Appearance"}),l.jsxs("div",{children:[l.jsx(tn,{className:"mb-2 block",children:"Theme"}),l.jsx("div",{className:"flex gap-2",children:[{v:"dark",label:"Dark",icon:l.jsx(P4,{className:"h-4 w-4"})},{v:"light",label:"Light",icon:l.jsx(V4,{className:"h-4 w-4"})},{v:"system",label:"System",icon:l.jsx(T4,{className:"h-4 w-4"})}].map(x=>l.jsxs(Fe,{variant:r===x.v?"default":"outline",size:"sm",className:"gap-2",onClick:()=>p(x.v),children:[x.icon,x.label]},x.v))}),l.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"EZY is dark-first; light mode is experimental."})]})]}),l.jsxs(nn,{className:"p-6 glass-card space-y-4",children:[l.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[l.jsx(h4,{className:"h-5 w-5"})," Notifications"]}),l.jsx(TC,{label:"Email me when collaborators reply",description:"Get notified about new chat messages in collaborative sessions.",checked:i,onChange:x=>g("notifyCollab",x,o)}),l.jsx(TC,{label:"Show in-app toasts for AI updates",description:"Pop a toast when the AI finishes editing your itinerary.",checked:a,onChange:x=>g("notifyToasts",x,c)})]}),l.jsxs(nn,{className:"p-6 glass-card space-y-4",children:[l.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[l.jsx(Pr,{className:"h-5 w-5"})," Planning Preferences"]}),l.jsxs("div",{children:[l.jsx(tn,{className:"mb-2 block",children:"Default trip pace"}),l.jsx("div",{className:"flex gap-2",children:["relaxed","balanced","packed"].map(x=>l.jsx(Fe,{variant:u===x?"default":"outline",size:"sm",className:"capitalize",onClick:()=>v(x),children:x},x))})]}),l.jsxs("div",{children:[l.jsx(tn,{htmlFor:"party",className:"mb-2 block",children:"Default party size"}),l.jsx(gn,{id:"party",type:"number",min:1,max:10,value:f,onChange:x=>b(Number(x.target.value)),className:"max-w-[120px]"})]})]}),l.jsxs(nn,{className:"p-6 glass-card space-y-4",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Account"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(tn,{children:"Email"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsxs(Fe,{variant:"outline",className:"gap-2",onClick:y,children:[l.jsx(E4,{className:"h-4 w-4"})," Send password reset email"]}),l.jsxs(Fe,{variant:"outline",className:"gap-2",onClick:w,children:[l.jsx(zx,{className:"h-4 w-4"})," Sign out"]})]}),l.jsxs("div",{className:"border-t border-border/50 pt-4 mt-2",children:[l.jsxs("h3",{className:"text-sm font-semibold text-destructive flex items-center gap-2 mb-2",children:[l.jsx(z4,{className:"h-4 w-4"})," Danger zone"]}),l.jsxs(si,{children:[l.jsx(eO,{asChild:!0,children:l.jsx(Fe,{variant:"destructive",size:"sm",children:"Delete account"})}
692),l.jsxs(ms,{children:[l.jsxs(gs,{children:[l.jsx(vs,{children:"Delete your account?"}),l.jsx(xs,{children:"This will permanently remove your profile, itineraries, and collaborative sessions. This action cannot be undone."})]}),l.jsxs(ys,{children:[l.jsx(bs,{children:"Cancel"}),l.jsx(ws,{onClick:()=>J("Coming soon",{description:"Account deletion is being wired up."}),children:"Delete"})]})]})]})]})]})]})})},TC=({label:e,description:t,checked:n,onChange:r})=>l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:e}),t&&l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]}),l.jsx(Iu,{checked:n,onCheckedChange:r})]}),Rse=({itinerary:e})=>{var t,n;return l.jsxs(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass-card p-6 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[((t=e.profiles)==null?void 0:t.avatar_url)&&l.jsx("img",{src:e.profiles.avatar_url,alt:"Profile",className:"w-12 h-12 rounded-full"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h1",{className:"text-2xl font-bold",children:e.title}),l.jsxs("p",{className:"text-muted-foreground",children:["Shared by ",((n=e.profiles)==null?void 0:n.display_name)||"Anonymous"]})]})]}),e.description&&l.jsx("p",{className:"text-muted-foreground",children:e.description})]})},Mse=()=>l.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background to-background/50 flex items-center justify-center",children:l.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-primary"})}),Ise=()=>l.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background to-background/50 flex items-center justify-center",children:l.jsxs("div",{className:"text-center space-y-4",children:[l.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Itinerary Not Found"}),l.jsx("p",{className:"text-muted-foreground",children:"This shared itinerary may have expired or been removed."})]})}),PC={primary:"bg-primary text-primary-foreground hover:bg-primary/90","primary-disabled":"bg-primary/20 text-primary cursor-default",secondary:"bg-primary/10 hover:bg-primary/20 text-primary",ghost:"bg-primary/5 hover:bg-primary/10 text-primary/80"},lO=({onSave:e,onShare:t,onShareAsText:n,onPlanTogether:r,isSaved:s=!1,saveLabel:i="Save to My Plans",savedLabel:o="Saved to My Plans"})=>{const a=[];return e&&a.push({key:"save",label:s?o:i,icon:jN,onClick:e,variant:"primary",disabled:s}),t&&a.push({key:"share",label:"Share Link",icon:So,onClick:t,variant:"secondary"}),r&&a.push({key:"plan-together",label:"Plan Together",icon:Gt,onClick:r,variant:"secondary"}),n&&a.push({key:"share-text",label:"Share as Text",icon:Yf,onClick:n,variant:"ghost"}),a},cO=({actions:e,className:t})=>{const n=$u();return e.length===0?null:l.jsx("div",{className:ae("grid grid-cols-1 gap-3",t),children:e.map(r=>{const s=r.disabled??!1,i=r.variant??"secondary",o=s?PC["primary-disabled"]:PC[i];return l.jsxs(de.button,{whileHover:{scale:n||s?1:1.01},onClick:s?void 0:r.onClick,disabled:s,className:ae("w-full glass-card py-2 sm:py-3 rounded-lg sm:rounded-xl","transition-all duration-300 font-medium","flex items-center justify-center gap-2 text-xs sm:text-sm",o),children:[l.jsx(r.icon,{className:"h-3 w-3 sm:h-4 sm:w-4"}),r.label]},r.key)})})};var Wu=e=>e.type==="checkbox",oo=e=>e instanceof Date,mn=e=>e==null;const uO=e=>typeof e=="object";var It=e=>!mn(e)&&!Array.isArray(e)&&uO(e)&&!oo(e),Ose=e=>It(e)&&e.target?Wu(e.target)?e.target.checked:e.target.value:e,Dse=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Lse=(e,t)=>e.has(Dse(t)),$se=e=>{const t=e.constructor&&e.constructor.prototype;return It(t)&&t.hasOwnProperty("isPrototypeOf")},Qw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function lr(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Qw&&(e instanceof Blob||e instanceof FileList))&&(n||It(e)))if(t=n?[]:{},!n&&!$se(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=lr(e[r]));else return e;return t}var Lp=e=>Array.isArray(e)?e.filter(Boolean):[],At=e=>e===void 0,ke=(e,t,n)=>{if(!t||!It(e))return n;const r=Lp(t.split(/[,[\].]+?/)).reduce((s,i)=>mn(s)?s:s[i],e);return At(r)||r===e?At(e[t])?n:e[t]:r},Hr=e=>typeof e=="boolean",Zw=e=>/^\w*$/.test(e),dO=e=>
vendor: 18,901 bytes, line 692
692Lp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),dt=(e,t,n)=>{let r=-1;const s=Zw(t)?[t]:dO(t),i=s.length,o=i-1;for(;++r<i;){const a=s[r];let c=n;if(r!==o){const u=e[a];c=It(u)||Array.isArray(u)?u:isNaN(+s[r+1])?{}:[]}if(a==="__proto__")return;e[a]=c,e=e[a]}return e};const AC={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},jr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},cs={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};$.createContext(null);var Fse=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==jr.all&&(t._proxyFormState[o]=!r||jr.all),e[o]}});return s},jn=e=>It(e)&&!Object.keys(e).length,zse=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return jn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===jr.all)},vf=e=>Array.isArray(e)?e:[e];function Bse(e){const t=$.useRef(e);t.current=e,$.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Jr=e=>typeof e=="string",Vse=(e,t,n,r,s)=>Jr(e)?(r&&t.watch.add(e),ke(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),ke(n,i))):(r&&(t.watchAll=!0),n),Use=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},RC=e=>({isOnSubmit:!e||e===jr.onSubmit,isOnBlur:e===jr.onBlur,isOnChange:e===jr.onChange,isOnAll:e===jr.all,isOnTouch:e===jr.onTouched}),MC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ec=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=ke(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(Ec(a,t))break}else if(It(a)&&Ec(a,t))break}}};var Hse=(e,t,n)=>{const r=vf(ke(e,n));return dt(r,"root",t[n]),dt(e,n,r),e},eb=e=>e.type==="file",_s=e=>typeof e=="function",Sh=e=>{if(!Qw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},xf=e=>Jr(e),tb=e=>e.type==="radio",kh=e=>e instanceof RegExp;const IC={value:!1,isValid:!1},OC={value:!0,isValid:!0};var fO=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!At(e[0].attributes.value)?At(e[0].value)||e[0].value===""?OC:{value:e[0].value,isValid:!0}:OC:IC}return IC};const DC={isValid:!1,value:null};var hO=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,DC):DC;function LC(e,t,n="validate"){if(xf(e)||Array.isArray(e)&&e.every(xf)||Hr(e)&&!e)return{type:n,message:xf(e)?e:"",ref:t}}var Xo=e=>It(e)&&!kh(e)?e:{value:e,message:""},$C=async(e,t,n,r,s)=>{const{ref:i,refs:o,required:a,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:p,name:g,valueAsNumber:v,mount:b,disabled:y}=e._f,w=ke(t,g);if(!b||y)return{};const x=o?o[0]:i,S=T=>{r&&x.reportValidity&&(x.setCustomValidity(Hr(T)?"":T||""),x.reportValidity())},C={},k=tb(i),_=Wu(i),j=k||_,R=(v||eb(i))&&At(i.value)&&At(w)||Sh(i)&&i.value===""||w===""||Array.isArray(w)&&!w.length,P=Use.bind(null,g,n,C),M=(T,L,F,z=cs.maxLength,V=cs.minLength)=>{const I=T?L:F;C[g]={type:T?z:V,message:I,ref:i,...P(T?z:V,I)}};if(s?!Array.isArray(w)||!w.length:a&&(!j&&(R||mn(w))||Hr(w)&&!w||_&&!fO(o).isValid||k&&!hO(o).isValid)){const{value:T,message:L}=xf(a)?{value:!!a,message:a}:Xo(a);if(T&&(C[g]={type:cs.required,message:L,ref:x,...P(cs.required,L)},!n))return S(L),C}if(!R&&(!mn(d)||!mn(f))){let T,L;const F=Xo(f),z=Xo(d);if(!mn(w)&&!isNaN(w)){const V=i.valueAsNumber||w&&+w;mn(F.value)||(T=V>F.value),mn(z.value)||(L=V<z.value)}else{const V=i.valueAsDate||new Date(w),I=E=>new Date(new Date().toDateString()+" "+E),A=i.type=="time",D=i.type=="week";Jr(F.value)&&w&&(T=A?I(w)>I(F.value):D?w>F.value:V>new Date(F.value)),Jr(z.value)&&w&&(L=A?I(w)<I(z.value):D?w<z.value:V<new Date(z.value))}if((T||L)&&(M(!!T,F.message,z.message,cs.max,cs.min),!n))return S(C[g].message),C}if((c||u)&&!R&&(Jr(w)||s&&Array.isArray(w))){const T=Xo(c),L=Xo(u),F=!mn(T.value)&&w.length>+T.value,z=!mn(L.value)&&w.length<+L.value;if((F||z)&&(M(F,T.message,L.message),!n))return S(C[g].message),C}if(h&&!R&&Jr(w)){const{value:T,message:L}=Xo(h);if(kh(T)&&!w.match(T)&&(C[g]={type:cs.pattern,message:L,ref:i,...P(cs.pattern,L)},!n))return S(L),C}if(p){if(_s(p)){const T=await p(w,t),L=LC(T,x);if(L&&(C[g]={...L,...P(cs.validate,L.message)},!n))return S(L.message),C}else if(It(p)){let T={};for(const L in p){if(!jn(T)&&!n)break;const F=LC(await p[L](w,t),x,L);F&&(T={...F,...P(L,F.message)},S(F.message),n&&(C[g]=T))}if(!jn(T)&&(C[g]={ref:x,...T},!n))return C}}return S(!0),C};function Wse(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=At(e)?r++:e[t[r++]];return e}function qse(e){for(const t in e)if(e.hasOwnProperty(t)&&!At(e[t]))return!1;return!0}function Ft(e,t){const n=Array.isArray(t)?t:Zw(t)?[t]:dO(t),r=n.length===1?e:Wse(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(It(r)&&jn(r)||Array.isArray(r)&&qse(r))&&Ft(e,n.slice(0,-1)),e}var xg=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},zv=e=>mn(e)||!uO(e);function ii(e,t){if(zv(e)||zv(t))return e===t;if(oo(e)&&oo(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const i=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const o=t[s];if(oo(i)&&oo(o)||It(i)&&It(o)||Array.isArray(i)&&Array.isArray(o)?!ii(i,o):i!==o)return!1}}return!0}var pO=e=>e.type==="select-multiple",Gse=e=>tb(e)||Wu(e),wg=e=>Sh(e)&&e.isConnected,mO=e=>{for(const t in e)if(_s(e[t]))return!0;return!1};function _h(e,t={}){const n=Array.isArray(e);if(It(e)||n)for(const r in e)Array.isArray(e[r])||It(e[r])&&!mO(e[r])?(t[r]=Array.isArray(e[r])?[]:{},_h(e[r],t[r])):mn(e[r])||(t[r]=!0);return t}function gO(e,t,n){const r=Array.isArray(e);if(It(e)||r)for(const s in e)Array.isArray(e[s])||It(e[s])&&!mO(e[s])?At(t)||zv(n[s])?n[s]=Array.isArray(e[s])?_h(e[s],[]):{..._h(e[s])}:gO(e[s],mn(t)?{}:t[s],n[s]):n[s]=!ii(e[s],t[s]);return n}var Wl=(e,t)=>gO(e,t,_h(t)),yO=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>At(e)?e:t?e===""?NaN:e&&+e:n&&Jr(e)?new Date(e):r?r(e):e;function bg(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return eb(t)?t.files:tb(t)?hO(e.refs).value:pO(t)?[...t.selectedOptions].map(({value:n})=>n):Wu(t)?fO(e.refs).value:yO(At(t.value)?e.ref.value:t.value,e)}var Kse=(e,t,n,r)=>{const s={};for(const i of e){const o=ke(t,i);o&&dt(s,i,o._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},ql=e=>At(e)?e:kh(e)?e.source:It(e)?kh(e.value)?e.value.source:e.value:e;const FC="AsyncFunction";var Yse=e=>(!e||!e.validate)&&!!(_s(e.validate)&&e.validate.constructor.name===FC||It(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===FC)),Jse=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function zC(e,t,n){const r=ke(e,n);if(r||Zw(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=ke(t,i),a=ke(e,i);if(o&&!Array.isArray(o)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};s.pop()}return{name:n}}var Xse=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,Qse=(e,t)=>!Lp(ke(e,t)).length&&Ft(e,t);const Zse={mode:jr.onSubmit,reValidateMode:jr.onChange,shouldFocusError:!0};function eie(e={}){let t={...Zse,...e},n={submitCount:0,isDirty:!1,isLoading:_s(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=It(t.defaultValues)||It(t.values)?lr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:lr(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:xg(),array:xg(),state:xg()},h=RC(t.mode),p=RC(t.reValidateMode),g=t.criteriaMode===jr.all,v=O=>B=>{clearTimeout(u),u=setTimeout(O,B)},b=async O=>{if(!e.disabled&&(d.isValid||O)){const B=t.resolver?jn((await j()).errors):await P(r,!0);B!==n.isValid&&f.state.next({isValid:B})}},y=(O,B)=>{!e.disabled&&(d.isValidating||d.validatingFields)&&((O||Array.from(a.mount)).forEach(G=>{G&&(B?dt(n.validatingFields,G,B):Ft(n.validatingFields,G))}),f.state.next({validatingFields:n.validatingFields,isValidating:!jn(n.validatingFields)}))},w=(O,B=[],G,pe,ce=!0,le=!0)=>{if(pe&&G&&!e.disabled){if(o.action=!0,le&&Array.isArray(ke(r,O))){const Ce=G(ke(r,O),pe.argA,pe.argB);ce&&dt(r,O,Ce)}if(le&&Array.isArray(ke(n.errors,O))){const Ce=G(ke(n.errors,O),pe.argA,pe.argB);ce&&dt(n.errors,O,Ce),Qse(n.errors,O)}if(d.touchedFields&&le&&Array.isArray(ke(n.touchedFields,O))){const Ce=G(ke(n.touchedFields,O),pe.argA,pe.argB);ce&&dt(n.touchedFields,O,Ce)}d.dirtyFields&&(n.dirtyFields=Wl(s,i)),f.state.next({name:O,isDirty:T(O,B),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else dt(i,O,B)},x=(O,B)=>{dt(n.errors,O,B),f.state.next({errors:n.errors})},S=O=>{n.errors=O,f.state.next({errors:n.errors,isValid:!1})},C=(O,B,G,pe)=>{const ce=ke(r,O);if(ce){const le=ke(i,O,At(G)?ke(s,O):G);At(le)||pe&&pe.defaultChecked||B?dt(i,O,B?le:bg(ce._f)):z(O,le),o.mount&&b()}},k=(O,B,G,pe,ce)=>{let le=!1,Ce=!1;const Me={name:O};if(!e.disabled){const H=!!(ke(r,O)&&ke(r,O)._f&&ke(r,O)._f.disabled);if(!G||pe){d.isDirty&&(Ce=n.isDirty,n.isDirty=Me.isDirty=T(),le=Ce!==Me.isDirty);const X=H||ii(ke(s,O),B);Ce=!!(!H&&ke(n.dirtyFields,O)),X||H?Ft(n.dirtyFields,O):dt(n.dirtyFields,O,!0),Me.dirtyFields=n.dirtyFields,le=le||d.dirtyFields&&Ce!==!X}if(G){const X=ke(n.touchedFields,O);X||(dt(n.touchedFields,O,G),Me.touchedFields=n.touchedFields,le=le||d.touchedFields&&X!==G)}le&&ce&&f.state.next(Me)}return le?Me:{}},_=(O,B,G,pe)=>{const ce=ke(n.errors,O),le=d.isValid&&Hr(B)&&n.isValid!==B;if(e.delayError&&G?(c=v(()=>x(O,G)),c(e.delayError)):(clearTimeout(u),c=null,G?dt(n.errors,O,G):Ft(n.errors,O)),(G?!ii(ce,G):ce)||!jn(pe)||le){const Ce={...pe,...le&&Hr(B)?{isValid:B}:{},errors:n.errors,name:O};n={...n,...Ce},f.state.next(Ce)}},j=async O=>{y(O,!0);const B=await t.resolver(i,t.context,Kse(O||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return y(O),B},R=async O=>{const{errors:B}=await j(O);if(O)for(const G of O){const pe=ke(B,G);pe?dt(n.errors,G,pe):Ft(n.errors,G)}else n.errors=B;return B},P=async(O,B,G={valid:!0})=>{for(const pe in O){const ce=O[pe];if(ce){const{_f:le,...Ce}=ce;if(le){const Me=a.array.has(le.name),H=ce._f&&Yse(ce._f);H&&d.validatingFields&&y([pe],!0);const X=await $C(ce,i,g,t.shouldUseNativeValidation&&!B,Me);if(H&&d.validatingFields&&y([pe]),X[le.name]&&(G.valid=!1,B))break;!B&&(ke(X,le.name)?Me?Hse(n.errors,X,le.name):dt(n.errors,le.name,X[le.name]):Ft(n.errors,le.name))}!jn(Ce)&&await P(Ce,B,G)}}return G.valid},M=()=>{for(const O of a.unMount){const B=ke(r,O);B&&(B._f.refs?B._f.refs.every(G=>!wg(G)):!wg(B._f.ref))&&U(O)}a.unMount=new Set},T=(O,B)=>!e.disabled&&(O&&B&&dt(i,O,B),!ii(K(),s)),L=(O,B,G)=>Vse(O,a,{...o.mount?i:At(B)?s:Jr(O)?{[O]:B}:B},G,B),F=O=>Lp(ke(o.mount?i:s,O,e.shouldUnregister?ke(s,O,[]):[])),z=(O,B,G={})=>{const pe=ke(r,O);let ce=B;if(pe){const le=pe._f;le&&(!le.disabled&&dt(i,O,yO(B,le)),ce=Sh(le.ref)&&mn(B)?"":B,pO(le.ref)?[...le.ref.options].forEach(Ce=>Ce.selected=ce.includes(Ce.value)):le.refs?Wu(le.ref)?le.refs.length>1?le.refs.forEach(Ce=>(!Ce.defaultChecked||!Ce.disabled)&&(Ce.checked=Array.isArray(ce)?!!ce.find(Me=>Me===Ce.value):ce===Ce.value)):le.refs[0]&&(le.refs[0].checked=!!ce):le.refs.forEach(Ce=>Ce.checked=Ce.value===ce):eb(le.ref)?le.ref.value="":(le.ref.value=ce,le.ref.type||f.values.next({name:O,values:{...i}})))}(G.shouldDirty||G.shouldTouch)&&k(O,ce,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&E(O)},V=(O,B,G)=>{for(const pe in B){const ce=B[pe],le=`${O}.${pe}`,Ce=ke(r,le);(a.array.has(O)||It(ce)||Ce&&!Ce._f)&&!oo(ce)?V(le,ce,G):z(le,ce,G)}},I=(O,B,G={})=>{const pe=ke(r,O),ce=a.array.has(O),le=lr(B);dt(i,O,le),ce?(f.array.next({name:O,values:{...i}}),(d.isDirty||d.dirtyFields)&&G.shouldDirty&&f.state.next({name:O,dirtyFields:Wl(s,i),isDirty:T(O,le)})):pe&&!pe._f&&!mn(le)?V(O,le,G):z(O,le,G),MC(O,a)&&f.state.next({...n}),f.values.next({name:o.mount?O:void 0,values:{...i}})},A=async O=>{o.mount=!0;const B=O.target;let G=B.name,pe=!0;const ce=ke(r,G),le=()=>B.type?bg(ce._f):Ose(O),Ce=Me=>{pe=Number.isNaN(Me)||oo(Me)&&isNaN(Me.getTime())||ii(Me,ke(i,G,Me))};if(ce){let Me,H;const X=le(),ve=O.type===AC.BLUR||O.type===AC.FOCUS_OUT,Ne=!Jse(ce._f)&&!t.resolver&&!ke(n.errors,G)&&!ce._f.deps||Xse(ve,ke(n.touchedFields,G),n.isSubmitted,p,h),Le=MC(G,a,ve);dt(i,G,X),ve?(ce._f.onBlur&&ce._f.onBlur(O),c&&c(0)):ce._f.onChange&&ce._f.onChange(O);const Qe=k(G,X,ve,!1),_t=!jn(Qe)||Le;if(!ve&&f.values.next({name:G,type:O.type,values:{...i}}),Ne)return d.isValid&&(e.mode==="onBlur"?ve&&b():b()),_t&&f.state.next({name:G,...Le?{}:Qe});if(!ve&&Le&&f.state.next({...n}),t.resolver){const{errors:nt}=await j([G]);if(Ce(X),pe){const xe=zC(n.errors,r,G),me=zC(nt,r,xe.name||G);Me=me.error,G=me.name,H=jn(nt)}}else y([G],!0),Me=(await $C(ce,i,g,t.shouldUseNativeValidation))[G],y([G]),Ce(X),pe&&(Me?H=!1:d.isValid&&(H=await P(r,!0)));pe&&(ce._f.deps&&E(ce._f.deps),_(G,H,Me,Qe))}},D=(O,B)=>{if(ke(n.errors,B)&&O.focus)return O.focus(),1},E=async(O,B={})=>{let G,pe;const ce=vf(O);if(t.resolver){const le=await R(At(O)?O:ce);G=jn(le),pe=O?!ce.some(Ce=>ke(le,Ce)):G}else O?(pe=(await Promise.all(ce.map(async le=>{const Ce=ke(r,le);return await P(Ce&&Ce._f?{[le]:Ce}:Ce)}))).every(Boolean),!(!pe&&!n.isValid)&&b()):pe=G=await P(r);return f.state.next({...!Jr(O)||d.isValid&&G!==n.isValid?{}:{name:O},...t.resolver||!O?{isValid:G}:{},errors:n.errors}),B.shouldFocus&&!pe&&Ec(r,D,O?ce:a.mount),pe},K=O=>{const B={...o.mount?i:s};return At(O)?B:Jr(O)?ke(B,O):O.map(G=>ke(B,G))},te=(O,B)=>({invalid:!!ke((B||n).errors,O),isDirty:!!ke((B||n).dirtyFields,O),error:ke((B||n).errors,O),isValidating:!!ke(n.validatingFields,O),isTouched:!!ke((B||n).touchedFields,O)}),N=O=>{O&&vf(O).forEach(B=>Ft(n.errors,B)),f.state.next({errors:O?n.errors:{}})},ee=(O,B,G)=>{const pe=(ke(r,O,{_f:{}})._f||{}).ref,ce=ke(n.errors,O)||{},{ref:le,message:Ce,type:Me,...H}=ce;dt(n.errors,O,{...H,...B,ref:pe}),f.state.next({name:O,errors:n.errors,isValid:!1}),G&&G.shouldFocus&&pe&&pe.focus&&pe.focus()},ie=(O,B)=>_s(O)?f.values.subscribe({next:G=>O(L(void 0,B),G)}):L(O,B,!0),U=(O,B={})=>{for(const G of O?vf(O):a.mount)a.mount.delete(G),a.array.delete(G),B.keepValue||(Ft(r,G),Ft(i,G)),!B.keepError&&Ft(n.errors,G),!B.keepDirty&&Ft(n.dirtyFields,G),!B.keepTouched&&Ft(n.touchedFields,G),!B.keepIsValidating&&Ft(n.validatingFields,G),!t.shouldUnregister&&!B.keepDefaultValue&&Ft(s,G);f.values.next({values:{...i}}),f.state.next({...n,...B.keepDirty?{isDirty:T()}:{}}),!B.keepIsValid&&b()},W=({disabled:O,name:B,field:G,fields:pe,value:ce})=>{if(Hr(O)&&o.mount||O){const le=O?void 0:At(ce)?bg(G?G._f:ke(pe,B)._f):ce;dt(i,B,le),k(B,le,!1,!1,!0)}},ne=(O,B={})=>{let G=ke(r,O);const pe=Hr(B.disabled)||Hr(e.disabled);return dt(r,O,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:O}},name:O,mount:!0,...B}}),a.mount.add(O),G?W({field:G,disabled:Hr(B.disabled)?B.disabled:e.disabled,name:O,value:B.value}):C(O,!0,B.value),{...pe?{disabled:B.disabled||e.disabled}:{},...t.progressive?{required:!!B.required,min:ql(B.min),max:ql(B.max),minLength:ql(B.minLength),maxLength:ql(B.maxLength),pattern:ql(B.pattern)}:{},name:O,onChange:A,onBlur:A,ref:ce=>{if(ce){ne(O,B),G=ke(r,O);const le=At(ce.value)&&ce.querySelectorAll&&ce.querySelectorAll("input,select,textarea")[0]||ce,Ce=Gse(le),Me=G._f.refs||[];if(Ce?Me.find(H=>H===le):le===G._f.ref)return;dt(r,O,{_f:{...G._f,...Ce?{refs:[...Me.filter(wg),le,...Array.isArray(ke(s,O))?[{}]:[]],ref:{type:le.type,name:O}}:{ref:le}}}),C(O,!1,void 0,le)}else G=ke(r,O,{}),G._f&&(G._f.mount=!1),(t.shouldUnregister||B.shouldUnregister)&&!(Lse(a.array,O)&&o.action)&&a.unMount.add(O)}}},oe=()=>t.shouldFocusError&&Ec(r,D,a.mount),Z=O=>{Hr(O)&&(f.state.next({disabled:O}),Ec(r,(B,G)=>{const pe=ke(r,G);pe&&(B.disabled=pe._f.disabled||O,Array.isArray(pe._f.refs)&&pe._f.refs.forEach(ce=>{ce.disabled=pe._f.disabled||O}))},0,!1))},se=(O,B)=>async G=>{let pe;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let ce=lr(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:le,values:Ce}=await j();n.errors=le,ce=Ce}else await P(r);if(Ft(n.errors,"root"),jn(n.errors)){f.state.next({errors:{}});try{await O(ce,G)}catch(le){pe=le}}else B&&await B({...n.errors},G),oe(),setTimeout(oe);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:jn(n.errors)&&!pe,submitCount:n.submitCount+1,errors:n.errors}),pe)throw pe},re=(O,B={})=>{ke(r,O)&&(At(B.defaultValue)?I(O,lr(ke(s,O))):(I(O,B.defaultValue),dt(s,O,lr(B.defaultValue))),B.keepTouched||Ft(n.touchedFields,O),B.keepDirty||(Ft(n.dirtyFields,O),n.isDirty=B.defaultValue?T(O,lr(ke(s,O))):T()),B.keepError||(Ft(n.errors,O),d.isValid&&b()),f.state.next({...n}))},Y=(O,B={})=>{const G=O?lr(O):s,pe=lr(G),ce=jn(O),le=ce?s:pe;if(B.keepDefaultValues||(s=G),!B.keepValues){if(B.keepDirtyValues){const Ce=new Set([...a.mount,...Object.keys(Wl(s,i))]);for(const Me of Array.from(Ce))ke(n.dirtyFields,Me)?dt(le,Me,ke(i,Me)):I(Me,ke(le,Me))}else{if(Qw&&At(O))for(const Ce of a.mount){const Me=ke(r,Ce);if(Me&&Me._f){const H=Array.isArray(Me._f.refs)?Me._f.refs[0]:Me._f.ref;if(Sh(H)){const X=H.closest("form");if(X){X.reset();break}}}}r={}}i=e.shouldUnregister?B.keepDefaultValues?lr(s):{}:lr(le),f.array.next({values:{...le}}),f.values.next({values:{...le}})}a={mount:B.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!B.keepIsValid||!!B.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:B.keepSubmitCount?n.submitCount:0,isDirty:ce?!1:B.keepDirty?n.isDirty:!!(B.keepDefaultValues&&!ii(O,s)),isSubmitted:B.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ce?{}:B.keepDirtyValues?B.keepDefaultValues&&i?Wl(s,i):n.dirtyFields:B.keepDefaultValues&&O?Wl(s,O):B.keepDirty?n.dirtyFields:{},touchedFields:B.keepTouched?n.touchedFields:{},errors:B.keepErrors?n.errors:{},isSubmitSuccessful:B.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ee=(O,B)=>Y(_s(O)?O(i):O,B);return{control:{register:ne,unregister:U,getFieldState:te,handleSubmit:se,setError:ee,_executeSchema:j,_getWatch:L,_getDirty:T,_updateV
692alid:b,_removeUnmounted:M,_updateFieldArray:w,_updateDisabledField:W,_getFieldArray:F,_reset:Y,_resetDefaultValues:()=>_s(t.defaultValues)&&t.defaultValues().then(O=>{Ee(O,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:O=>{n={...n,...O}},_disableForm:Z,_subjects:f,_proxyFormState:d,_setErrors:S,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(O){o=O},get _defaultValues(){return s},get _names(){return a},set _names(O){a=O},get _formState(){return n},set _formState(O){n=O},get _options(){return t},set _options(O){t={...t,...O}}},trigger:E,register:ne,handleSubmit:se,watch:ie,setValue:I,getValues:K,reset:Ee,resetField:re,clearErrors:N,unregister:U,setError:ee,setFocus:(O,B={})=>{const G=ke(r,O),pe=G&&G._f;if(pe){const ce=pe.refs?pe.refs[0]:pe.ref;ce.focus&&(ce.focus(),B.shouldSelect&&ce.select())}},getFieldState:te}}function tie(e={}){const t=$.useRef(),n=$.useRef(),[r,s]=$.useState({isDirty:!1,isValidating:!1,isLoading:_s(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:_s(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...eie(e),formState:r});const i=t.current.control;return i._options=e,Bse({subject:i._subjects.state,next:o=>{zse(o,i._proxyFormState,i._updateFormState)&&s({...i._formState})}}),$.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),$.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),$.useEffect(()=>{e.values&&!ii(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,s(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),$.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),$.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),$.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),$.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[r]),t.current.formState=Fse(r,i),t.current}const nie=({open:e,onOpenChange:t,itineraryId:n,onRSVP:r})=>{const{register:s,handleSubmit:i,reset:o,formState:{isSubmitting:a}}=tie(),c=async u=>{if(!n){J.error("Unable to RSVP at this time");return}try{const{error:d}=await q.from("itinerary_rsvps").insert({itinerary_id:n,guest_name:u.name,guest_email:u.email||null,message:u.message||null});if(d)throw d;J.success("Thanks for RSVPing! 🎉"),o(),t(!1),r==null||r()}catch(d){console.error("Error submitting RSVP:",d),J.error("Couldn't submit your RSVP. Please try again!")}};return l.jsx(Yw,{open:e,onOpenChange:t,children:l.jsxs(Ip,{className:"sm:max-w-[425px]",children:[l.jsx(Op,{children:l.jsx(Dp,{children:"RSVP to this plan"})}),l.jsxs("form",{onSubmit:i(c),className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(tn,{htmlFor:"name",children:"Your Name"}),l.jsx(gn,{id:"name",placeholder:"Enter your name",...s("name",{required:!0})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(tn,{htmlFor:"email",children:"Email (optional)"}),l.jsx(gn,{id:"email",type:"email",placeholder:"Enter your email",...s("email")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(tn,{htmlFor:"message",children:"Message (optional)"}),l.jsx(Xw,{id:"message",placeholder:"Looking forward to it! 🎉",className:"min-h-[60
692px] resize-none",...s("message")})]}),l.jsx(Fe,{type:"submit",className:"w-full",disabled:a,children:a?"Submitting...":"Submit RSVP"})]})]})})},rie=()=>{var C;const{token:e}=aN(),t=Kt(),[n,r]=m.useState(null),[s,i]=m.useState(null),[o,a]=m.useState([]),[c,u]=m.useState(!0),[d,f]=m.useState(!1),[h,p]=m.useState([]),[g,v]=m.useState(!1);m.useEffect(()=>{y()},[e]),m.useEffect(()=>{s&&b()},[s]);const b=async()=>{try{const{data:k,error:_}=await q.from("itinerary_rsvps").select("guest_name, guest_email, message, created_at").eq("itinerary_id",s).order("created_at",{ascending:!0});if(_)throw _;p(k||[])}catch(k){console.error("Error fetching RSVPs:",k),J.error("Couldn't load RSVPs")}},y=async()=>{try{const{data:k,error:_}=await q.rpc("get_shared_itinerary_full",{p_sharing_id:e});if(_)throw _;if(!k)throw new Error("Itinerary not found");const{itinerary:j,profile:R,venues:P}=k,M={...j,profiles:R};i(j.id),r(M),a(P||[])}catch(k){console.error("Error fetching itinerary:",k),J.error("Unable to load itinerary. It may have been deleted or the link is invalid.")}finally{u(!1)}},w=()=>{const k=window.location.href;/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)&&navigator.share?navigator.share({title:n==null?void 0:n.title,url:k}).catch(()=>{navigator.clipboard.writeText(k),J.success("Shareable link copied to clipboard!")}):(navigator.clipboard.writeText(k),J.success("Shareable link copied to clipboard!"))},x=()=>{if(!n)return;const k=`📝 ${n.title}
693
694`+o.map(j=>`📍 ${j.name}
695⏰ ${j.time}
696📌 ${j.location}
697ℹ️ ${j.description}
698
699`).join("");/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)&&navigator.share?navigator.share({title:n.title,text:k}).catch(()=>{navigator.clipboard.writeText(k),J.success("Itinerary copied to clipboard!")}):(navigator.clipboard.writeText(k),J.success("Itinerary copied to clipboard!"))},S=async()=>{if(!n||!s)return;const{data:{session:k}}=await q.auth.getSession();if(!k){sessionStorage.setItem("ezy_return_to",window.location.pathname),J.error("Please sign in to add this plan!",{action:{label:"Sign In",onClick:()=>t("/login",{state:{returnTo:window.location.pathname}})}});return}if(n.user_id===k.user.id){J.info("This is already your plan! Check it in your profile.");return}try{const{data:_,error:j}=await q.from("itineraries").insert({title:n.title,description:n.description||null,planned_city:n.planned_city||null,user_id:k.user.id,status:"final"}).select().single();if(j)throw j;const R=o.map(({id:P,itinerary_id:M,votes:T,comments:L,holiday_info:F,hours_source:z,estimated_price_range_source:V,openNow_at_query_time:I,open_at_visit:A,live_status_label:D,...E})=>({...E,itinerary_id:_.id}));if(R.length>0){const{error:P}=await q.from("venues").insert(R);P&&(console.error("Error cloning venues:",P),J.error("Plan added but some venues couldn't be copied."))}v(!0),J.success("Added to your plans! 🎉")}catch(_){console.error("Error adding to plans:",_),J.error("Couldn't add to your plans. Please try again!")}};return c?l.jsx(Mse,{}):n?l.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background to-background/50 p-4 md:p-8",children:l.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[l.jsx(Rse,{itinerary:n}),l.jsx(Uw,{venues:o,mode:"shared",utcOffsetMinutes:(C=n.planned_city)==null?void 0:C.utcOffsetMinutes,renderFooter:()=>l.jsx(cO,{actions:lO({onSave:S,onShare:w,onShareAsText:x,isSaved:g,saveLabel:"Add to My Plans",savedLabel:"Added to My Plans"})})}),l.jsx("div",{className:"flex justify-center",children:l.jsxs(Fe,{variant:"outline",onClick:()=>f(!0),className:"bg-primary/10 hover:bg-primary/20 text-primary",children:[l.jsx(by,{className:"h-4 w-4 mr-2"}),"RSVP"]})}),l.jsx(nie,{open:d,onOpenChange:f,itineraryId:s,onRSVP:b})]})}):l.jsx(Ise,{})},sie=()=>l.jsx(Or,{children:l.jsx(rie,{})});var nb="Tabs",[iie,jie]=Bs(nb,[cp]),vO=cp(),[oie,rb]=iie(nb),xO=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=T0(a),[f,h]=Ro({prop:r,onChange:s,defaultProp:i});return l.jsx(oie,{scope:n,baseId:Ts(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:c,children:l.jsx(Je.div,{dir:d,"data-orientation":o,...u,ref:t})})});xO.displayName=nb;var wO="TabsList",bO=m.forwardRef((e,t)=>
699{const{__scopeTabs:n,loop:r=!0,...s}=e,i=rb(wO,n),o=vO(n);return l.jsx(r2,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:l.jsx(Je.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});bO.displayName=wO;var SO="TabsTrigger",kO=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,o=rb(SO,n),a=vO(n),c=jO(o.baseId,r),u=EO(o.baseId,r),d=r===o.value;return l.jsx(s2,{asChild:!0,...a,focusable:!s,active:d,children:l.jsx(Je.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:t,onMouseDown:Ae(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:Ae(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:Ae(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!s&&f&&o.onValueChange(r)})})})});kO.displayName=SO;var _O="TabsContent",CO=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=e,a=rb(_O,n),c=jO(a.baseId,r),u=EO(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(sr,{present:s||d,children:({present:h})=>l.jsx(Je.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&i})})});CO.displayName=_O;function jO(e,t){return`${e}-trigger-${t}`}function EO(e,t){return`${e}-content-${t}`}var aie=xO,NO=bO,TO=kO,PO=CO;const AO=aie,sb=m.forwardRef(({className:e,...t},n)=>l.jsx(NO,{ref:n,className:ae("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));sb.displayName=NO.displayName;const Fa=m.forwardRef(({className:e,...t},n)=>l.jsx(TO,{ref:n,className:ae("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Fa.displayName=TO.displayName;const wf=m.forwardRef(({className:e,...t},n)=>l.jsx(PO,{ref:n,className:ae("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));wf.displayName=PO.displayName;const BC={async searchVenues(e,t,n="venues"){const{data:r,error:s}=await q.functions.invoke("discover-venues",{body:{query:e,location:t,type:n}});return s?{success:!1,error:s.message}:r},async scrapeVenueDetails(e){const{data:t,error:n}=await q.functions.invoke("scrape-venue",{body:{url:e}});return n?{success:!1,error:n.message}:t}};function lie(){const[e,t]=m.useState(""),[n,r]=m.useState(""),[s,i]=m.useState("venues"),[o,a]=m.useState(!1),[c,u]=m.useState([]),[d,f]=m.useState([]),[h,p]=m.useState(null),[g,v]=m.useState(null),b=async()=>{if(!e.trim()||!n.trim()){J.error("Please enter both a search query and location");return}a(!0),u([]);try{const C=await BC.searchVenues(e,n,s);C.success&&C.venues?(u(C.venues),J.success(`Found ${C.venues.length} ${s}`)):J.error(C.error||"Search failed")}catch(C){console.error("Search error:",C),J.error("Failed to search. Please try again.")}finally{a(!1)}},y=C=>{const k={...C,id:crypto.randomUUID(),approved:!0};f(_=>[..._,k]),u(_=>_.filter(j=>j.url!==C.url)),J.success(`${C.name} added to your approved list`)},w=C=>{u(k=>k.filter(_=>_.url!==C.url)),J.info("Venue dismissed")},x=C=>{f(k=>k.filter(_=>_.id!==C))},S=async C=>{v(C.url),p(C.url);try{const k=await BC.scrapeVenueDetails(C.url);k.success&&k.data?(u(_=>_.map(j=>{var R,P,M;return j.url===C.url?{...j,description:((R=k.data)==null?void 0:R.description)||j.description,rawData:{...j.rawData,markdown:(P=k.data)==null?void 0:P.markdown,metadata:(M=k.data)==null?void 0:M.metadata}}:j})),J.success("Details loaded")):J.error(k.error||"Failed to get details")}catch(k){console.error("Scrape error:",k),J.error("Failed to load details")}finally{v(null)}};return l.jsx(Or,{children:l.jsx("div",{className:"min-h-screen bg-background",children:l.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-6xl",children:[l.jsxs(de.div,{initial:{opacity:0,y:-20}
699,animate:{opacity:1,y:0},className:"text-center mb-8",children:[l.jsx("h1",{className:"text-4xl font-bold mb-2 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent",children:"Discover Venues & Events"}),l.jsx("p",{className:"text-muted-foreground",children:"Search the web for real venues and events, then approve them for your itineraries"})]}),l.jsx(nn,{className:"mb-8 border-border/50 bg-card/50 backdrop-blur",children:l.jsx(rc,{className:"pt-6",children:l.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(Sy,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(gn,{placeholder:"Search for restaurants, bars, clubs, concerts...",value:e,onChange:C=>t(C.target.value),className:"pl-10",onKeyDown:C=>C.key==="Enter"&&b()})]}),l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(er,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(gn,{placeholder:"Location (e.g., New York, London)",value:n,onChange:C=>r(C.target.value),className:"pl-10",onKeyDown:C=>C.key==="Enter"&&b()})]}),l.jsx(AO,{value:s,onValueChange:C=>i(C),className:"w-auto",children:l.jsxs(sb,{children:[l.jsxs(Fa,{value:"venues",className:"gap-2",children:[l.jsx(er,{className:"h-4 w-4"}),"Venues"]}),l.jsxs(Fa,{value:"events",className:"gap-2",children:[l.jsx(Ga,{className:"h-4 w-4"}),"Events"]})]})}),l.jsx(Fe,{onClick:b,disabled:o,className:"gap-2",children:o?l.jsxs(l.Fragment,{children:[l.jsx(js,{className:"h-4 w-4 animate-spin"}),"Searching..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Pr,{className:"h-4 w-4"}),"Search"]})})]})})}),l.jsxs("div",{className:"grid lg:grid-cols-3 gap-8",children:[l.jsxs("div",{className:"lg:col-span-2",children:[l.jsx("div",{className:"flex items-center justify-between mb-4",children:l.jsx("h2",{className:"text-xl font-semibold",children:o?"Searching...":c.length>0?`Found ${c.length} Results`:"Search Results"})}),o&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[l.jsx(js,{className:"h-8 w-8 animate-spin text-primary mb-4"}),l.jsxs("p",{className:"text-muted-foreground",children:["Crawling the web for ",s,"..."]})]}),!o&&c.length===0&&l.jsx(nn,{className:"border-dashed",children:l.jsxs(rc,{className:"flex flex-col items-center justify-center py-16",children:[l.jsx(Sy,{className:"h-12 w-12 text-muted-foreground mb-4"}),l.jsx("p",{className:"text-muted-foreground text-center",children:"Enter a search query and location to discover venues and events"})]})}),l.jsx(yt,{mode:"popLayout",children:c.map((C,k)=>{var _;return l.jsx(de.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,x:-100},transition:{delay:k*.05},children:l.jsxs(nn,{className:"mb-4 overflow-hidden hover:border-primary/50 transition-colors",children:[l.jsx(mv,{className:"pb-2",children:l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx(gv,{className:"text-lg line-clamp-1",children:C.name}),l.jsxs(yv,{className:"flex items-center gap-2 mt-1",children:[l.jsx(Qa,{variant:"secondary",className:"text-xs",children:C.source}),l.jsx(Qa,{variant:"outline",className:"text-xs",children:C.type})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Fe,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>w(C),children:l.jsx(Dn,{className:"h-4 w-4"})}),l.jsx(Fe,{size:"sm",variant:"ghost",className:"text-green-500 hover:text-green-500 hover:bg-green-500/10",onClick:()=>y(C),children:l.jsx(xo,{className:"h-4 w-4"})})]})]})}),l.jsxs(rc,{children:[l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-3",children:C.description}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(Fe,{size:"sm",variant:"outline",className:"gap-2",onClick:()=>S(C),disabled:g===C.url,children:[g===C.url?l.jsx(js,{className:"h-3 w-3 animate-spin"}):l.jsx(Pr,{className:"h-3 w-3"}),"Get Details"]}),l.jsxs(Fe,{size:"sm",variant:"ghost",className:"gap-2",onClick:()=>window.open(C.url,"_blank"),children:[l.jsx(wN,{className:"h-3 w-3"}),"Visit"]})]}),h===C.url&&((_=C.rawData)==null?void 0:_.markdown)&&l.jsx(de.div,{initial:{opacity:0,height:0}
699,animate:{opacity:1,height:"auto"},className:"mt-4 p-4 bg-muted/50 rounded-lg",children:l.jsxs("p",{className:"text-xs text-muted-foreground whitespace-pre-wrap line-clamp-10",children:[C.rawData.markdown.slice(0,1e3),"..."]})})]})]})},C.url)})})]}),l.jsx("div",{className:"lg:col-span-1",children:l.jsx("div",{className:"sticky top-4",children:l.jsxs(nn,{className:"border-primary/20 bg-primary/5",children:[l.jsxs(mv,{children:[l.jsxs(gv,{className:"flex items-center gap-2",children:[l.jsx(xo,{className:"h-5 w-5 text-green-500"}),"Approved (",d.length,")"]}),l.jsx(yv,{children:"Venues ready for your itineraries"})]}),l.jsxs(rc,{children:[d.length===0?l.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"Approve venues from search results to add them here"}):l.jsx("div",{className:"space-y-3",children:l.jsx(yt,{children:d.map(C=>l.jsxs(de.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"flex items-center justify-between p-3 bg-background rounded-lg",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"font-medium text-sm truncate",children:C.name}),l.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.source})]}),l.jsx(Fe,{size:"sm",variant:"ghost",className:"shrink-0",onClick:()=>x(C.id),children:l.jsx(Dn,{className:"h-4 w-4"})})]},C.id))})}),d.length>0&&l.jsxs(Fe,{className:"w-full mt-4 gap-2",onClick:()=>J.info("Feature coming soon: Use approved venues in itinerary generation"),children:[l.jsx(Pr,{className:"h-4 w-4"}),"Use in Itinerary"]})]})]})})})]})]})})})}const Sg=({id:e,title:t,createdAt:n,venueCount:r,status:s,plannedCity:i,sessionId:o,participantCount:a})=>{const c=Kt(),u=()=>{c(o?`/new-plan?session=${o}`:`/my-plans/${e}`)},d=(i==null?void 0:i.description)||(i==null?void 0:i.name)||null;return l.jsx(de.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:25},children:l.jsx(nn,{onClick:u,className:"cursor-pointer p-4 bg-background/60 backdrop-blur-lg border-border/30 hover:border-primary/40 transition-colors group",children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[l.jsx("h3",{className:"font-semibold text-foreground truncate group-hover:text-primary transition-colors",children:t}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[d&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(er,{className:"h-3 w-3"}),d]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(mN,{className:"h-3 w-3"}),OM(new Date(n),{addSuffix:!0})]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(bo,{className:"h-3 w-3"}),r," ",r===1?"venue":"venues"]}),a!==void 0&&a>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Gt,{className:"h-3 w-3"}),a]})]})]}),l.jsx(Qa,{variant:s==="final"?"default":"secondary",className:"shrink-0 text-[10px]",children:s==="final"?"Completed":s==="active"?"Active":"Draft"})]})})})},cie={completed:{icon:bN,heading:"No completed plans yet",description:"Once you finalize a plan, it will appear here for easy access.",cta:"Start Planning",to:"/new-plan"},drafts:{icon:SN,heading:"No drafts in progress",description:"Plans you're still working on will show up here.",cta:"Create a Plan",to:"/new-plan"},sessions:{icon:Gt,heading:"No active sessions",description:"Start a group session to plan together with friends.",cta:"Start a Session",to:"/new-plan"}},kg=({tab:e})=>{const t=Kt(),{icon:n,heading:r,description:s,cta:i,to:o}=cie[e];return l.jsxs(de.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center py-16 text-center space-y-4",children:[l.jsx("div",{className:"rounded-full bg-muted p-4",children:l.jsx(n,{className:"h-8 w-8 text-muted-foreground"})}),l.jsx("h3",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("p",{className:"text-sm text-muted-foreground max-w-xs",children:s}),l.jsxs(Fe,{onClick:()=>t(o),className:"gap-2",children:[l.jsx(Hh,{className:"h-4 w-4"}),i]})]})},uie=()=>{const e=Kt(),[t,n]=m.useState([]),[r,s]=m.useState([]),[i,o]=m.useState([]),[a,c]=m.useState(!0);m.useEffect(()=>{u()},[]);async function u(){try{const{data:{user:d}}=await q.auth.getUser();if(!d){e("/login");return}const f=q.from("itineraries").select("id, title, created_at, status, planned_city, venues(id)").eq("user_id",d.id).eq("status","final").order("created_at",{ascending:!1}),h=q.from("itineraries").select("id, title, created_at, status, planned_city, venues(id)").eq("user_id",d.id).eq("status","draft").order("created_at",{ascending:!1}),p=q.from("planning_sessions").select("id, title, created_at, status, itinerary_id").order("created_at",{ascending:!1}),[g,v,b]=await Promise.all([f,h,p]);if(g.error)throw g.error;if(v.error)throw v.error;if(b.error)throw b.error;n((g.data||[]).map(x=>{var S;
699return{id:x.id,title:x.title,created_at:x.created_at,status:x.status,planned_city:x.planned_city,venue_count:((S=x.venues)==null?void 0:S.length)||0}}));const y=new Set((b.data||[]).map(x=>x.itinerary_id).filter(Boolean));s((v.data||[]).filter(x=>!y.has(x.id)).map(x=>{var S;return{id:x.id,title:x.title,created_at:x.created_at,status:x.status,planned_city:x.planned_city,venue_count:((S=x.venues)==null?void 0:S.length)||0}}));const w=b.data||[];if(w.length>0){const x=await q.from("planning_participants").select("session_id").in("session_id",w.map(_=>_.id)),S={};(x.data||[]).forEach(_=>{S[_.session_id]=(S[_.session_id]||0)+1});const C=w.map(_=>_.itinerary_id).filter(Boolean);let k={};C.length>0&&((await q.from("venues").select("itinerary_id").in("itinerary_id",C)).data||[]).forEach(j=>{k[j.itinerary_id]=(k[j.itinerary_id]||0)+1}),o(w.map(_=>({session_id:_.id,itinerary_id:_.itinerary_id||"",title:_.title,created_at:_.created_at,status:_.status||"active",planned_city:null,venue_count:_.itinerary_id&&k[_.itinerary_id]||0,participant_count:S[_.id]||0})))}}catch(d){console.error("Error fetching plans:",d),J.error("Failed to load your plans")}finally{c(!1)}}return a?l.jsx(Or,{children:l.jsx("div",{className:"container mx-auto px-4 py-8",children:l.jsxs("div",{className:"animate-pulse space-y-4",children:[l.jsx("div",{className:"h-8 bg-primary/10 rounded w-1/4"}),l.jsx("div",{className:"h-12 bg-primary/5 rounded w-full"}),l.jsx("div",{className:"space-y-3",children:[1,2,3].map(d=>l.jsx("div",{className:"h-20 bg-primary/5 rounded"},d))})]})})}):l.jsx(Or,{children:l.jsxs("div",{className:"container mx-auto px-4 py-8 space-y-6",children:[l.jsx(de.h1,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-3xl font-bold text-foreground",children:"My Plans"}),l.jsxs(AO,{defaultValue:"completed",className:"w-full",children:[l.jsxs(sb,{className:"w-full sm:w-auto",children:[l.jsxs(Fa,{value:"completed",className:"gap-1.5",children:[l.jsx(bN,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:"Completed"}),t.length>0&&l.jsx("span",{className:"ml-1 text-xs bg-primary/20 text-primary rounded-full px-1.5",children:t.length})]}),l.jsxs(Fa,{value:"drafts",className:"gap-1.5",children:[l.jsx(SN,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:"Drafts"}),r.length>0&&l.jsx("span",{className:"ml-1 text-xs bg-muted-foreground/20 rounded-full px-1.5",children:r.length})]}),l.jsxs(Fa,{value:"sessions",className:"gap-1.5",children:[l.jsx(Gt,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:"Sessions"}),i.length>0&&l.jsx("span",{className:"ml-1 text-xs bg-muted-foreground/20 rounded-full px-1.5",children:i.length})]})]}),l.jsx(wf,{value:"completed",children:t.length===0?l.jsx(kg,{tab:"completed"}):l.jsx("div",{className:"grid gap-3 mt-4",children:t.map(d=>l.jsx(Sg,{id:d.id,title:d.title,createdAt:d.created_at,venueCount:d.venue_count,status:d.status,plannedCity:d.planned_city},d.id))})}),l.jsx(wf,{value:"drafts",children:r.length===0?l.jsx(kg,{tab:"drafts"}):l.jsx("div",{className:"grid gap-3 mt-4",children:r.map(d=>l.jsx(Sg,{id:d.id,title:d.title,createdAt:d.created_at,venueCount:d.venue_count,status:d.status,plannedCity:d.planned_city},d.id))})}),l.jsx(wf,{value:"sessions",children:i.length===0?l.jsx(kg,{tab:"sessions"}):l.jsx("div",{className:"grid gap-3 mt-4",children:i.map(d=>l.jsx(Sg,{id:d.itinerary_id,title:d.title,createdAt:d.created_at,venueCount:d.venue_count,status:d.status,plannedCity:d.planned_city,sessionId:d.session_id,participantCount:d.participant_count},d.session_id))})})]})]})})},die=({participants:e})=>e.length?l.jsxs("div",{className:"glass-card p-4 space-y-3",children:[l.jsx("div",{className:"flex items-center justify-between",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Gt,{className:"h-5 w-5 text-primary"}),l.jsxs("h3",{className:"font-semibold",children:["RSVPs (",e.length,")"]})]})}),l.jsx("div",{className:"space-y-2",children:e.map((t,n)=>l.jsxs("div",{className:"rounded-lg border border-border/50 p-3 space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm font-medium",children:t.guest_name||"Anonymous Guest"}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:[$n(new Date(t.created_at),"MMM d, yyyy · h:mm a")," (",new Date().toLocaleTimeString("en-us",{timeZoneName:"shortOffset"}).split(" ").pop(),")"]})]}),t.guest_email&&l.jsx("p",{className:"text-xs text-muted-foreground",children:t.guest_email}),t.message&&l.jsxs("div",{className:"flex items-start gap-1.5 mt-1",children:[l.jsx(Yf,{className:"h-3 w-3 text-muted-foreground mt-0.5 shrink-0"}),l.jsxs("p",{className:"text-sm text-muted-foreground italic",children:['"',t.message,'"']})]})]},n))})]}):null,fie=()=>{const{id:e}=aN(),t=Kt(),[n,r]=m.useState(!0),[s,i]=m.useState(""),[o,a]=m.useState(),[c,u]=m.useState([]),[d,f]=m.useState(null),[h,p]=m.useState(null),[g,v]=m.useState([]);m.useEffect(()=>{e&&b()},[e]);async function b(){try{const{data:{user:C}}=await q.auth.getUser();if(!C){t("/login");return}const{data:k,error:_}=await q.from("itineraries").select("*, venues(*)").eq("id",e).eq("user_id",C.id).single();if(_||!k){J.error("Plan not found"),t("/my-plans");return}i(k.title),a(k.description||void 0);const j=k.planned_city;p((j==null?void 0:j.utcOffsetMinutes)??null),f(k.sharing_id),u((k.venues||[]).map(P=>({...P,votes:{up:0,down:0},comments:[]})));const{data:R}=await q.from("itinerary_rsvps").select("guest_name, guest_email, message, created_at").eq("itinerary_id",e).order("created_at",{ascending:!1});v(R||[])}catch(C){console.error("Error fetching plan:",C),J.error("Error loading plan"),t("/my-plans")}finally{r(!1)}}const y=async()=>
699{if(!d){J.error("No sharing link available");return}const C=`${window.location.origin}/shared/${d}`;try{navigator.share?await navigator.share({title:s,url:C}):(await navigator.clipboard.writeText(C),J.success("Share link copied!"))}catch{J.error("Failed to share")}},w=()=>{const C=`📝 ${s}
700
701`+c.map(_=>`📍 ${_.name}
702⏰ ${_.time}
703📌 ${_.location}
704ℹ️ ${_.description}
705
706`).join("");/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)&&navigator.share?navigator.share({title:s,text:C}).catch(()=>{navigator.clipboard.writeText(C),J.success("Copied to clipboard!")}):(navigator.clipboard.writeText(C),J.success("Copied to clipboard! Ready to share!"))},x=async()=>{try{await q.from("venues").delete().eq("itinerary_id",e);const{error:C}=await q.from("itineraries").delete().eq("id",e);if(C)throw C;J.success("Plan deleted"),t("/my-plans")}catch(C){console.error("Delete error:",C),J.error("Failed to delete plan")}},S=async()=>{try{const{data:{user:C}}=await q.auth.getUser();if(!C)return;const k=crypto.randomUUID(),{error:_}=await q.from("planning_sessions").insert({id:k,title:s||"Group Planning Session",description:o||void 0,itinerary_id:e,status:"active"});if(_)throw _;const{error:j}=await q.from("planning_participants").insert({session_id:k,user_id:C.id,role:"host"});if(j)throw j;await q.from("itineraries").update({status:"draft"}).eq("id",e),J.success("Created collaborative planning session! Share the link with friends."),t(`/new-plan?session=${k}`)}catch(C){console.error("Error creating session:",C),J.error("Failed to start group session")}};return n?l.jsx(Or,{children:l.jsx("div",{className:"container mx-auto px-4 py-8",children:l.jsxs("div",{className:"animate-pulse space-y-4",children:[l.jsx("div",{className:"h-8 bg-primary/10 rounded w-1/3"}),l.jsx("div",{className:"h-64 bg-primary/5 rounded"})]})})}):l.jsx(Or,{children:l.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8 space-y-6",children:[l.jsxs(de.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"flex items-center justify-between",children:[l.jsxs(Fe,{variant:"ghost",onClick:()=>t("/my-plans"),className:"gap-2 text-muted-foreground hover:text-foreground",children:[l.jsx(d4,{className:"h-4 w-4"}),"Back to My Plans"]}),l.jsxs(si,{children:[l.jsx(eO,{asChild:!0,children:l.jsx(Fe,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",children:l.jsx(NN,{className:"h-4 w-4"})})}
706),l.jsxs(ms,{children:[l.jsxs(gs,{children:[l.jsx(vs,{children:"Delete this plan?"}),l.jsxs(xs,{children:['This will permanently remove "',s,'" and all its venues. This action cannot be undone.']})]}),l.jsxs(ys,{children:[l.jsx(bs,{children:"Cancel"}),l.jsx(ws,{onClick:x,className:"bg-destructive text-destructive-foreground",children:"Delete"})]})]})]})]}),l.jsx(Uw,{venues:c,mode:"saved",utcOffsetMinutes:h,renderFooter:()=>l.jsx(cO,{actions:lO({onShare:y,onShareAsText:w,onPlanTogether:S,isSaved:!0,savedLabel:"Saved"})})}),g.length>0&&l.jsx(die,{participants:g})]})})};function hie(){return m.useEffect(()=>{const e=localStorage.getItem("ezy:theme")||"dark",t=window.matchMedia("(prefers-color-scheme: dark)").matches,n=e==="dark"||e==="system"&&t;document.documentElement.classList.toggle("dark",n)},[]),l.jsxs(mq,{children:[l.jsx(t4,{children:l.jsxs(G5,{children:[l.jsx(ar,{path:"/",element:l.jsx(Iq,{})}),l.jsx(ar,{path:"/new-plan",element:l.jsx(NC,{})}),l.jsx(ar,{path:"/login",element:l.jsx(Ese,{})}),l.jsx(ar,{path:"/profile",element:l.jsx(Tse,{})}),l.jsx(ar,{path:"/settings",element:l.jsx(Ase,{})}),l.jsx(ar,{path:"/shared/:token",element:l.jsx(sie,{})}),l.jsx(ar,{path:"/collaborative",element:l.jsx(pie,{})}),l.jsx(ar,{path:"/plan/new",element:l.jsx(NC,{})}),l.jsx(ar,{path:"/discover",element:l.jsx(lie,{})}),l.jsx(ar,{path:"/my-plans",element:l.jsx(uie,{})}),l.jsx(ar,{path:"/my-plans/:id",element:l.jsx(fie,{})})]})}),l.jsx(Yz,{position:"bottom-right",expand:!0,richColors:!0,closeButton:!0,style:{marginBottom:"1rem",marginRight:"1rem"},toastOptions:{style:{background:"hsl(var(--secondary))",border:"1px solid hsl(var(--border))",color:"hsl(var(--foreground))",fontSize:"0.95rem"},className:"glass-card",duration:4e3}})]})}function pie(){const t=new URLSearchParams(window.location.search).get("session"),n=t?`/new-plan?session=${t}`:"/new-plan";return l.jsx(W5,{to:n,replace:!0})}const RO=document.getElementById("root");if(!RO)throw new Error("Root element not found");_g.createRoot(RO).render(l.jsx($.StrictMode,{children:l.jsx(hie,{})}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{setTimeout(async()=>{try{const e=await navigator.serviceWorker.register("/sw.js",{scope:"/",updateViaCache:"none"});console.log("ServiceWorker registration successful:",e.scope),e.addEventListener("updatefound",()=>{const t=e.installing;t&&t.addEventListener("statechange",()=>{t.state==="installed"&&(console.log("New service worker installed, reloading for fresh content"),window.location.reload())})})}catch(e){console.error("ServiceWorker registration failed:",e)}},2e3)});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.