var e,t,n=Object.defineProperty,r=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=Reflect.get,c=Math.pow,h=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&h(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&h(e,n,t[n]);return e},f=(e,t)=>r(e,i(t)),p=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&l.call(e,r)&&(n[r]=e[r]);return n},m=(e,t,n)=>h(e,"symbol"!=typeof t?t+"":t,n),g=(e,t,n)=>u(o(e),n,t),y=(e,t,n)=>new Promise((r,i)=>{var s=e=>{try{a(n.next(e))}catch(t){i(t)}},o=e=>{try{a(n.throw(e))}catch(t){i(t)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(s,o);a((n=n.apply(e,t)).next())});function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b={exports:{}},w={},k={exports:{}},S={},_=Symbol.for("react.element"),E=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),R=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),j=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),I=Symbol.iterator;var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,M={};function U(e,t,n){this.props=e,this.context=t,this.refs=M,this.updater=n||N}function B(){}function F(e,t,n){this.props=e,this.context=t,this.refs=M,this.updater=n||N}U.prototype.isReactComponent={},U.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)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")},U.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},B.prototype=U.prototype;var V=F.prototype=new B;V.constructor=F,D(V,U.prototype),V.isPureReactComponent=!0;var z=Array.isArray,W=Object.prototype.hasOwnProperty,H={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function K(e,t,n){var r,i={},s=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(s=""+t.key),t)W.call(t,r)&&!q.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(1===a)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===i[r]&&(i[r]=a[r]);return{$$typeof:_,type:e,key:s,ref:o,props:i,_owner:H.current}}function G(e){return"object"==typeof e&&null!==e&&e.$$typeof===_}var J=/\/+/g;function $(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function Y(e,t,n,r,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var o=!1;if(null===e)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case _:case E:o=!0}}if(o)return i=i(o=e),e=""===r?"."+$(o,0):r,z(i)?(n="",null!=e&&(n=e.replace(J,"$&/")+"/"),Y(i,t,n,"",function(e){return e})):null!=i&&(G(i)&&(i=function(e,t){return{$$typeof:_,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(J,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=""===r?".":r+":",z(e))for(var a=0;a<e.length;a++){var l=r+$(s=e[a],a);o+=Y(s,t,n,l,i)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=I&&e[I]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),a=0;!(s=e.next()).done;)o+=Y(s=s.value,t,n,l=r+$(s,a++),i);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function X(e,t,n){if(null==e)return e;var r=[],i=0;return Y(e,r,"","",function(e){return t.call(n,e,i++)}),r}function Q(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var Z={current:null},ee={transition:null},te={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:ee,ReactCurrentOwner:H};function ne(){throw Error("act(...) is not supported in production builds of React.")}S.Children={map:X,forEach:function(e,t,n){X(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return X(e,function(){t++}),t},toArray:function(e){return X(e,function(e){return e})||[]},only:function(e){if(!G(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},S.Component=U,S.Fragment=T,S.Profiler=C,S.PureComponent=F,S.StrictMode=x,S.Suspense=O,S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,S.act=ne,S.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=D({},e.props),i=e.key,s=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,o=H.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)W.call(t,l)&&!q.hasOwnProperty(l)&&(r[l]=void 0===t[l]&&void 0!==a?a[l]:t[l])}var l=arguments.length-2;if(1===l)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:_,type:e.type,key:i,ref:s,props:r,_owner:o}},S.createContext=function(e){return(e={$$typeof:R,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:P,_context:e},e.Consumer=e},S.createElement=K,S.createFactory=function(e){var t=K.bind(null,e);return t.type=e,t},S.createRef=function(){return{current:null}},S.forwardRef=function(e){return{$$typeof:A,render:e}},S.isValidElement=G,S.lazy=function(e){return{$$typeof:L,_payload:{_status:-1,_result:e},_init:Q}},S.memo=function(e,t){return{$$typeof:j,type:e,compare:void 0===t?null:t}},S.startTransition=function(e){var t=ee.transition;ee.transition={};try{e()}finally{ee.transition=t}},S.unstable_act=ne,S.useCallback=function(e,t){return Z.current.useCallback(e,t)},S.useContext=function(e){return Z.current.useContext(e)},S.useDebugValue=function(){},S.useDeferredValue=function(e){return Z.current.useDeferredValue(e)},S.useEffect=function(e,t){return Z.current.useEffect(e,t)},S.useId=function(){return Z.current.useId()},S.useImperativeHandle=function(e,t,n){return Z.current.useImperativeHandle(e,t,n)},S.useInsertionEffect=function(e,t){return Z.current.useInsertionEffect(e,t)},S.useLayoutEffect=function(e,t){return Z.current.useLayoutEffect(e,t)},S.useMemo=function(e,t){return Z.current.useMemo(e,t)},S.useReducer=function(e,t,n){return Z.current.useReducer(e,t,n)},S.useRef=function(e){return Z.current.useRef(e)},S.useState=function(e){return Z.current.useState(e)},S.useSyncExternalStore=function(e,t,n){return Z.current.useSyncExternalStore(e,t,n)},S.useTransition=function(){return Z.current.useTransition()},S.version="18.3.1",k.exports=S;var re=k.exports;const ie=v(re);var se=re,oe=Symbol.for("react.element"),ae=Symbol.for("react.fragment"),le=Object.prototype.hasOwnProperty,ue=se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ce={key:!0,ref:!0,__self:!0,__source:!0};function he(e,t,n){var r,i={},s=null,o=null;for(r in void 0!==n&&(s=""+n),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(o=t.ref),t)le.call(t,r)&&!ce.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:oe,type:e,key:s,ref:o,props:i,_owner:ue.current}}w.Fragment=ae,w.jsx=he,w.jsxs=he,b.exports=w;var de=b.exports,fe={exports:{}},pe={},me={exports:{}},ge={};!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,s=e[r];if(!(0<i(s,t)))break e;e[r]=t,e[n]=s,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,s=e.length,o=s>>>1;r<o;){var a=2*(r+1)-1,l=e[a],u=a+1,c=e[u];if(0>i(l,n))u<s&&0>i(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(u<s&&0>i(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,h=null,d=3,f=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var i=n(u);null!==i;){if(null===i.callback)r(u);else{if(!(i.startTime<=e))break;r(u),i.sortIndex=i.expirationTime,t(l,i)}i=n(u)}}function w(e){if(m=!1,b(e),!p)if(null!==n(l))p=!0,j(k);else{var t=n(u);null!==t&&L(w,t.startTime-e)}}function k(t,i){p=!1,m&&(m=!1,y(T),T=-1),f=!0;var s=d;try{for(b(i),h=n(l);null!==h&&(!(h.expirationTime>i)||t&&!P());){var o=h.callback;if("function"==typeof o){h.callback=null,d=h.priorityLevel;var a=o(h.expirationTime<=i);i=e.unstable_now(),"function"==typeof a?h.callback=a:h===n(l)&&r(l),b(i)}else r(l);h=n(l)}if(null!==h)var c=!0;else{var g=n(u);null!==g&&L(w,g.startTime-i),c=!1}return c}finally{h=null,d=s,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,_=!1,E=null,T=-1,x=5,C=-1;function P(){return!(e.unstable_now()-C<x)}function R(){if(null!==E){var t=e.unstable_now();C=t;var n=!0;try{n=E(!0,t)}finally{n?S():(_=!1,E=null)}}else _=!1}if("function"==typeof v)S=function(){v(R)};else if("undefined"!=typeof MessageChannel){var A=new MessageChannel,O=A.port2;A.port1.onmessage=R,S=function(){O.postMessage(null)}}else S=function(){g(R,0)};function j(e){E=e,_||(_=!0,S())}function L(t,n){T=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||f||(p=!0,j(k))},e.unstable_forceFrameRate=function(e){0>e||125<e||(x=0<e?Math.floor(1e3/e):5)},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(d){case 1:case 2:case 3:var t=3;break;default:t=d}var n=d;d=t;try{return e()}finally{d=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=d;d=e;try{return t()}finally{d=n}},e.unstable_scheduleCallback=function(r,i,s){var o=e.unstable_now();switch("object"==typeof s&&null!==s?s="number"==typeof(s=s.delay)&&0<s?o+s:o:s=o,r){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return r={id:c++,callback:i,priorityLevel:r,startTime:s,expirationTime:a=s+a,sortIndex:-1},s>o?(r.sortIndex=s,t(u,r),null===n(l)&&r===n(u)&&(m?(y(T),T=-1):m=!0,L(w,s-o))):(r.sortIndex=a,t(l,r),p||f||(p=!0,j(k))),r},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(e){var t=d;return function(){var n=d;d=t;try{return e.apply(this,arguments)}finally{d=n}}}}(ge),me.exports=ge;var ye=me.exports,ve=re,be=ye;function we(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."}var ke=new Set,Se={};function _e(e,t){Ee(e,t),Ee(e+"Capture",t)}function Ee(e,t){for(Se[e]=t,e=0;e<t.length;e++)ke.add(t[e])}var Te=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),xe=Object.prototype.hasOwnProperty,Ce=/^[: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]*$/,Pe={},Re={};function Ae(e,t,n,r,i,s,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Oe[e]=new Ae(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Oe[t]=new Ae(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Oe[e]=new Ae(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Oe[e]=new Ae(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){Oe[e]=new Ae(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Oe[e]=new Ae(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Oe[e]=new Ae(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Oe[e]=new Ae(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Oe[e]=new Ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var je=/[\-:]([a-z])/g;function Le(e){return e[1].toUpperCase()}function Ie(e,t,n,r){var i=Oe.hasOwnProperty(t)?Oe[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!xe.call(Re,e)||!xe.call(Pe,e)&&(Ce.test(e)?Re[e]=!0:(Pe[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"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(je,Le);Oe[t]=new Ae(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(je,Le);Oe[t]=new Ae(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(je,Le);Oe[t]=new Ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Oe[e]=new Ae(e,1,!1,e.toLowerCase(),null,!1,!1)}),Oe.xlinkHref=new Ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Oe[e]=new Ae(e,1,!1,e.toLowerCase(),null,!0,!0)});var Ne=ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,De=Symbol.for("react.element"),Me=Symbol.for("react.portal"),Ue=Symbol.for("react.fragment"),Be=Symbol.for("react.strict_mode"),Fe=Symbol.for("react.profiler"),Ve=Symbol.for("react.provider"),ze=Symbol.for("react.context"),We=Symbol.for("react.forward_ref"),He=Symbol.for("react.suspense"),qe=Symbol.for("react.suspense_list"),Ke=Symbol.for("react.memo"),Ge=Symbol.for("react.lazy"),Je=Symbol.for("react.offscreen"),$e=Symbol.iterator;function Ye(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=$e&&e[$e]||e["@@iterator"])?e:null}var Xe,Qe=Object.assign;function Ze(e){if(void 0===Xe)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Xe=t&&t[1]||""}return"\n"+Xe+e}var et=!1;function tt(e,t){if(!e||et)return"";et=!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()}}),"object"==typeof Reflect&&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&&"string"==typeof u.stack){for(var i=u.stack.split("\n"),s=r.stack.split("\n"),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(1!==o||1!==a)do{if(o--,0>--a||i[o]!==s[a]){var l="\n"+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=o&&0<=a);break}}}finally{et=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ze(e):""}function nt(e){switch(e.tag){case 5:return Ze(e.type);case 16:return Ze("Lazy");case 13:return Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 2:case 15:return e=tt(e.type,!1);case 11:return e=tt(e.type.render,!1);case 1:return e=tt(e.type,!0);default:return""}}function rt(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case Ue:return"Fragment";case Me:return"Portal";case Fe:return"Profiler";case Be:return"StrictMode";case He:return"Suspense";case qe:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ze:return(e.displayName||"Context")+".Consumer";case Ve:return(e._context.displayName||"Context")+".Provider";case We:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case Ke:return null!==(t=e.displayName||null)?t:rt(e.type)||"Memo";case Ge:t=e._payload,e=e._init;try{return rt(e(t))}catch(n){}}return null}function it(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=(e=t.render).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 rt(t);case 8:return t===Be?"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("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function st(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ot(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function at(e){e._valueTracker||(e._valueTracker=function(e){var t=ot(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ot(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function ut(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function ct(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ht(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=st(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function dt(e,t){null!=(t=t.checked)&&Ie(e,"checked",t,!1)}function ft(e,t){dt(e,t);var n=st(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?mt(e,t.type,n):t.hasOwnProperty("defaultValue")&&mt(e,t.type,st(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function pt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function mt(e,t,n){"number"===t&&ut(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gt=Array.isArray;function yt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+st(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function vt(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(we(91));return Qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function bt(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(we(92));if(gt(n)){if(1<n.length)throw Error(we(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:st(n)}}function wt(e,t){var n=st(t.value),r=st(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function kt(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function St(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 _t(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?St(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Et,Tt,xt=(Tt=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((Et=Et||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Et.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Tt(e,t)})}:Tt);function Ct(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Pt={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},Rt=["Webkit","ms","Moz","O"];function At(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Pt.hasOwnProperty(e)&&Pt[e]?(""+t).trim():t+"px"}function Ot(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=At(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(Pt).forEach(function(e){Rt.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pt[t]=Pt[e]})});var jt=Qe({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 Lt(e,t){if(t){if(jt[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(we(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(we(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(we(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(we(62))}}function It(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;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 Nt=null;function Dt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Mt=null,Ut=null,Bt=null;function Ft(e){if(e=Is(e)){if("function"!=typeof Mt)throw Error(we(280));var t=e.stateNode;t&&(t=Ds(t),Mt(e.stateNode,e.type,t))}}function Vt(e){Ut?Bt?Bt.push(e):Bt=[e]:Ut=e}function zt(){if(Ut){var e=Ut,t=Bt;if(Bt=Ut=null,Ft(e),t)for(e=0;e<t.length;e++)Ft(t[e])}}function Wt(e,t){return e(t)}function Ht(){}var qt=!1;function Kt(e,t,n){if(qt)return e(t,n);qt=!0;try{return Wt(e,t,n)}finally{qt=!1,(null!==Ut||null!==Bt)&&(Ht(),zt())}}function Gt(e,t){var n=e.stateNode;if(null===n)return null;var r=Ds(n);if(null===r)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)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(we(231,t,typeof n));return n}var Jt=!1;if(Te)try{var $t={};Object.defineProperty($t,"passive",{get:function(){Jt=!0}}),window.addEventListener("test",$t,$t),window.removeEventListener("test",$t,$t)}catch(Tt){Jt=!1}function Yt(e,t,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Xt=!1,Qt=null,Zt=!1,en=null,tn={onError:function(e){Xt=!0,Qt=e}};function nn(e,t,n,r,i,s,o,a,l){Xt=!1,Qt=null,Yt.apply(tn,arguments)}function rn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function sn(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function on(e){if(rn(e)!==e)throw Error(we(188))}function an(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=rn(e)))throw Error(we(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(r=i.return)){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return on(i),e;if(s===r)return on(i),t;s=s.sibling}throw Error(we(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,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){for(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)throw Error(we(189))}}if(n.alternate!==r)throw Error(we(190))}if(3!==n.tag)throw Error(we(188));return n.stateNode.current===n?e:t}(e))?ln(e):null}function ln(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=ln(e);if(null!==t)return t;e=e.sibling}return null}var un=be.unstable_scheduleCallback,cn=be.unstable_cancelCallback,hn=be.unstable_shouldYield,dn=be.unstable_requestPaint,fn=be.unstable_now,pn=be.unstable_getCurrentPriorityLevel,mn=be.unstable_ImmediatePriority,gn=be.unstable_UserBlockingPriority,yn=be.unstable_NormalPriority,vn=be.unstable_LowPriority,bn=be.unstable_IdlePriority,wn=null,kn=null;var Sn=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(_n(e)/En|0)|0},_n=Math.log,En=Math.LN2;var Tn=64,xn=4194304;function Cn(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pn(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=268435455&n;if(0!==o){var a=o&~i;0!==a?r=Cn(a):0!==(s&=o)&&(r=Cn(s))}else 0!==(o=n&~i)?r=Cn(o):0!==s&&(r=Cn(s));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(s=t&-t)||16===i&&4194240&s))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-Sn(t)),r|=e[n],t&=~i;return r}function Rn(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;default:return-1}}function An(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function On(){var e=Tn;return!(4194240&(Tn<<=1))&&(Tn=64),e}function jn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ln(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-Sn(t)]=n}function In(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Sn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Nn=0;function Dn(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var Mn,Un,Bn,Fn,Vn,zn=!1,Wn=[],Hn=null,qn=null,Kn=null,Gn=new Map,Jn=new Map,$n=[],Yn="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 Xn(e,t){switch(e){case"focusin":case"focusout":Hn=null;break;case"dragenter":case"dragleave":qn=null;break;case"mouseover":case"mouseout":Kn=null;break;case"pointerover":case"pointerout":Gn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jn.delete(t.pointerId)}}function Qn(e,t,n,r,i,s){return null===e||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},null!==t&&(null!==(t=Is(t))&&Un(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Zn(e){var t=Ls(e.target);if(null!==t){var n=rn(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=sn(n)))return e.blockedOn=t,void Vn(e.priority,function(){Bn(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function er(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=hr(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=Is(n))&&Un(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);Nt=r,n.target.dispatchEvent(r),Nt=null,t.shift()}return!0}function tr(e,t,n){er(e)&&n.delete(t)}function nr(){zn=!1,null!==Hn&&er(Hn)&&(Hn=null),null!==qn&&er(qn)&&(qn=null),null!==Kn&&er(Kn)&&(Kn=null),Gn.forEach(tr),Jn.forEach(tr)}function rr(e,t){e.blockedOn===t&&(e.blockedOn=null,zn||(zn=!0,be.unstable_scheduleCallback(be.unstable_NormalPriority,nr)))}function ir(e){function t(t){return rr(t,e)}if(0<Wn.length){rr(Wn[0],e);for(var n=1;n<Wn.length;n++){var r=Wn[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Hn&&rr(Hn,e),null!==qn&&rr(qn,e),null!==Kn&&rr(Kn,e),Gn.forEach(t),Jn.forEach(t),n=0;n<$n.length;n++)(r=$n[n]).blockedOn===e&&(r.blockedOn=null);for(;0<$n.length&&null===(n=$n[0]).blockedOn;)Zn(n),null===n.blockedOn&&$n.shift()}var sr=Ne.ReactCurrentBatchConfig,or=!0;function ar(e,t,n,r){var i=Nn,s=sr.transition;sr.transition=null;try{Nn=1,ur(e,t,n,r)}finally{Nn=i,sr.transition=s}}function lr(e,t,n,r){var i=Nn,s=sr.transition;sr.transition=null;try{Nn=4,ur(e,t,n,r)}finally{Nn=i,sr.transition=s}}function ur(e,t,n,r){if(or){var i=hr(e,t,n,r);if(null===i)ss(e,t,r,cr,n),Xn(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Hn=Qn(Hn,e,t,n,r,i),!0;case"dragenter":return qn=Qn(qn,e,t,n,r,i),!0;case"mouseover":return Kn=Qn(Kn,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Gn.set(s,Qn(Gn.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Jn.set(s,Qn(Jn.get(s)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Xn(e,r),4&t&&-1<Yn.indexOf(e)){for(;null!==i;){var s=Is(i);if(null!==s&&Mn(s),null===(s=hr(e,t,n,r))&&ss(e,t,r,cr,n),s===i)break;i=s}null!==i&&r.stopPropagation()}else ss(e,t,r,null,n)}}var cr=null;function hr(e,t,n,r){if(cr=null,null!==(e=Ls(e=Dt(r))))if(null===(t=rn(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=sn(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return cr=e,null}function dr(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(pn()){case mn:return 1;case gn:return 4;case yn:case vn:return 16;case bn:return 536870912;default:return 16}default:return 16}}var fr=null,pr=null,mr=null;function gr(){if(mr)return mr;var e,t,n=pr,r=n.length,i="value"in fr?fr.value:fr.textContent,s=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[s-t];t++);return mr=i.slice(e,1<t?1-t:void 0)}function yr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function vr(){return!0}function br(){return!1}function wr(e){function t(t,n,r,i,s){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?vr:br,this.isPropagationStopped=br,this}return Qe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=vr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=vr)},persist:function(){},isPersistent:vr}),t}var kr,Sr,_r,Er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tr=wr(Er),xr=Qe({},Er,{view:0,detail:0}),Cr=wr(xr),Pr=Qe({},xr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==_r&&(_r&&"mousemove"===e.type?(kr=e.screenX-_r.screenX,Sr=e.screenY-_r.screenY):Sr=kr=0,_r=e),kr)},movementY:function(e){return"movementY"in e?e.movementY:Sr}}),Rr=wr(Pr),Ar=wr(Qe({},Pr,{dataTransfer:0})),Or=wr(Qe({},xr,{relatedTarget:0})),jr=wr(Qe({},Er,{animationName:0,elapsedTime:0,pseudoElement:0})),Lr=Qe({},Er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ir=wr(Lr),Nr=wr(Qe({},Er,{data:0})),Dr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mr={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"},Ur={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Br(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Ur[e])&&!!t[e]}function Fr(){return Br}var Vr=Qe({},xr,{key:function(e){if(e.key){var t=Dr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=yr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Mr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fr,charCode:function(e){return"keypress"===e.type?yr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?yr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),zr=wr(Vr),Wr=wr(Qe({},Pr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hr=wr(Qe({},xr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fr})),qr=wr(Qe({},Er,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kr=Qe({},Pr,{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}),Gr=wr(Kr),Jr=[9,13,27,32],$r=Te&&"CompositionEvent"in window,Yr=null;Te&&"documentMode"in document&&(Yr=document.documentMode);var Xr=Te&&"TextEvent"in window&&!Yr,Qr=Te&&(!$r||Yr&&8<Yr&&11>=Yr),Zr=String.fromCharCode(32),ei=!1;function ti(e,t){switch(e){case"keyup":return-1!==Jr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ni(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ri=!1;var ii={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 si(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ii[e.type]:"textarea"===t}function oi(e,t,n,r){Vt(r),0<(t=as(t,"onChange")).length&&(n=new Tr("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ai=null,li=null;function ui(e){Zi(e,0)}function ci(e){if(lt(Ns(e)))return e}function hi(e,t){if("change"===e)return t}var di=!1;if(Te){var fi;if(Te){var pi="oninput"in document;if(!pi){var mi=document.createElement("div");mi.setAttribute("oninput","return;"),pi="function"==typeof mi.oninput}fi=pi}else fi=!1;di=fi&&(!document.documentMode||9<document.documentMode)}function gi(){ai&&(ai.detachEvent("onpropertychange",yi),li=ai=null)}function yi(e){if("value"===e.propertyName&&ci(li)){var t=[];oi(t,li,e,Dt(e)),Kt(ui,t)}}function vi(e,t,n){"focusin"===e?(gi(),li=n,(ai=t).attachEvent("onpropertychange",yi)):"focusout"===e&&gi()}function bi(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return ci(li)}function wi(e,t){if("click"===e)return ci(t)}function ki(e,t){if("input"===e||"change"===e)return ci(t)}var Si="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function _i(e,t){if(Si(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!xe.call(t,i)||!Si(e[i],t[i]))return!1}return!0}function Ei(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ti(e,t){var n,r=Ei(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ei(r)}}function xi(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?xi(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ci(){for(var e=window,t=ut();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=ut((e=t.contentWindow).document)}return t}function Pi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function Ri(e){var t=Ci(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&xi(n.ownerDocument.documentElement,n)){if(null!==r&&Pi(n))if(t=r.start,void 0===(e=r.end)&&(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).getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=void 0===r.end?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Ti(n,s);var o=Ti(n,r);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),s>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;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ai=Te&&"documentMode"in document&&11>=document.documentMode,Oi=null,ji=null,Li=null,Ii=!1;function Ni(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;Ii||null==Oi||Oi!==ut(r)||("selectionStart"in(r=Oi)&&Pi(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Li&&_i(Li,r)||(Li=r,0<(r=as(ji,"onSelect")).length&&(t=new Tr("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Oi)))}function Di(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Mi={animationend:Di("Animation","AnimationEnd"),animationiteration:Di("Animation","AnimationIteration"),animationstart:Di("Animation","AnimationStart"),transitionend:Di("Transition","TransitionEnd")},Ui={},Bi={};function Fi(e){if(Ui[e])return Ui[e];if(!Mi[e])return e;var t,n=Mi[e];for(t in n)if(n.hasOwnProperty(t)&&t in Bi)return Ui[e]=n[t];return e}Te&&(Bi=document.createElement("div").style,"AnimationEvent"in window||(delete Mi.animationend.animation,delete Mi.animationiteration.animation,delete Mi.animationstart.animation),"TransitionEvent"in window||delete Mi.transitionend.transition);var Vi=Fi("animationend"),zi=Fi("animationiteration"),Wi=Fi("animationstart"),Hi=Fi("transitionend"),qi=new Map,Ki="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 Gi(e,t){qi.set(e,t),_e(t,[e])}for(var Ji=0;Ji<Ki.length;Ji++){var $i=Ki[Ji];Gi($i.toLowerCase(),"on"+($i[0].toUpperCase()+$i.slice(1)))}Gi(Vi,"onAnimationEnd"),Gi(zi,"onAnimationIteration"),Gi(Wi,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(Hi,"onTransitionEnd"),Ee("onMouseEnter",["mouseout","mouseover"]),Ee("onMouseLeave",["mouseout","mouseover"]),Ee("onPointerEnter",["pointerout","pointerover"]),Ee("onPointerLeave",["pointerout","pointerover"]),_e("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_e("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_e("onBeforeInput",["compositionend","keypress","textInput","paste"]),_e("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_e("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_e("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yi="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(" "),Xi=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yi));function Qi(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,s,o,a,l){if(nn.apply(this,arguments),Xt){if(!Xt)throw Error(we(198));var u=Qt;Xt=!1,Qt=null,Zt||(Zt=!0,en=u)}}(r,t,void 0,e),e.currentTarget=null}function Zi(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Qi(i,a,u),s=l}else for(o=0;o<r.length;o++){if(l=(a=r[o]).instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Qi(i,a,u),s=l}}}if(Zt)throw e=en,Zt=!1,en=null,e}function es(e,t){var n=t[As];void 0===n&&(n=t[As]=new Set);var r=e+"__bubble";n.has(r)||(is(t,e,2,!1),n.add(r))}function ts(e,t,n){var r=0;t&&(r|=4),is(n,e,r,t)}var ns="_reactListening"+Math.random().toString(36).slice(2);function rs(e){if(!e[ns]){e[ns]=!0,ke.forEach(function(t){"selectionchange"!==t&&(Xi.has(t)||ts(t,!1,e),ts(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[ns]||(t[ns]=!0,ts("selectionchange",!1,t))}}function is(e,t,n,r){switch(dr(t)){case 1:var i=ar;break;case 4:i=lr;break;default:i=ur}n=i.bind(null,t,n,e),i=void 0,!Jt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ss(e,t,n,r,i){var s=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==a;){if(null===(o=Ls(a)))return;if(5===(l=o.tag)||6===l){r=s=o;continue e}a=a.parentNode}}r=r.return}Kt(function(){var r=s,i=Dt(n),o=[];e:{var a=qi.get(e);if(void 0!==a){var l=Tr,u=e;switch(e){case"keypress":if(0===yr(n))break e;case"keydown":case"keyup":l=zr;break;case"focusin":u="focus",l=Or;break;case"focusout":u="blur",l=Or;break;case"beforeblur":case"afterblur":l=Or;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=Rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=Ar;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Hr;break;case Vi:case zi:case Wi:l=jr;break;case Hi:l=qr;break;case"scroll":l=Cr;break;case"wheel":l=Gr;break;case"copy":case"cut":case"paste":l=Ir;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Wr}var c=!!(4&t),h=!c&&"scroll"===e,d=c?null!==a?a+"Capture":null:a;c=[];for(var f,p=r;null!==p;){var m=(f=p).stateNode;if(5===f.tag&&null!==m&&(f=m,null!==d&&(null!=(m=Gt(p,d))&&c.push(os(p,m,f)))),h)break;p=p.return}0<c.length&&(a=new l(a,u,null,n,i),o.push({event:a,listeners:c}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===Nt||!(u=n.relatedTarget||n.fromElement)||!Ls(u)&&!u[Rs])&&(l||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?Ls(u):null)&&(u!==(h=rn(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=Rr,m="onMouseLeave",d="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(c=Wr,m="onPointerLeave",d="onPointerEnter",p="pointer"),h=null==l?a:Ns(l),f=null==u?a:Ns(u),(a=new c(m,p+"leave",l,n,i)).target=h,a.relatedTarget=f,m=null,Ls(i)===r&&((c=new c(d,p+"enter",u,n,i)).target=f,c.relatedTarget=h,m=c),h=m,l&&u)e:{for(d=u,p=0,f=c=l;f;f=ls(f))p++;for(f=0,m=d;m;m=ls(m))f++;for(;0<p-f;)c=ls(c),p--;for(;0<f-p;)d=ls(d),f--;for(;p--;){if(c===d||null!==d&&c===d.alternate)break e;c=ls(c),d=ls(d)}c=null}else c=null;null!==l&&us(o,a,l,c,!1),null!==u&&null!==h&&us(o,h,u,c,!0)}if("select"===(l=(a=r?Ns(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===l&&"file"===a.type)var g=hi;else if(si(a))if(di)g=ki;else{g=bi;var y=vi}else(l=a.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(g=wi);switch(g&&(g=g(e,r))?oi(o,g,n,i):(y&&y(e,a,r),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&mt(a,"number",a.value)),y=r?Ns(r):window,e){case"focusin":(si(y)||"true"===y.contentEditable)&&(Oi=y,ji=r,Li=null);break;case"focusout":Li=ji=Oi=null;break;case"mousedown":Ii=!0;break;case"contextmenu":case"mouseup":case"dragend":Ii=!1,Ni(o,n,i);break;case"selectionchange":if(Ai)break;case"keydown":case"keyup":Ni(o,n,i)}var v;if($r)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else ri?ti(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Qr&&"ko"!==n.locale&&(ri||"onCompositionStart"!==b?"onCompositionEnd"===b&&ri&&(v=gr()):(pr="value"in(fr=i)?fr.value:fr.textContent,ri=!0)),0<(y=as(r,b)).length&&(b=new Nr(b,e,null,n,i),o.push({event:b,listeners:y}),v?b.data=v:null!==(v=ni(n))&&(b.data=v))),(v=Xr?function(e,t){switch(e){case"compositionend":return ni(t);case"keypress":return 32!==t.which?null:(ei=!0,Zr);case"textInput":return(e=t.data)===Zr&&ei?null:e;default:return null}}(e,n):function(e,t){if(ri)return"compositionend"===e||!$r&&ti(e,t)?(e=gr(),mr=pr=fr=null,ri=!1,e):null;switch(e){case"paste":default: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 Qr&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=as(r,"onBeforeInput")).length&&(i=new Nr("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=v))}Zi(o,t)})}function os(e,t,n){return{instance:e,listener:t,currentTarget:n}}function as(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,s=i.stateNode;5===i.tag&&null!==s&&(i=s,null!=(s=Gt(e,n))&&r.unshift(os(e,s,i)),null!=(s=Gt(e,t))&&r.push(os(e,s,i))),e=e.return}return r}function ls(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function us(e,t,n,r,i){for(var s=t._reactName,o=[];null!==n&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(null!==l&&l===r)break;5===a.tag&&null!==u&&(a=u,i?null!=(l=Gt(n,s))&&o.unshift(os(n,l,a)):i||null!=(l=Gt(n,s))&&o.push(os(n,l,a))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var cs=/\r\n?/g,hs=/\u0000|\uFFFD/g;function ds(e){return("string"==typeof e?e:""+e).replace(cs,"\n").replace(hs,"")}function fs(e,t,n){if(t=ds(t),ds(e)!==t&&n)throw Error(we(425))}function ps(){}var ms=null,gs=null;function ys(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var vs="function"==typeof setTimeout?setTimeout:void 0,bs="function"==typeof clearTimeout?clearTimeout:void 0,ws="function"==typeof Promise?Promise:void 0,ks="function"==typeof queueMicrotask?queueMicrotask:void 0!==ws?function(e){return ws.resolve(null).then(e).catch(Ss)}:vs;function Ss(e){setTimeout(function(){throw e})}function _s(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void ir(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);ir(t)}function Es(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function Ts(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var xs=Math.random().toString(36).slice(2),Cs="__reactFiber$"+xs,Ps="__reactProps$"+xs,Rs="__reactContainer$"+xs,As="__reactEvents$"+xs,Os="__reactListeners$"+xs,js="__reactHandles$"+xs;function Ls(e){var t=e[Cs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Rs]||n[Cs]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Ts(e);null!==e;){if(n=e[Cs])return n;e=Ts(e)}return t}n=(e=n).parentNode}return null}function Is(e){return!(e=e[Cs]||e[Rs])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Ns(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(we(33))}function Ds(e){return e[Ps]||null}var Ms=[],Us=-1;function Bs(e){return{current:e}}function Fs(e){0>Us||(e.current=Ms[Us],Ms[Us]=null,Us--)}function Vs(e,t){Us++,Ms[Us]=e.current,e.current=t}var zs={},Ws=Bs(zs),Hs=Bs(!1),qs=zs;function Ks(e,t){var n=e.type.contextTypes;if(!n)return zs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in n)s[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Gs(e){return null!=(e=e.childContextTypes)}function Js(){Fs(Hs),Fs(Ws)}function $s(e,t,n){if(Ws.current!==zs)throw Error(we(168));Vs(Ws,t),Vs(Hs,n)}function Ys(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(we(108,it(e)||"Unknown",i));return Qe({},n,r)}function Xs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zs,qs=Ws.current,Vs(Ws,e),Vs(Hs,Hs.current),!0}function Qs(e,t,n){var r=e.stateNode;if(!r)throw Error(we(169));n?(e=Ys(e,t,qs),r.__reactInternalMemoizedMergedChildContext=e,Fs(Hs),Fs(Ws),Vs(Ws,e)):Fs(Hs),Vs(Hs,n)}var Zs=null,eo=!1,to=!1;function no(e){null===Zs?Zs=[e]:Zs.push(e)}function ro(){if(!to&&null!==Zs){to=!0;var e=0,t=Nn;try{var n=Zs;for(Nn=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Zs=null,eo=!1}catch(i){throw null!==Zs&&(Zs=Zs.slice(e+1)),un(mn,ro),i}finally{Nn=t,to=!1}}return null}var io=[],so=0,oo=null,ao=0,lo=[],uo=0,co=null,ho=1,fo="";function po(e,t){io[so++]=ao,io[so++]=oo,oo=e,ao=t}function mo(e,t,n){lo[uo++]=ho,lo[uo++]=fo,lo[uo++]=co,co=e;var r=ho;e=fo;var i=32-Sn(r)-1;r&=~(1<<i),n+=1;var s=32-Sn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ho=1<<32-Sn(t)+i|n<<i|r,fo=s+e}else ho=1<<s|n<<i|r,fo=e}function go(e){null!==e.return&&(po(e,1),mo(e,1,0))}function yo(e){for(;e===oo;)oo=io[--so],io[so]=null,ao=io[--so],io[so]=null;for(;e===co;)co=lo[--uo],lo[uo]=null,fo=lo[--uo],lo[uo]=null,ho=lo[--uo],lo[uo]=null}var vo=null,bo=null,wo=!1,ko=null;function So(e,t){var n=qc(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function _o(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,vo=e,bo=Es(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,vo=e,bo=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==co?{id:ho,overflow:fo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=qc(18,null,null,0)).stateNode=t,n.return=e,e.child=n,vo=e,bo=null,!0);default:return!1}}function Eo(e){return!(!(1&e.mode)||128&e.flags)}function To(e){if(wo){var t=bo;if(t){var n=t;if(!_o(e,t)){if(Eo(e))throw Error(we(418));t=Es(n.nextSibling);var r=vo;t&&_o(e,t)?So(r,n):(e.flags=-4097&e.flags|2,wo=!1,vo=e)}}else{if(Eo(e))throw Error(we(418));e.flags=-4097&e.flags|2,wo=!1,vo=e}}}function xo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;vo=e}function Co(e){if(e!==vo)return!1;if(!wo)return xo(e),wo=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ys(e.type,e.memoizedProps)),t&&(t=bo)){if(Eo(e))throw Po(),Error(we(418));for(;t;)So(e,t),t=Es(t.nextSibling)}if(xo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(we(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){bo=Es(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}bo=null}}else bo=vo?Es(e.stateNode.nextSibling):null;return!0}function Po(){for(var e=bo;e;)e=Es(e.nextSibling)}function Ro(){bo=vo=null,wo=!1}function Ao(e){null===ko?ko=[e]:ko.push(e)}var Oo=Ne.ReactCurrentBatchConfig;function jo(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(we(309));var r=n.stateNode}if(!r)throw Error(we(147,e));var i=r,s=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===s?t.ref:((t=function(e){var t=i.refs;null===e?delete t[s]:t[s]=e})._stringRef=s,t)}if("string"!=typeof e)throw Error(we(284));if(!n._owner)throw Error(we(290,e))}return e}function Lo(e,t){throw e=Object.prototype.toString.call(t),Error(we(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Io(e){return(0,e._init)(e._payload)}function No(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Gc(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function a(e,t,n,r){return null===t||6!==t.tag?((t=Xc(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function l(e,t,n,r){var s=n.type;return s===Ue?c(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===s||"object"==typeof s&&null!==s&&s.$$typeof===Ge&&Io(s)===t.type)?((r=i(t,n.props)).ref=jo(e,t,n),r.return=e,r):((r=Jc(n.type,n.key,n.props,null,e.mode,r)).ref=jo(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qc(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function c(e,t,n,r,s){return null===t||7!==t.tag?((t=$c(n,e.mode,r,s)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Xc(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case De:return(n=Jc(t.type,t.key,t.props,null,e.mode,n)).ref=jo(e,null,t),n.return=e,n;case Me:return(t=Qc(t,e.mode,n)).return=e,t;case Ge:return h(e,(0,t._init)(t._payload),n)}if(gt(t)||Ye(t))return(t=$c(t,e.mode,n,null)).return=e,t;Lo(e,t)}return null}function d(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:a(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case De:return n.key===i?l(e,t,n,r):null;case Me:return n.key===i?u(e,t,n,r):null;case Ge:return d(e,t,(i=n._init)(n._payload),r)}if(gt(n)||Ye(n))return null!==i?null:c(e,t,n,r,null);Lo(e,n)}return null}function f(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return a(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case De:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i);case Me:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case Ge:return f(e,t,n,(0,r._init)(r._payload),i)}if(gt(r)||Ye(r))return c(t,e=e.get(n)||null,r,i,null);Lo(t,r)}return null}return function a(l,u,c,p){if("object"==typeof c&&null!==c&&c.type===Ue&&null===c.key&&(c=c.props.children),"object"==typeof c&&null!==c){switch(c.$$typeof){case De:e:{for(var m=c.key,g=u;null!==g;){if(g.key===m){if((m=c.type)===Ue){if(7===g.tag){n(l,g.sibling),(u=i(g,c.props.children)).return=l,l=u;break e}}else if(g.elementType===m||"object"==typeof m&&null!==m&&m.$$typeof===Ge&&Io(m)===g.type){n(l,g.sibling),(u=i(g,c.props)).ref=jo(l,g,c),u.return=l,l=u;break e}n(l,g);break}t(l,g),g=g.sibling}c.type===Ue?((u=$c(c.props.children,l.mode,p,c.key)).return=l,l=u):((p=Jc(c.type,c.key,c.props,null,l.mode,p)).ref=jo(l,u,c),p.return=l,l=p)}return o(l);case Me:e:{for(g=c.key;null!==u;){if(u.key===g){if(4===u.tag&&u.stateNode.containerInfo===c.containerInfo&&u.stateNode.implementation===c.implementation){n(l,u.sibling),(u=i(u,c.children||[])).return=l,l=u;break e}n(l,u);break}t(l,u),u=u.sibling}(u=Qc(c,l.mode,p)).return=l,l=u}return o(l);case Ge:return a(l,u,(g=c._init)(c._payload),p)}if(gt(c))return function(i,o,a,l){for(var u=null,c=null,p=o,m=o=0,g=null;null!==p&&m<a.length;m++){p.index>m?(g=p,p=null):g=p.sibling;var y=d(i,p,a[m],l);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(i,p),o=s(y,o,m),null===c?u=y:c.sibling=y,c=y,p=g}if(m===a.length)return n(i,p),wo&&po(i,m),u;if(null===p){for(;m<a.length;m++)null!==(p=h(i,a[m],l))&&(o=s(p,o,m),null===c?u=p:c.sibling=p,c=p);return wo&&po(i,m),u}for(p=r(i,p);m<a.length;m++)null!==(g=f(p,i,m,a[m],l))&&(e&&null!==g.alternate&&p.delete(null===g.key?m:g.key),o=s(g,o,m),null===c?u=g:c.sibling=g,c=g);return e&&p.forEach(function(e){return t(i,e)}),wo&&po(i,m),u}(l,u,c,p);if(Ye(c))return function(i,o,a,l){var u=Ye(a);if("function"!=typeof u)throw Error(we(150));if(null==(a=u.call(a)))throw Error(we(151));for(var c=u=null,p=o,m=o=0,g=null,y=a.next();null!==p&&!y.done;m++,y=a.next()){p.index>m?(g=p,p=null):g=p.sibling;var v=d(i,p,y.value,l);if(null===v){null===p&&(p=g);break}e&&p&&null===v.alternate&&t(i,p),o=s(v,o,m),null===c?u=v:c.sibling=v,c=v,p=g}if(y.done)return n(i,p),wo&&po(i,m),u;if(null===p){for(;!y.done;m++,y=a.next())null!==(y=h(i,y.value,l))&&(o=s(y,o,m),null===c?u=y:c.sibling=y,c=y);return wo&&po(i,m),u}for(p=r(i,p);!y.done;m++,y=a.next())null!==(y=f(p,i,m,y.value,l))&&(e&&null!==y.alternate&&p.delete(null===y.key?m:y.key),o=s(y,o,m),null===c?u=y:c.sibling=y,c=y);return e&&p.forEach(function(e){return t(i,e)}),wo&&po(i,m),u}(l,u,c,p);Lo(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c?(c=""+c,null!==u&&6===u.tag?(n(l,u.sibling),(u=i(u,c)).return=l,l=u):(n(l,u),(u=Xc(c,l.mode,p)).return=l,l=u),o(l)):n(l,u)}}var Do=No(!0),Mo=No(!1),Uo=Bs(null),Bo=null,Fo=null,Vo=null;function zo(){Vo=Fo=Bo=null}function Wo(e){var t=Uo.current;Fs(Uo),e._currentValue=t}function Ho(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function qo(e,t){Bo=e,Vo=Fo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Ll=!0),e.firstContext=null)}function Ko(e){var t=e._currentValue;if(Vo!==e)if(e={context:e,memoizedValue:t,next:null},null===Fo){if(null===Bo)throw Error(we(308));Fo=e,Bo.dependencies={lanes:0,firstContext:e}}else Fo=Fo.next=e;return t}var Go=null;function Jo(e){null===Go?Go=[e]:Go.push(e)}function $o(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Jo(t)):(n.next=i.next,i.next=n),t.interleaved=n,Yo(e,r)}function Yo(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Xo=!1;function Qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zo(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 ea(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ta(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&zu){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Yo(e,n)}return null===(i=r.interleaved)?(t.next=t,Jo(r)):(t.next=i.next,i.next=t),r.interleaved=t,Yo(e,n)}function na(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,In(e,n)}}function ra(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ia(e,t,n,r){var i=e.updateQueue;Xo=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var l=a,u=l.next;l.next=null,null===o?s=u:o.next=u,o=l;var c=e.alternate;null!==c&&((a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(null!==s){var h=i.baseState;for(o=0,c=u=l=null,a=s;;){var d=a.lane,f=a.eventTime;if((r&d)===d){null!==c&&(c=c.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(d=t,f=n,m.tag){case 1:if("function"==typeof(p=m.payload)){h=p.call(f,h,d);break e}h=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(d="function"==typeof(p=m.payload)?p.call(f,h,d):p))break e;h=Qe({},h,d);break e;case 2:Xo=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(d=i.effects)?i.effects=[a]:d.push(a))}else f={eventTime:f,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=f,l=h):c=c.next=f,o|=d;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(d=a).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}if(null===c&&(l=h),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null!==(t=i.shared.interleaved)){i=t;do{o|=i.lane,i=i.next}while(i!==t)}else null===s&&(i.shared.lanes=0);Yu|=o,e.lanes=o,e.memoizedState=h}}function sa(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(we(191,i));i.call(r)}}}var oa={},aa=Bs(oa),la=Bs(oa),ua=Bs(oa);function ca(e){if(e===oa)throw Error(we(174));return e}function ha(e,t){switch(Vs(ua,t),Vs(la,e),Vs(aa,oa),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:_t(null,"");break;default:t=_t(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Fs(aa),Vs(aa,t)}function da(){Fs(aa),Fs(la),Fs(ua)}function fa(e){ca(ua.current);var t=ca(aa.current),n=_t(t,e.type);t!==n&&(Vs(la,e),Vs(aa,n))}function pa(e){la.current===e&&(Fs(aa),Fs(la))}var ma=Bs(0);function ga(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ya=[];function va(){for(var e=0;e<ya.length;e++)ya[e]._workInProgressVersionPrimary=null;ya.length=0}var ba=Ne.ReactCurrentDispatcher,wa=Ne.ReactCurrentBatchConfig,ka=0,Sa=null,_a=null,Ea=null,Ta=!1,xa=!1,Ca=0,Pa=0;function Ra(){throw Error(we(321))}function Aa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Si(e[n],t[n]))return!1;return!0}function Oa(e,t,n,r,i,s){if(ka=s,Sa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ba.current=null===e||null===e.memoizedState?pl:ml,e=n(r,i),xa){s=0;do{if(xa=!1,Ca=0,25<=s)throw Error(we(301));s+=1,Ea=_a=null,t.updateQueue=null,ba.current=gl,e=n(r,i)}while(xa)}if(ba.current=fl,t=null!==_a&&null!==_a.next,ka=0,Ea=_a=Sa=null,Ta=!1,t)throw Error(we(300));return e}function ja(){var e=0!==Ca;return Ca=0,e}function La(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ea?Sa.memoizedState=Ea=e:Ea=Ea.next=e,Ea}function Ia(){if(null===_a){var e=Sa.alternate;e=null!==e?e.memoizedState:null}else e=_a.next;var t=null===Ea?Sa.memoizedState:Ea.next;if(null!==t)Ea=t,_a=e;else{if(null===e)throw Error(we(310));e={memoizedState:(_a=e).memoizedState,baseState:_a.baseState,baseQueue:_a.baseQueue,queue:_a.queue,next:null},null===Ea?Sa.memoizedState=Ea=e:Ea=Ea.next=e}return Ea}function Na(e,t){return"function"==typeof t?t(e):t}function Da(e){var t=Ia(),n=t.queue;if(null===n)throw Error(we(311));n.lastRenderedReducer=e;var r=_a,i=r.baseQueue,s=n.pending;if(null!==s){if(null!==i){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(null!==i){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var c=u.lane;if((ka&c)===c)null!==l&&(l=l.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 h={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===l?(a=l=h,o=r):l=l.next=h,Sa.lanes|=c,Yu|=c}u=u.next}while(null!==u&&u!==s);null===l?o=r:l.next=a,Si(r,t.memoizedState)||(Ll=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{s=i.lane,Sa.lanes|=s,Yu|=s,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ma(e){var t=Ia(),n=t.queue;if(null===n)throw Error(we(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(null!==i){n.pending=null;var o=i=i.next;do{s=e(s,o.action),o=o.next}while(o!==i);Si(s,t.memoizedState)||(Ll=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Ua(){}function Ba(e,t){var n=Sa,r=Ia(),i=t(),s=!Si(r.memoizedState,i);if(s&&(r.memoizedState=i,Ll=!0),r=r.queue,Xa(za.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||null!==Ea&&1&Ea.memoizedState.tag){if(n.flags|=2048,Ka(9,Va.bind(null,n,r,i,t),void 0,null),null===Wu)throw Error(we(349));30&ka||Fa(n,t,i)}return i}function Fa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Sa.updateQueue)?(t={lastEffect:null,stores:null},Sa.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Va(e,t,n,r){t.value=n,t.getSnapshot=r,Wa(t)&&Ha(e)}function za(e,t,n){return n(function(){Wa(t)&&Ha(e)})}function Wa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Si(e,n)}catch(r){return!0}}function Ha(e){var t=Yo(e,1);null!==t&&gc(t,e,1,-1)}function qa(e){var t=La();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:e},t.queue=e,e=e.dispatch=ul.bind(null,Sa,e),[t.memoizedState,e]}function Ka(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Sa.updateQueue)?(t={lastEffect:null,stores:null},Sa.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ga(){return Ia().memoizedState}function Ja(e,t,n,r){var i=La();Sa.flags|=e,i.memoizedState=Ka(1|t,n,void 0,void 0===r?null:r)}function $a(e,t,n,r){var i=Ia();r=void 0===r?null:r;var s=void 0;if(null!==_a){var o=_a.memoizedState;if(s=o.destroy,null!==r&&Aa(r,o.deps))return void(i.memoizedState=Ka(t,n,s,r))}Sa.flags|=e,i.memoizedState=Ka(1|t,n,s,r)}function Ya(e,t){return Ja(8390656,8,e,t)}function Xa(e,t){return $a(2048,8,e,t)}function Qa(e,t){return $a(4,2,e,t)}function Za(e,t){return $a(4,4,e,t)}function el(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function tl(e,t,n){return n=null!=n?n.concat([e]):null,$a(4,4,el.bind(null,t,e),n)}function nl(){}function rl(e,t){var n=Ia();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Aa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function il(e,t){var n=Ia();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Aa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function sl(e,t,n){return 21&ka?(Si(n,t)||(n=On(),Sa.lanes|=n,Yu|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ll=!0),e.memoizedState=n)}function ol(e,t){var n=Nn;Nn=0!==n&&4>n?n:4,e(!0);var r=wa.transition;wa.transition={};try{e(!1),t()}finally{Nn=n,wa.transition=r}}function al(){return Ia().memoizedState}function ll(e,t,n){var r=mc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cl(e))hl(t,n);else if(null!==(n=$o(e,t,n,r))){gc(n,e,r,pc()),dl(n,t,r)}}function ul(e,t,n){var r=mc(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cl(e))hl(t,i);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Si(a,o)){var l=t.interleaved;return null===l?(i.next=i,Jo(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(u){}null!==(n=$o(e,t,i,r))&&(gc(n,e,r,i=pc()),dl(n,t,r))}}function cl(e){var t=e.alternate;return e===Sa||null!==t&&t===Sa}function hl(e,t){xa=Ta=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dl(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,In(e,n)}}var fl={readContext:Ko,useCallback:Ra,useContext:Ra,useEffect:Ra,useImperativeHandle:Ra,useInsertionEffect:Ra,useLayoutEffect:Ra,useMemo:Ra,useReducer:Ra,useRef:Ra,useState:Ra,useDebugValue:Ra,useDeferredValue:Ra,useTransition:Ra,useMutableSource:Ra,useSyncExternalStore:Ra,useId:Ra,unstable_isNewReconciler:!1},pl={readContext:Ko,useCallback:function(e,t){return La().memoizedState=[e,void 0===t?null:t],e},useContext:Ko,useEffect:Ya,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ja(4194308,4,el.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ja(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ja(4,2,e,t)},useMemo:function(e,t){var n=La();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=La();return t=void 0!==n?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=ll.bind(null,Sa,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},La().memoizedState=e},useState:qa,useDebugValue:nl,useDeferredValue:function(e){return La().memoizedState=e},useTransition:function(){var e=qa(!1),t=e[0];return e=ol.bind(null,e[1]),La().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Sa,i=La();if(wo){if(void 0===n)throw Error(we(407));n=n()}else{if(n=t(),null===Wu)throw Error(we(349));30&ka||Fa(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Ya(za.bind(null,r,s,e),[e]),r.flags|=2048,Ka(9,Va.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=La(),t=Wu.identifierPrefix;if(wo){var n=fo;t=":"+t+"R"+(n=(ho&~(1<<32-Sn(ho)-1)).toString(32)+n),0<(n=Ca++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Pa++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ml={readContext:Ko,useCallback:rl,useContext:Ko,useEffect:Xa,useImperativeHandle:tl,useInsertionEffect:Qa,useLayoutEffect:Za,useMemo:il,useReducer:Da,useRef:Ga,useState:function(){return Da(Na)},useDebugValue:nl,useDeferredValue:function(e){return sl(Ia(),_a.memoizedState,e)},useTransition:function(){return[Da(Na)[0],Ia().memoizedState]},useMutableSource:Ua,useSyncExternalStore:Ba,useId:al,unstable_isNewReconciler:!1},gl={readContext:Ko,useCallback:rl,useContext:Ko,useEffect:Xa,useImperativeHandle:tl,useInsertionEffect:Qa,useLayoutEffect:Za,useMemo:il,useReducer:Ma,useRef:Ga,useState:function(){return Ma(Na)},useDebugValue:nl,useDeferredValue:function(e){var t=Ia();return null===_a?t.memoizedState=e:sl(t,_a.memoizedState,e)},useTransition:function(){return[Ma(Na)[0],Ia().memoizedState]},useMutableSource:Ua,useSyncExternalStore:Ba,useId:al,unstable_isNewReconciler:!1};function yl(e,t){if(e&&e.defaultProps){for(var n in t=Qe({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function vl(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:Qe({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var bl={isMounted:function(e){return!!(e=e._reactInternals)&&rn(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pc(),i=mc(e),s=ea(r,i);s.payload=t,null!=n&&(s.callback=n),null!==(t=ta(e,s,i))&&(gc(t,e,i,r),na(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pc(),i=mc(e),s=ea(r,i);s.tag=1,s.payload=t,null!=n&&(s.callback=n),null!==(t=ta(e,s,i))&&(gc(t,e,i,r),na(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pc(),r=mc(e),i=ea(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=ta(e,i,r))&&(gc(t,e,r,n),na(t,e,r))}};function wl(e,t,n,r,i,s,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,s,o):!t.prototype||!t.prototype.isPureReactComponent||(!_i(n,r)||!_i(i,s))}function kl(e,t,n){var r=!1,i=zs,s=t.contextType;return"object"==typeof s&&null!==s?s=Ko(s):(i=Gs(t)?qs:Ws.current,s=(r=null!=(r=t.contextTypes))?Ks(e,i):zs),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=bl,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Sl(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bl.enqueueReplaceState(t,t.state,null)}function _l(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Qo(e);var s=t.contextType;"object"==typeof s&&null!==s?i.context=Ko(s):(s=Gs(t)?qs:Ws.current,i.context=Ks(e,s)),i.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(vl(e,t,s,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&bl.enqueueReplaceState(i,i.state,null),ia(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function El(e,t){try{var n="",r=t;do{n+=nt(r),r=r.return}while(r);var i=n}catch(s){i="\nError generating stack: "+s.message+"\n"+s.stack}return{value:e,source:t,stack:i,digest:null}}function Tl(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}var xl="function"==typeof WeakMap?WeakMap:Map;function Cl(e,t,n){(n=ea(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ic||(ic=!0,sc=r)},n}function Pl(e,t,n){(n=ea(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===oc?oc=new Set([this]):oc.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Rl(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new xl;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Bc.bind(null,e,t,n),t.then(e,e))}function Al(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function Ol(e,t,n,r,i){return 1&e.mode?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=ea(-1,1)).tag=2,ta(n,t,1))),n.lanes|=1),e)}var jl=Ne.ReactCurrentOwner,Ll=!1;function Il(e,t,n,r){t.child=null===e?Mo(t,null,n,r):Do(t,e.child,n,r)}function Nl(e,t,n,r,i){n=n.render;var s=t.ref;return qo(t,i),r=Oa(e,t,n,r,s,i),n=ja(),null===e||Ll?(wo&&n&&go(t),t.flags|=1,Il(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,iu(e,t,i))}function Dl(e,t,n,r,i){if(null===e){var s=n.type;return"function"!=typeof s||Kc(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Jc(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,Ml(e,t,s,r,i))}if(s=e.child,0===(e.lanes&i)){var o=s.memoizedProps;if((n=null!==(n=n.compare)?n:_i)(o,r)&&e.ref===t.ref)return iu(e,t,i)}return t.flags|=1,(e=Gc(s,r)).ref=t.ref,e.return=t,t.child=e}function Ml(e,t,n,r,i){if(null!==e){var s=e.memoizedProps;if(_i(s,r)&&e.ref===t.ref){if(Ll=!1,t.pendingProps=r=s,0===(e.lanes&i))return t.lanes=e.lanes,iu(e,t,i);131072&e.flags&&(Ll=!0)}}return Fl(e,t,n,r,i)}function Ul(e,t,n){var r=t.pendingProps,i=r.children,s=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==s?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Vs(Gu,Ku),Ku|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==s?s.baseLanes:n,Vs(Gu,Ku),Ku|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Vs(Gu,Ku),Ku|=n;else null!==s?(r=s.baseLanes|n,t.memoizedState=null):r=n,Vs(Gu,Ku),Ku|=r;return Il(e,t,i,n),t.child}function Bl(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fl(e,t,n,r,i){var s=Gs(n)?qs:Ws.current;return s=Ks(t,s),qo(t,i),n=Oa(e,t,n,r,s,i),r=ja(),null===e||Ll?(wo&&r&&go(t),t.flags|=1,Il(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,iu(e,t,i))}function Vl(e,t,n,r,i){if(Gs(n)){var s=!0;Xs(t)}else s=!1;if(qo(t,i),null===t.stateNode)ru(e,t),kl(t,n,r),_l(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;"object"==typeof u&&null!==u?u=Ko(u):u=Ks(t,u=Gs(n)?qs:Ws.current);var c=n.getDerivedStateFromProps,h="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;h||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==r||l!==u)&&Sl(t,o,r,u),Xo=!1;var d=t.memoizedState;o.state=d,ia(t,r,o,i),l=t.memoizedState,a!==r||d!==l||Hs.current||Xo?("function"==typeof c&&(vl(t,n,c,r),l=t.memoizedState),(a=Xo||wl(t,n,a,r,d,l,u))?(h||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Zo(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:yl(t.type,a),o.props=u,h=t.pendingProps,d=o.context,"object"==typeof(l=n.contextType)&&null!==l?l=Ko(l):l=Ks(t,l=Gs(n)?qs:Ws.current);var f=n.getDerivedStateFromProps;(c="function"==typeof f||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==h||d!==l)&&Sl(t,o,r,l),Xo=!1,d=t.memoizedState,o.state=d,ia(t,r,o,i);var p=t.memoizedState;a!==h||d!==p||Hs.current||Xo?("function"==typeof f&&(vl(t,n,f,r),p=t.memoizedState),(u=Xo||wl(t,n,u,r,d,p,l)||!1)?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,p,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=l,r=u):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return zl(e,t,n,r,s,i)}function zl(e,t,n,r,i,s){Bl(e,t);var o=!!(128&t.flags);if(!r&&!o)return i&&Qs(t,n,!1),iu(e,t,s);r=t.stateNode,jl.current=t;var a=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=Do(t,e.child,null,s),t.child=Do(t,null,a,s)):Il(e,t,a,s),t.memoizedState=r.state,i&&Qs(t,n,!0),t.child}function Wl(e){var t=e.stateNode;t.pendingContext?$s(0,t.pendingContext,t.pendingContext!==t.context):t.context&&$s(0,t.context,!1),ha(e,t.containerInfo)}function Hl(e,t,n,r,i){return Ro(),Ao(i),t.flags|=256,Il(e,t,n,r),t.child}var ql,Kl,Gl,Jl,$l={dehydrated:null,treeContext:null,retryLane:0};function Yl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Xl(e,t,n){var r,i=t.pendingProps,s=ma.current,o=!1,a=!!(128&t.flags);if((r=a)||(r=(null===e||null!==e.memoizedState)&&!!(2&s)),r?(o=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),Vs(ma,1&s),null===e)return To(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=i.children,e=i.fallback,o?(i=t.mode,o=t.child,a={mode:"hidden",children:a},1&i||null===o?o=Yc(a,i,0,null):(o.childLanes=0,o.pendingProps=a),e=$c(e,i,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Yl(n),t.memoizedState=$l,e):Ql(t,a));if(null!==(s=e.memoizedState)&&null!==(r=s.dehydrated))return function(e,t,n,r,i,s,o){if(n)return 256&t.flags?(t.flags&=-257,Zl(e,t,o,r=Tl(Error(we(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Yc({mode:"visible",children:r.children},i,0,null),(s=$c(s,i,o,null)).flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,1&t.mode&&Do(t,e.child,null,o),t.child.memoizedState=Yl(o),t.memoizedState=$l,s);if(!(1&t.mode))return Zl(e,t,o,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var a=r.dgst;return r=a,Zl(e,t,o,r=Tl(s=Error(we(419)),r,void 0))}if(a=0!==(o&e.childLanes),Ll||a){if(null!==(r=Wu)){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(r.suspendedLanes|o))?0:i)&&i!==s.retryLane&&(s.retryLane=i,Yo(e,i),gc(r,e,i,-1))}return Rc(),Zl(e,t,o,r=Tl(Error(we(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Vc.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,bo=Es(i.nextSibling),vo=t,wo=!0,ko=null,null!==e&&(lo[uo++]=ho,lo[uo++]=fo,lo[uo++]=co,ho=e.id,fo=e.overflow,co=t),t=Ql(t,r.children),t.flags|=4096,t)}(e,t,a,i,r,s,n);if(o){o=i.fallback,a=t.mode,r=(s=e.child).sibling;var l={mode:"hidden",children:i.children};return 1&a||t.child===s?(i=Gc(s,l)).subtreeFlags=14680064&s.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=l,t.deletions=null),null!==r?o=Gc(r,o):(o=$c(o,a,n,null)).flags|=2,o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,a=null===(a=e.child.memoizedState)?Yl(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=$l,i}return e=(o=e.child).sibling,i=Gc(o,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ql(e,t){return(t=Yc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Zl(e,t,n,r){return null!==r&&Ao(r),Do(t,e.child,null,n),(e=Ql(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function eu(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ho(e.return,t,n)}function tu(e,t,n,r,i){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function nu(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Il(e,t,r.children,n),2&(r=ma.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&eu(e,n,t);else if(19===e.tag)eu(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Vs(ma,r),1&t.mode)switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===ga(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tu(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ga(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tu(t,!0,n,null,s);break;case"together":tu(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function ru(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function iu(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Yu|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(we(153));if(null!==t.child){for(n=Gc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Gc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function su(e,t){if(!wo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ou(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function au(e,t,n){var r=t.pendingProps;switch(yo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ou(t),null;case 1:case 17:return Gs(t.type)&&Js(),ou(t),null;case 3:return r=t.stateNode,da(),Fs(Hs),Fs(Ws),va(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Co(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ko&&(wc(ko),ko=null))),Kl(e,t),ou(t),null;case 5:pa(t);var i=ca(ua.current);if(n=t.type,null!==e&&null!=t.stateNode)Gl(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(we(166));return ou(t),null}if(e=ca(aa.current),Co(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Cs]=t,r[Ps]=s,e=!!(1&t.mode),n){case"dialog":es("cancel",r),es("close",r);break;case"iframe":case"object":case"embed":es("load",r);break;case"video":case"audio":for(i=0;i<Yi.length;i++)es(Yi[i],r);break;case"source":es("error",r);break;case"img":case"image":case"link":es("error",r),es("load",r);break;case"details":es("toggle",r);break;case"input":ht(r,s),es("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},es("invalid",r);break;case"textarea":bt(r,s),es("invalid",r)}for(var o in Lt(n,s),i=null,s)if(s.hasOwnProperty(o)){var a=s[o];"children"===o?"string"==typeof a?r.textContent!==a&&(!0!==s.suppressHydrationWarning&&fs(r.textContent,a,e),i=["children",a]):"number"==typeof a&&r.textContent!==""+a&&(!0!==s.suppressHydrationWarning&&fs(r.textContent,a,e),i=["children",""+a]):Se.hasOwnProperty(o)&&null!=a&&"onScroll"===o&&es("scroll",r)}switch(n){case"input":at(r),pt(r,s,!0);break;case"textarea":at(r),kt(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=ps)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{o=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=St(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=o.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),"select"===n&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Cs]=t,e[Ps]=r,ql(e,t,!1,!1),t.stateNode=e;e:{switch(o=It(n,r),n){case"dialog":es("cancel",e),es("close",e),i=r;break;case"iframe":case"object":case"embed":es("load",e),i=r;break;case"video":case"audio":for(i=0;i<Yi.length;i++)es(Yi[i],e);i=r;break;case"source":es("error",e),i=r;break;case"img":case"image":case"link":es("error",e),es("load",e),i=r;break;case"details":es("toggle",e),i=r;break;case"input":ht(e,r),i=ct(e,r),es("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Qe({},r,{value:void 0}),es("invalid",e);break;case"textarea":bt(e,r),i=vt(e,r),es("invalid",e)}for(s in Lt(n,i),a=i)if(a.hasOwnProperty(s)){var l=a[s];"style"===s?Ot(e,l):"dangerouslySetInnerHTML"===s?null!=(l=l?l.__html:void 0)&&xt(e,l):"children"===s?"string"==typeof l?("textarea"!==n||""!==l)&&Ct(e,l):"number"==typeof l&&Ct(e,""+l):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(Se.hasOwnProperty(s)?null!=l&&"onScroll"===s&&es("scroll",e):null!=l&&Ie(e,s,l,o))}switch(n){case"input":at(e),pt(e,r,!1);break;case"textarea":at(e),kt(e);break;case"option":null!=r.value&&e.setAttribute("value",""+st(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?yt(e,!!r.multiple,s,!1):null!=r.defaultValue&&yt(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=ps)}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)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return ou(t),null;case 6:if(e&&null!=t.stateNode)Jl(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(we(166));if(n=ca(ua.current),ca(aa.current),Co(t)){if(r=t.stateNode,n=t.memoizedProps,r[Cs]=t,(s=r.nodeValue!==n)&&null!==(e=vo))switch(e.tag){case 3:fs(r.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&fs(r.nodeValue,n,!!(1&e.mode))}s&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Cs]=t,t.stateNode=r}return ou(t),null;case 13:if(Fs(ma),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(wo&&null!==bo&&1&t.mode&&!(128&t.flags))Po(),Ro(),t.flags|=98560,s=!1;else if(s=Co(t),null!==r&&null!==r.dehydrated){if(null===e){if(!s)throw Error(we(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(we(317));s[Cs]=t}else Ro(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ou(t),s=!1}else null!==ko&&(wc(ko),ko=null),s=!0;if(!s)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,1&t.mode&&(null===e||1&ma.current?0===Ju&&(Ju=3):Rc())),null!==t.updateQueue&&(t.flags|=4),ou(t),null);case 4:return da(),Kl(e,t),null===e&&rs(t.stateNode.containerInfo),ou(t),null;case 10:return Wo(t.type._context),ou(t),null;case 19:if(Fs(ma),null===(s=t.memoizedState))return ou(t),null;if(r=!!(128&t.flags),null===(o=s.rendering))if(r)su(s,!1);else{if(0!==Ju||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=ga(e))){for(t.flags|=128,su(s,!1),null!==(r=o.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=14680066,null===(o=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Vs(ma,1&ma.current|2),t.child}e=e.sibling}null!==s.tail&&fn()>nc&&(t.flags|=128,r=!0,su(s,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ga(o))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),su(s,!0),null===s.tail&&"hidden"===s.tailMode&&!o.alternate&&!wo)return ou(t),null}else 2*fn()-s.renderingStartTime>nc&&1073741824!==n&&(t.flags|=128,r=!0,su(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(null!==(n=s.last)?n.sibling=o:t.child=o,s.last=o)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=fn(),t.sibling=null,n=ma.current,Vs(ma,r?1&n|2:1&n),t):(ou(t),null);case 22:case 23:return Tc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&Ku)&&(ou(t),6&t.subtreeFlags&&(t.flags|=8192)):ou(t),null;case 24:case 25:return null}throw Error(we(156,t.tag))}function lu(e,t){switch(yo(t),t.tag){case 1:return Gs(t.type)&&Js(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return da(),Fs(Hs),Fs(Ws),va(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return pa(t),null;case 13:if(Fs(ma),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(we(340));Ro()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Fs(ma),null;case 4:return da(),null;case 10:return Wo(t.type._context),null;case 22:case 23:return Tc(),null;default:return null}}ql=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Kl=function(){},Gl=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ca(aa.current);var s,o=null;switch(n){case"input":i=ct(e,i),r=ct(e,r),o=[];break;case"select":i=Qe({},i,{value:void 0}),r=Qe({},r,{value:void 0}),o=[];break;case"textarea":i=vt(e,i),r=vt(e,r),o=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=ps)}for(u in Lt(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(Se.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(a=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(null!=l||null!=a))if("style"===u)if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else"dangerouslySetInnerHTML"===u?(l=l?l.__html:void 0,a=a?a.__html:void 0,null!=l&&a!==l&&(o=o||[]).push(u,l)):"children"===u?"string"!=typeof l&&"number"!=typeof l||(o=o||[]).push(u,""+l):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(Se.hasOwnProperty(u)?(null!=l&&"onScroll"===u&&es("scroll",e),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},Jl=function(e,t,n,r){n!==r&&(t.flags|=4)};var uu=!1,cu=!1,hu="function"==typeof WeakSet?WeakSet:Set,du=null;function fu(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(r){Uc(e,t,r)}else n.current=null}function pu(e,t,n){try{n()}catch(r){Uc(e,t,r)}}var mu=!1;function gu(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,void 0!==s&&pu(t,n,s)}i=i.next}while(i!==r)}}function yu(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect: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 vu(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function bu(e){var t=e.alternate;null!==t&&(e.alternate=null,bu(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[Cs],delete t[Ps],delete t[As],delete t[Os],delete t[js])),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 wu(e){return 5===e.tag||3===e.tag||4===e.tag}function ku(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||wu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Su(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=ps));else if(4!==r&&null!==(e=e.child))for(Su(e,t,n),e=e.sibling;null!==e;)Su(e,t,n),e=e.sibling}function _u(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(_u(e,t,n),e=e.sibling;null!==e;)_u(e,t,n),e=e.sibling}var Eu=null,Tu=!1;function xu(e,t,n){for(n=n.child;null!==n;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(kn&&"function"==typeof kn.onCommitFiberUnmount)try{kn.onCommitFiberUnmount(wn,n)}catch(a){}switch(n.tag){case 5:cu||fu(n,t);case 6:var r=Eu,i=Tu;Eu=null,xu(e,t,n),Tu=i,null!==(Eu=r)&&(Tu?(e=Eu,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):Eu.removeChild(n.stateNode));break;case 18:null!==Eu&&(Tu?(e=Eu,n=n.stateNode,8===e.nodeType?_s(e.parentNode,n):1===e.nodeType&&_s(e,n),ir(e)):_s(Eu,n.stateNode));break;case 4:r=Eu,i=Tu,Eu=n.stateNode.containerInfo,Tu=!0,xu(e,t,n),Eu=r,Tu=i;break;case 0:case 11:case 14:case 15:if(!cu&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,void 0!==o&&(2&s||4&s)&&pu(n,t,o),i=i.next}while(i!==r)}xu(e,t,n);break;case 1:if(!cu&&(fu(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Uc(n,t,a)}xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:1&n.mode?(cu=(r=cu)||null!==n.memoizedState,xu(e,t,n),cu=r):xu(e,t,n);break;default:xu(e,t,n)}}function Pu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new hu),t.forEach(function(t){var r=zc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Ru(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;null!==a;){switch(a.tag){case 5:Eu=a.stateNode,Tu=!1;break e;case 3:case 4:Eu=a.stateNode.containerInfo,Tu=!0;break e}a=a.return}if(null===Eu)throw Error(we(160));Cu(s,o,i),Eu=null,Tu=!1;var l=i.alternate;null!==l&&(l.return=null),i.return=null}catch(u){Uc(i,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)Au(t,e),t=t.sibling}function Au(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ru(t,e),Ou(e),4&r){try{gu(3,e,e.return),yu(3,e)}catch(m){Uc(e,e.return,m)}try{gu(5,e,e.return)}catch(m){Uc(e,e.return,m)}}break;case 1:Ru(t,e),Ou(e),512&r&&null!==n&&fu(n,n.return);break;case 5:if(Ru(t,e),Ou(e),512&r&&null!==n&&fu(n,n.return),32&e.flags){var i=e.stateNode;try{Ct(i,"")}catch(m){Uc(e,e.return,m)}}if(4&r&&null!=(i=e.stateNode)){var s=e.memoizedProps,o=null!==n?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,null!==l)try{"input"===a&&"radio"===s.type&&null!=s.name&&dt(i,s),It(a,o);var u=It(a,s);for(o=0;o<l.length;o+=2){var c=l[o],h=l[o+1];"style"===c?Ot(i,h):"dangerouslySetInnerHTML"===c?xt(i,h):"children"===c?Ct(i,h):Ie(i,c,h,u)}switch(a){case"input":ft(i,s);break;case"textarea":wt(i,s);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;null!=f?yt(i,!!s.multiple,f,!1):d!==!!s.multiple&&(null!=s.defaultValue?yt(i,!!s.multiple,s.defaultValue,!0):yt(i,!!s.multiple,s.multiple?[]:"",!1))}i[Ps]=s}catch(m){Uc(e,e.return,m)}}break;case 6:if(Ru(t,e),Ou(e),4&r){if(null===e.stateNode)throw Error(we(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){Uc(e,e.return,m)}}break;case 3:if(Ru(t,e),Ou(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{ir(t.containerInfo)}catch(m){Uc(e,e.return,m)}break;case 4:default:Ru(t,e),Ou(e);break;case 13:Ru(t,e),Ou(e),8192&(i=e.child).flags&&(s=null!==i.memoizedState,i.stateNode.isHidden=s,!s||null!==i.alternate&&null!==i.alternate.memoizedState||(tc=fn())),4&r&&Pu(e);break;case 22:if(c=null!==n&&null!==n.memoizedState,1&e.mode?(cu=(u=cu)||c,Ru(t,e),cu=u):Ru(t,e),Ou(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!c&&1&e.mode)for(du=e,c=e.child;null!==c;){for(h=du=c;null!==du;){switch(f=(d=du).child,d.tag){case 0:case 11:case 14:case 15:gu(4,d,d.return);break;case 1:fu(d,d.return);var p=d.stateNode;if("function"==typeof p.componentWillUnmount){r=d,n=d.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){Uc(r,n,m)}}break;case 5:fu(d,d.return);break;case 22:if(null!==d.memoizedState){Nu(h);continue}}null!==f?(f.return=d,du=f):Nu(h)}c=c.sibling}e:for(c=null,h=e;;){if(5===h.tag){if(null===c){c=h;try{i=h.stateNode,u?"function"==typeof(s=i.style).setProperty?s.setProperty("display","none","important"):s.display="none":(a=h.stateNode,o=null!=(l=h.memoizedProps.style)&&l.hasOwnProperty("display")?l.display:null,a.style.display=At("display",o))}catch(m){Uc(e,e.return,m)}}}else if(6===h.tag){if(null===c)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){Uc(e,e.return,m)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;c===h&&(c=null),h=h.return}c===h&&(c=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Ru(t,e),Ou(e),4&r&&Pu(e);case 21:}}function Ou(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(wu(n)){var r=n;break e}n=n.return}throw Error(we(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(Ct(i,""),r.flags&=-33),_u(e,ku(e),i);break;case 3:case 4:var s=r.stateNode.containerInfo;Su(e,ku(e),s);break;default:throw Error(we(161))}}catch(o){Uc(e,e.return,o)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function ju(e,t,n){du=e,Lu(e)}function Lu(e,t,n){for(var r=!!(1&e.mode);null!==du;){var i=du,s=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||uu;if(!o){var a=i.alternate,l=null!==a&&null!==a.memoizedState||cu;a=uu;var u=cu;if(uu=o,(cu=l)&&!u)for(du=i;null!==du;)l=(o=du).child,22===o.tag&&null!==o.memoizedState?Du(i):null!==l?(l.return=o,du=l):Du(i);for(;null!==s;)du=s,Lu(s),s=s.sibling;du=i,uu=a,cu=u}Iu(e)}else 8772&i.subtreeFlags&&null!==s?(s.return=i,du=s):Iu(e)}}function Iu(e){for(;null!==du;){var t=du;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:cu||yu(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!cu)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:yl(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&sa(t,s,r);break;case 3:var o=t.updateQueue;if(null!==o){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}sa(t,o,n)}break;case 5:var a=t.stateNode;if(null===n&&4&t.flags){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var c=u.memoizedState;if(null!==c){var h=c.dehydrated;null!==h&&ir(h)}}}break;default:throw Error(we(163))}cu||512&t.flags&&vu(t)}catch(d){Uc(t,t.return,d)}}if(t===e){du=null;break}if(null!==(n=t.sibling)){n.return=t.return,du=n;break}du=t.return}}function Nu(e){for(;null!==du;){var t=du;if(t===e){du=null;break}var n=t.sibling;if(null!==n){n.return=t.return,du=n;break}du=t.return}}function Du(e){for(;null!==du;){var t=du;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{yu(4,t)}catch(l){Uc(t,n,l)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(l){Uc(t,i,l)}}var s=t.return;try{vu(t)}catch(l){Uc(t,s,l)}break;case 5:var o=t.return;try{vu(t)}catch(l){Uc(t,o,l)}}}catch(l){Uc(t,t.return,l)}if(t===e){du=null;break}var a=t.sibling;if(null!==a){a.return=t.return,du=a;break}du=t.return}}var Mu,Uu=Math.ceil,Bu=Ne.ReactCurrentDispatcher,Fu=Ne.ReactCurrentOwner,Vu=Ne.ReactCurrentBatchConfig,zu=0,Wu=null,Hu=null,qu=0,Ku=0,Gu=Bs(0),Ju=0,$u=null,Yu=0,Xu=0,Qu=0,Zu=null,ec=null,tc=0,nc=1/0,rc=null,ic=!1,sc=null,oc=null,ac=!1,lc=null,uc=0,cc=0,hc=null,dc=-1,fc=0;function pc(){return 6&zu?fn():-1!==dc?dc:dc=fn()}function mc(e){return 1&e.mode?2&zu&&0!==qu?qu&-qu:null!==Oo.transition?(0===fc&&(fc=On()),fc):0!==(e=Nn)?e:e=void 0===(e=window.event)?16:dr(e.type):1}function gc(e,t,n,r){if(50<cc)throw cc=0,hc=null,Error(we(185));Ln(e,n,r),2&zu&&e===Wu||(e===Wu&&(!(2&zu)&&(Xu|=n),4===Ju&&kc(e,qu)),yc(e,r),1===n&&0===zu&&!(1&t.mode)&&(nc=fn()+500,eo&&ro()))}function yc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Sn(s),a=1<<o,l=i[o];-1===l?0!==(a&n)&&0===(a&r)||(i[o]=Rn(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}(e,t);var r=Pn(e,e===Wu?qu:0);if(0===r)null!==n&&cn(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&cn(n),1===t)0===e.tag?function(e){eo=!0,no(e)}(Sc.bind(null,e)):no(Sc.bind(null,e)),ks(function(){!(6&zu)&&ro()}),n=null;else{switch(Dn(r)){case 1:n=mn;break;case 4:n=gn;break;case 16:default:n=yn;break;case 536870912:n=bn}n=Wc(n,vc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function vc(e,t){if(dc=-1,fc=0,6&zu)throw Error(we(327));var n=e.callbackNode;if(Dc()&&e.callbackNode!==n)return null;var r=Pn(e,e===Wu?qu:0);if(0===r)return null;if(30&r||0!==(r&e.expiredLanes)||t)t=Ac(e,r);else{t=r;var i=zu;zu|=2;var s=Pc();for(Wu===e&&qu===t||(rc=null,nc=fn()+500,xc(e,t));;)try{jc();break}catch(a){Cc(e,a)}zo(),Bu.current=s,zu=i,null!==Hu?t=0:(Wu=null,qu=0,t=Ju)}if(0!==t){if(2===t&&(0!==(i=An(e))&&(r=i,t=bc(e,i))),1===t)throw n=$u,xc(e,0),kc(e,r),yc(e,fn()),n;if(6===t)kc(e,r);else{if(i=e.current.alternate,!(30&r||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Si(s(),i))return!1}catch(o){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=Ac(e,r),2===t&&(s=An(e),0!==s&&(r=s,t=bc(e,s))),1!==t)))throw n=$u,xc(e,0),kc(e,r),yc(e,fn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(we(345));case 2:case 5:Nc(e,ec,rc);break;case 3:if(kc(e,r),(130023424&r)===r&&10<(t=tc+500-fn())){if(0!==Pn(e,0))break;if(((i=e.suspendedLanes)&r)!==r){pc(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=vs(Nc.bind(null,e,ec,rc),t);break}Nc(e,ec,rc);break;case 4:if(kc(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Sn(r);s=1<<o,(o=t[o])>i&&(i=o),r&=~s}if(r=i,10<(r=(120>(r=fn()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Uu(r/1960))-r)){e.timeoutHandle=vs(Nc.bind(null,e,ec,rc),r);break}Nc(e,ec,rc);break;default:throw Error(we(329))}}}return yc(e,fn()),e.callbackNode===n?vc.bind(null,e):null}function bc(e,t){var n=Zu;return e.current.memoizedState.isDehydrated&&(xc(e,t).flags|=256),2!==(e=Ac(e,t))&&(t=ec,ec=n,null!==t&&wc(t)),e}function wc(e){null===ec?ec=e:ec.push.apply(ec,e)}function kc(e,t){for(t&=~Qu,t&=~Xu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Sn(t),r=1<<n;e[n]=-1,t&=~r}}function Sc(e){if(6&zu)throw Error(we(327));Dc();var t=Pn(e,0);if(!(1&t))return yc(e,fn()),null;var n=Ac(e,t);if(0!==e.tag&&2===n){var r=An(e);0!==r&&(t=r,n=bc(e,r))}if(1===n)throw n=$u,xc(e,0),kc(e,t),yc(e,fn()),n;if(6===n)throw Error(we(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nc(e,ec,rc),yc(e,fn()),null}function _c(e,t){var n=zu;zu|=1;try{return e(t)}finally{0===(zu=n)&&(nc=fn()+500,eo&&ro())}}function Ec(e){null!==lc&&0===lc.tag&&!(6&zu)&&Dc();var t=zu;zu|=1;var n=Vu.transition,r=Nn;try{if(Vu.transition=null,Nn=1,e)return e()}finally{Nn=r,Vu.transition=n,!(6&(zu=t))&&ro()}}function Tc(){Ku=Gu.current,Fs(Gu)}function xc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,bs(n)),null!==Hu)for(n=Hu.return;null!==n;){var r=n;switch(yo(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Js();break;case 3:da(),Fs(Hs),Fs(Ws),va();break;case 5:pa(r);break;case 4:da();break;case 13:case 19:Fs(ma);break;case 10:Wo(r.type._context);break;case 22:case 23:Tc()}n=n.return}if(Wu=e,Hu=e=Gc(e.current,null),qu=Ku=t,Ju=0,$u=null,Qu=Xu=Yu=0,ec=Zu=null,null!==Go){for(t=0;t<Go.length;t++)if(null!==(r=(n=Go[t]).interleaved)){n.interleaved=null;var i=r.next,s=n.pending;if(null!==s){var o=s.next;s.next=i,r.next=o}n.pending=r}Go=null}return e}function Cc(e,t){for(;;){var n=Hu;try{if(zo(),ba.current=fl,Ta){for(var r=Sa.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}Ta=!1}if(ka=0,Ea=_a=Sa=null,xa=!1,Ca=0,Fu.current=null,null===n||null===n.return){Ju=1,$u=t,Hu=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=qu,a.flags|=32768,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l,c=a,h=c.tag;if(!(1&c.mode||0!==h&&11!==h&&15!==h)){var d=c.alternate;d?(c.updateQueue=d.updateQueue,c.memoizedState=d.memoizedState,c.lanes=d.lanes):(c.updateQueue=null,c.memoizedState=null)}var f=Al(o);if(null!==f){f.flags&=-257,Ol(f,o,a,0,t),1&f.mode&&Rl(s,u,t),l=u;var p=(t=f).updateQueue;if(null===p){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}if(!(1&t)){Rl(s,u,t),Rc();break e}l=Error(we(426))}else if(wo&&1&a.mode){var g=Al(o);if(null!==g){!(65536&g.flags)&&(g.flags|=256),Ol(g,o,a,0,t),Ao(El(l,a));break e}}s=l=El(l,a),4!==Ju&&(Ju=2),null===Zu?Zu=[s]:Zu.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,ra(s,Cl(0,l,t));break e;case 1:a=l;var y=s.type,v=s.stateNode;if(!(128&s.flags||"function"!=typeof y.getDerivedStateFromError&&(null===v||"function"!=typeof v.componentDidCatch||null!==oc&&oc.has(v)))){s.flags|=65536,t&=-t,s.lanes|=t,ra(s,Pl(s,a,t));break e}}s=s.return}while(null!==s)}Ic(n)}catch(b){t=b,Hu===n&&null!==n&&(Hu=n=n.return);continue}break}}function Pc(){var e=Bu.current;return Bu.current=fl,null===e?fl:e}function Rc(){0!==Ju&&3!==Ju&&2!==Ju||(Ju=4),null===Wu||!(268435455&Yu)&&!(268435455&Xu)||kc(Wu,qu)}function Ac(e,t){var n=zu;zu|=2;var r=Pc();for(Wu===e&&qu===t||(rc=null,xc(e,t));;)try{Oc();break}catch(i){Cc(e,i)}if(zo(),zu=n,Bu.current=r,null!==Hu)throw Error(we(261));return Wu=null,qu=0,Ju}function Oc(){for(;null!==Hu;)Lc(Hu)}function jc(){for(;null!==Hu&&!hn();)Lc(Hu)}function Lc(e){var t=Mu(e.alternate,e,Ku);e.memoizedProps=e.pendingProps,null===t?Ic(e):Hu=t,Fu.current=null}function Ic(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=lu(n,t)))return n.flags&=32767,void(Hu=n);if(null===e)return Ju=6,void(Hu=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=au(n,t,Ku)))return void(Hu=n);if(null!==(t=t.sibling))return void(Hu=t);Hu=t=e}while(null!==t);0===Ju&&(Ju=5)}function Nc(e,t,n){var r=Nn,i=Vu.transition;try{Vu.transition=null,Nn=1,function(e,t,n,r){do{Dc()}while(null!==lc);if(6&zu)throw Error(we(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(we(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(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 i=31-Sn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}(e,s),e===Wu&&(Hu=Wu=null,qu=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||ac||(ac=!0,Wc(yn,function(){return Dc(),null})),s=!!(15990&n.flags),!!(15990&n.subtreeFlags)||s){s=Vu.transition,Vu.transition=null;var o=Nn;Nn=1;var a=zu;zu|=4,Fu.current=null,function(e,t){if(ms=or,Pi(e=Ci())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch(w){n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,h=e,d=null;t:for(;;){for(var f;h!==n||0!==i&&3!==h.nodeType||(a=o+i),h!==s||0!==r&&3!==h.nodeType||(l=o+r),3===h.nodeType&&(o+=h.nodeValue.length),null!==(f=h.firstChild);)d=h,h=f;for(;;){if(h===e)break t;if(d===n&&++u===i&&(a=o),d===s&&++c===r&&(l=o),null!==(f=h.nextSibling))break;d=(h=d).parentNode}h=f}n=-1===a||-1===l?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(gs={focusedElem:e,selectionRange:n},or=!1,du=t;null!==du;)if(e=(t=du).child,1028&t.subtreeFlags&&null!==e)e.return=t,du=e;else for(;null!==du;){t=du;try{var p=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==p){var m=p.memoizedProps,g=p.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:yl(t.type,m),g);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(we(163))}}catch(w){Uc(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,du=e;break}du=t.return}p=mu,mu=!1}(e,n),Au(n,e),Ri(gs),or=!!ms,gs=ms=null,e.current=n,ju(n),dn(),zu=a,Nn=o,Vu.transition=s}else e.current=n;if(ac&&(ac=!1,lc=e,uc=i),s=e.pendingLanes,0===s&&(oc=null),function(e){if(kn&&"function"==typeof kn.onCommitFiberRoot)try{kn.onCommitFiberRoot(wn,e,void 0,!(128&~e.current.flags))}catch(t){}}(n.stateNode),yc(e,fn()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(ic)throw ic=!1,e=sc,sc=null,e;!!(1&uc)&&0!==e.tag&&Dc(),s=e.pendingLanes,1&s?e===hc?cc++:(cc=0,hc=e):cc=0,ro()}(e,t,n,r)}finally{Vu.transition=i,Nn=r}return null}function Dc(){if(null!==lc){var e=Dn(uc),t=Vu.transition,n=Nn;try{if(Vu.transition=null,Nn=16>e?16:e,null===lc)var r=!1;else{if(e=lc,lc=null,uc=0,6&zu)throw Error(we(331));var i=zu;for(zu|=4,du=e.current;null!==du;){var s=du,o=s.child;if(16&du.flags){var a=s.deletions;if(null!==a){for(var l=0;l<a.length;l++){var u=a[l];for(du=u;null!==du;){var c=du;switch(c.tag){case 0:case 11:case 15:gu(8,c,s)}var h=c.child;if(null!==h)h.return=c,du=h;else for(;null!==du;){var d=(c=du).sibling,f=c.return;if(bu(c),c===u){du=null;break}if(null!==d){d.return=f,du=d;break}du=f}}}var p=s.alternate;if(null!==p){var m=p.child;if(null!==m){p.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(null!==m)}}du=s}}if(2064&s.subtreeFlags&&null!==o)o.return=s,du=o;else e:for(;null!==du;){if(2048&(s=du).flags)switch(s.tag){case 0:case 11:case 15:gu(9,s,s.return)}var y=s.sibling;if(null!==y){y.return=s.return,du=y;break e}du=s.return}}var v=e.current;for(du=v;null!==du;){var b=(o=du).child;if(2064&o.subtreeFlags&&null!==b)b.return=o,du=b;else e:for(o=v;null!==du;){if(2048&(a=du).flags)try{switch(a.tag){case 0:case 11:case 15:yu(9,a)}}catch(k){Uc(a,a.return,k)}if(a===o){du=null;break e}var w=a.sibling;if(null!==w){w.return=a.return,du=w;break e}du=a.return}}if(zu=i,ro(),kn&&"function"==typeof kn.onPostCommitFiberRoot)try{kn.onPostCommitFiberRoot(wn,e)}catch(k){}r=!0}return r}finally{Nn=n,Vu.transition=t}}return!1}function Mc(e,t,n){e=ta(e,t=Cl(0,t=El(n,t),1),1),t=pc(),null!==e&&(Ln(e,1,t),yc(e,t))}function Uc(e,t,n){if(3===e.tag)Mc(e,e,n);else for(;null!==t;){if(3===t.tag){Mc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===oc||!oc.has(r))){t=ta(t,e=Pl(t,e=El(n,e),1),1),e=pc(),null!==t&&(Ln(t,1,e),yc(t,e));break}}t=t.return}}function Bc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=pc(),e.pingedLanes|=e.suspendedLanes&n,Wu===e&&(qu&n)===n&&(4===Ju||3===Ju&&(130023424&qu)===qu&&500>fn()-tc?xc(e,0):Qu|=n),yc(e,t)}function Fc(e,t){0===t&&(1&e.mode?(t=xn,!(130023424&(xn<<=1))&&(xn=4194304)):t=1);var n=pc();null!==(e=Yo(e,t))&&(Ln(e,t,n),yc(e,n))}function Vc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Fc(e,n)}function zc(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(we(314))}null!==r&&r.delete(t),Fc(e,n)}function Wc(e,t){return un(e,t)}function Hc(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 qc(e,t,n,r){return new Hc(e,t,n,r)}function Kc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Gc(e,t){var n=e.alternate;return null===n?((n=qc(e.tag,t,e.key,e.mode)).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=14680064&e.flags,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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Jc(e,t,n,r,i,s){var o=2;if(r=e,"function"==typeof e)Kc(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case Ue:return $c(n.children,i,s,t);case Be:o=8,i|=8;break;case Fe:return(e=qc(12,n,t,2|i)).elementType=Fe,e.lanes=s,e;case He:return(e=qc(13,n,t,i)).elementType=He,e.lanes=s,e;case qe:return(e=qc(19,n,t,i)).elementType=qe,e.lanes=s,e;case Je:return Yc(n,i,s,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case Ve:o=10;break e;case ze:o=9;break e;case We:o=11;break e;case Ke:o=14;break e;case Ge:o=16,r=null;break e}throw Error(we(130,null==e?e:typeof e,""))}return(t=qc(o,n,t,i)).elementType=e,t.type=r,t.lanes=s,t}function $c(e,t,n,r){return(e=qc(7,e,r,t)).lanes=n,e}function Yc(e,t,n,r){return(e=qc(22,e,r,t)).elementType=Je,e.lanes=n,e.stateNode={isHidden:!1},e}function Xc(e,t,n){return(e=qc(6,e,null,t)).lanes=n,e}function Qc(e,t,n){return(t=qc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zc(e,t,n,r,i){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=jn(0),this.expirationTimes=jn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jn(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function eh(e,t,n,r,i,s,o,a,l){return e=new Zc(e,t,n,a,l),1===t?(t=1,!0===s&&(t|=8)):t=0,s=qc(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qo(s),e}function th(e){if(!e)return zs;e:{if(rn(e=e._reactInternals)!==e||1!==e.tag)throw Error(we(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Gs(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(we(171))}if(1===e.tag){var n=e.type;if(Gs(n))return Ys(e,n,t)}return t}function nh(e,t,n,r,i,s,o,a,l){return(e=eh(n,r,!0,e,0,s,0,a,l)).context=th(null),n=e.current,(s=ea(r=pc(),i=mc(n))).callback=null!=t?t:null,ta(n,s,i),e.current.lanes=i,Ln(e,i,r),yc(e,r),e}function rh(e,t,n,r){var i=t.current,s=pc(),o=mc(i);return n=th(n),null===t.context?t.context=n:t.pendingContext=n,(t=ea(s,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=ta(i,t,o))&&(gc(e,i,o,s),na(e,i,o)),o}function ih(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function sh(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function oh(e,t){sh(e,t),(e=e.alternate)&&sh(e,t)}Mu=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Hs.current)Ll=!0;else{if(0===(e.lanes&n)&&!(128&t.flags))return Ll=!1,function(e,t,n){switch(t.tag){case 3:Wl(t),Ro();break;case 5:fa(t);break;case 1:Gs(t.type)&&Xs(t);break;case 4:ha(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Vs(Uo,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Vs(ma,1&ma.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Xl(e,t,n):(Vs(ma,1&ma.current),null!==(e=iu(e,t,n))?e.sibling:null);Vs(ma,1&ma.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return nu(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vs(ma,ma.current),r)break;return null;case 22:case 23:return t.lanes=0,Ul(e,t,n)}return iu(e,t,n)}(e,t,n);Ll=!!(131072&e.flags)}else Ll=!1,wo&&1048576&t.flags&&mo(t,ao,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ru(e,t),e=t.pendingProps;var i=Ks(t,Ws.current);qo(t,n),i=Oa(null,t,r,e,i,n);var s=ja();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Gs(r)?(s=!0,Xs(t)):s=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Qo(t),i.updater=bl,t.stateNode=i,i._reactInternals=t,_l(t,r,e,n),t=zl(null,t,r,!0,s,n)):(t.tag=0,wo&&s&&go(t),Il(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ru(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return Kc(e)?1:0;if(null!=e){if((e=e.$$typeof)===We)return 11;if(e===Ke)return 14}return 2}(r),e=yl(r,e),i){case 0:t=Fl(null,t,r,e,n);break e;case 1:t=Vl(null,t,r,e,n);break e;case 11:t=Nl(null,t,r,e,n);break e;case 14:t=Dl(null,t,r,yl(r.type,e),n);break e}throw Error(we(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,Fl(e,t,r,i=t.elementType===r?i:yl(r,i),n);case 1:return r=t.type,i=t.pendingProps,Vl(e,t,r,i=t.elementType===r?i:yl(r,i),n);case 3:e:{if(Wl(t),null===e)throw Error(we(387));r=t.pendingProps,i=(s=t.memoizedState).element,Zo(e,t),ia(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated){if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=Hl(e,t,r,n,i=El(Error(we(423)),t));break e}if(r!==i){t=Hl(e,t,r,n,i=El(Error(we(424)),t));break e}for(bo=Es(t.stateNode.containerInfo.firstChild),vo=t,wo=!0,ko=null,n=Mo(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Ro(),r===i){t=iu(e,t,n);break e}Il(e,t,r,n)}t=t.child}return t;case 5:return fa(t),null===e&&To(t),r=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,o=i.children,ys(r,i)?o=null:null!==s&&ys(r,s)&&(t.flags|=32),Bl(e,t),Il(e,t,o,n),t.child;case 6:return null===e&&To(t),null;case 13:return Xl(e,t,n);case 4:return ha(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Do(t,null,r,n):Il(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Nl(e,t,r,i=t.elementType===r?i:yl(r,i),n);case 7:return Il(e,t,t.pendingProps,n),t.child;case 8:case 12:return Il(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Vs(Uo,r._currentValue),r._currentValue=o,null!==s)if(Si(s.value,o)){if(s.children===i.children&&!Hs.current){t=iu(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var a=s.dependencies;if(null!==a){o=s.child;for(var l=a.firstContext;null!==l;){if(l.context===r){if(1===s.tag){(l=ea(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var c=(u=u.shared).pending;null===c?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),Ho(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(10===s.tag)o=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(o=s.return))throw Error(we(341));o.lanes|=n,null!==(a=o.alternate)&&(a.lanes|=n),Ho(o,n,t),o=s.sibling}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===t){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}Il(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,qo(t,n),r=r(i=Ko(i)),t.flags|=1,Il(e,t,r,n),t.child;case 14:return i=yl(r=t.type,t.pendingProps),Dl(e,t,r,i=yl(r.type,i),n);case 15:return Ml(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yl(r,i),ru(e,t),t.tag=1,Gs(r)?(e=!0,Xs(t)):e=!1,qo(t,n),kl(t,r,i),_l(t,r,i,n),zl(null,t,r,!0,e,n);case 19:return nu(e,t,n);case 22:return Ul(e,t,n)}throw Error(we(156,t.tag))};var ah="function"==typeof reportError?reportError:function(e){};function lh(e){this._internalRoot=e}function uh(e){this._internalRoot=e}function ch(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function hh(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function dh(){}function fh(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if("function"==typeof i){var a=i;i=function(){var e=ih(o);a.call(e)}}rh(t,o,e,i)}else o=function(e,t,n,r,i){if(i){if("function"==typeof r){var s=r;r=function(){var e=ih(o);s.call(e)}}var o=nh(t,r,e,0,null,!1,0,"",dh);return e._reactRootContainer=o,e[Rs]=o.current,rs(8===e.nodeType?e.parentNode:e),Ec(),o}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var a=r;r=function(){var e=ih(l);a.call(e)}}var l=eh(e,0,!1,null,0,!1,0,"",dh);return e._reactRootContainer=l,e[Rs]=l.current,rs(8===e.nodeType?e.parentNode:e),Ec(function(){rh(t,l,n,r)}),l}(n,t,e,i,r);return ih(o)}uh.prototype.render=lh.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(we(409));rh(e,t,null,null)},uh.prototype.unmount=lh.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Ec(function(){rh(null,e,null,null)}),t[Rs]=null}},uh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$n.length&&0!==t&&t<$n[n].priority;n++);$n.splice(n,0,e),0===n&&Zn(e)}},Mn=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Cn(t.pendingLanes);0!==n&&(In(t,1|n),yc(t,fn()),!(6&zu)&&(nc=fn()+500,ro()))}break;case 13:Ec(function(){var t=Yo(e,1);if(null!==t){var n=pc();gc(t,e,1,n)}}),oh(e,1)}},Un=function(e){if(13===e.tag){var t=Yo(e,134217728);if(null!==t)gc(t,e,134217728,pc());oh(e,134217728)}},Bn=function(e){if(13===e.tag){var t=mc(e),n=Yo(e,t);if(null!==n)gc(n,e,t,pc());oh(e,t)}},Fn=function(){return Nn},Vn=function(e,t){var n=Nn;try{return Nn=e,t()}finally{Nn=n}},Mt=function(e,t,n){switch(t){case"input":if(ft(e,n),t=n.name,"radio"===n.type&&null!=t){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 i=Ds(r);if(!i)throw Error(we(90));lt(r),ft(r,i)}}}break;case"textarea":wt(e,n);break;case"select":null!=(t=n.value)&&yt(e,!!n.multiple,t,!1)}},Wt=_c,Ht=Ec;var ph={usingClientEntryPoint:!1,Events:[Is,Ns,Ds,Vt,zt,_c]},mh={findFiberByHostInstance:Ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gh={bundleType:mh.bundleType,version:mh.version,rendererPackageName:mh.rendererPackageName,rendererConfig:mh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ne.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=an(e))?null:e.stateNode},findFiberByHostInstance:mh.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yh.isDisabled&&yh.supportsFiber)try{wn=yh.inject(gh),kn=yh}catch(Tt){}}pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ph,pe.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ch(t))throw Error(we(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Me,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},pe.createRoot=function(e,t){if(!ch(e))throw Error(we(299));var n=!1,r="",i=ah;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=eh(e,1,!1,null,0,n,0,r,i),e[Rs]=t.current,rs(8===e.nodeType?e.parentNode:e),new lh(t)},pe.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(we(188));throw e=Object.keys(e).join(","),Error(we(268,e))}return e=null===(e=an(t))?null:e.stateNode},pe.flushSync=function(e){return Ec(e)},pe.hydrate=function(e,t,n){if(!hh(t))throw Error(we(200));return fh(null,e,t,!0,n)},pe.hydrateRoot=function(e,t,n){if(!ch(e))throw Error(we(405));var r=null!=n&&n.hydratedSources||null,i=!1,s="",o=ah;if(null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(s=n.identifierPrefix),void 0!==n.onRecoverableError&&(o=n.onRecoverableError)),t=nh(t,null,e,1,null!=n?n:null,i,0,s,o),e[Rs]=t.current,rs(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new uh(t)},pe.render=function(e,t,n){if(!hh(t))throw Error(we(200));return fh(null,e,t,!1,n)},pe.unmountComponentAtNode=function(e){if(!hh(e))throw Error(we(40));return!!e._reactRootContainer&&(Ec(function(){fh(null,null,e,!1,function(){e._reactRootContainer=null,e[Rs]=null})}),!0)},pe.unstable_batchedUpdates=_c,pe.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!hh(n))throw Error(we(200));if(null==e||void 0===e._reactInternals)throw Error(we(38));return fh(e,t,n,!1,r)},pe.version="18.3.1-next-f1338f8080-20240426",function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){}}(),fe.exports=pe;var vh,bh=fe.exports,wh=bh;vh=wh.createRoot,wh.hydrateRoot;var kh="undefined"!=typeof Element,Sh="function"==typeof Map,_h="function"==typeof Set,Eh="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function Th(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,i,s;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!==r--;)if(!Th(e[r],t[r]))return!1;return!0}if(Sh&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(r=s.next()).done;)if(!t.has(r.value[0]))return!1;for(s=e.entries();!(r=s.next()).done;)if(!Th(r.value[1],t.get(r.value[0])))return!1;return!0}if(_h&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(r=s.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Eh&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!==r--;)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&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(kh&&e instanceof Element)return!1;for(r=n;0!==r--;)if(("_owner"!==i[r]&&"__v"!==i[r]&&"__o"!==i[r]||!e.$$typeof)&&!Th(e[i[r]],t[i[r]]))return!1;return!0}return e!=e&&t!=t}var xh=function(e,t){try{return Th(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return!1;throw n}};const Ch=v(xh);var Ph=function(e,t,n,r,i,s,o,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,s,o,a],c=0;(l=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}};const Rh=v(Ph);const Ah=v(function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var u=s[l];if(!a(u))return!1;var c=e[u],h=t[u];if(!1===(i=n?n.call(r,c,h,u):void 0)||void 0===i&&c!==h)return!1}return!0});var Oh=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Oh||{}),jh={rel:["amphtml","canonical","alternate"]},Lh={type:["application/ld+json"]},Ih={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},Nh=Object.values(Oh),Dh={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Mh=Object.entries(Dh).reduce((e,[t,n])=>(e[n]=t,e),{}),Uh="data-rh",Bh="defaultTitle",Fh="defer",Vh="encodeSpecialCharacters",zh="onChangeClientState",Wh="titleTemplate",Hh="prioritizeSeoTags",qh=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},Kh=e=>{let t=qh(e,"title");const n=qh(e,Wh);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=qh(e,Bh);return t||r||void 0},Gh=e=>qh(e,zh)||(()=>{}),Jh=(e,t)=>t.filter(t=>void 0!==t[e]).map(t=>t[e]).reduce((e,t)=>d(d({},e),t),{}),$h=(e,t)=>t.filter(e=>void 0!==e.base).map(e=>e.base).reverse().reduce((t,n)=>{if(!t.length){const r=Object.keys(n);for(let i=0;i<r.length;i+=1){const s=r[i].toLowerCase();if(-1!==e.indexOf(s)&&n[s])return t.concat(n)}}return t},[]),Yh=(e,t,n)=>{const r={};return n.filter(t=>!!Array.isArray(t[e])||(void 0!==t[e]&&("Helmet: ".concat(e,' should be of type "Array". Instead found type "').concat(typeof t[e],'"'),console&&console.warn),!1)).map(t=>t[e]).reverse().reduce((e,n)=>{const i={};n.filter(e=>{let n;const s=Object.keys(e);for(let r=0;r<s.length;r+=1){const i=s[r],o=i.toLowerCase();-1===t.indexOf(o)||"rel"===n&&"canonical"===e[n].toLowerCase()||"rel"===o&&"stylesheet"===e[o].toLowerCase()||(n=o),-1===t.indexOf(i)||"innerHTML"!==i&&"cssText"!==i&&"itemprop"!==i||(n=i)}if(!n||!e[n])return!1;const o=e[n].toLowerCase();return r[n]||(r[n]={}),i[n]||(i[n]={}),!r[n][o]&&(i[n][o]=!0,!0)}).reverse().forEach(t=>e.push(t));const s=Object.keys(i);for(let t=0;t<s.length;t+=1){const e=s[t],n=d(d({},r[e]),i[e]);r[e]=n}return e},[]).reverse()},Xh=(e,t)=>{if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n+=1){if(e[n][t])return!0}return!1},Qh=e=>Array.isArray(e)?e.join(""):e,Zh=(e,t)=>Array.isArray(e)?e.reduce((e,n)=>(((e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1})(n,t)?e.priority.push(n):e.default.push(n),e),{priority:[],default:[]}):{default:e,priority:[]},ed=(e,t)=>f(d({},e),{[t]:void 0}),td=["noscript","script","style"],nd=(e,t=!0)=>!1===t?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),rd=e=>Object.keys(e).reduce((t,n)=>{const r=void 0!==e[n]?"".concat(n,'="').concat(e[n],'"'):"".concat(n);return t?"".concat(t," ").concat(r):r},""),id=(e,t={})=>Object.keys(e).reduce((t,n)=>(t[Dh[n]||n]=e[n],t),t),sd=(e,t)=>t.map((t,n)=>{const r={key:n,[Uh]:!0};return Object.keys(t).forEach(e=>{const n=Dh[e]||e;if("innerHTML"===n||"cssText"===n){const e=t.innerHTML||t.cssText;r.dangerouslySetInnerHTML={__html:e}}else r[n]=t[e]}),ie.createElement(e,r)}),od=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>((e,t,n)=>{const r=id(n,{key:t,[Uh]:!0});return[ie.createElement("title",r,t)]})(0,t.title,t.titleAttributes),toString:()=>((e,t,n,r)=>{const i=rd(n),s=Qh(t);return i?"<".concat(e," ").concat(Uh,'="true" ').concat(i,">").concat(nd(s,r),"</").concat(e,">"):"<".concat(e," ").concat(Uh,'="true">').concat(nd(s,r),"</").concat(e,">")})(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>id(t),toString:()=>rd(t)};default:return{toComponent:()=>sd(e,t),toString:()=>((e,t,n=!0)=>t.reduce((t,r)=>{const i=r,s=Object.keys(i).filter(e=>!("innerHTML"===e||"cssText"===e)).reduce((e,t)=>{const r=void 0===i[t]?t:"".concat(t,'="').concat(nd(i[t],n),'"');return e?"".concat(e," ").concat(r):r},""),o=i.innerHTML||i.cssText||"",a=-1===td.indexOf(e);return"".concat(t,"<").concat(e," ").concat(Uh,'="true" ').concat(s).concat(a?"/>":">".concat(o,"</").concat(e,">"))},""))(e,t,n)}}},ad=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:s,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:c,metaTags:h,scriptTags:d}=e,f={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:f,linkTags:c,metaTags:h,scriptTags:d}=(({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=Zh(e,Ih),s=Zh(t,jh),o=Zh(n,Lh);return{priorityMethods:{toComponent:()=>[...sd("meta",i.priority),...sd("link",s.priority),...sd("script",o.priority)],toString:()=>"".concat(od("meta",i.priority,r)," ").concat(od("link",s.priority,r)," ").concat(od("script",o.priority,r))},metaTags:i.default,linkTags:s.default,scriptTags:o.default}})(e)),{priority:f,base:od("base",t,r),bodyAttributes:od("bodyAttributes",n,r),htmlAttributes:od("htmlAttributes",i,r),link:od("link",c,r),meta:od("meta",h,r),noscript:od("noscript",s,r),script:od("script",d,r),style:od("style",o,r),title:od("title",{title:a,titleAttributes:l},r)}},ld=[],ud=!("undefined"==typeof window||!window.document||!window.document.createElement),cd=class{constructor(e,t){m(this,"instances",[]),m(this,"canUseDOM",ud),m(this,"context"),m(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?ld:this.instances,add:e=>{(this.canUseDOM?ld:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?ld:this.instances).indexOf(e);(this.canUseDOM?ld:this.instances).splice(t,1)}}}),this.context=e,this.canUseDOM=t||!1,t||(e.helmet=ad({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},hd=ie.createContext({}),dd=(e=class extends re.Component{constructor(t){super(t),m(this,"helmetData"),this.helmetData=new cd(this.props.context||{},e.canUseDOM)}render(){return ie.createElement(hd.Provider,{value:this.helmetData.value},this.props.children)}},m(e,"canUseDOM",ud),e),fd=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll("".concat(e,"[").concat(Uh,"]")),i=[].slice.call(r),s=[];let o;return t&&t.length&&t.forEach(t=>{const n=document.createElement(e);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))if("innerHTML"===e)n.innerHTML=t.innerHTML;else if("cssText"===e)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{const r=e,i=void 0===t[r]?"":t[r];n.setAttribute(e,i)}n.setAttribute(Uh,"true"),i.some((e,t)=>(o=t,n.isEqualNode(e)))?i.splice(o,1):s.push(n)}),i.forEach(e=>{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),s.forEach(e=>n.appendChild(e)),{oldTags:i,newTags:s}},pd=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Uh),i=r?r.split(","):[],s=[...i],o=Object.keys(t);for(const a of o){const e=t[a]||"";n.getAttribute(a)!==e&&n.setAttribute(a,e),-1===i.indexOf(a)&&i.push(a);const r=s.indexOf(a);-1!==r&&s.splice(r,1)}for(let a=s.length-1;a>=0;a-=1)n.removeAttribute(s[a]);i.length===s.length?n.removeAttribute(Uh):n.getAttribute(Uh)!==o.join(",")&&n.setAttribute(Uh,o.join(","))},md=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:s,metaTags:o,noscriptTags:a,onChangeClientState:l,scriptTags:u,styleTags:c,title:h,titleAttributes:d}=e;pd("body",r),pd("html",i),((e,t)=>{void 0!==e&&document.title!==e&&(document.title=Qh(e)),pd("title",t)})(h,d);const f={baseTag:fd("base",n),linkTags:fd("link",s),metaTags:fd("meta",o),noscriptTags:fd("noscript",a),scriptTags:fd("script",u),styleTags:fd("style",c)},p={},m={};Object.keys(f).forEach(e=>{const{newTags:t,oldTags:n}=f[e];t.length&&(p[e]=t),n.length&&(m[e]=f[e].oldTags)}),t&&t(),l(e,p,m)},gd=null,yd=e=>{gd&&cancelAnimationFrame(gd),e.defer?gd=requestAnimationFrame(()=>{md(e,()=>{gd=null})}):(md(e),gd=null)},vd=class extends re.Component{constructor(){super(...arguments),m(this,"rendered",!1)}shouldComponentUpdate(e){return!Ah(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:t}=this.props.context;let n=null;const r=(i=e.get().map(e=>{const t=d({},e.props);return delete t.context,t}),{baseTag:$h(["href"],i),bodyAttributes:Jh("bodyAttributes",i),defer:qh(i,Fh),encode:qh(i,Vh),htmlAttributes:Jh("htmlAttributes",i),linkTags:Yh("link",["rel","href"],i),metaTags:Yh("meta",["name","charset","http-equiv","property","itemprop"],i),noscriptTags:Yh("noscript",["innerHTML"],i),onChangeClientState:Gh(i),scriptTags:Yh("script",["src","innerHTML"],i),styleTags:Yh("style",["cssText"],i),title:Kh(i),titleAttributes:Jh("titleAttributes",i),prioritizeSeoTags:Xh(i,Hh)});var i;dd.canUseDOM?yd(r):ad&&(n=ad(r)),t(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},bd=(t=class extends re.Component{shouldComponentUpdate(e){return!Ch(ed(this.props,"helmetData"),ed(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error("<".concat(e.type," /> elements are self-closing and can not contain children. Refer to our API for more information."))}}flattenArrayTypeChildren(e,t,n,r){return f(d({},t),{[e.type]:[...t[e.type]||[],d(d({},n),this.mapNestedChildrenToProps(e,r))]})}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return f(d({},t),{[e.type]:r,titleAttributes:d({},n)});case"body":return f(d({},t),{bodyAttributes:d({},n)});case"html":return f(d({},t),{htmlAttributes:d({},n)});default:return f(d({},t),{[e.type]:d({},n)})}}mapArrayTypeChildrenToProps(e,t){let n=d({},t);return Object.keys(e).forEach(t=>{n=f(d({},n),{[t]:e[t]})}),n}warnOnInvalidChildren(e,t){return Rh(Nh.some(t=>e.type===t),"function"==typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types ".concat(Nh.join(", ")," are allowed. Helmet does not support rendering <").concat(e.type,"> elements. Refer to our API for more information.")),Rh(!t||"string"==typeof t||Array.isArray(t)&&!t.some(e=>"string"!=typeof e),"Helmet expects a string as a child of <".concat(e.type,">. Did you forget to wrap your children in braces? ( <").concat(e.type,">{``}</").concat(e.type,"> ) Refer to our API for more information.")),!0}mapChildrenToProps(e,t){let n={};return ie.Children.forEach(e,e=>{if(!e||!e.props)return;const r=e.props,{children:i}=r,s=p(r,["children"]),o=Object.keys(s).reduce((e,t)=>(e[Mh[t]||t]=s[t],e),{});let{type:a}=e;switch("symbol"==typeof a?a=a.toString():this.warnOnInvalidChildren(e,i),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(e,n,o,i);break;default:t=this.mapObjectTypeChildren(e,t,o,i)}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const e=this.props,{children:t}=e,n=p(e,["children"]);let r=d({},n),{helmetData:i}=n;if(t&&(r=this.mapChildrenToProps(t,r)),i&&!(i instanceof cd)){i=new cd(i.context,!0),delete r.helmetData}return i?ie.createElement(vd,f(d({},r),{context:i.value})):ie.createElement(hd.Consumer,null,e=>ie.createElement(vd,f(d({},r),{context:e})))}},m(t,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),t),wd="popstate";function kd(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Sd(e={}){return function(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a="POP",l=null,u=c();null==u&&(u=0,o.replaceState(f(d({},o.state),{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function h(){a="POP";let e=c(),t=null==e?null:e-u;u=e,l&&l({action:a,location:y.location,delta:t})}function p(e,t){a="PUSH";let n=kd(e)?e:xd(y.location,e,t);u=c()+1;let r=Td(n,u),h=y.createHref(n.unstable_mask||n);try{o.pushState(r,"",h)}catch(d){if(d instanceof DOMException&&"DataCloneError"===d.name)throw d;i.location.assign(h)}s&&l&&l({action:a,location:y.location,delta:1})}function m(e,t){a="REPLACE";let n=kd(e)?e:xd(y.location,e,t);u=c();let r=Td(n,u),i=y.createHref(n.unstable_mask||n);o.replaceState(r,"",i),s&&l&&l({action:a,location:y.location,delta:0})}function g(e){return function(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href);_d(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:Cd(e);r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r);return new URL(r,n)}(e)}let y={get action(){return a},get location(){return e(i,o)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(wd,h),l=e,()=>{i.removeEventListener(wd,h),l=null}},createHref:e=>t(i,e),createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:p,replace:m,go:e=>o.go(e)};return y}(function(e,t){var n;let r=null==(n=t.state)?void 0:n.masked,{pathname:i,search:s,hash:o}=r||e.location;return xd("",{pathname:i,search:s,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",r?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:Cd(t)},0,e)}function _d(e,t){if(!1===e||null==e)throw new Error(t)}function Ed(e,t){if(!e)try{throw new Error(t)}catch(n){}}function Td(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function xd(e,t,n=null,r,i){return f(d({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?Pd(t):t),{state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),unstable_mask:i})}function Cd({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function Pd(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Rd(e,t,n="/"){return function(e,t,n,r){let i="string"==typeof t?Pd(t):t,s=Wd(i.pathname||"/",n);if(null==s)return null;let o=Ad(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let a=null;for(let l=0;null==a&&l<o.length;++l){let e=zd(s);a=Fd(o[l],e,r)}return a}(e,t,n,!1)}function Ad(e,t=[],n=[],r="",i=!1){let s=(e,s,o=i,a)=>{let l={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:s,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(r)&&o)return;_d(l.relativePath.startsWith(r),'Absolute route path "'.concat(l.relativePath,'" nested under path "').concat(r,'" is not valid. An absolute child route path must start with the combined path of all its parent routes.')),l.relativePath=l.relativePath.slice(r.length)}let u=Yd([r,l.relativePath]),c=n.concat(l);e.children&&e.children.length>0&&(_d(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'.concat(u,'".')),Ad(e.children,t,c,u,o)),(null!=e.path||e.index)&&t.push({path:u,score:Bd(u,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(""!==e.path&&(null==(n=e.path)?void 0:n.includes("?")))for(let r of Od(e.path))s(e,t,!0,r);else s(e,t)}),t}function Od(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(0===r.length)return i?[s,""]:[s];let o=Od(r.join("/")),a=[];return a.push(...o.map(e=>""===e?s:[s,e].join("/"))),i&&a.push(...o),a.map(t=>e.startsWith("/")&&""===t?"/":t)}var jd=/^:[\w-]+$/,Ld=3,Id=2,Nd=1,Dd=10,Md=-2,Ud=e=>"*"===e;function Bd(e,t){let n=e.split("/"),r=n.length;return n.some(Ud)&&(r+=Md),t&&(r+=Id),n.filter(e=>!Ud(e)).reduce((e,t)=>e+(jd.test(t)?Ld:""===t?Nd:Dd),r)}function Fd(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let e=r[a],l=a===r.length-1,u="/"===s?t:t.slice(s.length)||"/",c=Vd({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},u),h=e.route;if(!c&&l&&n&&!r[r.length-1].route.index&&(c=Vd({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},u)),!c)return null;Object.assign(i,c.params),o.push({params:i,pathname:Yd([s,c.pathname]),pathnameBase:Qd(Yd([s,c.pathnameBase])),route:h}),"/"!==c.pathnameBase&&(s=Yd([s,c.pathnameBase]))}return o}function Vd(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){Ed("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'.concat(e,'" will be treated as if it were "').concat(e.replace(/\*$/,"/*"),'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "').concat(e.replace(/\*$/,"/*"),'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,s)=>{if(r.push({paramName:t,isOptional:null!=n}),n){let t=s.charAt(i+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");let s=new RegExp(i,t?void 0:"i");return[s,r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=a[r]||"";o=s.slice(0,s.length-e.length).replace(/(.)\/+$/,"$1")}const i=a[r];return e[t]=n&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:s,pathnameBase:o,pattern:e}}function zd(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return Ed(!1,'The URL path "'.concat(e,'" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (').concat(t,").")),e}}function Wd(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)||"/"}var Hd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function qd(e,t){let n=Xd(t).split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function Kd(e,t,n,r){return"Cannot include a '".concat(e,"' character in a manually specified `to.").concat(t,"` field [").concat(JSON.stringify(r),"]. Please separate it out to the `to.").concat(n,'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.')}function Gd(e){let t=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Jd(e,t,n,r=!1){let i;"string"==typeof e?i=Pd(e):(i=d({},e),_d(!i.pathname||!i.pathname.includes("?"),Kd("?","pathname","search",i)),_d(!i.pathname||!i.pathname.includes("#"),Kd("#","pathname","hash",i)),_d(!i.search||!i.search.includes("#"),Kd("#","search","hash",i)));let s,o=""===e||""===i.pathname,a=o?"/":i.pathname;if(null==a)s=n;else{let e=t.length-1;if(!r&&a.startsWith("..")){let t=a.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}s=e>=0?t[e]:"/"}let l=function(e,t="/"){let n,{pathname:r,search:i="",hash:s=""}="string"==typeof e?Pd(e):e;return r?(r=$d(r),n=r.startsWith("/")?qd(r.substring(1),"/"):qd(r,t)):n=t,{pathname:n,search:Zd(i),hash:ef(s)}}(i,s),u=a&&"/"!==a&&a.endsWith("/"),c=(o||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!u&&!c||(l.pathname+="/"),l}var $d=e=>e.replace(/\/\/+/g,"/"),Yd=e=>$d(e.join("/")),Xd=e=>e.replace(/\/+$/,""),Qd=e=>Xd(e).replace(/^\/*/,"/"),Zd=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ef=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",tf=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function nf(e){let t=e.map(e=>e.route.path).filter(Boolean);return Yd(t)||"/"}var rf="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function sf(e,t){let n=e;if("string"!=typeof n||!Hd.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(rf)try{let e=new URL(window.location.href),r=n.startsWith("//")?new URL(e.protocol+n):new URL(n),s=Wd(r.pathname,t);r.origin===e.origin&&null!=s?n=s+r.search+r.hash:i=!0}catch(s){Ed(!1,'<Link to="'.concat(n,'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.'))}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var of=["POST","PUT","PATCH","DELETE"];new Set(of);var af=["GET",...of];new Set(af);var lf=re.createContext(null);lf.displayName="DataRouter";var uf=re.createContext(null);uf.displayName="DataRouterState";var cf=re.createContext(!1);var hf=re.createContext({isTransitioning:!1});hf.displayName="ViewTransition",re.createContext(new Map).displayName="Fetchers",re.createContext(null).displayName="Await";var df=re.createContext(null);df.displayName="Navigation";var ff=re.createContext(null);ff.displayName="Location";var pf=re.createContext({outlet:null,matches:[],isDataRoute:!1});pf.displayName="Route";var mf=re.createContext(null);mf.displayName="RouteError";var gf="REACT_ROUTER_ERROR";function yf(){return null!=re.useContext(ff)}function vf(){return _d(yf(),"useLocation() may be used only in the context of a <Router> component."),re.useContext(ff).location}var bf="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wf(e){re.useContext(df).static||re.useLayoutEffect(e)}function kf(){let{isDataRoute:e}=re.useContext(pf);return e?function(){let{router:e}=function(e){let t=re.useContext(lf);return _d(t,Of(e)),t}("useNavigate"),t=jf("useNavigate"),n=re.useRef(!1);return wf(()=>{n.current=!0}),re.useCallback((r,...i)=>y(this,[r,...i],function*(r,i={}){Ed(n.current,bf),n.current&&("number"==typeof r?yield e.navigate(r):yield e.navigate(r,d({fromRouteId:t},i)))}),[e,t])}():function(){_d(yf(),"useNavigate() may be used only in the context of a <Router> component.");let e=re.useContext(lf),{basename:t,navigator:n}=re.useContext(df),{matches:r}=re.useContext(pf),{pathname:i}=vf(),s=JSON.stringify(Gd(r)),o=re.useRef(!1);return wf(()=>{o.current=!0}),re.useCallback((r,a={})=>{if(Ed(o.current,bf),!o.current)return;if("number"==typeof r)return void n.go(r);let l=Jd(r,JSON.parse(s),i,"path"===a.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:Yd([t,l.pathname])),(a.replace?n.replace:n.push)(l,a.state,a)},[t,n,s,i,e])}()}function Sf(){var e;let{matches:t}=re.useContext(pf),n=t[t.length-1];return null!=(e=null==n?void 0:n.params)?e:{}}function _f(e,{relative:t}={}){let{matches:n}=re.useContext(pf),{pathname:r}=vf(),i=JSON.stringify(Gd(n));return re.useMemo(()=>Jd(e,JSON.parse(i),r,"path"===t),[e,i,r,t])}function Ef(e,t,n){var r;_d(yf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=re.useContext(df),{matches:s}=re.useContext(pf),o=s[s.length-1],a=o?o.params:{},l=o?o.pathname:"/",u=o?o.pathnameBase:"/",c=o&&o.route;{let e=c&&c.path||"";If(l,!c||e.endsWith("*")||e.endsWith("*?"),'You rendered descendant <Routes> (or called `useRoutes()`) at "'.concat(l,'" (under <Route path="').concat(e,'">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="').concat(e,'"> to <Route path="').concat("/"===e?"*":"".concat(e,"/*"),'">.'))}let h,f=vf();if(t){let e="string"==typeof t?Pd(t):t;_d("/"===u||(null==(r=e.pathname)?void 0:r.startsWith(u)),'When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'.concat(u,'" but pathname "').concat(e.pathname,'" was given in the `location` prop.')),h=e}else h=f;let p=h.pathname||"/",m=p;if("/"!==u){let e=u.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=Rd(e,{pathname:m});Ed(c||null!=g,'No routes matched location "'.concat(h.pathname).concat(h.search).concat(h.hash,'" ')),Ed(null==g||void 0!==g[g.length-1].route.element||void 0!==g[g.length-1].route.Component||void 0!==g[g.length-1].route.lazy,'Matched leaf route at location "'.concat(h.pathname).concat(h.search).concat(h.hash,'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.'));let y=function(e,t=[],n){let r=null==n?void 0:n.state;if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let i=e,s=null==r?void 0:r.errors;if(null!=s){let e=i.findIndex(e=>e.route.id&&void 0!==(null==s?void 0:s[e.route.id]));_d(e>=0,"Could not find a matching route for errors on route IDs: ".concat(Object.keys(s).join(","))),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,a=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(a=e),t.route.id){let{loaderData:e,errors:s}=r,l=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!s||void 0===s[t.route.id]);if(t.route.lazy||l){n.isStatic&&(o=!0),i=a>=0?i.slice(0,a+1):[i[0]];break}}}}let l=null==n?void 0:n.onError,u=r&&l?(e,t)=>{var n,i,s;l(e,{location:r.location,params:null!=(s=null==(i=null==(n=r.matches)?void 0:n[0])?void 0:i.params)?s:{},unstable_pattern:nf(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,l)=>{let c,h=!1,d=null,f=null;r&&(c=s&&n.route.id?s[n.route.id]:void 0,d=n.route.errorElement||xf,o&&(a<0&&0===l?(If("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,f=null):a===l&&(h=!0,f=n.route.hydrateFallbackElement||null)));let p=t.concat(i.slice(0,l+1)),m=()=>{let t;return t=c?d:h?f:n.route.Component?re.createElement(n.route.Component,null):n.route.element?n.route.element:e,re.createElement(Af,{match:n,routeContext:{outlet:e,matches:p,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===l)?re.createElement(Cf,{location:r.location,revalidation:r.revalidation,component:d,error:c,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):m()},null)}(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},a,e.params),pathname:Yd([u,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:Yd([u,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),s,n);return t&&y?re.createElement(ff.Provider,{value:{location:d({pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0},h),navigationType:"POP"}},y):y}function Tf(){let e=function(){var e;let t=re.useContext(mf),n=function(e){let t=re.useContext(uf);return _d(t,Of(e)),t}("useRouteError"),r=jf("useRouteError");if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?"".concat(e.status," ").concat(e.statusText):e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return o=re.createElement(re.Fragment,null,re.createElement("p",null,"💿 Hey developer 👋"),re.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",re.createElement("code",{style:s},"ErrorBoundary")," or"," ",re.createElement("code",{style:s},"errorElement")," prop on your route.")),re.createElement(re.Fragment,null,re.createElement("h2",null,"Unexpected Application Error!"),re.createElement("h3",{style:{fontStyle:"italic"}},t),n?re.createElement("pre",{style:i},n):null,o)}re.createContext(null);var xf=re.createElement(Tf,null),Cf=class extends re.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=function(e){if(e.startsWith("".concat(gf,":").concat("ROUTE_ERROR_RESPONSE",":{")))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new tf(t.status,t.statusText,t.data)}catch(t){}}(e.digest);t&&(e=t)}let t=void 0!==e?re.createElement(pf.Provider,{value:this.props.routeContext},re.createElement(mf.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?re.createElement(Rf,{error:e},t):t}};Cf.contextType=cf;var Pf=new WeakMap;function Rf({children:e,error:t}){let{basename:n}=re.useContext(df);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith("".concat(gf,":").concat("REDIRECT",":{")))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch(t){}}(t.digest);if(e){let r=Pf.get(t);if(r)throw r;let i=sf(e.location,n);if(rf&&!Pf.get(t)){if(!i.isExternal&&!e.reloadDocument){const n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Pf.set(t,n),n}window.location.href=i.absoluteURL||i.to}return re.createElement("meta",{httpEquiv:"refresh",content:"0;url=".concat(i.absoluteURL||i.to)})}}return e}function Af({routeContext:e,match:t,children:n}){let r=re.useContext(lf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),re.createElement(pf.Provider,{value:e},n)}function Of(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}function jf(e){let t=function(e){let t=re.useContext(pf);return _d(t,Of(e)),t}(e),n=t.matches[t.matches.length-1];return _d(n.route.id,"".concat(e,' can only be used on routes that contain a unique "id"')),n.route.id}var Lf={};function If(e,t,n){t||Lf[e]||(Lf[e]=!0,Ed(!1,n))}function Nf({to:e,replace:t,state:n,relative:r}){_d(yf(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=re.useContext(df);Ed(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=re.useContext(pf),{pathname:o}=vf(),a=kf(),l=Jd(e,Gd(s),o,"path"===r),u=JSON.stringify(l);return re.useEffect(()=>{a(JSON.parse(u),{replace:t,state:n,relative:r})},[a,u,r,t,n]),null}function Df(e){_d(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Mf({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:o}){_d(!yf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=re.useMemo(()=>({basename:a,navigator:i,static:s,unstable_useTransitions:o,future:{}}),[a,i,s,o]);"string"==typeof n&&(n=Pd(n));let{pathname:u="/",search:c="",hash:h="",state:d=null,key:f="default",unstable_mask:p}=n,m=re.useMemo(()=>{let e=Wd(u,a);return null==e?null:{location:{pathname:e,search:c,hash:h,state:d,key:f,unstable_mask:p},navigationType:r}},[a,u,c,h,d,f,r,p]);return Ed(null!=m,'<Router basename="'.concat(a,'"> is not able to match the URL "').concat(u).concat(c).concat(h,"\" because it does not start with the basename, so the <Router> won't render anything.")),null==m?null:re.createElement(df.Provider,{value:l},re.createElement(ff.Provider,{children:t,value:m}))}function Uf({children:e,location:t}){return Ef(Bf(e),t)}function Bf(e,t=[]){let n=[];return re.Children.forEach(e,(e,r)=>{if(!re.isValidElement(e))return;let i=[...t,r];if(e.type===re.Fragment)return void n.push.apply(n,Bf(e.props.children,i));_d(e.type===Df,"[".concat("string"==typeof e.type?e.type:e.type.name,"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>")),_d(!e.props.index||!e.props.children,"An index route cannot have child routes.");let s={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=Bf(e.props.children,i)),n.push(s)}),n}re.memo(function({routes:e,future:t,state:n,isStatic:r,onError:i}){return Ef(e,void 0,{state:n,isStatic:r,onError:i})});var Ff="get",Vf="application/x-www-form-urlencoded";function zf(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}var Wf=null;var Hf=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qf(e){return null==e||Hf.has(e)?e:(Ed(!1,'"'.concat(e,'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` and will default to "').concat(Vf,'"')),null)}function Kf(e,t){let n,r,i,s,o;if(zf(a=e)&&"form"===a.tagName.toLowerCase()){let o=e.getAttribute("action");r=o?Wd(o,t):null,n=e.getAttribute("method")||Ff,i=qf(e.getAttribute("enctype"))||Vf,s=new FormData(e)}else if(function(e){return zf(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return zf(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let o=e.form;if(null==o)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||o.getAttribute("action");if(r=a?Wd(a,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||Ff,i=qf(e.getAttribute("formenctype"))||qf(o.getAttribute("enctype"))||Vf,s=new FormData(o,e),!function(){if(null===Wf)try{new FormData(document.createElement("form"),0),Wf=!1}catch(e){Wf=!0}return Wf}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?"".concat(t,"."):"";s.append("".concat(e,"x"),"0"),s.append("".concat(e,"y"),"0")}else t&&s.append(t,r)}}else{if(zf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ff,r=null,i=Vf,o=e}var a;return s&&"text/plain"===i&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}function Gf(e,t){if(!1===e||null==e)throw new Error(t)}function Jf(e,t,n,r){let i="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname="".concat(i.pathname,"_.").concat(r):i.pathname="".concat(i.pathname,".").concat(r):"/"===i.pathname?i.pathname="_root.".concat(r):t&&"/"===Wd(i.pathname,t)?i.pathname="".concat(Xd(t),"/_root.").concat(r):i.pathname="".concat(Xd(i.pathname),".").concat(r),i}function $f(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Yf(e,t,n){return y(this,null,function*(){return function(e,t){let n=new Set;return new Set(t),e.reduce((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e},[])}((yield Promise.all(e.map(e=>y(this,null,function*(){let r=t.routes[e.route.id];if(r){let e=yield function(e,t){return y(this,null,function*(){if(e.id in t)return t[e.id];try{let n=yield import(e.module);return t[e.id]=n,n}catch(n){return window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}})}(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter($f).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?f(d({},e),{rel:"prefetch",as:"style"}):f(d({},e),{rel:"prefetch"})))})}function Xf(e,t,n,r,i,s){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,a=(e,t)=>{var r;return n[t].pathname!==e.pathname||(null==(r=n[t].route.path)?void 0:r.endsWith("*"))&&n[t].params["*"]!==e.params["*"]};return"assets"===s?t.filter((e,t)=>o(e,t)||a(e,t)):"data"===s?t.filter((t,s)=>{var l;let u=r.routes[t.route.id];if(!u||!u.hasLoader)return!1;if(o(t,s)||a(t,s))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:(null==(l=n[0])?void 0:l.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0}):[]}function Qf(e,t,{includeHydrateFallback:n}={}){return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1),[...new Set(r)];var r}function Zf(){let e=re.useContext(lf);return Gf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ep=re.createContext(void 0);function tp(){let e=re.useContext(ep);return Gf(e,"You must render this element inside a <HydratedRouter> element"),e}function np(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rp(e){var t=e,{page:n}=t,r=p(t,["page"]);let i=re.useContext(cf),{router:s}=Zf(),o=re.useMemo(()=>Rd(s.routes,n,s.basename),[s.routes,n,s.basename]);return o?i?re.createElement(ip,d({page:n,matches:o},r)):re.createElement(sp,d({page:n,matches:o},r)):null}function ip(e){var t=e,{page:n,matches:r}=t,i=p(t,["page","matches"]);let s=vf(),{future:o}=tp(),{basename:a}=Zf(),l=re.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let e=Jf(n,a,o.unstable_trailingSlashAwareDataRequests,"rsc"),t=!1,i=[];for(let n of r)"function"==typeof n.route.shouldRevalidate?t=!0:i.push(n.route.id);return t&&i.length>0&&e.searchParams.set("_routes",i.join(",")),[e.pathname+e.search]},[a,o.unstable_trailingSlashAwareDataRequests,n,s,r]);return re.createElement(re.Fragment,null,l.map(e=>re.createElement("link",d({key:e,rel:"prefetch",as:"fetch",href:e},i))))}function sp(e){var t=e,{page:n,matches:r}=t,i=p(t,["page","matches"]);let s=vf(),{future:o,manifest:a,routeModules:l}=tp(),{basename:u}=Zf(),{loaderData:c,matches:h}=function(){let e=re.useContext(uf);return Gf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),m=re.useMemo(()=>Xf(n,r,h,a,s,"data"),[n,r,h,a,s]),g=re.useMemo(()=>Xf(n,r,h,a,s,"assets"),[n,r,h,a,s]),y=re.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let e=new Set,t=!1;if(r.forEach(n=>{var r;let i=a.routes[n.route.id];i&&i.hasLoader&&(!m.some(e=>e.route.id===n.route.id)&&n.route.id in c&&(null==(r=l[n.route.id])?void 0:r.shouldRevalidate)||i.hasClientLoader?t=!0:e.add(n.route.id))}),0===e.size)return[];let i=Jf(n,u,o.unstable_trailingSlashAwareDataRequests,"data");return t&&e.size>0&&i.searchParams.set("_routes",r.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[i.pathname+i.search]},[u,o.unstable_trailingSlashAwareDataRequests,c,s,a,m,r,n,l]),v=re.useMemo(()=>Qf(g,a),[g,a]),b=function(e){let{manifest:t,routeModules:n}=tp(),[r,i]=re.useState([]);return re.useEffect(()=>{let r=!1;return Yf(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}(g);return re.createElement(re.Fragment,null,y.map(e=>re.createElement("link",d({key:e,rel:"prefetch",as:"fetch",href:e},i))),v.map(e=>re.createElement("link",d({key:e,rel:"modulepreload",href:e},i))),b.map(({key:e,link:t})=>{var n;return re.createElement("link",f(d({key:e,nonce:i.nonce},t),{crossOrigin:null!=(n=t.crossOrigin)?n:i.crossOrigin}))}))}function op(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}ep.displayName="FrameworkContext";var ap="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{ap&&(window.__reactRouterVersion="7.14.2")}catch(OC){}function lp({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=re.useRef();null==i.current&&(i.current=Sd({window:r,v5Compat:!0}));let s=i.current,[o,a]=re.useState({action:s.action,location:s.location}),l=re.useCallback(e=>{!1===n?a(e):re.startTransition(()=>a(e))},[n]);return re.useLayoutEffect(()=>s.listen(l),[s,l]),re.createElement(Mf,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s,unstable_useTransitions:n})}var up=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cp=re.forwardRef(function(e,t){var n=e,{onClick:r,discover:i="render",prefetch:s="none",relative:o,reloadDocument:a,replace:l,unstable_mask:u,state:c,target:h,to:m,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:v}=n,b=p(n,["onClick","discover","prefetch","relative","reloadDocument","replace","unstable_mask","state","target","to","preventScrollReset","viewTransition","unstable_defaultShouldRevalidate"]);let{basename:w,navigator:k,unstable_useTransitions:S}=re.useContext(df),_="string"==typeof m&&up.test(m),E=sf(m,w),T=function(e,{relative:t}={}){_d(yf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=re.useContext(df),{hash:i,pathname:s,search:o}=_f(e,{relative:t}),a=s;return"/"!==n&&(a="/"===s?n:Yd([n,s])),r.createHref({pathname:a,search:o,hash:i})}(m=E.to,{relative:o}),x=vf(),C=null;if(u){let e=Jd(u,[],x.unstable_mask?x.unstable_mask.pathname:"/",!0);"/"!==w&&(e.pathname="/"===e.pathname?w:Yd([w,e.pathname])),C=k.createHref(e)}let[P,R,A]=function(e,t){let n=re.useContext(ep),[r,i]=re.useState(!1),[s,o]=re.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:h}=t,d=re.useRef(null);re.useEffect(()=>{if("render"===e&&o(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return d.current&&e.observe(d.current),()=>{e.disconnect()}}},[e]),re.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let f=()=>{i(!0)},p=()=>{i(!1),o(!1)};return n?"intent"!==e?[s,d,{}]:[s,d,{onFocus:np(a,f),onBlur:np(l,p),onMouseEnter:np(u,f),onMouseLeave:np(c,p),onTouchStart:np(h,f)}]:[!1,d,{}]}(s,b),O=function(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:s,relative:o,viewTransition:a,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let c=kf(),h=vf(),d=_f(e,{relative:o});return re.useCallback(f=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(f,t)){f.preventDefault();let t=void 0!==n?n:Cd(h)===Cd(d),p=()=>c(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:s,relative:o,viewTransition:a,unstable_defaultShouldRevalidate:l});u?re.startTransition(()=>p()):p()}},[h,c,d,n,r,i,t,e,s,o,a,l,u])}(m,{replace:l,unstable_mask:u,state:c,target:h,preventScrollReset:g,relative:o,viewTransition:y,unstable_defaultShouldRevalidate:v,unstable_useTransitions:S});let j=!(E.isExternal||a),L=re.createElement("a",f(d(d({},b),A),{href:(j?C:void 0)||E.absoluteURL||T,onClick:j?function(e){r&&r(e),e.defaultPrevented||O(e)}:r,ref:op(t,R),target:h,"data-discover":_||"render"!==i?void 0:"true"}));return P&&!_?re.createElement(re.Fragment,null,L,re.createElement(rp,{page:T})):L});function hp(e){let t=re.useContext(lf);return _d(t,function(e){return"".concat(e," must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.")}(e)),t}cp.displayName="Link",re.forwardRef(function(e,t){var n=e,{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:o=!1,style:a,to:l,viewTransition:u,children:c}=n,h=p(n,["aria-current","caseSensitive","className","end","style","to","viewTransition","children"]);let m=_f(l,{relative:h.relative}),g=vf(),y=re.useContext(uf),{navigator:v,basename:b}=re.useContext(df),w=null!=y&&function(e,{relative:t}={}){let n=re.useContext(hf);_d(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=hp("useViewTransitionState"),i=_f(e,{relative:t});if(!n.isTransitioning)return!1;let s=Wd(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Wd(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=Vd(i.pathname,o)||null!=Vd(i.pathname,s)}(m)&&!0===u,k=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,S=g.pathname,_=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;i||(S=S.toLowerCase(),_=_?_.toLowerCase():null,k=k.toLowerCase()),_&&b&&(_=Wd(_,b)||_);const E="/"!==k&&k.endsWith("/")?k.length-1:k.length;let T,x=S===k||!o&&S.startsWith(k)&&"/"===S.charAt(E),C=null!=_&&(_===k||!o&&_.startsWith(k)&&"/"===_.charAt(k.length)),P={isActive:x,isPending:C,isTransitioning:w},R=x?r:void 0;T="function"==typeof s?s(P):[s,x?"active":null,C?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let A="function"==typeof a?a(P):a;return re.createElement(cp,f(d({},h),{"aria-current":R,className:T,ref:t,style:A,to:l,viewTransition:u}),"function"==typeof c?c(P):c)}).displayName="NavLink",re.forwardRef((e,t)=>{var n=e,{discover:r="render",fetcherKey:i,navigate:s,reloadDocument:o,replace:a,state:l,method:u=Ff,action:c,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:v,unstable_defaultShouldRevalidate:b}=n,w=p(n,["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition","unstable_defaultShouldRevalidate"]);let{unstable_useTransitions:k}=re.useContext(df),S=function(){let{router:e}=hp("useSubmit"),{basename:t}=re.useContext(df),n=jf("useRouteId"),r=e.fetch,i=e.navigate;return re.useCallback((e,...s)=>y(this,[e,...s],function*(e,s={}){let{action:o,method:a,encType:l,formData:u,body:c}=Kf(e,t);if(!1===s.navigate){let e=s.fetcherKey||fp();yield r(e,n,s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||a,formEncType:s.encType||l,flushSync:s.flushSync})}else yield i(s.action||o,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||a,formEncType:s.encType||l,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})}),[r,i,t,n])}(),_=function(e,{relative:t}={}){let{basename:n}=re.useContext(df),r=re.useContext(pf);_d(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s=d({},_f(e||".",{relative:t})),o=vf();if(null==e){s.search=o.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();s.search=n?"?".concat(n):""}}e&&"."!==e||!i.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(s.pathname="/"===s.pathname?n:Yd([n,s.pathname]));return Cd(s)}(c,{relative:m}),E="get"===u.toLowerCase()?"get":"post",T="string"==typeof c&&up.test(c);return re.createElement("form",f(d({ref:t,method:E,action:_,onSubmit:o?h:e=>{if(h&&h(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,n=(null==t?void 0:t.getAttribute("formmethod"))||u,r=()=>S(t||e.currentTarget,{fetcherKey:i,method:n,navigate:s,replace:a,state:l,relative:m,preventScrollReset:g,viewTransition:v,unstable_defaultShouldRevalidate:b});k&&!1!==s?re.startTransition(()=>r()):r()}},w),{"data-discover":T||"render"!==r?void 0:"true"}))}).displayName="Form";var dp=0,fp=()=>"__".concat(String(++dp),"__");const pp=re.createContext({});function mp(e){const t=re.useRef(null);return null===t.current&&(t.current=e()),t.current}const gp="undefined"!=typeof window?re.useLayoutEffect:re.useEffect,yp=re.createContext(null);function vp(e,t){-1===e.indexOf(t)&&e.push(t)}function bp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const wp=(e,t,n)=>n>t?t:n<e?e:n;const kp={},Sp=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function _p(e){return"object"==typeof e&&null!==e}const Ep=e=>/^0[^.\s]+$/u.test(e);function Tp(e){let t;return()=>(void 0===t&&(t=e()),t)}const xp=e=>e,Cp=(e,t)=>n=>t(e(n)),Pp=(...e)=>e.reduce(Cp),Rp=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class Ap{constructor(){this.subscriptions=[]}add(e){return vp(this.subscriptions,e),()=>bp(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Op=e=>1e3*e,jp=e=>e/1e3;function Lp(e,t){return t?e*(1e3/t):0}const Ip=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Np(e,t,n,r){if(e===t&&n===r)return xp;const i=t=>function(e,t,n,r,i){let s,o,a=0;do{o=t+(n-t)/2,s=Ip(o,r,i)-e,s>0?n=o:t=o}while(Math.abs(s)>1e-7&&++a<12);return o}(t,0,1,e,n);return e=>0===e||1===e?e:Ip(i(e),t,r)}const Dp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Mp=e=>t=>1-e(1-t),Up=Np(.33,1.53,.69,.99),Bp=Mp(Up),Fp=Dp(Bp),Vp=e=>e>=1?1:(e*=2)<1?.5*Bp(e):.5*(2-Math.pow(2,-10*(e-1))),zp=e=>1-Math.sin(Math.acos(e)),Wp=Mp(zp),Hp=Dp(zp),qp=Np(.42,0,1,1),Kp=Np(0,0,.58,1),Gp=Np(.42,0,.58,1),Jp=e=>Array.isArray(e)&&"number"==typeof e[0],$p={linear:xp,easeIn:qp,easeInOut:Gp,easeOut:Kp,circIn:zp,circInOut:Hp,circOut:Wp,backIn:Bp,backInOut:Fp,backOut:Up,anticipate:Vp},Yp=e=>{if(Jp(e)){e.length;const[t,n,r,i]=e;return Np(t,n,r,i)}return"string"==typeof e?$p[e]:e},Xp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qp(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Xp.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(t){s.has(t)&&(l.schedule(t),e()),t(o)}const l={schedule:(e,i=!1,o=!1)=>{const a=o&&r?t:n;return i&&s.add(e),a.add(e),e},cancel:e=>{n.delete(e),s.delete(e)},process:e=>{if(o=e,r)return void(i=!0);r=!0;const s=t;t=n,n=s,t.forEach(a),t.clear(),r=!1,i&&(i=!1,l.process(e))}};return l}(s),e),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:d,render:f,postRender:p}=o,m=()=>{const s=kp.useManualTiming,o=s?i.timestamp:performance.now();n=!1,s||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),f.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:Xp.reduce((t,s)=>{const a=o[s];return t[s]=(t,s=!1,o=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(m)),a.schedule(t,s,o)),t},{}),cancel:e=>{for(let t=0;t<Xp.length;t++)o[Xp[t]].cancel(e)},state:i,steps:o}}const{schedule:Zp,cancel:em,state:tm,steps:nm}=Qp("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:xp,!0);let rm;function im(){rm=void 0}const sm={now:()=>(void 0===rm&&sm.set(tm.isProcessing||kp.useManualTiming?tm.timestamp:performance.now()),rm),set:e=>{rm=e,queueMicrotask(im)}},om=e=>t=>"string"==typeof t&&t.startsWith(e),am=om("--"),lm=om("var(--"),um=e=>!!lm(e)&&cm.test(e.split("/*")[0].trim()),cm=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function hm(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const dm={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},fm=f(d({},dm),{transform:e=>wp(0,1,e)}),pm=f(d({},dm),{default:1}),mm=e=>Math.round(1e5*e)/1e5,gm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ym=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vm=(e,t)=>n=>Boolean("string"==typeof n&&ym.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),bm=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[i,s,o,a]=r.match(gm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},wm=f(d({},dm),{transform:e=>Math.round((e=>wp(0,255,e))(e))}),km={test:vm("rgb","red"),parse:bm("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+wm.transform(e)+", "+wm.transform(t)+", "+wm.transform(n)+", "+mm(fm.transform(r))+")"};const Sm={test:vm("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:km.transform},_m=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>"".concat(t).concat(e)}),Em=_m("deg"),Tm=_m("%"),xm=_m("px"),Cm=_m("vh"),Pm=_m("vw"),Rm=(()=>f(d({},Tm),{parse:e=>Tm.parse(e)/100,transform:e=>Tm.transform(100*e)}))(),Am={test:vm("hsl","hue"),parse:bm("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Tm.transform(mm(t))+", "+Tm.transform(mm(n))+", "+mm(fm.transform(r))+")"},Om={test:e=>km.test(e)||Sm.test(e)||Am.test(e),parse:e=>km.test(e)?km.parse(e):Am.test(e)?Am.parse(e):Sm.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?km.transform(e):Am.transform(e),getAnimatableNone:e=>{const t=Om.parse(e);return t.alpha=0,Om.transform(t)}},jm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Lm="number",Im="color",Nm=/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 Dm(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(Nm,e=>(Om.test(e)?(r.color.push(s),i.push(Im),n.push(Om.parse(e))):e.startsWith("var(")?(r.var.push(s),i.push("var"),n.push(e)):(r.number.push(s),i.push(Lm),n.push(parseFloat(e))),++s,"${}")).split("${}");return{values:n,split:o,indexes:r,types:i}}function Mm({split:e,types:t}){const n=e.length;return r=>{let i="";for(let s=0;s<n;s++)if(i+=e[s],void 0!==r[s]){const e=t[s];i+=e===Lm?mm(r[s]):e===Im?Om.transform(r[s]):r[s]}return i}}const Um=(e,t)=>{return"number"==typeof e?(null==t?void 0:t.trim().endsWith("/"))?e:0:"number"==typeof(n=e)?0:Om.test(n)?Om.getAnimatableNone(n):n;var n};const Bm={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null==(t=e.match(gm))?void 0:t.length)||0)+((null==(n=e.match(jm))?void 0:n.length)||0)>0},parse:function(e){return Dm(e).values},createTransformer:function(e){return Mm(Dm(e))},getAnimatableNone:function(e){const t=Dm(e);return Mm(t)(t.values.map((e,n)=>Um(e,t.split[n])))}};function Fm(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Vm(e,t){return n=>n>0?t:e}const zm=(e,t,n)=>e+(t-e)*n,Wm=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Hm=[Sm,km,Am];function qm(e){const t=(n=e,Hm.find(e=>e.test(n)));var n;if(!Boolean(t))return!1;let r=t.parse(e);return t===Am&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,s=0,o=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;i=Fm(a,r,e+1/3),s=Fm(a,r,e),o=Fm(a,r,e-1/3)}else i=s=o=n;return{red:Math.round(255*i),green:Math.round(255*s),blue:Math.round(255*o),alpha:r}}(r)),r}const Km=(e,t)=>{const n=qm(e),r=qm(t);if(!n||!r)return Vm(e,t);const i=d({},n);return e=>(i.red=Wm(n.red,r.red,e),i.green=Wm(n.green,r.green,e),i.blue=Wm(n.blue,r.blue,e),i.alpha=zm(n.alpha,r.alpha,e),km.transform(i))},Gm=new Set(["none","hidden"]);function Jm(e,t){return n=>zm(e,t,n)}function $m(e){return"number"==typeof e?Jm:"string"==typeof e?um(e)?Vm:Om.test(e)?Km:Qm:Array.isArray(e)?Ym:"object"==typeof e?Om.test(e)?Km:Xm:Vm}function Ym(e,t){const n=[...e],r=n.length,i=e.map((e,n)=>$m(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Xm(e,t){const n=d(d({},e),t),r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=$m(e[i])(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Qm=(e,t)=>{const n=Bm.createTransformer(t),r=Dm(e),i=Dm(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Gm.has(e)&&!i.values.length||Gm.has(t)&&!r.values.length?function(e,t){return Gm.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Pp(Ym(function(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],a=e.indexes[o][i[o]],l=null!=(n=e.values[a])?n:0;r[s]=l,i[o]++}return r}(r,i),i.values),n):Vm(e,t)};function Zm(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return zm(e,t,n);return $m(e)(e,t)}const eg=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>Zp.update(t,e),stop:()=>em(t),now:()=>tm.isProcessing?tm.timestamp:sm.now()}},tg=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(1e4*e(s/(i-1)))/1e4+", ";return"linear(".concat(r.substring(0,r.length-2),")")},ng=2e4;function rg(e){let t=0;let n=e.next(t);for(;!n.done&&t<ng;)t+=50,n=e.next(t);return t>=ng?1/0:t}const ig=100,sg=10,og=1,ag=0,lg=800,ug=.3,cg=.3,hg={granular:.01,default:2},dg={granular:.005,default:.5},fg=.01,pg=10,mg=.05,gg=1;function yg(e,t){return e*Math.sqrt(1-t*t)}const vg=.001;const bg=["duration","bounce"],wg=["stiffness","damping","mass"];function kg(e,t){return t.some(t=>void 0!==e[t])}function Sg(e){let t=d({velocity:ag,stiffness:ig,damping:sg,mass:og,isResolvedFromDuration:!1},e);if(!kg(e,wg)&&kg(e,bg))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),i=r*r,s=2*wp(.05,1,1-(e.bounce||0))*Math.sqrt(i);t=f(d({},t),{mass:og,stiffness:i,damping:s})}else{const n=function({duration:e=lg,bounce:t=ug,velocity:n=ag,mass:r=og}){let i,s,o=1-t;o=wp(mg,gg,o),e=wp(fg,pg,jp(e)),o<1?(i=t=>{const r=t*o,i=r*e,s=r-n,a=yg(t,o),l=Math.exp(-i);return vg-s/a*l},s=t=>{const r=t*o*e,s=r*n+n,a=Math.pow(o,2)*Math.pow(t,2)*e,l=Math.exp(-r),u=yg(Math.pow(t,2),o);return(-i(t)+vg>0?-1:1)*((s-a)*l)/u}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,s=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let i=1;i<12;i++)r-=e(r)/t(r);return r}(i,s,5/e);if(e=Op(e),isNaN(a))return{stiffness:ig,damping:sg,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*o*Math.sqrt(r*t),duration:e}}}(f(d({},e),{velocity:0}));t=f(d(d({},t),n),{mass:og}),t.isResolvedFromDuration=!0}return t}function _g(e=cg,t=ug){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:c,duration:h,velocity:p,isResolvedFromDuration:m}=Sg(f(d({},n),{velocity:-jp(n.velocity||0)})),g=p||0,y=u/(2*Math.sqrt(l*c)),v=o-s,b=jp(Math.sqrt(l/c)),w=Math.abs(v)<5;let k,S,_,E,T,x;if(r||(r=w?hg.granular:hg.default),i||(i=w?dg.granular:dg.default),y<1)_=yg(b,y),E=(g+y*b*v)/_,k=e=>{const t=Math.exp(-y*b*e);return o-t*(E*Math.sin(_*e)+v*Math.cos(_*e))},T=y*b*E+v*_,x=y*b*v-E*_,S=e=>Math.exp(-y*b*e)*(T*Math.sin(_*e)+x*Math.cos(_*e));else if(1===y){k=e=>o-Math.exp(-b*e)*(v+(g+b*v)*e);const e=g+b*v;S=t=>Math.exp(-b*t)*(b*e*t-g)}else{const e=b*Math.sqrt(y*y-1);k=t=>{const n=Math.exp(-y*b*t),r=Math.min(e*t,300);return o-n*((g+y*b*v)*Math.sinh(r)+e*v*Math.cosh(r))/e};const t=(g+y*b*v)/e,n=y*b*t-v*e,r=y*b*v-t*e;S=t=>{const i=Math.exp(-y*b*t),s=Math.min(e*t,300);return i*(n*Math.sinh(s)+r*Math.cosh(s))}}const C={calculatedDuration:m&&h||null,velocity:e=>Op(S(e)),next:e=>{if(!m&&y<1){const t=Math.exp(-y*b*e),n=Math.sin(_*e),s=Math.cos(_*e),l=o-t*(E*n+v*s),u=Op(t*(T*n+x*s));return a.done=Math.abs(u)<=r&&Math.abs(o-l)<=i,a.value=a.done?o:l,a}const t=k(e);if(m)a.done=e>=h;else{const n=Op(S(e));a.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return a.value=a.done?o:t,a},toString:()=>{const e=Math.min(rg(C),ng),t=tg(t=>C.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return C}_g.applyToOptions=e=>{const t=function(e,t=100,n){const r=n(f(d({},e),{keyframes:[0,t]})),i=Math.min(rg(r),ng);return{type:"keyframes",ease:e=>r.next(i*e).value/t,duration:jp(i)}}(e,100,_g);return e.ease=t.ease,e.duration=Op(t.duration),e.type="keyframes",e};function Eg(e,t,n){const r=Math.max(t-5,0);return Lp(n-e(r),t-r)}function Tg({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=e[0],d={done:!1,value:h},f=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let p=n*t;const m=h+p,g=void 0===o?m:o(m);g!==m&&(p=g-h);const y=e=>-p*Math.exp(-e/r),v=e=>g+y(e),b=e=>{const t=y(e),n=v(e);d.done=Math.abs(t)<=u,d.value=d.done?g:n};let w,k;const S=e=>{var t;(t=d.value,void 0!==a&&t<a||void 0!==l&&t>l)&&(w=e,k=_g({keyframes:[d.value,f(d.value)],velocity:Eg(v,e,d.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return k||void 0!==w||(t=!0,b(e),S(e)),void 0!==w&&e>=w?k.next(e-w):(!t&&b(e),d)}}}function xg(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(t.length,1===s)return()=>t[0];if(2===s&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const r=[],i=n||kp.mix||Zm,s=e.length-1;for(let o=0;o<s;o++){let n=i(e[o],e[o+1]);if(t){const e=Array.isArray(t)?t[o]||xp:t;n=Pp(e,n)}r.push(n)}return r}(t,r,i),l=a.length,u=n=>{if(o&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const i=Rp(e[r],e[r+1],n);return a[r](i)};return n?t=>u(wp(e[0],e[s-1],t)):u}function Cg(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Rp(0,t,r);e.push(zm(n,1,i))}}(t,e.length-1),t}function Pg({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Yp):Yp(r),s={done:!1,value:t[0]},o=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:Cg(t),e),a=xg(o,t,{ease:Array.isArray(i)?i:(l=t,u=i,l.map(()=>u||Gp).splice(0,l.length-1))});var l,u;return{calculatedDuration:e,next:t=>(s.value=a(t),s.done=t>=e,s)}}const Rg=e=>null!==e;function Ag(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(Rg),o=i<0||t&&"loop"!==n&&t%2==1?0:s.length-1;return o&&void 0!==r?r:s[o]}const Og={decay:Tg,inertia:Tg,tween:Pg,keyframes:Pg,spring:_g};function jg(e){"string"==typeof e.type&&(e.type=Og[e.type])}class Lg{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const Ig=e=>e/100;class Ng extends Lg{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var e,t;const{motionValue:n}=this.options;n&&n.updatedAt!==sm.now()&&this.tick(sm.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),null==(t=(e=this.options).onStop)||t.call(e))},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;jg(e);const{type:t=Pg,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:s=0}=e;let{keyframes:o}=e;const a=t||Pg;a!==Pg&&"number"!=typeof o[0]&&(this.mixKeyframes=Pp(Ig,Zm(o[0],o[1])),o=[0,100]);const l=a(f(d({},e),{keyframes:o}));"mirror"===i&&(this.mirroredGenerator=a(f(d({},e),{keyframes:[...o].reverse(),velocity:-s}))),null===l.calculatedDuration&&(l.calculatedDuration=rg(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:u,repeat:c,repeatType:h,repeatDelay:d,type:f,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let v,b=this.currentTime,w=n;if(c){const e=Math.min(this.currentTime,r)/o;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,c+1);Boolean(t%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(w=s)),b=wp(0,1,n)*o}y?(this.delayState.value=u[0],v=this.delayState):v=w.next(b),i&&!y&&(v.value=i(v.value));let{done:k}=v;y||null===a||(k=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&k);return S&&f!==Tg&&(v.value=Ag(u,this.options,m,this.speed)),p&&p(v.value),S&&this.finish(),v}then(e,t){return this.finished.then(e,t)}get duration(){return jp(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+jp(e)}get time(){return jp(this.currentTime)}set time(e){e=Op(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);return Eg(e=>this.generator.next(e).value,e,this.generator.next(e).value)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(sm.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=jp(this.currentTime))}play(){var e,t;if(this.isStopped)return;const{driver:n=eg,startTime:r}=this.options;this.driver||(this.driver=n(e=>this.tick(e))),null==(t=(e=this.options).onPlay)||t.call(e);const i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=null!=r?r:i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(sm.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,t;this.notifyFinished(),this.teardown(),this.state="finished",null==(t=(e=this.options).onComplete)||t.call(e)}cancel(){var e,t;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),null==(t=(e=this.options).onCancel)||t.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var t;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),null==(t=this.driver)||t.stop(),e.observe(this)}}const Dg=e=>180*e/Math.PI,Mg=e=>{const t=Dg(Math.atan2(e[1],e[0]));return Bg(t)},Ug={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Mg,rotateZ:Mg,skewX:e=>Dg(Math.atan(e[1])),skewY:e=>Dg(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bg=e=>((e%=360)<0&&(e+=360),e),Fg=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Vg=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),zg={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fg,scaleY:Vg,scale:e=>(Fg(e)+Vg(e))/2,rotateX:e=>Bg(Dg(Math.atan2(e[6],e[5]))),rotateY:e=>Bg(Dg(Math.atan2(-e[2],e[0]))),rotateZ:Mg,rotate:Mg,skewX:e=>Dg(Math.atan(e[4])),skewY:e=>Dg(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Wg(e){return e.includes("scale")?1:0}function Hg(e,t){if(!e||"none"===e)return Wg(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=zg,i=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Ug,i=t}if(!i)return Wg(t);const s=r[t],o=i[1].split(",").map(qg);return"function"==typeof s?s(o):o[s]}function qg(e){return parseFloat(e.trim())}const Kg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gg=(()=>new Set(Kg))(),Jg=e=>e===dm||e===xm,$g=new Set(["x","y","z"]),Yg=Kg.filter(e=>!$g.has(e));const Xg={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return"border-box"===r?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return"border-box"===r?i:i-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:(e,{transform:t})=>Hg(t,"x"),y:(e,{transform:t})=>Hg(t,"y")};Xg.translateX=Xg.x,Xg.translateY=Xg.y;const Qg=new Set;let Zg=!1,ey=!1,ty=!1;function ny(){if(ey){const e=Array.from(Qg).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return Yg.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{var r;null==(r=e.getValue(t))||r.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}ey=!1,Zg=!1,Qg.forEach(e=>e.complete(ty)),Qg.clear()}function ry(){Qg.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ey=!0)})}class iy{constructor(e,t,n,r,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Qg.add(this),Zg||(Zg=!0,Zp.read(ry),Zp.resolveKeyframes(ny))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const i=null==r?void 0:r.get(),s=e[e.length-1];if(void 0!==i)e[0]=i;else if(n&&t){const r=n.readValue(t,s);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=s),r&&void 0===i&&r.set(e[0])}!function(e){for(let t=1;t<e.length;t++)null!=e[t]||(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Qg.delete(this)}cancel(){"scheduled"===this.state&&(Qg.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function sy(e,t,n){(e=>e.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}const oy={};function ay(e,t){const n=Tp(e);return()=>{var e;return null!=(e=oy[t])?e:n()}}const ly=ay(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),uy=ay(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(OC){return!1}return!0},"linearEasing"),cy=([e,t,n,r])=>"cubic-bezier(".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,")"),hy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cy([0,.65,.55,1]),circOut:cy([.55,0,1,.45]),backIn:cy([.31,.01,.66,-.59]),backOut:cy([.33,1.53,.69,.99])};function dy(e,t){return e?"function"==typeof e?uy()?tg(e,t):"ease-out":Jp(e)?cy(e):Array.isArray(e)?e.map(e=>dy(e,t)||hy.easeOut):hy[e]:void 0}function fy(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const h=dy(a,i);Array.isArray(h)&&(c.easing=h);const d={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);return e.animate(c,d)}function py(e){return"function"==typeof e&&"applyToOptions"in e}class my extends Lg{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:o,onComplete:a}=e;this.isPseudoElement=Boolean(i),this.allowFlatten=s,this.options=e,e.type;const l=function(e){var t=e,{type:n}=t,r=p(t,["type"]);return py(n)&&uy()?n.applyToOptions(r):(null!=r.duration||(r.duration=300),null!=r.ease||(r.ease="easeOut"),r)}(e);this.animation=fy(t,n,r,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const e=Ag(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),sy(t,n,e),this.animation.cancel()}null==a||a(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,t;null==(t=(e=this.animation).finish)||t.call(e)}cancel(){try{this.animation.cancel()}catch(OC){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,t,n;const r=null==(e=this.options)?void 0:e.element;!this.isPseudoElement&&(null==r?void 0:r.isConnected)&&(null==(n=(t=this.animation).commitStyles)||n.call(t))}get duration(){var e,t;const n=(null==(t=null==(e=this.animation.effect)?void 0:e.getComputedTiming)?void 0:t.call(e).duration)||0;return jp(Number(n))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+jp(e)}get time(){return jp(Number(this.animation.currentTime)||0)}set time(e){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Op(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){var e;return null!=(e=this.manualStartTime)?e:Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){var i;return this.allowFlatten&&(null==(i=this.animation.effect)||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&ly()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),xp):r(this)}}const gy={anticipate:Vp,backInOut:Fp,circInOut:Hp};function yy(e){"string"==typeof e.ease&&e.ease in gy&&(e.ease=gy[e.ease])}class vy extends my{constructor(e){yy(e),jg(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const t=this.options,{motionValue:n,onUpdate:r,onComplete:i,element:s}=t,o=p(t,["motionValue","onUpdate","onComplete","element"]);if(!n)return;if(void 0!==e)return void n.set(e);const a=new Ng(f(d({},o),{autoplay:!1})),l=Math.max(10,sm.now()-this.startTime),u=wp(0,10,l-10),c=a.sample(l).value,{name:h}=this.options;s&&h&&sy(s,h,c),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,c,u),a.stop()}}const by=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Bm.test(e)&&"0"!==e||e.startsWith("url(")));function wy(e){e.duration=0,e.type="keyframes"}const ky=new Set(["opacity","clipPath","filter","transform"]),Sy=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const _y=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ey=Tp(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ty(e){var t;const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a,keyframes:l}=e;if(!((null==(t=null==n?void 0:n.owner)?void 0:t.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=n.owner.getProps();return Ey()&&r&&(ky.has(r)||_y.has(r)&&function(e){for(let t=0;t<e.length;t++)if("string"==typeof e[t]&&Sy.test(e[t]))return!0;return!1}(l))&&("transform"!==r||!c)&&!u&&!i&&"mirror"!==s&&0!==o&&"inertia"!==a}class xy extends Lg{constructor(e){var t,n=e,{autoplay:r=!0,delay:i=0,type:s="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:l="loop",keyframes:u,name:c,motionValue:h,element:f}=n,m=p(n,["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"]);super(),this.stop=()=>{var e,t;this._animation&&(this._animation.stop(),null==(e=this.stopTimeline)||e.call(this)),null==(t=this.keyframeResolver)||t.cancel()},this.createdAt=sm.now();const g=d({autoplay:r,delay:i,type:s,repeat:o,repeatDelay:a,repeatType:l,name:c,motionValue:h,element:f},m),y=(null==f?void 0:f.KeyframeResolver)||iy;this.keyframeResolver=new y(u,(e,t,n)=>this.onKeyframesResolved(e,t,g,!n),c,h,f),null==(t=this.keyframeResolver)||t.scheduleResolve()}onKeyframesResolved(e,t,n,r){var i,s;this.keyframeResolver=void 0;const{name:o,type:a,velocity:l,delay:u,isHandoff:c,onUpdate:h}=n;this.resolvedAt=sm.now();let p=!0;(function(e,t,n,r){const i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;const s=e[e.length-1],o=by(i,t),a=by(s,t);return!(!o||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||py(n))&&r)})(e,o,a,l)||(p=!1,!kp.instantAnimations&&u||null==h||h(Ag(e,n,t)),e[0]=e[e.length-1],wy(n),n.repeat=0);const m=r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,g=f(d({startTime:m,finalKeyframe:t},n),{keyframes:e}),y=p&&!c&&Ty(g),v=null==(s=null==(i=g.motionValue)?void 0:i.owner)?void 0:s.current;let b;if(y)try{b=new vy(f(d({},g),{element:v}))}catch(OC){b=new Ng(g)}else b=new Ng(g);b.finished.then(()=>{this.notifyFinished()}).catch(xp),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||(null==(e=this.keyframeResolver)||e.resume(),ty=!0,ry(),ny(),ty=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),null==(e=this.keyframeResolver)||e.cancel()}}function Cy(e,t,n,r=0,i=1){const s=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,a=(o-1)*r;return"function"==typeof n?n(s,o):1===i?s*r:a-s*r}const Py=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ry(e,t,n=1){const[r,i]=function(e){const t=Py.exec(e);if(!t)return[,];const[,n,r,i]=t;return["--".concat(null!=n?n:r),i]}(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const e=s.trim();return Sp(e)?parseFloat(e):e}return um(i)?Ry(i,t,n+1):i}const Ay={type:"spring",stiffness:500,damping:25,restSpeed:10},Oy={type:"keyframes",duration:.8},jy={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ly=(e,{keyframes:t})=>t.length>2?Oy:Gg.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Ay:jy;function Iy(e,t){if((null==e?void 0:e.inherit)&&t){const n=e,{inherit:r}=n,i=p(n,["inherit"]);return d(d({},t),i)}return e}function Ny(e,t){var n,r;const i=null!=(r=null!=(n=null==e?void 0:e[t])?n:null==e?void 0:e.default)?r:e;return i!==e?Iy(i,e):i}const Dy=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const My=(e,t,n,r={},i,s)=>o=>{const a=Ny(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u-=Op(l);const c=f(d({keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity()},a),{delay:-u,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i});(function(e){for(const t in e)if(!Dy.has(t))return!0;return!1})(a)||Object.assign(c,Ly(e,c)),c.duration&&(c.duration=Op(c.duration)),c.repeatDelay&&(c.repeatDelay=Op(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(wy(c),0===c.delay&&(h=!0)),(kp.instantAnimations||kp.skipAnimations||(null==i?void 0:i.shouldSkipAnimations))&&(h=!0,wy(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!s&&void 0!==t.get()){const e=Ag(c.keyframes,a);if(void 0!==e)return void Zp.update(()=>{c.onUpdate(e),c.onComplete()})}return a.isSync?new Ng(c):new xy(c)};function Uy(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function By(e,t,n,r){if("function"==typeof t){const[i,s]=Uy(r);t=t(void 0!==n?n:e.custom,i,s)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[i,s]=Uy(r);t=t(void 0!==n?n:e.custom,i,s)}return t}function Fy(e,t,n){const r=e.getProps();return By(r,t,void 0!==n?n:r.custom,e)}const Vy=new Set(["width","height","top","left","right","bottom",...Kg]);class zy{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{var t;const n=sm.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(null==(t=this.events.change)||t.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=sm.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Ap);const n=this.events[e].add(t);return"change"===e?()=>{n(),Zp.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;null==(e=this.events.change)||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=sm.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Lp(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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(){var e,t;null==(e=this.dependents)||e.clear(),null==(t=this.events.destroy)||t.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wy(e,t){return new zy(e,t)}const Hy=e=>Array.isArray(e);function qy(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wy(n))}function Ky(e){return Hy(e)?e[e.length-1]||0:e}const Gy=e=>Boolean(e&&e.getVelocity);function Jy(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Gy(r)&&r.add))return n.add(t);if(!n&&kp.WillChange){const n=new kp.WillChange("auto");e.addValue("willChange",n),n.add(t)}var r}function $y(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}const Yy="data-"+$y("framerAppearId");function Xy(e){return e.props[Yy]}function Qy({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Zy(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let o=t,{transition:a,transitionEnd:l}=o,u=p(o,["transition","transitionEnd"]);const c=e.getDefaultTransition();a=a?Iy(a,c):c;const h=null==a?void 0:a.reduceMotion;r&&(a=r);const f=[],m=i&&e.animationState&&e.animationState.getState()[i];for(const p in u){const t=e.getValue(p,null!=(s=e.latestValues[p])?s:null),r=u[p];if(void 0===r||m&&Qy(m,p))continue;const i=d({delay:n},Ny(a||{},p)),o=t.get();if(void 0!==o&&!t.isAnimating()&&!Array.isArray(r)&&r===o&&!i.velocity){Zp.update(()=>t.set(r));continue}let l=!1;if(window.MotionHandoffAnimation){const t=Xy(e);if(t){const e=window.MotionHandoffAnimation(t,p,Zp);null!==e&&(i.startTime=e,l=!0)}}Jy(e,p);const c=null!=h?h:e.shouldReduceMotion;t.start(My(p,t,r,c&&Vy.has(p)?{type:!1}:i,e,l));const g=t.animation;g&&f.push(g)}if(l){const t=()=>Zp.update(()=>{l&&function(e,t){let n=Fy(e,t)||{},{transitionEnd:r={},transition:i={}}=n,s=p(n,["transitionEnd","transition"]);s=d(d({},s),r);for(const o in s)qy(e,o,Ky(s[o]))}(e,l)});f.length?Promise.all(f).then(t):t()}return f}function ev(e,t,n={}){var r;const i=Fy(e,t,"exit"===n.type?null==(r=e.presenceContext)?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Zy(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:i=0,staggerChildren:o,staggerDirection:a}=s;return function(e,t,n=0,r=0,i=0,s=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(ev(l,t,f(d({},o),{delay:n+("function"==typeof r?0:r)+Cy(e.variantChildren,l,r,i,s)})).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}(e,t,r,i,o,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[e,t]="beforeChildren"===l?[o,a]:[a,o];return e().then(()=>t())}return Promise.all([o(),a(n.delay)])}const tv=e=>t=>t.test(e),nv=[dm,xm,Tm,Em,Pm,Cm,{test:e=>"auto"===e,parse:e=>e}],rv=e=>nv.find(tv(e));function iv(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Ep(e))}const sv=new Set(["brightness","contrast","saturate","opacity"]);function ov(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(gm)||[];if(!r)return e;const i=n.replace(r,"");let s=sv.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const av=/\b([a-z-]*)\(.*?\)/gu,lv=f(d({},Bm),{getAnimatableNone:e=>{const t=e.match(av);return t?t.map(ov).join(" "):e}}),uv=f(d({},Bm),{getAnimatableNone:e=>{const t=Bm.parse(e);return Bm.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?f(d({},e),{alpha:1}):e))}}),cv=f(d({},dm),{transform:Math.round}),hv=f(d({borderWidth:xm,borderTopWidth:xm,borderRightWidth:xm,borderBottomWidth:xm,borderLeftWidth:xm,borderRadius:xm,borderTopLeftRadius:xm,borderTopRightRadius:xm,borderBottomRightRadius:xm,borderBottomLeftRadius:xm,width:xm,maxWidth:xm,height:xm,maxHeight:xm,top:xm,right:xm,bottom:xm,left:xm,inset:xm,insetBlock:xm,insetBlockStart:xm,insetBlockEnd:xm,insetInline:xm,insetInlineStart:xm,insetInlineEnd:xm,padding:xm,paddingTop:xm,paddingRight:xm,paddingBottom:xm,paddingLeft:xm,paddingBlock:xm,paddingBlockStart:xm,paddingBlockEnd:xm,paddingInline:xm,paddingInlineStart:xm,paddingInlineEnd:xm,margin:xm,marginTop:xm,marginRight:xm,marginBottom:xm,marginLeft:xm,marginBlock:xm,marginBlockStart:xm,marginBlockEnd:xm,marginInline:xm,marginInlineStart:xm,marginInlineEnd:xm,fontSize:xm,backgroundPositionX:xm,backgroundPositionY:xm},{rotate:Em,rotateX:Em,rotateY:Em,rotateZ:Em,scale:pm,scaleX:pm,scaleY:pm,scaleZ:pm,skew:Em,skewX:Em,skewY:Em,distance:xm,translateX:xm,translateY:xm,translateZ:xm,x:xm,y:xm,z:xm,perspective:xm,transformPerspective:xm,opacity:fm,originX:Rm,originY:Rm,originZ:xm}),{zIndex:cv,fillOpacity:fm,strokeOpacity:fm,numOctaves:cv}),dv=f(d({},hv),{color:Om,backgroundColor:Om,outlineColor:Om,fill:Om,stroke:Om,borderColor:Om,borderTopColor:Om,borderRightColor:Om,borderBottomColor:Om,borderLeftColor:Om,filter:lv,WebkitFilter:lv,mask:uv,WebkitMask:uv}),fv=e=>dv[e],pv=new Set([lv,uv]);function mv(e,t){let n=fv(e);return pv.has(n)||(n=Bm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const gv=new Set(["auto","none","0"]);class yv extends iy{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let a=0;a<e.length;a++){let n=e[a];if("string"==typeof n&&(n=n.trim(),um(n))){const r=Ry(n,t.current);void 0!==r&&(e[a]=r),a===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Vy.has(n)||2!==e.length)return;const[r,i]=e,s=rv(r),o=rv(i);if(hm(r)!==hm(i)&&Xg[n])this.needsMeasurement=!0;else if(s!==o)if(Jg(s)&&Jg(o))for(let a=0;a<e.length;a++){const t=e[a];"string"==typeof t&&(e[a]=parseFloat(t))}else Xg[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let r=0;r<e.length;r++)(null===e[r]||iv(e[r]))&&n.push(r);n.length&&function(e,t,n){let r,i=0;for(;i<e.length&&!r;){const t=e[i];"string"==typeof t&&!gv.has(t)&&Dm(t).values.length&&(r=e[i]),i++}if(r&&n)for(const s of t)e[s]=mv(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Xg[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=Xg[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null==(e=this.removedTransforms)?void 0:e.length)&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}function vv(e,t,n){var r;if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document;const i=null!=(r=null==n?void 0:n[e])?r:t.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>null!=e)}const bv=(e,t)=>t&&"number"==typeof e?t.transform(e):e;function wv(e){return _p(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:kv}=Qp(queueMicrotask,!1),Sv={x:!1,y:!1};function _v(){return Sv.x||Sv.y}function Ev(e,t){const n=vv(e),r=new AbortController;return[n,f(d({passive:!0},t),{signal:r.signal}),()=>r.abort()]}function Tv(e,t,n={}){const[r,i,s]=Ev(e,n);return r.forEach(e=>{let n,r=!1,s=!1;const o=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},a=e=>{r=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),s&&(s=!1,o(e))},l=e=>{"touch"!==e.pointerType&&(r?s=!0:o(e))};e.addEventListener("pointerenter",r=>{if("touch"===r.pointerType||_v())return;s=!1;const o=t(e,r);"function"==typeof o&&(n=o,e.addEventListener("pointerleave",l,i))},i),e.addEventListener("pointerdown",()=>{r=!0,window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",a,i)},i)}),s}const xv=(e,t)=>!!t&&(e===t||xv(e,t.parentElement)),Cv=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Pv=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Rv=new Set(["INPUT","SELECT","TEXTAREA"]);const Av=new WeakSet;function Ov(e){return t=>{"Enter"===t.key&&e(t)}}function jv(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Lv(e){return Cv(e)&&!_v()}const Iv=new WeakSet;function Nv(e,t,n={}){const[r,i,s]=Ev(e,n),o=e=>{const r=e.currentTarget;if(!Lv(e))return;if(Iv.has(e))return;Av.add(r),n.stopPropagation&&Iv.add(e);const s=t(r,e),o=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Av.has(r)&&Av.delete(r),Lv(e)&&"function"==typeof s&&s(e,{success:t})},a=e=>{o(e,r===window||r===document||n.useGlobalTarget||xv(r,e.target))},l=e=>{o(e,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",o,i),wv(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ov(()=>{if(Av.has(n))return;jv(n,"down");const e=Ov(()=>{jv(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>jv(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,i)),t=e,Pv.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),s}function Dv(e){return _p(e)&&"ownerSVGElement"in e}const Mv=new WeakMap;let Uv;const Bv=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Dv(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Fv=Bv("inline","width","offsetWidth"),Vv=Bv("block","height","offsetHeight");function zv({target:e,borderBoxSize:t}){var n;null==(n=Mv.get(e))||n.forEach(n=>{n(e,{get width(){return Fv(e,t)},get height(){return Vv(e,t)}})})}function Wv(e){e.forEach(zv)}function Hv(e,t){Uv||"undefined"!=typeof ResizeObserver&&(Uv=new ResizeObserver(Wv));const n=vv(e);return n.forEach(e=>{let n=Mv.get(e);n||(n=new Set,Mv.set(e,n)),n.add(t),null==Uv||Uv.observe(e)}),()=>{n.forEach(e=>{const n=Mv.get(e);null==n||n.delete(t),(null==n?void 0:n.size)||null==Uv||Uv.unobserve(e)})}}const qv=new Set;let Kv;function Gv(e){return qv.add(e),Kv||(Kv=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};qv.forEach(t=>t(e))},window.addEventListener("resize",Kv)),()=>{qv.delete(e),qv.size||"function"!=typeof Kv||(window.removeEventListener("resize",Kv),Kv=void 0)}}function Jv(e,t){return"function"==typeof e?Gv(e):Hv(e,t)}const $v=[...nv,Om,Bm],Yv=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Xv=new WeakMap;function Qv(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Zv(e){return"string"==typeof e||Array.isArray(e)}const eb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tb=["initial",...eb];function nb(e){return Qv(e.animate)||tb.some(t=>Zv(e[t]))}function rb(e){return Boolean(nb(e)||e.variants)}const ib={current:null},sb={current:!1},ob="undefined"!=typeof window;const ab=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let lb={};function ub(e){lb=e}class cb{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=iy,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 e=sm.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Zp.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget=d({},l),this.initialValues=t.initial?d({},l):{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=a,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=nb(t),this.isVariantNode=rb(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const c=this.scrapeMotionValuesFromProps(t,{},this),{willChange:h}=c,f=p(c,["willChange"]);for(const d in f){const e=f[d];void 0!==l[d]&&Gy(e)&&e.set(l[d])}}mount(e){var t,n,r;if(this.hasBeenMounted)for(const i in this.initialValues)null==(t=this.values.get(i))||t.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,Xv.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(sb.current||function(){if(sb.current=!0,ob)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ib.current=e.matches;e.addEventListener("change",t),t()}else ib.current=!1}(),this.shouldReduceMotion=ib.current),this.shouldSkipAnimations=null!=(n=this.skipAnimationsConfig)&&n,null==(r=this.parent)||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),em(this.notifyUpdate),em(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),null==(e=this.parent)||e.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),null!=this.enteringChildren||(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ky.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:i,ease:s,duration:o}=t.accelerate,a=new my({element:this.current,name:e,keyframes:r,times:i,ease:s,duration:Op(o)}),l=n(a);return void this.valueSubscriptions.set(e,()=>{l(),a.cancel()})}const n=Gg.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Zp.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in lb){const t=lb[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<ab.length;n++){const t=ab[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Gy(i))e.addValue(r,i);else if(Gy(s))e.addValue(r,Wy(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(i):t.hasAnimated||t.set(i)}else{const t=e.getStaticValue(r);e.addValue(r,Wy(void 0!==t?t:i,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Wy(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!=(n=this.getBaseTargetFromProps(this.props,e))?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var i;return null!=r&&("string"==typeof r&&(Sp(r)||Ep(r))?r=parseFloat(r):(i=r,!$v.find(tv(i))&&Bm.test(t)&&(r=mv(e,t))),this.setBaseTarget(e,Gy(r)?r.get():r)),Gy(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const i=By(this.props,n,null==(t=this.presenceContext)?void 0:t.custom);i&&(r=i[e])}if(n&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,e);return void 0===i||Gy(i)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new Ap),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){kv.render(this.render)}}class hb extends cb{constructor(){super(...arguments),this.KeyframeResolver=yv}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Gy(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent="".concat(e))}))}}class db{constructor(e){this.isMounted=!1,this.node=e}update(){}}function fb({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function pb(e){return void 0===e||1===e}function mb({scale:e,scaleX:t,scaleY:n}){return!pb(e)||!pb(t)||!pb(n)}function gb(e){return mb(e)||yb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yb(e){return vb(e.x)||vb(e.y)}function vb(e){return e&&"0%"!==e}function bb(e,t,n){return n+t*(e-n)}function wb(e,t,n,r,i){return void 0!==i&&(e=bb(e,i,r)),bb(e,n,r)+t}function kb(e,t=0,n=1,r,i){e.min=wb(e.min,t,n,r,i),e.max=wb(e.max,t,n,r,i)}function Sb(e,{x:t,y:n}){kb(e.x,t.translate,t.scale,t.originPoint),kb(e.y,n.translate,n.scale,n.originPoint)}const _b=.999999999999,Eb=1.0000000000001;function Tb(e,t){e.min+=t,e.max+=t}function xb(e,t,n,r,i=.5){kb(e,t,n,zm(e.min,e.max,i),r)}function Cb(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function Pb(e,t,n){const r=null!=n?n:e;xb(e.x,Cb(t.x,r.x),t.scaleX,t.scale,t.originX),xb(e.y,Cb(t.y,r.y),t.scaleY,t.scale,t.originY)}function Rb(e,t){return fb(function(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}}(e.getBoundingClientRect(),t))}const Ab={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ob=Kg.length;function jb(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const e=t[l];if(Gg.has(l))o=!0;else if(am(l))i[l]=e;else{const t=bv(e,hv[l]);l.startsWith("origin")?(a=!0,s[l]=t):r[l]=t}}if(t.transform||(o||n?r.transform=function(e,t,n){let r="",i=!0;for(let s=0;s<Ob;s++){const o=Kg[s],a=e[o];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(o.startsWith("scale")?1:0);else{const e=parseFloat(a);l=o.startsWith("scale")?1===e:0===e}if(!l||n){const e=bv(a,hv[o]);l||(i=!1,r+="".concat(Ab[o]||o,"(").concat(e,") ")),n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=s;r.transformOrigin="".concat(e," ").concat(t," ").concat(n)}}function Lb(e,{style:t,vars:n},r,i){const s=e.style;let o;for(o in t)s[o]=t[o];for(o in null==i||i.applyProjectionStyles(s,r),n)s.setProperty(o,n[o])}function Ib(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Nb={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!xm.test(e))return e;e=parseFloat(e)}const n=Ib(e,t.target.x),r=Ib(e,t.target.y);return"".concat(n,"% ").concat(r,"%")}},Db={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Bm.parse(e);if(i.length>5)return r;const s=Bm.createTransformer(e),o="number"!=typeof i[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=zm(a,l,.5);return"number"==typeof i[2+o]&&(i[2+o]/=u),"number"==typeof i[3+o]&&(i[3+o]/=u),s(i)}},Mb={borderRadius:f(d({},Nb),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Nb,borderTopRightRadius:Nb,borderBottomLeftRadius:Nb,borderBottomRightRadius:Nb,boxShadow:Db};function Ub(e,{layout:t,layoutId:n}){return Gg.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Mb[e]||"opacity"===e)}function Bb(e,t,n){var r;const i=e.style,s=null==t?void 0:t.style,o={};if(!i)return o;for(const a in i)(Gy(i[a])||s&&Gy(s[a])||Ub(a,e)||void 0!==(null==(r=null==n?void 0:n.getValue(a))?void 0:r.liveStyle))&&(o[a]=i[a]);return o}class Fb extends hb{constructor(){super(...arguments),this.type="html",this.renderInstance=Lb}readValueFromInstance(e,t){var n,r;if(Gg.has(t))return(null==(n=this.projection)?void 0:n.isProjecting)?Wg(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Hg(n,t)})(e,t);{const n=(r=e,window.getComputedStyle(r)),i=(am(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof i?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Rb(e,t)}build(e,t,n){jb(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Bb(e,t,n)}}const Vb={offset:"stroke-dashoffset",array:"stroke-dasharray"},zb={offset:"strokeDashoffset",array:"strokeDasharray"};const Wb=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Hb(e,t,n,r,i){var s,o,a=t,{attrX:l,attrY:u,attrScale:c,pathLength:h,pathSpacing:d=1,pathOffset:f=0}=a;if(jb(e,p(a,["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"]),r),n)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:m,style:g}=e;m.transform&&(g.transform=m.transform,delete m.transform),(g.transform||m.transformOrigin)&&(g.transformOrigin=null!=(s=m.transformOrigin)?s:"50% 50%",delete m.transformOrigin),g.transform&&(g.transformBox=null!=(o=null==i?void 0:i.transformBox)?o:"fill-box",delete m.transformBox);for(const p of Wb)void 0!==m[p]&&(g[p]=m[p],delete m[p]);void 0!==l&&(m.x=l),void 0!==u&&(m.y=u),void 0!==c&&(m.scale=c),void 0!==h&&function(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Vb:zb;e[s.offset]="".concat(-r),e[s.array]="".concat(t," ").concat(n)}(m,h,d,f,!1)}const qb=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"]),Kb=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Gb(e,t,n){const r=Bb(e,t,n);for(const i in e)if(Gy(e[i])||Gy(t[i])){r[-1!==Kg.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]}return r}class Jb extends hb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Yv}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Gg.has(t)){const e=fv(t);return e&&e.default||0}return t=qb.has(t)?t:$y(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Gb(e,t,n)}build(e,t,n){Hb(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){Lb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(qb.has(i)?i:$y(i),t.attrs[i])}(e,t,0,r)}mount(e){this.isSVGTag=Kb(e.tagName),super.mount(e)}}const $b=tb.length;function Yb(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Yb(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<$b;n++){const r=tb[n],i=e.props[r];(Zv(i)||!1===i)&&(t[r]=i)}return t}function Xb(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}const Qb=[...eb].reverse(),Zb=eb.length;function ew(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map(t=>ev(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=ev(e,t,n);else{const i="function"==typeof t?Fy(e,t,n.custom):t;r=Promise.all(Zy(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}function tw(e){let t=ew(e),n=iw(),r=!0,i=!1;const s=t=>(n,r)=>{var i;const s=Fy(e,r,"exit"===t?null==(i=e.presenceContext)?void 0:i.custom:void 0);if(s){const e=s,{transition:t,transitionEnd:r}=e,i=p(e,["transition","transitionEnd"]);n=d(d(d({},n),i),r)}return n};function o(o){const{props:a}=e,l=Yb(e.parent)||{},u=[],c=new Set;let h={},f=1/0;for(let t=0;t<Zb;t++){const p=Qb[t],m=n[p],g=void 0!==a[p]?a[p]:l[p],y=Zv(g),v=p===o?m.isActive:null;!1===v&&(f=t);let b=g===l[p]&&g!==a[p]&&y;if(b&&(r||i)&&e.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=d({},h),!m.isActive&&null===v||!g&&!m.prevProp||Qv(g)||"boolean"==typeof g)continue;if("exit"===p&&m.isActive&&!0!==v){m.prevResolvedValues&&(h=d(d({},h),m.prevResolvedValues));continue}const w=nw(m.prevProp,g);let k=w||p===o&&m.isActive&&!b&&y||t>f&&y,S=!1;const _=Array.isArray(g)?g:[g];let E=_.reduce(s(p),{});!1===v&&(E={});const{prevResolvedValues:T={}}=m,x=d(d({},T),E),C=t=>{k=!0,c.has(t)&&(S=!0,c.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in x){const t=E[e],n=T[e];if(h.hasOwnProperty(e))continue;let r=!1;r=Hy(t)&&Hy(n)?!Xb(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):m.protectedKeys[e]=!0}m.prevProp=g,m.prevResolvedValues=E,m.isActive&&(h=d(d({},h),E)),(r||i)&&e.blockInitialAnimation&&(k=!1);const P=b&&w;k&&(!P||S)&&u.push(..._.map(t=>{const n={type:p};if("string"==typeof t&&(r||i)&&!P&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,i=Fy(r,t);if(r.enteringChildren&&i){const{delayChildren:t}=i.transition||{};n.delay=Cy(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(c.size){const t={};if("boolean"!=typeof a.initial){const n=Fy(e,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(t.transition=n.transition)}c.forEach(n=>{const r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=null!=r?r:null}),u.push({animation:t})}let p=Boolean(u.length);return!r||!1!==a.initial&&a.initial!==a.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,i=!1,p?t(u):Promise.resolve()}return{animateChanges:o,setActive:function(t,r){var i;if(n[t].isActive===r)return Promise.resolve();null==(i=e.variantChildren)||i.forEach(e=>{var n;return null==(n=e.animationState)?void 0:n.setActive(t,r)}),n[t].isActive=r;const s=o(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=iw(),i=!0}}}function nw(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Xb(t,e)}function rw(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iw(){return{animate:rw(!0),whileInView:rw(),whileHover:rw(),whileTap:rw(),whileDrag:rw(),whileFocus:rw(),exit:rw()}}function sw(e,t){e.min=t.min,e.max=t.max}function ow(e,t){sw(e.x,t.x),sw(e.y,t.y)}function aw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function lw(e){return e.max-e.min}function uw(e,t,n,r=.5){e.origin=r,e.originPoint=zm(t.min,t.max,e.origin),e.scale=lw(n)/lw(t),e.translate=zm(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function cw(e,t,n,r){uw(e.x,t.x,n.x,r?r.originX:void 0),uw(e.y,t.y,n.y,r?r.originY:void 0)}function hw(e,t,n,r=0){const i=r?zm(n.min,n.max,r):n.min;e.min=i+t.min,e.max=e.min+lw(t)}function dw(e,t,n,r=0){const i=r?zm(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+lw(t)}function fw(e,t,n,r){dw(e.x,t.x,n.x,null==r?void 0:r.x),dw(e.y,t.y,n.y,null==r?void 0:r.y)}function pw(e,t,n,r,i){return e=bb(e-=t,1/n,r),void 0!==i&&(e=bb(e,1/i,r)),e}function mw(e,t,[n,r,i],s,o){!function(e,t=0,n=1,r=.5,i,s=e,o=e){Tm.test(t)&&(t=parseFloat(t),t=zm(o.min,o.max,t/100)-o.min);if("number"!=typeof t)return;let a=zm(s.min,s.max,r);e===s&&(a-=t),e.min=pw(e.min,t,n,a,i),e.max=pw(e.max,t,n,a,i)}(e,t[n],t[r],t[i],t.scale,s,o)}const gw=["x","scaleX","originX"],yw=["y","scaleY","originY"];function vw(e,t,n,r){mw(e.x,t,gw,n?n.x:void 0,r?r.x:void 0),mw(e.y,t,yw,n?n.y:void 0,r?r.y:void 0)}function bw(e){return 0===e.translate&&1===e.scale}function ww(e){return bw(e.x)&&bw(e.y)}function kw(e,t){return e.min===t.min&&e.max===t.max}function Sw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function _w(e,t){return Sw(e.x,t.x)&&Sw(e.y,t.y)}function Ew(e){return lw(e.x)/lw(e.y)}function Tw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function xw(e){return[e("x"),e("y")]}const Cw=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Pw=Cw.length,Rw=e=>"string"==typeof e?parseFloat(e):e,Aw=e=>"number"==typeof e||xm.test(e);function Ow(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const jw=Iw(0,.5,Wp),Lw=Iw(.5,.95,xp);function Iw(e,t,n){return r=>r<e?0:r>t?1:n(Rp(e,t,r))}function Nw(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Dw=(e,t)=>e.depth-t.depth;class Mw{constructor(){this.children=[],this.isDirty=!1}add(e){vp(this.children,e),this.isDirty=!0}remove(e){bp(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Dw),this.isDirty=!1,this.children.forEach(e)}}function Uw(e){return Gy(e)?e.get():e}class Bw{constructor(){this.members=[]}add(e){vp(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;r&&!1!==r.isConnected||n.snapshot||(bp(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(bp(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){var t;for(let n=this.members.indexOf(e)-1;n>=0;n--){const e=this.members[n];if(!1!==e.isPresent&&!1!==(null==(t=e.instance)?void 0:t.isConnected))return this.promote(e),!0}return!1}promote(e,t){var n;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:s}=e.options;void 0!==i&&i===s||(e.resumeFrom=r,t&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(null==(n=e.root)?void 0:n.isUpdating)&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var t,n,r,i,s;null==(n=(t=e.options).onExitComplete)||n.call(t),null==(s=null==(r=e.resumingFrom)?void 0:(i=r.options).onExitComplete)||s.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(null==(e=this.lead)?void 0:e.snapshot)&&(this.lead.snapshot=void 0)}}const Fw={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Vw=["","X","Y","Z"];let zw=0;function Ww(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Hw(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xy(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Zp,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Hw(r)}function qw({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=zw++,this.animationId=0,this.animationCommitId=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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Jw),this.nodes.forEach(rk),this.nodes.forEach(ik),this.nodes.forEach($w)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Mw)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ap),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;var n;this.isSVG=Dv(t)&&!(Dv(n=t)&&"svg"===n.tagName),this.instance=t;const{layoutId:r,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||r)&&(this.isLayoutDirty=!0),e){let n,r=0;const i=()=>this.root.updateBlockedByResize=!1;Zp.read(()=>{r=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=sm.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(em(r),e(s-t))};return Zp.setup(r,!0),()=>em(r)}(i,250),Fw.hasAnimatedSinceResize&&(Fw.hasAnimatedSinceResize=!1,this.nodes.forEach(nk)))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&s&&(r||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||s.getDefaultTransition()||ck,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!_w(this.targetLayout,r),u=!t&&n;if(this.options.layoutRoot||this.resumeFrom||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t=f(d({},Ny(i,"layout")),{onPlay:o,onComplete:a});(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,u)}else t||nk(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),em(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(sk),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Hw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let i=0;i<this.path.length;i++){const e=this.path[i];e.shouldResetTransform=!0,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const e=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Qw),void this.nodes.forEach(Xw)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Zw);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ek),this.nodes.forEach(tk),this.nodes.forEach(Kw),this.nodes.forEach(Gw)):this.nodes.forEach(Zw),this.clearAllSnapshots();const e=sm.now();tm.delta=wp(0,1e3/60,e-tm.timestamp),tm.timestamp=e,tm.isProcessing=!0,nm.update.process(tm),nm.preRender.process(tm),nm.render.process(tm),tm.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,kv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Yw),this.sharedNodes.forEach(ok)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Zp.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Zp.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||lw(this.snapshot.measuredBox.x)||lw(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!ww(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,s=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||gb(this.latestValues)||s)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),fk((r=n).x),fk(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!((null==(e=this.scroll)?void 0:e.wasRoot)||this.path.some(mk))){const{scroll:e}=this.root;e&&(Tb(n.x,e.offset.x),Tb(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(ow(n,e),null==(t=this.scroll)?void 0:t.wasRoot)return n;for(let r=0;r<this.path.length;r++){const t=this.path[r],{scroll:i,options:s}=t;t!==this.root&&i&&s.layoutScroll&&(i.wasRoot&&ow(n,e),Tb(n.x,i.offset.x),Tb(n.y,i.offset.y))}return n}applyTransform(e,t=!1,n){var r,i;const s=n||{x:{min:0,max:0},y:{min:0,max:0}};ow(s,e);for(let o=0;o<this.path.length;o++){const e=this.path[o];!t&&e.options.layoutScroll&&e.scroll&&e!==e.root&&(Tb(s.x,-e.scroll.offset.x),Tb(s.y,-e.scroll.offset.y)),gb(e.latestValues)&&Pb(s,e.latestValues,null==(r=e.layout)?void 0:r.layoutBox)}return gb(this.latestValues)&&Pb(s,this.latestValues,null==(i=this.layout)?void 0:i.layoutBox),s}removeTransform(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};ow(n,e);for(let r=0;r<this.path.length;r++){const e=this.path[r];if(!gb(e.latestValues))continue;let i;e.instance&&(mb(e.latestValues)&&e.updateSnapshot(),i=Yv(),ow(i,e.measurePageBox())),vw(n,e.latestValues,null==(t=e.snapshot)?void 0:t.layoutBox,i)}return gb(this.latestValues)&&vw(n,this.latestValues),n}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options=f(d(d({},this.options),e),{crossfade:void 0===e.crossfade||e.crossfade})}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!==tm.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null==(t=this.parent)?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(!this.layout||!i&&!s)return;this.resolvedRelativeTargetAt=tm.timestamp;const o=this.getClosestProjectingParent();var a,l,u,c;(o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),a=this.target,l=this.relativeTarget,u=this.relativeParent.target,c=this.options.layoutAnchor||void 0,hw(a.x,l.x,u.x,null==c?void 0:c.x),hw(a.y,l.y,u.y,null==c?void 0:c.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):ow(this.target,this.layout.layoutBox),Sb(this.target,this.targetDelta)):ow(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&o&&Boolean(o.resumingFrom)===Boolean(this.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!mb(this.parent.latestValues)&&!yb(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},fw(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),ow(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null==(e=this.parent)?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===tm.timestamp&&(r=!1),r)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;ow(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,r=!1){var i;const s=n.length;if(!s)return;let o,a;t.x=t.y=1;for(let l=0;l<s;l++){o=n[l],a=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Tb(e.x,-o.scroll.offset.x),Tb(e.y,-o.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Sb(e,a)),r&&gb(o.latestValues)&&Pb(e,o.latestValues,null==(i=o.layout)?void 0:i.layoutBox))}t.x<Eb&&t.x>_b&&(t.x=1),t.y<Eb&&t.y>_b&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(aw(this.prevProjectionDelta.x,this.projectionDelta.x),aw(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),cw(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===o&&this.treeScale.y===a&&Tw(this.projectionDelta.x,this.prevProjectionDelta.x)&&Tw(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null==(t=this.options.visualElement)||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},i=d({},this.latestValues),s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const o={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(uk));let h;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,d,f,p;ak(s.x,e.x,n),ak(s.y,e.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fw(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),l=this.relativeTarget,d=this.relativeTargetOrigin,f=o,p=n,lk(l.x,d.x,f.x,p),lk(l.y,d.y,f.y,p),h&&function(e,t){return kw(e.x,t.x)&&kw(e.y,t.y)}(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),ow(h,this.relativeTarget)),a&&(this.animationValues=i,function(e,t,n,r,i,s){var o,a,l,u;i?(e.opacity=zm(0,null!=(o=n.opacity)?o:1,jw(r)),e.opacityExit=zm(null!=(a=t.opacity)?a:1,0,Lw(r))):s&&(e.opacity=zm(null!=(l=t.opacity)?l:1,null!=(u=n.opacity)?u:1,r));for(let c=0;c<Pw;c++){const i=Cw[c];let s=Ow(t,i),o=Ow(n,i);void 0===s&&void 0===o||(s||(s=0),o||(o=0),0===s||0===o||Aw(s)===Aw(o)?(e[i]=Math.max(zm(Rw(s),Rw(o),r),0),(Tm.test(o)||Tm.test(s))&&(e[i]+="%")):e[i]=o)}(t.rotate||n.rotate)&&(e.rotate=zm(t.rotate||0,n.rotate||0,r))}(i,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){var t,n,r;this.notifyListeners("animationStart"),null==(t=this.currentAnimation)||t.stop(),null==(r=null==(n=this.resumingFrom)?void 0:n.currentAnimation)||r.stop(),this.pendingAnimation&&(em(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Zp.update(()=>{Fw.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Wy(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(e,t,n){const r=Gy(e)?e:Wy(e);return r.start(My("",r,t,n)),r.animation}(this.motionValue,[0,1e3],f(d({},e),{velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{},onComplete:()=>{e.onComplete&&e.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 e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&pk(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=lw(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=lw(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}ow(t,n),Pb(t,i),cw(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Bw);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null==(e=this.getStack())?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null==(e=this.getStack())?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Ww("z",e,r,this.animationValues);for(let i=0;i<Vw.length;i++)Ww("rotate".concat(Vw[i]),e,r,this.animationValues),Ww("skew".concat(Vw[i]),e,r,this.animationValues);e.render();for(const i in r)e.setStaticValue(i,r[i]),this.animationValues&&(this.animationValues[i]=r[i]);e.scheduleRender()}applyProjectionStyles(e,t){var n,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(e.visibility="hidden");const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=Uw(null==t?void 0:t.pointerEvents)||"",void(e.transform=i?i(this.latestValues,""):"none");const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target)return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Uw(null==t?void 0:t.pointerEvents)||""),void(this.hasProjected&&!gb(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1));e.visibility="";const o=s.animationValues||s.latestValues;this.applyTransformsToTarget();let a=function(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(null==n?void 0:n.z)||0;if((i||s||o)&&(r="translate3d(".concat(i,"px, ").concat(s,"px, ").concat(o,"px) ")),1===t.x&&1===t.y||(r+="scale(".concat(1/t.x,", ").concat(1/t.y,") ")),n){const{transformPerspective:e,rotate:t,rotateX:i,rotateY:s,skewX:o,skewY:a}=n;e&&(r="perspective(".concat(e,"px) ").concat(r)),t&&(r+="rotate(".concat(t,"deg) ")),i&&(r+="rotateX(".concat(i,"deg) ")),s&&(r+="rotateY(".concat(s,"deg) ")),o&&(r+="skewX(".concat(o,"deg) ")),a&&(r+="skewY(".concat(a,"deg) "))}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+="scale(".concat(a,", ").concat(l,")")),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,o);i&&(a=i(o,a)),e.transform=a;const{x:l,y:u}=this.projectionDelta;e.transformOrigin="".concat(100*l.origin,"% ").concat(100*u.origin,"% 0"),s.animationValues?e.opacity=s===this?null!=(r=null!=(n=o.opacity)?n:this.latestValues.opacity)?r:1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:e.opacity=s===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0;for(const c in Mb){if(void 0===o[c])continue;const{correct:t,applyTo:n,isCSSVariable:r}=Mb[c],i="none"===a?o[c]:t(o[c],s);if(n){const t=n.length;for(let r=0;r<t;r++)e[n[r]]=i}else r?this.options.visualElement.renderState.vars[c]=i:e[c]=i}this.options.layoutId&&(e.pointerEvents=s===this?Uw(null==t?void 0:t.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null==(t=e.currentAnimation)?void 0:t.stop()}),this.root.nodes.forEach(Xw),this.root.sharedNodes.clear()}}}function Kw(e){e.updateLayout()}function Gw(e){var t;const n=(null==(t=e.resumeFrom)?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:i}=e.options,s=n.source!==e.layout.source;if("size"===i)xw(e=>{const r=s?n.measuredBox[e]:n.layoutBox[e],i=lw(r);r.min=t[e].min,r.max=r.min+i});else if("x"===i||"y"===i){const e="x"===i?"y":"x";sw(s?n.measuredBox[e]:n.layoutBox[e],t[e])}else pk(i,n.layoutBox,t)&&xw(r=>{const i=s?n.measuredBox[r]:n.layoutBox[r],o=lw(t[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};cw(o,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?cw(a,e.applyTransform(r,!0),n.measuredBox):cw(a,t,n.layoutBox);const l=!ww(o);let u=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:s}=r;if(i&&s){const o=e.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};fw(a,n.layoutBox,i.layoutBox,o);const l={x:{min:0,max:0},y:{min:0,max:0}};fw(l,t,s.layoutBox,o),_w(a,l)||(u=!0),r.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=a,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Jw(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function $w(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Yw(e){e.clearSnapshot()}function Xw(e){e.clearMeasurements()}function Qw(e){e.isLayoutDirty=!0,e.updateLayout()}function Zw(e){e.isLayoutDirty=!1}function ek(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function tk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function nk(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rk(e){e.resolveTargetDelta()}function ik(e){e.calcProjection()}function sk(e){e.resetSkewAndRotation()}function ok(e){e.removeLeadSnapshot()}function ak(e,t,n){e.translate=zm(t.translate,0,n),e.scale=zm(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function lk(e,t,n,r){e.min=zm(t.min,n.min,r),e.max=zm(t.max,n.max,r)}function uk(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const ck={duration:.45,ease:[.4,0,.1,1]},hk=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dk=hk("applewebkit/")&&!hk("chrome/")?Math.round:xp;function fk(e){e.min=dk(e.min),e.max=dk(e.max)}function pk(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Ew(t),i=Ew(n),s=.2,!(Math.abs(r-i)<=s));var r,i,s}function mk(e){var t;return e!==e.root&&(null==(t=e.scroll)?void 0:t.wasRoot)}const gk=qw({attachResizeListener:(e,t)=>Nw(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||(null==(e=document.body)?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||(null==(t=document.body)?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),yk={current:void 0},vk=qw({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!yk.current){const e=new gk({});e.mount(window),e.setOptions({layoutScroll:!0}),yk.current=e}return yk.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),bk=re.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function wk(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function kk(...e){return re.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=wk(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():wk(e[t],null)}}}}(...e),e)}class Sk extends re.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(wv(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=wv(e)&&e.offsetWidth||0,r=wv(e)&&e.offsetHeight||0,i=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(i.height),s.width=parseFloat(i.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=n-s.width-s.left,s.bottom=r-s.height-s.top}return null}componentDidUpdate(){}render(){return this.props.children}}function _k({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:s}){var o,a;const l=re.useId(),u=re.useRef(null),c=re.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:h}=re.useContext(bk),d=null!=(a=null==(o=e.props)?void 0:o.ref)?a:null==e?void 0:e.ref,f=kk(u,d);return re.useInsertionEffect(()=>{const{width:e,height:o,top:a,left:d,right:f,bottom:p}=c.current;if(t||!1===s||!u.current||!e||!o)return;const m="left"===n?"left: ".concat(d):"right: ".concat(f),g="bottom"===r?"bottom: ".concat(p):"top: ".concat(a);u.current.dataset.motionPopId=l;const y=document.createElement("style");h&&(y.nonce=h);const v=null!=i?i:document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule('\n [data-motion-pop-id="'.concat(l,'"] {\n position: absolute !important;\n width: ').concat(e,"px !important;\n height: ").concat(o,"px !important;\n ").concat(m,"px !important;\n ").concat(g,"px !important;\n }\n ")),()=>{var e;null==(e=u.current)||e.removeAttribute("data-motion-pop-id"),v.contains(y)&&v.removeChild(y)}},[t]),de.jsx(Sk,{isPresent:t,childRef:u,sizeRef:c,pop:s,children:!1===s?e:re.cloneElement(e,{ref:f})})}const Ek=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a,anchorY:l,root:u})=>{const c=mp(Tk),h=re.useId();let f=!0,p=re.useMemo(()=>(f=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:e=>{c.set(e,!0);for(const t of c.values())if(!t)return;r&&r()},register:e=>(c.set(e,!1),()=>c.delete(e))}),[n,c,r]);return s&&f&&(p=d({},p)),re.useMemo(()=>{c.forEach((e,t)=>c.set(t,!1))},[n]),re.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=de.jsx(_k,{pop:"popLayout"===o,isPresent:n,anchorX:a,anchorY:l,root:u,children:e}),de.jsx(yp.Provider,{value:p,children:e})};function Tk(){return new Map}function xk(e=!0){const t=re.useContext(yp);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=re.useId();re.useEffect(()=>{if(e)return i(s)},[e]);const o=re.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Ck=e=>e.key||"";function Pk(e){const t=[];return re.Children.forEach(e,e=>{re.isValidElement(e)&&t.push(e)}),t}const Rk=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[c,h]=xk(o),d=re.useMemo(()=>Pk(e),[e]),f=o&&!c?[]:d.map(Ck),p=re.useRef(!0),m=re.useRef(d),g=mp(()=>new Map),y=re.useRef(new Set),[v,b]=re.useState(d),[w,k]=re.useState(d);gp(()=>{p.current=!1,m.current=d;for(let e=0;e<w.length;e++){const t=Ck(w[e]);f.includes(t)?(g.delete(t),y.current.delete(t)):!0!==g.get(t)&&g.set(t,!1)}},[w,f.length,f.join("-")]);const S=[];if(d!==v){let e=[...d];for(let t=0;t<w.length;t++){const n=w[t],r=Ck(n);f.includes(r)||(e.splice(t,0,n),S.push(n))}return"wait"===s&&S.length&&(e=S),k(Pk(e)),b(d),null}const{forceRender:_}=re.useContext(pp);return de.jsx(de.Fragment,{children:w.map(e=>{const v=Ck(e),b=!(o&&!c)&&(d===w||f.includes(v));return de.jsx(Ek,{isPresent:b,initial:!(p.current&&!n)&&void 0,custom:t,presenceAffectsLayout:i,mode:s,root:u,onExitComplete:b?void 0:()=>{if(y.current.has(v))return;if(!g.has(v))return;y.current.add(v),g.set(v,!0);let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(null==_||_(),k(m.current),o&&(null==h||h()),r&&r())},anchorX:a,anchorY:l,children:e},v)})})},Ak=re.createContext({strict:!1}),Ok={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"]};let jk=!1;function Lk(){return function(){if(jk)return;const e={};for(const t in Ok)e[t]={isEnabled:e=>Ok[t].some(t=>!!e[t])};ub(e),jk=!0}(),lb}const Ik=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","propagate","ignoreStrict","viewport"]);function Nk(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ik.has(e)}let Dk=e=>!Nk(e);try{"function"==typeof(Mk=require("@emotion/is-prop-valid").default)&&(Dk=e=>e.startsWith("on")?!Nk(e):Mk(e))}catch(OC){}var Mk;const Uk=re.createContext({});function Bk(e){const{initial:t,animate:n}=function(e,t){if(nb(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Zv(t)?t:void 0,animate:Zv(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,re.useContext(Uk));return re.useMemo(()=>({initial:t,animate:n}),[Fk(t),Fk(n)])}function Fk(e){return Array.isArray(e)?e.join(" "):e}const Vk=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function zk(e,t,n){for(const r in t)Gy(t[r])||Ub(r,n)||(e[r]=t[r])}function Wk(e,t){const n={};return zk(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return re.useMemo(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return jb(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}function Hk(e,t){const n={},r=Wk(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-".concat("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const qk=()=>f(d({},{style:{},transform:{},transformOrigin:{},vars:{}}),{attrs:{}});function Kk(e,t,n,r){const i=re.useMemo(()=>{const n=qk();return Hb(n,t,Kb(r),e.transformTemplate,e.style),f(d({},n.attrs),{style:d({},n.style)})},[t]);if(e.style){const t={};zk(t,e.style,e),i.style=d(d({},t),i.style)}return i}const Gk=["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 Jk(e){return"string"==typeof e&&!e.includes("-")&&!!(Gk.indexOf(e)>-1||/[A-Z]/u.test(e))}function $k(e,t,n,{latestValues:r},i,s=!1,o){const a=((null!=o?o:Jk(e))?Kk:Hk)(t,r,i,e),l=function(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||Gy(e[i])||(Dk(i)||!0===n&&Nk(i)||!t&&!Nk(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(t,"string"==typeof e,s),u=e!==re.Fragment?f(d(d({},l),a),{ref:n}):{},{children:c}=t,h=re.useMemo(()=>Gy(c)?c.get():c,[c]);return re.createElement(e,f(d({},u),{children:h}))}function Yk(e,t,n,r){const i={},s=r(e,{});for(const d in s)i[d]=Uw(s[d]);let{initial:o,animate:a}=e;const l=nb(e),u=rb(e);t&&u&&!l&&!1!==e.inherit&&(void 0===o&&(o=t.initial),void 0===a&&(a=t.animate));let c=!!n&&!1===n.initial;c=c||!1===o;const h=c?a:o;if(h&&"boolean"!=typeof h&&!Qv(h)){const t=Array.isArray(h)?h:[h];for(let n=0;n<t.length;n++){const r=By(e,t[n]);if(r){const e=r,{transitionEnd:t,transition:n}=e,s=p(e,["transitionEnd","transition"]);for(const r in s){let e=s[r];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(i[r]=e)}for(const r in t)i[r]=t[r]}}}return i}const Xk=e=>(t,n)=>{const r=re.useContext(Uk),i=re.useContext(yp),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Yk(n,r,i,e),renderState:t()}}(e,t,r,i);return n?s():mp(s)},Qk=Xk({scrapeMotionValuesFromProps:Bb,createRenderState:Vk}),Zk=Xk({scrapeMotionValuesFromProps:Gb,createRenderState:qk}),eS=Symbol.for("motionComponentSymbol");function tS(e,t,n){const r=re.useRef(n);re.useInsertionEffect(()=>{r.current=n});const i=re.useRef(null);return re.useCallback(n=>{var s;n&&(null==(s=e.onMount)||s.call(e,n));const o=r.current;if("function"==typeof o)if(n){const e=o(n);"function"==typeof e&&(i.current=e)}else i.current?(i.current(),i.current=null):o(n);else o&&(o.current=n);t&&(n?t.mount(n):t.unmount())},[t])}const nS=re.createContext({});function rS(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function iS(e,t,n,r,i,s){var o,a;const{visualElement:l}=re.useContext(Uk),u=re.useContext(Ak),c=re.useContext(yp),h=re.useContext(bk),d=h.reducedMotion,f=h.skipAnimations,p=re.useRef(null),m=re.useRef(!1);r=r||u.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:d,skipAnimations:f,isSVG:s}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const g=p.current,y=re.useContext(nS);!g||g.projection||!i||"html"!==g.type&&"svg"!==g.type||function(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:sS(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:Boolean(o)||a&&rS(a),visualElement:e,animationType:"string"==typeof s?s:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}(p.current,n,i,y);const v=re.useRef(!1);re.useInsertionEffect(()=>{g&&v.current&&g.update(n,c)});const b=n[Yy],w=re.useRef(Boolean(b)&&"undefined"!=typeof window&&!(null==(o=window.MotionHandoffIsComplete)?void 0:o.call(window,b))&&(null==(a=window.MotionHasOptimisedAnimation)?void 0:a.call(window,b)));return gp(()=>{m.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),w.current&&g.animationState&&g.animationState.animateChanges())}),re.useEffect(()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var e;null==(e=window.MotionHandoffMarkAsComplete)||e.call(window,b)}),w.current=!1),g.enteringChildren=void 0)}),g}function sS(e){if(e)return!1!==e.options.allowProjection?e.projection:sS(e.parent)}function oS(e,{forwardMotionProps:t=!1,type:n}={},r,i){var s,o;r&&function(e){const t=Lk();for(const n in e)t[n]=d(d({},t[n]),e[n]);ub(t)}(r);const a=n?"svg"===n:Jk(e),l=a?Zk:Qk;function u(n,r){let s;const o=f(d(d({},re.useContext(bk)),n),{layoutId:aS(n)}),{isStatic:u}=o,c=Bk(n),h=l(n,u);if(!u&&"undefined"!=typeof window){re.useContext(Ak).strict;const t=function(e){const t=Lk(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i=d(d({},n),r);return{MeasureLayout:(null==n?void 0:n.isEnabled(e))||(null==r?void 0:r.isEnabled(e))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(o);s=t.MeasureLayout,c.visualElement=iS(e,h,o,i,t.ProjectionNode,a)}return de.jsxs(Uk.Provider,{value:c,children:[s&&c.visualElement?de.jsx(s,d({visualElement:c.visualElement},o)):null,$k(e,n,tS(h,c.visualElement,r),h,u,t,a)]})}u.displayName="motion.".concat("string"==typeof e?e:"create(".concat(null!=(o=null!=(s=e.displayName)?s:e.name)?o:"",")"));const c=re.forwardRef(u);return c[eS]=e,c}function aS({layoutId:e}){const t=re.useContext(pp).id;return t&&void 0!==e?t+"-"+e:e}function lS(e,t){if("undefined"==typeof Proxy)return oS;const n=new Map,r=(n,r)=>oS(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,s)=>"create"===s?r:(n.has(s)||n.set(s,oS(s,void 0,e,t)),n.get(s))})}const uS=(e,t)=>{var n;return(null!=(n=t.isSVG)?n:Jk(e))?new Jb(t):new Fb(t,{allowProjection:e!==re.Fragment})};let cS=0;const hS={animation:{Feature:class extends db{constructor(e){super(e),e.animationState||(e.animationState=tw(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Qv(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null==(e=this.unmountControls)||e.call(this)}}},exit:{Feature:class extends db{constructor(){super(...arguments),this.id=cS++,this.isExitComplete=!1}update(){var e;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;if(t&&!1===r){if(this.isExitComplete){const{initial:t,custom:n}=this.node.getProps();if("string"==typeof t){const r=Fy(this.node,t,n);if(r){const t=r,{transition:n,transitionEnd:i}=t,s=p(t,["transition","transitionEnd"]);for(const r in s)null==(e=this.node.getValue(r))||e.jump(s[r])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function dS(e){return{point:{x:e.pageX,y:e.pageY}}}function fS(e,t,n,r){return Nw(e,t,(e=>t=>Cv(t)&&e(t,dS(t)))(n),r)}const pS=({current:e})=>e?e.ownerDocument.defaultView:null,mS=(e,t)=>Math.abs(e-t);const gS=new Set(["auto","scroll"]);class yS{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=vS(this.lastRawMoveEventInfo,this.transformPagePoint));const e=wS(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=mS(e.x,t.x),r=mS(e.y,t.y);return Math.sqrt(c(n,2)+c(r,2))}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:r}=e,{timestamp:i}=tm;this.history.push(f(d({},r),{timestamp:i}));const{onStart:s,onMove:o}=this.handlers;t||(s&&s(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=vS(t,this.transformPagePoint),Zp.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const s=wS("pointercancel"===e.type?this.lastMoveEventInfo:vS(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,s),r&&r(e,s)},!Cv(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s,this.contextWindow=r||window;const a=vS(dS(e),this.transformPagePoint),{point:l}=a,{timestamp:u}=tm;this.history=[f(d({},l),{timestamp:u})];const{onSessionStart:h}=t;h&&h(e,wS(a,this.history)),this.removeListeners=Pp(fS(this.contextWindow,"pointermove",this.handlePointerMove),fS(this.contextWindow,"pointerup",this.handlePointerUp),fS(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(gS.has(e.overflowX)||gS.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i=r.x-t.x,s=r.y-t.y;0===i&&0===s||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i,this.lastMoveEventInfo.point.y+=s):this.history.length>0&&(this.history[0].x-=i,this.history[0].y-=s),this.scrollPositions.set(e,r),Zp.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),em(this.updatePoint)}}function vS(e,t){return t?{point:t(e.point)}:e}function bS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function wS({point:e},t){return{point:e,delta:bS(e,SS(t)),offset:bS(e,kS(t)),velocity:_S(t,.1)}}function kS(e){return e[0]}function SS(e){return e[e.length-1]}function _S(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=SS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Op(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>2*Op(t)&&(r=e[1]);const s=jp(i.timestamp-r.timestamp);if(0===s)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ES(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function TS(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}}const xS=.35;function CS(e,t,n){return{min:PS(e,t),max:PS(e,n)}}function PS(e,t){return"number"==typeof e?e:e[t]||0}const RS=new WeakMap;class AS{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new yS(e,{onSessionStart:e=>{t&&this.snapToCursor(dS(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(s=n)||"y"===s?Sv[s]?null:(Sv[s]=!0,()=>{Sv[s]=!1}):Sv.x||Sv.y?null:(Sv.x=Sv.y=!0,()=>{Sv.x=Sv.y=!1}),!this.openDragLock))return;var s;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),xw(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Tm.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=lw(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t}),i&&Zp.update(()=>i(e,t),!1,!0),Jy(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:s}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:o}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(o),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),s&&Zp.update(()=>s(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,distanceThreshold:n,contextWindow:pS(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&Zp.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!jS(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let s=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?zm(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?zm(n,e,r.max):Math.min(e,n)),e}(s,this.constraints[e],this.elastic[e])),i.set(s)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null==(e=this.visualElement.projection)?void 0:e.layout,i=this.constraints;t&&rS(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:i}){return{x:ES(e.x,n,i),y:ES(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=xS){return!1===e?e=0:!0===e&&(e=xS),{x:CS(e,"left","right"),y:CS(e,"top","bottom")}}(n),i!==this.constraints&&!rS(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&xw(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!rS(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=function(e,t,n){const r=Rb(e,n),{scroll:i}=t;return i&&(Tb(r.x,i.offset.x),Tb(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let s=function(e,t){return{x:TS(e.x,t.x),y:TS(e.y,t.y)}}(r.layout.layoutBox,i);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(s));this.hasMutatedConstraints=!!e,e&&(s=fb(e))}return s}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{},l=xw(o=>{if(!jS(o,t,this.currentDirection))return;let l=a&&a[o]||{};!0!==s&&s!==o||(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,h=d(d({type:"inertia",velocity:n?e[o]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10},i),l);return this.startAxisValueAnimation(o,h)});return Promise.all(l).then(o)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Jy(this.visualElement,e),n.start(My(e,n,0,t,this.visualElement,!1))}stopAnimation(){xw(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t="_drag".concat(e.toUpperCase()),n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){xw(t=>{const{drag:n}=this.getProps();if(!jS(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:s}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-zm(n,s,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!rS(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};xw(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=lw(e),i=lw(t);return i>r?n=Rp(t.min,t.max-r,e.min):r>i&&(n=Rp(e.min,e.max-i,t.min)),wp(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),xw(t=>{if(!jS(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(zm(i,s,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;RS.set(this.visualElement,this);const e=this.visualElement.current,t=fS(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,s=i!==e&&function(e){return Rv.has(e.tagName)||!0===e.isContentEditable}(i);n&&r&&!s&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();rS(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=Jv(e,OS(n)),i=Jv(t,OS(n));return()=>{r(),i()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Zp.read(r);const o=Nw(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(xw(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:s=xS,dragMomentum:o=!0}=e;return f(d({},e),{drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:s,dragMomentum:o})}}function OS(e){let t=!0;return()=>{t?t=!1:e()}}function jS(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const LS=e=>(t,n)=>{e&&Zp.update(()=>e(t,n),!1,!0)};let IS=!1;class NS extends re.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),IS&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions(f(d({},i.options),{layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()}))),Fw.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:s}=n;return s?(s.isPresent=i,e.layoutDependency!==t&&s.setOptions(f(d({},s.options),{layoutDependency:t})),IS=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==i?s.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?s.promote():s.relegate()||Zp.postRender(()=>{const e=s.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),kv.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;IS=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function DS(e){const[t,n]=xk(),r=re.useContext(pp);return de.jsx(NS,f(d({},e),{layoutGroup:r,switchLayoutGroup:re.useContext(nS),isPresent:t,safeToRemove:n}))}const MS={pan:{Feature:class extends db{constructor(){super(...arguments),this.removePointerDownListener=xp}onPointerDown(e){this.session=new yS(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pS(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:LS(e),onStart:LS(t),onMove:LS(n),onEnd:(e,t)=>{delete this.session,r&&Zp.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=fS(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends db{constructor(e){super(e),this.removeGroupControls=xp,this.removeListeners=xp,this.controls=new AS(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xp}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:vk,MeasureLayout:DS}};function US(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const i=r["onHover"+n];i&&Zp.postRender(()=>i(t,dS(t)))}function BS(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const i=r["onTap"+("End"===n?"":n)];i&&Zp.postRender(()=>i(t,dS(t)))}const FS=new WeakMap,VS=new WeakMap,zS=e=>{const t=FS.get(e.target);t&&t(e)},WS=e=>{e.forEach(zS)};function HS(e,t,n){const r=function(e){var t=e,{root:n}=t,r=p(t,["root"]);const i=n||document;VS.has(i)||VS.set(i,{});const s=VS.get(i),o=JSON.stringify(r);return s[o]||(s[o]=new IntersectionObserver(WS,d({root:n},r))),s[o]}(t);return FS.set(e,n),r.observe(e),()=>{FS.delete(e),r.unobserve(e)}}const qS={some:0,all:1};const KS={inView:{Feature:class extends db{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;null==(e=this.stopObserver)||e.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:"number"==typeof i?i:qS[i]};this.stopObserver=HS(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,s&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){var e;null==(e=this.stopObserver)||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends db{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Nv(e,(e,t)=>(BS(this.node,t,"Start"),(e,{success:t})=>BS(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===(null==n?void 0:n.tap)})}unmount(){}}},focus:{Feature:class extends db{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(OC){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Pp(Nw(this.node.current,"focus",()=>this.onFocus()),Nw(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends db{mount(){const{current:e}=this.node;e&&(this.unmount=Tv(e,(e,t)=>(US(this.node,t,"Start"),e=>US(this.node,e,"End"))))}unmount(){}}}},GS={layout:{ProjectionNode:vk,MeasureLayout:DS}},JS=lS(d(d(d(d({},hS),KS),MS),GS),uS);function $S(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function YS(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(OC){s(OC)}}function a(e){try{l(r.throw(e))}catch(OC){s(OC)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class XS extends Error{constructor(e,t="FunctionsError",n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class QS extends XS{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class ZS extends XS{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class e_ extends XS{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var t_,n_;(n_=t_||(t_={})).Any="any",n_.ApNortheast1="ap-northeast-1",n_.ApNortheast2="ap-northeast-2",n_.ApSouth1="ap-south-1",n_.ApSoutheast1="ap-southeast-1",n_.ApSoutheast2="ap-southeast-2",n_.CaCentral1="ca-central-1",n_.EuCentral1="eu-central-1",n_.EuWest1="eu-west-1",n_.EuWest2="eu-west-2",n_.EuWest3="eu-west-3",n_.SaEast1="sa-east-1",n_.UsEast1="us-east-1",n_.UsWest1="us-west-1",n_.UsWest2="us-west-2";class r_{constructor(e,{headers:t={},customFetch:n,region:r=t_.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(n)}setAuth(e){this.headers.Authorization="Bearer ".concat(e)}invoke(e){return YS(this,arguments,void 0,function*(e,t={}){var n;let r,i;try{const{headers:s,method:o,body:a,signal:l,timeout:u}=t;let c={},{region:h}=t;h||(h=this.region);const d=new URL("".concat(this.url,"/").concat(e));let f;h&&"any"!==h&&(c["x-region"]=h,d.searchParams.set("forceFunctionRegion",h)),a&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)?"undefined"!=typeof Blob&&a instanceof Blob||a instanceof ArrayBuffer?(c["Content-Type"]="application/octet-stream",f=a):"string"==typeof a?(c["Content-Type"]="text/plain",f=a):"undefined"!=typeof FormData&&a instanceof FormData?f=a:(c["Content-Type"]="application/json",f=JSON.stringify(a)):f=!a||"string"==typeof a||"undefined"!=typeof Blob&&a instanceof Blob||a instanceof ArrayBuffer||"undefined"!=typeof FormData&&a instanceof FormData?a:JSON.stringify(a);let p=l;u&&(i=new AbortController,r=setTimeout(()=>i.abort(),u),l?(p=i.signal,l.addEventListener("abort",()=>i.abort())):p=i.signal);const m=yield this.fetch(d.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},c),this.headers),s),body:f,signal:p}).catch(e=>{throw new QS(e)}),g=m.headers.get("x-relay-error");if(g&&"true"===g)throw new ZS(m);if(!m.ok)throw new e_(m);let y,v=(null!==(n=m.headers.get("Content-Type"))&&void 0!==n?n:"text/plain").split(";")[0].trim();return y="application/json"===v?yield m.json():"application/octet-stream"===v||"application/pdf"===v?yield m.blob():"text/event-stream"===v?m:"multipart/form-data"===v?yield m.formData():yield m.text(),{data:y,error:null,response:m}}catch(s){return{data:null,error:s,response:s instanceof e_||s instanceof ZS?s.context:void 0}}finally{r&&clearTimeout(r)}})}}const i_=e=>Math.min(1e3*c(2,e),3e4),s_=[520,503],o_=["GET","HEAD","OPTIONS"];var a_=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 l_(e,t){return new Promise(n=>{if(null==t?void 0:t.aborted)return void n();const r=setTimeout(()=>{null==t||t.removeEventListener("abort",i),n()},e);function i(){clearTimeout(r),n()}null==t||t.addEventListener("abort",i)})}function u_(e,t,n,r){return!(!r||n>=3)&&(!!o_.includes(e)&&!!s_.includes(t))}var c_=class{constructor(e){var t,n,r,i,s;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=null!==(t=e.shouldThrowOnError)&&void 0!==t&&t,this.signal=e.signal,this.isMaybeSingle=null!==(n=e.isMaybeSingle)&&void 0!==n&&n,this.shouldStripNulls=null!==(r=e.shouldStripNulls)&&void 0!==r&&r,this.urlLengthLimit=null!==(i=e.urlLengthLimit)&&void 0!==i?i:8e3,this.retryEnabled=null===(s=e.retry)||void 0===s||s,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if("text/csv"===this.headers.get("Accept"))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(void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const e=this.headers.get("Accept");"application/vnd.pgrst.object+json"===e?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):e&&"application/json"!==e||this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let i=(()=>y(this,null,function*(){let e=0;for(;;){const o=new Headers(n.headers);let a;e>0&&o.set("X-Retry-Count",String(e));try{a=yield r(n.url.toString(),{method:n.method,headers:o,body:JSON.stringify(n.body,(e,t)=>"bigint"==typeof t?t.toString():t),signal:n.signal})}catch(s){if("AbortError"===(null==s?void 0:s.name)||"ABORT_ERR"===(null==s?void 0:s.code))throw s;if(!o_.includes(n.method))throw s;if(n.retryEnabled&&e<3){const t=i_(e);e++,yield l_(t,n.signal);continue}throw s}if(u_(n.method,a.status,e,n.retryEnabled)){var t,i;const r=null!==(t=null===(i=a.headers)||void 0===i?void 0:i.get("Retry-After"))&&void 0!==t?t:null,s=null!==r?1e3*Math.max(0,parseInt(r,10)||0):i_(e);yield a.text(),e++,yield l_(s,n.signal);continue}return yield n.processResponse(a)}}))();return this.shouldThrowOnError||(i=i.catch(e=>{var t;let n="",r="",i="";const s=null==e?void 0:e.cause;if(s){var o,a,l,u;const t=null!==(o=null==s?void 0:s.message)&&void 0!==o?o:"",r=null!==(a=null==s?void 0:s.code)&&void 0!==a?a:"";n="".concat(null!==(l=null==e?void 0:e.name)&&void 0!==l?l:"FetchError",": ").concat(null==e?void 0:e.message),n+="\n\nCaused by: ".concat(null!==(u=null==s?void 0:s.name)&&void 0!==u?u:"Error",": ").concat(t),r&&(n+=" (".concat(r,")")),(null==s?void 0:s.stack)&&(n+="\n".concat(s.stack))}else{var c;n=null!==(c=null==e?void 0:e.stack)&&void 0!==c?c:""}const h=this.url.toString().length;return"AbortError"===(null==e?void 0:e.name)||"ABORT_ERR"===(null==e?void 0:e.code)?(i="",r="Request was aborted (timeout or manual cancellation)",h>this.urlLengthLimit&&(r+=". Note: Your request URL is ".concat(h," 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."))):"HeadersOverflowError"!==(null==s?void 0:s.name)&&"UND_ERR_HEADERS_OVERFLOW"!==(null==s?void 0:s.code)||(i="",r="HTTP headers exceeded server limits (typically 16KB)",h>this.urlLengthLimit&&(r+=". Your request URL is ".concat(h," 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:"".concat(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError",": ").concat(null==e?void 0:e.message),details:n,hint:r,code:i},data:null,count:null,status:0,statusText:""}})),i.then(e,t)}processResponse(e){return y(this,null,function*(){var t=this;let n=null,r=null,i=null,s=e.status,o=e.statusText;if(e.ok){var a,l;if("HEAD"!==t.method){var u;const n=yield e.text();""===n||(r="text/csv"===t.headers.get("Accept")||t.headers.get("Accept")&&(null===(u=t.headers.get("Accept"))||void 0===u?void 0:u.includes("application/vnd.pgrst.plan+text"))?n:JSON.parse(n))}const c=null===(a=t.headers.get("Prefer"))||void 0===a?void 0:a.match(/count=(exact|planned|estimated)/),h=null===(l=e.headers.get("content-range"))||void 0===l?void 0:l.split("/");c&&h&&h.length>1&&(i=parseInt(h[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:"Results contain ".concat(r.length," rows, application/vnd.pgrst.object+json requires 1 row"),hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,i=null,s=406,o="Not Acceptable"):r=1===r.length?r[0]:null)}else{const i=yield e.text();try{n=JSON.parse(i),Array.isArray(n)&&404===e.status&&(r=[],n=null,s=200,o="OK")}catch(c){404===e.status&&""===i?(s=204,o="No Content"):n={message:i}}if(n&&t.shouldThrowOnError)throw new a_(n)}return{success:null===n,error:n,data:r,count:i,status:s,statusText:o}})}returns(){return this}overrideTypes(){return this}},h_=class extends c_{select(e){let t=!1;const n=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){const s=i?"".concat(i,".order"):"order",o=this.url.searchParams.get(s);return this.url.searchParams.set(s,"".concat(o?"".concat(o,","):"").concat(e,".").concat(t?"asc":"desc").concat(void 0===n?"":n?".nullsfirst":".nullslast")),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=void 0===n?"limit":"".concat(n,".limit");return this.url.searchParams.set(r,"".concat(e)),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const i=void 0===r?"offset":"".concat(r,".offset"),s=void 0===r?"limit":"".concat(r,".limit");return this.url.searchParams.set(i,"".concat(e)),this.url.searchParams.set(s,"".concat(t-e+1)),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:s="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=null!==(o=this.headers.get("Accept"))&&void 0!==o?o:"application/json";return this.headers.set("Accept","application/vnd.pgrst.plan+".concat(s,'; for="').concat(l,'"; options=').concat(a,";")),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=".concat(e)),this}};const d_=new RegExp("[,()]");var f_=class extends h_{eq(e,t){return this.url.searchParams.append(e,"eq.".concat(t)),this}neq(e,t){return this.url.searchParams.append(e,"neq.".concat(t)),this}gt(e,t){return this.url.searchParams.append(e,"gt.".concat(t)),this}gte(e,t){return this.url.searchParams.append(e,"gte.".concat(t)),this}lt(e,t){return this.url.searchParams.append(e,"lt.".concat(t)),this}lte(e,t){return this.url.searchParams.append(e,"lte.".concat(t)),this}like(e,t){return this.url.searchParams.append(e,"like.".concat(t)),this}likeAllOf(e,t){return this.url.searchParams.append(e,"like(all).{".concat(t.join(","),"}")),this}likeAnyOf(e,t){return this.url.searchParams.append(e,"like(any).{".concat(t.join(","),"}")),this}ilike(e,t){return this.url.searchParams.append(e,"ilike.".concat(t)),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,"ilike(all).{".concat(t.join(","),"}")),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,"ilike(any).{".concat(t.join(","),"}")),this}regexMatch(e,t){return this.url.searchParams.append(e,"match.".concat(t)),this}regexIMatch(e,t){return this.url.searchParams.append(e,"imatch.".concat(t)),this}is(e,t){return this.url.searchParams.append(e,"is.".concat(t)),this}isDistinct(e,t){return this.url.searchParams.append(e,"isdistinct.".concat(t)),this}in(e,t){const n=Array.from(new Set(t)).map(e=>"string"==typeof e&&d_.test(e)?'"'.concat(e,'"'):"".concat(e)).join(",");return this.url.searchParams.append(e,"in.(".concat(n,")")),this}notIn(e,t){const n=Array.from(new Set(t)).map(e=>"string"==typeof e&&d_.test(e)?'"'.concat(e,'"'):"".concat(e)).join(",");return this.url.searchParams.append(e,"not.in.(".concat(n,")")),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,"cs.".concat(t)):Array.isArray(t)?this.url.searchParams.append(e,"cs.{".concat(t.join(","),"}")):this.url.searchParams.append(e,"cs.".concat(JSON.stringify(t))),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,"cd.".concat(t)):Array.isArray(t)?this.url.searchParams.append(e,"cd.{".concat(t.join(","),"}")):this.url.searchParams.append(e,"cd.".concat(JSON.stringify(t))),this}rangeGt(e,t){return this.url.searchParams.append(e,"sr.".concat(t)),this}rangeGte(e,t){return this.url.searchParams.append(e,"nxl.".concat(t)),this}rangeLt(e,t){return this.url.searchParams.append(e,"sl.".concat(t)),this}rangeLte(e,t){return this.url.searchParams.append(e,"nxr.".concat(t)),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,"adj.".concat(t)),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,"ov.".concat(t)):this.url.searchParams.append(e,"ov.{".concat(t.join(","),"}")),this}textSearch(e,t,{config:n,type:r}={}){let i="";"plain"===r?i="pl":"phrase"===r?i="ph":"websearch"===r&&(i="w");const s=void 0===n?"":"(".concat(n,")");return this.url.searchParams.append(e,"".concat(i,"fts").concat(s,".").concat(t)),this}match(e){return Object.entries(e).filter(([e,t])=>void 0!==t).forEach(([e,t])=>{this.url.searchParams.append(e,"eq.".concat(t))}),this}not(e,t,n){return this.url.searchParams.append(e,"not.".concat(t,".").concat(n)),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?"".concat(n,".or"):"or";return this.url.searchParams.append(r,"(".concat(e,")")),this}filter(e,t,n){return this.url.searchParams.append(e,"".concat(t,".").concat(n)),this}},p_=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:s}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=null!=t?t:{},i=n?"HEAD":"GET";let s=!1;const o=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!s?"":('"'===e&&(s=!s),e)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),r&&l.append("Prefer","count=".concat(r)),new f_({method:i,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const{url:i,headers:s}=this.cloneRequestState();if(t&&s.append("Prefer","count=".concat(t)),n||s.append("Prefer","missing=default"),Array.isArray(e)){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){const e=[...new Set(t)].map(e=>'"'.concat(e,'"'));i.searchParams.set("columns",e.join(","))}}return new f_({method:"POST",url:i,headers:s,schema:this.schema,body:e,fetch:null!==(r=this.fetch)&&void 0!==r?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var s;const{url:o,headers:a}=this.cloneRequestState();if(a.append("Prefer","resolution=".concat(n?"ignore":"merge","-duplicates")),void 0!==t&&o.searchParams.set("on_conflict",t),r&&a.append("Prefer","count=".concat(r)),i||a.append("Prefer","missing=default"),Array.isArray(e)){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){const e=[...new Set(t)].map(e=>'"'.concat(e,'"'));o.searchParams.set("columns",e.join(","))}}return new f_({method:"POST",url:o,headers:a,schema:this.schema,body:e,fetch:null!==(s=this.fetch)&&void 0!==s?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const{url:r,headers:i}=this.cloneRequestState();return t&&i.append("Prefer","count=".concat(t)),new f_({method:"PATCH",url:r,headers:i,schema:this.schema,body:e,fetch:null!==(n=this.fetch)&&void 0!==n?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const{url:n,headers:r}=this.cloneRequestState();return e&&r.append("Prefer","count=".concat(e)),new f_({method:"DELETE",url:n,headers:r,schema:this.schema,fetch:null!==(t=this.fetch)&&void 0!==t?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function m_(e){return(m_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g_(e){var t=function(e,t){if("object"!=m_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=m_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==m_(t)?t:t+""}function y_(e,t,n){return(t=g_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v_(Object(n),!0).forEach(function(t){y_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var w_=class e{constructor(e,{headers:t={},schema:n,fetch:r,timeout:i,urlLengthLimit:s=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=n,this.urlLengthLimit=s;const a=null!=r?r:globalThis.fetch;this.fetch=void 0!==i&&i>0?(e,t)=>{const n=new AbortController,r=setTimeout(()=>n.abort(),i),s=null==t?void 0:t.signal;if(s){if(s.aborted)return clearTimeout(r),a(e,t);const i=()=>{clearTimeout(r),n.abort()};return s.addEventListener("abort",i,{once:!0}),a(e,b_(b_({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),s.removeEventListener("abort",i)})}return a(e,b_(b_({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:a,this.retry=o}from(e){if(!e||"string"!=typeof e||""===e.trim())throw new Error("Invalid relation name: relation must be a non-empty string.");return new p_(new URL("".concat(this.url,"/").concat(e)),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){var s;let o;const a=new URL("".concat(this.url,"/rpc/").concat(e));let l;const u=e=>null!==e&&"object"==typeof e&&(!Array.isArray(e)||e.some(u)),c=n&&Object.values(t).some(u);c?(o="POST",l=t):n||r?(o=n?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?"{".concat(t.join(","),"}"):"".concat(t)]).forEach(([e,t])=>{a.searchParams.append(e,t)})):(o="POST",l=t);const h=new Headers(this.headers);return c?h.set("Prefer",i?"count=".concat(i,",return=minimal"):"return=minimal"):i&&h.set("Prefer","count=".concat(i)),new f_({method:o,url:a,headers:h,schema:this.schemaName,body:l,fetch:null!==(s=this.fetch)&&void 0!==s?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class k_{constructor(){}static detectEnvironment(){var e;if("undefined"!=typeof WebSocket)return{type:"native",constructor:WebSocket};if("undefined"!=typeof globalThis&&void 0!==globalThis.WebSocket)return{type:"native",constructor:globalThis.WebSocket};if("undefined"!=typeof global&&void 0!==global.WebSocket)return{type:"native",constructor:global.WebSocket};if("undefined"!=typeof globalThis&&void 0!==globalThis.WebSocketPair&&void 0===globalThis.WebSocket)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("undefined"!=typeof globalThis&&globalThis.EdgeRuntime||"undefined"!=typeof navigator&&(null===(e=navigator.userAgent)||void 0===e?void 0:e.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 t=globalThis.process;if(t){const e=t.versions;if(e&&e.node){const t=e.node,n=parseInt(t.replace(/^v/,"").split(".")[0]);return n>=22?void 0!==globalThis.WebSocket?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:"Node.js ".concat(n," detected but native WebSocket not found."),workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:"Node.js ".concat(n," detected without native WebSocket support."),workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew 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 e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+="\n\nSuggested solution: ".concat(e.workaround)),new Error(t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}}const S_="realtime-js/".concat("2.105.1"),__="2.0.0",E_=__,T_="closed",x_="errored",C_="joined",P_="joining",R_="leaving",A_={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},O_="connecting",j_="closing",L_="closed";class I_{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&"string"==typeof e.payload.event)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null===(t=e.payload)||void 0===t?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,n;const r=null!==(n=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==n?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,r)}_encodeJsonUserBroadcastPush(e){var t,n;const r=null!==(n=null===(t=e.payload)||void 0===t?void 0:t.payload)&&void 0!==n?n:{},i=(new TextEncoder).encode(JSON.stringify(r)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(e,t,n){var r,i;const s=e.topic,o=null!==(r=e.ref)&&void 0!==r?r:"",a=null!==(i=e.join_ref)&&void 0!==i?i:"",l=e.payload.event,u=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},c=0===Object.keys(u).length?"":JSON.stringify(u);if(a.length>255)throw new Error("joinRef length ".concat(a.length," exceeds maximum of 255"));if(o.length>255)throw new Error("ref length ".concat(o.length," exceeds maximum of 255"));if(s.length>255)throw new Error("topic length ".concat(s.length," exceeds maximum of 255"));if(l.length>255)throw new Error("userEvent length ".concat(l.length," exceeds maximum of 255"));if(c.length>255)throw new Error("metadata length ".concat(c.length," exceeds maximum of 255"));const h=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+o.length+s.length+l.length+c.length,d=new ArrayBuffer(this.HEADER_LENGTH+h);let f=new DataView(d),p=0;f.setUint8(p++,this.KINDS.userBroadcastPush),f.setUint8(p++,a.length),f.setUint8(p++,o.length),f.setUint8(p++,s.length),f.setUint8(p++,l.length),f.setUint8(p++,c.length),f.setUint8(p++,t),Array.from(a,e=>f.setUint8(p++,e.charCodeAt(0))),Array.from(o,e=>f.setUint8(p++,e.charCodeAt(0))),Array.from(s,e=>f.setUint8(p++,e.charCodeAt(0))),Array.from(l,e=>f.setUint8(p++,e.charCodeAt(0))),Array.from(c,e=>f.setUint8(p++,e.charCodeAt(0)));var m=new Uint8Array(d.byteLength+n.byteLength);return m.set(new Uint8Array(d),0),m.set(new Uint8Array(n),d.byteLength),m.buffer}decode(e,t){if(this._isArrayBuffer(e)){return t(this._binaryDecode(e))}if("string"==typeof e){const n=JSON.parse(e),[r,i,s,o,a]=n;return t({join_ref:r,ref:i,topic:s,event:o,payload:a})}return t({})}_binaryDecode(e){const t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;if(n===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,r)}_decodeUserBroadcast(e,t,n){const r=t.getUint8(1),i=t.getUint8(2),s=t.getUint8(3),o=t.getUint8(4);let a=this.HEADER_LENGTH+4;const l=n.decode(e.slice(a,a+r));a+=r;const u=n.decode(e.slice(a,a+i));a+=i;const c=n.decode(e.slice(a,a+s));a+=s;const h=e.slice(a,e.byteLength),d=o===this.JSON_ENCODING?JSON.parse(n.decode(h)):h,f={type:this.BROADCAST_EVENT,event:u,payload:d};return s>0&&(f.meta=JSON.parse(c)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:f}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||"ArrayBuffer"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}}var N_,D_;(D_=N_||(N_={})).abstime="abstime",D_.bool="bool",D_.date="date",D_.daterange="daterange",D_.float4="float4",D_.float8="float8",D_.int2="int2",D_.int4="int4",D_.int4range="int4range",D_.int8="int8",D_.int8range="int8range",D_.json="json",D_.jsonb="jsonb",D_.money="money",D_.numeric="numeric",D_.oid="oid",D_.reltime="reltime",D_.text="text",D_.time="time",D_.timestamp="timestamp",D_.timestamptz="timestamptz",D_.timetz="timetz",D_.tsrange="tsrange",D_.tstzrange="tstzrange";const M_=(e,t,n={})=>{var r;const i=null!==(r=n.skipTypes)&&void 0!==r?r:[];return t?Object.keys(t).reduce((n,r)=>(n[r]=U_(r,e,t,i),n),{}):{}},U_=(e,t,n,r)=>{const i=t.find(t=>t.name===e),s=null==i?void 0:i.type,o=n[e];return s&&!r.includes(s)?B_(s,o):F_(o)},B_=(e,t)=>{if("_"===e.charAt(0)){const n=e.slice(1,e.length);return H_(t,n)}switch(e){case N_.bool:return V_(t);case N_.float4:case N_.float8:case N_.int2:case N_.int4:case N_.int8:case N_.numeric:case N_.oid:return z_(t);case N_.json:case N_.jsonb:return W_(t);case N_.timestamp:return q_(t);case N_.abstime:case N_.date:case N_.daterange:case N_.int4range:case N_.int8range:case N_.money:case N_.reltime:case N_.text:case N_.time:case N_.timestamptz:case N_.timetz:case N_.tsrange:case N_.tstzrange:default:return F_(t)}},F_=e=>e,V_=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},z_=e=>{if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},W_=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e},H_=(e,t)=>{if("string"!=typeof e)return e;const n=e.length-1,r=e[n];if("{"===e[0]&&"}"===r){let r;const s=e.slice(1,n);try{r=JSON.parse("["+s+"]")}catch(i){r=s?s.split(","):[]}return r.map(e=>B_(t,e))}return e},q_=e=>"string"==typeof e?e.replace(" ","T"):e,K_=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 G_,J_,$_,Y_,X_,Q_,Z_,eE,tE=e=>{if("function"==typeof e)return e;return function(){return e}},nE="undefined"!=typeof self?self:null,rE="undefined"!=typeof window?window:null,iE=nE||rE||globalThis,sE=0,oE=1,aE=2,lE=3,uE="closed",cE="errored",hE="joined",dE="joining",fE="leaving",pE="phx_close",mE="phx_error",gE="phx_join",yE="phx_reply",vE="phx_leave",bE="longpoll",wE="websocket",kE=4,SE="base64url.bearer.phx.",_E=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},EE=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))}},TE=class{constructor(e,t,n){this.state=uE,this.topic=e,this.params=tE(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new _E(this,gE,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new EE(()=>{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=hE,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive("error",e=>{this.state=cE,this.socket.hasLogger()&&this.socket.log("channel","error ".concat(this.topic),e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel","close ".concat(this.topic)),this.state=uE,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log("channel","error ".concat(this.topic),e),this.isJoining()&&this.joinPush.reset(),this.state=cE,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel","timeout ".concat(this.topic),this.joinPush.timeout),new _E(this,vE,tE({}),this.timeout).send(),this.state=cE,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(yE,(e,t)=>{this.trigger(this.replyEventName(t),e)})}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=uE,this.bindings=[]}onClose(e){this.on(pE,e)}onError(e){return this.on(mE,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&&(void 0===t||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 '".concat(e,"' to '").concat(this.topic,"' before joining. Use channel.join() before pushing events"));let r=new _E(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=fE;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel","leave ".concat(this.topic)),this.trigger(pE,"leave")},n=new _E(this,vE,tE({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic===e&&(!r||r===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=dE,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let o=0;o<s.length;o++){s[o].callback(i,n,r||this.joinRef())}}replyEventName(e){return"chan_reply_".concat(e)}isClosed(){return this.state===uE}isErrored(){return this.state===cE}isJoined(){return this.state===hE}isJoining(){return this.state===dE}isLeaving(){return this.state===fE}},xE=class{static request(e,t,n,r,i,s,o){if(iE.XDomainRequest){let n=new iE.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,s,o)}if(iE.XMLHttpRequest){let a=new iE.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,i,s,o)}if(iE.fetch&&iE.AbortController)return this.fetchRequest(e,t,n,r,i,s,o);throw new Error("No suitable XMLHttpRequest implementation found")}static fetchRequest(e,t,n,r,i,s,o){let a={method:e,headers:n,body:r},l=null;return i&&(l=new AbortController,setTimeout(()=>l.abort(),i),a.signal=l.signal),iE.fetch(t,a).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{"AbortError"===e.name&&s?s():o&&o(null)}),l}static xdomainRequest(e,t,n,r,i,s,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},s&&(e.ontimeout=s),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,s,o,a){e.open(t,n,!0),e.timeout=s;for(let[l,u]of Object.entries(r))e.setRequestHeader(l,u);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===kE&&a){let t=this.parseJSON(e.responseText);a(t)}},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(OC){return console,null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?"".concat(t,"[").concat(r,"]"):r,s=e[r];"object"==typeof s?n.push(this.serialize(s,i)):n.push(encodeURIComponent(i)+"="+encodeURIComponent(s))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return"".concat(e).concat(n).concat(this.serialize(t))}},CE=class{constructor(e,t){t&&2===t.length&&t[1].startsWith(SE)&&(this.authToken=atob(t[1].slice(21))),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=sE,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+wE),"$1/"+bE)}endpointURL(){return xE.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=sE}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===oE||this.readyState===sE}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(410===t&&null!==this.token)return this.onerror(410),void this.closeAndRetry(3410,"session_gone",!1);this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=oE,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 ".concat(t))}})}send(e){"string"!=typeof e&&(e=(e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let i=0;i<r;i++)t+=String.fromCharCode(n[i]);return btoa(t)})(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("\n"),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,n){for(let i of this.reqs)i.abort();this.readyState=lE;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,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,i){let s;s=xE.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(s),r()},e=>{this.reqs.delete(s),this.isActive()&&i(e)}),this.reqs.add(s)}},PE=class e{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,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let i=this.clone(e),s={},o={};return this.map(i,(e,n)=>{t[e]||(o[e]=n)}),this.map(t,(e,t)=>{let n=i[e];if(n){let r=t.metas.map(e=>e.phx_ref),i=n.metas.map(e=>e.phx_ref),a=t.metas.filter(e=>i.indexOf(e.phx_ref)<0),l=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);a.length>0&&(s[e]=t,s[e].metas=a),l.length>0&&(o[e]=this.clone(n),o[e].metas=l)}else s[e]=t}),this.syncDiff(i,{joins:s,leaves:o},n,r)}static syncDiff(e,t,n,r){let{joins:i,leaves:s}=this.clone(t);return n||(n=function(){}),r||(r=function(){}),this.map(i,(t,r)=>{let i=e[t];if(e[t]=this.clone(r),i){let n=e[t].metas.map(e=>e.phx_ref),r=i.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,i,r)}),this.map(s,(t,n)=>{let i=e[t];if(!i)return;let s=n.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>s.indexOf(e.phx_ref)<0),r(t,i,n),0===i.metas.length&&delete e[t]}),e}static list(e,t){return t||(t=function(e,t){return t}),this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},RE={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,s,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:s,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:s}=e,o=this.META_LENGTH+t.length+n.length+i.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,t.length),l.setUint8(u++,n.length),l.setUint8(u++,i.length),l.setUint8(u++,r.length),Array.from(t,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(n,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(i,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(r,e=>l.setUint8(u++,e.charCodeAt(0)));var c=new Uint8Array(a.byteLength+s.byteLength);return c.set(new Uint8Array(a),0),c.set(new Uint8Array(s),a.byteLength),c.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),i=t.getUint8(2),s=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(o,o+r));o+=r;let l=n.decode(e.slice(o,o+i));o+=i;let u=n.decode(e.slice(o,o+s));return o+=s,{join_ref:a,ref:null,topic:l,event:u,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),s=t.getUint8(3),o=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(e.slice(a,a+r));a+=r;let u=n.decode(e.slice(a,a+i));a+=i;let c=n.decode(e.slice(a,a+s));a+=s;let h=n.decode(e.slice(a,a+o));a+=o;let d=e.slice(a,e.byteLength);return{join_ref:l,ref:u,topic:c,event:yE,payload:{status:h,response:d}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),s=this.HEADER_LENGTH+2,o=n.decode(e.slice(s,s+r));s+=r;let a=n.decode(e.slice(s,s+i));return s+=i,{join_ref:null,ref:null,topic:o,event:a,payload:e.slice(s,e.byteLength)}}},AE=class{constructor(e,t={}){var n,r;this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||1e4,this.transport=t.transport||iE.WebSocket||CE,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||iE&&iE.sessionStorage,this.establishedConnections=0,this.defaultEncoder=RE.encode.bind(RE),this.defaultDecoder=RE.decode.bind(RE),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!==CE?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;rE&&rE.addEventListener&&(rE.addEventListener("pagehide",e=>{this.conn&&(this.disconnect(),i=this.connectClock)}),rE.addEventListener("pageshow",e=>{i===this.connectClock&&(i=null,this.connect())}),rE.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?this.pageHidden=!0:(this.pageHidden=!1,this.isConnected()||this.closeWasClean||this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=null==(n=t.autoSendHeartbeat)||n,this.heartbeatCallback=null!=(r=t.heartbeatCallback)?r:()=>{},this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=tE(t.params||{}),this.endPoint="".concat(e,"/").concat(wE),this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new EE(()=>{if(this.pageHidden)return this.log("Not reconnecting as page is hidden!"),void this.teardown();this.teardown(()=>y(this,null,function*(){t.beforeReconnect&&(yield t.beforeReconnect()),this.connect()}))},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return CE}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=xE.appendParams(xE.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?"".concat(this.protocol(),":").concat(e):"".concat(this.protocol(),"://").concat(location.host).concat(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,this.params=tE(e)),this.conn&&!this.disconnecting||(this.longPollFallbackMs&&this.transport!==CE?this.connectWithFallback(CE,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){return e===CE?"LongPoll":e.name}transportConnect(){let e;this.connectClock++,this.closeWasClean=!1,this.authToken&&(e=["phoenix","".concat(SE).concat(btoa(this.authToken).replace(/=/g,""))]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n,r=!1,i=!0,s=this.transportName(e),o=t=>{this.log("transport","falling back to ".concat(s,"..."),t),this.off([void 0,n]),i=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession("phx:fallback:".concat(s)))return o("memorized");this.fallbackTimer=setTimeout(o,t),n=this.onError(e=>{this.log("transport","error",e),i&&!r&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!i){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession("phx:fallback:".concat(t),"true"),this.log("transport","established ".concat(t," fallback"))}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport","connected to ".concat(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(OC){this.log("error","error in heartbeat callback",OC)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"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){5!==n&&e.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n):t()}waitForSocketClosed(e,t,n=1){5!==n&&e.readyState!==lE?setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n):t()}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(mE,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case sE:return"connecting";case oE:return"open";case aE:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>-1===e.indexOf(t))}channel(e,t={}){let n=new TE(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:s}=e;this.log("push","".concat(t," ").concat(n," (").concat(s,", ").concat(i,")"),r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(this.isConnected())if(this.pendingHeartbeatRef)this.heartbeatTimeout();else{this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(OC){this.log("error","error in heartbeat callback",OC)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}else try{this.heartbeatCallback("disconnected")}catch(OC){this.log("error","error in heartbeat callback",OC)}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:s}=e;if(i&&i===this.pendingHeartbeatRef){const e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback("ok"===r.status?"ok":"error",e)}catch(OC){this.log("error","error in heartbeat callback",OC)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive","".concat(r.status||""," ").concat(t," ").concat(n," ").concat(i&&"("+i+")"||"").trim(),r);for(let o=0;o<this.channels.length;o++){const e=this.channels[o];e.isMember(t,n,r,s)&&e.trigger(n,r,i,s)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(OC){this.log("error","error in ".concat(e," callback"),OC)}})}catch(OC){this.log("error","error triggering ".concat(e," callbacks"),OC)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log("transport",'leaving duplicate topic "'.concat(e,'"')),t.leave())}};class OE{constructor(e,t){const n=function(e){return(null==e?void 0:e.events)&&{events:e.events}}(t);this.presence=new PE(e.getChannel(),n),this.presence.onJoin((t,n,r)=>{const i=OE.onJoinPayload(t,n,r);e.getChannel().trigger("presence",i)}),this.presence.onLeave((t,n,r)=>{const i=OE.onLeavePayload(t,n,r);e.getChannel().trigger("presence",i)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return OE.transformState(this.presence.state)}static transformState(e){return e=function(e){return JSON.parse(JSON.stringify(e))}(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{const r=e[n];return t[n]=jE(r),t},{})}static onJoinPayload(e,t,n){return{event:"join",key:e,currentPresences:LE(t),newPresences:jE(n)}}static onLeavePayload(e,t,n){return{event:"leave",key:e,currentPresences:LE(t),leftPresences:jE(n)}}}function jE(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function LE(e){return(null==e?void 0:e.metas)?jE(e):[]}(J_=G_||(G_={})).SYNC="sync",J_.JOIN="join",J_.LEAVE="leave";class IE{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new OE(this.channel.channelAdapter,t)}}class NE{constructor(e,t,n){const r=(i=n,{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},i.config)});var i;this.channel=e.getSocket().channel(t,r),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,n){let r;try{r=this.channel.push(e,t,n)}catch(i){throw new Error("tried to push '".concat(e,"' to '").concat(this.channel.topic,"' before joining. Use channel.subscribe() before pushing events"))}if(this.channel.pushBuffer.length>100){const e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log("channel","discarded push due to buffer overflow: ".concat(e.event),e.payload())}return r}updateJoinPayload(e){const t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===C_}isJoined(){return this.state===C_}isJoining(){return this.state===P_}isClosed(){return this.state===T_}isLeaving(){return this.state===R_}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}(Y_=$_||($_={})).ALL="*",Y_.INSERT="INSERT",Y_.UPDATE="UPDATE",Y_.DELETE="DELETE",(Q_=X_||(X_={})).BROADCAST="broadcast",Q_.PRESENCE="presence",Q_.POSTGRES_CHANGES="postgres_changes",Q_.SYSTEM="system",(eE=Z_||(Z_={})).SUBSCRIBED="SUBSCRIBED",eE.TIMED_OUT="TIMED_OUT",eE.CLOSED="CLOSED",eE.CHANNEL_ERROR="CHANNEL_ERROR";class DE{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},n){var r,i;if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new NE(this.socket.socketAdapter,e,this.params),this.presence=new IE(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=K_(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(null===(i=null===(r=this.params.config)||void 0===r?void 0:r.broadcast)||void 0===i?void 0:i.replay))throw new Error("tried to use replay on public channel '".concat(this.topic,"'. It must be a private channel."))}subscribe(e,t=this.timeout){var n,r,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:s,presence:o,private:a}}=this.params,l=null!==(r=null===(n=this.bindings.postgres_changes)||void 0===n?void 0:n.map(e=>e.filter))&&void 0!==r?r:[],u=!!this.bindings[X_.PRESENCE]&&this.bindings[X_.PRESENCE].length>0||!0===(null===(i=this.params.config.presence)||void 0===i?void 0:i.enabled),c={},h={broadcast:s,presence:Object.assign(Object.assign({},o),{enabled:u}),postgres_changes:l,private:a};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this._onError(t=>{null==e||e(Z_.CHANNEL_ERROR,function(e){if(e instanceof Error)return e;if("string"==typeof e)return new Error(e);if(e&&"object"==typeof e){const t=e;if("number"==typeof t.code){const n="string"==typeof t.reason&&t.reason?" (".concat(t.reason,")"):"";return new Error("socket closed: ".concat(t.code).concat(n),{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}(t))}),this._onClose(()=>null==e?void 0:e(Z_.CLOSED)),this.updateJoinPayload(Object.assign({config:h},c)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",t=>y(this,[t],function*({postgres_changes:t}){this.socket._isManualToken()||this.socket.setAuth(),void 0!==t?this._updatePostgresBindings(t,e):null==e||e(Z_.SUBSCRIBED)})).receive("error",t=>{this.state=x_;const n=Object.values(t).join(", ")||"error";null==e||e(Z_.CHANNEL_ERROR,new Error(n,{cause:t}))}).receive("timeout",()=>{null==e||e(Z_.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var n;const r=this.bindings.postgres_changes,i=null!==(n=null==r?void 0:r.length)&&void 0!==n?n:0,s=[];for(let o=0;o<i;o++){const n=r[o],{filter:{event:i,schema:a,table:l,filter:u}}=n,c=e&&e[o];if(!(c&&c.event===i&&DE.isFilterValueEqual(c.schema,a)&&DE.isFilterValueEqual(c.table,l)&&DE.isFilterValueEqual(c.filter,u)))return this.unsubscribe(),this.state=x_,void(null==t||t(Z_.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes")));s.push(Object.assign(Object.assign({},n),{id:c.id}))}this.bindings.postgres_changes=s,this.state!=x_&&t&&t(Z_.SUBSCRIBED)}presenceState(){return this.presence.state}track(e){return y(this,arguments,function*(e,t={}){return yield this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)})}untrack(){return y(this,arguments,function*(e={}){return yield this.send({type:"presence",event:"untrack"},e)})}on(e,t,n){const r=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===X_.PRESENCE||e===X_.POSTGRES_CHANGES;if(r&&i)throw this.socket.log("channel","cannot add `".concat(e,"` callbacks for ").concat(this.topic," after `subscribe()`.")),new Error("cannot add `".concat(e,"` callbacks for ").concat(this.topic," after `subscribe()`."));return this._on(e,t,n)}httpSend(e,t){return y(this,arguments,function*(e,t,n={}){var r;if(null==t)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 ".concat(this.socket.accessTokenValue));const s={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},o=yield this._fetchWithTimeout(this.broadcastEndpointURL,s,null!==(r=n.timeout)&&void 0!==r?r:this.timeout);if(202===o.status)return{success:!0};let a=o.statusText;try{const e=yield o.json();a=e.error||e.message||a}catch(l){}return Promise.reject(new Error(a))})}send(e){return y(this,arguments,function*(e,t={}){var n,r;if(this.channelAdapter.canPush()||"broadcast"!==e.type)return new Promise(n=>{var r,i,s;const o=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null===(s=null===(i=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===i?void 0:i.broadcast)||void 0===s?void 0:s.ack)||n("ok"),o.receive("ok",()=>n("ok")),o.receive("error",()=>n("error")),o.receive("timeout",()=>n("timed out"))});{const{event:s,payload:o}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization="Bearer ".concat(this.socket.accessTokenValue));const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:o,private:this.private}]})};try{const e=yield this._fetchWithTimeout(this.broadcastEndpointURL,l,null!==(n=t.timeout)&&void 0!==n?n:this.timeout);return yield null===(r=e.body)||void 0===r?void 0:r.cancel(),e.ok?"ok":"error"}catch(i){return"AbortError"===i.name?"timed out":"error"}}})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}unsubscribe(){return y(this,arguments,function*(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})})}teardown(){this.channelAdapter.teardown()}_fetchWithTimeout(e,t,n){return y(this,null,function*(){const r=new AbortController,i=setTimeout(()=>r.abort(),n),s=yield this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),s})}_on(e,t,n){const r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:n,ref:this.channelAdapter.on(e,n)};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{var r,i,s,o,a,l,u;const c=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(c,n))return!1;const h=null===(r=this.bindings[c])||void 0===r?void 0:r.find(t=>t.ref===e.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(c)){if("id"in h){const e=h.id,n=null===(i=h.filter)||void 0===i?void 0:i.event;return e&&(null===(s=t.ids)||void 0===s?void 0:s.includes(e))&&("*"===n||(null==n?void 0:n.toLocaleLowerCase())===(null===(o=t.data)||void 0===o?void 0:o.type.toLocaleLowerCase()))}{const e=null===(l=null===(a=null==h?void 0:h.filter)||void 0===a?void 0:a.event)||void 0===l?void 0:l.toLocaleLowerCase();return"*"===e||e===(null===(u=null==t?void 0:t.event)||void 0===u?void 0:u.toLocaleLowerCase())}}return h.type.toLocaleLowerCase()===c})}_notThisChannelEvent(e,t){const{close:n,error:r,leave:i,join:s}=A_;return t&&[n,r,i,s].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if("object"==typeof t&&"ids"in t){const e=t.data,{schema:n,table:r,commit_timestamp:i,type:s,errors:o}=e,a={schema:n,table:r,commit_timestamp:i,eventType:s,new:{},old:{},errors:o};return Object.assign(Object.assign({},a),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const t in e.bindings)for(const n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}_getPayloadRecords(e){const t={new:{},old:{}};return"INSERT"!==e.type&&"UPDATE"!==e.type||(t.new=M_(e.columns,e.record)),"UPDATE"!==e.type&&"DELETE"!==e.type||(t.old=M_(e.columns,e.old_record)),t}}class ME{constructor(e,t){this.socket=new AE(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),r),this.socket.disconnect(()=>{e(),i("ok")},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==O_}isDisconnecting(){return this.socket.connectionState()==j_}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const UE=25e3,BE=[1e3,2e3,5e3,1e4];class FE{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new I_,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!(null===(n=null==t?void 0:t.params)||void 0===n?void 0:n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey;const r=this._initializeOptions(t);this.socketAdapter=new ME(e,r),this.httpEndpoint=K_(e),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const t=e.message;if(t.includes("Node.js"))throw new Error("".concat(t,"\n\n")+'To use Realtime in Node.js, you need to provide a WebSocket implementation:\n\nOption 1: Use Node.js 22+ which has native WebSocket support\nOption 2: Install and provide the "ws" package:\n\n npm install ws\n\n import ws from "ws"\n const client = new RealtimeClient(url, {\n ...options,\n transport: ws\n })');throw new Error("WebSocket not available: ".concat(t))}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}disconnect(e,t){return y(this,null,function*(){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":yield this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)})}getChannels(){return this.channels}removeChannel(e){return y(this,null,function*(){const t=yield e.unsubscribe();return"ok"===t&&e.teardown(),t})}removeAllChannels(){return y(this,null,function*(){const e=this.channels.map(e=>y(this,null,function*(){const t=yield e.unsubscribe();return e.teardown(),t})),t=yield Promise.all(e);return yield this.disconnect(),t})}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||L_}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){const n="realtime:".concat(e),r=this.getChannels().find(e=>e.topic===n);if(r)return r;{const n=new DE("realtime:".concat(e),t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}setAuth(e=null){return y(this,null,function*(){this._authPromise=this._performAuth(e);try{yield this._authPromise}finally{this._authPromise=null}})}_isManualToken(){return this._manuallySetToken}sendHeartbeat(){return y(this,null,function*(){this.socketAdapter.sendHeartbeat()})}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),0===this.channels.length&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),0===this._disconnectOnEmptyChannelsAfterMs)return this.log("transport","disconnecting immediately - no channels"),void this.disconnect();this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,0===this.channels.length&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport","deferred disconnect scheduled in ".concat(this._disconnectOnEmptyChannelsAfterMs,"ms"))}_cancelPendingDisconnect(){null!==this._pendingDisconnectTimer&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}_performAuth(e=null){return y(this,null,function*(){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=yield this.accessToken()}catch(OC){this.log("error","Error fetching access token from callback",OC),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{const n={access_token:t,version:S_};t&&e.updateJoinPayload(n),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(A_.access_token,{access_token:t})}))})}_waitForAuthIfNeeded(){return y(this,null,function*(){this._authPromise&&(yield this._authPromise)})}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error","Error setting auth in ".concat(e),t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log("error","error waiting for auth on connect",e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{"sent"==t&&this._setAuthSafely(),e&&e(t,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker","starting worker for from ".concat(this.workerUrl)):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&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(e){let t;if(e)t=e;else{const e=new Blob(['\n addEventListener("message", (e) => {\n if (e.data.event === "start") {\n setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);\n }\n });'],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_initializeOptions(e){var t,n,r,i,s,o,a,l,u,c,h;this.worker=null!==(t=null==e?void 0:e.worker)&&void 0!==t&&t,this.accessToken=null!==(n=null==e?void 0:e.accessToken)&&void 0!==n?n:null;const d={};let f,p;d.timeout=null!==(r=null==e?void 0:e.timeout)&&void 0!==r?r:1e4,d.heartbeatIntervalMs=null!==(i=null==e?void 0:e.heartbeatIntervalMs)&&void 0!==i?i:UE,this._disconnectOnEmptyChannelsAfterMs=null!==(s=null==e?void 0:e.disconnectOnEmptyChannelsAfterMs)&&void 0!==s?s:2*(null!==(o=null==e?void 0:e.heartbeatIntervalMs)&&void 0!==o?o:UE),d.transport=null!==(a=null==e?void 0:e.transport)&&void 0!==a?a:k_.getWebSocketConstructor(),d.params=null==e?void 0:e.params,d.logger=null==e?void 0:e.logger,d.heartbeatCallback=this._wrapHeartbeatCallback(null==e?void 0:e.heartbeatCallback),d.reconnectAfterMs=null!==(l=null==e?void 0:e.reconnectAfterMs)&&void 0!==l?l:e=>BE[e-1]||1e4;const m=null!==(u=null==e?void 0:e.vsn)&&void 0!==u?u:E_;switch(m){case"1.0.0":f=(e,t)=>t(JSON.stringify(e)),p=(e,t)=>t(JSON.parse(e));break;case __:f=this.serializer.encode.bind(this.serializer),p=this.serializer.decode.bind(this.serializer);break;default:throw new Error("Unsupported serializer version: ".concat(d.vsn))}if(d.vsn=m,d.encode=null!==(c=null==e?void 0:e.encode)&&void 0!==c?c:f,d.decode=null!==(h=null==e?void 0:e.decode)&&void 0!==h?h:p,d.beforeReconnect=this._reconnectAuth.bind(this),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,d.params=Object.assign(Object.assign({},d.params),{log_level:this.logLevel})),this.worker){if("undefined"!=typeof window&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=null==e?void 0:e.workerUrl,d.autoSendHeartbeat=!this.worker}return d}_reconnectAuth(){return y(this,null,function*(){yield this._waitForAuthIfNeeded(),this.isConnected()||this.connect()})}}var VE=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="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&!0===(null==(n=t.icebergType)?void 0:n.includes("CommitState"))}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};function zE(e){var t;const n=null!=(t=e.fetchImpl)?t:globalThis.fetch;return{request(t){return y(this,arguments,function*({method:t,path:r,query:i,body:s,headers:o}){var a;const l=function(e,t,n){const r=new URL(t,e);if(n)for(const[i,s]of Object.entries(n))void 0!==s&&r.searchParams.set(i,s);return r.toString()}(e.baseUrl,r,i),u=yield function(e){return y(this,null,function*(){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:"Bearer ".concat(e.token)}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?yield e.getHeaders():{}:{}})}(e.auth),c=yield n(l,{method:t,headers:d(d(d({},s?{"Content-Type":"application/json"}:{}),u),o),body:s?JSON.stringify(s):void 0}),h=yield c.text(),f=(c.headers.get("content-type")||"").includes("application/json"),p=f&&h?JSON.parse(h):h;if(!c.ok){const e=f?p:void 0,t=null==e?void 0:e.error;throw new VE(null!=(a=null==t?void 0:t.message)?a:"Request failed with status ".concat(c.status),{status:c.status,icebergType:null==t?void 0:t.type,icebergCode:null==t?void 0:t.code,details:e})}return{status:c.status,headers:c.headers,data:p}})}}}function WE(e){return e.join("")}var HE=class{constructor(e,t=""){this.client=e,this.prefix=t}listNamespaces(e){return y(this,null,function*(){const t=e?{parent:WE(e.namespace)}:void 0;return(yield this.client.request({method:"GET",path:"".concat(this.prefix,"/namespaces"),query:t})).data.namespaces.map(e=>({namespace:e}))})}createNamespace(e,t){return y(this,null,function*(){const n={namespace:e.namespace,properties:null==t?void 0:t.properties};return(yield this.client.request({method:"POST",path:"".concat(this.prefix,"/namespaces"),body:n})).data})}dropNamespace(e){return y(this,null,function*(){yield this.client.request({method:"DELETE",path:"".concat(this.prefix,"/namespaces/").concat(WE(e.namespace))})})}loadNamespaceMetadata(e){return y(this,null,function*(){return{properties:(yield this.client.request({method:"GET",path:"".concat(this.prefix,"/namespaces/").concat(WE(e.namespace))})).data.properties}})}namespaceExists(e){return y(this,null,function*(){try{return yield this.client.request({method:"HEAD",path:"".concat(this.prefix,"/namespaces/").concat(WE(e.namespace))}),!0}catch(t){if(t instanceof VE&&404===t.status)return!1;throw t}})}createNamespaceIfNotExists(e,t){return y(this,null,function*(){try{return yield this.createNamespace(e,t)}catch(n){if(n instanceof VE&&409===n.status)return;throw n}})}};function qE(e){return e.join("")}var KE=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}listTables(e){return y(this,null,function*(){return(yield this.client.request({method:"GET",path:"".concat(this.prefix,"/namespaces/").concat(qE(e.namespace),"/tables")})).data.identifiers})}createTable(e,t){return y(this,null,function*(){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);return(yield this.client.request({method:"POST",path:"".concat(this.prefix,"/namespaces/").concat(qE(e.namespace),"/tables"),body:t,headers:n})).data.metadata})}updateTable(e,t){return y(this,null,function*(){const n=yield this.client.request({method:"POST",path:"".concat(this.prefix,"/namespaces/").concat(qE(e.namespace),"/tables/").concat(e.name),body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}})}dropTable(e,t){return y(this,null,function*(){var n;yield this.client.request({method:"DELETE",path:"".concat(this.prefix,"/namespaces/").concat(qE(e.namespace),"/tables/").concat(e.name),query:{purgeRequested:String(null!=(n=null==t?void 0:t.purge)&&n)}})})}loadTable(e){return y(this,null,function*(){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);return(yield this.client.request({method:"GET",path:"".concat(this.prefix,"/namespaces/").concat(qE(e.namespace),"/tables/").concat(e.name),headers:t})).data.metadata})}tableExists(e){return y(this,null,function*(){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return yield this.client.request({method:"HEAD",path:"".concat(this.prefix,"/namespaces/").concat(qE(e.namespace),"/tables/").concat(e.name),headers:t}),!0}catch(n){if(n instanceof VE&&404===n.status)return!1;throw n}})}createTableIfNotExists(e,t){return y(this,null,function*(){try{return yield this.createTable(e,t)}catch(n){if(n instanceof VE&&409===n.status)return yield this.loadTable({namespace:e.namespace,name:t.name});throw n}})}},GE=class{constructor(e){var t;let n="v1";e.catalogName&&(n+="/".concat(e.catalogName));const r=e.baseUrl.endsWith("/")?e.baseUrl:"".concat(e.baseUrl,"/");this.client=zE({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=null==(t=e.accessDelegation)?void 0:t.join(","),this.namespaceOps=new HE(this.client,n),this.tableOps=new KE(this.client,n,this.accessDelegation)}listNamespaces(e){return y(this,null,function*(){return this.namespaceOps.listNamespaces(e)})}createNamespace(e,t){return y(this,null,function*(){return this.namespaceOps.createNamespace(e,t)})}dropNamespace(e){return y(this,null,function*(){yield this.namespaceOps.dropNamespace(e)})}loadNamespaceMetadata(e){return y(this,null,function*(){return this.namespaceOps.loadNamespaceMetadata(e)})}listTables(e){return y(this,null,function*(){return this.tableOps.listTables(e)})}createTable(e,t){return y(this,null,function*(){return this.tableOps.createTable(e,t)})}updateTable(e,t){return y(this,null,function*(){return this.tableOps.updateTable(e,t)})}dropTable(e,t){return y(this,null,function*(){yield this.tableOps.dropTable(e,t)})}loadTable(e){return y(this,null,function*(){return this.tableOps.loadTable(e)})}namespaceExists(e){return y(this,null,function*(){return this.namespaceOps.namespaceExists(e)})}tableExists(e){return y(this,null,function*(){return this.tableOps.tableExists(e)})}createNamespaceIfNotExists(e,t){return y(this,null,function*(){return this.namespaceOps.createNamespaceIfNotExists(e,t)})}createTableIfNotExists(e,t){return y(this,null,function*(){return this.tableOps.createTableIfNotExists(e,t)})}};function JE(e){return(JE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $E(e){var t=function(e,t){if("object"!=JE(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=JE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==JE(t)?t:t+""}function YE(e,t,n){return(t=$E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XE(Object(n),!0).forEach(function(t){YE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ZE=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name="vectors"===t?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function eT(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var tT=class extends ZE{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name="vectors"===r?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return QE({},super.toJSON())}},nT=class extends ZE{constructor(e,t,n="storage"){super(e,n),this.name="vectors"===n?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function rT(e,t,n){const r=QE({},e),i=t.toLowerCase();for(const s of Object.keys(r))s.toLowerCase()===i&&delete r[s];return r[i]=n,r}const iT=e=>{if(Array.isArray(e))return e.map(e=>iT(e));if("function"==typeof e||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([e,n])=>{const r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""));t[r]=iT(n)}),t},sT=e=>{var t;return e.msg||e.message||e.error_description||("string"==typeof e.error?e.error:null===(t=e.error)||void 0===t?void 0:t.message)||JSON.stringify(e)},oT=(e,t,n,r)=>{const i={method:e,headers:(null==t?void 0:t.headers)||{}};if("GET"===e||"HEAD"===e||!r)return QE(QE({},i),n);if((e=>{if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)})(r)){var s;const e=(null==t?void 0:t.headers)||{};let n;for(const[t,r]of Object.entries(e))"content-type"===t.toLowerCase()&&(n=r);i.headers=rT(e,"Content-Type",null!==(s=n)&&void 0!==s?s:"application/json"),i.body=JSON.stringify(r)}else i.body=r;return(null==t?void 0:t.duplex)&&(i.duplex=t.duplex),QE(QE({},i),n)};function aT(e,t,n,r,i,s,o){return y(this,null,function*(){return new Promise((a,l)=>{e(n,oT(t,r,i,s)).then(e=>{if(!e.ok)throw e;if(null==r?void 0:r.noResolveJson)return e;if("vectors"===o){const t=e.headers.get("content-type");if("0"===e.headers.get("content-length")||204===e.status)return{};if(!t||!t.includes("application/json"))return{}}return e.json()}).then(e=>a(e)).catch(e=>((e,t,n,r)=>y(void 0,null,function*(){if(null!==e&&"object"==typeof e&&"function"==typeof e.json){const n=e;let i=parseInt(n.status,10);Number.isFinite(i)||(i=500),n.json().then(e=>{const n=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||i+"";t(new tT(sT(e),i,n,r))}).catch(()=>{const e=i+"";t(new tT(n.statusText||"HTTP ".concat(i," error"),i,e,r))})}else t(new nT(sT(e),e,r))}))(e,l,0,o))})})}function lT(e="storage"){return{get:(t,n,r,i)=>y(this,null,function*(){return aT(t,"GET",n,r,i,void 0,e)}),post:(t,n,r,i,s)=>y(this,null,function*(){return aT(t,"POST",n,i,s,r,e)}),put:(t,n,r,i,s)=>y(this,null,function*(){return aT(t,"PUT",n,i,s,r,e)}),head:(t,n,r,i)=>y(this,null,function*(){return aT(t,"HEAD",n,QE(QE({},r),{},{noResolveJson:!0}),i,void 0,e)}),remove:(t,n,r,i,s)=>y(this,null,function*(){return aT(t,"DELETE",n,i,s,r,e)})}}const uT=lT("storage"),{get:cT,post:hT,put:dT,head:fT,remove:pT}=uT,mT=lT("vectors");var gT=class{constructor(e,t={},n,r="storage"){var i;this.shouldThrowOnError=!1,this.url=e,this.headers=function(e){const t={};for(const[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}(t),this.fetch=(i=n)?(...e)=>i(...e):(...e)=>fetch(...e),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=rT(this.headers,e,t),this}handleOperation(e){return y(this,null,function*(){try{return{data:yield e(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(eT(t))return{data:null,error:t};throw t}})}},yT=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}execute(){return y(this,null,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(eT(e))return{data:null,error:e};throw e}})}};let vT;vT=Symbol.toStringTag;var bT=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[vT]="BlobDownloadBuilder",this.promise=null}asStream(){return new yT(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}execute(){return y(this,null,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(eT(e))return{data:null,error:e};throw e}})}};const wT={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},kT={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var ST=class extends gT{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}uploadOrUpdate(e,t,n,r){return y(this,null,function*(){var i=this;return i.handleOperation(()=>y(this,null,function*(){let s;const o=QE(QE({},kT),r);let a=QE(QE({},i.headers),"POST"===e&&{"x-upsert":String(o.upsert)});const l=o.metadata;if("undefined"!=typeof Blob&&n instanceof Blob?(s=new FormData,s.append("cacheControl",o.cacheControl),l&&s.append("metadata",i.encodeMetadata(l)),s.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",o.cacheControl),l&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(l))):(s=n,a["cache-control"]="max-age=".concat(o.cacheControl),a["content-type"]=o.contentType,l&&(a["x-metadata"]=i.toBase64(i.encodeMetadata(l))),("undefined"!=typeof ReadableStream&&s instanceof ReadableStream||s&&"object"==typeof s&&"pipe"in s&&"function"==typeof s.pipe)&&!o.duplex&&(o.duplex="half")),null==r?void 0:r.headers)for(const[e,t]of Object.entries(r.headers))a=rT(a,e,t);const u=i._removeEmptyFolders(t),c=i._getFinalPath(u),h=yield("PUT"==e?dT:hT)(i.fetch,"".concat(i.url,"/object/").concat(c),s,QE({headers:a},(null==o?void 0:o.duplex)?{duplex:o.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}}))})}upload(e,t,n){return y(this,null,function*(){return this.uploadOrUpdate("POST",e,t,n)})}uploadToSignedUrl(e,t,n,r){return y(this,null,function*(){var i=this;const s=i._removeEmptyFolders(e),o=i._getFinalPath(s),a=new URL(i.url+"/object/upload/sign/".concat(o));return a.searchParams.set("token",t),i.handleOperation(()=>y(this,null,function*(){let e;const t=QE(QE({},kT),r);let o=QE(QE({},i.headers),{"x-upsert":String(t.upsert)});const l=t.metadata;if("undefined"!=typeof Blob&&n instanceof Blob?(e=new FormData,e.append("cacheControl",t.cacheControl),l&&e.append("metadata",i.encodeMetadata(l)),e.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(e=n,e.has("cacheControl")||e.append("cacheControl",t.cacheControl),l&&!e.has("metadata")&&e.append("metadata",i.encodeMetadata(l))):(e=n,o["cache-control"]="max-age=".concat(t.cacheControl),o["content-type"]=t.contentType,l&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(l))),("undefined"!=typeof ReadableStream&&e instanceof ReadableStream||e&&"object"==typeof e&&"pipe"in e&&"function"==typeof e.pipe)&&!t.duplex&&(t.duplex="half")),null==r?void 0:r.headers)for(const[n,i]of Object.entries(r.headers))o=rT(o,n,i);return{path:s,fullPath:(yield dT(i.fetch,a.toString(),e,QE({headers:o},(null==t?void 0:t.duplex)?{duplex:t.duplex}:{}))).Key}}))})}createSignedUploadUrl(e,t){return y(this,null,function*(){var n=this;return n.handleOperation(()=>y(this,null,function*(){let r=n._getFinalPath(e);const i=QE({},n.headers);(null==t?void 0:t.upsert)&&(i["x-upsert"]="true");const s=yield hT(n.fetch,"".concat(n.url,"/object/upload/sign/").concat(r),{},{headers:i}),o=new URL(n.url+s.url),a=o.searchParams.get("token");if(!a)throw new ZE("No token returned by API");return{signedUrl:o.toString(),path:e,token:a}}))})}update(e,t,n){return y(this,null,function*(){return this.uploadOrUpdate("PUT",e,t,n)})}move(e,t,n){return y(this,null,function*(){var r=this;return r.handleOperation(()=>y(this,null,function*(){return yield hT(r.fetch,"".concat(r.url,"/object/move"),{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==n?void 0:n.destinationBucket},{headers:r.headers})}))})}copy(e,t,n){return y(this,null,function*(){var r=this;return r.handleOperation(()=>y(this,null,function*(){return{path:(yield hT(r.fetch,"".concat(r.url,"/object/copy"),{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==n?void 0:n.destinationBucket},{headers:r.headers})).Key}}))})}createSignedUrl(e,t,n){return y(this,null,function*(){var r=this;return r.handleOperation(()=>y(this,null,function*(){let i=r._getFinalPath(e);const s="object"==typeof(null==n?void 0:n.transform)&&null!==n.transform&&Object.keys(n.transform).length>0;let o=yield hT(r.fetch,"".concat(r.url,"/object/sign/").concat(i),QE({expiresIn:t},s?{transform:n.transform}:{}),{headers:r.headers});const a=new URLSearchParams;(null==n?void 0:n.download)&&a.set("download",!0===n.download?"":n.download),null!=(null==n?void 0:n.cacheNonce)&&a.set("cacheNonce",String(n.cacheNonce));const l=a.toString();return{signedUrl:encodeURI("".concat(r.url).concat(o.signedURL).concat(l?"&".concat(l):""))}}))})}createSignedUrls(e,t,n){return y(this,null,function*(){var r=this;return r.handleOperation(()=>y(this,null,function*(){const i=yield hT(r.fetch,"".concat(r.url,"/object/sign/").concat(r.bucketId),{expiresIn:t,paths:e},{headers:r.headers}),s=new URLSearchParams;(null==n?void 0:n.download)&&s.set("download",!0===n.download?"":n.download),null!=(null==n?void 0:n.cacheNonce)&&s.set("cacheNonce",String(n.cacheNonce));const o=s.toString();return i.map(e=>QE(QE({},e),{},{signedUrl:e.signedURL?encodeURI("".concat(r.url).concat(e.signedURL).concat(o?"&".concat(o):"")):null}))}))})}download(e,t,n){const r="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",i=new URLSearchParams;(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(i,t.transform),null!=(null==t?void 0:t.cacheNonce)&&i.set("cacheNonce",String(t.cacheNonce));const s=i.toString(),o=this._getFinalPath(e);return new bT(()=>cT(this.fetch,"".concat(this.url,"/").concat(r,"/").concat(o).concat(s?"?".concat(s):""),{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}info(e){return y(this,null,function*(){var t=this;const n=t._getFinalPath(e);return t.handleOperation(()=>y(this,null,function*(){return iT(yield cT(t.fetch,"".concat(t.url,"/object/info/").concat(n),{headers:t.headers}))}))})}exists(e){return y(this,null,function*(){var t=this;const n=t._getFinalPath(e);try{return yield fT(t.fetch,"".concat(t.url,"/object/").concat(n),{headers:t.headers}),{data:!0,error:null}}catch(i){if(t.shouldThrowOnError)throw i;if(eT(i)){var r;const e=i instanceof tT?i.status:i instanceof nT?null===(r=i.originalError)||void 0===r?void 0:r.status:void 0;if(void 0!==e&&[400,404].includes(e))return{data:!1,error:i}}throw i}})}getPublicUrl(e,t){const n=this._getFinalPath(e),r=new URLSearchParams;(null==t?void 0:t.download)&&r.set("download",!0===t.download?"":t.download),(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(r,t.transform),null!=(null==t?void 0:t.cacheNonce)&&r.set("cacheNonce",String(t.cacheNonce));const i=r.toString(),s="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI("".concat(this.url,"/").concat(s,"/public/").concat(n))+(i?"?".concat(i):"")}}}remove(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield pT(t.fetch,"".concat(t.url,"/object/").concat(t.bucketId),{prefixes:e},{headers:t.headers})}))})}list(e,t,n){return y(this,null,function*(){var r=this;return r.handleOperation(()=>y(this,null,function*(){const i=QE(QE(QE({},wT),t),{},{prefix:e||""});return yield hT(r.fetch,"".concat(r.url,"/object/list/").concat(r.bucketId),i,{headers:r.headers},n)}))})}listV2(e,t){return y(this,null,function*(){var n=this;return n.handleOperation(()=>y(this,null,function*(){const r=QE({},e);return yield hT(n.fetch,"".concat(n.url,"/object/list-v2/").concat(n.bucketId),r,{headers:n.headers},t)}))})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return"undefined"!=typeof Buffer?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return"".concat(this.bucketId,"/").concat(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 _T={"X-Client-Info":"storage-js/".concat("2.105.1")};var ET=class extends gT{constructor(e,t={},n,r){const i=new URL(e);(null==r?void 0:r.useNewHostname)&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));super(i.href.replace(/\/$/,""),QE(QE({},_T),t),n,"storage")}listBuckets(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){const n=t.listBucketOptionsToQueryString(e);return yield cT(t.fetch,"".concat(t.url,"/bucket").concat(n),{headers:t.headers})}))})}getBucket(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield cT(t.fetch,"".concat(t.url,"/bucket/").concat(e),{headers:t.headers})}))})}createBucket(e){return y(this,arguments,function*(e,t={public:!1}){var n=this;return n.handleOperation(()=>y(this,null,function*(){return yield hT(n.fetch,"".concat(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})}))})}updateBucket(e,t){return y(this,null,function*(){var n=this;return n.handleOperation(()=>y(this,null,function*(){return yield dT(n.fetch,"".concat(n.url,"/bucket/").concat(e),{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers})}))})}emptyBucket(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield hT(t.fetch,"".concat(t.url,"/bucket/").concat(e,"/empty"),{},{headers:t.headers})}))})}deleteBucket(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield pT(t.fetch,"".concat(t.url,"/bucket/").concat(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():""}},TT=class extends gT{constructor(e,t={},n){super(e.replace(/\/$/,""),QE(QE({},_T),t),n,"storage")}createBucket(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield hT(t.fetch,"".concat(t.url,"/bucket"),{name:e},{headers:t.headers})}))})}listBuckets(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){const n=new URLSearchParams;void 0!==(null==e?void 0:e.limit)&&n.set("limit",e.limit.toString()),void 0!==(null==e?void 0:e.offset)&&n.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&n.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&n.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&n.set("search",e.search);const r=n.toString(),i=r?"".concat(t.url,"/bucket?").concat(r):"".concat(t.url,"/bucket");return yield cT(t.fetch,i,{headers:t.headers})}))})}deleteBucket(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield pT(t.fetch,"".concat(t.url,"/bucket/").concat(e),{},{headers:t.headers})}))})}from(e){var t=this;if(!(e=>!(!e||"string"!=typeof e)&&!(0===e.length||e.length>100)&&e.trim()===e&&!e.includes("/")&&!e.includes("\\")&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e))(e))throw new ZE("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 GE({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:()=>y(this,null,function*(){return t.headers})},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){const n=e[t];return"function"!=typeof n?n:(...t)=>y(this,null,function*(){try{return{data:yield n.apply(e,t),error:null}}catch(i){if(r)throw i;return{data:null,error:i}}})}})}},xT=class extends gT{constructor(e,t={},n){super(e.replace(/\/$/,""),QE(QE({},_T),{},{"Content-Type":"application/json"},t),n,"vectors")}createIndex(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return(yield mT.post(t.fetch,"".concat(t.url,"/CreateIndex"),e,{headers:t.headers}))||{}}))})}getIndex(e,t){return y(this,null,function*(){var n=this;return n.handleOperation(()=>y(this,null,function*(){return yield mT.post(n.fetch,"".concat(n.url,"/GetIndex"),{vectorBucketName:e,indexName:t},{headers:n.headers})}))})}listIndexes(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield mT.post(t.fetch,"".concat(t.url,"/ListIndexes"),e,{headers:t.headers})}))})}deleteIndex(e,t){return y(this,null,function*(){var n=this;return n.handleOperation(()=>y(this,null,function*(){return(yield mT.post(n.fetch,"".concat(n.url,"/DeleteIndex"),{vectorBucketName:e,indexName:t},{headers:n.headers}))||{}}))})}},CT=class extends gT{constructor(e,t={},n){super(e.replace(/\/$/,""),QE(QE({},_T),{},{"Content-Type":"application/json"},t),n,"vectors")}putVectors(e){return y(this,null,function*(){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(()=>y(this,null,function*(){return(yield mT.post(t.fetch,"".concat(t.url,"/PutVectors"),e,{headers:t.headers}))||{}}))})}getVectors(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield mT.post(t.fetch,"".concat(t.url,"/GetVectors"),e,{headers:t.headers})}))})}listVectors(e){return y(this,null,function*(){var t=this;if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error("segmentIndex must be between 0 and ".concat(e.segmentCount-1))}return t.handleOperation(()=>y(this,null,function*(){return yield mT.post(t.fetch,"".concat(t.url,"/ListVectors"),e,{headers:t.headers})}))})}queryVectors(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield mT.post(t.fetch,"".concat(t.url,"/QueryVectors"),e,{headers:t.headers})}))})}deleteVectors(e){return y(this,null,function*(){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(()=>y(this,null,function*(){return(yield mT.post(t.fetch,"".concat(t.url,"/DeleteVectors"),e,{headers:t.headers}))||{}}))})}},PT=class extends gT{constructor(e,t={},n){super(e.replace(/\/$/,""),QE(QE({},_T),{},{"Content-Type":"application/json"},t),n,"vectors")}createBucket(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return(yield mT.post(t.fetch,"".concat(t.url,"/CreateVectorBucket"),{vectorBucketName:e},{headers:t.headers}))||{}}))})}getBucket(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield mT.post(t.fetch,"".concat(t.url,"/GetVectorBucket"),{vectorBucketName:e},{headers:t.headers})}))})}listBuckets(){return y(this,arguments,function*(e={}){var t=this;return t.handleOperation(()=>y(this,null,function*(){return yield mT.post(t.fetch,"".concat(t.url,"/ListVectorBuckets"),e,{headers:t.headers})}))})}deleteBucket(e){return y(this,null,function*(){var t=this;return t.handleOperation(()=>y(this,null,function*(){return(yield mT.post(t.fetch,"".concat(t.url,"/DeleteVectorBucket"),{vectorBucketName:e},{headers:t.headers}))||{}}))})}},RT=class e extends PT{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new AT(this.url,this.headers,e,this.fetch)}createBucket(t){return y(this,null,function*(){return(()=>g(e.prototype,this,"createBucket"))().call(this,t)})}getBucket(t){return y(this,null,function*(){return(()=>g(e.prototype,this,"getBucket"))().call(this,t)})}listBuckets(){return y(this,arguments,function*(t={}){return(()=>g(e.prototype,this,"listBuckets"))().call(this,t)})}deleteBucket(t){return y(this,null,function*(){return(()=>g(e.prototype,this,"deleteBucket"))().call(this,t)})}},AT=class e extends xT{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}createIndex(t){return y(this,null,function*(){return(()=>g(e.prototype,this,"createIndex"))().call(this,QE(QE({},t),{},{vectorBucketName:this.vectorBucketName}))})}listIndexes(){return y(this,arguments,function*(t={}){return(()=>g(e.prototype,this,"listIndexes"))().call(this,QE(QE({},t),{},{vectorBucketName:this.vectorBucketName}))})}getIndex(t){return y(this,null,function*(){return(()=>g(e.prototype,this,"getIndex"))().call(this,this.vectorBucketName,t)})}deleteIndex(t){return y(this,null,function*(){return(()=>g(e.prototype,this,"deleteIndex"))().call(this,this.vectorBucketName,t)})}index(e){return new OT(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},OT=class e extends CT{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}putVectors(t){return y(this,null,function*(){var n=this;return(()=>g(e.prototype,this,"putVectors"))().call(n,QE(QE({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))})}getVectors(t){return y(this,null,function*(){var n=this;return(()=>g(e.prototype,this,"getVectors"))().call(n,QE(QE({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))})}listVectors(){return y(this,arguments,function*(t={}){var n=this;return(()=>g(e.prototype,this,"listVectors"))().call(n,QE(QE({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))})}queryVectors(t){return y(this,null,function*(){var n=this;return(()=>g(e.prototype,this,"queryVectors"))().call(n,QE(QE({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))})}deleteVectors(t){return y(this,null,function*(){var n=this;return(()=>g(e.prototype,this,"deleteVectors"))().call(n,QE(QE({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))})}},jT=class extends ET{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new ST(this.url,this.headers,e,this.fetch)}get vectors(){return new RT(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new TT(this.url+"/iceberg",this.headers,this.fetch)}};const LT="2.105.1",IT=3e4,NT=9e4,DT={"X-Client-Info":"gotrue-js/".concat(LT)},MT="X-Supabase-Api-Version",UT={timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"},BT=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;class FT extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function VT(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class zT extends FT{constructor(e,t,n){super(e,t,n),this.name="AuthApiError",this.status=t,this.code=n}}class WT extends FT{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class HT extends FT{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}}class qT extends HT{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function KT(e){return VT(e)&&"AuthSessionMissingError"===e.name}class GT extends HT{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class JT extends HT{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class $T extends HT{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class YT extends HT{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class XT extends HT{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 QT extends HT{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function ZT(e){return VT(e)&&"AuthRetryableFetchError"===e.name}class ex extends HT{constructor(e,t,n){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class tx extends HT{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const nx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),rx=" \t\n\r=".split(""),ix=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<rx.length;t+=1)e[rx[t].charCodeAt(0)]=-2;for(let t=0;t<nx.length;t+=1)e[nx[t].charCodeAt(0)]=t;return e})();function sx(e,t,n){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const e=t.queue>>t.queuedBits-6&63;n(nx[e]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const e=t.queue>>t.queuedBits-6&63;n(nx[e]),t.queuedBits-=6}}function ox(e,t,n){const r=ix[e];if(!(r>-1)){if(-2===r)return;throw new Error('Invalid Base64-URL character "'.concat(String.fromCharCode(e),'"'))}for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8}function ax(e){const t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=e=>{!function(e,t,n){if(0===t.utf8seq){if(e<=127)return void n(e);for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else{if(4!==t.utf8seq)throw new Error("Invalid UTF-8 sequence");t.codepoint=7&e}t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&n(t.codepoint)}}(e,r,n)};for(let o=0;o<e.length;o+=1)ox(e.charCodeAt(o),i,s);return t.join("")}function lx(e,t){if(!(e<=127)){if(e<=2047)return t(192|e>>6),void t(128|63&e);if(e<=65535)return t(224|e>>12),t(128|e>>6&63),void t(128|63&e);if(e<=1114111)return t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),void t(128|63&e);throw new Error("Unrecognized Unicode codepoint: ".concat(e.toString(16)))}t(e)}function ux(e){const t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let i=0;i<e.length;i+=1)ox(e.charCodeAt(i),n,r);return new Uint8Array(t)}function cx(e){const t=[];return function(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const t=1024*(r-55296)&65535;r=65536+(e.charCodeAt(n+1)-56320&65535|t),n+=1}lx(r,t)}}(e,e=>t.push(e)),new Uint8Array(t)}function hx(e){const t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>sx(e,n,r)),sx(null,n,r),t.join("")}const dx=()=>"undefined"!=typeof window&&"undefined"!=typeof document,fx={tested:!1,writable:!1},px=()=>{if(!dx())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(OC){return!1}if(fx.tested)return fx.writable;const e="lswt-".concat(Math.random()).concat(Math.random());try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),fx.tested=!0,fx.writable=!0}catch(OC){fx.tested=!0,fx.writable=!1}return fx.writable};const mx=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),gx=(e,t,n)=>y(void 0,null,function*(){yield e.setItem(t,JSON.stringify(n))}),yx=(e,t)=>y(void 0,null,function*(){const n=yield e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(r){return n}}),vx=(e,t)=>y(void 0,null,function*(){yield e.removeItem(t)});class bx{constructor(){this.promise=new bx.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function wx(e){const t=e.split(".");if(3!==t.length)throw new tx("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!BT.test(t[n]))throw new tx("JWT not in base64url format");return{header:JSON.parse(ax(t[0])),payload:JSON.parse(ax(t[1])),signature:ux(t[2]),raw:{header:t[0],payload:t[1]}}}function kx(e){return("0"+e.toString(16)).substr(-2)}function Sx(e){return y(this,null,function*(){if(!("undefined"!=typeof crypto&&void 0!==crypto.subtle&&"undefined"!=typeof TextEncoder))return e;const t=yield function(e){return y(this,null,function*(){const t=(new TextEncoder).encode(e),n=yield crypto.subtle.digest("SHA-256",t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join("")})}(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")})}function _x(e,t,n=!1){return y(this,null,function*(){const r=function(){const e=new Uint32Array(56);if("undefined"==typeof crypto){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length;let n="";for(let r=0;r<56;r++)n+=e.charAt(Math.floor(Math.random()*t));return n}return crypto.getRandomValues(e),Array.from(e,kx).join("")}();let i=r;n&&(i+="/recovery"),yield gx(e,"".concat(t,"-code-verifier"),i);const s=yield Sx(r);return[s,r===s?"plain":"s256"]})}bx.promiseConstructor=Promise;const Ex=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;const Tx=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function xx(e){if(!Tx.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Cx(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Px(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){const e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)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 "'.concat(t,'" property of the session object is not supported. Please use getUser() instead.'))},set:(e,t)=>{throw new Error('@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "'.concat(t,'" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.'))},deleteProperty:(e,t)=>{throw new Error('@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "'.concat(t,'" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.'))}})}function Rx(e){return JSON.parse(JSON.stringify(e))}const Ax=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),Ox=[502,503,504,520,521,522,523,524,530];function jx(e){return y(this,null,function*(){var t,n;if(!("object"==typeof(n=e)&&null!==n&&"status"in n&&"ok"in n&&"json"in n&&"function"==typeof n.json))throw new QT(Ax(e),0);if(Ox.includes(e.status))throw new QT(Ax(e),e.status);let r,i;try{r=yield e.json()}catch(OC){throw new WT(Ax(OC),OC)}const s=function(e){const t=e.headers.get(MT);if(!t)return null;if(!t.match(Ex))return null;try{return new Date("".concat(t,"T00:00:00.0Z"))}catch(OC){return null}}(e);if(s&&s.getTime()>=UT.timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?i=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(i=r.error_code),i){if("weak_password"===i)throw new ex(Ax(r),e.status,(null===(t=r.weak_password)||void 0===t?void 0:t.reasons)||[]);if("session_not_found"===i)throw new qT}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0))throw new ex(Ax(r),e.status,r.weak_password.reasons);throw new zT(Ax(r),e.status||500,i)})}function Lx(e,t,n,r){return y(this,null,function*(){var i;const s=Object.assign({},null==r?void 0:r.headers);s[MT]||(s[MT]=UT.name),(null==r?void 0:r.jwt)&&(s.Authorization="Bearer ".concat(r.jwt));const o=null!==(i=null==r?void 0:r.query)&&void 0!==i?i:{};(null==r?void 0:r.redirectTo)&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=yield function(e,t,n,r,i,s){return y(this,null,function*(){const o=((e,t,n,r)=>{const i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))})(t,r,i,s);let a;try{a=yield e(n,Object.assign({},o))}catch(OC){throw new QT(Ax(OC),0)}if(a.ok||(yield jx(a)),null==r?void 0:r.noResolveJson)return a;try{return yield a.json()}catch(OC){yield jx(OC)}})}(e,t,n+a,{headers:s,noResolveJson:null==r?void 0:r.noResolveJson},{},null==r?void 0:r.body);return(null==r?void 0:r.xform)?null==r?void 0:r.xform(l):{data:Object.assign({},l),error:null}})}function Ix(e){var t;let n=null;var r;(function(e){return e.access_token&&e.refresh_token&&e.expires_in})(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r)));return{data:{session:n,user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function Nx(e){const t=Ix(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function Dx(e){var t;return{data:{user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function Mx(e){return{data:e,error:null}}function Ux(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=e,o=$S(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},user:Object.assign({},o)},error:null}}function Bx(e){return e}const Fx=["global","local","others"];class Vx{constructor({url:e="",headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=mx(n),this.experimental=null!=r?r:{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}signOut(e){return y(this,arguments,function*(e,t=Fx[0]){if(Fx.indexOf(t)<0)throw new Error("@supabase/auth-js: Parameter scope must be one of ".concat(Fx.join(", ")));try{return yield Lx(this.fetch,"POST","".concat(this.url,"/logout?scope=").concat(t),{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(VT(n))return{data:null,error:n};throw n}})}inviteUserByEmail(e){return y(this,arguments,function*(e,t={}){try{return yield Lx(this.fetch,"POST","".concat(this.url,"/invite"),{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:Dx})}catch(n){if(VT(n))return{data:{user:null},error:n};throw n}})}generateLink(e){return y(this,null,function*(){try{const{options:t}=e,n=$S(e,["options"]),r=Object.assign(Object.assign({},n),t);return"newEmail"in n&&(r.new_email=null==n?void 0:n.newEmail,delete r.newEmail),yield Lx(this.fetch,"POST","".concat(this.url,"/admin/generate_link"),{body:r,headers:this.headers,xform:Ux,redirectTo:null==t?void 0:t.redirectTo})}catch(t){if(VT(t))return{data:{properties:null,user:null},error:t};throw t}})}createUser(e){return y(this,null,function*(){try{return yield Lx(this.fetch,"POST","".concat(this.url,"/admin/users"),{body:e,headers:this.headers,xform:Dx})}catch(t){if(VT(t))return{data:{user:null},error:t};throw t}})}listUsers(e){return y(this,null,function*(){var t,n,r,i,s,o,a;try{const l={nextPage:null,lastPage:0,total:0},u=yield Lx(this.fetch,"GET","".concat(this.url,"/admin/users"),{headers:this.headers,noResolveJson:!0,query:{page:null!==(n=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==n?n:"",per_page:null!==(i=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==i?i:""},xform:Bx});if(u.error)throw u.error;const c=yield u.json(),h=null!==(s=u.headers.get("x-total-count"))&&void 0!==s?s:0,d=null!==(a=null===(o=u.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return d.length>0&&(d.forEach(e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);l["".concat(n,"Page")]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(l){if(VT(l))return{data:{users:[]},error:l};throw l}})}getUserById(e){return y(this,null,function*(){xx(e);try{return yield Lx(this.fetch,"GET","".concat(this.url,"/admin/users/").concat(e),{headers:this.headers,xform:Dx})}catch(t){if(VT(t))return{data:{user:null},error:t};throw t}})}updateUserById(e,t){return y(this,null,function*(){xx(e);try{return yield Lx(this.fetch,"PUT","".concat(this.url,"/admin/users/").concat(e),{body:t,headers:this.headers,xform:Dx})}catch(n){if(VT(n))return{data:{user:null},error:n};throw n}})}deleteUser(e,t=!1){return y(this,null,function*(){xx(e);try{return yield Lx(this.fetch,"DELETE","".concat(this.url,"/admin/users/").concat(e),{headers:this.headers,body:{should_soft_delete:t},xform:Dx})}catch(n){if(VT(n))return{data:{user:null},error:n};throw n}})}_listFactors(e){return y(this,null,function*(){xx(e.userId);try{const{data:t,error:n}=yield Lx(this.fetch,"GET","".concat(this.url,"/admin/users/").concat(e.userId,"/factors"),{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_deleteFactor(e){return y(this,null,function*(){xx(e.userId),xx(e.id);try{return{data:yield Lx(this.fetch,"DELETE","".concat(this.url,"/admin/users/").concat(e.userId,"/factors/").concat(e.id),{headers:this.headers}),error:null}}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_listOAuthClients(e){return y(this,null,function*(){var t,n,r,i,s,o,a;try{const l={nextPage:null,lastPage:0,total:0},u=yield Lx(this.fetch,"GET","".concat(this.url,"/admin/oauth/clients"),{headers:this.headers,noResolveJson:!0,query:{page:null!==(n=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==n?n:"",per_page:null!==(i=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==i?i:""},xform:Bx});if(u.error)throw u.error;const c=yield u.json(),h=null!==(s=u.headers.get("x-total-count"))&&void 0!==s?s:0,d=null!==(a=null===(o=u.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return d.length>0&&(d.forEach(e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);l["".concat(n,"Page")]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(l){if(VT(l))return{data:{clients:[]},error:l};throw l}})}_createOAuthClient(e){return y(this,null,function*(){try{return yield Lx(this.fetch,"POST","".concat(this.url,"/admin/oauth/clients"),{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_getOAuthClient(e){return y(this,null,function*(){try{return yield Lx(this.fetch,"GET","".concat(this.url,"/admin/oauth/clients/").concat(e),{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_updateOAuthClient(e,t){return y(this,null,function*(){try{return yield Lx(this.fetch,"PUT","".concat(this.url,"/admin/oauth/clients/").concat(e),{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(n){if(VT(n))return{data:null,error:n};throw n}})}_deleteOAuthClient(e){return y(this,null,function*(){try{return yield Lx(this.fetch,"DELETE","".concat(this.url,"/admin/oauth/clients/").concat(e),{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_regenerateOAuthClientSecret(e){return y(this,null,function*(){try{return yield Lx(this.fetch,"POST","".concat(this.url,"/admin/oauth/clients/").concat(e,"/regenerate_secret"),{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_listCustomProviders(e){return y(this,null,function*(){try{const t={};return(null==e?void 0:e.type)&&(t.type=e.type),yield Lx(this.fetch,"GET","".concat(this.url,"/admin/custom-providers"),{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!==(t=null==e?void 0:e.providers)&&void 0!==t?t:[]},error:null}}})}catch(t){if(VT(t))return{data:{providers:[]},error:t};throw t}})}_createCustomProvider(e){return y(this,null,function*(){try{return yield Lx(this.fetch,"POST","".concat(this.url,"/admin/custom-providers"),{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_getCustomProvider(e){return y(this,null,function*(){try{return yield Lx(this.fetch,"GET","".concat(this.url,"/admin/custom-providers/").concat(e),{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_updateCustomProvider(e,t){return y(this,null,function*(){try{return yield Lx(this.fetch,"PUT","".concat(this.url,"/admin/custom-providers/").concat(e),{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(n){if(VT(n))return{data:null,error:n};throw n}})}_deleteCustomProvider(e){return y(this,null,function*(){try{return yield Lx(this.fetch,"DELETE","".concat(this.url,"/admin/custom-providers/").concat(e),{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_adminListPasskeys(e){return y(this,null,function*(){Cx(this.experimental),xx(e.userId);try{return yield Lx(this.fetch,"GET","".concat(this.url,"/admin/users/").concat(e.userId,"/passkeys"),{headers:this.headers,xform:e=>({data:e,error:null})})}catch(t){if(VT(t))return{data:null,error:t};throw t}})}_adminDeletePasskey(e){return y(this,null,function*(){Cx(this.experimental),xx(e.userId),xx(e.passkeyId);try{return yield Lx(this.fetch,"DELETE","".concat(this.url,"/admin/users/").concat(e.userId,"/passkeys/").concat(e.passkeyId),{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(VT(t))return{data:null,error:t};throw t}})}}function zx(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const Wx=!!(globalThis&&px()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug"));class Hx extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class qx extends Hx{}function Kx(e,t,n){return y(this,null,function*(){const r=new globalThis.AbortController;let i;t>0&&(i=setTimeout(()=>{r.abort()},t)),yield Promise.resolve();try{return yield globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},r=>y(this,null,function*(){if(!r){if(0===t)throw new qx('Acquiring an exclusive Navigator LockManager lock "'.concat(e,'" immediately failed'));if(Wx)try{yield globalThis.navigator.locks.query()}catch(OC){}return clearTimeout(i),yield n()}clearTimeout(i);try{return yield n()}finally{}}))}catch(OC){if(t>0&&clearTimeout(i),"AbortError"===(null==OC?void 0:OC.name)&&t>0){if(r.signal.aborted)return yield Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},e=>y(this,null,function*(){if(!e)return yield n();try{return yield n()}finally{}})));throw new qx('Lock "'.concat(e,'" was released because another request stole it'))}throw OC}})}function Gx(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error('@supabase/auth-js: Address "'.concat(e,'" is invalid.'));return e.toLowerCase()}function Jx(e){const t=(new TextEncoder).encode(e);return"0x"+Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}class $x extends Error{constructor({message:e,code:t,cause:n,name:r}){var i;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=null!==(i=null!=r?r:n instanceof Error?n.name:void 0)&&void 0!==i?i:"Unknown Error",this.code=t}}class Yx extends $x{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}function Xx({error:e,options:t}){var n,r,i;const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new $x({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if(!0===(null===(n=s.authenticatorSelection)||void 0===n?void 0:n.requireResidentKey))return new $x({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if("conditional"===t.mediation&&"required"===(null===(r=s.authenticatorSelection)||void 0===r?void 0:r.userVerification))return new $x({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if("required"===(null===(i=s.authenticatorSelection)||void 0===i?void 0:i.userVerification))return new $x({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if("InvalidStateError"===e.name)return new $x({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if("NotAllowedError"===e.name)return new $x({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("NotSupportedError"===e.name){return 0===s.pubKeyCredParams.filter(e=>"public-key"===e.type).length?new $x({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new $x({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e})}if("SecurityError"===e.name){const t=window.location.hostname;if(!iC(t))return new $x({message:"".concat(window.location.hostname," is an invalid domain"),code:"ERROR_INVALID_DOMAIN",cause:e});if(s.rp.id!==t)return new $x({message:'The RP ID "'.concat(s.rp.id,'" is invalid for this domain'),code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new $x({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new $x({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 $x({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Qx({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new $x({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if("NotAllowedError"===e.name)return new $x({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if("SecurityError"===e.name){const t=window.location.hostname;if(!iC(t))return new $x({message:"".concat(window.location.hostname," is an invalid domain"),code:"ERROR_INVALID_DOMAIN",cause:e});if(n.rpId!==t)return new $x({message:'The RP ID "'.concat(n.rpId,'" is invalid for this domain'),code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new $x({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 $x({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}const Zx=new class{createNewAbortSignal(){if(this.controller){const e=new Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};function eC(e){if(!e)throw new Error("Credential creation options are required");if("undefined"!=typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,i=$S(e,["challenge","user","excludeCredentials"]),s=ux(t).buffer,o=Object.assign(Object.assign({},n),{id:ux(n.id).buffer}),a=Object.assign(Object.assign({},i),{challenge:s,user:o});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let e=0;e<r.length;e++){const t=r[e];a.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:ux(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return a}function tC(e){if(!e)throw new Error("Credential request options are required");if("undefined"!=typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=$S(e,["challenge","allowCredentials"]),i=ux(t).buffer,s=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let e=0;e<n.length;e++){const t=n[e];s.allowCredentials[e]=Object.assign(Object.assign({},t),{id:ux(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return s}function nC(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:hx(new Uint8Array(e.response.attestationObject)),clientDataJSON:hx(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:null!==(t=n.authenticatorAttachment)&&void 0!==t?t:void 0}}function rC(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();const n=e,r=e.getClientExtensionResults(),i=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:hx(new Uint8Array(i.authenticatorData)),clientDataJSON:hx(new Uint8Array(i.clientDataJSON)),signature:hx(new Uint8Array(i.signature)),userHandle:i.userHandle?hx(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!==(t=n.authenticatorAttachment)&&void 0!==t?t:void 0}}function iC(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function sC(){var e,t;return!!(dx()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&"function"==typeof(null===(e=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===e?void 0:e.create)&&"function"==typeof(null===(t=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===t?void 0:t.get))}function oC(e){return y(this,null,function*(){try{const t=yield navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Yx("Browser returned unexpected credential type",t)}:{data:null,error:new Yx("Empty credential response",t)}}catch(t){return{data:null,error:Xx({error:t,options:e})}}})}function aC(e){return y(this,null,function*(){try{const t=yield navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Yx("Browser returned unexpected credential type",t)}:{data:null,error:new Yx("Empty credential response",t)}}catch(t){return{data:null,error:Qx({error:t,options:e})}}})}const lC={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},uC={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function cC(...e){const t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(const i of e)if(i)for(const e in i){const s=i[e];if(void 0!==s)if(Array.isArray(s))r[e]=s;else if(n(s))r[e]=s;else if(t(s)){const n=r[e];t(n)?r[e]=cC(n,s):r[e]=cC(s)}else r[e]=s}return r}class hC{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}_enroll(e){return y(this,null,function*(){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))})}_challenge(e,t){return y(this,arguments,function*({factorId:e,webauthn:t,friendlyName:n,signal:r},i){var s;try{const{data:o,error:a}=yield this.client.mfa.challenge({factorId:e,webauthn:t});if(!o)return{data:null,error:a};const l=null!=r?r:Zx.createNewAbortSignal();if("create"===o.webauthn.type){const{user:e}=o.webauthn.credential_options.publicKey;if(!e.name){const t=n;if(t)e.name="".concat(e.id,":").concat(t);else{const t=(yield this.client.getUser()).data.user,n=(null===(s=null==t?void 0:t.user_metadata)||void 0===s?void 0:s.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name="".concat(e.id,":").concat(n)}}e.displayName||(e.displayName=e.name)}switch(o.webauthn.type){case"create":{const t=function(e,t){return cC(lC,e,t||{})}(o.webauthn.credential_options.publicKey,null==i?void 0:i.create),{data:n,error:r}=yield oC({publicKey:t,signal:l});return n?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}case"request":{const t=function(e,t){return cC(uC,e,t||{})}(o.webauthn.credential_options.publicKey,null==i?void 0:i.request),{data:n,error:r}=yield aC(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:t,signal:l}));return n?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(o){return VT(o)?{data:null,error:o}:{data:null,error:new WT("Unexpected error in challenge",o)}}})}_verify(e){return y(this,arguments,function*({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})})}_authenticate(e,t){return y(this,arguments,function*({factorId:e,webauthn:{rpId:t=("undefined"!=typeof window?window.location.hostname:void 0),rpOrigins:n=("undefined"!=typeof window?[window.location.origin]:void 0),signal:r}={}},i){if(!t)return{data:null,error:new FT("rpId is required for WebAuthn authentication")};try{if(!sC())return{data:null,error:new WT("Browser does not support WebAuthn",null)};const{data:s,error:o}=yield this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!s)return{data:null,error:o};const{webauthn:a}=s;return this._verify({factorId:e,challengeId:s.challengeId,webauthn:{type:a.type,rpId:t,rpOrigins:n,credential_response:a.credential_response}})}catch(s){return VT(s)?{data:null,error:s}:{data:null,error:new WT("Unexpected error in authenticate",s)}}})}_register(e,t){return y(this,arguments,function*({friendlyName:e,webauthn:{rpId:t=("undefined"!=typeof window?window.location.hostname:void 0),rpOrigins:n=("undefined"!=typeof window?[window.location.origin]:void 0),signal:r}={}},i){if(!t)return{data:null,error:new FT("rpId is required for WebAuthn registration")};try{if(!sC())return{data:null,error:new WT("Browser does not support WebAuthn",null)};const{data:s,error:o}=yield this._enroll({friendlyName:e});if(!s)return yield this.client.mfa.listFactors().then(t=>{var n;return null===(n=t.data)||void 0===n?void 0:n.all.find(t=>"webauthn"===t.factor_type&&t.friendly_name===e&&"unverified"!==t.status)}).then(e=>e?this.client.mfa.unenroll({factorId:null==e?void 0:e.id}):void 0),{data:null,error:o};const{data:a,error:l}=yield this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return a?this._verify({factorId:s.id,challengeId:a.challengeId,webauthn:{rpId:t,rpOrigins:n,type:a.webauthn.type,credential_response:a.webauthn.credential_response}}):{data:null,error:l}}catch(s){return VT(s)?{data:null,error:s}:{data:null,error:new WT("Unexpected error in register",s)}}})}}!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(OC){"undefined"!=typeof self&&(self.globalThis=self)}}();const dC={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:DT,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};function fC(e,t,n){return y(this,null,function*(){return yield n()})}const pC={};class mC{get jwks(){var e,t;return null!==(t=null===(e=pC[this.storageKey])||void 0===e?void 0:e.jwks)&&void 0!==t?t:{keys:[]}}set jwks(e){pC[this.storageKey]=Object.assign(Object.assign({},pC[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!==(t=null===(e=pC[this.storageKey])||void 0===e?void 0:e.cachedAt)&&void 0!==t?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){pC[this.storageKey]=Object.assign(Object.assign({},pC[this.storageKey]),{cachedAt:e})}constructor(e){var t,n,r,i;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 s=Object.assign(Object.assign({},dC),e);if(this.storageKey=s.storageKey,this.instanceID=null!==(t=mC.nextInstanceID[this.storageKey])&&void 0!==t?t:0,mC.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,"function"==typeof s.debug&&(this.logger=s.debug),this.instanceID>0&&dx()){"".concat(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.");this.logDebugMessages}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.experimental=null!==(n=s.experimental)&&void 0!==n?n:{},this.admin=new Vx({url:s.url,headers:s.headers,fetch:s.fetch,experimental:this.experimental}),this.url=s.url,this.headers=s.headers,this.fetch=mx(s.fetch),this.lock=s.lock||fC,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&dx()&&(null===(r=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===r?void 0:r.locks)?this.lock=Kx:this.lock=fC,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 hC(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:px()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=zx(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=zx(this.memoryStorage)),dx()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(OC){}null===(i=this.broadcastChannel)||void 0===i||i.addEventListener("message",e=>y(this,null,function*(){this._debug("received broadcast notification from other tab or client",e);try{yield this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(t){this._debug("#broadcastChannel","error",t)}}))}s.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return"GoTrueClient@"+"".concat(this.storageKey,":").concat(this.instanceID," (").concat(LT,") ").concat((new Date).toISOString())}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}initialize(){return y(this,null,function*(){return this.initializePromise||(this.initializePromise=(()=>y(this,null,function*(){return yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return yield this._initialize()}))}))()),yield this.initializePromise})}_initialize(){return y(this,null,function*(){var e;try{let t={},n="none";if(dx()&&(t=function(e){const t={},n=new URL(e);if(n.hash&&"#"===n.hash[0])try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch(OC){}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}(window.location.href),this._isImplicitGrantCallback(t)?n="implicit":(yield this._isPKCECallback(t))&&(n="pkce")),dx()&&this.detectSessionInUrl&&"none"!==n){const{data:r,error:i}=yield this._getSessionFromURL(t,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),function(e){return VT(e)&&"AuthImplicitGrantRedirectError"===e.name}(i)){const t=null===(e=i.details)||void 0===e?void 0:e.code;if("identity_already_exists"===t||"identity_not_found"===t||"single_identity_not_deletable"===t)return{error:i}}return{error:i}}const{session:s,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",s,"redirect type",o),yield this._saveSession(s),setTimeout(()=>y(this,null,function*(){"recovery"===o?yield this._notifyAllSubscribers("PASSWORD_RECOVERY",s):yield this._notifyAllSubscribers("SIGNED_IN",s)}),0),{error:null}}return yield this._recoverAndRefresh(),{error:null}}catch(t){return VT(t)?this._returnResult({error:t}):this._returnResult({error:new WT("Unexpected error during initialization",t)})}finally{yield this._handleVisibilityChange(),this._debug("#_initialize()","end")}})}signInAnonymously(e){return y(this,null,function*(){var t,n,r;try{const i=yield Lx(this.fetch,"POST","".concat(this.url,"/signup"),{headers:this.headers,body:{data:null!==(n=null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.data)&&void 0!==n?n:{},gotrue_meta_security:{captcha_token:null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken}},xform:Ix}),{data:s,error:o}=i;if(o||!s)return this._returnResult({data:{user:null,session:null},error:o});const a=s.session,l=s.user;return s.session&&(yield this._saveSession(s.session),yield this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(i){if(VT(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}signUp(e){return y(this,null,function*(){var t,n,r;try{let i;if("email"in e){const{email:n,password:r,options:s}=e;let o=null,a=null;"pkce"===this.flowType&&([o,a]=yield _x(this.storage,this.storageKey)),i=yield Lx(this.fetch,"POST","".concat(this.url,"/signup"),{headers:this.headers,redirectTo:null==s?void 0:s.emailRedirectTo,body:{email:n,password:r,data:null!==(t=null==s?void 0:s.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:o,code_challenge_method:a},xform:Ix})}else{if(!("phone"in e))throw new JT("You must provide either an email or phone number and a password");{const{phone:t,password:s,options:o}=e;i=yield Lx(this.fetch,"POST","".concat(this.url,"/signup"),{headers:this.headers,body:{phone:t,password:s,data:null!==(n=null==o?void 0:o.data)&&void 0!==n?n:{},channel:null!==(r=null==o?void 0:o.channel)&&void 0!==r?r:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:Ix})}}const{data:s,error:o}=i;if(o||!s)return yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),this._returnResult({data:{user:null,session:null},error:o});const a=s.session,l=s.user;return s.session&&(yield this._saveSession(s.session),yield this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(i){if(yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),VT(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}signInWithPassword(e){return y(this,null,function*(){try{let t;if("email"in e){const{email:n,password:r,options:i}=e;t=yield Lx(this.fetch,"POST","".concat(this.url,"/token?grant_type=password"),{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:Nx})}else{if(!("phone"in e))throw new JT("You must provide either an email or phone number and a password");{const{phone:n,password:r,options:i}=e;t=yield Lx(this.fetch,"POST","".concat(this.url,"/token?grant_type=password"),{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:Nx})}}const{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){const e=new GT;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(yield this._saveSession(n.session),yield this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(t){if(VT(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}})}signInWithOAuth(e){return y(this,null,function*(){var t,n,r,i;return yield this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(n=e.options)||void 0===n?void 0:n.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})})}exchangeCodeForSession(e){return y(this,null,function*(){return yield this.initializePromise,this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return this._exchangeCodeForSession(e)}))})}signInWithWeb3(e){return y(this,null,function*(){const{chain:t}=e;switch(t){case"ethereum":return yield this.signInWithEthereum(e);case"solana":return yield this.signInWithSolana(e);default:throw new Error('@supabase/auth-js: Unsupported chain "'.concat(t,'"'))}})}signInWithEthereum(e){return y(this,null,function*(){var t,n,r,i,s,o,a,l,u,c,h;let d,f;if("message"in e)d=e.message,f=e.signature;else{const{chain:c,wallet:h,statement:p,options:m}=e;let g;if(dx())if("object"==typeof h)g=h;else{const e=window;if(!("ethereum"in e)||"object"!=typeof e.ethereum||!("request"in e.ethereum)||"function"!=typeof e.ethereum.request)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.");g=e.ethereum}else{if("object"!=typeof h||!(null==m?void 0:m.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");g=h}const y=new URL(null!==(t=null==m?void 0:m.url)&&void 0!==t?t:window.location.href),v=yield g.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!v||0===v.length)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const b=Gx(v[0]);let w=null===(n=null==m?void 0:m.signInWithEthereum)||void 0===n?void 0:n.chainId;if(!w){const e=yield g.request({method:"eth_chainId"});w=parseInt(e,16)}d=function(e){var t;const{chainId:n,domain:r,expirationTime:i,issuedAt:s=new Date,nonce:o,notBefore:a,requestId:l,resources:u,scheme:c,uri:h,version:d}=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: '.concat(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: '.concat(o));if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==d)throw new Error("@supabase/auth-js: Invalid SIWE message field \"version\". Version must be '1'. Provided value: ".concat(d));if(null===(t=e.statement)||void 0===t?void 0:t.includes("\n"))throw new Error("@supabase/auth-js: Invalid SIWE message field \"statement\". Statement must not include '\\n'. Provided value: ".concat(e.statement));const f=Gx(e.address),p=c?"".concat(c,"://").concat(r):r,m=e.statement?"".concat(e.statement,"\n"):"",g="".concat(p," wants you to sign in with your Ethereum account:\n").concat(f,"\n\n").concat(m);let y="URI: ".concat(h,"\nVersion: ").concat(d,"\nChain ID: ").concat(n).concat(o?"\nNonce: ".concat(o):"","\nIssued At: ").concat(s.toISOString());if(i&&(y+="\nExpiration Time: ".concat(i.toISOString())),a&&(y+="\nNot Before: ".concat(a.toISOString())),l&&(y+="\nRequest ID: ".concat(l)),u){let e="\nResources:";for(const t of u){if(!t||"string"!=typeof t)throw new Error('@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: '.concat(t));e+="\n- ".concat(t)}y+=e}return"".concat(g,"\n").concat(y)}({domain:y.host,address:b,statement:p,uri:y.href,version:"1",chainId:w,nonce:null===(r=null==m?void 0:m.signInWithEthereum)||void 0===r?void 0:r.nonce,issuedAt:null!==(s=null===(i=null==m?void 0:m.signInWithEthereum)||void 0===i?void 0:i.issuedAt)&&void 0!==s?s:new Date,expirationTime:null===(o=null==m?void 0:m.signInWithEthereum)||void 0===o?void 0:o.expirationTime,notBefore:null===(a=null==m?void 0:m.signInWithEthereum)||void 0===a?void 0:a.notBefore,requestId:null===(l=null==m?void 0:m.signInWithEthereum)||void 0===l?void 0:l.requestId,resources:null===(u=null==m?void 0:m.signInWithEthereum)||void 0===u?void 0:u.resources}),f=yield g.request({method:"personal_sign",params:[Jx(d),b]})}try{const{data:t,error:n}=yield Lx(this.fetch,"POST","".concat(this.url,"/token?grant_type=web3"),{headers:this.headers,body:Object.assign({chain:"ethereum",message:d,signature:f},(null===(c=e.options)||void 0===c?void 0:c.captchaToken)?{gotrue_meta_security:{captcha_token:null===(h=e.options)||void 0===h?void 0:h.captchaToken}}:null),xform:Ix});if(n)throw n;if(!t||!t.session||!t.user){const e=new GT;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(yield this._saveSession(t.session),yield this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:n})}catch(p){if(VT(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}})}signInWithSolana(e){return y(this,null,function*(){var t,n,r,i,s,o,a,l,u,c,h,d;let f,p;if("message"in e)f=e.message,p=e.signature;else{const{chain:h,wallet:d,statement:m,options:g}=e;let y;if(dx())if("object"==typeof d)y=d;else{const e=window;if(!("solana"in e)||"object"!=typeof e.solana||!("signIn"in e.solana&&"function"==typeof e.solana.signIn||"signMessage"in e.solana&&"function"==typeof e.solana.signMessage))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.");y=e.solana}else{if("object"!=typeof d||!(null==g?void 0:g.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=d}const v=new URL(null!==(t=null==g?void 0:g.url)&&void 0!==t?t:window.location.href);if("signIn"in y&&y.signIn){const e=yield y.signIn(Object.assign(Object.assign(Object.assign({issuedAt:(new Date).toISOString()},null==g?void 0:g.signInWithSolana),{version:"1",domain:v.host,uri:v.href}),m?{statement:m}:null));let t;if(Array.isArray(e)&&e[0]&&"object"==typeof e[0])t=e[0];else{if(!(e&&"object"==typeof e&&"signedMessage"in e&&"signature"in e))throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");t=e}if(!("signedMessage"in t&&"signature"in t&&("string"==typeof t.signedMessage||t.signedMessage instanceof Uint8Array)&&t.signature instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields");f="string"==typeof t.signedMessage?t.signedMessage:(new TextDecoder).decode(t.signedMessage),p=t.signature}else{if(!("signMessage"in y&&"function"==typeof y.signMessage&&"publicKey"in y&&"object"==typeof y&&y.publicKey&&"toBase58"in y.publicKey&&"function"==typeof y.publicKey.toBase58))throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");f=["".concat(v.host," wants you to sign in with your Solana account:"),y.publicKey.toBase58(),...m?["",m,""]:[""],"Version: 1","URI: ".concat(v.href),"Issued At: ".concat(null!==(r=null===(n=null==g?void 0:g.signInWithSolana)||void 0===n?void 0:n.issuedAt)&&void 0!==r?r:(new Date).toISOString()),...(null===(i=null==g?void 0:g.signInWithSolana)||void 0===i?void 0:i.notBefore)?["Not Before: ".concat(g.signInWithSolana.notBefore)]:[],...(null===(s=null==g?void 0:g.signInWithSolana)||void 0===s?void 0:s.expirationTime)?["Expiration Time: ".concat(g.signInWithSolana.expirationTime)]:[],...(null===(o=null==g?void 0:g.signInWithSolana)||void 0===o?void 0:o.chainId)?["Chain ID: ".concat(g.signInWithSolana.chainId)]:[],...(null===(a=null==g?void 0:g.signInWithSolana)||void 0===a?void 0:a.nonce)?["Nonce: ".concat(g.signInWithSolana.nonce)]:[],...(null===(l=null==g?void 0:g.signInWithSolana)||void 0===l?void 0:l.requestId)?["Request ID: ".concat(g.signInWithSolana.requestId)]:[],...(null===(c=null===(u=null==g?void 0:g.signInWithSolana)||void 0===u?void 0:u.resources)||void 0===c?void 0:c.length)?["Resources",...g.signInWithSolana.resources.map(e=>"- ".concat(e))]:[]].join("\n");const e=yield y.signMessage((new TextEncoder).encode(f),"utf8");if(!(e&&e instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=e}}try{const{data:t,error:n}=yield Lx(this.fetch,"POST","".concat(this.url,"/token?grant_type=web3"),{headers:this.headers,body:Object.assign({chain:"solana",message:f,signature:hx(p)},(null===(h=e.options)||void 0===h?void 0:h.captchaToken)?{gotrue_meta_security:{captcha_token:null===(d=e.options)||void 0===d?void 0:d.captchaToken}}:null),xform:Ix});if(n)throw n;if(!t||!t.session||!t.user){const e=new GT;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(yield this._saveSession(t.session),yield this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:n})}catch(m){if(VT(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}})}_exchangeCodeForSession(e){return y(this,null,function*(){const t=yield yx(this.storage,"".concat(this.storageKey,"-code-verifier")),[n,r]=(null!=t?t:"").split("/");try{if(!n&&"pkce"===this.flowType)throw new XT;const{data:t,error:i}=yield Lx(this.fetch,"POST","".concat(this.url,"/token?grant_type=pkce"),{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Ix});if(yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),i)throw i;if(!t||!t.session||!t.user){const e=new GT;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(yield this._saveSession(t.session),yield this._notifyAllSubscribers("recovery"===r?"PASSWORD_RECOVERY":"SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=r?r:null}),error:i})}catch(i){if(yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),VT(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}})}signInWithIdToken(e){return y(this,null,function*(){try{const{options:t,provider:n,token:r,access_token:i,nonce:s}=e,o=yield Lx(this.fetch,"POST","".concat(this.url,"/token?grant_type=id_token"),{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:s,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:Ix}),{data:a,error:l}=o;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a||!a.session||!a.user){const e=new GT;return this._returnResult({data:{user:null,session:null},error:e})}return a.session&&(yield this._saveSession(a.session),yield this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:l})}catch(t){if(VT(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}})}signInWithOtp(e){return y(this,null,function*(){var t,n,r,i,s;try{if("email"in e){const{email:r,options:i}=e;let s=null,o=null;"pkce"===this.flowType&&([s,o]=yield _x(this.storage,this.storageKey));const{error:a}=yield Lx(this.fetch,"POST","".concat(this.url,"/otp"),{headers:this.headers,body:{email:r,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{},create_user:null===(n=null==i?void 0:i.shouldCreateUser)||void 0===n||n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:s,code_challenge_method:o},redirectTo:null==i?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if("phone"in e){const{phone:t,options:n}=e,{data:o,error:a}=yield Lx(this.fetch,"POST","".concat(this.url,"/otp"),{headers:this.headers,body:{phone:t,data:null!==(r=null==n?void 0:n.data)&&void 0!==r?r:{},create_user:null===(i=null==n?void 0:n.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},channel:null!==(s=null==n?void 0:n.channel)&&void 0!==s?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a})}throw new JT("You must provide either an email or phone number.")}catch(o){if(yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),VT(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}verifyOtp(e){return y(this,null,function*(){var t,n;try{let r,i;"options"in e&&(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo,i=null===(n=e.options)||void 0===n?void 0:n.captchaToken);const{data:s,error:o}=yield Lx(this.fetch,"POST","".concat(this.url,"/verify"),{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:Ix});if(o)throw o;if(!s){throw new Error("An error occurred on token verification.")}const a=s.session,l=s.user;return(null==a?void 0:a.access_token)&&(yield this._saveSession(a),yield this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(r){if(VT(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}})}signInWithSSO(e){return y(this,null,function*(){var t,n,r,i,s;try{let o=null,a=null;"pkce"===this.flowType&&([o,a]=yield _x(this.storage,this.storageKey));const l=yield Lx(this.fetch,"POST","".concat(this.url,"/sso"),{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(n=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==n?n:void 0}),(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:Mx});return(null===(i=l.data)||void 0===i?void 0:i.url)&&dx()&&!(null===(s=e.options)||void 0===s?void 0:s.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(o){if(yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),VT(o))return this._returnResult({data:null,error:o});throw o}})}reauthenticate(){return y(this,null,function*(){return yield this.initializePromise,yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return yield this._reauthenticate()}))})}_reauthenticate(){return y(this,null,function*(){try{return yield this._useSession(e=>y(this,null,function*(){const{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new qT;const{error:r}=yield Lx(this.fetch,"GET","".concat(this.url,"/reauthenticate"),{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})}))}catch(e){if(VT(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}resend(e){return y(this,null,function*(){try{const t="".concat(this.url,"/resend");if("email"in e){const{email:n,type:r,options:i}=e,{error:s}=yield Lx(this.fetch,"POST",t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},redirectTo:null==i?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:s})}if("phone"in e){const{phone:n,type:r,options:i}=e,{data:s,error:o}=yield Lx(this.fetch,"POST",t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==s?void 0:s.message_id},error:o})}throw new JT("You must provide either an email or phone number and a type")}catch(t){if(VT(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}})}getSession(){return y(this,null,function*(){yield this.initializePromise;return yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return this._useSession(e=>y(this,null,function*(){return e}))}))})}_acquireLock(e,t){return y(this,null,function*(){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(()=>y(this,null,function*(){return yield e,yield t()}))();return this.pendingInLock.push((()=>y(this,null,function*(){try{yield n}catch(OC){}}))()),n}return yield this.lock("lock:".concat(this.storageKey),e,()=>y(this,null,function*(){this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const e=t();for(this.pendingInLock.push((()=>y(this,null,function*(){try{yield e}catch(OC){}}))()),yield e;this.pendingInLock.length;){const e=[...this.pendingInLock];yield Promise.all(e),this.pendingInLock.splice(0,e.length)}return yield e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}}))}finally{this._debug("#_acquireLock","end")}})}_useSession(e){return y(this,null,function*(){this._debug("#_useSession","begin");try{const t=yield this.__loadSession();return yield e(t)}finally{this._debug("#_useSession","end")}})}__loadSession(){return y(this,null,function*(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",(new Error).stack);try{let e=null;const t=yield yx(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),yield this._removeSession())),!e)return{data:{session:null},error:null};const n=!!e.expires_at&&1e3*e.expires_at-Date.now()<NT;if(this._debug("#__loadSession()","session has".concat(n?"":" not"," expired"),"expires_at",e.expires_at),!n){if(this.userStorage){const t=yield yx(this.userStorage,this.storageKey+"-user");(null==t?void 0:t.user)?e.user=t.user:e.user=Px()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const t={value:this.suppressGetSessionWarning};e.user=function(e,t){return new Proxy(e,{get:(e,n,r)=>{if("__isInsecureUserWarningProxy"===n)return!0;if("symbol"==typeof n){const t=n.toString();if("Symbol(Symbol.toPrimitive)"===t||"Symbol(Symbol.toStringTag)"===t||"Symbol(util.inspect.custom)"===t||"Symbol(nodejs.util.inspect.custom)"===t)return Reflect.get(e,n,r)}return t.value||"string"!=typeof n||(t.value=!0),Reflect.get(e,n,r)}})}(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:r,error:i}=yield this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:r},error:null})}finally{this._debug("#__loadSession()","end")}})}getUser(e){return y(this,null,function*(){if(e)return yield this._getUser(e);yield this.initializePromise;const t=yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return yield this._getUser()}));return t.data.user&&(this.suppressGetSessionWarning=!0),t})}_getUser(e){return y(this,null,function*(){try{return e?yield Lx(this.fetch,"GET","".concat(this.url,"/user"),{headers:this.headers,jwt:e,xform:Dx}):yield this._useSession(e=>y(this,null,function*(){var t,n,r;const{data:i,error:s}=e;if(s)throw s;return(null===(t=i.session)||void 0===t?void 0:t.access_token)||this.hasCustomAuthorizationHeader?yield Lx(this.fetch,"GET","".concat(this.url,"/user"),{headers:this.headers,jwt:null!==(r=null===(n=i.session)||void 0===n?void 0:n.access_token)&&void 0!==r?r:void 0,xform:Dx}):{data:{user:null},error:new qT}}))}catch(t){if(VT(t))return KT(t)&&(yield this._removeSession(),yield vx(this.storage,"".concat(this.storageKey,"-code-verifier"))),this._returnResult({data:{user:null},error:t});throw t}})}updateUser(e){return y(this,arguments,function*(e,t={}){return yield this.initializePromise,yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return yield this._updateUser(e,t)}))})}_updateUser(e){return y(this,arguments,function*(e,t={}){try{return yield this._useSession(n=>y(this,null,function*(){const{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new qT;const s=r.session;let o=null,a=null;"pkce"===this.flowType&&null!=e.email&&([o,a]=yield _x(this.storage,this.storageKey));const{data:l,error:u}=yield Lx(this.fetch,"PUT","".concat(this.url,"/user"),{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:s.access_token,xform:Dx});if(u)throw u;return s.user=l.user,yield this._saveSession(s),yield this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})}))}catch(n){if(yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),VT(n))return this._returnResult({data:{user:null},error:n});throw n}})}setSession(e){return y(this,null,function*(){return yield this.initializePromise,yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return yield this._setSession(e)}))})}_setSession(e){return y(this,null,function*(){try{if(!e.access_token||!e.refresh_token)throw new qT;const t=Date.now()/1e3;let n=t,r=!0,i=null;const{payload:s}=wx(e.access_token);if(s.exp&&(n=s.exp,r=n<=t),r){const{data:t,error:n}=yield this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{const{data:r,error:s}=yield this._getUser(e.access_token);if(s)return this._returnResult({data:{user:null,session:null},error:s});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:n-t,expires_at:n},yield this._saveSession(i),yield this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(t){if(VT(t))return this._returnResult({data:{session:null,user:null},error:t});throw t}})}refreshSession(e){return y(this,null,function*(){return yield this.initializePromise,yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return yield this._refreshSession(e)}))})}_refreshSession(e){return y(this,null,function*(){try{return yield this._useSession(t=>y(this,null,function*(){var n;if(!e){const{data:r,error:i}=t;if(i)throw i;e=null!==(n=r.session)&&void 0!==n?n:void 0}if(!(null==e?void 0:e.refresh_token))throw new qT;const{data:r,error:i}=yield this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):r?this._returnResult({data:{user:r.user,session:r},error:null}):this._returnResult({data:{user:null,session:null},error:null})}))}catch(t){if(VT(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}})}_getSessionFromURL(e,t){return y(this,null,function*(){var n;try{if(!dx())throw new $T("No browser detected.");if(e.error||e.error_description||e.error_code)throw new $T(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new YT("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new $T("Not a valid implicit grant flow url.")}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new YT("No code detected.");const{data:t,error:r}=yield this._exchangeCodeForSession(e.code);if(r)throw r;const i=new URL(window.location.href);return i.searchParams.delete("code"),window.history.replaceState(window.history.state,"",i.toString()),{data:{session:t.session,redirectType:null!==(n=t.redirectType)&&void 0!==n?n:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=e;if(!(s&&a&&o&&u))throw new $T("No session defined in URL");const c=Math.round(Date.now()/1e3),h=parseInt(a);let d=c+h;l&&(d=parseInt(l));const{data:f,error:p}=yield this._getUser(s);if(p)throw p;const m={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:h,expires_at:d,refresh_token:o,token_type:u,user:f.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:m,redirectType:e.type},error:null})}catch(r){if(VT(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}})}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):Boolean(e.access_token||e.error_description)}_isPKCECallback(e){return y(this,null,function*(){const t=yield yx(this.storage,"".concat(this.storageKey,"-code-verifier"));return!(!e.code||!t)})}signOut(){return y(this,arguments,function*(e={scope:"global"}){return yield this.initializePromise,yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){return yield this._signOut(e)}))})}_signOut(){return y(this,arguments,function*({scope:e}={scope:"global"}){return yield this._useSession(t=>y(this,null,function*(){var n;const{data:r,error:i}=t;if(i&&!KT(i))return this._returnResult({error:i});const s=null===(n=r.session)||void 0===n?void 0:n.access_token;if(s){const{error:t}=yield this.admin.signOut(s,e);if(t&&(!function(e){return VT(e)&&"AuthApiError"===e.name}(t)||404!==t.status&&401!==t.status&&403!==t.status)&&!KT(t))return this._returnResult({error:t})}return"others"!==e&&(yield this._removeSession(),yield vx(this.storage,"".concat(this.storageKey,"-code-verifier"))),this._returnResult({error:null})}))})}onAuthStateChange(e){const t=Symbol("auth-callback"),n={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,n),(()=>{y(this,null,function*(){yield this.initializePromise,yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){this._emitInitialSession(t)}))})})(),{data:{subscription:n}}}_emitInitialSession(e){return y(this,null,function*(){return yield this._useSession(t=>y(this,null,function*(){var n,r;try{const{data:{session:r},error:i}=t;if(i)throw i;yield null===(n=this.stateChangeEmitters.get(e))||void 0===n?void 0:n.callback("INITIAL_SESSION",r),this._debug("INITIAL_SESSION","callback id",e,"session",r)}catch(i){yield null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",null),this._debug("INITIAL_SESSION","callback id",e,"error",i),KT(i)}}))})}resetPasswordForEmail(e){return y(this,arguments,function*(e,t={}){let n=null,r=null;"pkce"===this.flowType&&([n,r]=yield _x(this.storage,this.storageKey,!0));try{return yield Lx(this.fetch,"POST","".concat(this.url,"/recover"),{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(i){if(yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),VT(i))return this._returnResult({data:null,error:i});throw i}})}getUserIdentities(){return y(this,null,function*(){var e;try{const{data:t,error:n}=yield this.getUser();if(n)throw n;return this._returnResult({data:{identities:null!==(e=t.user.identities)&&void 0!==e?e:[]},error:null})}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}linkIdentity(e){return y(this,null,function*(){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)})}linkIdentityOAuth(e){return y(this,null,function*(){var t;try{const{data:n,error:r}=yield this._useSession(t=>y(this,null,function*(){var n,r,i,s,o;const{data:a,error:l}=t;if(l)throw l;const u=yield this._getUrlForProvider("".concat(this.url,"/user/identities/authorize"),e.provider,{redirectTo:null===(n=e.options)||void 0===n?void 0:n.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(i=e.options)||void 0===i?void 0:i.queryParams,skipBrowserRedirect:!0});return yield Lx(this.fetch,"GET",u,{headers:this.headers,jwt:null!==(o=null===(s=a.session)||void 0===s?void 0:s.access_token)&&void 0!==o?o:void 0})}));if(r)throw r;return dx()&&!(null===(t=e.options)||void 0===t?void 0:t.skipBrowserRedirect)&&window.location.assign(null==n?void 0:n.url),this._returnResult({data:{provider:e.provider,url:null==n?void 0:n.url},error:null})}catch(n){if(VT(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}})}linkIdentityIdToken(e){return y(this,null,function*(){return yield this._useSession(t=>y(this,null,function*(){var n;try{const{error:r,data:{session:i}}=t;if(r)throw r;const{options:s,provider:o,token:a,access_token:l,nonce:u}=e,c=yield Lx(this.fetch,"POST","".concat(this.url,"/token?grant_type=id_token"),{headers:this.headers,jwt:null!==(n=null==i?void 0:i.access_token)&&void 0!==n?n:void 0,body:{provider:o,id_token:a,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:Ix}),{data:h,error:d}=c;return d?this._returnResult({data:{user:null,session:null},error:d}):h&&h.session&&h.user?(h.session&&(yield this._saveSession(h.session),yield this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:d})):this._returnResult({data:{user:null,session:null},error:new GT})}catch(r){if(yield vx(this.storage,"".concat(this.storageKey,"-code-verifier")),VT(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}))})}unlinkIdentity(e){return y(this,null,function*(){try{return yield this._useSession(t=>y(this,null,function*(){var n,r;const{data:i,error:s}=t;if(s)throw s;return yield Lx(this.fetch,"DELETE","".concat(this.url,"/user/identities/").concat(e.identity_id),{headers:this.headers,jwt:null!==(r=null===(n=i.session)||void 0===n?void 0:n.access_token)&&void 0!==r?r:void 0})}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}_refreshAccessToken(e){return y(this,null,function*(){const t="#_refreshAccessToken(".concat(e.substring(0,5),"...)");this._debug(t,"begin");try{const n=Date.now();return yield function(e,t){return new Promise((n,r)=>{(()=>{y(this,null,function*(){for(let i=0;i<1/0;i++)try{const r=yield e(i);if(!t(i,null,r))return void n(r)}catch(OC){if(!t(i,OC))return void r(OC)}})})()})}(n=>y(this,null,function*(){return n>0&&(yield function(e){return y(this,null,function*(){return yield new Promise(t=>{setTimeout(()=>t(null),e)})})}(200*Math.pow(2,n-1))),this._debug(t,"refreshing attempt",n),yield Lx(this.fetch,"POST","".concat(this.url,"/token?grant_type=refresh_token"),{body:{refresh_token:e},headers:this.headers,xform:Ix})}),(e,t)=>{const r=200*Math.pow(2,e);return t&&ZT(t)&&Date.now()+r-n<IT})}catch(n){if(this._debug(t,"error",n),VT(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(t,"end")}})}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}_handleProviderSignIn(e,t){return y(this,null,function*(){const n=yield this._getUrlForProvider("".concat(this.url,"/authorize"),e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",n),dx()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}})}_recoverAndRefresh(){return y(this,null,function*(){var e,t;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const i=yield yx(this.storage,this.storageKey);if(i&&this.userStorage){let t=yield yx(this.userStorage,this.storageKey+"-user");this.storage.isServer||!Object.is(this.storage,this.userStorage)||t||(t={user:i.user},yield gx(this.userStorage,this.storageKey+"-user",t)),i.user=null!==(e=null==t?void 0:t.user)&&void 0!==e?e:Px()}else if(i&&!i.user&&!i.user){const e=yield yx(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(i.user=e.user,yield vx(this.storage,this.storageKey+"-user"),yield gx(this.storage,this.storageKey,i)):i.user=Px()}if(this._debug(n,"session from storage",i),!this._isValidSession(i))return this._debug(n,"session is not valid"),void(null!==i&&(yield this._removeSession()));const s=1e3*(null!==(t=i.expires_at)&&void 0!==t?t:1/0)-Date.now()<NT;if(this._debug(n,"session has".concat(s?"":" not"," expired with margin of ").concat(NT,"s")),s){if(this.autoRefreshToken&&i.refresh_token){const{error:e}=yield this._callRefreshToken(i.refresh_token);e&&(ZT(e)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",e),yield this._removeSession()))}}else if(i.user&&!0===i.user.__isUserNotAvailableProxy)try{const{data:e,error:t}=yield this._getUser(i.access_token);!t&&(null==e?void 0:e.user)?(i.user=e.user,yield this._saveSession(i),yield this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(r){this._debug(n,"error getting user data, skipping SIGNED_IN notification",r)}else yield this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){return void this._debug(n,"error",i)}finally{this._debug(n,"end")}})}_callRefreshToken(e){return y(this,null,function*(){var t,n;if(!e)throw new qT;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const r="#_callRefreshToken(".concat(e.substring(0,5),"...)");this._debug(r,"begin");try{this.refreshingDeferred=new bx;const{data:t,error:n}=yield this._refreshAccessToken(e);if(n)throw n;if(!t.session)throw new qT;yield this._saveSession(t.session),yield this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);const r={data:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(i){if(this._debug(r,"error",i),VT(i)){const e={data:null,error:i};return ZT(i)||(yield this._removeSession()),null===(t=this.refreshingDeferred)||void 0===t||t.resolve(e),e}throw null===(n=this.refreshingDeferred)||void 0===n||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(r,"end")}})}_notifyAllSubscribers(e,t,n=!0){return y(this,null,function*(){const r="#_notifyAllSubscribers(".concat(e,")");this._debug(r,"begin",t,"broadcast = ".concat(n));try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});const r=[],i=Array.from(this.stateChangeEmitters.values()).map(n=>y(this,null,function*(){try{yield n.callback(e,t)}catch(OC){r.push(OC)}}));if(yield Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1);throw r[0]}}finally{this._debug(r,"end")}})}_saveSession(e){return y(this,null,function*(){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,yield vx(this.storage,"".concat(this.storageKey,"-code-verifier"));const t=Object.assign({},e),n=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!n&&t.user&&(yield gx(this.userStorage,this.storageKey+"-user",{user:t.user}));const e=Object.assign({},t);delete e.user;const r=Rx(e);yield gx(this.storage,this.storageKey,r)}else{const e=Rx(t);yield gx(this.storage,this.storageKey,e)}})}_removeSession(){return y(this,null,function*(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,yield vx(this.storage,this.storageKey),yield vx(this.storage,this.storageKey+"-code-verifier"),yield vx(this.storage,this.storageKey+"-user"),this.userStorage&&(yield vx(this.userStorage,this.storageKey+"-user")),yield this._notifyAllSubscribers("SIGNED_OUT",null)})}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&dx()&&(null===window||void 0===window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(OC){}}_startAutoRefresh(){return y(this,null,function*(){yield this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),IT);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);const t=setTimeout(()=>y(this,null,function*(){yield this.initializePromise,yield this._autoRefreshTokenTick()}),0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)})}_stopAutoRefresh(){return y(this,null,function*(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)})}startAutoRefresh(){return y(this,null,function*(){this._removeVisibilityChangedCallback(),yield this._startAutoRefresh()})}stopAutoRefresh(){return y(this,null,function*(){this._removeVisibilityChangedCallback(),yield this._stopAutoRefresh()})}_autoRefreshTokenTick(){return y(this,null,function*(){this._debug("#_autoRefreshTokenTick()","begin");try{yield this._acquireLock(0,()=>y(this,null,function*(){try{const e=Date.now();try{return yield this._useSession(t=>y(this,null,function*(){const{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");const r=Math.floor((1e3*n.expires_at-e)/IT);this._debug("#_autoRefreshTokenTick()","access token expires in ".concat(r," ticks, a tick lasts ").concat(IT,"ms, refresh threshold is ").concat(3," ticks")),r<=3&&(yield this._callRefreshToken(n.refresh_token))}))}catch(OC){}}finally{this._debug("#_autoRefreshTokenTick()","end")}}))}catch(OC){if(!(OC.isAcquireTimeout||OC instanceof Hx))throw OC;this._debug("auto refresh token tick lock not available")}})}_handleVisibilityChange(){return y(this,null,function*(){if(this._debug("#_handleVisibilityChange()"),!dx()||!(null===window||void 0===window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=()=>y(this,null,function*(){try{yield this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}}),null===window||void 0===window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),yield this._onVisibilityChanged(!0)}catch(e){}})}_onVisibilityChanged(e){return y(this,null,function*(){const t="#_onVisibilityChanged(".concat(e,")");this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(yield this.initializePromise,yield this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){"visible"===document.visibilityState?yield this._recoverAndRefresh():this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting")})))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()})}_getUrlForProvider(e,t,n){return y(this,null,function*(){const r=["provider=".concat(encodeURIComponent(t))];if((null==n?void 0:n.redirectTo)&&r.push("redirect_to=".concat(encodeURIComponent(n.redirectTo))),(null==n?void 0:n.scopes)&&r.push("scopes=".concat(encodeURIComponent(n.scopes))),"pkce"===this.flowType){const[e,t]=yield _x(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:"".concat(encodeURIComponent(e)),code_challenge_method:"".concat(encodeURIComponent(t))});r.push(n.toString())}if(null==n?void 0:n.queryParams){const e=new URLSearchParams(n.queryParams);r.push(e.toString())}return(null==n?void 0:n.skipBrowserRedirect)&&r.push("skip_http_redirect=".concat(n.skipBrowserRedirect)),"".concat(e,"?").concat(r.join("&"))})}_unenroll(e){return y(this,null,function*(){try{return yield this._useSession(t=>y(this,null,function*(){var n;const{data:r,error:i}=t;return i?this._returnResult({data:null,error:i}):yield Lx(this.fetch,"DELETE","".concat(this.url,"/factors/").concat(e.factorId),{headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token})}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}_enroll(e){return y(this,null,function*(){try{return yield this._useSession(t=>y(this,null,function*(){var n,r;const{data:i,error:s}=t;if(s)return this._returnResult({data:null,error:s});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:a,error:l}=yield Lx(this.fetch,"POST","".concat(this.url,"/factors"),{body:o,headers:this.headers,jwt:null===(n=null==i?void 0:i.session)||void 0===n?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):("totp"===e.factorType&&"totp"===a.type&&(null===(r=null==a?void 0:a.totp)||void 0===r?void 0:r.qr_code)&&(a.totp.qr_code="data:image/svg+xml;utf-8,".concat(a.totp.qr_code)),this._returnResult({data:a,error:null}))}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}_verify(e){return y(this,null,function*(){return this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){try{return yield this._useSession(t=>y(this,null,function*(){var n;const{data:r,error:i}=t;if(i)return this._returnResult({data:null,error:i});const s=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?nC(e.webauthn.credential_response):rC(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:a}=yield Lx(this.fetch,"POST","".concat(this.url,"/factors/").concat(e.factorId,"/verify"),{body:s,headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token});return a?this._returnResult({data:null,error:a}):(yield this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),yield this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:a}))}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}}))})}_challenge(e){return y(this,null,function*(){return this._acquireLock(this.lockAcquireTimeout,()=>y(this,null,function*(){try{return yield this._useSession(t=>y(this,null,function*(){var n;const{data:r,error:i}=t;if(i)return this._returnResult({data:null,error:i});const s=yield Lx(this.fetch,"POST","".concat(this.url,"/factors/").concat(e.factorId,"/challenge"),{body:e,headers:this.headers,jwt:null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.access_token});if(s.error)return s;const{data:o}=s;if("webauthn"!==o.type)return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:eC(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:tC(o.webauthn.credential_options.publicKey)})})}),error:null}}}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}}))})}_challengeAndVerify(e){return y(this,null,function*(){const{data:t,error:n}=yield this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):yield this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})})}_listFactors(){return y(this,null,function*(){var e;const{data:{user:t},error:n}=yield this.getUser();if(n)return{data:null,error:n};const r={all:[],phone:[],totp:[],webauthn:[]};for(const i of null!==(e=null==t?void 0:t.factors)&&void 0!==e?e:[])r.all.push(i),"verified"===i.status&&r[i.factor_type].push(i);return{data:r,error:null}})}_getAuthenticatorAssuranceLevel(e){return y(this,null,function*(){var t,n,r,i;if(e)try{const{payload:r}=wx(e);let i=null;r.aal&&(i=r.aal);let s=i;const{data:{user:o},error:a}=yield this.getUser(e);if(a)return this._returnResult({data:null,error:a});(null!==(n=null===(t=null==o?void 0:o.factors)||void 0===t?void 0:t.filter(e=>"verified"===e.status))&&void 0!==n?n:[]).length>0&&(s="aal2");return{data:{currentLevel:i,nextLevel:s,currentAuthenticationMethods:r.amr||[]},error:null}}catch(c){if(VT(c))return this._returnResult({data:null,error:c});throw c}const{data:{session:s},error:o}=yield this.getSession();if(o)return this._returnResult({data:null,error:o});if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=wx(s.access_token);let l=null;a.aal&&(l=a.aal);let u=l;(null!==(i=null===(r=s.user.factors)||void 0===r?void 0:r.filter(e=>"verified"===e.status))&&void 0!==i?i:[]).length>0&&(u="aal2");return{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:a.amr||[]},error:null}})}_getAuthorizationDetails(e){return y(this,null,function*(){try{return yield this._useSession(t=>y(this,null,function*(){const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?yield Lx(this.fetch,"GET","".concat(this.url,"/oauth/authorizations/").concat(e),{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new qT})}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}_approveAuthorization(e,t){return y(this,null,function*(){try{return yield this._useSession(n=>y(this,null,function*(){const{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new qT});const s=yield Lx(this.fetch,"POST","".concat(this.url,"/oauth/authorizations/").concat(e,"/consent"),{headers:this.headers,jwt:r.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url&&dx()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s}))}catch(n){if(VT(n))return this._returnResult({data:null,error:n});throw n}})}_denyAuthorization(e,t){return y(this,null,function*(){try{return yield this._useSession(n=>y(this,null,function*(){const{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new qT});const s=yield Lx(this.fetch,"POST","".concat(this.url,"/oauth/authorizations/").concat(e,"/consent"),{headers:this.headers,jwt:r.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url&&dx()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s}))}catch(n){if(VT(n))return this._returnResult({data:null,error:n});throw n}})}_listOAuthGrants(){return y(this,null,function*(){try{return yield this._useSession(e=>y(this,null,function*(){const{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?yield Lx(this.fetch,"GET","".concat(this.url,"/user/oauth/grants"),{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new qT})}))}catch(e){if(VT(e))return this._returnResult({data:null,error:e});throw e}})}_revokeOAuthGrant(e){return y(this,null,function*(){try{return yield this._useSession(t=>y(this,null,function*(){const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(yield Lx(this.fetch,"DELETE","".concat(this.url,"/user/oauth/grants"),{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new qT})}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}fetchJwk(e){return y(this,arguments,function*(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;const r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;const{data:i,error:s}=yield Lx(this.fetch,"GET","".concat(this.url,"/.well-known/jwks.json"),{headers:this.headers});if(s)throw s;return i.keys&&0!==i.keys.length?(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),n||null):null})}getClaims(e){return y(this,arguments,function*(e,t={}){try{let n=e;if(!n){const{data:e,error:t}=yield this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}const{header:r,payload:i,signature:s,raw:{header:o,payload:a}}=wx(n);(null==t?void 0:t.allowExpired)||function(e){if(!e)throw new Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw new Error("JWT has expired")}(i.exp);const l=r.alg&&!r.alg.startsWith("HS")&&r.kid&&"crypto"in globalThis&&"subtle"in globalThis.crypto?yield this.fetchJwk(r.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks):null;if(!l){const{error:e}=yield this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:s},error:null}}const u=function(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")}}(r.alg),c=yield crypto.subtle.importKey("jwk",l,u,!0,["verify"]);if(!(yield crypto.subtle.verify(u,c,s,cx("".concat(o,".").concat(a)))))throw new tx("Invalid JWT signature");return{data:{claims:i,header:r,signature:s},error:null}}catch(n){if(VT(n))return this._returnResult({data:null,error:n});throw n}})}signInWithPasskey(e){return y(this,null,function*(){var t,n,r;Cx(this.experimental);try{if(!sC())return this._returnResult({data:null,error:new WT("Browser does not support WebAuthn",null)});const{data:i,error:s}=yield this._startPasskeyAuthentication({options:{captchaToken:null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.captchaToken}});if(s||!i)return this._returnResult({data:null,error:s});const o=tC(i.options),a=null!==(r=null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.signal)&&void 0!==r?r:Zx.createNewAbortSignal(),{data:l,error:u}=yield aC({publicKey:o,signal:a});if(u||!l)return this._returnResult({data:null,error:null!=u?u:new WT("WebAuthn ceremony failed",null)});const c=rC(l);return this._verifyPasskeyAuthentication({challengeId:i.challenge_id,credential:c})}catch(i){if(VT(i))return this._returnResult({data:null,error:i});throw i}})}registerPasskey(e){return y(this,null,function*(){var t,n;Cx(this.experimental);try{if(!sC())return this._returnResult({data:null,error:new WT("Browser does not support WebAuthn",null)});const{data:r,error:i}=yield this._startPasskeyRegistration();if(i||!r)return this._returnResult({data:null,error:i});const s=eC(r.options),o=null!==(n=null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.signal)&&void 0!==n?n:Zx.createNewAbortSignal(),{data:a,error:l}=yield oC({publicKey:s,signal:o});if(l||!a)return this._returnResult({data:null,error:null!=l?l:new WT("WebAuthn ceremony failed",null)});const u=nC(a);return this._verifyPasskeyRegistration({challengeId:r.challenge_id,credential:u})}catch(r){if(VT(r))return this._returnResult({data:null,error:r});throw r}})}_startPasskeyRegistration(){return y(this,null,function*(){Cx(this.experimental);try{return yield this._useSession(e=>y(this,null,function*(){const{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new qT});const{data:r,error:i}=yield Lx(this.fetch,"POST","".concat(this.url,"/passkeys/registration/options"),{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})}))}catch(e){if(VT(e))return this._returnResult({data:null,error:e});throw e}})}_verifyPasskeyRegistration(e){return y(this,null,function*(){Cx(this.experimental);try{return yield this._useSession(t=>y(this,null,function*(){const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new qT});const{data:i,error:s}=yield Lx(this.fetch,"POST","".concat(this.url,"/passkeys/registration/verify"),{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:i,error:null})}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}_startPasskeyAuthentication(e){return y(this,null,function*(){var t;Cx(this.experimental);try{const{data:n,error:r}=yield Lx(this.fetch,"POST","".concat(this.url,"/passkeys/authentication/options"),{headers:this.headers,body:{gotrue_meta_security:{captcha_token:null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.captchaToken}}});return r?this._returnResult({data:null,error:r}):this._returnResult({data:n,error:null})}catch(n){if(VT(n))return this._returnResult({data:null,error:n});throw n}})}_verifyPasskeyAuthentication(e){return y(this,null,function*(){Cx(this.experimental);try{const{data:t,error:n}=yield Lx(this.fetch,"POST","".concat(this.url,"/passkeys/authentication/verify"),{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Ix});return n?this._returnResult({data:null,error:n}):(t.session&&(yield this._saveSession(t.session),yield this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:t,error:null}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}_listPasskeys(){return y(this,null,function*(){Cx(this.experimental);try{return yield this._useSession(e=>y(this,null,function*(){const{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new qT});const{data:r,error:i}=yield Lx(this.fetch,"GET","".concat(this.url,"/passkeys"),{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})}))}catch(e){if(VT(e))return this._returnResult({data:null,error:e});throw e}})}_updatePasskey(e){return y(this,null,function*(){Cx(this.experimental);try{return yield this._useSession(t=>y(this,null,function*(){const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new qT});const{data:i,error:s}=yield Lx(this.fetch,"PATCH","".concat(this.url,"/passkeys/").concat(e.passkeyId),{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:i,error:null})}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}_deletePasskey(e){return y(this,null,function*(){Cx(this.experimental);try{return yield this._useSession(t=>y(this,null,function*(){const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new qT});const{error:i}=yield Lx(this.fetch,"DELETE","".concat(this.url,"/passkeys/").concat(e.passkeyId),{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})}))}catch(t){if(VT(t))return this._returnResult({data:null,error:t});throw t}})}}mC.nextInstanceID={};const gC=mC;let yC="";yC="undefined"!=typeof Deno?"deno":"undefined"!=typeof document?"web":"undefined"!=typeof navigator&&"ReactNative"===navigator.product?"react-native":"node";const vC={headers:{"X-Client-Info":"supabase-js-".concat(yC,"/").concat("2.105.1")}},bC={schema:"public"},wC={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},kC={};function SC(e){return(SC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _C(e){var t=function(e,t){if("object"!=SC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=SC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==SC(t)?t:t+""}function EC(e,t,n){return(t=_C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TC(Object(n),!0).forEach(function(t){EC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const CC=(e,t,n)=>{const r=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(n),i=Headers;return(n,s)=>y(void 0,null,function*(){var o;const a=null!==(o=yield t())&&void 0!==o?o:e;let l=new i(null==s?void 0:s.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization","Bearer ".concat(a)),r(n,xC(xC({},s),{},{headers:l}))})};var PC=class extends gC{constructor(e){super(e)}},RC=class{constructor(e,t,n){var r,i;this.supabaseUrl=e,this.supabaseKey=t;const s=function(e){const t=null==e?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((n=t).endsWith("/")?n:n+"/")}catch(r){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}var n}(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const o="sb-".concat(s.hostname.split(".")[0],"-auth-token"),a=function(e,t){var n,r;const{db:i,auth:s,realtime:o,global:a}=e,{db:l,auth:u,realtime:c,global:h}=t,d={db:xC(xC({},l),i),auth:xC(xC({},u),s),realtime:xC(xC({},c),o),storage:{},global:xC(xC(xC({},h),a),{},{headers:xC(xC({},null!==(n=null==h?void 0:h.headers)&&void 0!==n?n:{}),null!==(r=null==a?void 0:a.headers)&&void 0!==r?r:{})}),accessToken:()=>y(this,null,function*(){return""})};return e.accessToken?d.accessToken=e.accessToken:delete d.accessToken,d}(null!=n?n:{},{db:bC,realtime:kC,auth:xC(xC({},wC),{},{storageKey:o}),global:vC});var l;(this.storageKey=null!==(r=a.auth.storageKey)&&void 0!==r?r:"",this.headers=null!==(i=a.global.headers)&&void 0!==i?i:{},a.accessToken)?(this.accessToken=a.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw new Error("@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.".concat(String(t)," is not possible"))}})):this.auth=this._initSupabaseAuthClient(null!==(l=a.auth)&&void 0!==l?l:{},this.headers,a.global.fetch);this.fetch=CC(t,this._getAccessToken.bind(this),a.global.fetch),this.realtime=this._initRealtimeClient(xC({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},a.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>{}),this.rest=new w_(new URL("rest/v1",s).href,{headers:this.headers,schema:a.db.schema,fetch:this.fetch,timeout:a.db.timeout,urlLengthLimit:a.db.urlLengthLimit}),this.storage=new jT(this.storageUrl.href,this.headers,this.fetch,null==n?void 0:n.storage),a.accessToken||this._listenForAuthEvents()}get functions(){return new r_(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)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){return y(this,null,function*(){var e,t,n=this;if(n.accessToken)return yield n.accessToken();const{data:r}=yield n.auth.getSession();return null!==(e=null===(t=r.session)||void 0===t?void 0:t.access_token)&&void 0!==e?e:n.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:s,flowType:o,lock:a,debug:l,throwOnError:u,experimental:c},h,d){const f={Authorization:"Bearer ".concat(this.supabaseKey),apikey:"".concat(this.supabaseKey)};return new PC({url:this.authUrl.href,headers:xC(xC({},f),h),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:a,debug:l,throwOnError:u,experimental:c,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new FE(this.realtimeUrl.href,xC(xC({},e),{},{params:xC(xC({},{apikey:this.supabaseKey}),null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,n){"TOKEN_REFRESHED"!==e&&"SIGNED_IN"!==e||this.changedAccessToken===n?"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0):(this.changedAccessToken=n,this.realtime.setAuth(n))}};const AC=(e,t,n)=>new RC(e,t,n);!function(){if("undefined"!=typeof window)return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(null==t)return!1;const n=t.match(/^v(\d+)\./);!!n&&parseInt(n[1],10)}();export{Rk as A,lp as B,bd as H,cp as L,Nf as N,Uf as R,Sf as a,Df as b,AC as c,vh as d,dd as e,bh as f,kf as g,de as j,JS as m,re as r,vf as u};