PageSourceSearch

https://app.wepaint.ai/assets/index-0E0aWtT2.js

js wepaint.ai collected 2026-10-05 15:58:42 UTC 643,828 bytes, 18 lines download raw bytes

vendor: 20,101 bytes, lines 1-4
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-K2OLWr00.js","assets/GoogleSignInButton-DckcRHOW.js","assets/routes-B84Cva9Z.js"])))=>i.map(i=>d[i]);
2var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var D=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},O={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=O,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return te(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=E,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,D)}catch(e){D(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-ee<w)}function ne(){if(g=!1,S){var t=e.unstable_now();ee=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,E=function(){ie.postMessage(null)}}else E=function(){_(ne,0)};function ae(t,n){C=_(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_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function k(e){return{current:e}}function pe(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function A(e,t){fe++,de[fe]=e.current,e.current=t}var me=k(null),he=k(null),ge=k(null),_e=k(null);function ve(e,t){switch(A(ge,t),A(he,e),A(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zd(t),e=Qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pe(me),A(me,e)}function ye(){pe(me),pe(he),pe(ge)}function be(e){e.memoizedState!==null&&A(_e,e);var t=me.current,n=Qd(t,e.type);t!==n&&(A(he,e),A(me,n))}function xe(e){he.current===e&&(pe(me),pe(he)),_e.current===e&&(pe(_e),cp._currentValue=ue)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
3    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}
vendor: 98,188 bytes, lines 4-9
4else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5`),l=s.split(`
6`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8Error generating stack: `+e.message+`
9`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function et(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rt(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function it(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ke(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&st(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function st(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ke(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ke(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function lt(e,t){var n=t&-t;return n=n&42?1:ut(n),(n&(e.suspendedLanes|t))===0?n:0}function ut(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ft(){var e=O.p;return e===0?(e=window.event,e===void 0?32:wp(e.type)):e}function pt(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var mt=Math.random().toString(36).slice(2),ht=`__reactFiber$`+mt,gt=`__reactProps$`+mt,_t=`__reactContainer$`+mt,vt=`__reactEvents$`+mt,yt=`__reactListeners$`+mt,bt=`__reactHandles$`+mt,xt=`__reactResources$`+mt,St=`__reactMarker$`+mt;function Ct(e){delete e[ht],delete e[gt],delete e[vt],delete e[yt],delete e[bt]}function wt(e){var t=e[ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xf(e);e!==null;){if(n=e[ht])return n;e=xf(e)}return t}e=n,n=e.parentNode}return null}function Tt(e){if(e=e[ht]||e[_t]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Et(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Dt(e){var t=e[xt];return t||=e[xt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ot(e){e[St]=!0}var kt=new Set,At={};function jt(e,t){Mt(e,t),Mt(e+`Capture`,t)}function Mt(e,t){for(At[e]=t,e=0;e<t.length;e++)kt.add(t[e])}var Nt=RegExp(`^[: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]*$`),Pt={},Ft={};function It(e){return ke.call(Ft,e)?!0:ke.call(Pt,e)?!1:Nt.test(e)?Ft[e]=!0:(Pt[e]=!0,!1)}function Lt(e,t,n){if(It(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Rt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function zt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Bt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Vt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ht(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ut(e){if(!e._valueTracker){var t=Vt(e)?`checked`:`value`;e._valueTracker=Ht(e,t,``+e[t])}}function Wt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Vt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Gt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Kt=/[\n"\\]/g;function qt(e){return e.replace(Kt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Jt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Bt(t)):e.value!==``+Bt(t)&&(e.value=``+Bt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Xt(e,o,Bt(n)):Xt(e,o,Bt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Bt(s):e.removeAttribute(`name`)}function Yt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ut(e);return}n=n==null?``:``+Bt(n),t=t==null?n:``+Bt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ut(e)}function Xt(e,t,n){t===`number`&&Gt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Zt(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=``+Bt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Qt(e,t,n){if(t!=null&&(t=``+Bt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Bt(n)}function $t(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(le(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Bt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ut(e)}function en(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function nn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||tn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function rn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&nn(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&nn(e,o,t[o])}function an(e){if(e.indexOf(`-`)===-1)return!1;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 on=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),sn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function cn(e){return sn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function ln(){}var un=null;function dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fn=null,pn=null;function mn(e){var t=Tt(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Jt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[gt]||null;if(!a)throw Error(i(90));Jt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Wt(r)}break a;case`textarea`:Qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Zt(e,!!n.multiple,t,!1)}}}var hn=!1;function gn(e,t,n){if(hn)return e(t,n);hn=!0;try{return e(t)}finally{if(hn=!1,(fn!==null||pn!==null)&&(ku(),fn&&(t=fn,e=pn,pn=fn=null,mn(t),e)))for(t=0;t<e.length;t++)mn(e[t])}}function _n(e,t){var n=e.stateNode;if(n===null)return null;var r=n[gt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var vn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),yn=!1;if(vn)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){yn=!0}}),window.addEventListener(`test`,bn,bn),window.removeEventListener(`test`,bn,bn)}catch{yn=!1}var xn=null,Sn=null,Cn=null;function wn(){if(Cn)return Cn;var e,t=Sn,n=t.length,r,i=`value`in xn?xn.value:xn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Cn=i.slice(e,1<r?1-r:void 0)}function Tn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function En(){return!0}function Dn(){return!1}function On(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?En:Dn,this.isPropagationStopped=Dn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=En)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=En)},persist:function(){},isPersistent:En}),t}var kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},An=On(kn),jn=m({},kn,{view:0,detail:0}),Mn=On(jn),Nn,Pn,Fn,In=m({},jn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Fn&&(Fn&&e.type===`mousemove`?(Nn=e.screenX-Fn.screenX,Pn=e.screenY-Fn.screenY):Pn=Nn=0,Fn=e),Nn)},movementY:function(e){return`movementY`in e?e.movementY:Pn}}),Ln=On(In),Rn=On(m({},In,{dataTransfer:0})),zn=On(m({},jn,{relatedTarget:0})),Bn=On(m({},kn,{animationName:0,elapsedTime:0,pseudoElement:0})),Vn=On(m({},kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Hn=On(m({},kn,{data:0})),Un={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Wn={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`},Gn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gn[e])?!!t[e]:!1}function qn(){return Kn}var Jn=On(m({},jn,{key:function(e){if(e.key){var t=Un[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Tn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Wn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qn,charCode:function(e){return e.type===`keypress`?Tn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Tn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Yn=On(m({},In,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Xn=On(m({},jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qn})),Zn=On(m({},kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Qn=On(m({},In,{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})),$n=On(m({},kn,{newState:0,oldState:0})),er=[9,13,27,32],tr=vn&&`CompositionEvent`in window,nr=null;vn&&`documentMode`in document&&(nr=document.documentMode);var rr=vn&&`TextEvent`in window&&!nr,ir=vn&&(!tr||nr&&8<nr&&11>=nr),ar=` `,j=!1;function or(e,t){switch(e){case`keyup`:return er.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var cr=!1;function M(e,t){switch(e){case`compositionend`:return sr(t);case`keypress`:return t.which===32?(j=!0,ar):null;case`textInput`:return e=t.data,e===ar&&j?null:e;default:return null}}function lr(e,t){if(cr)return e===`compositionend`||!tr&&or(e,t)?(e=wn(),Cn=Sn=xn=null,cr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return ir&&t.locale!==`ko`?null:t.data;default:return null}}var ur={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 dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ur[e.type]:t===`textarea`}function fr(e,t,n,r){fn?pn?pn.push(r):pn=[r]:fn=r,t=Fd(t,`onChange`),0<t.length&&(n=new An(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var pr=null,mr=null;function hr(e){Od(e,0)}function gr(e){if(Wt(Et(e)))return e}function _r(e,t){if(e===`change`)return t}var vr=!1;if(vn){var yr;if(vn){var br=`oninput`in document;if(!br){var xr=document.createElement(`div`);xr.setAttribute(`oninput`,`return;`),br=typeof xr.oninput==`function`}yr=br}else yr=!1;vr=yr&&(!document.documentMode||9<document.documentMode)}function Sr(){pr&&(pr.detachEvent(`onpropertychange`,Cr),mr=pr=null)}function Cr(e){if(e.propertyName===`value`&&gr(mr)){var t=[];fr(t,mr,e,dn(e)),gn(hr,t)}}function wr(e,t,n){e===`focusin`?(Sr(),pr=t,mr=n,pr.attachEvent(`onpropertychange`,Cr)):e===`focusout`&&Sr()}function Tr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return gr(mr)}function Er(e,t){if(e===`click`)return gr(t)}function Dr(e,t){if(e===`input`||e===`change`)return gr(t)}function Or(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var kr=typeof Object.is==`function`?Object.is:Or;function Ar(e,t){if(kr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!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(!ke.call(t,i)||!kr(e[i],t[i]))return!1}return!0}function jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mr(e,t){var n=jr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gt(e.document)}return t}function Fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ir=vn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Gt(r)||(r=Lr,`selectionStart`in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&Ar(zr,r)||(zr=r,r=Fd(Rr,`onSelect`),0<r.length&&(t=new An(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ur={animationend:Hr(`Animation`,`AnimationEnd`),animationiteration:Hr(`Animation`,`AnimationIteration`),animationstart:Hr(`Animation`,`AnimationStart`),transitionrun:Hr(`Transition`,`TransitionRun`),transitionstart:Hr(`Transition`,`TransitionStart`),transitioncancel:Hr(`Transition`,`TransitionCancel`),transitionend:Hr(`Transition`,`TransitionEnd`)},Wr={},Gr={};vn&&(Gr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),`TransitionEvent`in window||delete Ur.transitionend.transition);function Kr(e){if(Wr[e])return Wr[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gr)return Wr[e]=t[n];return e}var qr=Kr(`animationend`),Jr=Kr(`animationiteration`),Yr=Kr(`animationstart`),Xr=Kr(`transitionrun`),Zr=Kr(`transitionstart`),Qr=Kr(`transitioncancel`),$r=Kr(`transitionend`),ei=new Map,ti=`abort auxClick beforeToggle 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(` `);ti.push(`scrollEnd`);function ni(e,t){ei.set(e,t),jt(t,[e])}var ri=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ii=[],ai=0,oi=0;function si(){for(var e=ai,t=oi=ai=0;t<e;){var n=ii[t];ii[t++]=null;var r=ii[t];ii[t++]=null;var i=ii[t];ii[t++]=null;var a=ii[t];if(ii[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&di(n,i,a)}}function ci(e,t,n,r){ii[ai++]=e,ii[ai++]=t,ii[ai++]=n,ii[ai++]=r,oi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function li(e,t,n,r){return ci(e,t,n,r),fi(e)}function ui(e,t){return ci(e,null,null,t),fi(e)}function di(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ke(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function fi(e){if(50<bu)throw bu=0,xu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var pi={};function mi(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.refCleanup=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 hi(e,t,n,r){return new mi(e,t,n,r)}function gi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _i(e,t){var n=e.alternate;return n===null?(n=hi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function vi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function yi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)gi(e)&&(s=1);else if(typeof e==`string`)s=$f(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case re:return e=hi(31,n,t,a),e.elementType=re,e.lanes=o,e;case y:return bi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=hi(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=hi(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=hi(19,n,t,a),e.elementType=te,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ne:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=hi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function bi(e,t,n,r){return e=hi(7,e,r,t),e.lanes=n,e}function xi(e,t,n){return e=hi(6,e,null,t),e.lanes=n,e}function Si(e){var t=hi(18,null,null,0);return t.stateNode=e,t}function Ci(e,t,n){return t=hi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wi=new WeakMap;function Ti(e,t){if(typeof e==`object`&&e){var n=wi.get(e);return n===void 0?(t={value:e,source:t,stack:Oe(t)},wi.set(e,t),t):n}return{value:e,source:t,stack:Oe(t)}}var Ei=[],Di=0,Oi=null,ki=0,Ai=[],ji=0,Mi=null,Ni=1,Pi=``;function Fi(e,t){Ei[Di++]=ki,Ei[Di++]=Oi,Oi=e,ki=t}function Ii(e,t,n){Ai[ji++]=Ni,Ai[ji++]=Pi,Ai[ji++]=Mi,Mi=e;var r=Ni;e=Pi;var i=32-Ke(r)-1;r&=~(1<<i),n+=1;var a=32-Ke(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ni=1<<32-Ke(t)+i|n<<i|r,Pi=a+e}else Ni=1<<a|n<<i|r,Pi=e}function Li(e){e.return!==null&&(Fi(e,1),Ii(e,1,0))}function Ri(e){for(;e===Oi;)Oi=Ei[--Di],Ei[Di]=null,ki=Ei[--Di],Ei[Di]=null;for(;e===Mi;)Mi=Ai[--ji],Ai[ji]=null,Pi=Ai[--ji],Ai[ji]=null,Ni=Ai[--ji],Ai[ji]=null}function zi(e,t){Ai[ji++]=Ni,Ai[ji++]=Pi,Ai[ji++]=Mi,Ni=t.id,Pi=t.overflow,Mi=e}var Bi=null,Vi=null,N=!1,Hi=null,Ui=!1,Wi=Error(i(519));function Gi(e){throw Zi(Ti(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Wi}function Ki(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ht]=e,t[gt]=r,n){case`dialog`:W(`cancel`,t),W(`close`,t);break;case`iframe`:case`object`:case`embed`:W(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ed.length;n++)W(Ed[n],t);break;case`source`:W(`error`,t);break;case`img`:case`image`:case`link`:W(`error`,t),W(`load`,t);break;case`details`:W(`toggle`,t);break;case`input`:W(`invalid`,t),Yt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:W(`invalid`,t);break;case`textarea`:W(`invalid`,t),$t(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Vd(t.textContent,n)?(r.popover!=null&&(W(`beforetoggle`,t),W(`toggle`,t)),r.onScroll!=null&&W(`scroll`,t),r.onScrollEnd!=null&&W(`scrollend`,t),r.onClick!=null&&(t.onclick=ln),t=!0):t=!1,t||Gi(e,!0)}function qi(e){for(Bi=e.return;Bi;)switch(Bi.tag){case 5:case 31:case 13:Ui=!1;return;case 27:case 3:Ui=!0;return;default:Bi=Bi.return}}function Ji(e){if(e!==Bi)return!1;if(!N)return qi(e),N=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||$d(e.type,e.memoizedProps)),n=!n),n&&Vi&&Gi(e),qi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Vi=bf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Vi=bf(e)}else t===27?(t=Vi,cf(e.type)?(e=yf,yf=null,Vi=e):Vi=t):Vi=Bi?vf(e.stateNode.nextSibling):null;return!0}function Yi(){Vi=Bi=null,N=!1}function Xi(){var e=Hi;return e!==null&&(ou===null?ou=e:ou.push.apply(ou,e),Hi=null),e}function Zi(e){Hi===null?Hi=[e]:Hi.push(e)}var Qi=k(null),$i=null,ea=null;function ta(e,t,n){A(Qi,t._currentValue),t._currentValue=n}function na(e){e._currentValue=Qi.current,pe(Qi)}function ra(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ia(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ra(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ra(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function aa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;kr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===_e.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[cp]:e.push(cp))}a=a.return}e!==null&&ia(t,e,n,r),t.flags|=262144}function oa(e){for(e=e.firstContext;e!==null;){if(!kr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sa(e){$i=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ca(e){return ua($i,e)}function la(e,t){return $i===null&&sa(e),ua(e,t)}function ua(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ea===null){if(e===null)throw Error(i(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return n}var da=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},fa=t.unstable_scheduleCallback,pa=t.unstable_NormalPriority,ma={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ha(){return{controller:new da,data:new Map,refCount:0}}function ga(e){e.refCount--,e.refCount===0&&fa(pa,function(){e.controller.abort()})}var _a=null,va=0,ya=0,ba=null;function xa(e,t){if(_a===null){var n=_a=[];va=0,ya=bd(),ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return va++,t.then(Sa,Sa),t}function Sa(){if(--va===0&&_a!==null){ba!==null&&(ba.status=`fulfilled`);var e=_a;_a=null,ya=0,ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ca(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var wa=D.S;D.S=function(e,t){lu=Pe(),typeof t==`object`&&t&&typeof t.then==`function`&&xa(e,t),wa!==null&&wa(e,t)};var Ta=k(null);function Ea(){var e=Ta.current;return e===null?Jl.pooledCache:e}function Da(e,t){t===null?A(Ta,Ta.current):A(Ta,t.pool)}function Oa(){var e=Ea();return e===null?null:{parent:ma._currentValue,pool:e}}var ka=Error(i(460)),Aa=Error(i(474)),ja=Error(i(542)),Ma={then:function(){}};function Na(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Pa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ln,ln),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ra(e),e;default:if(typeof t.status==`string`)t.then(ln,ln);else{if(e=Jl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ra(e),e}throw Ia=t,ka}}function Fa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ia=e,ka):e}}var Ia=null;function La(){if(Ia===null)throw Error(i(459));var e=Ia;return Ia=null,e}function Ra(e){if(e===ka||e===ja)throw Error(i(483))}var za=null,Ba=0;function Va(e){var t=Ba;return Ba+=1,za===null&&(za=[]),Pa(za,e,t)}function Ha(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ua(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Wa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=_i(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=xi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===E&&Fa(i)===t.type)?(t=a(t,n.props),Ha(t,n),t.return=e,t):(t=yi(n.type,n.key,n.props,null,e.mode,r),Ha(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ci(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=bi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=xi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=yi(t.type,t.key,t.props,null,e.mode,n),Ha(n,t),n.return=e,n;case v:return t=Ci(t,e.mode,n),t.return=e,t;case E:return t=Fa(t),f(e,t,n)}if(le(t)||oe(t))return t=bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Va(t),n);if(t.$$typeof===C)return f(e,la(e,t),n);Ua(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case E:return n=Fa(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Va(n),r);if(n.$$typeof===C)return p(e,t,la(e,n),r);Ua(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Fa(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Va(r),i);if(r.$$typeof===C)return m(e,t,n,la(t,r),i);Ua(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),N&&Fi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return N&&Fi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),N&&Fi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),N&&Fi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return N&&Fi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),N&&Fi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Fa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ha(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=bi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=yi(o.type,o.key,o.props,null,e.mode,c),Ha(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=Ci(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Fa(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Va(o),c);if(o.$$typeof===C)return b(e,r,la(e,o),c);Ua(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=xi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ba=0;var i=b(e,t,n,r);return za=null,i}catch(t){if(t===ka||t===ja)throw t;var a=hi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ga=Wa(!0),Ka=Wa(!1),qa=!1;function Ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,R&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=fi(e),di(e,null,n),t}return ci(e,r,t,n),fi(e)}function Qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}function $a(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var eo=!1;function to(){if(eo){var e=ba;if(e!==null)throw e}}function no(e,t,n,r){eo=!1;var i=e.updateQueue;qa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(B&f)===f:(r&f)===f){f!==0&&f===ya&&(eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:qa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),eu|=o,e.lanes=o,e.memoizedState=d}}function ro(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function io(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ro(n[e],t)}var ao=k(null),oo=k(0);function so(e,t){e=$l,A(oo,e),A(ao,t),$l=e|t.baseLanes}function co(){A(oo,$l),A(ao,ao.current)}function lo(){$l=oo.current,pe(ao),pe(oo)}var uo=k(null),fo=null;function po(e){var t=e.alternate;A(vo,vo.current&1),A(uo,e),fo===null&&(t===null||ao.current!==null||t.memoizedState!==null)&&(fo=e)}function mo(e){A(vo,vo.current),A(uo,e),fo===null&&(fo=e)}function ho(e){e.tag===22?(A(vo,vo.current),A(uo,e),fo===null&&(fo=e)):go(e)}function go(){A(vo,vo.current),A(uo,uo.current)}function _o(e){pe(uo),fo===e&&(fo=null),pe(vo)}var vo=k(0);function yo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hf(n)||gf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var P=0,F=null,bo=null,xo=null,So=!1,Co=!1,wo=!1,To=0,Eo=0,Do=null,Oo=0;function ko(){throw Error(i(321))}function Ao(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kr(e[n],t[n]))return!1;return!0}function jo(e,t,n,r,i,a){return P=a,F=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?Ks:qs,wo=!1,a=n(r,i),wo=!1,Co&&(a=No(t,n,r,i)),Mo(e),a}function Mo(e){D.H=Gs;var t=bo!==null&&bo.next!==null;if(P=0,xo=bo=F=null,So=!1,Eo=0,Do=null,t)throw Error(i(300));e===null||uc||(e=e.dependencies,e!==null&&oa(e)&&(uc=!0))}function No(e,t,n,r){F=e;var a=0;do{if(Co&&(Do=null),Eo=0,Co=!1,25<=a)throw Error(i(301));if(a+=1,xo=bo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}D.H=Js,o=t(n,r)}while(Co);return o}function Po(){var e=D.H,t=e.useState()[0];return t=typeof t.then==`function`?Vo(t):t,e=e.useState()[0],(bo===null?null:bo.memoizedState)!==e&&(F.flags|=1024),t}function Fo(){var e=To!==0;return To=0,e}function Io(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Lo(e){if(So){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}So=!1}P=0,xo=bo=F=null,Co=!1,Eo=To=0,Do=null}function Ro(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xo===null?F.memoizedState=xo=e:xo=xo.next=e,xo}function zo(){if(bo===null){var e=F.alternate;e=e===null?null:e.memoizedState}else e=bo.next;var t=xo===null?F.memoizedState:xo.next;if(t!==null)xo=t,bo=e;else{if(e===null)throw F.alternate===null?Error(i(467)):Error(i(310));bo=e,e={memoizedState:bo.memoizedState,baseState:bo.baseState,baseQueue:bo.baseQueue,queue:bo.queue,next:null},xo===null?F.memoizedState=xo=e:xo=xo.next=e}return xo}function Bo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vo(e){var t=Eo;return Eo+=1,Do===null&&(Do=[]),e=Pa(Do,e,t),t=F,(xo===null?t.memoizedState:xo.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?Ks:qs),e}function Ho(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Vo(e);if(e.$$typeof===C)return ca(e)}throw Error(i(438,String(e)))}function Uo(e){var t=null,n=F.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=F.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Bo(),F.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ie;return t.index++,n}function Wo(e,t){return typeof t==`function`?t(e):t}function Go(e){return Ko(zo(),bo,e)}function Ko(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(P&f)===f:(B&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ya&&(d=!0);else if((P&p)===p){u=u.next,p===ya&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,F.lanes|=p,eu|=p;f=u.action,wo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,F.lanes|=f,eu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!kr(o,e.memoizedState)&&(uc=!0,d&&(n=ba,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function qo(e){var t=zo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);kr(o,t.memoizedState)||(uc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Jo(e,t,n){var r=F,a=zo(),o=N;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!kr((bo||a).memoizedState,n);if(s&&(a.memoizedState=n,uc=!0),a=a.queue,I(Zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||xo!==null&&xo.memoizedState.tag&1){if(r.flags|=2048,ms(9,{destroy:void 0},Xo.bind(null,r,a,n,t),null),Jl===null)throw Error(i(349));o||P&127||Yo(r,t,n)}return n}function Yo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=F.updateQueue,t===null?(t=Bo(),F.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xo(e,t,n,r){t.value=n,t.getSnapshot=r,Qo(t)&&$o(e)}function Zo(e,t,n){return n(function(){Qo(t)&&$o(e)})}function Qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kr(e,n)}catch{return!0}}function $o(e){var t=ui(e,2);t!==null&&wu(t,e,2)}function es(e){var t=Ro();if(typeof e==`function`){var n=e;if(e=n(),wo){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:e},t}function ts(e,t,n,r){return e.baseState=n,Ko(e,bo,typeof r==`function`?r:Wo)}function ns(e,t,n,r,a){if(Hs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};D.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,rs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function rs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=D.T,o={};D.T=o;try{var s=n(i,r),c=D.S;c!==null&&c(o,s),is(e,t,s)}catch(n){os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),D.T=a}}else try{a=n(i,r),is(e,t,a)}catch(n){os(e,t,n)}}function is(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){as(e,t,n)},function(n){return os(e,t,n)}):as(e,t,n)}function as(e,t,n){t.status=`fulfilled`,t.value=n,ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,rs(e,n)))}function os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ss(t),t=t.next;while(t!==r)}e.action=null}function ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cs(e,t){return t}function ls(e,t){if(N){var n=Jl.formState;if(n!==null){a:{var r=F;if(N){if(Vi){b:{for(var i=Vi,a=Ui;i.nodeType!==8;){if(!a){i=null;break b}if(i=vf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Vi=vf(i.nextSibling),r=i.data===`F!`;break a}}Gi(r)}r=!1}r&&(t=n[0])}}return n=Ro(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:t},n.queue=r,n=zs.bind(null,F,r),r.dispatch=n,r=es(!1),a=Vs.bind(null,F,!1,r.queue),r=Ro(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ns.bind(null,F,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function us(e){return ds(zo(),bo,e)}function ds(e,t,n){if(t=Ko(e,t,cs)[0],e=Go(Wo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Vo(t)}catch(e){throw e===ka?ja:e}else r=t;t=zo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(F.flags|=2048,ms(9,{destroy:void 0},fs.bind(null,i,n),null)),[r,a,e]}function fs(e,t){e.action=t}function ps(e){var t=zo(),n=bo;if(n!==null)return ds(t,n,e);zo(),t=t.memoizedState,n=zo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=F.updateQueue,t===null&&(t=Bo(),F.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function hs(){return zo().memoizedState}function gs(e,t,n,r){var i=Ro();F.flags|=e,i.memoizedState=ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function _s(e,t,n,r){var i=zo();r=r===void 0?null:r;var a=i.memoizedState.inst;bo!==null&&r!==null&&Ao(r,bo.memoizedState.deps)?i.memoizedState=ms(t,a,n,r):(F.flags|=e,i.memoizedState=ms(1|t,a,n,r))}function vs(e,t){gs(8390656,8,e,t)}function I(e,t){_s(2048,8,e,t)}function ys(e){F.flags|=4;var t=F.updateQueue;if(t===null)t=Bo(),F.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function bs(e){var t=zo().memoizedState;return ys({ref:t,nextImpl:e}),function(){if(R&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function xs(e,t){return _s(4,2,e,t)}function Ss(e,t){return _s(4,4,e,t)}function Cs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ws(e,t,n){n=n==null?null:n.concat([e]),_s(4,4,Cs.bind(null,t,e),n)}function Ts(){}function L(e,t){var n=zo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ao(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Es(e,t){var n=zo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ao(t,r[1]))return r[0];if(r=e(),wo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r}function Ds(e,t,n){return n===void 0||P&1073741824&&!(B&261930)?e.memoizedState=t:(e.memoizedState=n,e=Cu(),F.lanes|=e,eu|=e,n)}function Os(e,t,n,r){return kr(n,t)?n:ao.current===null?!(P&42)||P&1073741824&&!(B&261930)?(uc=!0,e.memoizedState=n):(e=Cu(),F.lanes|=e,eu|=e,t):(e=Ds(e,n,r),kr(e,t)||(uc=!0),e)}function ks(e,t,n,r,i){var a=O.p;O.p=a!==0&&8>a?a:8;var o=D.T,s={};D.T=s,Vs(e,!1,t,n);try{var c=i(),l=D.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Bs(e,t,Ca(c,r),Su(e)):Bs(e,t,r,Su(e))}catch(n){Bs(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{O.p=a,o!==null&&s.types!==null&&(o.types=s.types),D.T=o}}function As(){}function js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ms(e).queue;ks(e,a,t,ue,n===null?As:function(){return Ns(e),n(r)})}function Ms(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ns(e){var t=Ms(e);t.next===null&&(t=e.alternate.memoizedState),Bs(e,t.next.queue,{},Su())}function Ps(){return ca(cp)}function Fs(){return zo().memoizedState}function Is(){return zo().memoizedState}function Ls(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=Xa(n);var r=Za(t,e,n);r!==null&&(wu(r,t,n),Qa(r,t,n)),t={cache:ha()},e.payload=t;return}t=t.return}}function Rs(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Hs(e)?Us(t,n):(n=li(e,t,n,r),n!==null&&(wu(n,e,r),Ws(n,t,r)))}function zs(e,t,n){Bs(e,t,n,Su())}function Bs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))Us(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,kr(s,o))return ci(e,t,i,0),Jl===null&&si(),!1}catch{}if(n=li(e,t,i,r),n!==null)return wu(n,e,r),Ws(n,t,r),!0}return!1}function Vs(e,t,n,r){if(r={lane:2,revertLane:bd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(i(479))}else t=li(e,n,r,2),t!==null&&wu(t,e,2)}function Hs(e){var t=e.alternate;return e===F||t!==null&&t===F}function Us(e,t){Co=So=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ws(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var Gs={readContext:ca,use:Ho,useCallback:ko,useContext:ko,useEffect:ko,useImperativeHandle:ko,useLayoutEffect:ko,useInsertionEffect:ko,useMemo:ko,useReducer:ko,useRef:ko,useState:ko,useDebugValue:ko,useDeferredValue:ko,useTransition:ko,useSyncExternalStore:ko,useId:ko,useHostTransitionStatus:ko,useFormState:ko,useActionState:ko,useOptimistic:ko,useMemoCache:ko,useCacheRefresh:ko};Gs.useEffectEvent=ko;var Ks={readContext:ca,use:Ho,useCallback:function(e,t){return Ro().memoizedState=[e,t===void 0?null:t],e},useContext:ca,useEffect:vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),gs(4194308,4,Cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gs(4194308,4,e,t)},useInsertionEffect:function(e,t){gs(4,2,e,t)},useMemo:function(e,t){var n=Ro();t=t===void 0?null:t;var r=e();if(wo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ro();if(n!==void 0){var i=n(t);if(wo){Ge(!0);try{n(t)}finally{Ge(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Rs.bind(null,F,e),[r.memoizedState,e]},useRef:function(e){var t=Ro();return e={current:e},t.memoizedState=e},useState:function(e){e=es(e);var t=e.queue,n=zs.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ts,useDeferredValue:function(e,t){return Ds(Ro(),e,t)},useTransition:function(){var e=es(!1);return e=ks.bind(null,F,e.queue,!0,!1),Ro().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=F,a=Ro();if(N){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Jl===null)throw Error(i(349));B&127||Yo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,vs(Zo.bind(null,r,o,e),[e]),r.flags|=2048,ms(9,{destroy:void 0},Xo.bind(null,r,o,n,t),null),n},useId:function(){var e=Ro(),t=Jl.identifierPrefix;if(N){var n=Pi,r=Ni;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=To++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Oo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ps,useFormState:ls,useActionState:ls,useOptimistic:function(e){var t=Ro();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vs.bind(null,F,!0,n),n.dispatch=t,[e,t]},useMemoCache:Uo,useCacheRefresh:function(){return Ro().memoizedState=Ls.bind(null,F)},useEffectEvent:function(e){var t=Ro(),n={impl:e};return t.memoizedState=n,function(){if(R&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},qs={readContext:ca,use:Ho,useCallback:L,useContext:ca,useEffect:I,useImperativeHandle:ws,useInsertionEffect:xs,useLayoutEffect:Ss,useMemo:Es,useReducer:Go,useRef:hs,useState:function(){return Go(Wo)},useDebugValue:Ts,useDeferredValue:function(e,t){return Os(zo(),bo.memoizedState,e,t)},useTransition:function(){var e=Go(Wo)[0],t=zo().memoizedState;return[typeof e==`boolean`?e:Vo(e),t]},useSyncExternalStore:Jo,useId:Fs,useHostTransitionStatus:Ps,useFormState:us,useActionState:us,useOptimistic:function(e,t){return ts(zo(),bo,e,t)},useMemoCache:Uo,useCacheRefresh:Is};qs.useEffectEvent=bs;var Js={readContext:ca,use:Ho,useCallback:L,useContext:ca,useEffect:I,useImperativeHandle:ws,useInsertionEffect:xs,useLayoutEffect:Ss,useMemo:Es,useReducer:qo,useRef:hs,useState:function(){return qo(Wo)},useDebugValue:Ts,useDeferredValue:function(e,t){var n=zo();return bo===null?Ds(n,e,t):Os(n,bo.memoizedState,e,t)},useTransition:function(){var e=qo(Wo)[0],t=zo().memoizedState;return[typeof e==`boolean`?e:Vo(e),t]},useSyncExternalStore:Jo,useId:Fs,useHostTransitionStatus:Ps,useFormState:ps,useActionState:ps,useOptimistic:function(e,t){var n=zo();return bo===null?(n.baseState=e,[e,n.queue.dispatch]):ts(n,bo,e,t)},useMemoCache:Uo,useCacheRefresh:Is};Js.useEffectEvent=bs;function Ys(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Xa(r);i.payload=t,n!=null&&(i.callback=n),t=Za(e,i,r),t!==null&&(wu(t,e,r),Qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Xa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Za(e,i,r),t!==null&&(wu(t,e,r),Qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Su(),r=Xa(n);r.tag=2,t!=null&&(r.callback=t),t=Za(e,r,n),t!==null&&(wu(t,e,n),Qa(t,e,n))}};function Zs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ar(n,r)||!Ar(i,a):!0}function Qs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Xs.enqueueReplaceState(t,t.state,null)}function $s(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function ec(e){ri(e)}function tc(e){console.error(e)}function nc(e){ri(e)}function rc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ic(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ac(e,t,n){return n=Xa(n),n.tag=3,n.payload={element:null},n.callback=function(){rc(e,t)},n}function oc(e){return e=Xa(e),e.tag=3,e}function sc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){ic(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ic(t,n,r),typeof i!=`function`&&(fu===null?fu=new Set([this]):fu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function cc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&aa(t,n,a,!0),n=uo.current,n!==null){switch(n.tag){case 31:case 13:return fo===null?Iu():n.alternate===null&&H===0&&(H=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ma?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ed(e,r,a)),!1;case 22:return n.flags|=65536,r===Ma?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ed(e,r,a)),!1}throw Error(i(435,n.tag))}return ed(e,r,a),Iu(),!1}if(N)return t=uo.current,t===null?(r!==Wi&&(t=Error(i(423),{cause:r}),Zi(Ti(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ti(r,n),a=ac(e.stateNode,r,a),$a(e,a),H!==4&&(H=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Wi&&(e=Error(i(422),{cause:r}),Zi(Ti(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ti(o,n),au===null?au=[o]:au.push(o),H!==4&&(H=2),t===null)return!0;r=Ti(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ac(n.stateNode,r,e),$a(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(fu===null||!fu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=oc(a),sc(a,e,n,r),$a(n,a),!1}n=n.return}while(n!==null);return!1}var lc=Error(i(461)),uc=!1;function dc(e,t,n,r){t.child=e===null?Ka(t,null,n,r):Ga(t,e.child,n,r)}function fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return sa(t),r=jo(e,t,n,o,a,i),s=Fo(),e!==null&&!uc?(Io(e,t,i),Ic(e,t,i)):(N&&s&&Li(t),t.flags|=1,dc(e,t,r,i),t.child)}function pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!gi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,mc(e,t,a,r,i)):(e=yi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Lc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ar:n,n(o,r)&&e.ref===t.ref)return Ic(e,t,i)}return t.flags|=1,e=_i(a,r),e.ref=t.ref,e.return=t,t.child=e}function mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ar(a,r)&&e.ref===t.ref)if(uc=!1,t.pendingProps=r=a,Lc(e,i))e.flags&131072&&(uc=!0);else return t.lanes=e.lanes,Ic(e,t,i)}return Sc(e,t,n,r,i)}function hc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return _c(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Da(t,a===null?null:a.cachePool),a===null?co():so(t,a),ho(t);else return r=t.lanes=536870912,_c(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Da(t,null),co(),go(t)):(Da(t,a.cachePool),so(t,a),go(t),t.memoizedState=null);return dc(e,t,i,n),t.child}function gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _c(e,t,n,r,i){var a=Ea();return a=a===null?null:{parent:ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Da(t,null),co(),ho(t),e!==null&&aa(e,t,r,!0),t.childLanes=i,null}function vc(e,t){return t=jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function yc(e,t,n){return Ga(t,e.child,null,n),e=vc(t,t.pendingProps),e.flags|=2,_o(t),t.memoizedState=null,e}function bc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(N){if(r.mode===`hidden`)return e=vc(t,r),t.lanes=536870912,gc(null,e);if(mo(t),(e=Vi)?(e=mf(e,Ui),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mi===null?null:{id:Ni,overflow:Pi},retryLane:536870912,hydrationErrors:null},n=Si(e),n.return=t,t.child=n,Bi=t,Vi=null)):e=null,e===null)throw Gi(t);return t.lanes=536870912,null}return vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(mo(t),a)if(t.flags&256)t.flags&=-257,t=yc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(uc||aa(e,t,n,!1),a=(n&e.childLanes)!==0,uc||a){if(r=Jl,r!==null&&(s=lt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ui(e,s),wu(r,e,s),lc;Iu(),t=yc(e,t,n)}else e=o.treeContext,Vi=vf(s.nextSibling),Bi=t,N=!0,Hi=null,Ui=!1,e!==null&&zi(t,e),t=vc(t,r),t.flags|=4096;return t}return e=_i(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Sc(e,t,n,r,i){return sa(t),n=jo(e,t,n,r,void 0,i),r=Fo(),e!==null&&!uc?(Io(e,t,i),Ic(e,t,i)):(N&&r&&Li(t),t.flags|=1,dc(e,t,n,i),t.child)}function Cc(e,t,n,r,i,a){return sa(t),t.updateQueue=null,n=No(t,r,n,i),Mo(e),r=Fo(),e!==null&&!uc?(Io(e,t,a),Ic(e,t,a)):(N&&r&&Li(t),t.flags|=1,dc(e,t,n,a),t.child)}function wc(e,t,n,r,i){if(sa(t),t.stateNode===null){var a=pi,o=n.contextType;typeof o==`object`&&o&&(a=ca(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Xs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ja(t),o=n.contextType,a.context=typeof o==`object`&&o?ca(o):pi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ys(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Xs.enqueueReplaceState(a,a.state,null),no(t,r,a,i),to(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=$s(n,s);a.props=c;var l=a.context,u=n.contextType;o=pi,typeof u==`object`&&u&&(o=ca(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Qs(t,a,r,o),qa=!1;var f=t.memoizedState;a.state=f,no(t,r,a,i),to(),l=t.memoizedState,s||f!==l||qa?(typeof d==`function`&&(Ys(t,n,d,r),l=t.memoizedState),(c=qa||Zs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ya(e,t),o=t.memoizedProps,u=$s(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=pi,typeof l==`object`&&l&&(c=ca(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Qs(t,a,r,c),qa=!1,f=t.memoizedState,a.state=f,no(t,r,a,i),to();var p=t.memoizedState;o!==d||f!==p||qa||e!==null&&e.dependencies!==null&&oa(e.dependencies)?(typeof s==`function`&&(Ys(t,n,s,r),p=t.memoizedState),(u=qa||Zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&oa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,xc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ga(t,e.child,null,i),t.child=Ga(t,null,n,i)):dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ic(e,t,i),e}function Tc(e,t,n,r){return Yi(),t.flags|=256,dc(e,t,n,r),t.child}var Ec={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dc(e){return{baseLanes:e,cachePool:Oa()}}function Oc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ru),e}function kc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(vo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(N){if(a?po(t):go(t),(e=Vi)?(e=mf(e,Ui),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mi===null?null:{id:Ni,overflow:Pi},retryLane:536870912,hydrationErrors:null},n=Si(e),n.return=t,t.child=n,Bi=t,Vi=null)):e=null,e===null)throw Gi(t);return gf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(go(t),a=t.mode,c=jc({mode:`hidden`,children:c},a),r=bi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Dc(n),r.childLanes=Oc(e,s,n),t.memoizedState=Ec,gc(null,r)):(po(t),Ac(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(po(t),t.flags&=-257,t=Mc(e,t,n)):t.memoizedState===null?(go(t),c=r.fallback,a=t.mode,r=jc({mode:`visible`,children:r.children},a),c=bi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ga(t,e.child,null,n),r=t.child,r.memoizedState=Dc(n),r.childLanes=Oc(e,s,n),t.memoizedState=Ec,t=gc(null,r)):(go(t),t.child=e.child,t.flags|=128,t=null);else if(po(t),gf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Zi({value:r,source:null,stack:null}),t=Mc(e,t,n)}else if(uc||aa(e,t,n,!1),s=(n&e.childLanes)!==0,uc||s){if(s=Jl,s!==null&&(r=lt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ui(e,r),wu(s,e,r),lc;hf(c)||Iu(),t=Mc(e,t,n)}else hf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Vi=vf(c.nextSibling),Bi=t,N=!0,Hi=null,Ui=!1,e!==null&&zi(t,e),t=Ac(t,r.children),t.flags|=4096);return t}return a?(go(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=_i(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=bi(c,a,n,null),c.flags|=2):c=_i(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,gc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Dc(n):(a=c.cachePool,a===null?a=Oa():(l=ma._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Oc(e,s,n),t.memoizedState=Ec,gc(e.child,r)):(po(t),n=e.child,e=n.sibling,n=_i(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Ac(e,t){return t=jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function jc(e,t){return e=hi(22,e,null,t),e.lanes=0,e}function Mc(e,t,n){return Ga(t,e.child,null,n),e=Ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ra(e.return,t,n)}function Pc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Fc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=vo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,A(vo,o),dc(e,t,r,n),r=N?ki:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nc(e,n,t);else if(e.tag===19)Nc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&yo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Pc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&yo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Pc(t,!0,n,null,a,r);break;case`together`:Pc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ic(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(aa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=_i(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_i(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Lc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&oa(e))):!0}function Rc(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),ta(t,ma,e.memoizedState.cache),Yi();break;case 27:case 5:be(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(po(t),e=Ic(e,t,n),e===null?null:e.sibling):kc(e,t,n):(po(t),t.flags|=128,null);po(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(aa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Fc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),A(vo,vo.current),r)break;return null;case 22:return t.lanes=0,hc(e,t,n,t.pendingProps);case 24:ta(t,ma,e.memoizedState.cache)}return Ic(e,t,n)}function zc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)uc=!0;else{if(!Lc(e,n)&&!(t.flags&128))return uc=!1,Rc(e,t,n);uc=!!(e.flags&131072)}else uc=!1,N&&t.flags&1048576&&Ii(t,ki,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Fa(t.elementType),t.type=e,typeof e==`function`)gi(e)?(r=$s(e,r),t.tag=1,t=wc(null,t,e,r,n)):(t.tag=0,t=Sc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=fc(null,t,e,r,n);break a}else if(a===ne){t.tag=14,t=pc(null,t,e,r,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return Sc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=$s(r,t.pendingProps),wc(e,t,r,a,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ya(e,t),no(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ta(t,ma,r),r!==o.cache&&ia(t,[ma],n,!0),to(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Tc(e,t,r,n);break a}else if(r!==a){a=Ti(Error(i(424)),t),Zi(a),t=Tc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Vi=vf(e.firstChild),Bi=t,N=!0,Hi=null,Ui=!0,n=Ka(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Yi(),r===a){t=Ic(e,t,n);break a}dc(e,t,r,n)}t=t.child}return t;case 26:return xc(e,t),e===null?(n=zf(t.type,null,t.pendingProps,null))?t.memoizedState=n:N||(n=t.type,e=t.pendingProps,r=Xd(ge.current).createElement(n),r[ht]=t,r[gt]=e,Wd(r,n,e),Ot(r),t.stateNode=r):t.memoizedState=zf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&N&&(r=t.stateNode=Sf(t.type,t.pendingProps,ge.current),Bi=t,Ui=!0,a=Vi,cf(t.type)?(yf=a,Vi=vf(r.firstChild)):Vi=a),dc(e,t,t.pendingProps.children,n),xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&N&&((a=r=Vi)&&(r=ff(r,t.type,t.pendingProps,Ui),r===null?a=!1:(t.stateNode=r,Bi=t,Vi=vf(r.firstChild),Ui=!1,a=!0)),a||Gi(t)),be(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,$d(a,o)?r=null:s!==null&&$d(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=jo(e,t,Po,null,null,n),cp._currentValue=a),xc(e,t),dc(e,t,r,n),t.child;case 6:return e===null&&N&&((e=n=Vi)&&(n=pf(n,t.pendingProps,Ui),n===null?e=!1:(t.stateNode=n,Bi=t,Vi=null,e=!0)),e||Gi(t)),null;case 13:return kc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ga(t,null,r,n):dc(e,t,r,n),t.child;case 11:return fc(e,t,t.type,t.pendingProps,n);case 7:return dc(e,t,t.pendingProps,n),t.child;case 8:return dc(e,t,t.pendingProps.children,n),t.child;case 12:return dc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ta(t,t.type,r.value),dc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,sa(t),a=ca(a),r=r(a),t.flags|=1,dc(e,t,r,n),t.child;case 14:return pc(e,t,t.type,t.pendingProps,n);case 15:return mc(e,t,t.type,t.pendingProps,n);case 19:return Fc(e,t,n);case 31:return bc(e,t,n);case 22:return hc(e,t,n,t.pendingProps);case 24:return sa(t),r=ca(ma),e===null?(a=Ea(),a===null&&(a=Jl,o=ha(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ja(t),ta(t,ma,a)):((e.lanes&n)!==0&&(Ya(e,t),no(t,null,null,n),to()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ta(t,ma,r),r!==a.cache&&ia(t,[ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ta(t,ma,r))),dc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Bc(e){e.flags|=4}function Vc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Nu())e.flags|=8192;else throw Ia=Ma,Aa}else e.flags&=-16777217}function Hc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ep(t))if(Nu())e.flags|=8192;else throw Ia=Ma,Aa}function Uc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:rt(),e.lanes|=t,iu|=t)}function Wc(e,t){if(!N)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Gc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)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 Kc(e,t,n){var r=t.pendingProps;switch(Ri(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gc(t),null;case 1:return Gc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),na(ma),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ji(t)?Bc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xi())),Gc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Bc(t),o===null?(Gc(t),Vc(t,a,null,r,n)):(Gc(t),Hc(t,o))):o?o===e.memoizedState?(Gc(t),t.flags&=-16777217):(Bc(t),Gc(t),Hc(t,o)):(e=e.memoizedProps,e!==r&&Bc(t),Gc(t),Vc(t,a,e,r,n)),null;case 27:if(xe(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Gc(t),null}e=me.current,Ji(t)?Ki(t,e):(e=Sf(a,r,n),t.stateNode=e,Bc(t))}return Gc(t),null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Gc(t),null}if(o=me.current,Ji(t))Ki(t,o);else{var s=Xd(ge.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ht]=t,o[gt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Wd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Bc(t)}}return Gc(t),Vc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,Ji(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Bi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Vd(e.nodeValue,n)),e||Gi(t,!0)}else e=Xd(e).createTextNode(r),e[ht]=t,t.stateNode=e}return Gc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ji(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ht]=t}else Yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gc(t),e=!1}else n=Xi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(_o(t),t):(_o(t),null);if(t.flags&128)throw Error(i(558))}return Gc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ji(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ht]=t}else Yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gc(t),a=!1}else a=Xi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(_o(t),t):(_o(t),null)}return _o(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Uc(t,t.updateQueue),Gc(t),null);case 4:return ye(),e===null&&jd(t.stateNode.containerInfo),Gc(t),null;case 10:return na(t.type),Gc(t),null;case 19:if(pe(vo),r=t.memoizedState,r===null)return Gc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Wc(r,!1);else{if(H!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=yo(e),o!==null){for(t.flags|=128,Wc(r,!1),e=o.updateQueue,t.updateQueue=e,Uc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vi(n,e),n=n.sibling;return A(vo,vo.current&1|2),N&&Fi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>uu&&(t.flags|=128,a=!0,Wc(r,!1),t.lanes=4194304)}else{if(!a)if(e=yo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Uc(t,e),Wc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!N)return Gc(t),null}else 2*Pe()-r.renderingStartTime>uu&&n!==536870912&&(t.flags|=128,a=!0,Wc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Gc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,n=vo.current,A(vo,a?n&1|2:n&1),N&&Fi(t,r.treeForkCount),e);case 22:case 23:return _o(t),lo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Gc(t),t.subtreeFlags&6&&(t.flags|=8192)):Gc(t),n=t.updateQueue,n!==null&&Uc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&pe(Ta),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),na(ma),Gc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function qc(e,t){switch(Ri(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return na(ma),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(_o(t),t.alternate===null)throw Error(i(340));Yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_o(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(vo),null;case 4:return ye(),null;case 10:return na(t.type),null;case 22:case 23:return _o(t),lo(),e!==null&&pe(Ta),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return na(ma),null;case 25:return null;default:return null}}function Jc(e,t){switch(Ri(t),t.tag){case 3:na(ma),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&_o(t);break;case 13:_o(t);break;case 19:pe(vo);break;case 10:na(t.type);break;case 22:case 23:_o(t),lo(),e!==null&&pe(Ta);break;case 24:na(ma)}}function Yc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){U(t,t.return,e)}}function Xc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){U(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){U(t,t.return,e)}}function Zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{io(t,n)}catch(t){U(e,e.return,t)}}}function Qc(e,t,n){n.props=$s(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){U(e,t,n)}}function $c(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){U(e,t,n)}}function el(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){U(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){U(e,t,n)}else n.current=null}function tl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){U(e,e.return,t)}}function nl(e,t,n){try{var r=e.stateNode;Gd(r,e.type,n,t),r[gt]=t}catch(t){U(e,e.return,t)}}function rl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&cf(e.type)||e.tag===4}function il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||rl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&cf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function al(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ln));else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ol(e,t,n),e=e.sibling;e!==null;)ol(e,t,n),e=e.sibling}function sl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Wd(t,r,n),t[ht]=e,t[gt]=n}catch(t){U(e,e.return,t)}}var cl=!1,ll=!1,ul=!1,dl=typeof WeakSet==`function`?WeakSet:Set,fl=null;function pl(e,t){if(e=e.containerInfo,Jd=_p,e=Pr(e),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Yd={focusedElem:e,selectionRange:n},_p=!1,fl=t;fl!==null;)if(t=fl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,fl=e;else for(;fl!==null;){switch(t=fl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=$s(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){U(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)df(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:df(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,fl=e;break}fl=t.return}}function ml(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:kl(e,n),r&4&&Yc(5,n);break;case 1:if(kl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){U(n,n.return,e)}else{var i=$s(n.type,t.memoizedProps);t=t.memoizedState;
vendor: 4,306 bytes, line 9
9try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){U(n,n.return,e)}}r&64&&Zc(n),r&512&&$c(n,n.return);break;case 3:if(kl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{io(e,t)}catch(e){U(n,n.return,e)}}break;case 27:t===null&&r&4&&sl(n);case 26:case 5:kl(e,n),t===null&&r&4&&tl(n),r&512&&$c(n,n.return);break;case 12:kl(e,n);break;case 31:kl(e,n),r&4&&bl(e,n);break;case 13:kl(e,n),r&4&&xl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=rd.bind(null,n),_f(e,n))));break;case 22:if(r=n.memoizedState!==null||cl,!r){t=t!==null&&t.memoizedState!==null||ll,i=cl;var a=ll;cl=r,(ll=t)&&!a?jl(e,n,(n.subtreeFlags&8772)!=0):kl(e,n),cl=i,ll=a}break;case 30:break;default:kl(e,n)}}function hl(e){var t=e.alternate;t!==null&&(e.alternate=null,hl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ct(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gl=null,_l=!1;function vl(e,t,n){for(n=n.child;n!==null;)yl(e,t,n),n=n.sibling}function yl(e,t,n){if(We&&typeof We.onCommitFiberUnmount==`function`)try{We.onCommitFiberUnmount(Ue,n)}catch{}switch(n.tag){case 26:ll||el(n,t),vl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ll||el(n,t);var r=gl,i=_l;cf(n.type)&&(gl=n.stateNode,_l=!1),vl(e,t,n),Cf(n.stateNode),gl=r,_l=i;break;case 5:ll||el(n,t);case 6:if(r=gl,i=_l,gl=null,vl(e,t,n),gl=r,_l=i,gl!==null)if(_l)try{(gl.nodeType===9?gl.body:gl.nodeName===`HTML`?gl.ownerDocument.body:gl).removeChild(n.stateNode)}catch(e){U(n,t,e)}else try{gl.removeChild(n.stateNode)}catch(e){U(n,t,e)}break;case 18:gl!==null&&(_l?(e=gl,lf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Up(e)):lf(gl,n.stateNode));break;case 4:r=gl,i=_l,gl=n.stateNode.containerInfo,_l=!0,vl(e,t,n),gl=r,_l=i;break;case 0:case 11:case 14:case 15:Xc(2,n,t),ll||Xc(4,n,t),vl(e,t,n);break;case 1:ll||(el(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Qc(n,t,r)),vl(e,t,n);break;case 21:vl(e,t,n);break;case 22:ll=(r=ll)||n.memoizedState!==null,vl(e,t,n),ll=r;break;default:vl(e,t,n)}}function bl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Up(e)}catch(e){U(t,t.return,e)}}}function xl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Up(e)}catch(e){U(t,t.return,e)}}function Sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dl),t;default:throw Error(i(435,e.tag))}}function Cl(e,t){var n=Sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=id.bind(null,e,t);t.then(r,r)}})}function wl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(cf(c.type)){gl=c.stateNode,_l=!1;break a}break;case 5:gl=c.stateNode,_l=!1;break a;case 3:case 4:gl=c.stateNode.containerInfo,_l=!0;break a}c=c.return}if(gl===null)throw Error(i(160));yl(o,s,a),gl=null,_l=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)El(t,e),t=t.sibling}var Tl=null;function El(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wl(t,e),Dl(e),r&4&&(Xc(3,e,e.return),Yc(3,e),Xc(5,e,e.return));break;case 1:wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),r&64&&cl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Tl;if(wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[St]||o[ht]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head >
9 title`))),Wd(o,r,n),o[ht]=e,Ot(o),r=o;break a;case`link`:var s=Zf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Wd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Zf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Wd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ht]=e,Ot(o),r=o}e.stateNode=r}else Qf(a,e.type,e.stateNode);else e.stateNode=Kf(a,r,e.memoizedProps);
vendor: 65,871 bytes, lines 9-10
9else o===r?r===null&&e.stateNode!==null&&nl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Qf(a,e.type,e.stateNode):Kf(a,r,e.memoizedProps))}break;case 27:wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),n!==null&&r&4&&nl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),e.flags&32){a=e.stateNode;try{en(a,``)}catch(t){U(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,nl(e,a,n===null?a:n.memoizedProps)),r&1024&&(ul=!0);break;case 6:if(wl(t,e),Dl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){U(e,e.return,t)}}break;case 3:if(Xf=null,a=Tl,Tl=Ef(t.containerInfo),wl(t,e),Tl=a,Dl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Up(t.containerInfo)}catch(t){U(e,e.return,t)}ul&&(ul=!1,Ol(e));break;case 4:r=Tl,Tl=Ef(e.stateNode.containerInfo),wl(t,e),Dl(e),Tl=r;break;case 12:wl(t,e),Dl(e);break;case 31:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 13:wl(t,e),Dl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(cu=Pe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=cl,d=ll;if(cl=u||a,ll=d||l,wl(t,e),ll=d,cl=u,Dl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||cl||ll||Al(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){U(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){U(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?uf(m,!0):uf(l.stateNode,!1)}catch(e){U(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Cl(e,n))));break;case 19:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 30:break;case 21:break;default:wl(t,e),Dl(e)}}function Dl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(rl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;ol(e,il(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(en(o,``),n.flags&=-33),ol(e,il(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;al(e,il(e),s);break;default:throw Error(i(161))}}catch(t){U(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ol(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ol(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function kl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ml(e,t.alternate,t),t=t.sibling}function Al(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xc(4,t,t.return),Al(t);break;case 1:el(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Qc(t,t.return,n),Al(t);break;case 27:Cf(t.stateNode);case 26:case 5:el(t,t.return),Al(t);break;case 22:t.memoizedState===null&&Al(t);break;case 30:Al(t);break;default:Al(t)}e=e.sibling}}function jl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:jl(i,a,n),Yc(4,a);break;case 1:if(jl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){U(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)ro(c[i],s)}catch(e){U(r,r.return,e)}}n&&o&64&&Zc(a),$c(a,a.return);break;case 27:sl(a);case 26:case 5:jl(i,a,n),n&&r===null&&o&4&&tl(a),$c(a,a.return);break;case 12:jl(i,a,n);break;case 31:jl(i,a,n),n&&o&4&&bl(i,a);break;case 13:jl(i,a,n),n&&o&4&&xl(i,a);break;case 22:a.memoizedState===null&&jl(i,a,n),$c(a,a.return);break;case 30:break;default:jl(i,a,n)}t=t.sibling}}function Ml(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ga(n))}function Nl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e))}function Pl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fl(e,t,n,r),t=t.sibling}function Fl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Pl(e,t,n,r),i&2048&&Yc(9,t);break;case 1:Pl(e,t,n,r);break;case 3:Pl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e)));break;case 12:if(i&2048){Pl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){U(t,t.return,e)}}else Pl(e,t,n,r);break;case 31:Pl(e,t,n,r);break;case 13:Pl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Pl(e,t,n,r):(a._visibility|=2,Il(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Pl(e,t,n,r):Ll(e,t),i&2048&&Ml(o,t);break;case 24:Pl(e,t,n,r),i&2048&&Nl(t.alternate,t);break;default:Pl(e,t,n,r)}}function Il(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Il(a,o,s,c,i),Yc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Il(a,o,s,c,i)):u._visibility&2?Il(a,o,s,c,i):Ll(a,o),i&&l&2048&&Ml(o.alternate,o);break;case 24:Il(a,o,s,c,i),i&&l&2048&&Nl(o.alternate,o);break;default:Il(a,o,s,c,i)}t=t.sibling}}function Ll(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ll(n,r),i&2048&&Ml(r.alternate,r);break;case 24:Ll(n,r),i&2048&&Nl(r.alternate,r);break;default:Ll(n,r)}t=t.sibling}}var Rl=8192;function zl(e,t,n){if(e.subtreeFlags&Rl)for(e=e.child;e!==null;)Bl(e,t,n),e=e.sibling}function Bl(e,t,n){switch(e.tag){case 26:zl(e,t,n),e.flags&Rl&&e.memoizedState!==null&&tp(n,Tl,e.memoizedState,e.memoizedProps);break;case 5:zl(e,t,n);break;case 3:case 4:var r=Tl;Tl=Ef(e.stateNode.containerInfo),zl(e,t,n),Tl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Rl,Rl=16777216,zl(e,t,n),Rl=r):zl(e,t,n));break;default:zl(e,t,n)}}function Vl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ul(e),e=e.sibling}function Ul(e){switch(e.tag){case 0:case 11:case 15:Hl(e),e.flags&2048&&Xc(9,e,e.return);break;case 3:Hl(e);break;case 12:Hl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wl(e)):Hl(e);break;default:Hl(e)}}function Wl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xc(8,t,t.return),Wl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wl(t));break;default:Wl(t)}e=e.sibling}}function Gl(e,t){for(;fl!==null;){var n=fl;switch(n.tag){case 0:case 11:case 15:Xc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ga(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fl=r;else a:for(n=e;fl!==null;){r=fl;var i=r.sibling,a=r.return;if(hl(r),r===n){fl=null;break a}if(i!==null){i.return=a,fl=i;break a}fl=a}}}var Kl={getCacheForType:function(e){var t=ca(ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ca(ma).controller.signal}},ql=typeof WeakMap==`function`?WeakMap:Map,R=0,Jl=null,z=null,B=0,V=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,H=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=null,ou=null,su=!1,cu=0,lu=0,uu=1/0,du=null,fu=null,pu=0,mu=null,hu=null,gu=0,_u=0,vu=null,yu=null,bu=0,xu=null;function Su(){return R&2&&B!==0?B&-B:D.T===null?ft():bd()}function Cu(){if(ru===0)if(!(B&536870912)||N){var e=Ze;Ze<<=1,!(Ze&3932160)&&(Ze=262144),ru=e}else ru=536870912;return e=uo.current,e!==null&&(e.flags|=32),ru}function wu(e,t,n){(e===Jl&&(V===2||V===9)||e.cancelPendingCommit!==null)&&(ju(e,0),Ou(e,B,ru,!1)),at(e,n),(!(R&2)||e!==Jl)&&(e===Jl&&(!(R&2)&&(tu|=n),H===4&&Ou(e,B,ru,!1)),fd(e))}function Tu(e,t,n){if(R&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||tt(e,t),a=r?zu(e,t):Lu(e,t,!0),o=r;do{if(a===0){Zl&&!r&&Ou(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Du(n)){a=Lu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=au;var l=c.current.memoizedState.isDehydrated;if(l&&(ju(c,s).flags|=256),s=Lu(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,tu|=o,a=4;break a}o=ou,ou=a,o!==null&&(ou===null?ou=o:ou.push.apply(ou,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ju(e,0),Ou(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Ou(r,t,ru,!Xl);break a;case 2:ou=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=cu+300-Pe(),10<a)){if(Ou(r,t,ru,!Xl),et(r,0,!0)!==0)break a;gu=t,r.timeoutHandle=nf(Eu.bind(null,r,n,ou,du,su,t,ru,tu,iu,Xl,o,`Throttled`,-0,0),a);break a}Eu(r,n,ou,du,su,t,ru,tu,iu,Xl,o,null,-0,0)}}break}while(1);fd(e)}function Eu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ln},Bl(t,a,d);var m=(a&62914560)===a?cu-Pe():(a&4194048)===a?lu-Pe():0;if(m=rp(d,m),m!==null){gu=a,e.cancelPendingCommit=m(Ku.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Ou(e,a,o,!l);return}}Ku(e,t,a,n,r,i,o,s,c)}function Du(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!kr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ou(e,t,n,r){t&=~nu,t&=~tu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ke(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&st(e,n,t)}function ku(){return R&6?!0:(pd(0,!1),!1)}function Au(){if(z!==null){if(V===0)var e=z.return;else e=z,ea=$i=null,Lo(e),za=null,Ba=0,e=z;for(;e!==null;)Jc(e.alternate,e),e=e.return;z=null}}function ju(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,rf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gu=0,Au(),Jl=e,z=n=_i(e.current,null),B=t,V=0,Yl=null,Xl=!1,Zl=tt(e,t),Ql=!1,iu=ru=nu=tu=eu=H=0,ou=au=null,su=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ke(r),a=1<<i;t|=e[i],r&=~a}return $l=t,si(),n}function Mu(e,t){F=null,D.H=Gs,t===ka||t===ja?(t=La(),V=3):t===Aa?(t=La(),V=4):V=t===lc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,z===null&&(H=1,rc(e,Ti(t,e.current)))}function Nu(){var e=uo.current;return e===null?!0:(B&4194048)===B?fo===null:(B&62914560)===B||B&536870912?e===fo:!1}function Pu(){var e=D.H;return D.H=Gs,e===null?Gs:e}function Fu(){var e=D.A;return D.A=Kl,e}function Iu(){H=4,Xl||(B&4194048)!==B&&uo.current!==null||(Zl=!0),!(eu&134217727)&&!(tu&134217727)||Jl===null||Ou(Jl,B,ru,!1)}function Lu(e,t,n){var r=R;R|=2;var i=Pu(),a=Fu();(Jl!==e||B!==t)&&(du=null,ju(e,t)),t=!1;var o=H;a:do try{if(V!==0&&z!==null){var s=z,c=Yl;switch(V){case 8:Au(),o=6;break a;case 3:case 2:case 9:case 6:uo.current===null&&(t=!0);var l=V;if(V=0,Yl=null,Uu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=V,V=0,Yl=null,Uu(e,s,c,l)}}Ru(),o=H;break}catch(t){Mu(e,t)}while(1);return t&&e.shellSuspendCounter++,ea=$i=null,R=r,D.H=i,D.A=a,z===null&&(Jl=null,B=0,si()),o}function Ru(){for(;z!==null;)Vu(z)}function zu(e,t){var n=R;R|=2;var r=Pu(),a=Fu();Jl!==e||B!==t?(du=null,uu=Pe()+500,ju(e,t)):Zl=tt(e,t);a:do try{if(V!==0&&z!==null){t=z;var o=Yl;b:switch(V){case 1:V=0,Yl=null,Uu(e,t,o,1);break;case 2:case 9:if(Na(o)){V=0,Yl=null,Hu(t);break}t=function(){V!==2&&V!==9||Jl!==e||(V=7),fd(e)},o.then(t,t);break a;case 3:V=7;break a;case 4:V=5;break a;case 7:Na(o)?(V=0,Yl=null,Hu(t)):(V=0,Yl=null,Uu(e,t,o,7));break;case 5:var s=null;switch(z.tag){case 26:s=z.memoizedState;case 5:case 27:var c=z;if(s?ep(s):c.stateNode.complete){V=0,Yl=null;var l=c.sibling;if(l!==null)z=l;else{var u=c.return;u===null?z=null:(z=u,Wu(u))}break b}}V=0,Yl=null,Uu(e,t,o,5);break;case 6:V=0,Yl=null,Uu(e,t,o,6);break;case 8:Au(),H=6;break a;default:throw Error(i(462))}}Bu();break}catch(t){Mu(e,t)}while(1);return ea=$i=null,D.H=r,D.A=a,R=n,z===null?(Jl=null,B=0,si(),H):0}function Bu(){for(;z!==null&&!Me();)Vu(z)}function Vu(e){var t=zc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Wu(e):z=t}function Hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Cc(n,t,t.pendingProps,t.type,void 0,B);break;case 11:t=Cc(n,t,t.pendingProps,t.type.render,t.ref,B);break;case 5:Lo(t);default:Jc(n,t),t=z=vi(t,$l),t=zc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Wu(e):z=t}function Uu(e,t,n,r){ea=$i=null,Lo(t),za=null,Ba=0;var i=t.return;try{if(cc(e,i,t,n,B)){H=1,rc(e,Ti(n,e.current)),z=null;return}}catch(t){if(i!==null)throw z=i,t;H=1,rc(e,Ti(n,e.current)),z=null;return}t.flags&32768?(N||r===1?e=!0:Zl||B&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=uo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gu(t,e)):Wu(t)}function Wu(e){var t=e;do{if(t.flags&32768){Gu(t,Xl);return}e=t.return;var n=Kc(t.alternate,t,$l);if(n!==null){z=n;return}if(t=t.sibling,t!==null){z=t;return}z=t=e}while(t!==null);H===0&&(H=5)}function Gu(e,t){do{var n=qc(e.alternate,e);if(n!==null){n.flags&=32767,z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){z=e;return}z=e=n}while(e!==null);H=6,z=null}function Ku(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Zu();while(pu!==0);if(R&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=oi,ot(e,n,o,s,c,l),e===Jl&&(z=Jl=null,B=0),hu=t,mu=e,gu=n,_u=o,vu=a,yu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ad(Re,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=D.T,D.T=null,a=O.p,O.p=2,s=R,R|=4;try{pl(e,t,n)}finally{R=s,O.p=a,D.T=r}}pu=1,qu(),Ju(),Yu()}}function qu(){if(pu===1){pu=0;var e=mu,t=hu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=R;R|=4;try{El(t,e);var a=Yd,o=Pr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Nr(s.ownerDocument.documentElement,s)){if(c!==null&&Fr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}_p=!!Jd,Yd=Jd=null}finally{R=i,O.p=r,D.T=n}}e.current=t,pu=2}}function Ju(){if(pu===2){pu=0;var e=mu,t=hu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=R;R|=4;try{ml(e,t.alternate,t)}finally{R=i,O.p=r,D.T=n}}pu=3}}function Yu(){if(pu===4||pu===3){pu=0,Ne();var e=mu,t=hu,n=gu,r=yu;t.subtreeFlags&10256||t.flags&10256?pu=5:(pu=0,hu=mu=null,Xu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(fu=null),dt(n),t=t.stateNode,We&&typeof We.onCommitFiberRoot==`function`)try{We.onCommitFiberRoot(Ue,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=D.T,i=O.p,O.p=2,D.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{D.T=t,O.p=i}}gu&3&&Zu(),fd(e),i=e.pendingLanes,n&261930&&i&42?e===xu?bu++:(bu=0,xu=e):bu=0,pd(0,!1)}}function Xu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ga(t)))}function Zu(){return qu(),Ju(),Yu(),Qu()}function Qu(){if(pu!==5)return!1;var e=mu,t=_u;_u=0;var n=dt(gu),r=D.T,a=O.p;try{O.p=32>n?32:n,D.T=null,n=vu,vu=null;var o=mu,s=gu;if(pu=0,hu=mu=null,gu=0,R&6)throw Error(i(331));var c=R;if(R|=4,Ul(o.current),Fl(o,o.current,s,n),R=c,pd(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{O.p=a,D.T=r,Xu(e,t)}}function $u(e,t,n){t=Ti(n,t),t=ac(e.stateNode,t,2),e=Za(e,t,2),e!==null&&(at(e,2),fd(e))}function U(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fu===null||!fu.has(r))){e=Ti(n,e),n=oc(2),r=Za(t,n,2),r!==null&&(sc(n,r,t,e),at(r,2),fd(r));break}}t=t.return}}function ed(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ql;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ql=!0,i.add(n),e=td.bind(null,e,t,n),t.then(e,e))}function td(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Jl===e&&(B&n)===n&&(H===4||H===3&&(B&62914560)===B&&300>Pe()-cu?!(R&2)&&ju(e,0):nu|=n,iu===B&&(iu=0)),fd(e)}function nd(e,t){t===0&&(t=rt()),e=ui(e,t),e!==null&&(at(e,t),fd(e))}function rd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nd(e,n)}function id(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),nd(e,n)}function ad(e,t){return Ae(e,t)}var od=null,sd=null,cd=!1,ld=!1,ud=!1,dd=0;function fd(e){e!==sd&&e.next===null&&(sd===null?od=sd=e:sd=sd.next=e),ld=!0,cd||(cd=!0,yd())}function pd(e,t){if(!ud&&ld){ud=!0;do for(var n=!1,r=od;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,vd(r,a))}else a=B,a=et(r,r===Jl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,vd(r,a));r=r.next}while(n);ud=!1}}function md(){hd()}function hd(){ld=cd=!1;var e=0;dd!==0&&tf()&&(e=dd);for(var t=Pe(),n=null,r=od;r!==null;){var i=r.next,a=gd(r,t);a===0?(r.next=null,n===null?od=i:n.next=i,i===null&&(sd=n)):(n=r,(e!==0||a&3)&&(ld=!0)),r=i}pu!==0&&pu!==5||pd(e,!1),dd!==0&&(dd=0)}function gd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ke(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=nt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Jl,n=B,n=et(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(V===2||V===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&je(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&je(r),dt(n)){case 2:case 8:n=Le;break;case 32:n=Re;break;case 268435456:n=Be;break;default:n=Re}return r=_d.bind(null,e),n=Ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&je(r),e.callbackPriority=2,e.callbackNode=null,2}function _d(e,t){if(pu!==0&&pu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zu()&&e.callbackNode!==n)return null;var r=B;return r=et(e,e===Jl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Tu(e,r,t),gd(e,Pe()),e.callbackNode!=null&&e.callbackNode===n?_d.bind(null,e):null)}function vd(e,t){if(Zu())return null;Tu(e,t,!0)}function yd(){of(function(){R&6?Ae(Ie,md):hd()})}function bd(){if(dd===0){var e=ya;e===0&&(e=Xe,Xe<<=1,!(Xe&261888)&&(Xe=256)),dd=e}return dd}function xd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:cn(``+e)}function Sd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Cd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=xd((i[gt]||null).action),o=r.submitter;o&&(t=(t=o[gt]||null)?xd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new An(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(dd!==0){var e=o?Sd(i,o):new FormData(i);js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Sd(i,o):new FormData(i),js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var wd=0;wd<ti.length;wd++){var Td=ti[wd];ni(Td.toLowerCase(),`on`+(Td[0].toUpperCase()+Td.slice(1)))}ni(qr,`onAnimationEnd`),ni(Jr,`onAnimationIteration`),ni(Yr,`onAnimationStart`),ni(`dblclick`,`onDoubleClick`),ni(`focusin`,`onFocus`),ni(`focusout`,`onBlur`),ni(Xr,`onTransitionRun`),ni(Zr,`onTransitionStart`),ni(Qr,`onTransitionCancel`),ni($r,`onTransitionEnd`),Mt(`onMouseEnter`,[`mouseout`,`mouseover`]),Mt(`onMouseLeave`,[`mouseout`,`mouseover`]),Mt(`onPointerEnter`,[`pointerout`,`pointerover`]),Mt(`onPointerLeave`,[`pointerout`,`pointerover`]),jt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),jt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),jt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),jt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),jt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),jt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ed=`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(` `),Dd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ed));function Od(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ri(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ri(e)}i.currentTarget=null,a=c}}}}function W(e,t){var n=t[vt];n===void 0&&(n=t[vt]=new Set);var r=e+`__bubble`;n.has(r)||(Md(t,e,2,!1),n.add(r))}function kd(e,t,n){var r=0;t&&(r|=4),Md(n,e,r,t)}var Ad=`_reactListening`+Math.random().toString(36).slice(2);function jd(e){if(!e[Ad]){e[Ad]=!0,kt.forEach(function(t){t!==`selectionchange`&&(Dd.has(t)||kd(t,!1,e),kd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ad]||(t[Ad]=!0,kd(`selectionchange`,!1,t))}}function Md(e,t,n,r){switch(wp(t)){case 2:var i=vp;break;case 8:i=yp;break;default:i=bp}n=i.bind(null,t,n,e),i=void 0,!yn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Nd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=wt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}gn(function(){var r=a,i=dn(n),s=[];a:{var c=ei.get(e);if(c!==void 0){var l=An,u=e;switch(e){case`keypress`:if(Tn(n)===0)break a;case`keydown`:case`keyup`:l=Jn;break;case`focusin`:u=`focus`,l=zn;break;case`focusout`:u=`blur`,l=zn;break;case`beforeblur`:case`afterblur`:l=zn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Ln;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Rn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Xn;break;case qr:case Jr:case Yr:l=Bn;break;case $r:l=Zn;break;case`scroll`:case`scrollend`:l=Mn;break;case`wheel`:l=Qn;break;case`copy`:case`cut`:case`paste`:l=Vn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Yn;break;case`toggle`:case`beforetoggle`:l=$n}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=_n(m,p),g!=null&&d.push(Pd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==un&&(u=n.relatedTarget||n.fromElement)&&(wt(u)||u[_t]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?wt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Ln,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Yn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Et(l),h=u==null?c:Et(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,wt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Id,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ld(s,c,l,d,!1),u!==null&&f!==null&&Ld(s,f,u,d,!0)}}a:{if(c=r?Et(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=_r;else if(dr(c))if(vr)v=Dr;else{v=Tr;var y=wr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&an(r.elementType)&&(v=_r):v=Er;if(v&&=v(e,r)){fr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Xt(c,`number`,c.value)}switch(y=r?Et(r):window,e){case`focusin`:(dr(y)||y.contentEditable===`true`)&&(Lr=y,Rr=r,zr=null);break;case`focusout`:zr=Rr=Lr=null;break;case`mousedown`:Br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Br=!1,Vr(s,n,i);break;case`selectionchange`:if(Ir)break;case`keydown`:case`keyup`:Vr(s,n,i)}var b;if(tr)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else cr?or(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(ir&&n.locale!==`ko`&&(cr||x!==`onCompositionStart`?x===`onCompositionEnd`&&cr&&(b=wn()):(xn=i,Sn=`value`in xn?xn.value:xn.textContent,cr=!0)),y=Fd(r,x),0<y.length&&(x=new Hn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=sr(n),b!==null&&(x.data=b)))),(b=rr?M(e,n):lr(e,n))&&(x=Fd(r,`onBeforeInput`),0<x.length&&(y=new Hn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Cd(s,e,r,n,i)}Od(s,t)})}function Pd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=_n(e,n),i!=null&&r.unshift(Pd(e,i,a)),i=_n(e,t),i!=null&&r.push(Pd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Id(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ld(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=_n(n,a),l!=null&&o.unshift(Pd(n,l,c))):i||(l=_n(n,a),l!=null&&o.push(Pd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Rd=/\r\n?/g,zd=/\u0000|\uFFFD/g;function Bd(e){return(typeof e==`string`?e:``+e).replace(Rd,`
10`).replace(zd,``)}function Vd(e,t){return t=Bd(t),Bd(e)===t}function Hd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||en(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&en(e,``+r);break;case`className`:Rt(e,`class`,r);break;case`tabIndex`:Rt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Rt(e,n,r);break;case`style`:rn(e,r,o);break;case`data`:if(t!==`object`){Rt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Hd(e,t,`name`,a.name,a,null),Hd(e,t,`formEncType`,a.formEncType,a,null),Hd(e,t,`formMethod`,a.formMethod,a,null),Hd(e,t,`formTarget`,a.formTarget,a,null)):(Hd(e,t,`encType`,a.encType,a,null),Hd(e,t,`method`,a.method,a,null),Hd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`onScroll`:r!=null&&W(`scroll`,e);break;case`onScrollEnd`:r!=null&&W(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=cn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:W(`beforetoggle`,e),W(`toggle`,e),Lt(e,`popover`,r);break;case`xlinkActuate`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Lt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=on.get(n)||n,Lt(e,n,r))}}function Ud(e,t,n,r,a,o){switch(n){case`style`:rn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?en(e,r):(typeof r==`number`||typeof r==`bigint`)&&en(e,``+r);break;case`onScroll`:r!=null&&W(`scroll`,e);break;case`onScrollEnd`:r!=null&&W(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!At.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[gt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Lt(e,n,r)}}}function Wd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:W(`error`,e),W(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Hd(e,t,o,s,n,null)}}a&&Hd(e,t,`srcSet`,n.srcSet,n,null),r&&Hd(e,t,`src`,n.src,n,null);return;case`input`:W(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Hd(e,t,r,d,n,null)}}Yt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in W(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Hd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Zt(e,!!r,n,!0):Zt(e,!!r,t,!1);return;case`textarea`:for(s in W(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Hd(e,t,s,c,n,null)}$t(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Hd(e,t,l,r,n,null)}return;case`dialog`:W(`beforetoggle`,e),W(`toggle`,e),W(`cancel`,e),W(`close`,e);break;case`iframe`:case`object`:W(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ed.length;r++)W(Ed[r],e);break;case`image`:W(`error`,e),W(`load`,e);break;case`details`:W(`toggle`,e);break;case`embed`:case`source`:case`link`:W(`error`,e),W(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Hd(e,t,u,r,n,null)}return;default:if(an(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ud(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Hd(e,t,c,r,n,null))}function Gd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Hd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Hd(e,t,p,m,r,f)}}Jt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Hd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Hd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Zt(e,!!n,n?[]:``,!1):Zt(e,!!n,t,!0)):Zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Hd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Hd(e,t,s,a,r,o)}Qt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Hd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Hd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Hd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Hd(e,t,u,p,r,m)}return;default:if(an(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ud(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Ud(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Hd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Hd(e,t,f,p,r,m)}function Kd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function qd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Kd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Kd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Jd=null,Yd=null;function Xd(e){return e.nodeType===9?e:e.ownerDocument}function Zd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function $d(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ef=null;function tf(){var e=window.event;return e&&e.type===`popstate`?e===ef?!1:(ef=e,!0):(ef=null,!1)}var nf=typeof setTimeout==`function`?setTimeout:void 0,rf=typeof clearTimeout==`function`?clearTimeout:void 0,af=typeof Promise==`function`?Promise:void 0,of=typeof queueMicrotask==`function`?queueMicrotask:af===void 0?nf:function(e){return af.resolve(null).then(e).catch(sf)};function sf(e){setTimeout(function(){throw e})}function cf(e){return e===`head`}function lf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Up(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[St]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cf(e.ownerDocument.body);n=i}while(n);Up(t)}function uf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function df(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:df(n),Ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function ff(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[St])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=vf(e.nextSibling),e===null)break}return null}function pf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vf(e.nextSibling),e===null))return null;return e}function mf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vf(e.nextSibling),e===null))return null;return e}function hf(e){return e.data===`$?`||e.data===`$~`}function gf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _f(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function vf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var yf=null;function bf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Sf(e,t,n){switch(t=Xd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Cf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ct(e)}var wf=new Map,Tf=new Set;function Ef(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Df=O.d;O.d={f:Of,r:kf,D:Mf,C:Nf,L:Pf,m:Ff,X:Lf,S:If,M:Rf};function Of(){var e=Df.f(),t=ku();return e||t}function kf(e){var t=Tt(e);t!==null&&t.tag===5&&t.type===`form`?Ns(t):Df.r(e)}var Af=typeof document>`u`?null:document;function jf(e,t,n){var r=Af;if(r&&typeof t==`string`&&t){var i=qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tf.has(i)||(Tf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Wd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Mf(e){Df.D(e),jf(`dns-prefetch`,e,null)}function Nf(e,t){Df.C(e,t),jf(`preconnect`,e,t)}function Pf(e,t,n){Df.L(e,t,n);var r=Af;if(r&&e&&t){var i=`link[rel="preload"][as="`+qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+qt(n.imageSizes)+`"]`)):i+=`[href="`+qt(e)+`"]`;var a=i;switch(t){case`style`:a=Bf(e);break;case`script`:a=Wf(e)}wf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vf(a))||t===`script`&&r.querySelector(Gf(a))||(t=r.createElement(`link`),Wd(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Ff(e,t){Df.m(e,t);var n=Af;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+qt(r)+`"][href="`+qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wf(e)}if(!wf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),wf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gf(a)))return}r=n.createElement(`link`),Wd(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function If(e,t,n){Df.S(e,t,n);var r=Af;if(r&&e){var i=Dt(r).hoistableStyles,a=Bf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wf.get(a))&&Jf(e,n);var c=o=r.createElement(`link`);Ot(c),Wd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lf(e,t){Df.X(e,t);var n=Af;if(n&&e){var r=Dt(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=m({src:e,async:!0},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),Ot(a),Wd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t){Df.M(e,t);var n=Af;if(n&&e){var r=Dt(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),Ot(a),Wd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t,n,r){var a=(a=ge.current)?Ef(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Bf(n.href),n=Dt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bf(n.href);var o=Dt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),wf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wf.set(e,n),o||Uf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Wf(n),n=Dt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bf(e){return`href="`+qt(e)+`"`}function Vf(e){return`link[rel="stylesheet"][`+e+`]`}function Hf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Uf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Wd(t,`link`,n),Ot(t),e.head.appendChild(t))}function Wf(e){return`[src="`+qt(e)+`"]`}function Gf(e){return`script[async]`+e}function Kf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+qt(n.href)+`"]`);if(r)return t.instance=r,Ot(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ot(r),Wd(r,`style`,a),qf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bf(n.href);var o=e.querySelector(Vf(a));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Hf(n),(a=wf.get(a))&&Jf(r,a),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Wd(o,`link`,r),t.state.loading|=4,qf(o,n.precedence,e),t.instance=o;case`script`:return o=Wf(n.src),(a=e.querySelector(Gf(o)))?(t.instance=a,Ot(a),a):(r=n,(a=wf.get(o))&&(r=m({},n),Yf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ot(a),Wd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qf(r,n.precedence,e));return t.instance}function qf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Yf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xf=null;function Zf(e,t,n){if(Xf===null){var r=new Map,i=Xf=new Map;i.set(n,r)}else i=Xf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[St]||a[ht]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $f(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ep(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function tp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bf(r.href),a=t.querySelector(Vf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ip.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Hf(r),(i=wf.get(i))&&Jf(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Wd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ip.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var np=0;function rp(e,t){return e.stylesheets&&e.count===0&&op(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&op(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&np===0&&(np=62500*qd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&op(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>np?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ip(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)op(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ap=null;function op(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ap=new Map,t.forEach(sp,e),ap=null,ip.call(e))}function sp(e,t){if(!(t.state.loading&4)){var n=ap.get(e);if(n)var r=n.get(null);else{n=new Map,ap.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ip.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var cp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function lp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=it(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=it(0),this.hiddenUpdates=it(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function up(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=hi(3,null,null,t),e.current=a,a.stateNode=e,t=ha(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ja(a),e}function dp(e){return e?(e=pi,e):pi}function fp(e,t,n,r,i,a){i=dp(i),r.context===null?r.context=i:r.pendingContext=i,r=Xa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Za(e,r,t),n!==null&&(wu(n,e,t),Qa(n,e,t))}function pp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mp(e,t){pp(e,t),(e=e.alternate)&&pp(e,t)}function hp(e){if(e.tag===13||e.tag===31){var t=ui(e,67108864);t!==null&&wu(t,e,67108864),mp(e,67108864)}}function gp(e){if(e.tag===13||e.tag===31){var t=Su();t=ut(t);var n=ui(e,t);n!==null&&wu(n,e,t),mp(e,t)}}var _p=!0;function vp(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=2,bp(e,t,n,r)}finally{O.p=a,D.T=i}}function yp(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=8,bp(e,t,n,r)}finally{O.p=a,D.T=i}}function bp(e,t,n,r){if(_p){var i=xp(r);if(i===null)Nd(e,t,r,Sp,n),Np(e,r);else if(Fp(i,e,t,n,r))r.stopPropagation();else if(Np(e,r),t&4&&-1<Mp.indexOf(e)){for(;i!==null;){var a=Tt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$e(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ke(o);s.entanglements[1]|=c,o&=~c}fd(a),!(R&6)&&(uu=Pe()+500,pd(0,!1))}}break;case 31:case 13:s=ui(a,2),s!==null&&wu(s,a,2),ku(),mp(a,2)}if(a=xp(r),a===null&&Nd(e,t,r,Sp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Nd(e,t,r,null,n)}}function xp(e){return e=dn(e),Cp(e)}var Sp=null;function Cp(e){if(Sp=null,e=wt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Sp=e,null}function wp(e){switch(e){case`beforetoggle`: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`toggle`: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 2;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`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Fe()){case Ie:return 2;case Le:return 8;case Re:case ze:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Tp=!1,Ep=null,Dp=null,Op=null,kp=new Map,Ap=new Map,jp=[],Mp=`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`.split(` `);function Np(e,t){switch(e){case`focusin`:case`focusout`:Ep=null;break;case`dragenter`:case`dragleave`:Dp=null;break;case`mouseover`:case`mouseout`:Op=null;break;case`pointerover`:case`pointerout`:kp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ap.delete(t.pointerId)}}function Pp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Tt(t),t!==null&&hp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fp(e,t,n,r,i){switch(t){case`focusin`:return Ep=Pp(Ep,e,t,n,r,i),!0;case`dragenter`:return Dp=Pp(Dp,e,t,n,r,i),!0;case`mouseover`:return Op=Pp(Op,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kp.set(a,Pp(kp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ap.set(a,Pp(Ap.get(a)||null,e,t,n,r,i)),!0}return!1}function Ip(e){var t=wt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,pt(e.priority,function(){gp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,pt(e.priority,function(){gp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);un=r,n.target.dispatchEvent(r),un=null}else return t=Tt(n),t!==null&&hp(t),e.blockedOn=n,!1;t.shift()}return!0}function Rp(e,t,n){Lp(e)&&n.delete(t)}function zp(){Tp=!1,Ep!==null&&Lp(Ep)&&(Ep=null),Dp!==null&&Lp(Dp)&&(Dp=null),Op!==null&&Lp(Op)&&(Op=null),kp.forEach(Rp),Ap.forEach(Rp)}function Bp(e,n){e.blockedOn===n&&(e.blockedOn=null,Tp||(Tp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zp)))}var Vp=null;function Hp(e){Vp!==e&&(Vp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vp===e&&(Vp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Cp(r||n)===null)continue;break}var a=Tt(n);a!==null&&(e.splice(t,3),t-=3,js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Up(e){function t(t){return Bp(t,e)}Ep!==null&&Bp(Ep,e),Dp!==null&&Bp(Dp,e),Op!==null&&Bp(Op,e),kp.forEach(t),Ap.forEach(t);for(var n=0;n<jp.length;n++){var r=jp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jp.length&&(n=jp[0],n.blockedOn===null);)Ip(n),n.blockedOn===null&&jp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[gt]||null;if(typeof a==`function`)o||Hp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Cp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hp(n)}}}function Wp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Gp(e){this._internalRoot=e}Kp.prototype.render=Gp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fp(n,Su(),e,t,null,null)},Kp.prototype.unmount=Gp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fp(e.current,2,null,e,null,null),ku(),t[_t]=null}};function Kp(e){this._internalRoot=e}Kp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jp.length&&t!==0&&t<jp[n].priority;n++);jp.splice(n,0,e),n===0&&Ip(e)}};var qp=n.version;if(qp!==`19.2.7`)throw Error(i(527,qp,`19.2.7`));O.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Jp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:D,reconcilerVersion:`19.2.7`};
10if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yp.isDisabled&&Yp.supportsFiber)try{Ue=Yp.inject(Jp),We=Yp}catch{}}e.hydrateRoot=function(e,t,n){if(!a(e))throw Error(i(299));var r=!1,o=``,s=ec,c=tc,l=nc,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=up(e,1,!0,t,n??null,r,o,u,s,c,l,Wp),t.context=dp(null),n=t.current,r=Su(),r=ut(r),o=Xa(r),o.callback=null,Za(n,o,r),n=r,t.current.lanes=n,at(t,n),fd(t),e[_t]=t.current,jd(e),new Kp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=`__TSS_CONTEXT`,y=Symbol.for(`TSS_SERVER_FUNCTION`),b=Symbol.for(`TSS_SERVER_FUNCTION_FACTORY`),x=`application/x-tss-framed`,S={JSON:0,CHUNK:1,END:2,ERROR:3};`${x}`;var C=/;\s*v=(\d+)/;function w(e){let t=e.match(C);return t?parseInt(t[1],10):void 0}function ee(e){let t=w(e);if(t!==void 0&&t!==1)throw Error(`Incompatible framed protocol version: server=${t}, client=1. Please ensure client and server are using compatible versions.`)}var te=()=>window.__TSS_START_OPTIONS__;function ne(e){return e[e.length-1]}function E(e){return typeof e==`function`}function re(e,t){return E(e)?e(t):e}var ie=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;function oe(e){for(let t in e)if(ie.call(e,t))return!0;return!1}var se=()=>Object.create(null),ce=(e,t)=>le(e,t,se);function le(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=de(e)&&de(i);if(!a&&!(O(e)&&O(i)))return i;let o=a?e:D(e);if(!o)return i;let s=a?i:D(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:ie.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=le(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function D(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!ae.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!ae.call(e,t))return!1;r.push(t)}return r}function O(e){if(!ue(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ue(n)||!n.hasOwnProperty(`isPrototypeOf`))}function ue(e){return Object.prototype.toString.call(e)===`[object Object]`}function de(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fe(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!fe(e[r],t[r],n))return!1;return!0}if(O(e)&&O(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!fe(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!fe(e[o],t[o],n)))return!1;return i===a}return!1}function k(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function pe(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}
10function A(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}var me=/[\x00-\x1f\x7f"<>`{}]/g;function he(e){return e.replace(me,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ge(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return he(t)}var _e=[`http:`,`https:`,`mailto:`,`tel:`];function ve(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var ye={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},be=/[&><\u2028\u2029]/g;function xe(e){return e.replace(be,e=>ye[e])}function Se(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ge(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ge(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Ce(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function we(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Te(){throw Error(`Invariant failed`)}function Ee(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var De=4,Oe=5;function ke(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Ae(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=ke(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function je(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=Ae(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Pe(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Pe(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Fe(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Fe(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Fe(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}
10if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Pe(n.fullPath??n.from);e.kind=Oe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Pe(n.fullPath??n.from);e.kind=De,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)je(e,t,r,s,i,a,o)}function Me(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ne(e){if(e.pathless)for(let t of e.pathless)Ne(t);if(e.static)for(let t of e.static.values())Ne(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Ne(t);if(e.dynamic?.length){e.dynamic.sort(Me);for(let t of e.dynamic)Ne(t)}if(e.optional?.length){e.optional.sort(Me);for(let t of e.optional)Ne(t)}if(e.wildcard?.length){e.wildcard.sort(Me);for(let t of e.wildcard)Ne(t)}}function Pe(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Fe(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Ie(e,t){let n=Pe(`/`),r=new Uint16Array(6);for(let t of e)je(!1,r,t,1,n,0);Ne(n),t.masksTree=n,t.flatCache=Ee(1e3)}function Le(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=He(e,t.masksTree);return t.flatCache.set(e,r),r}function Re(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Pe(`/`),je(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),He(r,o,n)}function ze(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=He(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=We(a.route)),t.matchCache.set(r,a),a}function Be(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ve(e,t=!1,n){let r=Pe(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return je(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&Te(),a[e.id]=e,s!==0&&e.path){let t=Be(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Ne(r),{processedTree:{segmentTree:r,singleCache:Ee(1e3),matchCache:Ee(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function He(e,t,n=!1){let r=e.split(`/`),i=Ke(e,r,t,n);if(!i)return null;let[a]=Ue(e,r,i);return{route:i.node.route,rawParams:a}}function Ue(e,t,n){let r=Ge(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===De)break;if(u.kind===Oe){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function We(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Ge(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Ke(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!ne(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!Xe(l,n))continue;if(i.parse){if(!Ye(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==De&&Xe(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===De||i.kind===2)&&Xe(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;
10if(i.index.parse&&(Ye(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&Je(p,o))return n;Xe(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+qe(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+qe(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+qe(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+qe(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function qe(e,t){return 2**(e-t-1)}function Je(e,t){return e===2**(t-1)-1}function Ye(e,t,n){let r,i;try{[r,i]=Ue(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Xe(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===De)>(e.node.kind===De)||t.node.kind===De==(e.node.kind===De)&&t.depth>e.depth))):!0}function Ze(e){return Qe(e.filter(e=>e!==void 0).join(`/`))}function Qe(e){return e.replace(/\/{2,}/g,`/`)}function $e(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function et(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function tt(e){return et($e(e))}function nt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function rt(e,t,n){return nt(e,n)===nt(t,n)}function it({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&ne(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(ne(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Qe(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function at(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function ot(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>ct(e,n)).join(`/`):ct(r,n):r}function st({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Ae(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=ot(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];
10let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=ot(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=ot(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function ct(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function lt(e){return e?.isNotFound===!0}function ut(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function dt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ft(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=dt(r):Array.isArray(t)?t.push(dt(r)):n[e]=[t,dt(r)]}return n}var pt=ht(JSON.parse),mt=gt(JSON.stringify,JSON.parse);function ht(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=ft(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function gt(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=ut(e,r);return t?`?${t}`:``}}var _t=`__root__`;function vt(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function yt(e){return e instanceof Response&&!!e.options}function bt(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return vt(e)}var xt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},St=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Ct=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),wt=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);
10i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Tt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Et=(e,t,n)=>{if(!(!yt(n)&&!lt(n)))throw yt(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:yt(n)?`redirected`:lt(n)?`notFound`:r.status===`pending`?`success`:r.status,context:wt(e,t.index),isFetching:!1,error:n})),lt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),yt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Dt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Ot=(e,t,n)=>{let r=wt(e,n);e.updateMatch(t,e=>({...e,context:r}))},kt=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,Et(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,Et(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!yt(n)&&!lt(n)&&(e.serialError??=n)},At=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ct(e,t)&&(n.options.loader||n.options.beforeLoad||Vt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{xt(e)},i);r._nonReactive.pendingTimeout=t}},jt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;At(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Et(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Mt=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=k(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&kt(e,n,o),s&&kt(e,n,s),At(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=k();let f={...wt(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Ct(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(yt(r)||lt(r))&&(u(),kt(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),A(y))return u(),y.catch(t=>{kt(e,n,t)}).then(v)}catch(t){u(),kt(e,n,t)}v(y)},Nt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Mt(e,n,t,i),s=()=>{if(Dt(e,n))return;let t=jt(e,n,i);return A(t)?t.then(o):o()};return a()},Pt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Ft=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=wt(e,r),d=Ct(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},It=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Bt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Ft(e,t,n,r,i)),l=!!s&&A(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Et(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:wt(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>
10({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:wt(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,lt(t)&&await i.options.notFoundComponent?.preload?.(),Et(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Et(e,e.router.getMatch(n),t)}!yt(o)&&!lt(o)&&await Bt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:wt(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Et(e,r,t)}},Lt=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Ft(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await It(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){yt(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await It(e,t,i,n,d):Ot(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Dt(e,i)){if(!e.router.getMatch(i))return e.matches[n];Ot(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=Ct(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Et(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=k(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function Rt(e){let t=e,n=[];St(t.router)&&xt(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Nt(t,e);A(n)&&await n}catch(e){if(yt(e))throw e;if(lt(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Tt(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Lt(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(yt(e))throw e;lt(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Tt(t,l);e===void 0&&Te();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Bt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Bt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Pt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=xt(t);if(A(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function zt(e,t){let n=t.map(t=>
10e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Bt(e,t=Ht){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Ht?(()=>{if(e._componentsPromise===void 0){let t=zt(e,Ht);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():zt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Vt(e){for(let t of Ht)if(e.options[t]?.preload)return!0;return!1}var Ht=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Ut(e){return{input:({url:t})=>{for(let n of e)t=Gt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Kt(e[n],t);return t}}}function Wt(e){let t=tt(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ze([`/`,t,e.pathname]),e)}}function Gt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Kt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function qt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Jt(o,_.get())),x=r(()=>Jt(s,v.get())),S=r(()=>Jt(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),ee=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),te=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),ne=Ee(64);function E(e){let t=ne.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),ne.set(e,t)),t}let re={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:ee,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:te,getRouteMatchStore:E,setMatches:ie,setPending:ae,setCached:oe};ie(e.matches),a?.(re);function ie(e){Yt(e,o,_,n,i)}function ae(e){Yt(e,s,v,n,i)}function oe(e){Yt(e,c,y,n,i)}return re}function Jt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Yt(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}we(n.get(),a)||n.set(a)})}var Xt=`__TSR_index`,Zt=`popstate`,Qt=`beforeunload`;function $t(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=rn(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Xt];i=en(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Xt];i=en(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Xt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function en(e,t){t||={};let n=an();return{...t,key:n,__TSR_key:n,[Xt]:e}}function tn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>rn(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=an();t.history.replaceState({[Xt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=rn(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>
10{if(f){f=!1;return}let e=c(),n=e.state[Xt]-l.state[Xt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=$t({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Qt,S,{capture:!0}),t.removeEventListener(Zt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Qt,S,{capture:!0}),t.addEventListener(Zt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function nn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function rn(e,t){let n=nn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=an();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Xt]:0,key:a,__TSR_key:a}}}function an(){return(Math.random()+1).toString(36).substring(7)}function on(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function sn(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var cn=new WeakMap,ln=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=at(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tn()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Ee(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=qt(fn(this.latestLocation),e),Mn(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=tt(o);t&&t!==`/`&&e.push(Wt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Ut(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ve(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Ie(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>
10{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Se(e).path,external:!1,searchStr:o,search:ce(t?.search,i),hash:Se(r.slice(1)).path,state:le(t?.state,a)}}let o=new URL(i,this.origin),s=Gt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Se(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:ce(t?.search,c),hash:Se(s.hash.slice(1)).path,state:le(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>it({base:e,to:t.includes(`//`)?Qe(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>mn({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,re(t.params,s)),d=this.routesByPath[et(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&oe(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:Se(st({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,pn(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=hn({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=ce(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?re(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?re(t.state,n.state):{};v=le(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Kt(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=Ce(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Le(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,re(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];
10e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=fe(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=et(this.latestLocation.href)===et(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=k(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=rn(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Gt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ve(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?cn.set(this.latestLocation,t):cn.delete(this.latestLocation);let n=this.latestLocation,r=sn(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Rt({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){yt(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):lt(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(sn(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>
10{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&ve(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=Bt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await Rt({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(yt(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});lt(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Re(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!fe(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?fe(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??mt,parseSearch:e.parseSearch??pt,protocolAllowlist:e.protocolAllowlist??_e}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=We(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParam
10s:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:et(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?_n(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=pn(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof un||(r=new un(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=st({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{vn(r,b)}catch(e){if(x=lt(e)||yt(e)?e:new dn(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:ce(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Vt(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?ce(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:k()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?le(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?ce(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let t=ne(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];let{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=ne(r),o={...e.search};for(let e of r)try{Object.assign(o,pn(e.options.validateSearch,o))}catch{}let s=t&&this.stores.matchStores.get(t)?.get(),c=s&&s.routeId===a.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),i);for(let t of r)try{vn(t,e)}catch{}l=e}let u={matchedRoutes:r,fullPath:a.fullPath,search:o,params:l};return this.lightweightCache.set(e,[t,u]),u}},un=class extends Error{},dn=class extends Error{};function fn(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function pn(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new un(`Async validation not supported`);if(n.issues)throw new un(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function mn({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=et(e),a,o=ze(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function hn({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return gn(n)(e,t,r??!1)}function gn(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>
10t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=pn(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=re(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function _n(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return _t}function vn(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function yn(){try{return sessionStorage}catch{return}}var bn=`tsr-scroll-restoration-v1_3`,xn=yn();function Sn(){try{return JSON.parse(xn?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Cn(){try{xn?.setItem(bn,JSON.stringify(wn))}catch{}}var wn=Sn(),Tn=`data-scroll-restoration-id`,En=e=>e.state.__TSR_key||e.href;function Dn(e){let t=e.getAttribute(Tn);if(t)return`[${Tn}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var On=!1,kn=`window`;function An(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function jn(e){let t=[];for(let n of e){if(n===kn)continue;let e=An(n);e&&t.push(e)}return t}function Mn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||En,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(On||!r.restoring))if(e.target===document)o(kn,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=wn[e]||={};for(let[e,n]of a)e===kn?t[kn]=n:e.isConnected&&(t[Dn(e)]=n)};n&&!r.restoration&&(r.restoration=!0,On=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Cn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=wn[u];if(e){let t=wn[l];for(let n in e){if(n===kn){if(s)continue}else{let e=An(n);if(!e||s&&o&&(c??=jn(o),c.includes(e)))continue}t||=wn[l]={},t[n]??=e[n]}}}On=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=cn.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?wn[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===kn){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=An(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=jn(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{On=!1}}))}var Nn=Symbol.for(`TSR_DEFERRED_PROMISE`);function Pn(e,t){let n=e;return n[Nn]?n:(n[Nn]={status:`pending`},n.then(e=>{n[Nn].status=`success`,n[Nn].data=e}).catch(e=>{n[Nn].status=`error`,n[Nn].error={data:(t?.serializeError??on)(e),__isServerError:!0}}),n)}var Fn=`Error preloading route! ☝️`;function In(e,t){if(e)return typeof e==`string`?e:e[t]}function Ln(e){return e?.scriptFormat??`module`}function Rn(e,t,n){let r=zn(t),i=In(n,`script`)??r.crossOrigin;return{...Ln(e)===`iife`?{rel:`preload`,as:`script`}:{rel:`modulepreload`},href:r.href,...i?{crossOrigin:i}:{}}}function zn(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function Bn(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}let n=new Set;for(let r of t){let t=JSON.stringify(r);n.has(t)||(n.add(t),e.push(r))}}function Vn(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}var Hn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=_t:this.parentRoute||Te();let r=n?_t:t?.path;r&&r!==`/`&&(r=$e(r));let i=t?.id||r,a=n?_t:Ze([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);
10r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ze([`/`,a]));let o=a===`__root__`?`/`:Ze([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=et(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>vt({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Un=class extends Hn{constructor(e){super(e)}},Wn=(e=>(e[e.AggregateError=1]=`AggregateError`,e[e.ArrowFunction=2]=`ArrowFunction`,e[e.ErrorPrototypeStack=4]=`ErrorPrototypeStack`,e[e.ObjectAssign=8]=`ObjectAssign`,e[e.BigIntTypedArray=16]=`BigIntTypedArray`,e[e.RegExp=32]=`RegExp`,e))(Wn||{}),Gn=Symbol.asyncIterator,Kn=Symbol.hasInstance,qn=Symbol.isConcatSpreadable,Jn=Symbol.iterator,Yn=Symbol.match,Xn=Symbol.matchAll,Zn=Symbol.replace,Qn=Symbol.search,$n=Symbol.species,er=Symbol.split,tr=Symbol.toPrimitive,nr=Symbol.toStringTag,rr=Symbol.unscopables,ir={[Gn]:0,[Kn]:1,[qn]:2,[Jn]:3,[Yn]:4,[Xn]:5,[Zn]:6,[Qn]:7,[$n]:8,[er]:9,[tr]:10,[nr]:11,[rr]:12},ar={0:Gn,1:Kn,2:qn,3:Jn,4:Yn,5:Xn,6:Zn,7:Qn,8:$n,9:er,10:tr,11:nr,12:rr},j=void 0,or={2:!0,3:!1,1:j,0:null,4:-0,5:1/0,6:-1/0,7:NaN},sr={0:`Error`,1:`EvalError`,2:`RangeError`,3:`ReferenceError`,4:`SyntaxError`,5:`TypeError`,6:`URIError`},cr={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function M(e,t,n,r,i,a,o,s,c,l,u,d){return{t:e,i:t,s:n,c:r,m:i,p:a,e:o,a:s,f:c,b:l,o:u,l:d}}function lr(e){return M(2,j,e,j,j,j,j,j,j,j,j,j)}var ur=lr(2),dr=lr(3),fr=lr(1),pr=lr(0),mr=lr(4),hr=lr(5),gr=lr(6),_r=lr(7);function vr(e){switch(e){case`"`:return`\\"`;case`\\`:return`\\\\`;case`
11`:return`\\n`;case`\r`:return`\\r`;case`\b`:return`\\b`;case`	`:return`\\t`;case`\f`:return`\\f`;case`<`:return`\\x3C`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:return j}}function yr(e){let t=``,n=0,r;for(let i=0,a=e.length;i<a;i++)r=vr(e[i]),r&&(t+=e.slice(n,i)+r,n=i+1);return n===0?t=e:t+=e.slice(n),t}function br(e){switch(e){case`\\\\`:return`\\`;case`\\"`:return`"`;case`\\n`:return`
12`;case`\\r`:return`\r`;case`\\b`:return`\b`;case`\\t`:return`	`;case`\\f`:return`\f`;case`\\x3C`:return`<`;case`\\u2028`:return`\u2028`;case`\\u2029`:return`\u2029`;default:return e}}function xr(e){return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,br)}var Sr=`__SEROVAL_REFS__`,Cr=new Map,wr=new Map;function Tr(e){return Cr.has(e)}function Er(e){return wr.has(e)}function Dr(e){if(Tr(e))return Cr.get(e);throw new hi(e)}function Or(e){if(Er(e))return wr.get(e);throw new gi(e)}typeof globalThis<`u`?Object.defineProperty(globalThis,Sr,{value:wr,configurable:!0,writable:!1,enumerable:!1}):typeof window<`u`?Object.defineProperty(window,Sr,{value:wr,configurable:!0,writable:!1,enumerable:!1}):typeof self<`u`?Object.defineProperty(self,Sr,{value:wr,configurable:!0,writable:!1,enumerable:!1}):typeof global<`u`&&Object.defineProperty(global,Sr,{value:wr,configurable:!0,writable:!1,enumerable:!1});function kr(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function Ar(e){let t=sr[kr(e)];return e.name===t?e.constructor.name===t?{}:{name:e.constructor.name}:{name:e.name}}function jr(e,t){let n=Ar(e),r=Object.getOwnPropertyNames(e);for(let i=0,a=r.length,o;i<a;i++)o=r[i],o!==`name`&&o!==`message`&&(o===`stack`?t&4&&(n||={},n[o]=e[o]):(n||={},n[o]=e[o]));return n}function Mr(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:+!Object.isExtensible(e)}function Nr(e){switch(e){case 1/0:return hr;case-1/0:return gr}return e===e?Object.is(e,-0)?mr:M(0,j,e,j,j,j,j,j,j,j,j,j):_r}function Pr(e){return M(1,j,yr(e),j,j,j,j,j,j,j,j,j)}function Fr(e){return M(3,j,``+e,j,j,j,j,j,j,j,j,j)}function Ir(e){return M(4,e,j,j,j,j,j,j,j,j,j,j)}function Lr(e,t){let n=t.valueOf();return M(5,e,n===n?t.toISOString():``,j,j,j,j,j,j,j,j,j)}function Rr(e,t){return M(6,e,j,yr(t.source),t.flags,j,j,j,j,j,j,j)}function zr(e,t){return M(17,e,ir[t],j,j,j,j,j,j,j,j,j)}function Br(e,t){return M(18,e,yr(Dr(t)),j,j,j,j,j,j,j,j,j)}function Vr(e,t,n){return M(25,e,n,yr(t),j,j,j,j,j,j,j,j)}function Hr(e,t,n){return M(9,e,j,j,j,j,j,n,j,j,Mr(t),j)}function Ur(e,t){return M(21,e,j,j,j,j,j,j,t,j,j,j)}function Wr(e,t,n){return M(15,e,j,t.constructor.name,j,j,j,j,n,t.byteOffset,j,t.length)}function Gr(e,t,n){return M(16,e,j,t.constructor.name,j,j,j,j,n,t.byteOffset,j,t.byteLength)}function Kr(e,t,n){return M(20,e,j,j,j,j,j,j,n,t.byteOffset,j,t.byteLength)}function qr(e,t,n){return M(13,e,kr(t),j,yr(t.message),n,j,j,j,j,j,j)}function Jr(e,t,n){return M(14,e,kr(t),j,yr(t.message),n,j,j,j,j,j,j)}function Yr(e,t){return M(7,e,j,j,j,j,j,t,j,j,j,j)}function Xr(e,t){return M(28,j,j,j,j,j,j,[e,t],j,j,j,j)}function Zr(e,t){return M(30,j,j,j,j,j,j,[e,t],j,j,j,j)}function Qr(e,t,n){return M(31,e,j,j,j,j,j,n,t,j,j,j)}function $r(e,t){return M(32,e,j,j,j,j,j,j,t,j,j,j)}function ei(e,t){return M(33,e,j,j,j,j,j,j,t,j,j,j)}function ti(e,t){return M(34,e,j,j,j,j,j,j,t,j,j,j)}function ni(e,t,n,r){return M(35,e,n,j,j,j,j,t,j,j,j,r)}var{toString:ri}
12=Object.prototype,ii={parsing:1,serialization:2,deserialization:3};function ai(e){return`Seroval Error (step: ${ii[e]})`}var oi=(e,t)=>ai(e),si=class extends Error{constructor(e,t){super(oi(e,t)),this.cause=t}},ci=class extends si{constructor(e){super(`parsing`,e)}},li=class extends si{constructor(e){super(`deserialization`,e)}};function ui(e){return`Seroval Error (specific: ${e})`}var di=class extends Error{constructor(e){super(ui(1)),this.value=e}},fi=class extends Error{constructor(e){super(ui(2))}},pi=class extends Error{constructor(e){super(ui(3))}},mi=class extends Error{constructor(e){super(ui(4))}},hi=class extends Error{constructor(e){super(ui(5)),this.value=e}},gi=class extends Error{constructor(e){super(ui(6))}},_i=class extends Error{constructor(e){super(ui(7))}},vi=class extends Error{constructor(e){super(ui(8))}},yi=class extends Error{constructor(e){super(ui(9))}},bi=class{constructor(e,t){this.value=e,this.replacement=t}},xi=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e};xi.toString(),((e,t)=>{e.s(t),e.p.s=1,e.p.v=t}).toString(),((e,t)=>{e.f(t),e.p.s=2,e.p.v=t}).toString();var Si=()=>{let e=[],t=[],n=!0,r=!1,i=0,a=(e,n,r)=>{for(r=0;r<i;r++)t[r]&&t[r][n](e)},o=(t,i,a,o)=>{for(i=0,a=e.length;i<a;i++)o=e[i],!n&&i===a-1?t[r?`return`:`throw`](o):t.next(o)},s=(e,r)=>(n&&(r=i++,t[r]=e),o(e),()=>{n&&(t[r]=t[i],t[i--]=void 0)});return{__SEROVAL_STREAM__:!0,on:e=>s(e),next:t=>{n&&(e.push(t),a(t,`next`))},throw:i=>{n&&(e.push(i),a(i,`throw`),n=!1,r=!1,t.length=0)},return:i=>{n&&(e.push(i),a(i,`return`),n=!1,r=!0,t.length=0)}}};Si.toString();var Ci=e=>t=>()=>{let n=0,r={[e]:()=>r,next:()=>{if(n>t.d)return{done:!0,value:void 0};let e=n++,r=t.v[e];if(e===t.t)throw r;return{done:e===t.d,value:r}}};return r};Ci.toString();var wi=(e,t)=>n=>()=>{let r=0,i=-1,a=!1,o=[],s=[],c=(e=0,t=s.length)=>{for(;e<t;e++)s[e].s({done:!0,value:void 0})};n.on({next:e=>{let t=s.shift();t&&t.s({done:!1,value:e}),o.push(e)},throw:e=>{let t=s.shift();t&&t.f(e),c(),i=o.length,a=!0,o.push(e)},return:e=>{let t=s.shift();t&&t.s({done:!0,value:e}),c(),i=o.length,o.push(e)}});let l={[e]:()=>l,next:()=>{if(i===-1){let e=r++;if(e>=o.length){let e=t();return s.push(e),e.p}return{done:!1,value:o[e]}}if(r>i)return{done:!0,value:void 0};let e=r++,n=o[e];if(e!==i)return{done:!1,value:n};if(a)throw n;return{done:!0,value:n}}};return l};wi.toString();var Ti=e=>{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer};Ti.toString();function Ei(e){return`__SEROVAL_SEQUENCE__`in e}function Di(e,t,n){return{__SEROVAL_SEQUENCE__:!0,v:e,t,d:n}}function Oi(e){let t=[],n=-1,r=-1,i=e[Jn]();for(;;)try{let e=i.next();if(t.push(e.value),e.done){r=t.length-1;break}}catch(e){n=t.length,t.push(e)}return Di(t,n,r)}var ki=Ci(Jn);function Ai(e){return ki(e)}var ji={},Mi={},Ni={0:{},1:{},2:{},3:{},4:{},5:{}};function Pi(e){return`__SEROVAL_STREAM__`in e}function Fi(){return Si()}function Ii(e){let t=Fi(),n=e[Gn]();async function r(){try{let e=await n.next();e.done?t.return(e.value):(t.next(e.value),await r())}catch(e){t.throw(e)}}return r().catch(()=>{}),t}var Li=wi(Gn,xi);function Ri(e){return Li(e)}async function zi(e){try{return[1,await e]}catch(e){return[0,e]}}function Bi(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function Vi(e,t){e.marked.add(t)}function N(e,t){let n=e.refs.size;return e.refs.set(t,n),n}function Hi(e,t){let n=e.refs.get(t);return n==null?{type:0,value:N(e,t)}
12:(Vi(e,n),{type:1,value:Ir(n)})}function Ui(e,t){let n=Hi(e,t);return n.type===1?n:Tr(t)?{type:2,value:Br(n.value,t)}:n}function Wi(e,t){let n=Ui(e,t);if(n.type!==0)return n.value;if(t in ir)return zr(n.value,t);throw new di(t)}function Gi(e,t){let n=Hi(e,Ni[t]);return n.type===1?n.value:M(26,n.value,t,j,j,j,j,j,j,j,j,j)}function Ki(e){let t=Hi(e,ji);return t.type===1?t.value:M(27,t.value,j,j,j,j,j,j,Wi(e,Jn),j,j,j)}function qi(e){let t=Hi(e,Mi);return t.type===1?t.value:M(29,t.value,j,j,j,j,j,[Gi(e,1),Wi(e,Gn)],j,j,j,j)}function Ji(e,t,n,r){return M(n?11:10,e,j,j,j,r,j,j,j,j,Mr(t),j)}function Yi(e,t,n,r){return M(8,t,j,j,j,j,{k:n,v:r},j,Gi(e,0),j,j,j)}function Xi(e,t,n){let r=new Uint8Array(n),i=``;for(let e=0,t=r.length;e<t;e++)i+=String.fromCharCode(r[e]);return M(19,t,yr(btoa(i)),j,j,j,j,j,Gi(e,5),j,j,j)}function Zi(e,t){return{base:Bi(e,t),child:void 0}}var Qi=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return va(this._p,this.depth,e)}};async function $i(e,t,n){let r=[];for(let i=0,a=n.length;i<a;i++)i in n?r[i]=await va(e,t,n[i]):r[i]=0;return r}async function ea(e,t,n,r){return Hr(n,r,await $i(e,t,r))}async function ta(e,t,n){let r=Object.entries(n),i=[],a=[];for(let n=0,o=r.length;n<o;n++)i.push(yr(r[n][0])),a.push(await va(e,t,r[n][1]));return Jn in n&&(i.push(Wi(e.base,Jn)),a.push(Xr(Ki(e.base),await va(e,t,Oi(n))))),Gn in n&&(i.push(Wi(e.base,Gn)),a.push(Zr(qi(e.base),await va(e,t,Ii(n))))),nr in n&&(i.push(Wi(e.base,nr)),a.push(Pr(n[nr]))),qn in n&&(i.push(Wi(e.base,qn)),a.push(n[qn]?ur:dr)),{k:i,v:a}}async function na(e,t,n,r,i){return Ji(n,r,i,await ta(e,t,r))}async function ra(e,t,n,r){return Ur(n,await va(e,t,r.valueOf()))}async function ia(e,t,n,r){return Wr(n,r,await va(e,t,r.buffer))}async function aa(e,t,n,r){return Gr(n,r,await va(e,t,r.buffer))}async function oa(e,t,n,r){return Kr(n,r,await va(e,t,r.buffer))}async function sa(e,t,n,r){let i=jr(r,e.base.features);return qr(n,r,i?await ta(e,t,i):j)}async function ca(e,t,n,r){let i=jr(r,e.base.features);return Jr(n,r,i?await ta(e,t,i):j)}async function la(e,t,n,r){let i=[],a=[];for(let[n,o]of r.entries())i.push(await va(e,t,n)),a.push(await va(e,t,o));return Yi(e.base,n,i,a)}async function ua(e,t,n,r){let i=[];for(let n of r.keys())i.push(await va(e,t,n));return Yr(n,i)}async function da(e,t,n,r){let i=e.base.plugins;if(i)for(let a=0,o=i.length;a<o;a++){let o=i[a];if(o.parse.async&&o.test(r))return Vr(n,o.tag,await o.parse.async(r,new Qi(e,t),{id:n}))}return j}async function fa(e,t,n,r){let[i,a]=await zi(r);return M(12,n,i,j,j,j,j,j,await va(e,t,a),j,j,j)}function pa(e,t,n,r,i){let a=[],o=n.on({next:n=>{Vi(this.base,t),va(this,e,n).then(e=>{a.push($r(t,e))},e=>{i(e),o()})},throw:n=>{Vi(this.base,t),va(this,e,n).then(e=>{a.push(ei(t,e)),r(a),o()},e=>{i(e),o()})},return:n=>{Vi(this.base,t),va(this,e,n).then(e=>{a.push(ti(t,e)),r(a),o()},e=>{i(e),o()})}})}async function ma(e,t,n,r){return Qr(n,Gi(e.base,4),await new Promise(pa.bind(e,t,n,r)))}async function ha(e,t,n,r){let i=[];for(let n=0,a=r.v.length;n<a;n++)i[n]=await va(e,t,r.v[n]);return ni(n,i,r.t,r.d)}async function ga(e,t,n,r){if(Array.isArray(r))return ea(e,t,n,r);if(Pi(r))return ma(e,t,n,r);if(Ei(r))return ha(e,t,n,r);let i=r.constructor;if(i===bi)return va(e,t,r.replacement);let a=await da(e,t,n,r);if(a)return a;switch(i){case Object:return na(e,t,n,r,!1);case j:return na(e,t,n,r,!0);case Date:return Lr(n,r);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return sa(e,t,n,r);case Number:case Boolean:case String:case BigInt:return ra(e,t,n,r);case ArrayBuffer:return Xi(e.base,n,r);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return ia(e,t,n,r);case DataView:return oa(e,t,n,r);case Map:return la(e,t,n,r);case Set:return ua(e,t,n,r);default:break}if(i===Promise||r instanceof Promise)return fa(e,t,n,r);let o=e.base.features;if(o&32&&i===RegExp)return Rr(n,r);if(o&16)switch(i){case BigInt64Array:case BigUint64Array:return aa(e,t,n,r);default:break}if(o&1&&typeof AggregateError<`u`&&(i===AggregateError||r instanceof AggregateError))return ca(e,t,n,r);if(r instanceof Error)return sa(e,t,n,r);if(Jn in r||Gn in r)return na(e,t,n,r,!!i);throw new di(r)}async function _a(e,t,n){let r=Ui(e.base,n);if(r.type!==0)return r.value;let i=await da(e,t,r.value,n);if(i)return i;throw new di(n)}async function va(e,t,n){switch(typeof n){case`boolean`:return n?ur:dr;case`undefined`:return fr;case`string`:return Pr(n);case`number`:return Nr(n);case`bigint`:return Fr(n);case`object`:if(n){let r=Ui(e.base,n);return r.type===0?await ga(e,t+1,r.value,n):r.value}return pr;case`symbol`:return Wi(e.base,n);case`function`:return _a(e,t,n);default:throw new di(n)}}async function ya(e,t){try{return await va(e,0,t)}catch(e){throw e instanceof ci?e:new ci(e)}}var ba=(e=>(e[e.Vanilla=1]=`Vanilla`,e[e.Cross=2]=`Cross`,e))(ba||{});function xa(e){return e}function Sa(e,t){for(let n=0,r=t.length;n<r;n++){let r=t[n];e.has(r)||(e.add(r),r.extends&&Sa(e,r.extends))}}function Ca(e){if(e){let t=new Set;return Sa(t,e),[...t]}}function wa(e){switch(e){case`Int8Array`:return Int8Array;case`Int16Array`:return Int16Array;case`Int32Array`:return Int32Array;case`Uint8Array`:return Uint8Array;case`Uint16Array`:return Uint16Array;case`Uint32Array`:return Uint32Array;case`Uint8ClampedArray`:return Uint8ClampedArray;case`Float32Array`:return Float32Array;case`Float64Array`:return Float64Array;case`BigInt64Array`:return BigInt64Array;case`BigUint64Array`:return BigUint64Array;default:throw new _i(e)}}var Ta=1e6,Ea=1e4,Da=2e4;function Oa(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var ka=1e3;function Aa(e,t){let n=t.refs||new Map;return`types`in n||Object.assign(n,{types:new Map}),{mode:e,plugins:t.plugins,refs:n,features:t.features??63^(t.disabledFeatures||0),depthLimit:t.depthLimit||ka}}
12function ja(e){return{mode:2,base:Aa(2,e),child:j}}var Ma=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return P(this._p,this.depth,e)}};function Na(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new vi({t:4,i:t});if(e.refs.has(t))throw Error(`Conflicted ref id: `+t)}function Pa(e,t,n){return Na(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,n),n}function Fa(e,t,n){return Na(e.base,t),e.base.refs.set(t,n),n}function Ia(e,t,n){return e.mode===1?Pa(e,t,n):Fa(e,t,n)}function La(e,t,n){if(Object.hasOwn(t,n))return t[n];throw new vi(e)}function Ra(e,t){return Ia(e,t.i,Or(xr(t.s)))}function za(e,t,n){let r=n.a,i=r.length,a=Ia(e,n.i,Array(i));for(let n=0,o;n<i;n++)o=r[n],o&&(a[n]=P(e,t,o));return Oa(a,n.o),a}function Ba(e){switch(e){case`constructor`:case`__proto__`:case`prototype`:case`__defineGetter__`:case`__defineSetter__`:case`__lookupGetter__`:case`__lookupSetter__`:return!1;default:return!0}}function Va(e){switch(e){case Gn:case qn:case nr:case Jn:return!0;default:return!1}}function Ha(e,t,n){Ba(t)?e[t]=n:Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function Ua(e,t,n,r,i){if(typeof r==`string`)Ha(n,xr(r),P(e,t,i));else{let a=P(e,t,r);switch(typeof a){case`string`:Ha(n,a,P(e,t,i));break;case`symbol`:Va(a)&&(n[a]=P(e,t,i));break;default:throw new vi(r)}}}function Wa(e,t,n){e.base.refs.types.set(t,n)}function Ga(e,t,n,r){if(e.base.refs.types.get(n)!==r)throw new vi(t)}function Ka(e,t,n,r){let i=n.k;if(i.length>0)for(let a=0,o=n.v,s=i.length;a<s;a++)Ua(e,t,r,i[a],o[a]);return r}function qa(e,t,n){let r=Ia(e,n.i,n.t===10?{}:Object.create(null));return Ka(e,t,n.p,r),Oa(r,n.o),r}function Ja(e,t){return Ia(e,t.i,new Date(t.s))}function Ya(e,t){if(e.base.features&32){let n=xr(t.c);if(n.length>Da)throw new vi(t);return Ia(e,t.i,new RegExp(n,t.m))}throw new fi(t)}function Xa(e,t,n){let r=Ia(e,n.i,new Set);for(let i=0,a=n.a,o=a.length;i<o;i++)r.add(P(e,t,a[i]));return r}function Za(e,t,n){let r=Ia(e,n.i,new Map);for(let i=0,a=n.e.k,o=n.e.v,s=a.length;i<s;i++)r.set(P(e,t,a[i]),P(e,t,o[i]));return r}function Qa(e,t){if(t.s.length>Ta)throw new vi(t);return Ia(e,t.i,Ti(xr(t.s)))}function $a(e,t,n){let r=wa(n.c),i=P(e,t,n.f),a=n.b??0;if(a<0||a>i.byteLength)throw new vi(n);return Ia(e,n.i,new r(i,a,n.l))}function eo(e,t,n){let r=P(e,t,n.f),i=n.b??0;if(i<0||i>r.byteLength)throw new vi(n);return Ia(e,n.i,new DataView(r,i,n.l))}function to(e,t,n,r){if(n.p){let i=Ka(e,t,n.p,{});Object.defineProperties(r,Object.getOwnPropertyDescriptors(i))}return r}function no(e,t,n){return to(e,t,n,Ia(e,n.i,AggregateError([],xr(n.m))))}function ro(e,t,n){let r=La(n,cr,n.s);return to(e,t,n,Ia(e,n.i,new r(xr(n.m))))}function io(e,t,n){let r=xi(),i=Ia(e,n.i,r.p),a=P(e,t,n.f);return n.s?r.s(a):r.f(a),i}function ao(e,t,n){return Ia(e,n.i,Object(P(e,t,n.f)))}function oo(e,t,n){let r=e.base.plugins;if(r){let i=xr(n.c);for(let a=0,o=r.length;a<o;a++){let o=r[a];if(o.tag===i)return Ia(e,n.i,o.deserialize(n.s,new Ma(e,t),{id:n.i}))}}throw new pi(n.c)}function so(e,t){let n=Ia(e,t.i,Ia(e,t.s,xi()).p);return Wa(e,t.s,22),n}function co(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ga(e,n,n.i,22),r.s(P(e,t,n.a[1])),j;throw new mi(`Promise`)}function lo(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ga(e,n,n.i,22),r.f(P(e,t,n.a[1])),j;throw new mi(`Promise`)}function uo(e,t,n){return P(e,t,n.a[0]),Ai(P(e,t,n.a[1]))}function fo(e,t,n){return P(e,t,n.a[0]),Ri(P(e,t,n.a[1]))}function po(e,t,n){let r=Ia(e,n.i,Fi());Wa(e,n.i,31);let i=n.a,a=i.length;if(a)for(let n=0;n<a;n++)P(e,t,i[n]);return r}function mo(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ga(e,n,n.i,31),r.next(P(e,t,n.f)),j;throw new mi(`Stream`)}function ho(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ga(e,n,n.i,31),r.throw(P(e,t,n.f)),j;throw new mi(`Stream`)}function go(e,t,n){let r=e.base.refs.get(n.i);if(r)return Ga(e,n,n.i,31),r.return(P(e,t,n.f)),j;throw new mi(`Stream`)}function _o(e,t,n){return P(e,t,n.f),j}function vo(e,t,n){return P(e,t,n.a[1]),j}function yo(e,t,n){let r=Ia(e,n.i,Di([],n.s,n.l));for(let i=0,a=n.a.length;i<a;i++)r.v[i]=P(e,t,n.a[i]);return r}function P(e,t,n){if(t>e.base.depthLimit)throw new yi(e.base.depthLimit);switch(t+=1,n.t){case 2:return La(n,or,n.s);case 0:return Number(n.s);case 1:return xr(String(n.s));case 3:if(String(n.s).length>Ea)throw new vi(n);return BigInt(n.s);case 4:return e.base.refs.get(n.i);case 18:return Ra(e,n);case 9:return za(e,t,n);case 10:case 11:return qa(e,t,n);case 5:return Ja(e,n);case 6:return Ya(e,n);case 7:return Xa(e,t,n);
12case 8:return Za(e,t,n);case 19:return Qa(e,n);case 16:case 15:return $a(e,t,n);case 20:return eo(e,t,n);case 14:return no(e,t,n);case 13:return ro(e,t,n);case 12:return io(e,t,n);case 17:return La(n,ar,n.s);case 21:return ao(e,t,n);case 25:return oo(e,t,n);case 22:return so(e,n);case 23:return co(e,t,n);case 24:return lo(e,t,n);case 28:return uo(e,t,n);case 30:return fo(e,t,n);case 31:return po(e,t,n);case 32:return mo(e,t,n);case 33:return ho(e,t,n);case 34:return go(e,t,n);case 27:return _o(e,t,n);case 29:return vo(e,t,n);case 35:return yo(e,t,n);default:throw new fi(n)}}function F(e,t){try{return P(e,0,t)}catch(e){throw new li(e)}}var bo=(()=>T).toString();/=>/.test(bo);function xo(e,t){return F(ja({plugins:Ca(t.plugins),refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit}),e)}async function So(e,t={}){let n=Zi(1,{plugins:Ca(t.plugins),disabledFeatures:t.disabledFeatures});return{t:await ya(n,e),f:n.base.features,m:Array.from(n.base.marked)}}function Co(e){return e}function wo(e){return xa({tag:`$TSR/t/`+e.key,test:e.test,parse:{sync(t,n,r){return{v:n.parse(e.toSerializable(t))}},async async(t,n,r){return{v:await n.parse(e.toSerializable(t))}},stream(t,n,r){return{v:n.parse(e.toSerializable(t))}}},serialize:void 0,deserialize(t,n,r){return e.fromSerializable(n.deserialize(t.v))}})}var To=class{constructor(e,t){this.stream=e,this.hint=t?.hint??`binary`}},Eo=globalThis.Buffer,Do=!!Eo&&typeof Eo.from==`function`;function Oo(e){if(e.length===0)return``;if(Do)return Eo.from(e).toString(`base64`);let t=32768,n=[];for(let r=0;r<e.length;r+=t){let i=e.subarray(r,r+t);n.push(String.fromCharCode.apply(null,i))}return btoa(n.join(``))}function ko(e){if(e.length===0)return new Uint8Array;
12if(Do){let t=Eo.from(e,`base64`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var Ao=Object.create(null),jo=Object.create(null),Mo=e=>new ReadableStream({start(t){e.on({next(e){try{t.enqueue(ko(e))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),No=new TextEncoder,Po=e=>new ReadableStream({start(t){e.on({next(e){try{typeof e==`string`?t.enqueue(No.encode(e)):t.enqueue(ko(e.$b64))}catch{}},throw(e){t.error(e)},return(){try{t.close()}catch{}}})}}),Fo=`(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))`,Io=`(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})`;function Lo(e){let t=Fi(),n=e.getReader();return(async()=>{try{for(;;){let{done:e,value:r}=await n.read();if(e){t.return(void 0);break}t.next(Oo(r))}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}function Ro(e){let t=Fi(),n=e.getReader(),r=new TextDecoder(`utf-8`,{fatal:!0});return(async()=>{try{for(;;){let{done:e,value:i}=await n.read();if(e){try{let e=r.decode();e.length>0&&t.next(e)}catch{}t.return(void 0);break}try{let e=r.decode(i,{stream:!0});e.length>0&&t.next(e)}catch{t.next({$b64:Oo(i)})}}}catch(e){t.throw(e)}finally{n.releaseLock()}})(),t}var zo=xa({tag:`tss/RawStream`,extends:[xa({tag:`tss/RawStreamFactory`,test(e){return e===Ao},parse:{sync(e,t,n){return{}},async async(e,t,n){return{}},stream(e,t,n){return{}}},serialize(e,t,n){return Fo},deserialize(e,t,n){return Ao}}),xa({tag:`tss/RawStreamFactoryText`,test(e){return e===jo},parse:{sync(e,t,n){return{}},async async(e,t,n){return{}},stream(e,t,n){return{}}},serialize(e,t,n){return Io},deserialize(e,t,n){return jo}})],test(e){return e instanceof To},parse:{sync(e,t,n){let r=e.hint===`text`?jo:Ao;return{hint:t.parse(e.hint),factory:t.parse(r),stream:t.parse(Fi())}},async async(e,t,n){let r=e.hint===`text`?jo:Ao,i=e.hint===`text`?Ro(e.stream):Lo(e.stream);return{hint:await t.parse(e.hint),factory:await t.parse(r),stream:await t.parse(i)}},stream(e,t,n){let r=e.hint===`text`?jo:Ao,i=e.hint===`text`?Ro(e.stream):Lo(e.stream);return{hint:t.parse(e.hint),factory:t.parse(r),stream:t.parse(i)}}},serialize(e,t,n){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t,n){let r=t.deserialize(e.stream);return t.deserialize(e.hint)===`text`?Po(r):Mo(r)}});function Bo(e){return xa({tag:`tss/RawStream`,test:()=>!1,parse:{},serialize(){throw Error(`RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.`)},deserialize(t,n,r){return e(typeof n?.deserialize==`function`?n.deserialize(t.streamId):t.streamId)}})}var Vo=xa({tag:`$TSR/Error`,test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return`new Error(`+t.serialize(e.message)+`)`},deserialize(e,t){return Error(t.deserialize(e.message))}}),Ho={},Uo=e=>new ReadableStream({start:t=>{e.on({next:e=>{try{t.enqueue(e)}catch{}},throw:e=>{t.error(e)},return:()=>{try{t.close()}catch{}}})}}),Wo=xa({tag:`seroval-plugins/web/ReadableStreamFactory`,test(e){return e===Ho},parse:{sync(){return Ho},async async(){return await Promise.resolve(Ho)},stream(){return Ho}},serialize(){return Uo.toString()},deserialize(){return Ho}});function Go(e){let t=Fi(),n=e.getReader();async function r(){try{let e=await n.read();e.done?t.return(e.value):(t.next(e.value),await r())}catch(e){t.throw(e)}}return r().catch(()=>{}),t}var Ko=[Vo,zo,xa({tag:`seroval/plugins/web/ReadableStream`,extends:[Wo],test(e){return typeof ReadableStream>`u`?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(Ho),stream:t.parse(Fi())}},async async(e,t){return{factory:await t.parse(Ho),stream:await t.parse(Go(e))}},stream(e,t){return{factory:t.parse(Ho),stream:t.parse(Go(e))}}},serialize(e,t){return`(`+t.serialize(e.factory)+`)(`+t.serialize(e.stream)+`)`},deserialize(e,t){return Uo(t.deserialize(e.stream))}})];function qo(){return[...(te()?.serializationAdapters)?.map(wo)??[],...Ko]}var Jo=new TextDecoder,Yo=new Uint8Array,Xo=16*1024*1024,Zo=32*1024*1024,Qo=1024,$o=1e5;function es(e){let t=new Map,n=new Map,r=new Set,i=!1,a=null,o=0,s,c=new ReadableStream({start(e){s=e},cancel(){i=!0;try{a?.cancel()}catch{}
12t.forEach(e=>{try{e.error(Error(`Framed response cancelled`))}catch{}}),t.clear(),n.clear(),r.clear()}});function l(e){let i=n.get(e);if(i)return i;if(r.has(e))return new ReadableStream({start(e){e.close()}});if(n.size>=Qo)throw Error(`Too many raw streams in framed response (max ${Qo})`);let a=new ReadableStream({start(n){t.set(e,n)},cancel(){r.add(e),t.delete(e),n.delete(e)}});return n.set(e,a),a}function u(e){return l(e),t.get(e)}return(async()=>{let n=e.getReader();a=n;let c=[],l=0;function d(){if(l<9)return null;let e=c[0];if(e.length>=9)return{type:e[0],streamId:(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0,length:(e[5]<<24|e[6]<<16|e[7]<<8|e[8])>>>0};let t=new Uint8Array(9),n=0,r=9;for(let e=0;e<c.length&&r>0;e++){let i=c[e],a=Math.min(i.length,r);t.set(i.subarray(0,a),n),n+=a,r-=a}return{type:t[0],streamId:(t[1]<<24|t[2]<<16|t[3]<<8|t[4])>>>0,length:(t[5]<<24|t[6]<<16|t[7]<<8|t[8])>>>0}}function f(e){if(e===0)return Yo;let t=c[0];if(t&&t.length>=e){let n=t.subarray(0,e);return t.length===e?c.shift():c[0]=t.subarray(e),l-=e,n}let n=new Uint8Array(e),r=0,i=e;for(;i>0&&c.length>0;){let e=c[0];if(!e)break;let t=Math.min(e.length,i);n.set(e.subarray(0,t),r),r+=t,i-=t,t===e.length?c.shift():c[0]=e.subarray(t)}return l-=e,n}try{for(;;){let{done:e,value:a}=await n.read();if(i||e)break;if(a){if(l+a.length>Zo)throw Error(`Framed response buffer exceeded ${Zo} bytes`);for(c.push(a),l+=a.length;;){let e=d();if(!e)break;let{type:n,streamId:i,length:a}=e;if(n!==S.JSON&&n!==S.CHUNK&&n!==S.END&&n!==S.ERROR)throw Error(`Unknown frame type: ${n}`);if(n===S.JSON){if(i!==0)throw Error(`Invalid JSON frame streamId (expected 0)`)}else if(i===0)throw Error(`Invalid raw frame streamId (expected non-zero)`);if(a>Xo)throw Error(`Frame payload too large: ${a} bytes (max ${Xo})`);let c=9+a;if(l<c)break;if(++o>$o)throw Error(`Too many frames in framed response (max ${$o})`);f(9);let p=f(a);switch(n){case S.JSON:try{s.enqueue(Jo.decode(p))}catch{}break;case S.CHUNK:{let e=u(i);e&&e.enqueue(p);break}case S.END:{let e=u(i);if(r.add(i),e){try{e.close()}catch{}t.delete(i)}break}case S.ERROR:{let e=u(i);if(r.add(i),e){let n=Jo.decode(p);e.error(Error(n)),t.delete(i)}break}}}}}if(l!==0)throw Error(`Incomplete frame at end of framed response`);try{s.close()}catch{}t.forEach(e=>{try{e.close()}catch{}}),t.clear()}catch(e){try{s.error(e)}catch{}t.forEach(t=>{try{t.error(e)}catch{}}),t.clear()}finally{try{n.releaseLock()}catch{}a=null}})(),{getOrCreateStream:l,jsonChunks:c}}var ts=null;async function ns(e){e.length>0&&await Promise.allSettled(e)}var rs=Object.prototype.hasOwnProperty;function is(e){for(let t in e)if(rs.call(e,t))return!0;return!1}async function as(e,t,n){ts||=qo();let r=t[0],i=r.fetch??n,a=r.data instanceof FormData?`formData`:`payload`,o=r.headers?new Headers(r.headers):new Headers;if(o.set(`x-tsr-serverFn`,`true`),a===`payload`&&o.set(`accept`,`${x}, application/x-ndjson, application/json`),r.method===`GET`){if(a===`formData`)throw Error(`FormData is not supported with GET requests`);let t=await os(r);if(t!==void 0){let n=ut({payload:t});e.includes(`?`)?e+=`&${n}`:e+=`?${n}`}}let s;if(r.method===`POST`){let e=await cs(r);e?.contentType&&o.set(`content-type`,e.contentType),s=e?.body}return await ls(async()=>i(e,{method:r.method,headers:o,signal:r.signal,body:s}))}async function os(e){let t=!1,n={};if(e.data!==void 0&&(t=!0,n.data=e.data),e.context&&is(e.context)&&(t=!0,n.context=e.context),t)return ss(n)}async function ss(e){return JSON.stringify(await Promise.resolve(So(e,{plugins:ts})))}async function cs(e){if(e.data instanceof FormData){let t;return e.context&&is(e.context)&&(t=await ss(e.context)),t!==void 0&&e.data.set(v,t),{body:e.data}}let t=await os(e);if(t)return{body:t,contentType:`application/json`}}async function ls(e){let t;try{t=await e()}catch(e){if(e instanceof Response)t=e;else throw console.log(e),e}if(t.headers.get(`x-tss-raw`)===`true`)return t;let n=t.headers.get(`content-type`);if(n||Te(),t.headers.get(`x-tss-serialized`)){let e;if(n.includes(`application/x-tss-framed`)){if(ee(n),!t.body)throw Error(`No response body for framed response`);
12let{getOrCreateStream:r,jsonChunks:i}=es(t.body),a=[Bo(r),...ts||[]],o=new Map;e=await us({jsonStream:i,onMessage:e=>xo(e,{refs:o,plugins:a}),onError(e,t){console.error(e,t)}})}else if(n.includes(`application/json`)){let n=await t.json(),r=[];try{e=xo(n,{plugins:ts})}finally{}await ns(r)}if(e||Te(),e instanceof Error)throw e;return e}if(n.includes(`application/json`)){let e=await t.json(),n=bt(e);if(n)throw n;if(lt(e))throw e;return e}if(!t.ok)throw Error(await t.text());return t}async function us({jsonStream:e,onMessage:t,onError:n}){let r=e.getReader(),{value:i,done:a}=await r.read();if(a||!i)throw Error(`Stream ended before first object`);let o=JSON.parse(i),s=!1,c=(async()=>{try{for(;;){let{value:e,done:i}=await r.read();if(i)break;if(e)try{let n=[];try{t(JSON.parse(e))}finally{}await ns(n)}catch(t){n?.(`Invalid JSON: ${e}`,t)}}}catch(e){s||n?.(`Stream processing error:`,e)}})(),l,u=[];try{l=t(o)}catch(e){throw s=!0,r.cancel().catch(()=>{}),e}return await ns(u),Promise.resolve(l).catch(()=>{s=!0,r.cancel().catch(()=>{})}),c.finally(()=>{try{r.releaseLock()}catch{}}),l}function ds(e){let t=`/_serverFn/`+e;return Object.assign((...e)=>{let n=te()?.serverFns?.fetch;return as(t,e,n??fetch)},{url:t,serverFnMeta:{id:e},[y]:!0})}var fs=Co({key:`$TSS/serverfn`,test:e=>typeof e!=`function`||!(y in e)?!1:!!e[y],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>ds(e)});function ps(e){if(Array.isArray(e))return e.flatMap(e=>ps(e));if(typeof e!=`string`)return[];let t=[],n=0,r,i,a,o,s,c=()=>{for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length},l=()=>(i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`);for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.slice(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.slice(r))}return t}function ms(e){return e instanceof Headers?e:Array.isArray(e)||typeof e==`object`?new Headers(e):null}function hs(...e){return e.reduce((e,t)=>{let n=ms(t);if(!n)return e;for(let[t,r]of n.entries())t===`set-cookie`?ps(r).forEach(t=>e.append(`set-cookie`,t)):e.set(t,r);return e},new Headers)}function gs(e){return e.replaceAll(`\0`,`/`).replaceAll(`�`,`/`)}function _s(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e,t.g!==void 0&&(e.globalNotFound=t.g)}async function vs(e){window.$_TSR||Te();let t=e.options.serializationAdapters;if(t?.length){let e=new Map;t.forEach(t=>{e.set(t.key,t.fromSerializable)}),window.$_TSR.t=e,window.$_TSR.buffer.forEach(e=>e())}window.$_TSR.initialized=!0,window.$_TSR.router||Te();let n=window.$_TSR.router;n.matches.forEach(e=>{e.i=gs(e.i)}),n.lastMatchId&&=gs(n.lastMatchId);let{manifest:r,dehydratedData:i,lastMatchId:a}=n;e.ssr={manifest:r};let o=document.querySelector(`meta[property="csp-nonce"]`)?.content;e.options.ssr={nonce:o},await e.options.hydrate?.(i);let s=e.matchRoutes(e.stores.location.get()),c=Promise.all(s.map(t=>e.loadRouteChunk(e.looseRoutesById[t.routeId])));function l(t){let n=e.looseRoutesById[t.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(n){let r=k();t._nonReactive.minPendingPromise=r,t._forcePending=!0,setTimeout(()=>{r.resolve(),e.updateMatch(t.id,e=>(e._nonReactive.minPendingPromise=void 0,{...e,_forcePending:void 0}))},n)}}function u(t){let n=e.looseRoutesById[t.routeId];n&&(n.options.ssr=t.ssr)}let d;s.forEach(e=>{let t=n.matches.find(t=>t.i===e.id);if(!t){e._nonReactive.dehydrated=!1,e.ssr=!1,u(e);return}_s(e,t),u(e),e._nonReactive.dehydrated=e.ssr!==!1,(e.ssr===`data-only`||e.ssr===!1)&&d===void 0&&(d=e.index,l(e))}),e.stores.setMatches(s);let f=e.stores.matches.get(),p=e.stores.location.get();await Promise.all(f.map(async t=>{try{let n=e.looseRoutesById[t.routeId],r=f[t.index-1]?.context??e.options.context;if(n.options.context){let i={deps:t.loaderDeps,params:t.params,context:r??{},location:p,navigate:t=>e.navigate({...t,_fromLocation:p}),buildLocation:e.buildLocation,cause:t.cause,abortController:t.abortController,preload:!1,matches:s,routeId:n.id};
12t.__routeContext=n.options.context(i)??void 0}t.context={...r,...t.__routeContext,...t.__beforeLoadContext};let i={ssr:e.options.ssr,matches:f,match:t,params:t.params,loaderData:t.loaderData},a=await n.options.head?.(i),o=await n.options.scripts?.(i);t.meta=a?.meta,t.links=a?.links,t.headScripts=a?.scripts,t.styles=a?.styles,t.scripts=o}catch(e){if(lt(e))t.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${t.routeId}`,e);else throw t.error=e,console.error(`Error during hydration for route ${t.routeId}:`,e),e}}));let m=s[s.length-1].id!==a;if(!s.some(e=>e.ssr===!1)&&!m)return s.forEach(e=>{e._nonReactive.dehydrated=void 0}),e.stores.resolvedLocation.set(e.stores.location.get()),c;let h=Promise.resolve().then(()=>e.load()).catch(e=>{console.error(`Error during router hydration:`,e)});if(m){let t=s[1];t||Te(),l(t),t._displayPending=!0,t._nonReactive.displayPendingPromise=h,h.then(()=>{e.batch(()=>{e.stores.status.get()===`pending`&&(e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())),e.updateMatch(t.id,e=>({...e,_displayPending:void 0,displayPendingPromise:void 0}))})})}return c}var I=l(d(),1),ys=I.use,bs=typeof window<`u`?I.useLayoutEffect:I.useEffect;function xs(e){let t=I.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Ss(e,t,n={},r={}){I.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Cs(e){let t=I.useRef(null);return I.useImperativeHandle(e,()=>t.current,[]),t}var ws=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ts=o(((e,t)=>{t.exports=ws()})),L=Ts();function Es({promise:e}){if(ys)return ys(e);let t=Pn(e);if(t[Nn].status===`pending`)throw t;if(t[Nn].status===`error`)throw t[Nn].error;return t[Nn].data}function Ds(e){let t=(0,L.jsx)(Os,{...e});return e.fallback?(0,L.jsx)(I.Suspense,{fallback:e.fallback,children:t}):t}function Os(e){let t=Es(e);return e.children(t)}function ks(e){let t=e.errorComponent??js;return(0,L.jsx)(As,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?I.createElement(t,{error:n,reset:r}):e.children})}var As=class extends I.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function js({error:e}){let[t,n]=I.useState(!1);return(0,L.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,L.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,L.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,L.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,L.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,L.jsx)(`div`,{children:(0,L.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,L.jsx)(`code`,{children:e.message}):null})}):null]})}function Ms({children:e,fallback:t=null}){return Ns()?(0,L.jsx)(I.Fragment,{children:e}):(0,L.jsx)(I.Fragment,{children:t})}function Ns(){return I.useSyncExternalStore(Ps,()=>!0,()=>!1)}function Ps(){return()=>{}}var Fs=I.createContext(null);function Is(e){return I.useContext(Fs)}var Ls=I.createContext(void 0),Rs=I.createContext(void 0),zs=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(zs||{});function Bs({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;
12if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Vs(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Hs=[],Us=0,{link:Ws,unlink:Gs,propagate:Ks,checkDirty:qs,shallowPropagate:Js}=Bs({update(e){return e._update()},notify(e){Hs[Xs++]=e,e.flags&=~zs.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=zs.Mutable|zs.Dirty,ec(e))}}),Ys=0,Xs=0,Zs,Qs=0;function $s(e){try{++Qs,e()}finally{--Qs||tc()}}function ec(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Gs(n,e)}function tc(){if(!(Qs>0)){for(;Ys<Xs;){let e=Hs[Ys];Hs[Ys++]=void 0,e.notify()}Ys=0,Xs=0}}function nc(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?zs.None:zs.Mutable,get(){return Zs!==void 0&&Ws(i,Zs,Us),i._snapshot},subscribe(e){let t=Vs(e),n={current:!1},r=rc(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Zs,o=t?.compare??Object.is;if(n)Zs=i,++Us,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=zs.Mutable|zs.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Zs=a,n&&(i.flags&=~zs.RecursedCheck),ec(i)}}};return n?(i.flags=zs.Mutable|zs.Dirty,i.get=function(){let e=i.flags;if(e&zs.Dirty||e&zs.Pending&&qs(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Js(e)}}else e&zs.Pending&&(i.flags=e&~zs.Pending);return Zs!==void 0&&Ws(i,Zs,Us),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ks(e),Js(e),tc())}},i}function rc(e){let t=()=>{let t=Zs;Zs=n,++Us,n.depsTail=void 0,n.flags=zs.Watching|zs.RecursedCheck;try{return e()}finally{Zs=t,n.flags&=~zs.RecursedCheck,ec(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:zs.Watching|zs.RecursedCheck,notify(){let e=this.flags;e&zs.Dirty||e&zs.Pending&&qs(this.deps,this)?t():this.flags=zs.Watching},stop(){this.flags=zs.None,this.depsTail=void 0,ec(this)}};return t(),n}var ic=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ac=o(((e,t)=>{t.exports=ic()})),oc=o((e=>{var t=d(),n=ac();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),sc=o(((e,t)=>{t.exports=oc()}))();function cc(e,t){return e===t}function lc(e,t,n=cc){let r=(0,I.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,I.useCallback)(()=>e?.get(),[e]);return(0,sc.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var uc={get(){},subscribe(){return{unsubscribe(){}}}};function dc(e,t){let n=I.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=le(n.current,i):i}}function fc(e){let t=Is(),n=I.useContext(e.from?Rs:Ls),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=dc(e,t),a=lc(r??uc,e=>e?i(e):uc);if(a!==uc)return a;(e.shouldThrow??!0)&&Te()}function pc(e){return fc({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function mc(e){let{select:t,...n}=e;return fc({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function hc(e){return fc({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function gc(e){return fc({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function _c(e){let t=Is();return I.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function vc(e){return fc({...e,select:t=>e.select?e.select(t.context):t.context})}var yc=h();function bc(e,t){let n=Is(),r=Cs(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:ee,onTouchStart:te,ignoreBlocker:ne,params:E,search:ie,hash:ae,state:oe,mask:se,reloadDocument:ce,unsafeRelative:le,from:D,_fromLocation:O,...ue}=e,de=Ns(),k=I.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),pe=lc(n.stores.location,e=>e,(e,t)=>e.href===t.href),A=I.useMemo(()=>{let e={_fromLocation:pe,...k};return n.buildLocation(e)},[n,pe,k]),me=A.maskedLocation?A.maskedLocation.publicHref:A.publicHref,he=A.maskedLocation?A.maskedLocation.external:A.external,ge=I.useMemo(()=>kc(me,he,n.history,v),[v,he,me,n.history]),_e=I.useMemo(()=>
12{if(ge?.external)return ve(ge.href,n.protocolAllowlist)?void 0:ge.href;if(!Ac(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ve(s,n.protocolAllowlist)?void 0:s}catch{}},[s,ge,n.protocolAllowlist]),ye=I.useMemo(()=>{if(_e)return!1;if(o?.exact){if(!rt(pe.pathname,A.pathname,n.basepath))return!1}else{let e=nt(pe.pathname,n.basepath),t=nt(A.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!fe(pe.search,A.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?de&&pe.hash===A.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,pe,_e,de,A.hash,A.pathname,A.search,n.basepath]),be=ye?re(i,{})??Sc:xc,xe=ye?xc:re(a,{})??xc,Se=[b,be.className,xe.className].filter(Boolean).join(` `),Ce=(y||be.style||xe.style)&&{...y,...be.style,...xe.style},[we,Te]=I.useState(!1),Ee=I.useRef(!1),De=e.reloadDocument||_e?!1:c??n.options.defaultPreload,Oe=l??n.options.defaultPreloadDelay??0,ke=I.useCallback(()=>{n.preloadRoute({...k,_builtLocation:A}).catch(e=>{console.warn(e),console.warn(Fn)})},[n,k,A]);Ss(r,I.useCallback(e=>{e?.isIntersecting&&ke()},[ke]),Dc,{disabled:!!v||De!==`viewport`}),I.useEffect(()=>{Ee.current||!v&&De===`render`&&(ke(),Ee.current=!0)},[v,ke,De]);let Ae=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Mc(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,yc.flushSync)(()=>{Te(!0)});let t=n.subscribe(`onResolved`,()=>{t(),Te(!1)});n.navigate({...k,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:ne})}};if(_e)return{...ue,ref:r,href:_e,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...ee&&{onMouseLeave:ee},...te&&{onTouchStart:te}};let je=e=>{if(v||De!==`intent`)return;if(!Oe){ke();return}let t=e.currentTarget;if(Ec.has(t))return;let n=setTimeout(()=>{Ec.delete(t),ke()},Oe);Ec.set(t,n)},Me=e=>{v||De!==`intent`||ke()},Ne=e=>{if(v||!De||!Oe)return;let t=e.currentTarget,n=Ec.get(t);n&&(clearTimeout(n),Ec.delete(t))};return{...ue,...be,...xe,href:ge?.href,ref:r,onClick:Oc([x,Ae]),onBlur:Oc([S,Ne]),onFocus:Oc([C,je]),onMouseEnter:Oc([w,je]),onMouseLeave:Oc([ee,Ne]),onTouchStart:Oc([te,Me]),disabled:!!v,target:_,...Ce&&{style:Ce},...Se&&{className:Se},...v&&Cc,...ye&&wc,...de&&we&&Tc}}var xc={},Sc={className:`active`},Cc={role:`link`,"aria-disabled":!0},wc={"data-status":`active`,"aria-current":`page`},Tc={"data-transitioning":`transitioning`},Ec=new WeakMap,Dc={rootMargin:`100px`},Oc=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function kc(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ac(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var jc=I.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=bc(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return I.createElement(`a`,t,o)}return I.createElement(n,a,o)});function Mc(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Nc=class extends Hn{constructor(e){super(e),this.useMatch=e=>fc({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>vc({...e,from:this.id}),this.useSearch=e=>gc({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>hc({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>mc({...e,from:this.id}),this.useLoaderData=e=>pc({...e,from:this.id}),this.useNavigate=()=>_c({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,L.jsx)(jc,{ref:t,from:this.fullPath,...e}))}};function Pc(e){return new Nc(e)}var Fc=class extends Un{constructor(e){super(e),this.useMatch=e=>fc({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>vc({...e,from:this.id}),this.useSearch=e=>gc({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>hc({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>mc({...e,from:this.id}),this.useLoaderData=e=>pc({...e,from:this.id}),this.useNavigate=()=>_c({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>
12(0,L.jsx)(jc,{ref:t,from:this.fullPath,...e}))}};function Ic(e){return new Fc(e)}function Lc(e){return new Rc(e,{silent:!0}).createRoute}var Rc=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Pc(e);return t.isRoot=!1,t},this.silent=t?.silent}};function zc(e,t){let n,r,i,a,o=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,pe(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),s=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(ys)ys(o());else throw o();return I.createElement(r,e)};return s.preload=o,s}function Bc(e){let t=Is(),n=`not-found-${lc(t.stores.location,e=>e.pathname)}-${lc(t.stores.status,e=>e)}`;return(0,L.jsx)(ks,{getResetKey:()=>n,onCatch:(t,n)=>{if(lt(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(lt(t))return e.fallback?.(t);throw t},children:e.children})}function Vc(){return(0,L.jsx)(`p`,{children:`Not Found`})}function Hc(e){return(0,L.jsx)(L.Fragment,{children:e.children})}function Uc(e,t,n){return t.options.notFoundComponent?(0,L.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,L.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,L.jsx)(Vc,{})}var Wc=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,Gc=(e,t)=>e[0]===t[0]&&e[1]===t[1],Kc=I.memo(function({matchId:e}){let t=Is(),n=t.stores.matchStores.get(e);n||Te();let r=lc(t.stores.loadedAt,e=>e),i=lc(n,e=>e,Wc);return(0,L.jsx)(qc,{router:t,matchId:e,resetKey:r,matchState:I.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function qc({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,L.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?I.Suspense:Hc,f=s?ks:Hc,p=l?Bc:Hc;return(0,L.jsxs)(i.isRoot?i.options.shellComponent??Hc:Hc,{children:[(0,L.jsx)(Ls.Provider,{value:t,children:(0,L.jsx)(d,{fallback:o,children:(0,L.jsx)(f,{getResetKey:()=>n,errorComponent:s||js,onCatch:(e,t)=>{if(lt(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,L.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return I.createElement(l,e)},children:u||r._displayPending?(0,L.jsx)(Ms,{fallback:o,children:(0,L.jsx)(Yc,{matchId:t})}):(0,L.jsx)(Yc,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Jc,{}),(e.options.scrollRestoration,null)]}):null]})}function Jc(){let e=Is(),t=I.useRef();return bs(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...sn(e.stores.location.get(),r??n)}),t.current=n},[lc(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Yc=I.memo(function({matchId:e}){let t=Is(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||Te();let i=lc(r,e=>e),a=i.routeId,o=t.routesById[a],s=I.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=I.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,L.jsx)(e,{},s):(0,L.jsx)(Xc,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);
12if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=k();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return lt(i.error)||Te(),Uc(t,o,i.error);if(i.status===`redirected`)throw yt(i.error)||Te(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Xc=I.memo(function(){let e=Is(),t=I.useContext(Ls),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=lc(a,e=>[e?.routeId,e?.globalNotFound??!1],Gc),i=lc(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,L.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||Te(),Uc(e,a,void 0);if(!i)return null;let s=(0,L.jsx)(Kc,{matchId:i});return n===`__root__`?(0,L.jsx)(I.Suspense,{fallback:o,children:s}):s});function Zc(){let e=Is(),t=I.useRef({router:e,mounted:!1}),[n,r]=I.useState(!1),i=lc(e.stores.isLoading,e=>e),a=lc(e.stores.hasPending,e=>e),o=xs(i),s=i||n||a,c=xs(s),l=i||a,u=xs(l);return e.startTransition=e=>{r(!0),I.startTransition(()=>{e(),r(!1)})},I.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return et(e.latestLocation.publicHref)!==et(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),bs(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),bs(()=>{o&&!i&&e.emit({type:`onLoad`,...sn(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),bs(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...sn(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),bs(()=>{if(c&&!s){let t=sn(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),$s(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function Qc(){let e=Is(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,L.jsx)(t,{}):null,r=(0,L.jsxs)(typeof document<`u`&&e.ssr?Hc:I.Suspense,{fallback:n,children:[(0,L.jsx)(Zc,{}),(0,L.jsx)($c,{})]});return e.options.InnerWrap?(0,L.jsx)(e.options.InnerWrap,{children:r}):r}function $c(){let e=Is(),t=lc(e.stores.firstId,e=>e),n=lc(e.stores.loadedAt,e=>e),r=t?(0,L.jsx)(Kc,{matchId:t}):null;return(0,L.jsx)(Ls.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,L.jsx)(ks,{getResetKey:()=>n,errorComponent:js,onCatch:void 0,children:r})})}var el=e=>({createMutableStore:nc,createReadonlyStore:nc,batch:$s}),tl=e=>new nl(e),nl=class extends ln{constructor(e){super(e,el)}};function rl({router:e,children:t,...n}
12){oe(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,L.jsx)(Fs.Provider,{value:e,children:t});return e.options.Wrap?(0,L.jsx)(e.options.Wrap,{children:r}):r}function il({router:e,...t}){return(0,L.jsx)(rl,{router:e,...t,children:(0,L.jsx)(Qc,{})})}function al(e){let t=Is();return lc(t.stores.location,dc(e,t))}function ol(e,t){if(t)for(let[n,r]of Object.entries(t))n!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&e.setAttribute(n,typeof r==`boolean`?``:String(r))}function sl(e){let{attrs:t,children:n,nonce:r,preventScriptHoist:i}=e;switch(e.tag){case`title`:return(0,L.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,L.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,L.jsx)(`link`,{...t,precedence:t?.precedence??(t?.rel===`stylesheet`?`default`:void 0),nonce:r,suppressHydrationWarning:!0});case`style`:return e.inlineCss,(0,L.jsx)(`style`,{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case`script`:return(0,L.jsx)(cl,{attrs:t,preventScriptHoist:i,children:n});default:return null}}function cl({attrs:e,children:t,preventScriptHoist:n}){Is();let r=Ns(),i=typeof e?.type==`string`&&e.type!==``&&e.type!==`text/javascript`&&e.type!==`module`;if(I.useEffect(()=>{if(!i){if(e?.src){let t=(()=>{try{let t=document.baseURI||window.location.href;return new URL(e.src,t).href}catch{return e.src}})();for(let e of document.querySelectorAll(`script[src]`))if(e.src===t)return;let n=document.createElement(`script`);return ol(n,e),document.head.appendChild(n),()=>n.remove()}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;for(let e of document.querySelectorAll(`script:not([src])`)){if(!(e instanceof HTMLScriptElement))continue;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;if(e.textContent===t&&i===n&&a===r)return}let i=document.createElement(`script`);return i.textContent=t,ol(i,e),document.head.appendChild(i),()=>i.remove()}}},[e,t,i]),i&&typeof t==`string`)return(0,L.jsx)(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!r){if(e?.src)return(0,L.jsx)(`script`,{...e,suppressHydrationWarning:!0});if(typeof t==`string`)return(0,L.jsx)(`script`,{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var ll=e=>
12{let t=Is(),n=t.options.ssr?.nonce,r=lc(t.stores.matches,e=>e.map(e=>e.meta).filter(e=>e!==void 0),fe),i=I.useMemo(()=>{let e=[],t={},i;for(let a=r.length-1;a>=0;a--){let o=r[a];for(let r=o.length-1;r>=0;r--){let a=o[r];if(a)if(a.title)i||={tag:`title`,children:a.title};else if(`script:ld+json`in a)try{let t=JSON.stringify(a[`script:ld+json`]);e.push({tag:`script`,attrs:{type:`application/ld+json`},children:xe(t)})}catch{}else{let r=a.name??a.property;if(r){if(t[r])continue;t[r]=!0}e.push({tag:`meta`,attrs:{...a,nonce:n}})}}}return i&&e.push(i),n&&e.push({tag:`meta`,attrs:{property:`csp-nonce`,content:n}}),e.reverse(),e},[r,n]),a=lc(t.stores.matches,e=>e.flatMap(e=>e.links??[]).filter(e=>e!==void 0).map(e=>({tag:`link`,attrs:{...e,nonce:n}})),fe),o=lc(t.stores.matches,r=>{let i=t.ssr?.manifest,a=[];return i?(r.forEach(t=>{i.routes[t.routeId]?.css?.forEach(t=>{let r=Vn(t);a.push({tag:`link`,attrs:{rel:`stylesheet`,...r,crossOrigin:In(e,`stylesheet`)??r.crossOrigin,suppressHydrationWarning:!0,nonce:n}})})}),i.inlineStyle&&a.push({tag:`style`,attrs:{...i.inlineStyle.attrs,nonce:n},children:i.inlineStyle.children,inlineCss:!0}),a):a},fe),s=lc(t.stores.matches,r=>{let i=[],a=t.ssr?.manifest;return a&&r.forEach(t=>{a.routes[t.routeId]?.preloads?.forEach(t=>{i.push({tag:`link`,attrs:{...Rn(a,t,e),nonce:n}})})}),i},fe),c=lc(t.stores.matches,e=>e.flatMap(e=>e.styles??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`style`,attrs:{...t,nonce:n},children:e})),fe),l=lc(t.stores.matches,e=>e.flatMap(e=>e.headScripts??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`script`,attrs:{...t,nonce:n},children:e})),fe),u=[];return Bn(u,i),u.push(...s),Bn(u,a),u.push(...o),Bn(u,c),Bn(u,l),u};function ul(e){let t=ll(e.assetCrossOrigin),n=Is().options.ssr?.nonce;return(0,L.jsx)(L.Fragment,{children:t.map(e=>(0,I.createElement)(sl,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}var dl=()=>{let e=Is(),t=e.options.ssr?.nonce,n=n=>{let r=[],i=e.ssr?.manifest;if(!i)return[];for(let e of n){let n=i.routes[e.routeId]?.scripts;if(n)for(let e of n)r.push({tag:`script`,attrs:{...e.attrs,nonce:t},children:e.children,...typeof e.attrs?.src==`string`?{preventScriptHoist:!0}:{}})}return r},r=e=>e.map(e=>e.scripts).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`script`,attrs:{...n,suppressHydrationWarning:!0,nonce:t},children:e})),i=lc(e.stores.matches,n,fe);return fl(e,lc(e.stores.matches,r,fe),i)};function fl(e,t,n){let r=[...t,...n];return(0,L.jsx)(L.Fragment,{children:r.map((e,t)=>(0,I.createElement)(sl,{...e,key:`tsr-scripts-${e.tag}-${t}`}))})}function pl(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function ml(e,t){let n=Object.create(null);if(e)for(let t of Object.keys(e))pl(t)&&(n[t]=e[t]);if(t&&typeof t==`object`)for(let e of Object.keys(t))pl(e)&&(n[e]=t[e]);return n}function hl(e){if(!e)return Object.create(null);let t=Object.create(null);for(let n of Object.keys(e))pl(n)&&(t[n]=e[n]);return t}var gl=()=>{throw Error(`createServerOnlyFn() functions can only be called on the server!`)},_l=(e,t)=>{let n=t||e||{};n.method===void 0&&(n.method=`GET`);let r=e=>_l(void 0,{...n,validator:e,inputValidator:e});return Object.assign(e=>_l(void 0,{...n,...e}),{options:n,middleware:e=>{let t=[...n.middleware||[]];e.map(e=>{b in e?e.options.middleware&&t.push(...e.options.middleware):t.push(e)});let r=_l(void 0,{...n,middleware:t});return r[b]=!0,r},validator:r,inputValidator:r,handler:(...e)=>{let[t,r]=e,i={...n,extractedFn:t,serverFn:r},a=[...i.middleware||[],xl(i)];return t.method=n.method,Object.assign(async e=>{let n=await vl(a,`client`,{...t,...i,data:e?.data,headers:e?.headers,signal:e?.signal,fetch:e?.fetch,context:hl()}),r=bt(n.error);if(r)throw r;if(n.error)throw n.error;return n.result},{...t,method:n.method,__executeServer:async e=>{let n=gl(),r=n.contextAfterGlobalMiddlewares;return await vl(a,`server`,{...t,...e,serverFnMeta:t.serverFnMeta,context:ml(e.context,r),request:n.request}).then(e=>({result:e.result,error:e.error,context:e.sendContext}))}})}})};async function vl(e,t,n){let r=yl([...te()?.functionMiddleware||[],...e]);if(t===`server`){let e=gl({throwIfNotFound:!1});e?.executedRequestMiddlewares&&(r=r.filter(t=>!e.executedRequestMiddlewares.has(t)))}let i=async e=>{let n=r.shift();if(!n)return e;try{let r=`validator`in n.options?n.options.validator:void 0;!r&&`inputValidator`in n.options&&(r=n.options.inputValidator),r&&t===`server`&&(e.data=await bl(r,e.data));let a;if(t===`client`?`client`in n.options&&(a=n.options.client):`server`in n.options&&(a=n.options.server),a){let t=async(t={})=>{let n=await i({...e,...t,context:ml(e.context,t.context),sendContext:ml(e.sendContext,t.sendContext),headers:hs(e.headers,t.headers),_callSiteFetch:e._callSiteFetch,fetch:e._callSiteFetch??t.fetch??e.fetch,result:t.result===void 0?t instanceof Response?t:e.result:t.result,error:t.error??e.error});if(n.error)throw n.error;return n},n=await a({...e,next:t});if(yt(n))return{...e,error:n};if(n instanceof Response)return{...e,result:n};if(!n)throw Error(`User middleware returned undefined. You must call next() or return a result in your middlewares.`);return n}return i(e)}catch(t){return{...e,error:t}}};return i({...n,headers:n.headers||{},sendContext:n.sendContext||{},context:n.context||hl(),_callSiteFetch:n.fetch})}function yl(e,t=100){let n=new Set,r=[],i=(e,a)=>{if(a>t)throw Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);
12e.forEach(e=>{e.options.middleware&&i(e.options.middleware,a+1),n.has(e)||(n.add(e),r.push(e))})};return i(e,0),r}async function bl(e,t){if(e==null)return{};if(`~standard`in e){let n=await e[`~standard`].validate(t);if(n.issues)throw Error(JSON.stringify(n.issues,void 0,2));return n.value}if(`parse`in e)return e.parse(t);if(typeof e==`function`)return e(t);throw Error(`Invalid validator type!`)}function xl(e){return{"~types":void 0,options:{inputValidator:e.validator??e.inputValidator,client:async({next:t,sendContext:n,fetch:r,...i})=>{let a={...i,context:n,fetch:r};return t(await e.extractedFn?.(a))},server:async({next:t,...n})=>{let r=await e.serverFn?.(n);return t({...n,result:r})}}}}for(var Sl=[],Cl=[],wl=Uint8Array,Tl=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,El=0,Dl=Tl.length;El<Dl;++El)Sl[El]=Tl[El],Cl[Tl.charCodeAt(El)]=El;Cl[45]=62,Cl[95]=63;function Ol(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function kl(e,t,n){return(t+n)*3/4-n}function Al(e){var t,n=Ol(e),r=n[0],i=n[1],a=new wl(kl(e,r,i)),o=0,s=i>0?r-4:r,c;for(c=0;c<s;c+=4)t=Cl[e.charCodeAt(c)]<<18|Cl[e.charCodeAt(c+1)]<<12|Cl[e.charCodeAt(c+2)]<<6|Cl[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=Cl[e.charCodeAt(c)]<<2|Cl[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=Cl[e.charCodeAt(c)]<<10|Cl[e.charCodeAt(c+1)]<<4|Cl[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function jl(e){return Sl[e>>18&63]+Sl[e>>12&63]+Sl[e>>6&63]+Sl[e&63]}function Ml(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(jl(r));return i.join(``)}function Nl(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(Ml(e,o,o+a>s?s:o+a));return r===1?(t=e[n-1],i.push(Sl[t>>2]+Sl[t<<4&63]+`==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(Sl[t>>10]+Sl[t>>4&63]+Sl[t<<2&63]+`=`)),i.join(``)}function Pl(e){if(e===void 0)return{};if(!Il(e))throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function Fl(e){if(e===void 0)throw Error(`Client created with undefined deployment address. If you used an environment variable, check that it's set.`);if(typeof e!=`string`)throw Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith(`http:`)||e.startsWith(`https:`)))throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(`.convex.site`))throw Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function Il(e){let t=typeof e==`object`,n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name===`Object`;return t&&r}var Ll=!0,Rl=BigInt(`-9223372036854775808`),zl=BigInt(`9223372036854775807`),Bl=BigInt(`0`),Vl=BigInt(`8`),Hl=BigInt(`256`);function Ul(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function Wl(e){e<Bl&&(e-=Rl+Rl);let t=e.toString(16);t.length%2==1&&(t=`0`+t);let n=new Uint8Array(new ArrayBuffer(8)),r=0;for(let i of t.match(/.{2}/g).reverse())n.set([parseInt(i,16)],r++),e>>=Vl;return Nl(n)}function Gl(e){let t=Al(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=Bl,r=Bl;for(let e of t)n+=BigInt(e)*Hl**r,r++;return n>zl&&(n+=Rl+Rl),n}function Kl(e){if(e<Rl||zl<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);let t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),Nl(new Uint8Array(t))}function ql(e){let t=Al(e);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}var R=DataView.prototype.setBigInt64?Kl:Wl,Jl=DataView.prototype.getBigInt64?ql:Gl,z=1024;function B(e){if(e.length>z)throw Error(`Field name ${e} exceeds maximum field name length ${z}.`);if(e.startsWith(`$`))throw Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<32||n>=127)throw Error(`Field name ${e}
12 has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function V(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return e;if(Array.isArray(e))return e.map(e=>V(e));if(typeof e!=`object`)throw Error(`Unexpected type of ${e}`);let t=Object.entries(e);if(t.length===1){let n=t[0][0];if(n===`$bytes`){if(typeof e.$bytes!=`string`)throw Error(`Malformed $bytes field on ${e}`);return Al(e.$bytes).buffer}if(n===`$integer`){if(typeof e.$integer!=`string`)throw Error(`Malformed $integer field on ${e}`);return Jl(e.$integer)}if(n===`$float`){if(typeof e.$float!=`string`)throw Error(`Malformed $float field on ${e}`);let t=Al(e.$float);if(t.byteLength!==8)throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);let n=new DataView(t.buffer).getFloat64(0,Ll);if(!Ul(n))throw Error(`Float ${n} should be encoded as a number`);return n}if(n===`$set`)throw Error(`Received a Set which is no longer supported as a Convex type.`);if(n===`$map`)throw Error(`Received a Map which is no longer supported as a Convex type.`)}let n={};for(let[t,r]of Object.entries(e))B(t),n[t]=V(r);return n}var Yl=16384;function Xl(e){let t=JSON.stringify(e,(e,t)=>t===void 0?`undefined`:typeof t==`bigint`?`${t.toString()}n`:t);if(t.length>Yl){let e=Yl-14,n=t.codePointAt(e-1);return n!==void 0&&n>65535&&--e,t.substring(0,e)+`[...truncated]`}return t}function Zl(e,t,n,r){if(e===void 0){let e=n&&` (present at path ${n} in original object ${Xl(t)})`;throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e==`bigint`){if(e<Rl||zl<e)throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:R(e)}}if(typeof e==`number`)if(Ul(e)){let t=new ArrayBuffer(8);return new DataView(t).setFloat64(0,e,Ll),{$float:Nl(new Uint8Array(t))}}else return e;if(typeof e==`boolean`||typeof e==`string`)return e;if(e instanceof ArrayBuffer)return{$bytes:Nl(new Uint8Array(e))};if(Array.isArray(e))return e.map((e,r)=>Zl(e,t,n+`[${r}]`,!1));if(e instanceof Set)throw Error(Ql(n,`Set`,[...e],t));if(e instanceof Map)throw Error(Ql(n,`Map`,[...e],t));if(!Il(e)){let r=e?.constructor?.name,i=r?`${r} `:``;throw Error(Ql(n,i,e,t))}let i={},a=Object.entries(e);a.sort(([e,t],[n,r])=>e===n?0:e<n?-1:1);for(let[e,o]of a)o===void 0?r&&(B(e),i[e]=$l(o,t,n+`.${e}`)):(B(e),i[e]=Zl(o,t,n+`.${e}`,!1));return i}function Ql(e,t,n,r){return e?`${t}${Xl(n)} is not a supported Convex type (present at path ${e} in original object ${Xl(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${Xl(n)} is not a supported Convex type.`}function $l(e,t,n){if(e===void 0)return{$undefined:null};if(t===void 0)throw Error(`Programming error. Current value is ${Xl(e)} but original value is undefined`);return Zl(e,t,n,!1)}function H(e){return Zl(e,e,``,!1)}
12var eu=Object.defineProperty,tu=(e,t,n)=>t in e?eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nu=(e,t,n)=>tu(e,typeof t==`symbol`?t:t+``,n),ru,iu,au=Symbol.for(`ConvexError`),ou=class extends (iu=Error,ru=au,iu){constructor(e){super(typeof e==`string`?e:Xl(e)),nu(this,`name`,`ConvexError`),nu(this,`data`),nu(this,ru,!0),this.data=e}},su=`1.42.1`,cu=Object.defineProperty,lu=(e,t,n)=>t in e?cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uu=(e,t,n)=>lu(e,typeof t==`symbol`?t:t+``,n),du=`color:rgb(0, 145, 255)`;function fu(e){switch(e){case`query`:return`Q`;case`mutation`:return`M`;case`action`:return`A`;case`any`:return`?`}}var pu=class{constructor(e){uu(this,`_onLogLineFuncs`),uu(this,`_verbose`),this._onLogLineFuncs={},this._verbose=e.verbose}addLogLineListener(e){let t=Math.random().toString(36).substring(2,15);for(let e=0;e<10&&this._onLogLineFuncs[t]!==void 0;e++)t=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[t]=e,()=>{delete this._onLogLineFuncs[t]}}logVerbose(...e){if(this._verbose)for(let t of Object.values(this._onLogLineFuncs))t(`debug`,`${new Date().toISOString()}`,...e)}log(...e){for(let t of Object.values(this._onLogLineFuncs))t(`info`,...e)}warn(...e){for(let t of Object.values(this._onLogLineFuncs))t(`warn`,...e)}error(...e){for(let t of Object.values(this._onLogLineFuncs))t(`error`,...e)}};function mu(e){let t=new pu(e);return t.addLogLineListener((e,...t)=>{switch(e){case`debug`:console.debug(...t);break;case`info`:console.log(...t);break;case`warn`:console.warn(...t);break;case`error`:console.error(...t);break;default:console.log(...t)}}),t}function hu(e){return new pu(e)}function gu(e,t,n,r,i){let a=fu(n);if(typeof i==`object`&&(i=`ConvexError ${JSON.stringify(i.errorData,null,2)}`),t===`info`){let t=i.match(/^\[.*?\] /);if(t===null){e.error(`[CONVEX ${a}(${r})] Could not parse console.log`);return}let n=i.slice(1,t[0].length-2),o=i.slice(t[0].length);e.log(`%c[CONVEX ${a}(${r})] [${n}]`,du,o)}else e.error(`[CONVEX ${a}(${r})] ${i}`)}function _u(e,t){let n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),Error(n)}function vu(e,t,n){return`[CONVEX ${fu(e)}(${t})] ${n.errorMessage}
13  Called by client`}function yu(e,t){return t.data=e.errorData,t}function bu(e){let t=e.split(`:`),n,r;return t.length===1?(n=t[0],r=`default`):(n=t.slice(0,t.length-1).join(`:`),r=t[t.length-1]),n.endsWith(`.js`)&&(n=n.slice(0,-3)),`${n}:${r}`}function xu(e,t){return JSON.stringify({udfPath:bu(e),args:H(t)})}function Su(e,t,n){let{initialNumItems:r,id:i}=n;return JSON.stringify({type:`paginated`,udfPath:bu(e),args:H(t),options:H({initialNumItems:r,id:i})})}function Cu(e){return JSON.parse(e).type===`paginated`}var wu=Object.defineProperty,Tu=(e,t,n)=>t in e?wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Eu=(e,t,n)=>Tu(e,typeof t==`symbol`?t:t+``,n),Du=class{constructor(){Eu(this,`nextQueryId`),Eu(this,`querySetVersion`),Eu(this,`querySet`),Eu(this,`queryIdToToken`),Eu(this,`identityVersion`),Eu(this,`auth`),Eu(this,`outstandingQueriesOlderThanRestart`),Eu(this,`outstandingAuthOlderThanRestart`),Eu(this,`paused`),Eu(this,`pendingQuerySetModifications`),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(e,t,n,r){let i=bu(e),a=xu(i,t),o=this.querySet.get(a);if(o!==void 0)return o.numSubscribers+=1,{queryToken:a,modification:null,unsubscribe:()=>this.removeSubscriber(a)};{let e=this.nextQueryId++,o={id:e,canonicalizedUdfPath:i,args:t,numSubscribers:1,journal:n,componentPath:r};this.querySet.set(a,o),this.queryIdToToken.set(e,a);let s=this.querySetVersion,c=this.querySetVersion+1,l={type:`Add`,queryId:e,udfPath:i,args:[H(t)],journal:n,componentPath:r};return this.paused?this.pendingQuerySetModifications.set(e,l):this.querySetVersion=c,{queryToken:a,modification:{type:`ModifyQuerySet`,baseVersion:s,newVersion:c,modifications:[l]},unsubscribe:()=>this.removeSubscriber(a)}}}transition(e){for(let t of e.modifications)switch(t.type){case`QueryUpdated`:case`QueryFailed`:{this.outstandingQueriesOlderThanRestart.delete(t.queryId);let e=t.journal;if(e!==void 0){let n=this.queryIdToToken.get(t.queryId);n!==void 0&&(this.querySet.get(n).journal=e)}break}case`QueryRemoved`:this.outstandingQueriesOlderThanRestart.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}}queryId(e,t){let n=xu(bu(e),t),r=this.querySet.get(n);return r===void 0?null:r.id}isCurrentOrNewerAuthVersion(e){return e>=this.identityVersion}getAuth(){return this.auth}setAuth(e){this.auth={tokenType:`User`,value:e};let t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:`Authenticate`,baseVersion:t,...this.auth}}setAdminAuth(e,t){let n={tokenType:`Admin`,value:e,impersonating:t};this.auth=n;let r=this.identityVersion;return this.paused||(this.identityVersion=r+1),{type:`Authenticate`,baseVersion:r,...n}}clearAuth(){this.auth=void 0,this.markAuthCompletion();let e=this.identityVersion;return this.paused||(this.identityVersion=e+1),{type:`Authenticate`,tokenType:`None`,baseVersion:e}}hasAuth(){return!!this.auth}isNewAuth(e){return this.auth?.value!==e}queryPath(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).canonicalizedUdfPath:null}queryArgs(e){let t=this.queryIdToToken.get(e);return t?this.querySet.get(t).args:null}queryToken(e){return this.queryIdToToken.get(e)??null}queryJournal(e){return this.querySet.get(e)?.journal}restart(){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();let e=[];for(let t of this.querySet.values()){let n={type:`Add`,queryId:t.id,udfPath:t.canonicalizedUdfPath,args:[H(t.args)],journal:t.journal,componentPath:t.componentPath};e.push(n),this.outstandingQueriesOlderThanRestart.add(t.id)}this.querySetVersion=1;let t={type:`ModifyQuerySet`,baseVersion:0,newVersion:1,modifications:e};if(!this.auth)return this.identityVersion=0,[t,void 0];this.outstandingAuthOlderThanRestart=!0;let n={type:`Authenticate`,baseVersion:0,...this.auth};return this.identityVersion=1,[t,n]}pause(){this.paused=!0}resume(){let e=this.pendingQuerySetModifications.size>0?{type:`ModifyQuerySet`,baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,t=this.auth===void 0?void 0:{type:`Authenticate`,baseVersion:this.identityVersion++,...this.auth};return this.unpause(),[e,t]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(e){let t=this.querySet.get(e);if(t.numSubscribers>1)return--t.numSubscribers,null;{this.querySet.delete(e),this.queryIdToToken.delete(t.id),this.outstandingQueriesOlderThanRestart.delete(t.id);let n=this.querySetVersion,r=this.querySetVersion+1,i={type:`Remove`,queryId:t.id};return this.paused?this.pendingQuerySetModifications.has(t.id)?this.pendingQuerySetModifications.delete(t.id):this.pendingQuerySetModifications.set(t.id,i):this.querySetVersion=r,{type:`ModifyQuerySet`,baseVersion:n,newVersion:r,modifications:[i]}}}},Ou=Object.defineProperty,ku=(e,t,n)=>t in e?Ou(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}
13):e[t]=n,Au=(e,t,n)=>ku(e,typeof t==`symbol`?t:t+``,n),ju=class{constructor(e,t){this.logger=e,this.markConnectionStateDirty=t,Au(this,`inflightRequests`),Au(this,`requestsOlderThanRestart`),Au(this,`inflightMutationsCount`,0),Au(this,`inflightActionsCount`,0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(e,t){let n=new Promise(n=>{let r=t?`Requested`:`NotSent`;this.inflightRequests.set(e.requestId,{message:e,status:{status:r,requestedAt:new Date,onResult:n}}),e.type===`Mutation`?this.inflightMutationsCount++:e.type===`Action`&&this.inflightActionsCount++});return this.markConnectionStateDirty(),n}onResponse(e){let t=this.inflightRequests.get(e.requestId);if(t===void 0||t.status.status===`Completed`)return null;let n=t.message.type===`Mutation`?`mutation`:`action`,r=t.message.udfPath;for(let t of e.logLines)gu(this.logger,`info`,n,r,t);let i=t.status,a,o;if(e.success)a={success:!0,logLines:e.logLines,value:V(e.result)},o=()=>i.onResult(a);else{let t=e.result,{errorData:s}=e;gu(this.logger,`error`,n,r,t),a={success:!1,errorMessage:t,errorData:s===void 0?void 0:V(s),logLines:e.logLines},o=()=>i.onResult(a)}return e.type===`ActionResponse`||!e.success?(o(),this.inflightRequests.delete(e.requestId),this.requestsOlderThanRestart.delete(e.requestId),t.message.type===`Action`?this.inflightActionsCount--:t.message.type===`Mutation`&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:e.requestId,result:a}
13):(t.status={status:`Completed`,result:a,ts:e.ts,onResolve:o},null)}removeCompleted(e){let t=new Map;for(let[n,r]of this.inflightRequests.entries()){let i=r.status;i.status===`Completed`&&i.ts.lessThanOrEqual(e)&&(i.onResolve(),t.set(n,i.result),r.message.type===`Mutation`?this.inflightMutationsCount--:r.message.type===`Action`&&this.inflightActionsCount--,this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n))}return t.size>0&&this.markConnectionStateDirty(),t}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());let e=[];for(let[t,n]of this.inflightRequests){if(n.status.status===`NotSent`){n.status.status=`Requested`,e.push(n.message);continue}if(n.message.type===`Mutation`)e.push(n.message);else if(n.message.type===`Action`){if(this.inflightRequests.delete(t),this.requestsOlderThanRestart.delete(t),this.inflightActionsCount--,n.status.status===`Completed`)throw Error(`Action should never be in 'Completed' state`);n.status.onResult({success:!1,errorMessage:`Connection lost while action was in flight`,logLines:[]})}}return this.markConnectionStateDirty(),e}resume(){let e=[];for(let[,t]of this.inflightRequests)if(t.status.status===`NotSent`){t.status.status=`Requested`,e.push(t.message);continue}return e}hasIncompleteRequests(){for(let e of this.inflightRequests.values())if(e.status.status===`Requested`)return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let e=Date.now();for(let t of this.inflightRequests.values())t.status.status!==`Completed`&&t.status.requestedAt.getTime()<e&&(e=t.status.requestedAt.getTime());return new Date(e)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}},Mu=Symbol.for(`functionName`),Nu=Symbol.for(`toReferencePath`);function Pu(e){return e[Nu]??null}function Fu(e){return e.startsWith(`function://`)}function Iu(e){let t;if(typeof e==`string`)t=Fu(e)?{functionHandle:e}:{name:e};else if(e[Mu])t={name:e[Mu]};else{let n=Pu(e);if(!n)throw Error(`${e} is not a functionReference`);t={reference:n}}return t}function Lu(e){let t=Iu(e);if(t.name===void 0)throw t.functionHandle===void 0?t.reference===void 0?Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`):Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`);if(typeof e==`string`)return e;let n=e[Mu];if(!n)throw Error(`${e} is not a functionReference`);return n}function Ru(e){return{[Mu]:e}}function zu(e=[]){return new Proxy({},{get(t,n){if(typeof n==`string`)return zu([...e,n]);if(n===Mu){if(e.length<2){let t=[`api`,...e].join(`.`);throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``)}let t=e.slice(0,-1).join(`/`),n=e[e.length-1];return n==="default"?t:t+`:`+n}else if(n===Symbol.toStringTag)return`FunctionReference`;else return}})}var Bu=zu(),Vu=Object.defineProperty,Hu=(e,t,n)=>t in e?Vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uu=(e,t,n)=>Hu(e,typeof t==`symbol`?t:t+``,n),Wu=class e{constructor(e){Uu(this,`queryResults`),Uu(this,`modifiedQueries`),this.queryResults=e,this.modifiedQueries=[]}getQuery(t,...n){let r=Pl(n[0]),i=Lu(t),a=this.queryResults.get(xu(i,r));if(a!==void 0)return e.queryValue(a.result)}getAllQueries(t){let n=[],r=Lu(t);for(let t of this.queryResults.values())t.udfPath===bu(r)&&n.push({args:t.args,value:e.queryValue(t.result)});return n}setQuery(e,t,n){let r=Pl(t),i=Lu(e),a=xu(i,r),o;o=n===void 0?void 0:{success:!0,value:n,logLines:[]};let s={udfPath:i,args:r,result:o};this.queryResults.set(a,s),this.modifiedQueries.push(a)}static queryValue(e){if(e!==void 0&&e.success)return e.value}},Gu=class{constructor(){Uu(this,`queryResults`),Uu(this,`optimisticUpdates`),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(e,t){this.optimisticUpdates=this.optimisticUpdates.filter(e=>!t.has(e.mutationId));let n=this.queryResults;this.queryResults=new Map(e);let r=new Wu(this.queryResults);for(let e of this.optimisticUpdates)e.update(r);let i=[];for(let[e,t]of this.queryResults){let r=n.get(e);(r===void 0||r.result!==t.result)&&i.push(e)}return i}applyOptimisticUpdate(e,t){this.optimisticUpdates.push({update:e,mutationId:t});let n=new Wu(this.queryResults);return e(n),n.modifiedQueries}rawQueryResult(e){let t=this.queryResults.get(e);if(t!==void 0)return t.result}queryResult(e){let t=this.queryResults.get(e);if(t===void 0)return;let n=t.result;if(n!==void 0){if(n.success)return n.value;throw n.errorData===void 0?Error(vu(`query`,t.udfPath,n)):yu(n,new ou(vu(`query`,t.udfPath,n)))}}hasQueryResult(e){return this.queryResults.get(e)!==void 0}queryLogs(e){return this.queryResults.get(e)?.result?.logLines}}
13,Ku=Object.defineProperty,qu=(e,t,n)=>t in e?Ku(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ju=(e,t,n)=>qu(e,typeof t==`symbol`?t:t+``,n),Yu=class e{constructor(e,t){Ju(this,`low`),Ju(this,`high`),Ju(this,`__isUnsignedLong__`),this.low=e|0,this.high=t|0,this.__isUnsignedLong__=!0}static isLong(e){return(e&&e.__isUnsignedLong__)===!0}static fromBytesLE(t){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){let e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]}static fromNumber(t){return isNaN(t)||t<0?Xu:t>=$u?U:new e(t%Qu|0,t/Qu|0)}toString(){return(BigInt(this.high)*BigInt(Qu)+BigInt(this.low)).toString()}equals(t){return e.isLong(t)||(t=e.fromValue(t)),this.high>>>31==1&&t.high>>>31==1?!1:this.high===t.high&&this.low===t.low}notEquals(e){return!this.equals(e)}comp(t){return e.isLong(t)||(t=e.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(e){return this.comp(e)<=0}static fromValue(t){return typeof t==`number`?e.fromNumber(t):new e(t.low,t.high)}},Xu=new Yu(0,0),Zu=65536,Qu=Zu*Zu,$u=Qu*Qu,U=new Yu(-1,-1),ed=Object.defineProperty,td=(e,t,n)=>t in e?ed(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nd=(e,t,n)=>td(e,typeof t==`symbol`?t:t+``,n),rd=class{constructor(e,t){nd(this,`version`),nd(this,`remoteQuerySet`),nd(this,`queryPath`),nd(this,`logger`),this.version={querySet:0,ts:Yu.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=e,this.logger=t}transition(e){let t=e.startVersion;if(this.version.querySet!==t.querySet||this.version.ts.notEquals(t.ts)||this.version.identity!==t.identity)throw Error(`Invalid start version: ${t.ts.toString()}:${t.querySet}:${t.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(let t of e.modifications)switch(t.type){case`QueryUpdated`:{let e=this.queryPath(t.queryId);if(e)for(let n of t.logLines)gu(this.logger,`info`,`query`,e,n);let n=V(t.value??null);this.remoteQuerySet.set(t.queryId,{success:!0,value:n,logLines:t.logLines});break}case`QueryFailed`:{let e=this.queryPath(t.queryId);if(e)for(let n of t.logLines)gu(this.logger,`info`,`query`,e,n);let{errorData:n}=t;this.remoteQuerySet.set(t.queryId,{success:!1,errorMessage:t.errorMessage,errorData:n===void 0?void 0:V(n),logLines:t.logLines});break}case`QueryRemoved`:this.remoteQuerySet.delete(t.queryId);break;default:throw Error(`Invalid modification ${t.type}`)}this.version=e.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}};function id(e){let t=Al(e);return Yu.fromBytesLE(Array.from(t))}function ad(e){return Nl(new Uint8Array(e.toBytesLE()))}function od(e){switch(e.type){case`FatalError`:case`AuthError`:case`ActionResponse`:case`TransitionChunk`:case`Ping`:return{...e};case`MutationResponse`:return e.success?{...e,ts:id(e.ts)}:{...e};case`Transition`:return{...e,startVersion:{...e.startVersion,ts:id(e.startVersion.ts)},endVersion:{...e.endVersion,ts:id(e.endVersion.ts)}};default:}}function sd(e){switch(e.type){case`Authenticate`:case`ModifyQuerySet`:case`Mutation`:case`Action`:case`Event`:return{...e};case`Connect`:return e.maxObservedTimestamp===void 0?{...e,maxObservedTimestamp:void 0}:{...e,maxObservedTimestamp:ad(e.maxObservedTimestamp)};default:}}var cd=Object.defineProperty,ld=(e,t,n)=>t in e?cd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ud=(e,t,n)=>ld(e,typeof t==`symbol`?t:t+``,n),dd=1e3,fd=1001,pd=1005,md=4040,hd;function gd(){return hd===void 0&&(hd=Date.now()),typeof performance>`u`||!performance.now?Date.now():Math.round(hd+performance.now())}function _d(){return`t=${Math.round((gd()-hd)/100)/10}s`}var vd={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function yd(e){if(e===void 0)return`Unknown`;for(let t of Object.keys(vd))if(e.startsWith(t))return t;return`Unknown`}var bd=class{constructor(e,t,n,r,i,a){this.markConnectionStateDirty=i,this.debug=a,ud(this,`socket`),ud(this,`connectionCount`),ud(this,`_hasEverConnected`,!1),ud(this,`lastCloseReason`),ud(this,`transitionChunkBuffer`,null),ud(this,`defaultInitialBackoff`),ud(this,`maxBackoff`),ud(this,`retries`),ud(this,`serverInactivityThreshold`),ud(this,`reconnectDueToServerInactivityTimeout`),ud(this,`scheduledReconnect`,null),ud(this,`networkOnlineHandler`,null),ud(this,`pendingNetworkRecoveryInfo`,null),ud(this,`uri`),ud(this,`onOpen`),ud(this,`onResume`),ud(this,`onMessage`),ud(this,`webSocketConstructor`),ud(this,`logger`),ud(this,`onServerDisconnectError`),this.webSocketConstructor=n,this.socket={state:`disconnected`},this.connectionCount=0,this.lastCloseReason=`InitialConnect`,this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=e,this.onOpen=t.onOpen,this.onResume=t.onResume,this.onMessage=t.onMessage,this.onServerDisconnectError=t.onServerDisconnectError,this.logger=r,this.setupNetworkListener(),this.connect()}setSocketState(e){this.socket=e,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${`paused`in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>`u`||typeof window.addEventListener!=`function`||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose(`network online event detected`),this.tryReconnectImmediately()},window.addEventListener(`online`,this.networkOnlineHandler),this._logVerbose(`network online event listener registered`))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<`u`&&typeof window.removeEventListener==`function`&&(window.removeEventListener(`online`,this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose(`network online event listener removed`))}assembleTransition(e){if(e.partNumber<0||e.partNumber>=e.totalParts||e.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==e.totalParts||this.transitionChunkBuffer.transitionId!==e.transitionId))throw this.transitionChunkBuffer=null,Error(`Invalid TransitionChunk`);if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:e.totalParts,transitionId:e.transitionId}),e.partNumber!==this.transitionChunkBuffer.chunks.length){let t=this.transitionChunkBuffer.chunks.length;
13throw this.transitionChunkBuffer=null,Error(`TransitionChunk received out of order: expected part ${t}, got ${e.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(e.chunk),this.transitionChunkBuffer.chunks.length===e.totalParts){let e=this.transitionChunkBuffer.chunks.join(``);this.transitionChunkBuffer=null;let t=od(JSON.parse(e));if(t.type!==`Transition`)throw Error(`Expected Transition, got ${t.type} after assembling chunks`);return t}return null}connect(){if(this.socket.state===`terminated`)return;if(this.socket.state!==`disconnected`&&this.socket.state!==`stopped`)throw Error(`Didn't start connection from disconnected state: `+this.socket.state);let e=new this.webSocketConstructor(this.uri);this._logVerbose(`constructed WebSocket`),this.setSocketState({state:`connecting`,ws:e,paused:`no`}),this.resetServerInactivityTimeout(),e.onopen=()=>{if(this.logger.logVerbose(`begin ws.onopen`),this.socket.state!==`connecting`)throw Error(`onopen called with socket not in connecting state`);if(this.setSocketState({state:`ready`,ws:e,paused:this.socket.paused===`yes`?`uninitialized`:`no`}),this.resetServerInactivityTimeout(),this.socket.paused===`no`&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:gd()})),this.lastCloseReason!==`InitialConnect`&&(this.lastCloseReason?this.logger.log(`WebSocket reconnected at`,_d(),`after disconnect due to`,this.lastCloseReason):this.logger.log(`WebSocket reconnected at`,_d())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){let{timeSavedMs:e}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:`Event`,eventType:`NetworkRecoveryReconnect`,event:{timeSavedMs:e}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(e/1e3)}s of waiting`)}},e.onerror=e=>{this.transitionChunkBuffer=null;let t=e.message;t&&this.logger.log(`WebSocket error message: ${t}`)},e.onmessage=e=>{this.resetServerInactivityTimeout();let t=e.data.length,n=od(JSON.parse(e.data));if(this._logVerbose(`received ws message with type ${n.type}`),n.type!==`Ping`){if(n.type===`TransitionChunk`){let e=this.assembleTransition(n);if(!e)return;n=e,this._logVerbose(`assembled full ws message of type ${n.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${n.type} while buffering TransitionChunks`)),n.type===`Transition`&&this.reportLargeTransition({messageLength:t,transition:n}),this.onMessage(n).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())}},e.onclose=e=>{if(this._logVerbose(`begin ws.onclose`),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=e.reason||`closed with code ${e.code}`),e.code!==dd&&e.code!==fd&&e.code!==pd&&e.code!==md){let t=`WebSocket closed with code ${e.code}`;e.reason&&(t+=`: ${e.reason}`),this.logger.log(t),this.onServerDisconnectError&&e.reason&&this.onServerDisconnectError(t)}let t=yd(e.reason);this.scheduleReconnect(t)}}socketState(){return this.socket.state}sendMessage(e){let t={type:e.type,...e.type===`Authenticate`&&e.tokenType===`User`?{value:`...${e.value.slice(-7)}`}:{}};if(this.socket.state===`ready`&&this.socket.paused===`no`){let n=sd(e),r=JSON.stringify(n),i=!1;try{this.socket.ws.send(r),i=!0}catch(e){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${e}`),this.closeAndReconnect(`FailedToSendMessage`)}return this._logVerbose(`${i?`sent`:`failed to send`} message with type ${e.type}: ${JSON.stringify(t)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${`paused`in this.socket?this.socket.paused:void 0}): ${JSON.stringify(t)}`),!1}resetServerInactivityTimeout(){this.socket.state!==`terminated`&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect(`InactiveServer`)},this.serverInactivityThreshold))}scheduleReconnect(e){this.scheduledReconnect&&=(clearTimeout(this.scheduledReconnect.timeout),null),this.socket={state:`disconnected`};let t=this.nextBackoff(e);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);let n=gd(),r=setTimeout(()=>{this.scheduledReconnect?.timeout===r&&(this.scheduledReconnect=null,this.connect())},t);this.scheduledReconnect={timeout:r,scheduledAt:n,backoffMs:t}}closeAndReconnect(e){switch(this._logVerbose(`begin closeAndReconnect with reason ${e}`),this.socket.state){case`disconnected`:case`terminated`:case`stopped`:return;case`connecting`:case`ready`:this.lastCloseReason=e,this.close(),this.scheduleReconnect(`client`);return;default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case`disconnected`:case`terminated`:case`stopped`:return Promise.resolve();case`connecting`:{let e=this.socket.ws;return e.onmessage=e=>{this._logVerbose(`Ignoring message received after close`)},new Promise(t=>{e.onclose=()=>{this._logVerbose(`Closed after connecting`),t()},e.onopen=()=>{this._logVerbose(`Opened after connecting`),e.close()}})}case`ready`:{this._logVerbose(`ws.close called`);let e=this.socket.ws;e.onmessage=e=>{this._logVerbose(`Ignoring message received after close`)};let t=new Promise(t=>{e.onclose=()=>{t()}});return e.close(),t}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&=(clearTimeout(this.scheduledReconnect.timeout),null),this.cleanupNetworkListener(),this.socket.state){case`terminated`:case`stopped`:case`disconnected`:case`connecting`:case`ready`:{let e=this.close();return this.setSocketState({state:`terminated`}),e}default:throw this.socket,Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case`terminated`:return Promise.resolve();case`connecting`:case`stopped`:case`disconnected`:case`ready`:{this.cleanupNetworkListener();let e=this.close();return this.socket={state:`stopped`},e}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case`stopped`:break;case`terminated`:case`connecting`:case`ready`:case`disconnected`:this.logger.logVerbose(`Restart called without stopping first`);return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case`disconnected`:case`stopped`:case`terminated`:return;case`connecting`:case`ready`:this.socket={...this.socket,paused:`yes`};return;default:this.socket;return}}tryReconnectImmediately(){if(this._logVerbose(`tryReconnectImmediately called`),this.socket.state!==`disconnected`){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let e=null;if(this.scheduledReconnect){let t=gd()-this.scheduledReconnect.scheduledAt;e=Math.max(0,this.scheduledReconnect.backoffMs-t),this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose(`canceled scheduled reconnect`)}this.logger.log(`Network recovery detected, reconnecting immediately`),this.pendingNetworkRecoveryInfo=e===null?null:{timeSavedMs:e},this.connect()}resume(){switch(this.socket.state){case`connecting`:this.socket={...this.socket,paused:`no`};return;case`ready`:this.socket.paused===`uninitialized`?(this.socket={...this.socket,paused:`no`},this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:gd()})):this.socket.paused===`yes`&&(this.socket={...this.socket,paused:`no`},this.onResume());return;case`terminated`:case`stopped`:case`disconnected`:return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state===`ready`,hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(e){this.logger.logVerbose(e)}nextBackoff(e){let t=(e===`client`?100:e===`Unknown`?this.defaultInitialBackoff:vd[e].timeout)*2**this.retries;this.retries+=1;let n=Math.min(t,this.maxBackoff);return n+n*(Math.random()-.5)}reportLargeTransition({transition:e,messageLength:t}){if(e.clientClockSkew===void 0||e.serverTs===void 0)return;let n=gd()-e.clientClockSkew-e.serverTs/1e6,r=`${Math.round(n)}ms`,i=`${Math.round(t/1e4)/100}MB`,a=t/(n/1e3),o=`${Math.round(a/1e4)/100}MB per second`;this._logVerbose(`received ${i} transition in ${r} at ${o}`),t>2e7?this.logger.log(`received query results totaling more that 20MB (${i}
13) which will take a long time to download on slower connections`):n>2e4&&this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${r})`),this.debug&&this.sendMessage({type:`Event`,eventType:`ClientReceivedTransition`,event:{transitionTransitTime:n,messageLength:t}})}};function xd(){return Sd()}function Sd(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var Cd=class extends Error{};Cd.prototype.name=`InvalidTokenError`;function wd(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n=`0`+n),`%`+n}))}function Td(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`base64 string is not of the correct length`)}try{return wd(t)}catch{return atob(t)}}function Ed(e,t){if(typeof e!=`string`)throw new Cd(`Invalid token specified: must be a string`);t||={};let n=t.header===!0?0:1,r=e.split(`.`)[n];if(typeof r!=`string`)throw new Cd(`Invalid token specified: missing part #${n+1}`);let i;try{i=Td(r)}catch(e){throw new Cd(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new Cd(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}var Dd=Object.defineProperty,Od=(e,t,n)=>t in e?Dd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>Od(e,typeof t==`symbol`?t:t+``,n),kd=480*60*60*1e3,Ad=2,jd=class{constructor(e,t,n){W(this,`authState`,{state:`noAuth`}),W(this,`configVersion`,0),W(this,`syncState`),W(this,`authenticate`),W(this,`stopSocket`),W(this,`tryRestartSocket`),W(this,`pauseSocket`),W(this,`resumeSocket`),W(this,`clearAuth`),W(this,`logger`),W(this,`refreshTokenLeewaySeconds`),W(this,`initialAuthTokenReuse`),W(this,`lastRefreshChange`),W(this,`tokenConfirmationAttempts`,0),this.syncState=e,this.authenticate=t.authenticate,this.stopSocket=t.stopSocket,this.tryRestartSocket=t.tryRestartSocket,this.pauseSocket=t.pauseSocket,this.resumeSocket=t.resumeSocket,this.clearAuth=t.clearAuth,this.logger=n.logger,this.refreshTokenLeewaySeconds=n.refreshTokenLeewaySeconds,this.initialAuthTokenReuse=n.initialAuthTokenReuse,this.lastRefreshChange=!1}notifyRefreshChange(e){this.authState.state!==`noAuth`&&this.authState.state!==`initialRefetch`&&this.authState.config.onRefreshChange&&this.lastRefreshChange!==e&&(this.lastRefreshChange=e,this.authState.config.onRefreshChange(e))}async setConfig(e,t,n){this.resetAuthState(),this._logVerbose(`pausing WS for auth token fetch`),this.pauseSocket();let r=await this.fetchTokenAndGuardAgainstRace(e,{forceRefreshToken:!1});if(r.isFromOutdatedConfig)return;let i={fetchToken:e,onAuthChange:t,onRefreshChange:n};r.value?(this.setAuthState({state:`waitingForServerConfirmationOfCachedToken`,config:i,hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:`initialRefetch`,config:i}),await this.refetchToken()),this._logVerbose(`resuming WS after auth token fetch`),this.resumeSocket()}onTransition(e){if(this.syncState.isCurrentOrNewerAuthVersion(e.endVersion.identity)&&!(e.endVersion.identity<=e.startVersion.identity)){if(this._logVerbose(`auth state is ${this.authState.state} when handling transition`),this.syncState.markAuthCompletion(),this.authState.state===`waitingForServerConfirmationOfCachedToken`){this._logVerbose(`server confirmed auth token is valid`);let t=this.syncState.getAuth()?.value;this.initialAuthTokenReuse&&t?this.scheduleTokenRefetch(t,e.clientClockSkew):this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state===`waitingForServerConfirmationOfFreshToken`&&(this._logVerbose(`server confirmed new auth token is valid`),this.notifyRefreshChange(!1),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(e){if(e.authUpdateAttempted===!1&&(this.authState.state===`waitingForServerConfirmationOfFreshToken`||this.authState.state===`waitingForServerConfirmationOfCachedToken`)){this._logVerbose(`ignoring non-auth token expired error`);return}let{baseVersion:t}=e;if(!this.syncState.isCurrentOrNewerAuthVersion(t+1)){this._logVerbose(`ignoring auth error for previous auth attempt`);return}this.tryToReauthenticate(e)}async tryToReauthenticate(e){if(this._logVerbose(`attempting to reauthenticate: ${e.error}
13`),this.authState.state===`noAuth`||this.authState.state===`waitingForServerConfirmationOfFreshToken`&&this.tokenConfirmationAttempts>=Ad){this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!==`noAuth`&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}if(this.authState.state===`waitingForServerConfirmationOfFreshToken`&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${Ad-this.tokenConfirmationAttempts} attempts remaining`)),this.notifyRefreshChange(!0),await this.stopSocket(),this.authState.state===`noAuth`)return;let t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value&&this.syncState.isNewAuth(t.value)?(this.authenticate(t.value),this.setAuthState({state:`waitingForServerConfirmationOfFreshToken`,config:this.authState.config,token:t.value,hadAuth:this.authState.state===`notRefetching`||this.authState.state===`waitingForScheduledRefetch`})):(this._logVerbose(`reauthentication failed, could not fetch a new token`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}
13async refetchToken(){if(this.authState.state===`noAuth`)return;this._logVerbose(`refetching auth token`);let e=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});e.isFromOutdatedConfig||(e.value?this.syncState.isNewAuth(e.value)?(this.setAuthState({state:`waitingForServerConfirmationOfFreshToken`,hadAuth:this.syncState.hasAuth(),token:e.value,config:this.authState.config}),this.authenticate(e.value)):this.setAuthState({state:`notRefetching`,config:this.authState.config}):(this._logVerbose(`refetching token failed`),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose(`restarting WS after auth token fetch (if currently stopped)`),this.tryRestartSocket())}scheduleTokenRefetch(e,t){if(this.authState.state===`noAuth`)return;let n=this.decodeToken(e);if(!n){this.logger.error(`Auth token is not a valid JWT, cannot refetch the token`);return}let{iat:r,exp:i}=n;if(!r||!i){this.logger.error(`Auth token does not have required fields, cannot refetch the token`);return}let a=i-r;if(a<=2){this.logger.error(`Auth token does not live long enough, cannot refetch the token`);return}let o;t===void 0?o=a:(o=i-(Date.now()-t)/1e3,o<=0&&(o=0));let s=Math.min(kd,(o-this.refreshTokenLeewaySeconds)*1e3);s<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${o}s`),s=0);let c=setTimeout(()=>{this._logVerbose(`running scheduled token refetch`),this.refetchToken()},s);this.setAuthState({state:`waitingForScheduledRefetch`,refetchTokenTimeoutId:c,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${s}ms`)}async fetchTokenAndGuardAgainstRace(e,t){let n=++this.configVersion;this._logVerbose(`fetching token with config version ${n}`);let r=await e(t);return this.configVersion===n?{isFromOutdatedConfig:!1,value:r}:(this._logVerbose(`stale config version, expected ${n}, got ${this.configVersion}`),{isFromOutdatedConfig:!0})}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(e){e(!1),this.resetAuthState()}resetAuthState(){this.notifyRefreshChange(!1),this.setAuthState({state:`noAuth`})}setAuthState(e){let t=e.state===`waitingForServerConfirmationOfFreshToken`?{hadAuth:e.hadAuth,state:e.state,token:`...${e.token.slice(-7)}`}:{state:e.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(t)}`),e.state){case`waitingForScheduledRefetch`:case`notRefetching`:case`noAuth`:this.tokenConfirmationAttempts=0;break;case`waitingForServerConfirmationOfFreshToken`:case`waitingForServerConfirmationOfCachedToken`:case`initialRefetch`:break;default:}this.authState.state===`waitingForScheduledRefetch`&&clearTimeout(this.authState.refetchTokenTimeoutId),this.authState=e}decodeToken(e){try{return Ed(e)}catch(e){return this._logVerbose(`Error decoding token: ${e instanceof Error?e.message:`Unknown error`}`),null}}_logVerbose(e){this.logger.logVerbose(`${e} [v${this.configVersion}]`)}},Md=[`convexClientConstructed`,`convexWebSocketOpen`,`convexFirstMessageReceived`];function Nd(e,t){let n={sessionId:t};typeof performance>`u`||!performance.mark||performance.mark(e,{detail:n})}function Pd(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function Fd(e){if(typeof performance>`u`||!performance.getEntriesByName)return[];let t=[];for(let n of Md){let r=performance.getEntriesByName(n).filter(e=>e.entryType===`mark`).filter(t=>t.detail.sessionId===e);t.push(...r)}return t.map(Pd)}var Id=Object.defineProperty,Ld=(e,t,n)=>t in e?Id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rd=(e,t,n)=>Ld(e,typeof t==`symbol`?t:t+``,n),zd=class{constructor(e,t,n){if(Rd(this,`address`),Rd(this,`state`),Rd(this,`requestManager`),Rd(this,`webSocketManager`),Rd(this,`authenticationManager`),Rd(this,`remoteQuerySet`),Rd(this,`optimisticQueryResults`),Rd(this,`_transitionHandlerCounter`,0),Rd(this,`_nextRequestId`),Rd(this,`_onTransitionFns`,new Map),Rd(this,`_sessionId`),Rd(this,`firstMessageReceived`,!1),Rd(this,`debug`),Rd(this,`logger`),Rd(this,`maxObservedTimestamp`),Rd(this,`connectionStateSubscribers`,new Map),Rd(this,`nextConnectionStateSubscriberId`,0),Rd(this,`_lastPublishedConnectionState`),Rd(this,`markConnectionStateDirty`,()=>{Promise.resolve().then(()=>{let e=this.connectionState();if(JSON.stringify(e)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=e;for(let t of this.connectionStateSubscribers.values())t(e)}})}),Rd(this,`mark`,e=>{this.debug&&Nd(e,this.sessionId)}),typeof e==`object`)throw Error(`Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.`);n?.skipConvexDeploymentUrlCheck!==!0&&Fl(e),n={...n};let r=n.authRefreshTokenLeewaySeconds??10,i=n.webSocketConstructor;if(!i&&typeof WebSocket>`u`)throw Error(`No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpCl
13ient`);i||=WebSocket,this.debug=n.reportDebugInfoToConvex??!1,this.address=e,this.logger=n.logger===!1?hu({verbose:n.verbose??!1}):n.logger!==!0&&n.logger?n.logger:mu({verbose:n.verbose??!1});let a=e.search(`://`);if(a===-1)throw Error(`Provided address was not an absolute URL.`);let o=e.substring(a+3),s=e.substring(0,a),c;if(s===`http`)c=`ws`;else if(s===`https`)c=`wss`;else throw Error(`Unknown parent protocol ${s}`);let l=`${c}://${o}/api/${su}/sync`;this.state=new Du,this.remoteQuerySet=new rd(e=>this.state.queryPath(e),this.logger),this.requestManager=new ju(this.logger,this.markConnectionStateDirty);let u=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new jd(this.state,{authenticate:e=>{let t=this.state.setAuth(e);return this.webSocketManager.sendMessage(t),t.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:u,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:r,initialAuthTokenReuse:n.initialAuthTokenReuse??!1}),this.optimisticQueryResults=new Gu,this.addOnTransitionHandler(e=>{t(e.queries.map(e=>e.token))}),this._nextRequestId=0,this._sessionId=xd();let{unsavedChangesWarning:d}=n;if(typeof window>`u`||window.addEventListener===void 0){if(d===!0)throw Error(`unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.`)}else d!==!1&&window.addEventListener(`beforeunload`,e=>{if(this.requestManager.hasIncompleteRequests()){e.preventDefault();let t=`Are you sure you want to leave? Your changes may not be saved.`;return(e||window.event).returnValue=t,t}});this.webSocketManager=new bd(l,{onOpen:e=>{this.mark(`convexWebSocketOpen`),this.webSocketManager.sendMessage({...e,type:`Connect`,sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp}),this.remoteQuerySet=new rd(e=>this.state.queryPath(e),this.logger);let[t,n]=this.state.restart();n&&this.webSocketManager.sendMessage(n),this.webSocketManager.sendMessage(t);for(let e of this.requestManager.restart())this.webSocketManager.sendMessage(e)},onResume:()=>{let[e,t]=this.state.resume();t&&this.webSocketManager.sendMessage(t),e&&this.webSocketManager.sendMessage(e);for(let e of this.requestManager.resume())this.webSocketManager.sendMessage(e)},onMessage:e=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark(`convexFirstMessageReceived`),this.reportMarks()),e.type){case`Transition`:{this.observedTimestamp(e.endVersion.ts),this.authenticationManager.onTransition(e),this.remoteQuerySet.transition(e),this.state.transition(e);let t=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(t);break}case`MutationResponse`:{e.success&&this.observedTimestamp(e.ts);let t=this.requestManager.onResponse(e);t!==null&&this.notifyOnQueryResultChanges(new Map([[t.requestId,t.result]]));break}case`ActionResponse`:this.requestManager.onResponse(e);break;case`AuthError`:this.authenticationManager.onAuthError(e);break;case`FatalError`:{let t=_u(this.logger,e.error);throw this.webSocketManager.terminate(),t}default:}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:n.onServerDisconnectError},i,this.logger,this.markConnectionStateDirty,this.debug),this.mark(`convexClientConstructed`),n.expectAuth&&u()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()&&this.state.hasSyncedPastLastReconnect()}observedTimestamp(e){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(e))&&(this.maxObservedTimestamp=e)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(e){let t=this.remoteQuerySet.remoteQueryResults(),n=new Map;for(let[e,r]of t){let t=this.state.queryToken(e);if(t!==null){let i={result:r,udfPath:this.state.queryPath(e),args:this.state.queryArgs(e)};n.set(t,i)}}let r=this.optimisticQueryResults.ingestQueryResultsFromServer(n,new Set(e.keys()));this.handleTransition({queries:r.map(e=>({token:e,modification:{kind:`Updated`,result:this.optimisticQueryResults.rawQueryResult(e)}})),reflectedMutations:Array.from(e).map(([e,t])=>({requestId:e,result:t})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(e){for(let t of this._onTransitionFns.values())t(e)}addOnTransitionHandler(e){let t=this._transitionHandlerCounter++;return this._onTransitionFns.set(t,e),()=>this._onTransitionFns.delete(t)}getCurrentAuthClaims(){let e=this.state.getAuth(),t={};if(e&&e.tokenType===`User`)try{t=e?Ed(e.value):{}}catch{t={}}else return;return{token:e.value,decoded:t}}setAuth(e,t,n){this.authenticationManager.setConfig(e,t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(e,t){let n=this.state.setAdminAuth(e,t);this.webSocketManager.sendMessage(n)}clearAuth(){let e=this.state.clearAuth();this.webSocketManager.sendMessage(e)}subscribe(e,t,n){let r=Pl(t),{modification:i,queryToken:a,unsubscribe:o}=this.state.subscribe(e,r,n?.journal,n?.componentPath);return i!==null&&this.webSocketManager.sendMessage(i),{queryToken:a,unsubscribe:()=>{let e=o();e&&this.webSocketManager.sendMessage(e)}}}localQueryResult(e,t){let n=xu(e,Pl(t));return this.optimisticQueryResults.queryResult(n)}localQueryResultByToken(e){return this.optimisticQueryResults.queryResult(e)}hasLocalQueryResultByToken(e){return this.optimisticQueryResults.hasQueryResult(e)}localQueryLogs(e,t){let n=xu(e,Pl(t));return this.optimisticQueryResults.queryLogs(n)}queryJournal(e,t){let n=xu(e,Pl(t));return this.state.queryJournal(n)}connectionState(){let e=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:e.isConnected,hasEverConnected:e.hasEverConnected,connectionCount:e.connectionCount,connectionRetries:e.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(e){let t=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(t,e),()=>{this.connectionStateSubscribers.delete(t)}}async mutation(e,t,n){let r=await this.mutationInternal(e,t,n);if(!r.success)throw r.errorData===void 0?Error(vu(`mutation`,e,r)):yu(r,new ou(vu(`mutation`,e,r)));return r.value}async mutationInternal(e,t,n,r){let{mutationPromise:i}=this.enqueueMutation(e,t,n,r);return i}enqueueMutation(e,t,n,r){let i=Pl(t);this.tryReportLongDisconnect();let a=this.nextRequestId;if(this._nextRequestId++,n!==void 0){let e=n.optimisticUpdate;if(e!==void 0){let t=this.optimisticQueryResults.applyOptimisticUpdate(t=>{e(t,i)instanceof Promise&&this.logger.warn(`Optimistic update handler returned a Promise. Optimistic updates should be synchronous.`)},a).map(e=>{let t=this.localQueryResultByToken(e);return{token:e,modification:{kind:`Updated`,result:t===void 0?void 0:{success:!0,value:t,logLines:[]}}}});this.handleTransition({queries:t,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}let o={type:`Mutation`,requestId:a,udfPath:e,componentPath:r,args:[H(i)]},s=this.webSocketManager.sendMessage(o);return{requestId:a,mutationPromise:this.requestManager.request(o,s)}}async action(e,t){let n=await this.actionInternal(e,t);if(!n.success)throw n.errorData===void 0?Error(vu(`action`,e,n)):yu(n,new ou(vu(`action`,e,n)));return n.value}async actionInternal(e,t,n){let r=Pl(t),i=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();let a={type:`Action`,requestId:i,udfPath:e,componentPath:n,args:[H(r)]},o=this.webSocketManager.sendMessage(a);return this.requestManager.request(a,o)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}
13reportMarks(){if(this.debug){let e=Fd(this.sessionId);this.webSocketManager.sendMessage({type:`Event`,eventType:`ClientConnect`,event:e})}}tryReportLongDisconnect(){if(!this.debug)return;let e=this.connectionState().timeOfOldestInflightRequest;if(e===null||Date.now()-e.getTime()<=60*1e3)return;let t=`${this.address}/api/debug_event`;fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`,"Convex-Client":`npm-${su}`},body:JSON.stringify({event:`LongWebsocketDisconnect`})}).then(e=>{e.ok||this.logger.warn(`Analytics request failed with response:`,e.body)}).catch(e=>{this.logger.warn(`Analytics response failed with error:`,e)})}};function Bd(e){if(typeof e!=`object`||!e||!Array.isArray(e.page)||typeof e.isDone!=`boolean`||typeof e.continueCursor!=`string`)throw Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var Vd=Object.defineProperty,Hd=(e,t,n)=>t in e?Vd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ud=(e,t,n)=>Hd(e,typeof t==`symbol`?t:t+``,n),Wd=class{constructor(e,t){this.client=e,this.onTransition=t,Ud(this,`paginatedQuerySet`,new Map),Ud(this,`lastTransitionTs`),this.lastTransitionTs=Yu.fromNumber(0),this.client.addOnTransitionHandler(e=>this.onBaseTransition(e))}subscribe(e,t,n){let r=bu(e),i=Su(r,t,n),a=()=>this.removePaginatedQuerySubscriber(i),o=this.paginatedQuerySet.get(i);return o?(o.numSubscribers+=1,{paginatedQueryToken:i,unsubscribe:a}):(this.paginatedQuerySet.set(i,{token:i,canonicalizedUdfPath:r,args:t,numSubscribers:1,options:{initialNumItems:n.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:n.id}),this.addPageToPaginatedQuery(i,null,n.initialNumItems),{paginatedQueryToken:i,unsubscribe:a})}localQueryResult(e,t,n){let r=Su(bu(e),t,n);return this.localQueryResultByToken(r)}localQueryResultByToken(e){let t=this.paginatedQuerySet.get(e);if(!t)return;let n=this.activePageQueryTokens(t);if(n.length===0)return{results:[],status:`LoadingFirstPage`,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)};let r=[],i=!1,a=!1;for(let e of n){let t=this.client.localQueryResultByToken(e);if(t===void 0){i=!0,a=!1;continue}let n=Bd(t);r=r.concat(n.page),a=!!n.isDone}let o;return o=i?r.length===0?`LoadingFirstPage`:`LoadingMore`:a?`Exhausted`:`CanLoadMore`,{results:r,status:o,loadMore:t=>this.loadMoreOfPaginatedQuery(e,t)}}onBaseTransition(e){let t=e.queries.map(e=>e.token),n=this.queriesContainingTokens(t),r=[];n.length>0&&(this.processPaginatedQuerySplits(n,e=>this.client.localQueryResultByToken(e)),r=n.map(e=>({token:e,modification:{kind:`Updated`,result:this.localQueryResultByToken(e)}})));let i={...e,paginatedQueries:r};this.onTransition(i)}loadMoreOfPaginatedQuery(e,t){this.mustGetPaginatedQuery(e);let n=this.queryTokenForLastPageOfPaginatedQuery(e),r=this.client.localQueryResultByToken(n);if(!r)return!1;let i=Bd(r);if(i.isDone)return!1;this.addPageToPaginatedQuery(e,i.continueCursor,t);let a={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:e,modification:{kind:`Updated`,result:this.localQueryResultByToken(e)}}]};return this.onTransition(a),!0}queriesContainingTokens(e){if(e.length===0)return[];let t=[],n=new Set(e);for(let[e,r]of this.paginatedQuerySet)for(let i of this.allQueryTokens(r))if(n.has(i)){t.push(e);break}return t}processPaginatedQuerySplits(e,t){for(let n of e){let e=this.mustGetPaginatedQuery(n),{ongoingSplits:r,pageKeyToQuery:i,pageKeys:a}=e;for(let[n,[a,o]]of r)t(i.get(a).queryToken)!==void 0&&t(i.get(o).queryToken)!==void 0&&this.completePaginatedQuerySplit(e,n,a,o);for(let n of a){if(r.has(n))continue;let a=i.get(n).queryToken,o=t(a);if(!o)continue;let s=Bd(o);s.splitCursor&&(s.pageStatus===`SplitRecommended`||s.pageStatus===`SplitRequired`||s.page.length>e.options.initialNumItems*2)&&this.splitPaginatedQueryPage(e,n,s.splitCursor,s.continueCursor)}}}splitPaginatedQueryPage(e,t,n,r){let i=e.nextPageKey++,a=e.nextPageKey++,o={cursor:r,numItems:e.options.initialNumItems,id:e.id},s=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...o,cursor:null,endCursor:n}});e.pageKeyToQuery.set(i,s);let c=this.client.subscribe(e.canonicalizedUdfPath,{...e.args,paginationOpts:{...o,cursor:n,endCursor:r}});e.pageKeyToQuery.set(a,c),e.ongoingSplits.set(t,[i,a])}addPageToPaginatedQuery(e,t,n){let r=this.mustGetPaginatedQuery(e),i=r.nextPageKey++,a={cursor:t,numItems:n,id:r.id},o={...r.args,paginationOpts:a},s=this.client.subscribe(r.canonicalizedUdfPath,o);return r.pageKeys.push(i),r.pageKeyToQuery.set(i,s),s}removePaginatedQuerySubscriber(e){let t=this.paginatedQuerySet.get(e);if(t&&(--t.numSubscribers,!(t.numSubscribers>
130))){for(let e of t.pageKeyToQuery.values())e.unsubscribe();this.paginatedQuerySet.delete(e)}}completePaginatedQuerySplit(e,t,n,r){let i=e.pageKeyToQuery.get(t);e.pageKeyToQuery.delete(t);let a=e.pageKeys.indexOf(t);e.pageKeys.splice(a,1,n,r),e.ongoingSplits.delete(t),i.unsubscribe()}activePageQueryTokens(e){return e.pageKeys.map(t=>e.pageKeyToQuery.get(t).queryToken)}allQueryTokens(e){return Array.from(e.pageKeyToQuery.values()).map(e=>e.queryToken)}queryTokenForLastPageOfPaginatedQuery(e){let t=this.mustGetPaginatedQuery(e),n=t.pageKeys[t.pageKeys.length-1];if(n===void 0)throw Error(`No pages for paginated query ${e}`);return t.pageKeyToQuery.get(n).queryToken}mustGetPaginatedQuery(e){let t=this.paginatedQuerySet.get(e);if(!t)throw Error(`paginated query no longer exists for token `+e);return t}},Gd=Object.defineProperty,Kd=(e,t,n)=>t in e?Gd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qd=(e,t,n)=>Kd(e,typeof t==`symbol`?t:t+``,n),Jd,Yd=class{constructor(e,t={}){qd(this,`listeners`),qd(this,`_client`),qd(this,`_paginatedClient`),qd(this,`callNewListenersWithCurrentValuesTimer`),qd(this,`_closed`),qd(this,`_disabled`),t.skipConvexDeploymentUrlCheck!==!0&&Fl(e);let{disabled:n,...r}=t;this._closed=!1,this._disabled=!!n,Jd&&!(`webSocketConstructor`in r)&&typeof WebSocket>`u`&&(r.webSocketConstructor=Jd),typeof window>`u`&&!(`unsavedChangesWarning`in r)&&(r.unsavedChangesWarning=!1),this.disabled||(this._client=new zd(e,()=>{},r),this._paginatedClient=new Wd(this._client,e=>this._transition(e))),this.listeners=new Set}get closed(){return this._closed}get client(){if(this._client)return this._client;throw Error(`ConvexClient is disabled`)}get paginatedClient(){if(this._paginatedClient)return this._paginatedClient;throw Error(`ConvexClient is disabled`)}get disabled(){return this._disabled}onUpdate(e,t,n,r){if(this.disabled)return this.createDisabledUnsubscribe();let{queryToken:i,unsubscribe:a}=this.client.subscribe(Lu(e),t),o={queryToken:i,callback:n,onError:r,unsubscribe:a,hasEverRun:!1,query:e,args:t,paginationOptions:void 0};this.listeners.add(o),this.queryResultReady(i)&&this.callNewListenersWithCurrentValuesTimer===void 0&&(this.callNewListenersWithCurrentValuesTimer=setTimeout(()=>this.callNewListenersWithCurrentValues(),0));let s={unsubscribe:()=>{this.closed||(this.listeners.delete(o),a())},getCurrentValue:()=>this.client.localQueryResultByToken(i),getQueryLogs:()=>this.client.localQueryLogs(i)},c=s.unsubscribe;return Object.assign(c,s),c}onPaginatedUpdate_experimental(e,t,n,r,i){if(this.disabled)return this.createDisabledUnsubscribe();let a={initialNumItems:n.initialNumItems,id:-1},{paginatedQueryToken:o,unsubscribe:s}=this.paginatedClient.subscribe(Lu(e),t,a),c={queryToken:o,callback:r,onError:i,unsubscribe:s,hasEverRun:!1,query:e,args:t,paginationOptions:a};this.listeners.add(c),this.paginatedClient.localQueryResultByToken(o)&&this.callNewListenersWithCurrentValuesTimer===void 0&&(this.callNewListenersWithCurrentValuesTimer=setTimeout(()=>this.callNewListenersWithCurrentValues(),0));let l={unsubscribe:()=>{this.closed||(this.listeners.delete(c),s())},getCurrentValue:()=>this.paginatedClient.localQueryResult(Lu(e),t,a),getQueryLogs:()=>[]},u=l.unsubscribe;return Object.assign(u,l),u}callNewListenersWithCurrentValues(){this.callNewListenersWithCurrentValuesTimer=void 0,this._transition({queries:[],paginatedQueries:[]},!0)}queryResultReady(e){return this.client.hasLocalQueryResultByToken(e)}createDisabledUnsubscribe(){let e=(()=>{});return Object.assign(e,{unsubscribe:e,getCurrentValue:()=>void 0,getQueryLogs:()=>void 0}),e}async close(){if(!this.disabled)return this.listeners.clear(),this._closed=!0,this._paginatedClient&&=void 0,this.client.close()}getAuth(){if(!this.disabled)return this.client.getCurrentAuthClaims()}setAuth(e,t){this.disabled||this.client.setAuth(e,t??(()=>{}))}setAdminAuth(e,t){if(this.closed)throw Error(`ConvexClient has already been closed.`);this.disabled||this.client.setAdminAuth(e,t)}_transition({queries:e,paginatedQueries:t},n=!1){let r=[...e.map(e=>e.token),...t.map(e=>e.token)];for(let e of this.listeners){let{callback:t,queryToken:i,onError:a,hasEverRun:o}=e,s=Cu(i),c=s?!!this.paginatedClient.localQueryResultByToken(i):this.client.hasLocalQueryResultByToken(i);if(r.includes(i)||n&&!o&&c){e.hasEverRun=!0;let n;try{n=s?this.paginatedClient.localQueryResultByToken(i):this.client.localQueryResultByToken(i)}catch(e){if(!(e instanceof Error))throw e;a?a(e,`Second argument to onUpdate onError is reserved for later use`):Prom
13ise.reject(e);continue}t(n,`Second argument to onUpdate callback is reserved for later use`)}}}async mutation(e,t,n){if(this.disabled)throw Error(`ConvexClient is disabled`);return await this.client.mutation(Lu(e),t,n)}async action(e,t){if(this.disabled)throw Error(`ConvexClient is disabled`);return await this.client.action(Lu(e),t)}async query(e,t){if(this.disabled)throw Error(`ConvexClient is disabled`);let n=this.client.localQueryResult(Lu(e),t);return n===void 0?new Promise((n,r)=>{let{unsubscribe:i}=this.onUpdate(e,t,e=>{i(),n(e)},e=>{i(),r(e)})}):Promise.resolve(n)}connectionState(){if(this.disabled)throw Error(`ConvexClient is disabled`);return this.client.connectionState()}subscribeToConnectionState(e){return this.disabled?()=>{}:this.client.subscribeToConnectionState(e)}};function Xd({getCurrentValue:e,subscribe:t}){let[n,r]=(0,I.useState)(()=>({getCurrentValue:e,subscribe:t,value:e()})),i=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(i=e(),r({getCurrentValue:e,subscribe:t,value:i})),(0,I.useEffect)(()=>{let n=!1,i=()=>{n||r(n=>{if(n.getCurrentValue!==e||n.subscribe!==t)return n;let r=e();return n.value===r?n:{...n,value:r}})},a=t(i);return i(),()=>{n=!0,a()}},[e,t]),i}var Zd=Object.defineProperty,Qd=(e,t,n)=>t in e?Zd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$d=(e,t,n)=>Qd(e,typeof t==`symbol`?t:t+``,n),ef=5e3;if(I.default===void 0)throw Error(`Required dependency 'react' not found`);function tf(e,t,n){function r(r){return df(r),t.mutation(e,r,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(r){if(n!==void 0)throw Error(`Already specified optimistic update for mutation ${Lu(e)}`);return tf(e,t,r)},r}function nf(e,t){return function(n){return t.action(e,n)}}var rf=class{constructor(e,t){if($d(this,`address`),$d(this,`cachedSync`),$d(this,`cachedPaginatedQueryClient`),$d(this,`listeners`),$d(this,`options`),$d(this,`closed`,!1),$d(this,`_logger`),$d(this,`adminAuth`),$d(this,`fakeUserIdentity`),e===void 0)throw Error(`No address provided to ConvexReactClient.
14If trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/
15If running locally, make sure to run \`convex dev\` and ensure the .env.local file is populated.`);if(typeof e!=`string`)throw Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof e} instead.`);if(!e.includes(`://`))throw Error(`Provided address was not an absolute URL.`);this.address=e,this.listeners=new Map,this._logger=t?.logger===!1?hu({verbose:t?.verbose??!1}):t?.logger!==!0&&t?.logger?t.logger:mu({verbose:t?.verbose??!1}),this.options={...t,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw Error(`ConvexReactClient has already been closed.`);return this.cachedSync?this.cachedSync:(this.cachedSync=new zd(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new Wd(this.cachedSync,e=>this.handleTransition(e)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw Error(`Should already be instantiated`)}setAuth(e,t,n){if(typeof e==`string`)throw Error(`Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.`);this.sync.setAuth(e,t??(()=>{}),n)}clearAuth(){this.sync.clearAuth()}setAdminAuth(e,t){if(this.adminAuth=e,this.fakeUserIdentity=t,this.closed)throw Error(`ConvexReactClient has already been closed.`);this.cachedSync&&this.sync.setAdminAuth(e,t)}watchQuery(e,...t){let[n,r]=t,i=Lu(e);return{onUpdate:e=>{let{queryToken:t,unsubscribe:a}=this.sync.subscribe(i,n,r),o=this.listeners.get(t);return o===void 0?this.listeners.set(t,new Set([e])):o.add(e),()=>{if(this.closed)return;let n=this.listeners.get(t);n.delete(e),n.size===0&&this.listeners.delete(t),a()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(i,n)},localQueryLogs:()=>
15{if(this.cachedSync)return this.cachedSync.localQueryLogs(i,n)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(i,n)}}}prewarmQuery(e){let t=e.extendSubscriptionFor??ef,n=this.watchQuery(e.query,e.args||{}).onUpdate(()=>{});setTimeout(n,t)}watchPaginatedQuery(e,t,n){let r=Lu(e);return{onUpdate:e=>{let{paginatedQueryToken:i,unsubscribe:a}=this.paginatedQueryClient.subscribe(r,t||{},n),o=this.listeners.get(i);return o===void 0?this.listeners.set(i,new Set([e])):o.add(e),()=>{if(this.closed)return;let t=this.listeners.get(i);t.delete(e),t.size===0&&this.listeners.delete(i),a()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(r,t,n)}}mutation(e,...t){let[n,r]=t,i=Lu(e);return this.sync.mutation(i,n,r)}action(e,...t){let n=Lu(e);return this.sync.action(n,...t)}query(e,...t){let n=this.watchQuery(e,...t),r=n.localQueryResult();return r===void 0?new Promise((e,t)=>{let r=n.onUpdate(()=>{r();try{e(n.localQueryResult())}catch(e){t(e)}})}):Promise.resolve(r)}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(e){return this.sync.subscribeToConnectionState(e)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&=void 0,this.cachedSync){let e=this.cachedSync;this.cachedSync=void 0,await e.close()}}handleTransition(e){let t=e.queries.map(e=>e.token),n=e.paginatedQueries.map(e=>e.token);this.transition([...t,...n])}transition(e){for(let t of e){let e=this.listeners.get(t);if(e)for(let t of e)t()}}},af=I.createContext(void 0);function of(){return(0,I.useContext)(af)}var sf=({client:e,children:t})=>I.createElement(af.Provider,{value:e},t);function cf(e,...t){let n=t[0]===`skip`,r=t[0]===`skip`?{}:Pl(t[0]),i=typeof e==`string`?Ru(e):e,a=Lu(i),o=gf((0,I.useMemo)(()=>n?{}:{query:{query:i,args:r}},[JSON.stringify(H(r)),a,n])).query;if(o instanceof Error)throw o;return o}function lf(e){let t=typeof e==`string`?Ru(e):e,n=(0,I.useContext)(af);if(n===void 0)throw Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,I.useMemo)(()=>tf(t,n),[n,Lu(t)])}function uf(e){let t=(0,I.useContext)(af),n=typeof e==`string`?Ru(e):e;if(t===void 0)throw Error("Could not find Convex client! `useAction` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return(0,I.useMemo)(()=>nf(n,t),[t,Lu(n)])}function df(e){if(typeof e==`object`&&e&&`bubbles`in e&&`persist`in e&&`isDefaultPrevented`in e)throw Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var ff=Object.defineProperty,pf=(e,t,n)=>t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mf=(e,t,n)=>pf(e,typeof t==`symbol`?t:t+``,n),hf=class{constructor(e){mf(this,`createWatch`),mf(this,`queries`),mf(this,`listeners`),this.createWatch=e,this.queries={},this.listeners=new Set}setQueries(e){for(let t of Object.keys(e)){let{query:n,args:r,paginationOptions:i}=e[t];if(Lu(n),this.queries[t]===void 0)this.addQuery(t,n,r,i?{paginationOptions:i}:{});else{let e=this.queries[t];(Lu(n)!==Lu(e.query)||JSON.stringify(H(r))!==JSON.stringify(H(e.args))||JSON.stringify(i)!==JSON.stringify(e.paginationOptions))&&(this.removeQuery(t),this.addQuery(t,n,r,i?{paginationOptions:i}:{}))}}for(let t of Object.keys(this.queries))e[t]===void 0&&this.removeQuery(t)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getLocalResults(e){let t={};for(let n of Object.keys(e)){let{query:r,args:i}=e[n],a=e[n].paginationOptions;Lu(r);let o=this.createWatch(r,i,a?{paginationOptions:a}:{}),s;try{s=o.localQueryResult()}catch(e){if(e instanceof Error)s=e;else throw e}t[n]=s}return t}setCreateWatch(e){this.createWatch=e;for(let e of Object.keys(this.queries)){let{query:t,args:n,watch:r,paginationOptions:i}=this.queries[e],a=`journal`in r?r.journal():void 0;this.removeQuery(e),this.addQuery(e,t,n,{...a?{journal:a}:[],...i?{paginationOptions:i}:{}})}}destroy(){for(let e of Object.keys(this.queries))this.removeQuery(e);this.listeners=new Set}addQuery(e,t,n,{paginationOptions:r,journal:i}){if(this.queries[e]!==void 0)throw Error(`Tried to add a new query with identifier ${e} when it already exists.`);let a=this.createWatch(t,n,{...i?{journal:i}:[],...r?{paginationOptions:r}:{}}),o=a.onUpdate(()=>this.notifyListeners());this.queries[e]={query:t,args:n,watch:a,unsubscribe:o,...r?{paginationOptions:r}:{}}}removeQuery(e){let t=this.queries[e];if(t===void 0)throw Error(`No query found with identifier ${e}.`);t.unsubscribe(),delete this.queries[e]}notifyListeners(){for(let e of this.listeners)e()}};function gf(e){let t=of();if(t===void 0)throw Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return _f(e,(0,I.useMemo)(()=>(e,n,{journal:r,paginationOptions:i})=>i?t.watchPaginatedQuery(e,n,i):t.watchQuery(e,n,r?{journal:r}:{}),[t]))}function _f(e,t){let[n]=(0,I.useState)(()=>new hf(t));return n.createWatch!==t&&n.setCreateWatch(t),(0,I.useEffect)(()=>()=>n.destroy(),[n]),Xd((0,I.useMemo)(()=>({getCurrentValue:()=>
15n.getLocalResults(e),subscribe:t=>(n.setQueries(e),n.subscribe(t))}),[n,e]))}var vf=(0,I.createContext)(void 0);function yf(){let e=(0,I.useContext)(vf);if(e===void 0)throw Error("Could not find `ConvexProviderWithAuth` (or `ConvexProviderWithClerk` or `ConvexProviderWithAuth0`) as an ancestor component. This component may be missing, or you might have two instances of the `convex/react` module loaded in your project.");return e}function bf({children:e,client:t,useAuth:n}){let{isLoading:r,isAuthenticated:i,fetchAccessToken:a}=n(),[o,s]=(0,I.useState)(null),[c,l]=(0,I.useState)(!1);r&&o!==null&&(s(null),l(!1)),!r&&!i&&o!==!1&&(s(!1),l(!1));let u=i&&(o??!1);return I.createElement(vf.Provider,{value:{isLoading:o===null,isAuthenticated:u,isRefreshing:c&&u}},I.createElement(xf,{authProviderAuthenticated:i,fetchAccessToken:a,authProviderLoading:r,client:t,setIsConvexAuthenticated:s,setIsRefreshing:l}),I.createElement(sf,{client:t},e),I.createElement(Sf,{authProviderAuthenticated:i,fetchAccessToken:a,authProviderLoading:r,client:t,setIsConvexAuthenticated:s,setIsRefreshing:l}))}function xf({authProviderAuthenticated:e,fetchAccessToken:t,authProviderLoading:n,client:r,setIsConvexAuthenticated:i,setIsRefreshing:a}){return(0,I.useEffect)(()=>{let n=!0;if(e)return r.setAuth(t,e=>{n&&i(()=>e)},e=>{n&&a(e)}),()=>{n=!1,i(e=>e?!1:null),a(!1)}},[e,t,n,r,i,a]),null}function Sf({authProviderAuthenticated:e,fetchAccessToken:t,authProviderLoading:n,client:r,setIsConvexAuthenticated:i,setIsRefreshing:a}){return(0,I.useEffect)(()=>{if(e)return()=>{r.clearAuth(),i(()=>null),a(!1)}},[e,t,n,r,i,a]),null}function Cf({children:e,client:t,authClient:n,initialToken:r}){let i=Tf(n,r);return(0,I.useEffect)(()=>{(async()=>{if(typeof window>`u`||!window.location?.href)return;let e=new URL(window.location.href),t=e.searchParams.get(`ott`);if(t){let r=n;e.searchParams.delete(`ott`),window.history.replaceState({},``,e);let i=(await r.crossDomain.oneTimeToken.verify({token:t})).data?.session;i&&(await n.getSession({fetchOptions:{headers:{Authorization:`Bearer ${i.token}`}}}),r.updateSession())}})()},[n]),(0,L.jsx)(bf,{client:t,useAuth:i,children:(0,L.jsx)(L.Fragment,{children:e})})}var wf=!1;function Tf(e,t){let[n,r]=(0,I.useState)(wf?null:t??null),i=(0,I.useRef)(null);return(0,I.useEffect)(()=>{wf||=!0},[]),(0,I.useMemo)(()=>function(){let{data:t,isPending:a}=e.useSession(),o=t?.session?.id;(0,I.useEffect)(()=>{!t&&!a&&n&&r(null)},[t,a]);let s=(0,I.useCallback)(async({forceRefreshToken:t=!1}={})=>n&&!t?n:(!t&&i.current||(i.current=e.convex.token({fetchOptions:{throw:!1}}).then(({data:e})=>{let t=e?.token||null;return r(t),t}).catch(()=>(r(null),null)).finally(()=>{i.current=null})),i.current),[o]);return(0,I.useMemo)(()=>({isLoading:a&&!n,isAuthenticated:!!t?.session||n!==null,fetchAccessToken:s}),[a,o,s,n])},[e])}var Ef=Object.create(null),Df=e=>({}),Of=new Proxy(Ef,{get(e,t){return Df()[t]??Ef[t]},has(e,t){return t in Df()||t in Ef},set(e,t,n){let r=Df(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=Df(!0);return delete n[t],!0},ownKeys(){let e=Df(!0);return Object.keys(e)}});Of.NODE_ENV;function kf(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return kf(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return kf(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return kf(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return kf(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return kf(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return kf(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return kf(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function Af(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function jf(e){let t=e.split(`
16    at `);return t.length<=1?e:(t.splice(1,1),t.join(`
17    at `))}function Mf(e,t){class n extends e{#e;constructor(...e){if(Af()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=jf(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t}
17,enumerable:!1,configurable:!0}),n}var Nf={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Mf(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:Nf[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var Pf=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Ff=47;function If(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Ff;)t--;return t===e.length?e:e.slice(0,t)}function Lf(e){try{return(If(new URL(e).pathname)||`/`)!==`/`}catch{throw new Pf(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Rf(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new Pf(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof Pf?t:new Pf(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function zf(e,t=`/api/auth`){if(Rf(e),Lf(e))return e;let n=If(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function Bf(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function Vf(e,t,n,r,i){if(e)return zf(e,t);if(r!==!1){let e=Of.BETTER_AUTH_URL||Of.NEXT_PUBLIC_BETTER_AUTH_URL||Of.PUBLIC_BETTER_AUTH_URL||Of.NUXT_PUBLIC_BETTER_AUTH_URL||Of.NUXT_PUBLIC_AUTH_URL||(Of.BASE_URL===`/`?void 0:Of.BASE_URL);if(e)return zf(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&Bf(o,`proto`)&&Bf(a,`host`))try{return zf(`${o}://${a}`,t)}catch{}if(n){let e=Hf(n.url);if(!e)throw new Pf(`Could not get origin from request. Please provide a valid base URL.`);return zf(e,t)}if(typeof window<`u`&&window.location)return zf(window.location.origin,t)}function Hf(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Uf={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Wf=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Gf={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},Kf=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function qf(e){return e instanceof Date&&!isNaN(e.getTime())}function Jf(e){let t=Kf.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return qf(f)?f:null}function Yf(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in Gf)return Gf[s];if(!Wf.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(Uf).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Jf(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function Xf(e,t={strict:!0}){return Yf(e,t)}var Zf=[`javascript:`,`data:`,`vbscript:`];function Qf(e){let t;try{t=new URL(e)}catch{return!0}return!Zf.includes(t.protocol)}var $f={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Qf(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},ep=[],tp=0,np=null,rp=4,ip=globalThis.nanostoresGlobal||={epoch:0},ap=()=>{for(tp=0;tp<ep.length;tp+=rp)ep[tp](ep[tp+1].value,ep[tp+2],ep[tp+3]);ep.length=0},op=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=tp+rp;t<ep.length;)ep[t]===e?ep.splice(t,rp):t+=rp;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){ip.epoch++;let i=!ep.length&&!0;for(let i of t)np?.has(i)||(np?.add(i),ep.push(i,n,e,r));i&&ap()},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},sp=2,cp=5,lp=6,up=10,dp=(e,t,n,r)=>(e.events=e.events||{},e.events[n+up]||(e.events[n+up]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+up](),delete e.events[n+up])}),fp=(e,t)=>dp(e,t,sp,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),pp=1e3,mp=(e,t)=>dp(e,n=>{let r=t(n);r&&e.events[lp].push(r)},cp,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[lp]=[],e.off=()=>{r(),setTimeout(()=>
17{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[lp])t();e.events[lp]=[]}},pp)},()=>{e.listen=n,e.off=r}});function hp(e,t,n){let r=new Set(t);return e.listen((e,i,a)=>{(a===void 0?t.some(t=>e[t]!==i[t]):r.has(a)||r.has(a.split(/\.|\[/)[0]))&&n(e,i,a)})}function gp(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _p(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!_p(e[n],t[n]))return!1;return!0}if(gp(e)&&gp(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!_p(e[r],t[r]))return!1;return!0}return!1}function vp(e,t){return fp(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var yp=Symbol.for(`better-auth:broadcast-channel`),bp=()=>Math.floor(Date.now()/1e3),xp=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:bp()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Sp(e=`better-auth.message`){return globalThis[yp]||(globalThis[yp]=new xp(e)),globalThis[yp]}var Cp=Symbol.for(`better-auth:focus-manager`),wp=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Tp(){return globalThis[Cp]||(globalThis[Cp]=new wp),globalThis[Cp]}var Ep=Symbol.for(`better-auth:online-manager`),Dp=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function Op(){return globalThis[Ep]||(globalThis[Ep]=new Dp),globalThis[Ep]}var kp=()=>Math.floor(Date.now()/1e3),Ap=5;function jp(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||Op().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=kp(),t();return}if(e?.event===`visibilitychange`){if(kp()-c.lastSessionRequest<Ap)return;c.lastSessionRequest=kp(),t();return}t()}},d=e=>{Sp().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Sp().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Tp().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=Op().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=Sp().setup(),c.cleanupFocusSetup=Tp().setup(),c.cleanupOnlineSetup=Op().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var Mp=()=>typeof window>`u`;function Np(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Pp(e){return!e||e.session===null&&e.user===null?null:e}function Fp(e,t){return _p(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function Ip(e,t){let n=op(!1),r,i=e=>s(e),a=op({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});vp(a,Fp);let o=e=>{if(r!==e)return;let t=a.get();r=void 0,!(!t.isPending&&!t.isRefetching)&&a.set({...t,isPending:!1,isRefetching:!1,refetch:i})},s=async t=>{r?.abort();let n=new AbortController;r=n;let s=a.get();a.set({...s,isPending:s.data===null,isRefetching:!0,error:null,refetch:i});try{let r=await e(`/get-session`,{method:`GET`,query:t?.query,signal:n.signal});if(n.signal.aborted){o(n);return}let{data:s,error:c}=Np(r);if(s?.needsRefresh)try{let t=await e(`/get-session`,{method:`POST`,signal:n.signal});if(n.signal.aborted){o(n);return}({data:s,error:c}=Np(t))}catch{if(n.signal.aborted){o(n);return}}if(c){let e=a.get(),t=c?.status===401;a.set({data:t?null:e.data,error:c,isPending:!1,isRefetching:!1,refetch:i});return}let l=Pp(s),u=a.get(),d=u.data!=null&&l!=null&&_p(u.data,l)?u.data:l;a.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(e){if(n.signal.aborted){o(n);return}let t=a.get();a.set({data:t.data,error:e,isPending:!1,isRefetching:!1,refetch:i})}},c=()=>{};return mp(a,()=>{let e;Mp()||(e=setTimeout(()=>{s()},0));let i=jp({fetchSession:s,shouldPollSession:()=>a.get().data!=null,sessionSignal:n,options:t});return i.init(),c=i.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=r;t?.abort(),t&&o(t),i.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>c(e)}}function Lp(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Rp(e,t,n=`.`,r){if(!Lp(t))return Rp(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Lp(a)&&Lp(i[t])?i[t]=Rp(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function zp(e){return(...t)=>t.reduce((t,n)=>Rp(t,n,``,e),{})}var Bp=zp(),Vp=Object.defineProperty,Hp=Object.defineProperties,Up=Object.getOwnPropertyDescriptors,Wp=Object.getOwnPropertySymbols,Gp=Object.prototype.hasOwnProperty,Kp=Object.prototype.propertyIsEnumerable,qp=(e,t,n)=>t in e?Vp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jp=(e,t)=>{for(var n in t||={})Gp.call(t,n)&&qp(e,n,t[n]);if(Wp)for(var n of Wp(t))Kp.call(t,n)&&qp(e,n,t[n]);return e},Yp=(e,t)=>
17Hp(e,Up(t)),Xp=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},Zp=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},Qp=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},$p=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function em(e){if(typeof e==`number`)return new Qp({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new Qp(e);case`exponential`:return new $p(e);default:throw Error(`Invalid retry strategy`)}}var tm=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},nm=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function rm(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return nm.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function im(e){try{return JSON.parse(e),!0}catch{return!1}}function am(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function om(e){try{return JSON.parse(e)}catch{return e}}function sm(e){return typeof e==`function`}function cm(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&sm(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&sm(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function lm(...e){let t={};for(let n of e)if(n)if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}return t}async function um(e){let t=new Headers(lm(e?.headers,await tm(e)));if(!t.has(`content-type`)){let n=dm(e?.body);n&&t.set(`content-type`,n)}return t}function dm(e){return am(e)?`application/json`:null}function fm(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function pm(e,t){let{body:n}=e;return n?!am(n)||typeof n==`string`?n:fm(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function mm(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return vm.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function hm(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var gm=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function _m(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new gm(n.issues);return n.value}var vm=[`get`,`post`,`put`,`patch`,`delete`],ym=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>
17e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await _m(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=Yp(Jp({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=Yp(Jp({},r),{body:i.input?await _m(i.input,n?.body):n?.body,params:i.params?await _m(i.params,n?.params):n?.params,query:i.query?await _m(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),bm=e=>{async function t(t,n){let r=Yp(Jp(Jp({},e),n),{headers:lm(e?.headers,n?.headers),plugins:[...e?.plugins||[],ym(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await wm(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await wm(t,r)}return t},xm=e=>e===`.`||e===`..`;function Sm(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(xm(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function Cm(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];vm.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t));o=o.split(`/`).map(e=>Sm(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var wm=async(e,t)=>{let{hooks:n,url:r,options:i}=await Zp(e,t),a=cm(i),o=new AbortController,s=i.signal??o.signal,c=Cm(r,i),l=await um(i),u=pm(i,l),d=mm(r,i),f=Yp(Jp({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=hm(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(Yp(Jp({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=rm(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??om)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await _m(f.output,r.data));for(let e of n.onSuccess)e&&await e(Yp(Jp({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??om,_=await m.text(),v=im(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:Yp(Jp({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(Yp(Jp({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=em(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await wm(e,Yp(Jp({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new Xp(m.status,m.statusText,v?y:_);return{data:null,error:Yp(Jp({},y),{status:m.status,statusText:m.statusText})}},Tm=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Em=(e,t)=>{let n=`credentials`in Request.prototype,r=Vf(e?.baseURL,e?.basePath,void 0,t)??Tm(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=bm({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?Xf(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[$f],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=Ip(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p}
17,v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=Bp(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function Dm(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function Om(e){return e.charAt(0).toUpperCase()+e.slice(1)}var km=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,Am=/['\u2019]/g;function jm(e){return e.replace(Am,``).match(km)??[]}function Mm(e){return jm(e).map(e=>e.toLowerCase()).join(`-`)}function Nm(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Pm(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||Dm(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(Mm).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Nm(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function Fm(e,t={}){let n=(0,I.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,I.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?hp(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,I.useSyncExternalStore)(a,o,o)}function Im(e){return`use${Om(e)}`}function Lm(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,$store:a,atomListeners:o}=Em(e),s={};for(let[e,t]of Object.entries(r))s[Im(e)]=()=>Fm(t);return Pm({...n,...s,$fetch:i,$store:a},i,t,r,o)}var Rm=Lm({plugins:[{id:`convex`,version:`0.12.5`,$InferServerPlugin:{}},{id:`preview-session-handoff`,getActions:(e,t)=>({updateSession:()=>t.notify(`$sessionSignal`)})}]});function zm(){let{data:e,isPending:t}=Rm.useSession();return{isLoaded:!t,isSignedIn:!!e?.user,user:e?.user??null,userId:e?.user?.id??null}}var Bm=new rf(`https://api.wepaint.ai`),Vm=new Yd(`https://api.wepaint.ai`);function Hm({children:e,initialToken:t}){return(0,L.jsx)(Cf,{client:Bm,authClient:Rm,initialToken:t,children:e})}var Um=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Wm=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Gm=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Km=e=>{let t=Gm(e);return t.charAt(0).toUpperCase()+t.slice(1)},qm={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Jm=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Ym=(0,I.createContext)({}),Xm=()=>(0,I.useContext)(Ym),Zm=(0,I.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Xm()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,I.createElement)(`svg`,{ref:c,...qm,width:t??l??qm.width,height:t??l??qm.height,stroke:e??f,strokeWidth:m,className:Um(`lucide`,p,i),...!a&&!Jm(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,I.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Qm=(e,t)=>{let n=(0,I.forwardRef)(({className:n,...r},i)=>(0,I.createElement)(Zm,{ref:i,iconNode:t,className:Um(`lucide-${Wm(Km(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Km(e),n},$m=Qm(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),eh=Qm(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),th=`renderatl`,nh=`wepaintai-auth`,rh=[`/login`,`/sign-up`,`/api/auth`];function ih({children:e}){let[t,n]=(0,I.useState)(!1),[r,i]=(0,I.useState)(``),[a,o]=(0,I.useState)(``),[s,c]=(0,I.useState)(!0),l=al({select:e=>e.pathname}),u=rh.some(e=>l.startsWith(e));return(0,I.useEffect)(()=>{n(!0),c(!1)},[!1]),u?(0,L.jsx)(L.Fragment,{children:e}):s?null:t?(0,L.jsx)(L.Fragment,{children:e}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`fixed inset-0 bg-black/50 backdrop-blur-sm z-50`}),(0,L.jsx)(`div`,{className:`fixed inset-0 flex items-center justify-center z-50 p-4`,children:(0,L.jsxs)(`div`,{className:`bg-white rounded-2xl shadow-2xl max-w-md w-full p-8 relative`,children:[(0,L.jsx)(`div`,{className:`flex justify-center mb-6`,children:(0,L.jsx)(`div`,{className:`bg-blue-100 p-4 rounded-full`,children:(0,L.jsx)(eh,{className:`h-8 w-8 text-blue-600`})})}),(0,L.jsx)(`h1`,{className:`text-2xl font-bold text-center text-gray-900 mb-2`,children:`Password Required`}),(0,L.jsx)(`p`,{className:`text-gray-600 text-center mb-8`,children:`Please enter the password to access wePaintAI`}),(0,L.jsxs)(`form`,{onSubmit:e=>
17{e.preventDefault(),r===th?(localStorage.setItem(nh,`authenticated`),n(!0),o(``)):(o(`Incorrect password. Please try again.`),i(``))},className:`space-y-4`,children:[(0,L.jsx)(`div`,{children:(0,L.jsx)(`input`,{type:`password`,value:r,onChange:e=>{i(e.target.value),a&&o(``)},placeholder:`Enter password`,className:`w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all`,autoFocus:!0})}),a&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-red-600 text-sm`,children:[(0,L.jsx)($m,{className:`h-4 w-4`}),(0,L.jsx)(`span`,{children:a})]}),(0,L.jsx)(`button`,{type:`submit`,className:`w-full bg-blue-600 text-white py-3 px-4 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all font-medium`,children:`Access App`})]}),(0,L.jsx)(`div`,{className:`absolute -top-1 -left-1 w-20 h-20 bg-blue-100 rounded-full opacity-50 blur-xl`}),(0,L.jsx)(`div`,{className:`absolute -bottom-1 -right-1 w-32 h-32 bg-purple-100 rounded-full opacity-50 blur-xl`})]})})]})}var ah=`/assets/app-CCrC2U6-.css`;function oh(){return(0,L.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50`,children:(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(`h1`,{className:`text-6xl font-bold text-gray-900 mb-4`,children:`404`}),(0,L.jsx)(`h2`,{className:`text-2xl font-semibold text-gray-700 mb-4`,children:`Page Not Found`}),(0,L.jsx)(`p`,{className:`text-gray-600 mb-8`,children:`The page you're looking for doesn't exist.`}),(0,L.jsx)(`a`,{href:`/`,className:`inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors`,children:`Go back to painting`})]})})}var sh=_l({method:`GET`}).handler(ds(`cb2b3e5e1e8306e053224009604ac2548a745898344521b332eb26227a28d58b`)),ch=Ic({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`wePaintAI - AI-Powered Painting App`}],links:[{rel:`stylesheet`,href:ah}]}),beforeLoad:async()=>await sh(),component:lh,notFoundComponent:oh});function lh(){let{token:e}=ch.useRouteContext();return(0,L.jsx)(Hm,{initialToken:e,children:(0,L.jsx)(uh,{children:(0,L.jsx)(ih,{children:(0,L.jsx)(Xc,{})})})})}function uh({children:e}){return(0,L.jsxs)(`html`,{children:[(0,L.jsx)(`head`,{children:(0,L.jsx)(ul,{})}),(0,L.jsxs)(`body`,{children:[e,(0,L.jsx)(dl,{})]})]})}var dh=Lc(`/sign-up`)({beforeLoad:()=>{throw vt({to:`/login`})}}),fh=`modulepreload`,ph=function(e){return`/`+e},mh={},hh=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=ph(t,n),t=s(t),t in mh)return;mh[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fh,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},gh=Lc(`/login`)({validateSearch:e=>({redirect:typeof e.redirect==`string`?e.redirect:void 0}),component:zc(()=>hh(()=>import(`./login-K2OLWr00.js`),__vite__mapDeps([0,1])),`component`)}),_h=Lc(`/`)({component:zc(()=>hh(()=>import(`./routes-B84Cva9Z.js`),__vite__mapDeps([2,1])),`component`)}),vh=dh.update({id:`/sign-up`,path:`/sign-up`,getParentRoute:()=>ch}),yh=gh.update({id:`/login`,path:`/login`,getParentRoute:()=>ch}),bh={IndexRoute:_h.update({id:`/`,path:`/`,getParentRoute:()=>ch}),LoginRoute:yh,SignUpRoute:vh},xh=ch._addFileChildren(bh);function Sh(){return tl({routeTree:xh,scrollRestoration:!0})}async function Ch(){let e=await Sh(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t}
17,t.push(fs),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await vs(e),e}var wh=Ch;async function Th(){let e=await wh();return window.$_TSR?.h(),e}var Eh;function Dh(){return Eh||=Th(),(0,L.jsx)(Ds,{promise:Eh,children:e=>(0,L.jsx)(il,{router:e})})}var Oh=_(),G=typeof window<`u`?window:void 0,kh=typeof globalThis<`u`?globalThis:G;typeof self>`u`&&(kh.self=kh),typeof File>`u`&&(kh.File=function(){});var Ah=kh?.navigator,K=kh?.document,jh=kh?.location,Mh=kh?.fetch,Nh=kh!=null&&kh.XMLHttpRequest&&`withCredentials`in new kh.XMLHttpRequest?kh.XMLHttpRequest:void 0,Ph=kh?.AbortController,Fh=kh?.CompressionStream,Ih=Ah?.userAgent,q=G??{};function Lh(){return!(!G||!1===G.navigator.onLine)}var Rh=`1.398.2`,zh={DEBUG:!1,LIB_VERSION:Rh,LIB_NAME:`web`,JS_SDK_VERSION:Rh};function Bh(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Vh(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){Bh(a,r,i,o,s,`next`,e)}function s(e){Bh(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}function Hh(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Uh=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}};function Wh(e){return typeof e==`string`||e}function Gh(e){return typeof e==`string`?e:void 0}var Kh,qh=function(e){return e.AnonymousId=`anonymous_id`,e.DistinctId=`distinct_id`,e.Props=`props`,e.EnablePersonProcessing=`enable_person_processing`,e.PersonMode=`person_mode`,e.FeatureFlagDetails=`feature_flag_details`,e.FeatureFlags=`feature_flags`,e.FeatureFlagPayloads=`feature_flag_payloads`,e.BootstrapFeatureFlagDetails=`bootstrap_feature_flag_details`,e.BootstrapFeatureFlags=`bootstrap_feature_flags`,e.BootstrapFeatureFlagPayloads=`bootstrap_feature_flag_payloads`,e.OverrideFeatureFlags=`override_feature_flags`,e.Queue=`queue`,e.LogsQueue=`logs_queue`,e.OptedOut=`opted_out`,e.SessionId=`session_id`,e.SessionStartTimestamp=`session_start_timestamp`,e.SessionLastTimestamp=`session_timestamp`,e.PersonProperties=`person_properties`,e.GroupProperties=`group_properties`,e.InstalledAppBuild=`installed_app_build`,e.InstalledAppVersion=`installed_app_version`,e.SessionReplay=`session_replay`,e.SessionReplayEventTriggerActivatedSession=`session_replay_event_trigger_activated_session`,e.SurveyLastSeenDate=`survey_last_seen_date`,e.SurveysSeen=`surveys_seen`,e.Surveys=`surveys`,e.RemoteConfig=`remote_config`,e.FlagsEndpointWasHit=`flags_endpoint_was_hit`,e.DeviceId=`device_id`,e}({}),Jh=function(e){return e.GZipJS=`gzip-js`,e.Base64=`base64`,e}({}),Yh=[`$snapshot`,`$pageview`,`$pageleave`,`$set`,`survey dismissed`,`survey sent`,`survey shown`,`$identify`,`$groupidentify`,`$create_alias`,`$$client_ingestion_warning`,`$web_experiment_applied`,`$feature_enrollment_update`,`$feature_flag_called`],Xh=[`token`],Zh=`NativeGzipValidationError`,Qh=e=>e.length>=2&&e[0]===31&&e[1]===139,$h=(e,t)=>e===Jh.GZipJS||t===Jh.GZipJS||t===`gzip`,eg=e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`,tg=e=>{var t=Error(`Native gzip produced invalid output: `+e);throw t.name=Zh,t},ng=function(){var e=Vh((function*(e,t){18>e.size&&tg(`too-short`);var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());Qh(n)&&n[2]===8||tg(`invalid-header`);var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(Kh)return Kh;Kh=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;Kh[e]=t>>>0}return Kh})(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0})(t)&&tg(`invalid-crc`);var i=t.length>>>0;r.getUint32(4,!0)!==i&&tg(`invalid-size`)}));return function(t,n){return e.apply(this,arguments)}}();
17function rg(){return rg=Vh((function*(e,t,n){t===void 0&&(t=!0);try{var r=new TextEncoder().encode(e),i=new CompressionStream(`gzip`),a=i.writable.getWriter(),o=a.write(r).then((()=>a.close())).catch(function(){var e=Vh((function*(e){try{yield a.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(i.readable).blob(),[c]=yield Promise.all([s,o]);return yield ng(c,r),c}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),rg.apply(this,arguments)}var ig=`amazonbot,amazonproductbot,app.hypefactors.com,applebot,archive.org_bot,awariobot,backlinksextendedbot,baiduspider,bingbot,bingpreview,chrome-lighthouse,dataforseobot,deepscan,duckduckbot,facebookexternal,facebookcatalog,http://yandex.com/bots,hubspot,ia_archiver,leikibot,linkedinbot,meta-externalagent,mj12bot,msnbot,nessus,petalbot,pinterest,prerender,rogerbot,screaming frog,sebot-wa,sitebulb,slackbot,slurp,trendictionbot,turnitin,twitterbot,vercel-screenshot,vercelbot,yahoo! slurp,yandexbot,zoombot,bot.htm,bot.php,(bot;,bot/,crawler,ahrefsbot,ahrefssiteaudit,semrushbot,siteauditbot,splitsignalbot,gptbot,oai-searchbot,chatgpt-user,perplexitybot,better uptime bot,sentryuptimebot,uptimerobot,headlesschrome,cypress,google-hoteladsverifier,adsbot-google,apis-google,duplexweb-google,feedfetcher-google,google favicon,google web preview,google-read-aloud,googlebot,googleother,google-cloudvertexbot,googleweblight,mediapartners-google,storebot-google,google-inspectiontool,bytespider`.split(`,`),ag=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return ig.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))};function Y(e,t){return e.indexOf(t)!==-1}var og=function(e){return e.trim()},sg=function(e){return e.replace(/^\$/,``)},cg=Object.prototype,lg=cg.hasOwnProperty,ug=cg.toString,X=Array.isArray||function(e){return ug.call(e)===`[object Array]`},dg=e=>typeof e==`function`,fg=e=>e===Object(e)&&!X(e),pg=e=>{if(fg(e)){for(var t in e)if(lg.call(e,t))return!1;return!0}return!1},Z=e=>e===void 0,mg=e=>ug.call(e)==`[object String]`,hg=e=>mg(e)&&e.trim().length===0,gg=e=>e===null,Q=e=>Z(e)||gg(e),_g=e=>ug.call(e)==`[object Number]`&&e==e,vg=e=>_g(e)&&e>0,yg=e=>ug.call(e)===`[object Boolean]`,bg=e=>e instanceof FormData,xg=e=>Y(Yh,e),Sg=e=>Y(Xh,e);function Cg(e){return typeof e!=`object`||!e}function wg(e,t){return{}.toString.call(e)===`[object `+t+`]`}function Tg(e){return typeof Event<`u`&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}var Eg=[!0,`true`,1,`1`,`yes`],Dg=e=>Y(Eg,e),Og=[!1,`false`,0,`0`,`no`];function kg(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),_g(e)?e>n?(r.warn(` cannot be  greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),kg(i||n,t,n,r))}var Ag=class{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=kg(e.bucketSize,0,100,e.Ae),this.$e=kg(e.refillRate,0,this.Fe,e.Ae),this.De=kg(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var n=Math.floor((t-e.lastAccess)/this.De);n>0&&(e.tokens=Math.min(e.tokens+n*this.$e,this.Fe),e.lastAccess+=n*this.De)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.Ee[r];return i?this.Ne(i,n):this.Ee[r]=i={tokens:this.Fe,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.Pe)==null||t.call(this,e)),i.tokens===0)}stop(){this.Ee={}}},jg=`Mobile`,Mg=`iOS`,Ng=`Android`,Pg=`Tablet`,Fg=Ng+` `+Pg,Ig=`iPad`,Lg=`Apple`,Rg=Lg+` Watch`,zg=`Safari`,Bg=`BlackBerry`,Vg=`Samsung`,Hg=Vg+`Browser`,Ug=Vg+` Internet`,Wg=`Chrome`,Gg=Wg+` OS`,Kg=Wg+` `+Mg,qg=`Internet Explorer`,Jg=qg+` `+jg,Yg=`Opera`,Xg=Yg+` Mini`,Zg=`Edge`,Qg=`Microsoft `+Zg,$g=`Firefox`,e_=$g+` `+Mg,t_=`Nintendo`,n_=`PlayStation`,r_=`Xbox`,i_=Ng+` `+jg,a_=jg+` `+zg,o_=`Windows`,s_=o_+` Phone`,c_=`Nokia`,l_=`Ouya`,u_=`Generic`,d_=u_+` `+jg.toLowerCase(),f_=u_+` `+Pg.toLowerCase(),p_=`Konqueror`,m_=`Oculus Browser`,h_=`Vivaldi`,g_=`Yandex`,__=`Whale`,v_=`DuckDuckGo`,y_=`Pale Moon`,b_=`Waterfox`,x_=`Brave`,S_=`Google Search App`,C_=`(\\d+(\\.\\d+)?)`,w_=RegExp(`Version/`+C_),T_=new RegExp(r_,`i`),E_=RegExp(n_+` \\w+`,`i`),D_=RegExp(t_+` \\w+`,`i`),O_=RegExp(Bg+`|PlayBook|BB10`,`i`),k_={"NT3.51":`NT 3.11`,"NT4.0":`NT 4.0`,"5.0":`2000`,5.1:`XP`,5.2:`XP`,"6.0":`Vista`,6.1:`7`,6.2:`8`,6.3:`8.1`,6.4:`10`,"10.0":`10`},A_=function(e,t,n,r){return t||=``,function(e){return e!=null&&e.brave?x_:null}(n)||(r!=null&&r.detectGoogleSearchApp&&Y(e,`GSA/`)?S_:Y(e,` OPR/`)&&Y(e,`Mini`)?Xg:Y(e,` OPR/`)?Yg:O_.test(e)?Bg:Y(e,`IE`+jg)||Y(e,`WPDesktop`)?Jg:Y(e,`OculusBrowser`)?m_:Y(e,Hg)?Ug:Y(e,Zg)||Y(e,`Edg/`)?Qg:Y(e,h_+`/`)?h_:Y(e,`YaBrowser/`)?g_:Y(e,__+`/`)?__:Y(e,v_+`/`)||Y(e,`Ddg/`)?v_:Y(e,`FBIOS`)?`Facebook `+jg:Y(e,`UCWEB`)||Y(e,`UCBrowser`)?`UC Browser`:Y(e,`CriOS`)?Kg:Y(e,`CrMo`)||Y(e,Wg)?Wg:Y(e,Ng)&&Y(e,zg)?i_:Y(e,`FxiOS`)?e_:Y(e.toLowerCase(),p_.toLowerCase())?p_:Y(e,x_+`/`)?x_:((e,t)=>t&&Y(t,Lg)||function(e){return Y(e,zg)&&!Y(e,Wg)&&!Y(e,Ng)}(e))(e,t)?Y(e,jg)?a_:zg:Y(e,`PaleMoon/`)?y_:Y(e,b_+`/`)?b_:Y(e,$g)?$g:Y(e,`MSIE`)||Y(e,`Trident/`)?qg:Y(e,`Gecko`)?$g:``)},j_={[Jg]:[RegExp(`rv:`+C_)],[Qg]:[RegExp(Zg+`?\\/`+C_)],[Wg]:[RegExp(`(`+Wg+`|CrMo)\\/`+C_)],[Kg]:[RegExp(`CriOS\\/`+C_)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+C_)],[zg]:[w_],[a_]:[w_],[Yg]:[RegExp(`(Opera|OPR)\\/`+C_)],[$g]:[RegExp($g+`\\/`+C_)],[e_]:[RegExp(`FxiOS\\/`+C_)],[p_]:[RegExp(`Konqueror[:/]?`+C_,`i`)],[Bg]:[RegExp(Bg+` `+C_),w_],[i_]:[RegExp(`android\\s`+C_,`i`)],[Ug]:[RegExp(Hg+`\\/`+C_)],[m_]:[RegExp(`OculusBrowser\\/`+C_)],[h_]:[RegExp(h_+`\\/`+C_)],[g_]:[RegExp(`YaBrowser\\/`+C_)],[__]:[RegExp(__+`\\/`+C_)],[x_]:[RegExp(x_+`\\/`+C_)],[v_]:[RegExp(`(DuckDuckGo|Ddg)\\/`+C_)],[y_]:[RegExp(`PaleMoon\\/`+C_)],[b_]:[RegExp(b_+`\\/`+C_)],[S_]:[RegExp(`GSA\\/`+C_)],[qg]:[RegExp(`(rv:|MSIE )`+C_)],Mozilla:[RegExp(`rv:`+C_)]},M_=function(e,t,n,r){var i=j_[A_(e,t,n,r)];if(Z(i))return null;for(var a=0;i.length>a;a++){var o=e.match(i[a]);if(o)return parseFloat(o[o.length-2])}return null},N_=[[RegExp(r_+`; `+r_+` (.*?)[);]`,`i`),e=>[r_,e&&e[1]||``]],[new RegExp(t_,`i`),[t_,``]],[new RegExp(n_,`i`),[n_,``]],[O_,[Bg,``]],[new RegExp(o_,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[s_,``];if(new RegExp(jg).test(t)&&!/IEMobile\b/.test(t))return[o_+` `+jg,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=k_[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[o_,r]}return[o_,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Mg,[e[3],e[4],e[5]||`0`].join(`.`)]:[Mg,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=Z(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+Ng+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+Ng+`)`,`i`),e=>e&&e[2]?[Ng,[e[2],e[3],e[4]||`0`].join(`.`)]:[Ng,``]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=[`Mac OS X`,``];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||`0`].join(`.`)),t}],[/Mac/i,[`Mac OS X`,``]],[/CrOS/,[Gg,``]],[/Linux|debian/i,[`Linux`,``]]],P_=function(e){return D_.test(e)?t_:E_.test(e)?n_:T_.test(e)?r_:new RegExp(l_,`i`).test(e)?l_:RegExp(`(`+s_+`|WPDesktop)`,`i`).test(e)?s_:/iPad/.test(e)?Ig:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Rg:O_.test(e)?Bg:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(c_,`i`).test(e)?c_:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?`Kindle Fire`:/(Android|ZTE)/i.test(e)?new RegExp(jg).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Ng:Fg:RegExp(`(pda|`+jg+`)`,`i`).test(e)?d_
17:new RegExp(Pg,`i`).test(e)&&!RegExp(Pg+` pc`,`i`).test(e)?f_:``},F_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function I_(e,t){return typeof(n=e)==`string`&&F_.test(n)?e:t();var n}function L_(e){return e&&e.split(`#`)[0]}function R_(e,t){var n=setTimeout(e,t);return n!=null&&n.unref&&n?.unref(),n}var z_=e=>e instanceof Error,B_={trace:{text:`TRACE`,number:1},debug:{text:`DEBUG`,number:5},info:{text:`INFO`,number:9},warn:{text:`WARN`,number:13},error:{text:`ERROR`,number:17},fatal:{text:`FATAL`,number:21}},V_=B_.info;function H_(e){if(yg(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(X(e))return{arrayValue:{values:e.map((e=>H_(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function U_(e){var t=[];for(var n in e){var r=e[n];gg(r)||Z(r)||t.push({key:n,value:H_(r)})}return t}function W_(e,t){var{text:n,number:r}=B_[e.level||`info`]||V_,i=String(Date.now())+`000000`,a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a[`window.id`]=t.windowId),Q(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),Q(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a[`url.full`]=t.currentUrl),t.screenName&&(a[`screen.name`]=t.screenName),t.appState&&(a[`app.state`]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var o=J({},a,e.attributes||{}),s={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:U_(o)};return e.trace_id&&(s.traceId=e.trace_id),e.span_id&&(s.spanId=e.span_id),Z(e.trace_flags)||(s.flags=e.trace_flags),s}function G_(e,t,n){return J({},e.resourceAttributes,{"service.name":e.serviceName||`unknown_service`},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}function K_(e,t,n,r){return{resourceLogs:[{resource:{attributes:U_(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var q_=class{constructor(e,t,n,r,i,a,o){a===void 0&&(a=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=n,this.qe=r,this.Be=i,this.je=a,this.He=o,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(t.maxQueueSize??t.maxBufferSize,t.maxBufferSize),this.Ye=t.flushIntervalMs,this.Ke=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&e!=null&&e.body){var t=this.it(e);if(t!==null)if(t.body){if(this.nt()){var n={record:W_(t,this.qe())};this.Be((()=>this.st(n)))}}else this.Ae.info(`Log was rejected in beforeSend function`)}}it(e){var t=this.Se.beforeSend;if(!t)return e;var n=X(t)?t:[t],r=e;for(var i of n)try{var a=i(r);if(!a)return this.Ae.info(`Log was rejected in beforeSend function`),null;r=a}catch(e){return this.Ae.error(`Error in beforeSend function for log:`,e),null}return r}nt(){if(this.et===void 0)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||=(this.Ae.warn(`captureLog dropping logs: exceeded `+this.et+` logs per `+this.Xe+`ms`),!0),!1)}flush(){var e=this;return Vh((function*(){if(!e._instance.isDisabled)return e.Ue||=e.ot().finally((()=>{e.Ue=null})),e.Ue}))()}ot(){var e=this;return Vh((function*(){e.tt();var t=e._instance.getPersistedProperty(qh.LogsQueue)??[];if(t.length!==0)for(var n=t.length,r=0;t.length>0&&n>r;){e.ze=0;var i=Math.min(t.length,e.Ke),a=t.slice(0,i),o=K_(a.map((e=>e.record)),e.ut(),e.He??e._instance.getLibraryId(),e._instance.getLibraryVersion()),s=yield e._instance.ht(o);if(s.kind===`too-large`&&a.length>1)e.Ke=Math.max(1,Math.floor(a.length/2)),e.Ae.warn(`Received 413 when sending logs batch of size `+a.length+`, reducing batch size to `+e.Ke);else if(s.kind===`retry-later`||(s.kind===`too-large`?e.Ae.warn(`Dropping a single log record after 413 with batch size 1 — the record 
17is larger than the server cap and cannot be split further.`):s.kind===`ok`&&e.Se.maxBatchRecordsPerPost>e.Ke&&(e.Ke=Math.min(e.Se.maxBatchRecordsPerPost,e.Ke+1)),yield e.dt(a.length),t=e._instance.getPersistedProperty(qh.LogsQueue)??[],r+=a.length,s.kind===`fatal`))throw s.error}}))()}dt(e){var t=this;return Vh((function*(){var n=Math.max(0,e-t.ze),r=t._instance.getPersistedProperty(qh.LogsQueue)??[];t._instance.setPersistedProperty(qh.LogsQueue,r.slice(n)),yield t.je()}))()}ut(){return G_(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){if(!this._instance.optedOut){var t=this._instance.getPersistedProperty(qh.LogsQueue)??[];this.Je>t.length||(t.shift(),this.ze++,this.Ae.info(`Logs queue is full, dropping oldest record.`)),t.push(e),this._instance.setPersistedProperty(qh.LogsQueue,t),this.Qe>t.length?this.ct():this.rt()}}ct(e){e===void 0&&(e=this.Ye),this.vt||=R_((()=>{this.vt=void 0,this.rt()}),e)}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*2**e}yt(){var e=this._instance.getPersistedProperty(qh.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return Vh((function*(){t.tt();var n=t.flush().catch((()=>{}));e===void 0?yield n:yield Promise.race([n,new Promise((t=>R_(t,e)))])}))()}flushWithTimeout(e){var t=this;return Vh((function*(){var n=!1,r=t.flush(),i=new Promise((t=>R_((()=>{n=!0,t()}),e)));try{yield Promise.race([r,i])}finally{n&&r.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.Ve=0}),(e=>{this.Ve++,this.Ae.error(`PostHog logs flush failed:`,e)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&=(clearTimeout(this.vt),void 0)}},J_,Y_,X_;function Z_(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return X_&&n.length===Y_||(Y_=n.length,X_=n.reduce(((n,r)=>{J_||={};var i=J_[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,J_[r]=[s,c];break}}return n}),{})),X_}}var Q_=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return Vh((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&X(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),J({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return Vh((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,J({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:Z_(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return J({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},$_=`?`;function ev(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?$_:n,in_app:!0};return Z(r)||(a.lineno=r),Z(i)||(a.colno=i),a}var tv=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?$_:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},nv=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,rv=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,iv=/\((\S*)(?::(\d+))(?::(\d+))\)/,av=(e,t)=>{var n=nv.exec(e);if(n){var[,r,i,a]=n;return ev(t,r,$_,+i,+a)}var o=rv.exec(e);if(o){if(o[2]&&o[2].indexOf(`eval`)===0){var s=iv.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[c,l]=tv(o[1]||$_,o[2]);return ev(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},ov=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,sv=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,cv=(e,t)=>{var n=ov.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=sv.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||$_;return[a,i]=tv(a,i),ev(t,i,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},lv=/\(error: (.*)\)/,uv=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=mg(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?`DOMError`:`DOMException`}getValue(e){var t=e.name||(this.isDOMError(e)?`DOMError`:`DOMException`);return e.message?t+`: `+e.message:t}isDOMException(e){return wg(e,`DOMException`)}isDOMError(e){return wg(e,`DOMError`)}},dv=class{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},fv=class{constructor(){}match(e){return wg(e,`ErrorEvent`)&&e.error!=null}coerce(e,t){return t.apply(e.error)||{type:`ErrorEvent`,value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}},pv=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,mv=class{match(e){return typeof e==`string`}coerce(e,t){var[n,r]=this.getInfos(e);return{type:n??`Error`,value:r??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(pv);return r&&(t=r[1],n=r[2]),[t,n]}},hv=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];
17function gv(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var _v=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:`error`,synthetic:!0}}getType(e){return Tg(e)?e.constructor.name:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+gv(e)}isSeverityLevel(e){return mg(e)&&!hg(e)&&hv.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(z_(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},vv=class{match(e){return Tg(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+gv(e),stack:t.syntheticException?.stack,synthetic:!0}}},yv=class{match(e){return Cg(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},bv=class{match(e){return wg(e,`PromiseRejectionEvent`)||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Tg(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return Cg(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},xv=`$message`,Sv=`$timestamp`,Cv=new Set([xv,Sv]),wv={enabled:!0,max_bytes:32768};function Tv(e){return e?{enabled:e.enabled??wv.enabled,max_bytes:Dv(e.max_bytes,wv.max_bytes)}:J({},wv)}var Ev=class{constructor(e){this.bt=[],this._t=0,this.Se=Tv(e)}setConfig(e){this.Se=Tv(e),this.wt()}add(e){var t=function(e){var t,n;try{n=[],t=JSON.stringify(e,(function(e,t){if(typeof t==`bigint`)return t.toString();if(typeof t!=`function`&&typeof t!=`symbol`){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&typeof t==`object`){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(t))return`[Circular]`;n.push(t)}return t}}))??`null`}catch{return}try{var r=JSON.parse(t);if(!fg(r))return;var i=r,a=i[xv],o=i[Sv];return!mg(a)||a.trim().length===0||!mg(o)&&!_g(o)?void 0:{step:i,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.Se.max_bytes||(this.bt.push({step:t.step,bytes:n}),this._t+=n,this.wt())}}getAttachable(){return this.bt.map((e=>e.step))}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}};function Dv(e,t){if(!_g(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var Ov=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k(t){if(G&&(zh.DEBUG||q.POSTHOG_DEBUG||n)&&!Z(G.console)&&G.console){for(var r=(`__rrweb_original__`in G.console[t])?G.console[t].__rrweb_original__:G.console[t],i=arguments.length,a=Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];r(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`error`,...t)},critical(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning(e){r.error(`You must initialize PostHog before calling `+e)},createLogger:(t,n)=>Ov(e+` `+t,n)};return r},$=Ov(`[PostHog.js]`),kv=$.createLogger,Av=kv(`[ExternalScriptsLoader]`),jv=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Av.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loa
17ding of external scripts is disabled`);var r=K?.querySelectorAll(`script`);if(r){for(var i,a=function(){if(r[o].src===t){var e=r[o];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener(`load`,(t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)})),e.onerror=e=>n(e),{v:void 0})}},o=0;r.length>o;o++)if(i=a())return i.v}var s=()=>{if(!K)return n(`document not found`);var r=K.createElement(`script`);if(r.type=`text/javascript`,r.crossOrigin=`anonymous`,r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,n(void 0,e)},r.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)K.head.appendChild(r);else{var i,a=K.querySelectorAll(`body > script`);a.length>0?(i=a[0].parentNode)==null||i.insertBefore(r,a[0]):K.body.appendChild(r)}};K!=null&&K.body?s():K?.addEventListener(`DOMContentLoaded`,s)};q.__PosthogExtensions__=q.__PosthogExtensions__||{},q.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.strict_script_versioning)r=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`);else{var i=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var a=3e5;i=i+`&t=`+Math.floor(Date.now()/a)*a}r=e.requestRouter.endpointFor(`assets`,i)}jv(e,r,n)}else jv(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},q.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{jv(e,e.requestRouter.endpointFor(`api`,t),n)};var Mv=`$people_distinct_id`,Nv=`$device_id`,Pv=`$device_model`,Fv=`__alias`,Iv=`__timers`,Lv=`$autocapture_disabled_server_side`,Rv=`$heatmaps_enabled_server_side`,zv=`$exception_capture_enabled_server_side`,Bv=`$error_tracking_suppression_rules`,Vv=`$error_tracking_capture_extension_exceptions`,Hv=`$web_vitals_enabled_server_side`,Uv=`$dead_clicks_enabled_server_side`,Wv=`$product_tours_enabled_server_side`,Gv=`$web_vitals_allowed_metrics`,Kv=`$session_recording_remote_config`,qv=`$replay_sample_rate`,Jv=`$replay_override_sampling`,Yv=`$replay_override_linked_flag`,Xv=`$replay_override_url_trigger`,Zv=`$replay_override_event_trigger`,Qv=`$sesid`,$v=`$session_is_sampled`,ey=`$enabled_feature_flags`,ty=`$active_feature_flags`,ny=`$early_access_features`,ry=`$feature_flag_details`,iy=`$feature_flag_payloads`,ay=`$feature_flag_request_id`,oy=`$override_feature_flags`,sy=`$override_feature_flag_payloads`,cy=`$stored_person_properties`,ly=`$stored_group_properties`,uy=`$surveys`,dy=`$surveys_loaded_at`,fy=`$surveys_activated`,py=`ph_product_tours`,my=`$flag_call_reported`,hy=`$flag_call_reported_session_id`,gy=`$feature_flag_errors`,_y=`$feature_flag_evaluated_at`,vy=`$user_state`,yy=`$client_session_props`,by=`$capture_rate_limit`,xy=`$initial_campaign_params`,Sy=`$initial_referrer_info`,Cy=`$initial_person_info`,wy=`$epp`,Ty=`__POSTHOG_TOOLBAR__`,Ey=`$posthog_cookieless`,Dy=`$sdk_debug_extensions_init_method`,Oy=`$sdk_debug_extensions_init_time_ms`,ky=`$sdk_debug_recording_script_not_loaded`,Ay=`PostHog loadExternalDependency extension not found.`,jy=`on_reject`,My=`always`,Ny=`anonymous`,Py=`identified`,Fy=`identified_only`,Iy=`visibilitychange`,Ly=`beforeunload`,Ry=`$pageview`,zy=`$pageleave`,By=`$identify`,Vy=`$groupidentify`;function Hy(e,t){X(e)&&e.forEach(t)}function Uy(e,t){if(!Q(e))if(X(e))e.forEach(t);else if(bg(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)lg.call(e,n)&&t(e[n],n)}var Wy=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function Gy(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Ky=function(e){try{return e()}catch{return}},qy=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){$.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),$.critical(e)}}},Jy=function(e){var t={};return Uy(e,(function(e,n){(mg(e)&&e.length>0||_g(e))&&(t[n]=e)})),t},Yy=[`herokuapp.com`,`vercel.app`,`netlify.app`];function Xy(e){var t=e?.hostname;if(!mg(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of Yy)if(n===r)return!1;return!0}function Zy(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function Qy(e){return e.name===`ph_toolbar_internal`}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return _g(e)&&isFinite(e)&&Math.floor(e)===e});var $y=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/2**8,a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}toString(){for(var e=``,t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);
17if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},eb=class{constructor(){this.S=0,this.C=0,this.I=new rb}generate(){var e=this.generateOrAbort();if(Z(e)){this.S=0;var t=this.generateOrAbort();if(Z(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return $y.fromFieldsV7(this.S,Math.trunc(this.C/2**30),this.C&2**30-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}},tb,nb=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};G&&!Z(G.crypto)&&crypto.getRandomValues&&(nb=e=>crypto.getRandomValues(e));var rb=class{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(nb(this.R),this.O=0),this.R[this.O++]}},ib=()=>ab().toString(),ab=()=>(tb||=new eb).generate(),ob=``,sb=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,cb={N:()=>!!K,D(e){$.error(`cookieStore error: `+e)},A(e){if(K){try{for(var t=e+`=`,n=K.cookie.split(`;`).filter((e=>e.length)),r=0;n.length>r;r++){for(var i=n[r];i.charAt(0)==` `;)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},F(e){var t;try{t=JSON.parse(cb.A(e))||{}}catch{}return t},q(e,t,n,r,i){if(!K)return!1;try{var a=``,o=``,s=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=K),ob)return ob;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),r=Math.min(n.length,8),i=`dmn_chk_`+ib();!ob&&r--;){var a=n.slice(r).join(`.`),o=i+`=1;domain=.`+a+`;path=/`;t.cookie=o+`;max-age=3`,t.cookie.includes(i)&&(t.cookie=o+`;max-age=0`,ob=a)}return ob}(e);if(!n){var r=(e=>{var t=e.match(sb);return t?t[0]:``})(e);r!==n&&$.info(`Warning: cookie subdomain discovery mismatch`,r,n),n=r}return n?`; domain=.`+n:``}return``}(K.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),a=`; expires=`+c.toUTCString()}i&&(o=`; secure`);var l=e+`=`+encodeURIComponent(JSON.stringify(t))+a+`; SameSite=Lax; path=/`+s+o;return l.length>3686.4&&$.warn(`cookieStore warning: large cookie, len=`+l.length),K.cookie=l,!0}catch{return!1}},P(e,t){if(K!=null&&K.cookie)try{cb.q(e,``,-1,t)}catch{return}}},lb=null,ub={N(){if(!gg(lb))return lb;var e=!0;if(Z(G))e=!1;else try{var t=`__mplssupport__`;ub.q(t,`xyz`),ub.A(t)!==`"xyz"`&&(e=!1),ub.P(t)}catch{e=!1}return e||$.error(`localStorage unsupported; falling back to cookie store`),lb=e,e},D(e){$.error(`localStorage error: `+e)},A(e){try{return G?.localStorage.getItem(e)}catch(e){ub.D(e)}return null},F(e){try{return JSON.parse(ub.A(e))||{}}catch{}return null},q(e,t){try{return G?.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){ub.D(e)}return!1},P(e){try{G?.localStorage.removeItem(e)}catch(e){ub.D(e)}}},db=[Nv,`distinct_id`,Qv,$v,wy,Cy,vy],fb={},pb={N:()=>!0,D(e){$.error(`memoryStorage error: `+e)},A:e=>fb[e]||null,F:e=>fb[e]||null,q:(e,t)=>(fb[e]=t,!0),P(e){delete fb[e]}},mb=null,hb={N(){if(!gg(mb))return mb;if(mb=!0,Z(G))mb=!1;else try{var e=`__support__`;hb.q(e,`xyz`),hb.A(e)!==`"xyz"`&&(mb=!1),hb.P(e)}catch{mb=!1}return mb},D(e){$.error(`sessionStorage error: `,e)},A(e){try{return G?.sessionStorage.getItem(e)}catch(e){hb.D(e)}return null},F(e){try{return JSON.parse(hb.A(e))||null}catch{}return null},q(e,t){try{return G?.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){hb.D(e)}return!1},P(e){try{G?.sessionStorage.removeItem(e)}catch(e){hb.D(e)}}},gb=class{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}
17isOptedOut(){return this.Se.cookieless_mode===My||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===jy}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,+!!e,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:`__ph_opt_in_out_`+e)}get St(){var e=this.Ct.A(this.It);return Dg(e)?1:Y(Og,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,t=e===`localStorage`?ub:cb;if(!this.Tt||this.Tt!==t){this.Tt=t;var n=e===`localStorage`?cb:ub;n.A(this.It)&&(this.Tt.A(this.It)||this.optInOut(Dg(n.A(this.It))),n.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[Ah?.doNotTrack,Ah?.msDoNotTrack,q.doNotTrack].some((e=>Dg(e)))}};function _b(e,t){var n,r=e==null||(n=e.config)==null?void 0:n.get_current_url;if(!dg(r))return t;try{var i=r(t);return mg(i)&&i?i:t}catch(e){return $.error(`Error in get_current_url, falling back to window.location.href`,e),t}}var vb=1,yb=3,bb=11;function xb(e){return e instanceof Element&&(e.id===Ty||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function Sb(e){return!!e&&e.nodeType===vb}function Cb(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function wb(e){return!!e&&e.nodeType===yb}function Tb(e){return!!e&&e.nodeType===bb&&Sb(e.host)}function Eb(e){return e?og(e).split(/\s+/):[]}function Db(e,t){var n=function(e){var t,n=G==null||(t=G.location)==null?void 0:t.href;return Z(n)?void 0:_b(e,n)}(t);return!!(n&&e&&e.some((e=>n.match(e))))}function Ob(e){var t=``;switch(typeof e.className){case`string`:t=e.className;break;case`object`:t=(e.className&&`baseVal`in e.className?e.className.baseVal:null)||e.getAttribute(`class`)||``;break;default:t=``}return Eb(t)}function kb(e){return Q(e)?null:og(e).split(/(\s+)/).filter((e=>Qb(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function Ab(e){var t=``;return Wb(e)&&!Gb(e)&&e.childNodes&&e.childNodes.length&&Uy(e.childNodes,(function(e){wb(e)&&e.textContent&&(t+=kb(e.textContent)??``)})),og(t)}function jb(e){return Z(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Mb=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function Nb(e,t){if(Z(t))return!0;var n,r=function(e){if(t.some((t=>function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch{return!1}}(e,t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function Pb(e){var t=e.parentNode;return!(!t||!Sb(t))&&t}var Fb=[`.ph-no-autocapture`,`[data-ph-no-autocapture]`],Ib=[`next`,`previous`,`prev`,`>`,`<`],Lb=[...Ib,`+`,`-`,`−`,`–`],Rb=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,zb=[`.ph-no-rageclick`,`.ph-no-capture`],Bb=[``,`text`,`search`,`email`,`password`,`url`,`tel`,`number`];function Vb(e,t){if(!G||Hb(e))return!1;var n,r,i,a;if(yg(t)?(n=!!t&&zb,r=void 0,i=!1):(n=t?.css_selector_ignorelist??zb,r=t?.content_ignorelist,i=(a=t?.ignore_text_selection)!=null&&a),!1===n||i&&function(e){return!(!e||!Sb(e))&&(!!Cb(e,`textarea`)||(Cb(e,`input`)?Y(Bb,(e.getAttribute(`type`)||``).toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=e.getAttribute==null?void 0:e.getAttribute(`contenteditable`);return t===`true`||t===``}(e)))}(e))return!1;var{targetElementList:o}=Ub(e,!1);return!function(e,t){if(!1===e||Z(e))return!1;var n;if(!0===e)n=Ib;else{if(!X(e))return!1;if(e.length>10)return $.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:r}=e;return n.some((e=>Rb(t,e)||Rb(r,e)))}))}(r,o.map((e=>({safeText:Ab(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!Nb(o,n)}var Hb=e=>!e||Cb(e,`html`)||!Sb(e),Ub=(e,t)=>
17{if(!G||Hb(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!Cb(i,`body`);)if(Tb(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var a=Pb(i);if(!a)break;if(t||Mb.indexOf(a.tagName.toLowerCase())>-1)n=!0;else try{var o=G.getComputedStyle(a);o&&o.getPropertyValue(`cursor`)===`pointer`&&(n=!0)}catch{}r.push(a),i=a}return{parentIsUsefulElement:n,targetElementList:r}};function Wb(e){for(var t=e;t.parentNode&&!Cb(t,`body`);t=t.parentNode){var n=Ob(t);if(Y(n,`ph-sensitive`)||Y(n,`ph-no-capture`))return!1}if(Y(Ob(e),`ph-include`))return!0;var r=e.type||``;if(mg(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}var i=e.name||e.id||``;return!mg(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,``))}function Gb(e){return!!(Cb(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||Cb(e,`select`)||Cb(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var Kb=`(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})`,qb=RegExp(`^(?:`+Kb+`)$`),Jb=new RegExp(Kb),Yb=`\\d{3}-?\\d{2}-?\\d{4}`,Xb=RegExp(`^(`+Yb+`)$`),Zb=RegExp(`(`+Yb+`)`);function Qb(e,t){return t===void 0&&(t=!0),!(Q(e)||mg(e)&&(e=og(e),(t?qb:Jb).test((e||``).replace(/[- ]/g,``))||(t?Xb:Zb).test(e)))}function $b(e){var t=Ab(e);return Qb(t=(t+` `+ex(e)).trim())?t:``}function ex(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&Uy(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=Ab(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+ex(e)).trim())}catch(e){$.error(`[AutoCapture]`,e)}})),t}function tx(e){return e.replace(/"|\\"/g,`\\"`)}function nx(e){var t=e.attr__class;return t?X(t)?t:Eb(t):void 0}var rx=kv(`[Dead Clicks]`),ix=()=>!0,ax=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(Uv)),r=e.instance.config.capture_dead_clicks;return yg(r)?r:!!fg(r)||n},ox=class{get lazyLoadedDeadClicksAutocapture(){return this.Et}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){`captureDeadClicks`in e&&(this.instance.persistence&&this.instance.persistence.register({[Uv]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt((()=>{this.Pt()})):this.stop()}Mt(e){var t,n;(t=q.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture?e():(n=q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?rx.error(`failed to load script`,t):e()}))}Pt(){var e;if(K){if(!this.Et&&(e=q.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=fg(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Et=q.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Et.start(K),rx.info(`starting...`)}}else rx.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,rx.info(`stopping...`))}},sx=kv(`[SegmentIntegration]`),cx=`posthog-js`;function lx(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:a=[`error`],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return t=>{if(a!==`*`&&!a.includes(t.level)||!e.__loaded)return t;t.tags||={};var s=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=s,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var c,l=t.exception?.values||[],u=l.map((e=>J({},e,{stacktrace:e.stacktrace?J({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>J({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:l[0]?.value||t.message,$exception_type:l[0]?.type,$exception_level:t.level,$exception_list:u,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:l[0]?.value||t.message,$sentry_exception_type:l[0]?.type,$sentry_tags:t.tags};return n&&r&&(d.$sentry_url=(i||`https://sentry.io/organizations/`)+n+`/issues/?project=`+r+`&query=`+t.event_id),o&&((c=e.exceptions)==null||c.sendExceptionEvent(d)),t}}var ux=class{constructor(e,t,n,r,i,a){this.name=cx,this.setupOnce=function(o){o(lx(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}
17,dx=class{constructor(e){this.Rt=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength||n.crossTabAdoption)&&($.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){this.Ft=this._instance.sessionManager?.onSessionId(this.Rt)}destroy(){var e;(e=this.Ft)==null||e.call(this),this.Ft=void 0}doPageView(e,t){var n=this.At(e,t);return this.Ot={pathname:G?.location.pathname??``,pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){return this.At(e,this.Ot?.pageViewId)}doEvent(){return{$pageview_id:this.Ot?.pageViewId}}At(e,t){var n=this.Ot;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:s,maxContentHeight:c,lastContentY:l,maxContentY:u}=i;if(!(Z(a)||Z(o)||Z(s)||Z(c)||Z(l)||Z(u))){a=Math.ceil(a),o=Math.ceil(o),s=Math.ceil(s),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);var d=a>1?kg(o/a,0,1,$):1,f=a>1?kg(s/a,0,1,$):1,p=c>1?kg(l/c,0,1,$):1,m=c>1?kg(u/c,0,1,$):1;r=Wy(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},fx=[`flags`,`surveys`],px={[Mv]:{exposure:`hidden`},[Fv]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[Iv]:{exposure:`hidden`},[Lv]:{exposure:`event`},[Rv]:{exposure:`hidden`},[zv]:{exposure:`event`},[Bv]:{exposure:`hidden`},[Vv]:{exposure:`event`},[Hv]:{exposure:`event`},[Uv]:{exposure:`event`},[Wv]:{exposure:`hidden`},[Gv]:{exposure:`event`},[Kv]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[Qv]:{exposure:`hidden`},[$v]:{exposure:`event`},[qv]:{exposure:`event`,shouldSkipFromEventProperties:e=>gg(e)},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},$sess_rec_flush_size:{exposure:`hidden`},[ey]:{exposure:`derived`,storageGroup:`flags`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!fg(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[ty]:{exposure:`event`,storageGroup:`flags`},[ny]:{exposure:`hidden`},[ry]:{exposure:`hidden`,storageGroup:`flags`},[iy]:{exposure:`event`,storageGroup:`flags`},[ay]:{exposure:`event`,storageGroup:`flags`,volatile:!0},[oy]:{exposure:`event`},[sy]:{exposure:`hidden`},[cy]:{exposure:`hidden`},[ly]:{exposure:`hidden`},[uy]:{exposure:`hidden`,storageGroup:`surveys`},[dy]:{exposure:`hidden`,storageGroup:`surveys`,volatile:!0},[fy]:{exposure:`event`},[py]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[my]:{exposure:`hidden`},[hy]:{exposure:`hidden`},[gy]:{exposure:`hidden`},[_y]:{exposure:`hidden`,storageGroup:`flags`,volatile:!0},[vy]:{exposure:`hidden`},[yy]:{exposure:`hidden`},[by]:{exposure:`hidden`},[xy]:{exposure:`hidden`},[Sy]:{exposure:`hidden`},[Cy]:{exposure:`hidden`},[wy]:{exposure:`hidden`},[Jv]:{exposure:`event`},[Yv]:{exposure:`event`},[Xv]:{exposure:`event`},[Zv]:{exposure:`event`},[Dy]:{exposure:`event`},[Oy]:{exposure:`event`},[ky]:{exposure:`event`},$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`}
17,$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},mx=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],hx=e=>{var t=px[e];if(t)return t;for(var[n,r]of mx)if(e.indexOf(n)===0)return r},gx=e=>{var t=K?.createElement(`a`);return Z(t)?null:(t.href=e,t)},_x=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!X(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{$.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},vx=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);X(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},yx=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},bx=(e,t)=>e>=t&&Lh(),xx=(e,t,n,r)=>{if(e===0){if(Lh()){var i=t+1;return i===n&&r(),i}return t}return 0},Sx=`https?://(.*)`,Cx=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],wx=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...Cx],Tx=`<masked>`,Ex=[`li_fat_id`];function Dx(e,t,n){if(!K)return{};var r,i=t?[...Cx,...n||[]]:[],a=Ox(vx(K.URL,i,Tx),e);return Wy((r={},Uy(Ex,(function(e){var t=cb.A(e);r[e]=t||null})),r),a)}function Ox(e,t){var n=wx.concat(t||[]),r={};return Uy(n,(function(t){r[t]=_x(e,t)||null})),r}function kx(e){var t=function(e){return e?e.search(Sx+`google.([^/?]*)`)===0?`google`:e.search(Sx+`bing.com`)===0?`bing`:e.search(Sx+`yahoo.com`)===0?`yahoo`:e.search(Sx+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,r={};if(!gg(t)){r.$search_engine=t;var i=K?_x(K.referrer,n):``;i.length&&(r.ph_keyword=i)}return r}function Ax(){return navigator.language||navigator.userLanguage}var jx=`$direct`;function Mx(){return K?.referrer||jx}function Nx(e,t,n){n===void 0&&(n=!1);var r=e?[...Cx,...t||[]]:[],i=(n?L_(jh?.href):jh?.href)?.substring(0,1e3);return{r:Mx().substring(0,1e3),u:i?vx(i,r,Tx):void 0}}function Px(e,t){t===void 0&&(t=!1);var{r:n,u:r}=e,i=t?L_(r):r,a={$referrer:n,$referring_domain:n==null?void 0:n==jx?jx:gx(n)?.host};if(i){a.$current_url=i;var o=gx(i);a.$host=o?.host,a.$pathname=o?.pathname,Wy(a,Ox(i))}return n&&Wy(a,kx(n)),a}function Fx(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Ix(){try{return new Date().getTimezoneOffset()}catch{return}}var Lx={flags:_y,surveys:dy},Rx=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],zx=`main`,Bx=class{constructor(e,t,n){if(n===void 0&&(n=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=n,this.props={},this.Bt=!1,this.jt=(e=>{var t=``;return e.token&&(t=e.token.replace(/\+/g,`PL`).replace(/\//g,`SL`).replace(/=/g,`EQ`)),e.persistence_name?`ph_`+e.persistence_name:`ph_`+t+`_posthog`})(e),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&$.info(`Persistence loaded`,e.persistence,J({},this.props)),this.update_config(e,e,t),this.save(),G){var r=()=>this.flush();Zy(G,`beforeunload`,r,{capture:!1}),Zy(G,`pagehide`,r,{capture:!1})}}zt(){var e=this.Se?.persistence_save_debounce_ms;return _g(e)&&e>0?e:0}isDisabled(){return!!this.Vt}Ht(e){Rx.indexOf(e.persistence.toLowerCase())===-1&&($.critical(`Unknown persistence type `+e.persistence+`; falling back to localStorage+cookie`),e.persistence=`localStorage+cookie`);var t,n=function(e,t){e===void 0&&(e=[]),t===void 0&&(t=!1);var n=[...db,...e];return J({},ub,{F(e){try{var n={};try{n=cb.F(e)||{}}catch{}var r,i=JSON.parse(ub.A(e)||`{}`);if(t){var a={};for(var o in n){var s=n[o];gg(s)||s===``||(a[o]=s)}r=Wy(i,a)}else r=Wy(n,i);return ub.q(e,r),r}catch{}return null},q(e,t,r,i,a,o){var s=ub.q(e,t,void 0,void 0,o);try{var c={};
17n.forEach((e=>{t[e]&&(c[e]=t[e])})),Object.keys(c).length&&cb.q(e,c,r,i,a,o)}catch(e){ub.D(e)}return s},P(e,t){try{G?.localStorage.removeItem(e),cb.P(e,t)}catch(e){ub.D(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),r=!1,i=e.persistence.toLowerCase();return i===`localstorage`&&ub.N()?(t=ub,r=!0):i===`localstorage+cookie`&&n.N()?(t=n,r=!0):i===`sessionstorage`&&hb.N()?t=hb:i===`memory`?t=pb:i===`cookie`?t=cb:n.N()?(t=n,r=!0):t=cb,this.Dt=r,t}Wt(e){return this.jt+`__`+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var t=e??this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[_y];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return Uy(this.props,((t,n)=>{var r=hx(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===ey?()=>this.Gt():()=>!1))return;r.transformToEventProperties&&Wy(e,r.transformToEventProperties(t))}else if(!r||r.exposure===`event`){if(r!=null&&r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,(()=>!1)))return;e[n]=t}})),e}load(){if(!this.Vt){var e=this.Ct.F(this.jt);e&&(this.props=Wy({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of fx){var t=ub.F(this.Wt(e));if(t&&!pg(t)){var n=this.Qt(e);n.persisted=!0,this.Jt(e)||(n.fingerprint=this.Yt(t,e)),this.Kt(e,t)||Wy(this.props,t)}}}Jt(e){return Object.keys(this.props).some((t=>hx(t)?.storageGroup===e))}Kt(e,t){var n=Lx[e];if(!n)return!1;var r=t[n],i=this.props[n];return _g(r)&&_g(i)&&i>r}refreshKey(e){if(!this.Vt){var t=this.Nt?hx(e)?.storageGroup:void 0,n=t?ub.F(this.Wt(t)):this.Ct.F(this.jt);if(n&&e in n)this.Xt(e,n[e]);else{if(t){var r=this.Ct.F(this.jt);if(r&&e in r)return void this.Xt(e,r[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?Z(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),e)):this.rr()}}flush(){Z(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,zx))}ir(){var{main:e,groups:t}=this.sr();for(var n of(this.nr(this.Ct,this.jt,e,zx),fx)){var r,i=t[n];(!pg(i)||(r=this.$t[n])!=null&&r.persisted)&&this.nr(ub,this.Wt(n),i,n)}}sr(){var e={},t={};for(var n of fx)t[n]={};return Uy(this.props,((n,r)=>{var i=hx(r)?.storageGroup;i?t[i][r]=n:e[r]=n})),{main:e,groups:t}}Yt(e,t){if(t===zx)return JSON.stringify(e)+`|`+this.ar+`|`+this.lr+`|`+this.ur;var n={};return Uy(e,((e,t)=>{var r;n[t]=(r=hx(t))!=null&&r.volatile?`__volatile__`:e})),JSON.stringify(n)}nr(e,t,n,r){var i=this.Qt(r);if(r===zx||i.dirty||Z(i.fingerprint)){var a;try{if((a=this.Yt(n,r))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(t,n,this.ar,this.lr,this.ur,this.Se.debug)?(i.dirty=!1,r!==zx&&(i.persisted=!0),Z(a)||(i.fingerprint=a)):this.Se.debug&&$.warn(`failed to persist storage entry "`+t+`"; will retry on next save`)}}remove(e){var{keepGroupEntries:t=!1}=e===void 0?{}:e;if(Z(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.jt,!1),this.Ct.P(this.jt,!0),!t&&this.qt)for(var n of fx)ub.P(this.Wt(n));t?delete this.$t[zx]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,t,n){if(fg(e)){Z(t)&&(t=`None`),this.ar=Z(n)?this.hr:n;var r=!1;if(Uy(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Xt(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(fg(e)){this.ar=Z(t)?this.hr:t;var n=!1;if(Uy(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Xt(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.Bt){var e=Dx(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);pg(Jy(e))||this.register(e),this.Bt=!0}}update_search_keyword(){var e;this.register((e=K?.referrer)?kx(e):{})}update_referrer_info(){this.register_once({$referrer:Mx(),$referring_domain:K!=null&&K.referrer&&gx(K.referrer)?.host||jx},void 0)}set_initial_person_info(){this.props[xy]||this.props[Sy]||this.register_once({[Cy]:Nx(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes
17)},void 0)}get_initial_props(){var e={};Uy([Sy,xy],(t=>{var n=this.props[t];n&&Uy(n,(function(t,n){e[`$initial_`+sg(n)]=t}))}));var t=this.props[Cy];return t&&Wy(e,function(e,t){t===void 0&&(t=!1);var n=Px(e,t),r={};return Uy(n,(function(e,t){r[`$initial_`+sg(t)]=e})),r}(t,this.Se.disable_capture_url_hashes)),e}safe_merge(e){return Uy(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),i=r?this.Ht(e):this.Ct,a=this.Ut(e);if(r||a!==this.Nt){var o=this.props;this.clear(),this.Ct=i,this.Nt=a,this.props=o,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var n=this.props[Iv]||{};n[e]=t,this.Xt(Iv,n),this.save()}remove_event_timer(e){var t=this.props[Iv]||{},n=t[e];return Z(n)||(delete t[e],this.Xt(Iv,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Xt(e,t),this.save()}Xt(e,t){var n;this.props[e]=t,(n=hx(e))!=null&&n.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var t=hx(e)?.storageGroup;t&&(this.Qt(t).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}},Vx={Activation:`events`,Cancellation:`cancelEvents`},Hx={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},Ux={Once:`once`,Recurring:`recurring`,Always:`always`},Wx={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},Gx={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,SURVEY_ITERATION:`$survey_iteration`,SURVEY_ITERATION_START_DATE:`$survey_iteration_start_date`,SURVEY_PARTIALLY_COMPLETED:`$survey_partially_completed`,SURVEY_SUBMISSION_ID:`$survey_submission_id`,SURVEY_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},Kx={Popover:`popover`,Inline:`inline`},qx={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},Jx={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},Yx=kv(`[RateLimiter]`),Xx=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
17if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{Yx.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){Yx.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,i=new Date().getTime(),a=this.instance.persistence?.get_property(by)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(by,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},Zx=kv(`[RemoteConfig]`),Qx=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}cr(e){var t,n;(t=q.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}vr(e){this._instance._send_request({method:`GET`,url:this._instance.requestRouter.endpointFor(`assets`,`/array/`+this._instance.config.token+`/config`),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return Zx.info(`Using preloaded remote config`,this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void Zx.warn(`Remote config is disabled. Falling back to local config.`);this.cr((e=>{if(!e)return Zx.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.vr((e=>{this.pr(e),this.gr()}));this.pr(e),this.gr()}))}catch(e){Zx.error(`Error loading remote config`,e)}}stop(){this.yr&&=(clearInterval(this.yr),void 0)}refresh(){!this._instance.mr()&&K&&K.visibilityState!==`hidden`&&this._instance.reloadFeatureFlags()}gr(){if(!this.yr){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.yr=setInterval((()=>{this.refresh()}),e))}}pr(e){var t;e||Zx.error(`Failed to fetch remote config from PostHog.`),this._instance.pr(e??{}),!1!==e?.hasFeatureFlags&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},$x={GZipJS:`gzip-js`,Base64:`base64`},eS=Uint8Array,tS=Uint16Array,nS=Uint32Array,rS=new eS([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),iS=new eS([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),aS=new eS([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oS=function(e,t){for(var n=new tS(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new nS(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},sS=oS(rS,2),cS=sS[1];sS[0][28]=258,cS[258]=28;for(var lS=oS(iS,0)[1],uS=new tS(32768),dS=0;32768>dS;++dS){var fS=(43690&dS)>>>1|(21845&dS)<<1;uS[dS]=((65280&(fS=(61680&(fS=(52428&fS)>>>2|(13107&fS)<<2))>>>4|(3855&fS)<<4))>>>8|(255&fS)<<8)>>>1}var pS=function(e,t,n){for(var r=e.length,i=0,a=new tS(t);r>i;++i)++a[e[i]-1];var o,s=new tS(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new tS(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[uS[d]>>>c]=l}else for(o=new tS(r),i=0;r>i;++i)o[i]=uS[s[e[i]-1]++]>>>15-e[i];return o},mS=new eS(288);for(dS=0;144>dS;++dS)mS[dS]=8;for(dS=144;256>dS;++dS)mS[dS]=9;for(dS=256;280>dS;++dS)mS[dS]=7;for(dS=280;288>dS;++dS)mS[dS]=8;var hS=new eS(32);for(dS=0;32>dS;++dS)hS[dS]=5;var gS=pS(mS,9,0),_S=pS(hS,5,0),vS=function(e){return(e/8>>0)+(7&e&&1)},yS=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof tS?tS:e instanceof nS?nS:eS)(n-t);return r.set(e.subarray(t,n)),r},bS=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},xS=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},SS=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new eS(0),0];if(i==1){var o=new eS(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new tS(f+1),m=CS(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;t>p[y]?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new eS(p),m]},CS=function(e,t,n){return e.s==-1?Math.max(CS(e.l,t,n+1),CS(e.r,t,n+1)):t[e.s]=n},wS=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new tS(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>
172&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},TS=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},ES=function(e,t,n){var r=n.length,i=vS(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},DS=function(e,t,n,r,i,a,o,s,c,l,u){bS(t,u++,n),++i[256];for(var d=SS(i,15),f=d[0],p=d[1],m=SS(a,15),h=m[0],g=m[1],_=wS(f),v=_[0],y=_[1],b=wS(h),x=b[0],S=b[1],C=new tS(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var ee=SS(C,7),te=ee[0],ne=ee[1],E=19;E>4&&!te[aS[E-1]];--E);var re,ie,ae,oe,se=l+5<<3,ce=TS(i,mS)+TS(a,hS)+o,le=TS(i,f)+TS(a,h)+o+14+3*E+TS(C,te)+(2*C[16]+3*C[17]+7*C[18]);if(ce>=se&&le>=se)return ES(t,u,e.subarray(c,c+l));if(bS(t,u,1+(ce>le)),u+=2,ce>le){re=pS(f,p,0),ie=f,ae=pS(h,g,0),oe=h;var D=pS(te,ne,0);for(bS(t,u,y-257),bS(t,u+5,S-1),bS(t,u+10,E-4),u+=14,w=0;E>w;++w)bS(t,u+3*w,te[aS[w]]);u+=3*E;for(var O=[v,x],ue=0;2>ue;++ue){var de=O[ue];for(w=0;de.length>w;++w)bS(t,u,D[fe=31&de[w]]),u+=te[fe],fe>15&&(bS(t,u,de[w]>>>5&127),u+=de[w]>>>12)}}else re=gS,ie=mS,ae=_S,oe=hS;for(w=0;s>w;++w)if(r[w]>255){var fe;xS(t,u,re[257+(fe=r[w]>>>18&31)]),u+=ie[fe+257],fe>7&&(bS(t,u,r[w]>>>23&31),u+=rS[fe]);var k=31&r[w];xS(t,u,ae[k]),u+=oe[k],k>3&&(xS(t,u,r[w]>>>5&8191),u+=iS[k])}else xS(t,u,re[r[w]]),u+=ie[r[w]];return xS(t,u,re[256]),u+ie[256]},OS=new nS([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kS=function(){for(var e=new nS(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),AS=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function jS(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=kS[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new eS(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=ES(c,l,e.subarray(u,d)):(c[u]=!0,l=ES(c,l,e.subarray(u,o)))}else{for(var f=OS[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new tS(32768),_=new tS(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new nS(25e3),S=new tS(288),C=new tS(32),w=0,ee=0,te=(u=0,0),ne=0,E=0;o>u;++u){var re=b(u),ie=32767&u,ae=_[re];if(g[ie]=ae,_[re]=ie,u>=ne){var oe=o-u;if((w>7e3||te>24576)&&oe>423){l=DS(e,c,0,x,S,C,ee,te,E,u-E,l),te=w=ee=0,E=u;for(var se=0;286>se;++se)S[se]=0;for(se=0;30>se;++se)C[se]=0}var ce=2,le=0,D=m,O=ie-ae&32767;if(oe>2&&re==b(u-O))for(var ue=Math.min(p,oe)-1,de=Math.min(32767,u),fe=Math.min(258,oe);de>=O&&--D&&ie!=ae;){if(e[u+ce]==e[u+ce-O]){for(var k=0;fe>k&&e[u+k]==e[u+k-O];++k);if(k>ce){if(ce=k,le=O,k>ue)break;var pe=Math.min(O,k-2),A=0;for(se=0;pe>se;++se){var me=u-O+se+32768&32767,he=me-g[me]+32768&32767;he>A&&(A=he,ae=me)}}}O+=(ie=ae)-(ae=g[ie])+32768&32767}if(le){x[te++]=268435456|cS[ce]<<18|lS[le];var ge=31&cS[ce],_e=31&lS[le];ee+=rS[ge]+iS[_e],++S[257+ge],++C[_e],ne=u+ce,++w}else x[te++]=e[u],++S[e[u]]}}l=DS(e,c,!0,x,S,C,ee,te,E,u-E,l)}return yS(s,0,r+vS(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&AS(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),AS(l,u-8,n.d()),AS(l,u-4,r),l}var MS=!!Nh||!!Mh,NS=`text/plain`,PS=!1,FS=(e,t)=>{var[n,r]=e.split(`#`),[i,a]=n.split(`?`);if(!a)return e;var o=a.split(`&`).filter((e=>e.split(`=`)[0]!==t)).join(`&`);return i+(o?`?`+o:``)+(r?`#`+r:``)},IS=function(e,t,n){n===void 0&&(n=!0);var[r,i]=e.split(`?`),a=J({},t),o=i?.split(`&`).map((e=>{var t,[r,i]=e.split(`=`),o=n&&(t=a[r])!=null?t:i;return delete a[r],r+`=`+o}))??[],s=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return Uy(e,(function(e,t){Z(e)||Z(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(a);return s&&o.push(s),r+`?`+o.join(`&`)},LS=(e,t)=>JSON.stringify(e,((e,t)=>
17typeof t==`bigint`?t.toString():t),t),RS=e=>{if(e.xt)return e.xt;var{data:t,compression:n}=e;if(t){if(n===$x.GZipJS){var r=jS(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new eS(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new eS(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return yS(r,0,i)}(LS(t)),{mtime:0});return{contentType:NS,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===$x.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:LS(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(LS(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=LS(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},zS=e=>{var t,n,r=()=>({url:FS(e.url,`compression`),encodedBody:RS(J({},e,{compression:void 0,xt:void 0}))});try{t=RS(e)}catch(t){if($h(e.compression,_x(e.url,`compression`)))return $.error(`Failed to gzip request body, sending uncompressed payload`,t),r();throw t}return t&&$h(e.compression,_x(e.url,`compression`))&&!((n=t.body)instanceof ArrayBuffer?Qh(new Uint8Array(n)):ArrayBuffer.isView(n)&&Qh(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(PS=!0,r()):{url:e.url,encodedBody:t}},BS=e=>{try{return zS(e)}catch(t){$.error(t),e.callback==null||e.callback({statusCode:0,error:t});return}},VS=function(){var e=Vh((function*(e){var t=yield function(e,t,n){return rg.apply(this,arguments)}(LS(e.data),zh.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return J({},e,{xt:{contentType:NS,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),HS=[`/e/`,`/s/`],US=(e,t)=>{var n=(e=>{var t=(e=>{var t=gx(e)?.pathname||e.split(/[?#]/)[0];return t?t[0]===`/`?t:`/`+t:`/`})(e);return HS.some((e=>((e,t)=>e.slice(e.length-t.length)===t)(t,e)))})(e),r=n?FS(e,`ver`):e;return IS(t===$x.GZipJS?FS(r,`compression`):r,J({_:new Date().getTime().toString()},n?{}:{ver:zh.JS_SDK_VERSION},t===$x.GZipJS?{}:{compression:t}))},WS=[];Mh&&WS.push({transport:`fetch`,method(e){var t=BS(e);if(t){var{url:n,encodedBody:r}=t,{contentType:i,body:a,estimatedSize:o}=r??{},s=new Headers;Uy(e.headers,(function(e,t){s.append(t,e)})),i&&s.append(`Content-Type`,i);var c=null,l=!1;if(Ph){var u=new Ph;c={signal:u.signal,timeout:setTimeout((()=>{var t,n;l=!0,u.abort((t=e.timeout,(n=Error(`PostHog request timed out`+(t?` after `+t+`ms`:``))).name=`AbortError`,n))}),e.timeout)}}Mh(n,J({method:e?.method||`GET`,headers:s,keepalive:e.method===`POST`&&52428.8>(o||0),body:a,signal:c?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){$.error(e)}e.callback==null||e.callback(r)})))).catch((t=>{l&&t?.name===`AbortError`?$.warn(t):$.error(t),e.callback==null||e.callback({statusCode:0,error:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}}),Nh&&WS.push({transport:`XHR`,method(e){var t=BS(e);if(t){var n=new Nh,{url:r,encodedBody:i}=t;n.open(e.method||`GET`,r,!0);var{contentType:a,body:o}=i??{};Uy(e.headers,(function(e,t){n.setRequestHeader(t,e)})),a&&n.setRequestHeader(`Content-Type`,a),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var t={statusCode:n.status,text:n.responseText};if(n.status===200)try{t.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(t)}},n.send(o)}}}),Ah!=null&&Ah.sendBeacon&&WS.push({transport:`sendBeacon`,method(e){try{var{url:t,encodedBody:n}=zS(e),{contentType:r,body:i}=n??{};if(!i)return;var a=i instanceof Blob?i:new Blob([i],{type:r});Ah.sendBeacon(t,a)}catch{}}});var GS=3e3,KS=class{constructor(e,t){this.br=!0,this._r=[],this.wr=kg(t?.flush_interval_ms||GS,250,5e3,$.createLogger(`flush interval`),GS),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=this._r.length>0?this.Tr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.Er(J({},e,{transport:`sendBeacon`}))}))}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout((()=>
17{if(this.Ir(),this._r.length>0){var t=this.Tr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&X(n.data)&&Uy(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.Er(n)};for(var r in t)n()}}),this.wr))}Er(e){try{this.kr(e)}catch(e){$.error(e)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return Uy(this._r,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;Z(e[i])&&(e[i]=J({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this._r=[],e}},qS=[`retriesPerformedSoFar`],JS=class{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!Z(G)&&`onLine`in G.navigator&&(this.Rr=G.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},Zy(G,`online`,this.Or),Zy(G,`offline`,this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=Hh(e,qS);vg(t)&&(n.url=IS(n.url,{retry_count:t})),this._instance._send_request(J({},n,{callback:e=>{if(e.statusCode!==200&&(400>e.statusCode||e.statusCode>=500)){if((e.statusCode===0?3:10)>(t??0))return void this.st(J({retriesPerformedSoFar:t},n));e.statusCode===0&&$.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after `+(t??0)+` retries.`)}n.callback==null||n.callback(e)}}))}st(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this._r.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),$.warn(i),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),this._r.length===0)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout((()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()}),this.Pr)}Lr(){var e=Date.now(),t=[],n=this._r.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this._r=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$r&&=(clearTimeout(this.$r),void 0),this.Mr=!1,Z(G)||(this.Or&&=(G.removeEventListener(`online`,this.Or),void 0),this.Fr&&=(G.removeEventListener(`offline`,this.Fr),void 0)),this._r))try{this._instance._send_request(J({},e,{transport:`sendBeacon`}))}catch(e){$.error(e)}this._r=[]}},YS=class{constructor(e){this.Dr=()=>{this.Nr||={};var e=this.scrollElement(),t=this.scrollY(),n=e?Math.max(0,e.scrollHeight-e.clientHeight):0,r=t+(e?.clientHeight||0),i=e?.scrollHeight||0;this.Nr.lastScrollY=Math.ceil(t),this.Nr.maxScrollY=Math.max(t,this.Nr.maxScrollY??0),this.Nr.maxScrollHeight=Math.max(n,this.Nr.maxScrollHeight??0),this.Nr.lastContentY=r,this.Nr.maxContentY=Math.max(r,this.Nr.maxContentY??0),this.Nr.maxContentHeight=Math.max(i,this.Nr.maxContentHeight??0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){Zy(G,`scroll`,this.Dr,{capture:!0}),Zy(G,`scrollend`,this.Dr,{capture:!0}),Zy(G,`resize`,this.Dr)}scrollElement(){if(!this.qr)return G?.document.documentElement;for(var e of X(this.qr)?this.qr:[this.qr]){var t=G?.document.querySelector(e);if(t)return t}}Br(e){var t=e===`y`?`scrollTop`:`scrollLeft`;if(this.qr){var n=this.scrollElement();return n&&n[t]||0}return G?e===`y`?G.scrollY||G.pageYOffset||G.document.documentElement.scrollTop||0:G.scrollX||G.pageXOffset||G.document.documentElement.scrollLeft||0:0}scrollY(){return this.Br(`y`)}scrollX(){return this.Br(`x`)}},XS=e=>Nx(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties,e?.config.disable_capture_url_hashes),ZS=class{constructor(e,t,n,r){this.jr=e=>{var t=this.Hr();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.Ur(this._instance)};this.zr.register({[yy]:n})}},this._instance=e,this.Vr=t,this.zr=n,this.Ur=r||XS,this.Vr.onSessionId(this.jr)}Hr(){return this.zr.props[yy]}getSetOnceProps(){var e=this.Hr()?.props;return e?`r`in e?Px(e,this._instance.config.disable_capture_url_hashes
17):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var e={};return Uy(Jy(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+sg(n)]=t})),e}},QS=class{constructor(){this.Wr={}}on(e,t){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(t),()=>{this.Wr[e]=this.Wr[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.Wr[e]||[])n(t);for(var r of this.Wr[`*`]||[])r(e,t)}},$S=kv(`[SessionId]`),eC=class{on(e,t){return this.Gr.on(e,t)}constructor(e,t,n){var r;if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new QS,this.Kr=(e,t)=>!(!vg(e)||!vg(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===My)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=t||ib,this.ri=n||ib;var i=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*kg(this.Se.session_idle_timeout_seconds||1800,60,36e3,$S.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni=`ph_`+i+`_window_id`,this.si=`ph_`+i+`_primary_window_exists`,this.oi()){var a=hb.F(this.ni),o=hb.F(this.si);a&&!o?this.Xr=a:hb.P(this.ni),hb.q(this.si,!0)}if((r=this.Se.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.Se.bootstrap.sessionID.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,new Date().getTime(),s)}catch(e){$S.error(`Invalid sessionID in bootstrap`,e)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Z(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter((t=>t!==e))}}oi(){return this.Se.persistence!==`memory`&&!this.zr.Vt&&hb.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&hb.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?hb.F(this.ni):null}di(e){var t=this.Zr;return!gg(t)&&!gg(e)&&5e3>Math.abs(e-t)}ai(e,t,n){var r=t!==this._sessionActivityTimestamp,i=!(e!==this.ei||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.ei=e,i&&!r||i&&this.di(t)||(this.Zr=t,this.zr.register({[Qv]:[t,e,n]}))}ci(){var e=this.Se?.persistence_save_debounce_ms;return vg(e)&&e>0}vi(){this.ci()?this.zr.refreshKey(Qv):(this.zr.flush(),this.zr.load())}fi(){if(!gg(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,e,t]=this.pi();e===this.ei&&t===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[Qv]:[this._sessionActivityTimestamp,this.ei??null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi(),t=vg(e)?e:0,n=vg(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[Qv];return X(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&G&&(G.removeEventListener(Ly,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&hb.P(this.si)},Zy(G,Ly,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Se.cookieless_mode===My)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),[,r,i]=this.pi(),a=this.gi(),o=this.hi(),s=vg(i)&&Math.abs(n-i)>864e5,c=!1,l=!1,u=!r,d=r,f=!u&&!e&&this.Kr(n,a);f&&((f=this.mi(n))||$S.info(`cross-tab refresh kept the session alive`,{sessionId:r}),[,r,i]=this.pi()),u||f||s?(r=this.ti(),o=this.ri(),$S.info(`new session ID generated`,{sessionId:r,windowId:o,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:s}}),i=n,c=!0):(o||(o=this.ri(),c=!0),(l=r!==d)&&($S.info(`adopted cross-tab session id`,{sessionId:r,windowId:o}),c=!0));var p=vg(a)&&e&&!s?a:n,m=vg(i)?i:new Date().getTime();this.ui(o),this.ai(r,p,m),e||this.ii();var h={noSessionId:u,activityTimeout:f,sessionPastMaximumLength:s,crossTabAdoption:l};return c&&this.Qr.forEach((e=>e(r,o,h))),{sessionId:r,windowId:o,sessionStartTimestamp:m,changeReason:c?h:void 0,lastActivityTimestamp:a}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout((()=>
17{if(!this.Yr)if(this.mi(new Date().getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit(`forcedIdleReset`,{idleSessionId:e})}else this.ii()}),1.1*this.sessionTimeoutMs))}},tC=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&ag(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>ag(e?.brand,t))))return!0}catch{}return!!e.webdriver};function nC(){return(nC=Vh((function*(){var e=Ah?.userAgentData;if(e!=null&&e.getHighEntropyValues)try{var t=(yield e.getHighEntropyValues([`model`]))?.model;return mg(t)&&t.length>0?t:void 0}catch(e){$.info(`Unable to resolve $device_model from userAgentData.getHighEntropyValues`,e);return}}))).apply(this,arguments)}var rC=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function iC(e,t,n){return LS({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var aC={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>rC(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!rC(t,e))))),icontains:(e,t)=>t.map(oC).some((t=>e.map(oC).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(oC).every((t=>e.map(oC).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},oC=e=>e.toLowerCase();function sC(e,t){return!e||Object.entries(e).every((e=>{var[n,r]=e,i=t?.[n];if(Z(i)||gg(i))return!1;var a=[String(i)],o=aC[r.operator];return!!o&&o(r.values,a)}))}var cC=`custom`,lC=`i.posthog.com`,uC=/^\/static\//,dC=class{constructor(e){this.bi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`https://us.i.posthog.com`:e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,``):this.apiHost}get uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+lC,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.bi[this.apiHost]||(this.bi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`us`:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`eu`:cC),this.bi[this.apiHost]}wi(e){if(uC.test(e)){var t=this.instance.config.asset_host;if(typeof t==`string`)return t.trim().replace(/\/$/,``)||void 0}}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.uiHost+t;if(e===`flags`)return this.flagsApiHost+t;if(e===`assets`){var n=this.wi(t);if(n)return``+n+t}if(this.region===cC)return this.apiHost+t;var r=lC+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}},fC=kv(`[Surveys]`),pC=`seenSurvey_`,mC=e=>{try{var t=(e=>((e,t)=>{var n=``+pC+t.id;return t.current_iteration&&t.current_iteration>0&&(n=``+pC+t.id+`_`+t.current_iteration),n})(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){fC.error(`Failed to persist survey seen state`,e)}},hC=[Hx.Popover,Hx.Widget,Hx.API],gC={ignoreConditions:!1,ignoreDelay:!1,displayType:Kx.Popover},_C=kv(`[PostHog ExternalIntegrations]`),vC={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},yC=class{constructor(e){this._instance=e}Mt(e,t){var n;(n=q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return _C.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var n,i,a;!r||(n=q.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[t]||e.Mt(vC[t],(()=>{var n;(n=q.__PosthogExtensions__)==null||(n=n.integrations)==null||(n=n[t])==null||n.start(e._instance)})),!r&&(i=q.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[t]&&((a=q.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[t])==null||a.stop())};for(var[n,r]of Object.entries((i=this._instance.config.integrations)??{})){var i;t(n)}}},bC={},xC=0,SC=()=>{}
17,CC=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,wC=`Surveys module not available`,TC=`sanitize_properties is deprecated. Use before_send instead`,EC=`Invalid value for property_denylist config: `,DC=`posthog`,OC=!MS&&Ih?.indexOf(`MSIE`)===-1&&Ih?.indexOf(`Mozilla`)===-1,kC=e=>{var t;return J({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,asset_host:null,token:``,autocapture:!0,cross_subdomain_cookie:Xy(K?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:SC,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:e??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:jh&&mg(jh?.search)&&jh.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(G==null||(t=G.location)==null?void 0:t.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){$.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Fy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:GS},error_tracking:{},_onCapture:SC},(e=>({rageclick:e&&e>=`2026-05-30`?{content_ignorelist:Lb,ignore_text_selection:!0}
17:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2026-06-25`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>=`2026-05-30`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>=`2025-11-30`?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>=`2026-01-30`?`head`:`body`,internal_or_test_user_hostname:e&&e>=`2026-01-30`?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>=`2026-05-30`?250:0,split_storage:!(!e||`2026-05-30`>e),detect_google_search_app:!(!e||`2026-05-30`>e),disable_capture_url_hashes:!(!e||`2026-06-25`>e)}))(e))},AC=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`__preview_disable_beacon`,`disable_beacon`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`]],jC=e=>{var t={};for(var[n,r]of AC)Z(e[n])||(t[r]=e[n]);var i=Wy({},t,e),a=e.__preview_external_dependency_versioned_paths;return Z(a)||(Z(e.strict_script_versioning)&&(i.strict_script_versioning=!!a),mg(a)&&Z(e.asset_host)&&(i.asset_host=a)),X(e.property_blacklist)&&(Z(e.property_denylist)?i.property_denylist=e.property_blacklist:X(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:$.error(EC+e.property_denylist)),i},MC=class{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){$.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},NC=class e{ki(e,t){if(e){var n=this.Si.indexOf(e);n!==-1&&this.Si.splice(n,1)}return this.Si.push(t),t.initialize==null||t.initialize(),t}Ci(){return this.config.cookieless_mode===My||this.config.cookieless_mode===jy&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new MC,this.Ii=!1,this.version=zh.LIB_VERSION,this.Ti=new QS,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=kC(),this.SentryIntegration=ux,this.sentryIntegration=e=>function(e,t){var n=lx(e,t);return{name:cx,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new YS(this),this.pageViewManager=new dx(this),this.rateLimiter=new Xx(this),this.requestRouter=new dC(this),this.consent=new gb(this),this.externalIntegrations=new yC(this);var t=e.__defaultExtensionClasses??{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,n)=>{var r=mg(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=mg(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>$.info(`send "`+e?.event+`"`,e)))}init(t,n,r){if(r&&r!==DC){var i=bC[r]??new e;return i._init(t,n,r),bC[r]=i,bC[DC][r]=i,i}return this._init(t,n,r)}_init(e,t,n){var r;t===void 0&&(t={});var i=mg(e)?e.trim():``;if(!i)return $.critical(`PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()`),this;if(this.__loaded)return console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`),this;this.__loaded=!0,this.config={},t.debug=this.Oi(t.debug),this.Li=t,this.Fi=[],t.person_profiles?this.Pi=t.person_profiles:t.process_person&&(this.Pi=t.process_person);var a=kC(t.defaults),o=jC(t),s=Wy({},a,o,{name:n,token:i});fg(a.rageclick)&&fg(o.rageclick)&&(s.rageclick=Wy({},a.rageclick,o.rageclick)),fg(a.session_recording)&&fg(o.session_recording)&&(s.session_recording=Wy({},a.session_recording,o.session_recording)),this.set_config(s),this.config.on_xhr_error&&$.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=t.disable_compression?void 0:$x.GZipJS;var c=this.Ai();this.persistence=new Bx(this.config,c),this.sessionPersistence=this.config.persistence===`
17sessionStorage`||this.config.persistence===`memory`?this.persistence:new Bx(J({},this.config,{persistence:`sessionStorage`}),c,!1);var l=J({},this.persistence.props),u=J({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new KS((e=>this.Di(e)),this.config.request_queue_config),this.Ni=new JS(this),this.__request_queue=[];var d=this.Ci();if(d||(this.sessionManager=new eC(this),this.sessionPropsManager=new ZS(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.qi(d)}),0)):($.info(`Initializing extensions synchronously`),this.qi(d)),zh.DEBUG=zh.DEBUG||this.config.debug,zh.DEBUG&&$.info(`Starting in debug mode`,{this:this,config:t,thisC:J({},this.config),p:l,s:u}),!this.config.identity_distinct_id||(r=t.bootstrap)!=null&&r.distinctID||(t.bootstrap=J({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),t.bootstrap?.distinctID!==void 0){var f=t.bootstrap.distinctID,p=this.get_distinct_id(),m=this.persistence.get_property(vy);if(t.bootstrap.isIdentifiedID&&p!=null&&p!==f&&m===Ny)this.identify(f);else if(t.bootstrap.isIdentifiedID&&p!=null&&p!==f&&m===Py)$.warn(`Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.`);else{var h=this.config.get_device_id(ib()),g=t.bootstrap.isIdentifiedID?h:f;this.persistence.set_property(vy,t.bootstrap.isIdentifiedID?Py:Ny),this.register({distinct_id:f,$device_id:g})}}if(d)this.register_once({distinct_id:Ey,$device_id:null},``);else if(!this.get_distinct_id()){var _=this.config.get_device_id(ib());this.register_once({distinct_id:_,$device_id:_},``),this.persistence.set_property(vy,Ny)}return Zy(G,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||ib();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(vy,Py)),t()},i=n.user();`then`in i&&dg(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{typeof Promise<`u`&&Promise.resolve||sx.warn(`This browser does not have Promise support, and can not use the segment integration`);var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(sx.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(sx.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Ry),identify:e=>t(e,By),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.Bi())):this.Bi(),dg(this.config._onCapture)&&this.config._onCapture!==SC&&($.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&$.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return nC.apply(this,arguments)}().then((e=>{e&&this.register({[Pv]:e})})).catch(SC),this}qi(t){var n=performance.now(),r=J({},e.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.Si.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.Si.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.Si.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.Si.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.Si.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!t&&this.Si.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.Si.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.Si.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.Si.push(this.logs=this.logs??new r.logs(this)),r.conversations&&this.Si.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.Si.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Si.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Si.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,ax)),r.toolbar&&this.Si.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.Si.push(this.experiments=this.experiments??new r.experiments(this)),this.Si.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>
17{if(this.ji){var e=this.ji;this.ji=void 0,this.pr(e)}})),this.Hi(i,n)}Hi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Hi(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){$.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Dy]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[Oy]:r}),this.config.__preview_deferred_init_extensions&&$.info(`PostHog extensions initialized (`+r+`ms)`)}pr(e){var t;if(!K||!K.body)return $.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.pr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.ji=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Y(e.supportedCompression,$x.GZipJS)?$x.GZipJS:Y(e.supportedCompression,$x.Base64)?$x.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:Fy}),this.Si.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}Bi(){try{this.config.loaded(this)}catch(e){$.critical("`loaded` function failed",e)}if(this.zi(),this.config.internal_or_test_user_hostname&&jh!=null&&jh.hostname){var e=jh.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()}),1),this.Wi=new Qx(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.$i)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Hy(this.__request_queue,(e=>this.Di(e))),this.__request_queue=[],this.zi()}_handle_unload(){var e,t,n,r;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(zy),(t=this.logs)==null||t.flushLogs(`sendBeacon`),(n=this.$i)==null||n.unload(),(r=this.Ni)==null||r.unload()):this.Gi()&&this.capture(zy,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded?OC?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=J({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,(Z(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=J({},e);t.timeout=t.timeout||6e4,t.url=US(t.url,t.compression);var n=t.transport??`fetch`,r=WS.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),i=function(e,t){for(var r=0;e.length>r;r++)if(e[r].transport===n)return e[r]}(r)?.method??r[0].method;if(!i)throw Error(`No available transport method`);n!==`sendBeacon`&&t.data&&t.compression===$x.GZipJS&&Fh&&typeof Promise<`u`&&!PS?VS(t).then((e=>{i(e)})).catch((n=>{if(eg(n))return PS=!0,void i(J({},t,{compression:void 0,url:US(e.url,void 0)}));(e=>{if(!e||typeof e!=`object`)return!1;var t=`name`in e?String(e.name):``;return eg(e)||t===Zh})(n)&&(PS=!0),i(t)})):i(t)})(J({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){xC++;try{var t,n=[],r=[],i=[];Hy(e,(e=>{if(e)if(X(t=e[0]))i.push(e);else if(dg(e))try{e.call(this)}catch(t){$.error(`Error executing queued PostHog call`,e,t)}else X(e)&&t===`alias`?n.push(e):X(e)&&t.indexOf(`capture`)!==-1&&dg(this[t])?i.push(e):r.push(e)}));var a=function(e,t){Hy(e,(function(e){try{if(X(e[0])){var n=t;Uy(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){$.error(`Error executing queued PostHog call`,e,t)}}))};a(n,this),a(r,this),a(i,this)}finally{xC--}}push(t){if(xC>0&&X(t)&&mg(t[0])){var n=e.prototype[t[0]];dg(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(e,t,n){var r,i,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!Z(e)&&mg(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!mg(t?.$current_url)&&($.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!==`$exception`||n!=null&&n.Zi||$.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=n?.timestamp||l,d=I_(n?.uuid,ib),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===Ry&&this.config.__preview_capture_bot_pageviews&&s&&(f.event=`$bot_pageview`,f.properties.$browser_type=`bot`),c&&(f.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),n!=null&&n.$set&&(f.$set=n?.$set);var p=n?.$unset;p&&(f.$unset=p);var m,h,g,_=this.Qi(n?.$set_once,e!==Vy,e===By);if(_&&(f.$set_once=_),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>mg(e)?e.slice(0,r):e,o=new Set,f=function e(t,n){return t===Object(t)?o.has(t)?void 0:(o.add(t),X(t)?(r=[],Hy(t,(t=>{r.push(e(t))}))):(r={},Uy(t,((t,n)=>{o.has(t)||(r[n]=e(t,n))}))),r):a?a(t):t;var r}(i)),f.timestamp=u,Z(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===Wx.DISMISSED||e===Wx.SENT){var v=t?.[Gx.SURVEY_ID],y=t?.[Gx.SURVEY_ITERATION];mC({id:v,current_iteration:y}),f.$set=J({},f.$set,{[(m={id:v,current_iteration:y},h=e===Wx.SENT?`responded`:`dismissed`,g=`$survey_`+h+`/`+m.id,m.current_iteration&&m.current_iteration>0&&(g=`$survey_`+h+`/`+m.id+`/`+m.current_iteration),g)]:!0})}else e===Wx.SHOWN&&(f.$set=J({},f.$set,{[Gx.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===qx.SHOWN){var b=t?.[Jx.TOUR_TYPE];b&&(f.$set=J({},f.$set,{[Jx.TOUR_LAST_SEEN_DATE+`/`+b]:new Date().toISOString()}))}var x=J({},f.properties.$set,f.$set);if(pg(x)||this.setPersonPropertiesForFlags(x),!Q(this.config.before_send)){var S=this.it(f);if(!S)return;(f=S).uuid=I_(f.uuid,ib)}this.Ti.emit(`eventCaptured`,f);var C={method:`POST`,url:n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),data:f,compression:`best-available`,batchKey:n?._batchKey,transport:n?.transport};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Di(C):this.$i.enqueue(C),f}$.critical(`This capture call is ignored due to client rate limiting.`)}}else $.error(`No event name provided to posthog.capture`)}else $.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}calculateEventProperties(e,t,n,r,i){if(n||=new Date,!this.persistence||!this.sessionPersistence)return t;var a=i?void 0:this.persistence.remove_event_timer(e),o=J({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.Ci()&&(o.$cookieless_mode=!0),e===`$snapshot`){var s=J({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,(!mg(o.distinct_id)&&!_g(o.distinct_id)||hg(o.distinct_id))&&$.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),o}var c,l=function(e,t,n,r){var i,a,o;if(r===void 0&&(r=!1),!Ih)return{};var s,c,l,u,d,f=e?[...Cx,...t||[]]:[],[p,m]=function(e){for(var t=0;N_.length>t;
17t++){var[n,r]=N_[t],i=n.exec(e),a=i&&(dg(r)?r(i,e):r);if(a)return a}return[``,``]}(Ih),h=(s=typeof navigator<`u`?navigator:void 0)!=null&&s.brave?{brave:!0}:{},g={detectGoogleSearchApp:n},_=Wy(Jy({$os:p,$os_version:m,$browser:A_(Ih,navigator.vendor,h,g),$device:P_(Ih),$device_type:(l=Ih,u={userAgentDataPlatform:(i=navigator)==null||(i=i.userAgentData)==null?void 0:i.platform,maxTouchPoints:navigator?.maxTouchPoints,screenWidth:G==null||(a=G.screen)==null?void 0:a.width,screenHeight:G==null||(o=G.screen)==null?void 0:o.height,devicePixelRatio:G?.devicePixelRatio},d=P_(l),d===Ig||d===Fg||d===`Kobo`||d===`Kindle Fire`||d===f_?Pg:d===t_||d===r_||d===n_||d===l_?`Console`:d===Rg?`Wearable`:d?jg:u?.userAgentDataPlatform===`Android`&&(u?.maxTouchPoints??0)>0?600>Math.min(u?.screenWidth??0,u?.screenHeight??0)/(u?.devicePixelRatio??1)?jg:Pg:`Desktop`),$timezone:Fx(),$timezone_offset:Ix()}),{$current_url:vx(r?L_(jh?.href):jh?.href,f,Tx),$host:jh?.host,$pathname:jh?.pathname,$raw_user_agent:Ih.length>1e3?Ih.substring(0,997)+`...`:Ih,$browser_version:M_(Ih,navigator.vendor,h,g),$browser_language:Ax(),$browser_language_prefix:(c=Ax(),typeof c==`string`?c.split(`-`)[0]:void 0),$screen_height:G?.screen.height,$screen_width:G?.screen.width,$viewport_height:G?.innerHeight,$viewport_width:G?.innerWidth,$lib:zh.LIB_NAME,$lib_version:zh.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return zh.SDK_DIST_CHANNEL&&(_.$sdk_dist_channel=zh.SDK_DIST_CHANNEL),_}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var{sessionId:u,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime());o.$session_id=u,o.$window_id=d}this.sessionPropsManager&&Wy(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&Wy(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=this.Ni?.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===cC&&(o.$lib_custom_api_host=this.config.api_host),c=e!==Ry||i?e!==zy||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),o=Wy(o,c),e===Ry&&K&&(o.title=K.title),!Z(a)){var f=n.getTime()-a;o.$duration=parseFloat((f/1e3).toFixed(3))}Ih&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?`bot`:`browser`),(o=Wy({},l,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),X(this.config.property_denylist)?Uy(this.config.property_denylist,(function(e){delete o[e]})):$.error(EC+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&($.error(TC),o=p(o,e));var m=this.Ji();return o.$process_person_profile=m,m&&!i&&this.Yi(`_calculate_event_properties`),o}Qi(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.Ji()||this.Ii&&!n)return e;var r=Wy({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&($.error(TC),r=i(r,`$set_once`)),t&&(this.Ii=!0),pg(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Ki(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags?.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags?.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags?.getFeatureFlagResult(e,t)}getAllFeatureFlags(){return this.featureFlags?.getAllFeatureFlags()??[]}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}
17updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Ti.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:wC}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:wC})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:wC})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=gC),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:wC}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:wC})}Xi(e){return!e||hg(e)?($.critical(`Unique user id has not been set in posthog.identify`),!1):e===Ey?($.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||($.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return $.uninitializedWarning(`posthog.identify`);if(_g(e)&&(e=e.toString(),$.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.Xi(e)&&this.Yi(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Nv)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(Fv)&&(this.unregister(Fv),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(vy)||Ny)===Ny;e!==r&&a?(this.persistence.set_property(vy,Py),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(By,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Ri=iC(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(my))}}setPersonProperties(e,t){if((e||t)&&this.Yi(`posthog.setPersonProperties`)){var n=iC(this.get_distinct_id(),e,t);this.Ri===n?$.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Ri=n)}}unsetPersonProperties(e){var t,n=(X(e)?e:[e]).filter((e=>mg(e)&&e.length>0));n.length!==0&&this.Yi(`posthog.unsetPersonProperties`)&&((t=this.featureFlags)==null||t.unsetPersonPropertiesForFlags(n,!0),this.capture(`$set`,{$unset:n}),this.Ri=null)}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:J({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(Vy,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else $.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;e===void 0&&(e=!0),(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.Yi(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i,a,o,s,c,l;if($.info(`reset`),!this.__loaded)return $.uninitializedWarning(`posthog.reset`);var u,d=this.get_property(Nv),f=this.get_property(Pv),p=this.get_property(Kv);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),Z(p)||(u=this.persistence)==null||u.register({[Kv]:p}),(r=this.surveys)==null||r.reset(),(i=this.Wi)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(s=this.logs)==null||s.reset(),(c=this.persistence)==null||c.set_property(vy,Ny),(l=this.sessionManager)==null||l.resetSessionId(),this.Ri=null,this.config.cookieless_mode===My)this.register_once({distinct_id:Ey,$device_id:null},``);else{var m=this.config.get_device_id(ib());this.register_once({distinct_id:m,$device_id:e?m:d},``),e||Z(f)||this.register({[Pv]:f})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return Vh((function*(){var e,n,r,i;t.__loaded?((e=t.logs)==null||e.flushLogs(`sendBeacon`),(n=t.$i)==null||n.unload(),(r=t.Ni)==null||r.unload(),(i=t.featureFlags)==null||i.destroy()):$.uninitializedWarning(`posthog.shutdown`)}))()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.tn()}get_distinct_id(){return this.get_property(`distinct_id`)}getGroups(){return this.get_property(`$groups`)||{}}get_session_id(){return this.sessionManager?.checkAndGetSessionAndWindowId(!0).sessionId??``}get_session_replay_url(e){if(!this.sessionManager)return``;var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor(`ui`,`/project/`+this.config.token+`/replay/`+t);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(Mv)?($.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.Yi(`posthog.alias`)?(Z(t)&&(t=this.get_distinct_id()),e===t?($.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.Ki(Fv,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=J({},this.config);if(fg(e)){var n,r,i,a,o,s,c,l,u,d,f;Wy(this.config,jC(e));var p=this.Ai();(n=this.persistence)==null||n.update_config(this.config,t,p),this.sessionPersistence=this.config.persistence===`
17sessionStorage`||this.config.persistence===`memory`?this.persistence:new Bx(J({},this.config,{persistence:`sessionStorage`}),p,!1);var m=this.Oi(this.config.debug);yg(m)&&(this.config.debug=m),yg(this.config.debug)&&(this.config.debug?(zh.DEBUG=!0,ub.N()&&ub.q(`ph_debug`,!0),$.info(`set_config`,{config:e,oldConfig:t,newConfig:J({},this.config)})):(zh.DEBUG=!1,ub.N()&&ub.P(`ph_debug`))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.rn(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){zh.LIB_NAME=e,zh.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(J({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??e.nn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??DC;return e!==DC&&(e=DC+`.`+e),e}_isIdentified(){return this.persistence?.get_property(vy)===Py||this.sessionPersistence?.get_property(vy)===Py}Ji(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===Fy&&!this._isIdentified()&&pg(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Fv])&&((t=this.persistence)==null||(t=t.props)==null||!t[wy]))}Gi(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.Ji()||this.Yi(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(e){return this.config.person_profiles===`never`?($.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.Ki(wy,!0),!0)}Ai(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==jy)}rn(){var e,t,n=this.Ai();return this.persistence?.Vt!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.Vt!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==My){if(this.Ci()){var r,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new eC(this),this.pageViewM
17anager=new dx(this),this.persistence&&(this.sessionPropsManager=new ZS(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??e.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.ki(this.sessionRecording,new o(this)),this.Ui&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.Ui)))}var s;this.consent.optInOut(!0),this.rn(),this.zi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==jy&&((s=this.surveys)==null||s.loadIfEnabled()),(Z(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture(t?.captureEventName??`$opt_in`,t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else $.warn(CC)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===My?$.warn(CC):(this.config.cookieless_mode===jy&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===jy&&(this.register({distinct_id:Ey,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi()))}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===My||(this.config.cookieless_mode===jy?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return Ah?tC(Ah,this.config.custom_blocked_useragents):void 0}Vi(){K&&(K.visibilityState===`visible`?this.Ei||(this.Ei=!0,this.capture(Ry,{title:K.title},{send_instantly:!0}),this.Mi&&=(K.removeEventListener(Iy,this.Mi),null)):this.Mi||(this.Mi=this.Vi.bind(this),Zy(K,Iy,this.Mi)))}debug(e){!1===e?(G?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(G?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}mr(){var e,t,n,r,i,a,o=this.Li||{};return`advanced_disable_flags`in o?!!o.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?($.warn(`Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version.`),!0):(n=`advanced_disable_decide`,r=$,i=(t=`advanced_disable_flags`)in(e=o)&&!Q(e[t]),a=n in e&&!Q(e[n]),i?e[t]:!!a&&(r&&r.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])):!!this.config.advanced_disable_flags}it(e){if(Q(this.config.before_send))return e;var t=Object.keys(e.properties??{}).filter(Sg),n=X(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),Q(r)){var a=`Event '`+e.event+`' was rejected in beforeSend function`;return xg(e.event)?$.warn(a+`. This can cause unexpected behavior.`):$.info(a),null}r.properties&&!pg(r.properties)||$.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}for(var o of t)if(r.properties&&Q(r.properties[o]))return $.warn(`Event '`+e.event+`' had its '`+o+`' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){return this.pageViewManager.Ot?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Oi(e){var t=yg(e)&&!e,n=ub.N()&&ub.A(`ph_debug`)===`true`;return!t&&(!!n||e)}};NC.__defaultExtensionClasses={},NC.nn=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=qy(e.prototype[t[n]])}(NC,[`identify`]);var PC=class{constructor(e){this.disabled=!1===e;var t=fg(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},FC=`$copy_autocapture`,IC=kv(`[AutoCapture]`);function LC(e,t){return t.length>e?t.slice(0,e)+`...`:t}function RC(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Sb(t));return t}function zC(e,t){var n,{e:r,maskAllElementAttributes:i,maskAllText:a,elementAttributeIgnoreList:o,elementsC
17hainAsString:s,disableCaptureUrlHashes:c}=t;if(!Sb(e))return{props:{}};for(var l=[e],u=e;u.parentNode&&!Cb(u,`body`);)if(Tb(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!Sb(u.parentNode))break;l.push(u.parentNode),u=u.parentNode}var d,f,p=[],m={},h=!1,g=!1;if(Uy(l,(e=>{var t=Wb(e);if(Cb(e,`a`)){var n=e.getAttribute(`href`);h=!!(t&&n&&Qb(n))&&(c?L_(n):n)}Y(Ob(e),`ph-no-capture`)&&(g=!0),p.push(function(e,t,n,r,i){i===void 0&&(i=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};Mb.indexOf(a)>-1&&!n&&(o.$el_text=a.toLowerCase()===`a`||a.toLowerCase()===`button`?LC(1024,$b(e)):LC(1024,Ab(e)));var s=Ob(e);s.length>0&&(o.classes=s.filter((function(e){return e!==``}))),Uy(e.attributes,(function(n){var a;if((!Gb(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&Qb(n.value)&&(!mg(a=n.name)||a.substring(0,10)!==`_ngcontent`&&a.substring(0,7)!==`_nghost`)){var s=n.value;n.name===`class`&&(s=Eb(s).join(` `)),o[`attr__`+n.name]=LC(1024,n.name===`href`&&i?L_(s):s)}}));for(var c=1,l=1,u=e;u=RC(u);)c++,u.tagName===e.tagName&&l++;return o.nth_child=c,o.nth_of_type=l,o}(e,i,a,o,c)),Wy(m,function(e){if(!Wb(e))return{};var t={};return Uy(e.attributes,(function(e){if(e.name&&e.name.indexOf(`data-ph-capture-attribute`)===0){var n=e.name.replace(`data-ph-capture-attribute-`,``),r=e.value;n&&r&&Qb(r)&&(t[n]=r)}})),t}(e))})),g)return{props:{},explicitNoCapture:g};if(a||(p[0].$el_text=Cb(e,`a`)||Cb(e,`button`)?$b(e):Ab(e)),h){var _;p[0].attr__href=h;var v=gx(h)?.host,y=G==null||(_=G.location)==null?void 0:_.host;v&&y&&v!==y&&(d=h)}return{props:Wy({$event_type:r.type,$ce_version:1},s?{}:{$elements:p},{$elements_chain:(f=p,function(e){return e.map((e=>{var t=``;if(e.tag_name&&(t+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))t+=`.`+n.replace(/"/g,``);var r=J({},e.text?{text:e.text}:{},{"nth-child":e.nth_child??0,"nth-of-type":e.nth_of_type??0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return Gy(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[tx(t.toString())]=tx(n.toString())})),(t+=`:`)+Gy(i).map((e=>{var[t,n]=e;return t+`="`+n+`"`})).join(``)})).join(`;`)}(function(e){return e.map((e=>{var t={text:e.$el_text?.slice(0,400),tag_name:e.tag_name,href:e.attr__href?.slice(0,2048),attr_class:nx(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Gy(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(f)))},(n=p[0])!=null&&n.$el_text?{$el_text:p[0]?.$el_text}:{},d&&r.type===`click`?{$external_click_url:d}:{},m)}}var BC=kv(`[ExceptionAutocapture]`),VC=()=>{},HC=kv(`[TracingHeaders]`),UC=kv(`[Web Vitals]`),WC=9e5,GC=`disabled`,KC=`lazy_loading`,qC=`awaiting_config`,JC=`missing_config`;kv(`[SessionRecording]`),kv(`[SessionRecording]`);var YC=`[SessionRecording]`,XC=kv(YC),ZC=kv(`[Heatmaps]`);function QC(e){return fg(e)&&`clientX`in e&&`clientY`in e&&_g(e.clientX)&&_g(e.clientY)}var $C=kv(`[Product Tours]`),ew=e=>{var t;return!e.config.disable_product_tours&&!((t=e.persistence)==null||!t.get_property(Wv))},tw=[`$set_once`,`$set`],nw=kv(`[SiteApps]`),rw=`Error while initializing PostHog app with config id `;function iw(e,t,n){if(Q(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var aw=class{constructor(e){this.sn=new QS,this.an=(e,t)=>this.ln(e,t)&&this.un(e,t)&&this.hn(e,t)&&this.dn(e,t),this.ln=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e;Z(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!Z(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.vn)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.cn)==null||t.add(e?.event||``)}))})),(t=this._instance)!=null&&t.autocapture)){var n,r=new Set;e.forEach((e=>{var t;(t=e.steps)==null||t.forEach((e=>{e!=null&&e.selector&&r.add(e?.selector)}))}
17)),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.cn.has(e)||this.cn.has(t?.event))&&this.vn&&this.vn?.size>0&&this.vn.forEach((e=>{this.fn(t,e)&&this.sn.emit(`actionCaptured`,e.name)}))}pn(e){this.onAction(`actionCaptured`,(t=>e(t)))}fn(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.an(e,n))return!0;return!1}onAction(e,t){return this.sn.on(e,t)}un(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!iw(r,t.url,t.url_matching||`contains`))return!1}return!0}hn(e,t){return!!this.gn(e,t)&&!!this.mn(e,t)&&!!this.yn(e,t)}gn(e,t){var n;if(t==null||!t.href)return!0;var r=this.bn(e);if(r.length>0)return r.some((e=>iw(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&iw((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}mn(e,t){var n;if(t==null||!t.text)return!0;var r=this.bn(e);if(r.length>0)return r.some((e=>iw(e.text,t.text,t.text_matching||`exact`)||iw(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!Q(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>iw(e,a,o))))}yn(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}bn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}dn(e,t){return t==null||!t.properties||t.properties.length===0||sC(t.properties.reduce(((e,t)=>{var n=X(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},ow=class{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,t){return!!e&&sC(e.propertyFilters,t?.properties)}Cn(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}In(e,t,n){var r=(n===Vx.Activation?this.wn:this.xn).get(e),i=[];return this.Tn((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.Sn(a,t)}))}register(e){Z(this._instance?._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.Pn??(this.Pn=new aw(this._instance),this.Pn.init(),this.Pn.pn((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.Pn)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.kn.get(t.name);n&&n.push(e.id),this.kn.set(t.name,n||[e.id])}})))})))}En(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.wn=this.Cn(e,Vx.Activation),this.xn=this.Cn(e,Vx.Cancellation))}onEvent(e,t){var n,r,i=this.Rn(),a=(t==null||(n=t.properties)==null?void 0:n.$survey_id)||(t==null||(r=t.properties)==null?void 0:r.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var o=this.On(e,a);if(o===`consume`)return i.info(`event consumed activated item, remov
17ing it`,{event:e,itemId:a}),void this.Ln([a]);if(o===`persist`)return i.info(`shown item promoted to persisted activation`,{event:e,itemId:a}),void this.Fn(a)}if(this.xn.has(e)){var s=this.In(e,t,Vx.Cancellation);s.length>0&&(i.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:s.map((e=>e.id))}),this.Ln(s.map((e=>e.id))),s.forEach((e=>this.An(e.id))))}if(this.wn.has(e)){i.info(`event name matched`,{event:e,eventPayload:t,items:this.wn.get(e)});var c=this.In(e,t,Vx.Activation);this.$n(c.map((e=>e.id)))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){e.length!==0&&(this._n=[...new Set([...this._n,...e])],this.Rn().info(`updating activated items`,{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter((t=>t!==e));var t=this.Dn();t.includes(e)||this.Nn([...t,e])}Ln(e){var t=new Set(e);this._n=this._n.filter((e=>!t.has(e)));var n=this.Dn(),r=n.filter((e=>!t.has(e)));r.length!==n.length&&this.Nn(r)}Dn(){var e,t=this.qn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter((e=>!this.Bn(e)))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}jn(){return this.Pn}},sw=class extends ow{constructor(e){super(e)}qn(){return fy}Hn(){return Wx.SHOWN}Tn(e){var t;(t=this._instance)==null||t.getSurveys(e)}An(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}Rn(){return fC}Nn(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[fy]:e})}Bn(){return!1}On(e,t){var n;return this.Tn((e=>{n=e.find((e=>e.id===t))})),!n||function(e){var t,n,r=(((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)??0)>0;return e.schedule===Ux.Always||!((n=e.conditions)==null||(n=n.events)==null||!n.repeatedActivation||!r)}(n)?e===Wx.SHOWN?`consume`:`ignore`:e===Wx.SHOWN?`persist`:e===Wx.DISMISSED||e===Wx.SENT?`consume`:`ignore`}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},cw=`SDK is not enabled or survey functionality is not yet loaded`,lw=`Disabled. Not loading surveys.`,uw=G!=null&&G.location?yx(G.location.hash,`__posthog`)||yx(location.hash,`state`):null,dw=`_postHogToolbarParams`,fw=kv(`[Toolbar]`),pw=kv(`[FeatureFlags]`),mw=kv(`[FeatureFlags]`,{debugEnabled:!0}),hw=`" failed. Feature flags didn't load in time.`,gw=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},_w=e=>{var t={};for(var[n,r]of Gy(e||{}))r&&(t[n]=r);return t},vw=kv(`[Error tracking]`),yw=`Refusing to render web experiment since the viewer is a likely bot`,bw={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>rC(t,e),not_regex:(e,t)=>!rC(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},xw=class e{get Se(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){t===void 0&&(t=!1),n.getWebExperiments((t=>{e.Un(`retrieved web experiments from the server`),n.zn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;n.zn&&(e.Un(`setting flag key `,t.feature_flag_key,` to web experiment `,t),(r=n.zn)==null||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);mg(i)&&t.variants[i]&&n.Vn(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var a in t.variants){var o=t.variants[a];e.Wn(o,n._instance)&&n.Vn(t.name,a,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Un(yw);else if(!this.Se.disable_web_experiments){if(Q(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Un(`applying feature flags`,t),t.forEach((e=>{var t;if(this.zn&&(t=this.zn)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.zn?.get(e);n&&r!=null&&r.variants[n]&&this.Vn(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var t=e.getWindowLocation();if(t!=null&&t.search){var n=_x(t?.search,`__experiment_id`),r=_x(t?.search,`__experiment_variant`);n&&r&&(e.Un(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.Gn(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}
17getWebExperiments(e,t,n){if(this.Se.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property(`$web_experiments`);if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/web_experiments/?token=`+this.Se.token),method:`GET`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}Gn(t,n,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(e.Un(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.Vn(i[0].name,n,i[0].variants[n].transforms))}static Wn(t,n){return!Q(t.conditions)&&e.Zn(t,n)&&e.Qn(t)}static Zn(t,n){if(Q(t.conditions)||Q(t.conditions?.url))return!0;var r=e.getWindowLocation();if(r){var i,a=_b(n,r.href);return(i=t.conditions)==null||!i.url||bw[t.conditions?.urlMatchType??`icontains`](t.conditions.url,a)}return!1}static getWindowLocation(){return G?.location}static Qn(e){if(Q(e.conditions)||Q(e.conditions?.utm))return!0;var t=Dx();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static Un(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];$.info(`[WebExperiments] `+e,n)}Vn(t,n,r){this._is_bot()?e.Un(yw):n===`control`?e.Un(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(e.Un(`applying transform of variant `+n+` for experiment `+t+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return Ah&&this._instance?tC(Ah,this.Se.custom_blocked_useragents):void 0}},Sw=kv(`[Conversations]`),Cw=`Conversations not available yet.`,ww=`console`,Tw={featureFlags:class{constructor(e){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=0,this.os=()=>{var e=this.ls();this.ss=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],G&&Zy(G,`online`,this.os)}destroy(){G?.removeEventListener(`online`,this.os)}get Se(){return this._instance.config}get zr(){return this._instance.persistence}us(e){return this._instance.get_property(e)}hs(){var e;return(e=this.zr?.Gt(this.Se.feature_flag_cache_ttl_ms))!=null&&e}ds(){return!!this.hs()&&(this.ns||this.Kn||(this.ns=!0,pw.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}cs(){var e=this.Se.evaluation_contexts??this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||(pw.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.rs=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||pw.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}vs(){return this.cs().length>0}fs(){var e=this.Se.flag_keys;if(!Z(e)){if(X(e))return e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||pw.error(`Invalid flag key found:`,e,`Expected non-empty string`),t}));pw.error(`Invalid flag_keys found:`,e,`Expected array of non-empty strings`)}}initialize(){var{config:e}=this._instance,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(n[t]&&(e[t]=n[t]),e)),{});this.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r,i,a=n!=null&&n.merge&&(r=this.us(ey))!=null?r:{},o=n!=null&&n.merge&&(i=this.us(iy))!=null?i:{},s=J({},a,e),c=J({},o,t),l={};for(var[u,d]of Object.entries(s))l[u]={key:u,enabled:Wh(d),variant:Gh(d),reason:void 0,metadata:Z(c?.[u])?void 0:{id:0,version:void 0,description:void 0,payload:c[u]}};this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.us(ry),t=this.us(oy),n=this.us(sy);if(!n&&!t)return e||{};var r=Wy({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=Z(c)?(a=s?.enabled)!=null&&a:!!c,u=Z(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=J({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=J({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.Jn||=(pw.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((n=>{var r=e[n];return{key:n,enabled:Wh(r),variant:Gh(r),payload:Uh(t[n])}}))}getFlagVariants(){var e=this.us(ey),t=this.us(oy);if(!t)return e||{};for(var n=Wy({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=(pw.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.us(iy),t=this.us(sy);if(!t)return e||{};for(var n=Wy({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=(pw.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.ls()||this.ps||(this._instance.Ti.emit(`featureFlagsReloading`,!0),this.ps=setTimeout((()=>{this.gs()}),5))}ys(){clearTimeout(this.ps),this.ps=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.ps||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Xn=e}gs(e){if(this.ys(),!this._instance.mr()&&!this.ls())if(this.Kn)this.es=!0;else{var t=this.Se.token,n=this.us(Nv),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:J({},this.zr?.get_initial_props()||{},this.us(cy)||{}),group_properties:this.us(ly),timezone:Fx()};gg(n)||Z(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.vs()&&(r.evaluation_contexts=this.cs());var i=this.fs();Z(i)||(r.flag_keys=i);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.Se.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.Kn=!0,this._instance._send_request({method:`POST`,url:o,data:r,compression:this.Se.disable_compression?void 0:$x.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,o=!0;if(this.bs(e.statusCode),e.statusCode===200&&(this.es||(this.$anon_distinct_id=void 0),o=!1),this.Kn=!1,!r.disable_flags||this.es){this.ts=!o;var s=[];e.error?e.error instanceof Error?s.push(e.error.name===`AbortError`?`timeout`:`connection_error`):s.push(`unknown_error`):e.statusCode!==200&&s.push(`api_error_`+e.statusCode),(t=e.json)!=null&&t.errorsWhileComputingFlags&&s.push(`errors_while_computing_flags`);var c=!((n=e.json)==null||(n=n.quotaLimited)==null||!n.includes(`feature_flags`));c&&s.push(`quota_limited`),(i=this.zr)==null||i.register({[gy]:s}
17),c?pw.warn(`You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more.`):(r.disable_flags||this.receivedFeatureFlags(e.json??{},o,{partialResponse:a}),this.es&&(this.es=!1,this.gs()))}}})}}ls(){return bx(this.ss,3)}bs(e){this.ss=xx(e,this.ss,3,(()=>pw.warn(`Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.`)))}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ds()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else pw.warn(`getFeatureFlag for key "`+e+hw)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ds()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.us(ay)||void 0,c=this.us(_y)||void 0,l=this.us(my)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.us(hy);d&&d!==f&&(l={},(u=this.zr)==null||u.register({[my]:l,[hy]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,_,v,y,b;X(l[e])?l[e].push(o):l[e]=[o],(p=this.zr)==null||p.register({[my]:l});var x=this.getFeatureFlagDetails(e),S=[...this.us(gy)??[]];Z(i)&&S.push(`flag_missing`);var C={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((m=this.Se.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.Se.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.ts};Z(x==null||(g=x.metadata)==null?void 0:g.version)||(C.$feature_flag_version=x.metadata.version);var w,ee=(x==null||(_=x.reason)==null?void 0:_.description)??(x==null||(v=x.reason)==null?void 0:v.code);ee&&(C.$feature_flag_reason=ee),x!=null&&(y=x.metadata)!=null&&y.id&&(C.$feature_flag_id=x.metadata.id),Z(x?.original_variant)&&Z(x?.original_enabled)||(C.$feature_flag_original_response=Z(x.original_variant)?x.original_enabled:x.original_variant),x!=null&&(b=x.metadata)!=null&&b.original_payload&&(C.$feature_flag_original_payload=x==null||(w=x.metadata)==null?void 0:w.original_payload),S.length&&(C.$feature_flag_error=S.join(`,`)),this._instance.capture(`$feature_flag_called`,C)}if(r)return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:Uh(a)}}}else pw.warn(`getFeatureFlagResult for key "`+e+hw)}getRemoteConfigPayload(e,t){var n=this.Se.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.vs()&&(r.evaluation_contexts=this.cs());var i=this.fs();Z(i)||(r.flag_keys=i),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.Se.disable_compression?void 0:$x.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(n){var r=n.json?.featureFlagPayloads;t(r?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return Z(n)?void 0:!!n}pw.warn(`isFeatureEnabled for key "`+e+hw)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.zr){this.Yn=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(e,t,n,r,i,a){n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i={});var o=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>[e,t[e].variant??t[e].enabled]))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>t[e].metadata?.payload)).map((e=>[e,t[e].metadata?.payload])))):e.featureFlags&&pw.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e})(e),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(X(c)){pw.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;t&&t.register({[ty]:c,[ey]:f})}else{var m=c,h=l,g=s;if(a!=null&&a.partialResponse)m=J({},n,m),h=J({},r,h),g=J({},i,g);else if(e.errorsWhileComputingFlags)if(s){var _=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=J({},n,Object.fromEntries(Object.entries(m).filter((e=>{var[t]=e;return _.has(t)})))),h=J({},r,Object.fromEntries(Object.entries(h||{}).filter((e=>{var[t]=e;return _.has(t)})))),g=J({},i,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return _.has(t)}))))}else m=J({},n,m),h=J({},r,h),g=J({},i,g);t&&t.register(J({[ty]:Object.keys(_w(m)),[ey]:m||{},[iy]:h||{},[ry]:g||{}},u?{[ay]:u}:{},d?{[_y]:d}:{}))}}})(e,this.zr,r,i,a,n),t||(this.ns=!1),this._s(t)}}override(e,t){t===void 0&&(t=!1),pw.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.zr)return pw.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.zr.unregister(oy),this.zr.unregister(sy),this._s(),mw.info(`All overrides cleared`);if(X(e)){var t=gw(e);return this.zr.register({[oy]:t}),this._s(),mw.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.zr.unregister(oy),mw.info(`Flag overrides cleared`);else if(r.flags){if(X(r.flags)){var i=gw(r.flags);this.zr.register({[oy]:i})}else this.zr.register({[oy]:r.flags});mw.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.zr.unregister(sy),mw.info(`Payload overrides cleared`)):r.payloads&&(this.zr.register({[sy]:r.payloads}),mw.info(`Payload overrides set`,{payloads:r.payloads}))),this._s();return}if(e&&typeof e==`object`)return this.zr.register({[oy]:e}),this._s(),mw.info(`Flag overrides set`,{flags:e});pw.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:n}=this.ws();try{e(t,n)}catch(e){pw.error(`Error while running feature flags callback`,e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.us(ny)||[]).find((t=>t.flagKey===e)),a={[`$feature_enrollment/`+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture(`$feature_enrollment_update`,o),this.setPersonPropertiesForFlags(a,!1);var s=J({},this.getFlagVariants(),{[e]:t});(r=this.zr)==null||r.register({[ty]:Object.keys(_w(s)),[ey]:s}),this._s()}
17getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.us(ny),i=n?`&`+n.map((e=>`stage=`+e)).join(`&`):``;if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=`+this.Se.token+i),method:`GET`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.zr)==null||n.unregister(ny),(r=this.zr)==null||r.register({[ny]:i}),e(i)}}})}ws(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}_s(e){var{flags:t,flagVariants:n}=this.ws();this.featureFlagEventHandlers.forEach((r=>{try{r(t,n,{errorsLoading:e})}catch(e){pw.error(`Error while running feature flags callback`,e)}}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.us(cy)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this._instance.register({[cy]:J({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=J({},this.us(cy)||{});e.forEach((e=>{delete n[e]})),this._instance.register({[cy]:n}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){e===void 0&&(e=!0),this._instance.unregister(cy),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.us(ly)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=J({},n[t],e[t]),delete e[t]})),this._instance.register({[ly]:J({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.us(ly)||{};this._instance.register({[ly]:J({},t,{[e]:{}})})}else this._instance.unregister(ly)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.ys(),this.Jn=!1,this.ss=0}}},Ew={sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var e;return!((e=this.xs)==null||!e.isStarted)}get status(){return this.ks===qC||this.ks===JC?this.ks:this.xs?.status??this.ks}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ks=GC,this.Ss=void 0,this._instance=e,!this._instance.sessionManager)throw XC.error(`started without valid sessionManager`),Error(YC+` started without valid sessionManager. This is a bug.`);if(this.Se.cookieless_mode===My)throw Error(YC+` cannot be used with cookieless_mode="always"`)}initialize(){this.startIfEnabledOrStop()}get Cs(){var e,t=!((e=this._instance.get_property(Kv))==null||!e.enabled),n=!this.Se.disable_session_recording,r=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return G&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.Cs||(t=this.xs)==null||!t.isStarted){var n=!Z(Object.assign)&&!Z(Array.from);this.Cs&&n?(this.Is(e),XC.info(`starting`)):(this.ks=GC,this.stopRecording())}}Is(e){var t,n,r;this.Cs&&(this.ks!==qC&&this.ks!==JC&&(this.ks=KC),q!=null&&(t=q.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=q.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Ts(e):(r=q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Es,(t=>{if(t)return XC.error(`could not load recorder`,t);this.Ts(e)})))}stopRecording(){var e,t;(e=this.Ss)==null||e.call(this),this.Ss=void 0,(t=this.xs)==null||t.stop()}Ms(){var e,t;(e=this.Ss)==null||e.call(this),this.Ss=void 0,(t=this.xs)==null||t.discard()}Ps(){var e,t;(e=this.zr)==null||e.unregister($v),(t=this.zr)==null||t.unregister(qv)}Rs(e,t){if(Q(e))return null;var n,r=_g(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(XC.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}Os(e){if(this.zr){var t,n=this.zr,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Rs(this.Se.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Rs(t?.sampleRate,`remote config sampleRate`),a=r??i;Q(a)&&this.Ps();var o=t?.minimumDurationMilliseconds;n.register({[Kv]:J({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:J({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Z(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this.Ss)==null||t.call(this),this.Ss=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){`sessionRecording`in e?!1===e.sessionRecording?(this.Os(e),this.Ms()):(this.Os(e),this.startIfEnabledOrStop()):(this.ks===qC&&(this.ks=JC,XC.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.xs)!=null&&n.log?this.xs.log(e,t):XC.warn(`log called before recorder was ready`)}get Es(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Kv);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Ls(){var e,t=this._instance.get_property(Kv);if(!t)return!1;try{e=typeof t==`object`?t:JSON.parse(t)}catch(e){return XC.warn(`persisted remote config for session recording is invali
17d and will be ignored`,e),!1}var n=e.cache_timestamp??Date.now();return 36e5>=Date.now()-n}Ts(e){var t;if((t=q.__PosthogExtensions__)==null||!t.initSessionRecording)return XC.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[ky]:!0});if(this.xs||(this.xs=q.__PosthogExtensions__?.initSessionRecording(this._instance),this.xs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ls()){if(this.ks===JC||this.ks===qC)return;this.ks=qC,XC.info(`persisted remote config is stale, requesting fresh config before starting`),new Qx(this._instance).load();return}this.ks=KC,this.xs.start(e)}onRRwebEmit(e){var t;(t=this.xs)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.xs||(t=this.zr)==null||t.register({[Yv]:!0}),(e=this.xs)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.xs||(t=this.zr)==null||t.register({[Jv]:!0}),(e=this.xs)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.xs||(n=this.zr)==null||n.register({[e===`url`?Xv:Zv]:!0}),(t=this.xs)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.xs?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.xs)==null||!n.tryAddCustomEvent(e,t))}}},Dw={autocapture:class{constructor(e){this.Fs=!1,this.As=null,this.$s=!1,this.instance=e,this.rageclicks=new PC(e.config.rageclick),this.Ds=null}initialize(){this.startIfEnabled()}get Se(){var e=fg(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=e.url_allowlist?.map((e=>new RegExp(e))),e.url_ignorelist=e.url_ignorelist?.map((e=>new RegExp(e))),e}Ns(){if(this.isBrowserSupported()){if(G&&K){var e=e=>{e||=G?.event;try{this.qs(e)}catch(e){IC.error(`Failed to capture event`,e)}};if(Zy(K,`submit`,e,{capture:!0}),Zy(K,`change`,e,{capture:!0}),Zy(K,`click`,e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e||=G?.event;try{this.qs(e,FC)}catch(e){IC.error(`Failed to capture copy/cut event`,e)}};Zy(K,`copy`,t,{capture:!0}),Zy(K,`cut`,t,{capture:!0})}}}else IC.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.Fs&&(this.Ns(),this.Fs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.$s=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Lv]:!!e.autocapture_opt_out}),this.As=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ds=e}getElementSelectors(e){var t,n=[];return(t=this.Ds)==null||t.forEach((t=>{(K?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[Lv];if(gg(this.As)&&!yg(e)&&!this.instance.mr())return!1;var t=this.As??!!e;return!!this.instance.config.autocapture&&!t}qs(e,t){if(t===void 0&&(t=`$autocapture`),this.isEnabled){var n,r=jb(e);wb(r)&&(r=r.parentNode||null),t===`$autocapture`&&e.type===`click`&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Vb(r,this.instance.config.rageclick)&&this.qs(e,`$rageclick`);var i=t===FC;if(r&&function(e,t,n,r,i,a){var o,s,c;if(n===void 0&&(n=void 0),!G||Hb(e)||(o=n)!=null&&o.url_allowlist&&!Db(n.url_allowlist,a)||(s=n)!=null&&s.url_ignorelist&&Db(n.url_ignorelist,a))return!1;if((c=n)!=null&&c.dom_event_allowlist){var l=n.dom_event_allowlist;if(l&&!l.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=Ub(e,r);if(!function(e,t){var n=t?.element_allowlist;if(Z(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(d,n)||!Nb(d,n?.css_selector_allowlist)||Nb(d,n?.css_selector_ignorelist??Fb))return!1;try{var f=G.getComputedStyle(e);if(f&&f.getPropertyValue(`cursor`)===`pointer`&&t.type===`click`)return!0}catch{}var p=e.tagName.toLowerCase();switch(p){case`html`:return!1;case`form`:return(i||[`submit`]).indexOf(t.type)>=0;case`input`:case`select`:case`textarea`:return(i||[`change`,`click`]).indexOf(t.type)>=0;default:return u?(i||[`click`]).indexOf(t.type)>=0:(i||[`click`]).indexOf(t.type)>=0&&(Mb.indexOf(p)>-1||e.getAttribute(`contenteditable`)===`true`)}}(r,e,this.Se,i,i?[`copy`,`cut`]:void 0,this.instance)){var{props:a,explicitNoCapture:o}
17=zC(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.$s,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(o)return!1;var s=this.getElementSelectors(r);if(s&&s.length>0&&(a.$element_selectors=s),t===FC){var c,l=kb(G==null||(c=G.getSelection())==null?void 0:c.toString()),u=e.type||`clipboard`;if(!l)return!1;a.$selected_content=l,a.$copy_type=u}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return dg(K?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Bs=(G==null||(t=G.location)==null?void 0:t.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&($.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.js&&this.js(),this.js=void 0,$.info(`History API monitoring stopped`)}monitorHistoryChanges(){G&&G.history&&(this.Hs(`pushState`),this.Hs(`replaceState`),this.Us())}Hs(e){var t;if(G&&((t=G.history[e])==null||!t.__posthog_wrapped__)){var n=this;(function(e,t,n){try{if(!(t in e))return VC;var r={next:e[t]},i=n((function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return r.next.apply(this,t)}));return dg(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=i,()=>{if(e[t]!==i)for(var n=e[t];dg(n)&&n.__posthog_layer__;){var a=n.__posthog_layer__;if(a.next===i)return void(a.next=r.next);n=a.next}else e[t]=r.next}}catch{return VC}})(G.history,e,(t=>function(r,i,a){t.call(this,r,i,a),n.zs(e)}))}}zs(e){try{var t,n=G==null||(t=G.location)==null?void 0:t.pathname;if(!n)return;n!==this.Bs&&this.isEnabled&&this._instance.capture(Ry,{navigation_type:e}),this.Bs=n}catch(t){$.error(`Error capturing `+e+` pageview`,t)}}Us(){if(!this.js){var e=()=>{this.zs(`popstate`)};Zy(G,`popstate`,e),this.js=()=>{G&&G.removeEventListener(`popstate`,e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.Vs=!1,this.Fs=!1,this.Ws=null,this.instance=e,this.Vs=!((t=this.instance.persistence)==null||!t.props[Rv]),this.rageclicks=new PC(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return fg(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Q(this.Se.capture_heatmaps)?Q(this.Se.enable_heatmaps)?this.Vs:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Fs)return;ZC.info(`starting...`),this.Gs(),this.ke()}else clearInterval(this.Ws??void 0),this.Zs(),this.getAndClearBuffer()}onRemoteConfig(e){if(`heatmaps`in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Rv]:t}),this.Vs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Qs(e){this.fe(e.originalEvent,`deadclick`)}ke(){this.Ws&&clearInterval(this.Ws),this.Ws=K?.visibilityState===`visible`?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Gs(){G&&K&&(this.Js=this.Lr.bind(this),Zy(G,Ly,this.Js),this.Ys=e=>this.fe(e||G?.event),Zy(K,`click`,this.Ys,{capture:!0}),this.Ks=e=>this.Xs(e||G?.event),Zy(K,`mousemove`,this.Ks,{capture:!0}),this.eo=new ox(this.instance,ix,this.Qs.bind(this)),this.eo.startIfEnabledOrStop(),this.ro=this.ke.bind(this),Zy(K,Iy,this.ro),this.Fs=!0)}Zs(){var e;G&&K&&(this.Js&&G.removeEventListener(Ly,this.Js),this.Ys&&K.removeEventListener(`click`,this.Ys,{capture:!0}),this.Ks&&K.removeEventListener(`mousemove`,this.Ks,{capture:!0}),this.ro&&K.removeEventListener(Iy,this.ro),clearTimeout(this.io),(e=this.eo)==null||e.stop(),this.Fs=!1)}no(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),a=function(e,t,n){for(var r=e;r&&Sb(r)&&!Cb(r,`body`);){if(r===n)return!1;var i=void 0;try{i=(r.ownerDocument?.defaultView??G)?.getComputedStyle(r).position}catch{return!1}
17if(Y(t,i))return!0;r=Pb(r)}return!1}(jb(e),[`fixed`,`sticky`],i);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:n),target_fixed:a,type:t}}fe(e,t){var n;if(t===void 0&&(t=`click`),!xb(e.target)&&QC(e)){var r=this.no(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&Vb(jb(e),this.instance.config.rageclick)&&this.so(J({},r,{type:`rageclick`})),this.so(r)}}Xs(e){!xb(e.target)&&QC(e)&&(clearTimeout(this.io),this.io=setTimeout((()=>{this.so(this.no(e,`mousemove`))}),500))}so(e){if(G){var t=this.Se.disable_capture_url_hashes?L_(G.location.href):G.location.href,n=this.Se.custom_personal_data_properties,r=vx(t,this.Se.mask_personal_data_properties?[...Cx,...n||[]]:[],Tx);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(e)}}Lr(){this.R&&!pg(this.R)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ox,webVitalsAutocapture:class{constructor(e){var t;this.Vs=!1,this.Fs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.oo=()=>{clearTimeout(this.ao),this.R.metrics.length!==0&&(this._instance.capture(`$web_vitals`,this.R.metrics.reduce(((e,t)=>J({},e,{[`$web_vitals_`+t.name+`_event`]:J({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.lo=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t=this.uo();if(!Z(t))if(Q(e?.name)||Q(e?.value))UC.error(`Invalid metric received`,e);else if(!this.ho||this.ho>e.value){this.R.url!==t&&(this.oo(),this.ao=setTimeout(this.oo,this.flushToCaptureTimeoutMs)),Z(this.R.url)&&(this.R.url=t),this.R.firstMetricTimestamp=Z(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0),r=J({},e,{$current_url:t,timestamp:Date.now()});Z(n)||(r.$session_id=n.sessionId,r.$window_id=n.windowId),this.R.metrics.push(r),this.R.metrics.length===this.allowedMetrics.length&&this.oo()}else UC.error(`Ignoring metric with value >= `+this.ho,e)},this.do=()=>{if(!this.Fs){var e,t,n,r,i=q.__PosthogExtensions__;Z(i)||Z(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.lo.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.lo.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.lo.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.lo.bind(this)),this.Fs=!0):UC.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.Vs=!((t=this._instance.persistence)==null||!t.props[Hv]),this.startIfEnabled()}get co(){return this._instance.config.capture_performance}get allowedMetrics(){var e=fg(this.co)?this.co?.web_vitals_allowed_metrics:void 0;return Q(e)?this._instance.persistence?.props[Gv]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(fg(this.co)?this.co.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=fg(this.co)?this.co.web_vitals_attribution:void 0;return e!=null&&e}get ho(){var e=fg(this.co)&&_g(this.co.__web_vitals_max_value)?this.co.__web_vitals_max_value:WC;return e>0&&6e4>=e?WC:e}get isEnabled(){var e=jh?.protocol;if(e!==`http:`&&e!==`https:`)return UC.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=fg(this.co)?this.co.web_vitals:yg(this.co)?this.co:void 0;return yg(t)?t:this.Vs}startIfEnabled(){this.isEnabled&&!this.Fs&&(UC.info(`enabled, starting...`),this.Mt(this.do))}onRemoteConfig(e){if(`capturePerformance`in e){var t=fg(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=fg(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Hv]:t}),this._instance.persistence.register({[Gv]:n})),this.Vs=t,this.startIfEnabled()}}Mt(e){var t,n;(t=q.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?`web-vitals-with-attribution`:`web-vitals`,(t=>{t?UC.error(`failed to load script`,t):e()}))}uo(){var e=G?this._instance.config.disable_capture_url_hashes?L_(G.location.href):G.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return vx(e,this._instance.config.mask_personal_data_properties?[...Cx,...t||[]]:[],Tx)}UC.error(`Could not determine current URL`)}}},Ow={exceptionObserver:class{constructor(e){var t;this.do=()=>{var e;if(G&&this.isEnabled&&(e=q.__PosthogExtensions__)!=null&&e.errorWrappingFunctions){var t=q.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=q.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=q.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.vo&&this.Se.capture_unhandled_errors&&(this.vo=t(this.captureException.bind(this))),!this.fo&&this.Se.capture_unhandled_rejections&&(this.fo=n(this.captureException.bind(this))),!this.po&&this.Se.capture_console_errors&&(this.po=r(this.captureException.bind(this)))}catch(e){BC.error(`failed to start`,e),this.mo()}}},this._instance=e,this.yo=!((t=this._instance.persistence)==null||!t.props[zv]),this.bo=new Ag({refillRate:this._instance.config.error_tracking.__exceptionRateLimiterRefillRate??1,bucketSize:this._instance.config.error_tracking.__exceptionRateLimiterBucketSize??10,refillInterval:1e4,Ae:BC}),this.Se=this._o(),this.startIfEnabledOrStop()}_o(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return fg(e)?t=J({},t,e):(Z(e)?this.yo:e)&&(t=J({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(BC.info(`enabled`),this.mo(),this.Mt(this.do)):this.mo()}Mt(e){var t,n;(t=q.__PosthogExtensions__)!=null&&t.errorWrappingFunctions?e():(n=q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return BC.error(`failed to load script`,t);
17e()}))}mo(){var e,t,n;(e=this.vo)==null||e.call(this),this.vo=void 0,(t=this.fo)==null||t.call(this),this.fo=void 0,(n=this.po)==null||n.call(this),this.po=void 0}onRemoteConfig(e){`autocaptureExceptions`in e&&(this.yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[zv]:this.yo}),this.Se=this._o(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this._o()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.bo.consumeRateLimit(r)?BC.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.wo=[],this.xo=new Q_([new uv,new bv,new fv,new dv,new vv,new _v,new mv,new yv],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(`
18`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=lv.test(s)?s.replace(lv,`$1`):s;if(!c.match(/\S*Error: /)){for(var l of n){var u=l(c,e);if(u){i.push(u);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return J({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||$_});var n}))}(i)}}(`web:javascript`,av,cv)),this._instance=e,this.wo=this._instance.persistence?.get_property(Bv)??[],this.ko=Tv(this.So()),this.Co=new Ev(this.ko)}onConfigChange(){this.ko=Tv(this.So()),this.Co.setConfig(this.ko)}onRemoteConfig(e){if(`errorTracking`in e){var t=e.errorTracking?.suppressionRules??[],n=e.errorTracking?.captureExtensionExceptions;this.wo=t,this._instance.persistence&&this._instance.persistence.register({[Bv]:this.wo,[Vv]:n})}}get Io(){var e,t=!!this._instance.get_property(Vv);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.xo.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.ko.enabled)try{if(!mg(e)||e.trim().length===0)return void vw.warn(`Ignoring exception step because message must be a non-empty string`);var{sanitizedProperties:n,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((n,r)=>Cv.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this.To(t));r.length>0&&vw.warn(`Ignoring reserved exception step fields`,{droppedKeys:r}),this.Co.add(J({[xv]:e,[Sv]:new Date().toISOString()},n))}catch(e){vw.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Eo(t)){if(this.Mo(t))return this.Po(`Exception dropped: matched a suppression rule`),void vw.info(`Skipping exception capture because a suppression rule matched`);if(!this.Io&&this.Ro(t))return this.Po(`Exception dropped: thrown by a browser extension`),void vw.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Oo(t))return this.Po(`Exception dropped: thrown by the PostHog SDK`),void vw.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.ko.enabled&&Q(e.$exception_steps)?this.Lo(e):e;try{var r=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,Zi:!0});return r&&this.Co.clear(),r}catch(e){vw.error(`Failed to capture exception event. Dropping this exception.`,e),this.Co.clear();return}}catch(e){vw.error(`Failed to process exception event. Ignoring this exception.`,e);return}}Lo(e){try{var t=this.Co.getAttachable();return t.length===0?e:J({},e,{$exception_steps:t})}catch(t){return vw.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}Po(e){this.ko.enabled&&this.Co.add({[xv]:e,[Sv]:new Date().toISOString()})}To(e){return fg(e)?J({},e):{}}So(){return this._instance.config.error_tracking?.exception_steps??{}}Mo(e){if(e.length===0)return!1;var t=e.reduce(((e,t)=>{var{type:n,value:r}=t;return mg(n)&&n.length>0&&e.$exception_types.push(n),mg(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.wo.some((e=>{var n=e.values.map((e=>{var n=aC[e.operator],r=X(e.value)?e.value:[e.value],i=t[e.key]??[];return r.length>0&&n(r,i)}));return e.type===`OR`?n.some(Boolean):n.every(Boolean)}))}Ro(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}Oo(e){if(e.length>0){var t,n,r=e[0].stacktrace?.frames??[],i=r[r.length-1];return(t=i==null||(n=i.filename)==null?void 0:n.includes(`posthog.com/static`))!=null&&t}return!1}Eo(e){return!Q(e)&&X(e)}}},kw=J({productTours:class{get zr(){return this._instance.persistence}constructor(e){this.Fo=null,this.Ao=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(`productTours`in e){var t;if(this.zr&&this.zr.register({[Wv]:!!e.productTours}),!ew(this._instance))return!this.Fo&&Q(this.zr?.props[py])||$C.info(`product tours disabled; stopping and clearing cached tours`),(t=this.Fo)==null||t.stop(),this.Fo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Fo&&ew(this._instance)&&this.Mt((()=>this.$o()))}Mt(e){var t,n;(t=q.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?$C.error(`Could not load product tours script`,t):e()}))}$o(){var e;!this.Fo&&(e=q.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Fo=q.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!X(this.Ao)||t){var n=this.zr;if(n){var r=n.props[py];if(X(r)&&!t)return this.Ao=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/product_tours/?token=`+this._instance.config.token),method:`GET`,callback:t=>{if(ew(this._instance)){var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;$C.error(i),e([],{isLoaded:!1,error:i});return}var a=X(t.json.product_tours)?t.json.product_tours:[];this.Ao=a,n&&n.register({[py]:a}),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ao,{isLoaded:!0})}getActiveProductTours(e){Q(this.Fo)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Fo.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Fo)==null||t.showTourById(e)}previewTour(e){this.Fo?this.Fo.previewTour(e):this.Mt((()=>{var t;this.$o(),(t=this.Fo)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Fo)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Fo)==null||e.nextStep()}previousStep(){var e;(e=this.Fo)==null||e.previousStep()}clearCache(){var e;this.Ao=null,(e=this.zr)==null||e.unregister(py)}resetTour(e){var t;(t=this.Fo)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Fo)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Fo)==null||t.cancelPendingTour(e)}}},Tw),Aw={siteApps:class{constructor(e){this.Do=0,this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qo(e,t){if(t){var n=this.globalsForEvent(t);this.No.push(n),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return(e=q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.qo.bind(this));this.Bo=()=>{e(),this.No=[],this.Bo=void 0}}}globalsForEvent(e){if(!e)throw Error(`Event payload is required`);var t={},n=this._instance.get_property(`$groups`)||[],r=this._instance.get_property(`$stored_group_properties`)||{};for(var[i,a]of Object.entries(r))t[i]={id:n[i],type:i,properties:a};var{$set_once:o,$set:s}=e;return{event:J({},Hh(e,tw),{properties:J({},e.properties,s?{$set:J({},e.properties?.$set??{},s)}:{},o?{$set_once:J({},e.properties?.$set_once??{},o)}:{}),elements_chain:e.properties?.$elements_chain??``,distinct_id:e.properties?.distinct_id}),person:{properties:this._instance.get_property(`$stored_person_properties`)},groups:t}}jo(e){var t=e.tagName?.toLowerCase();
18return t===`style`&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(nw.error(`prepare_external_dependency_stylesheet returned null`),null):t===`script`&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(nw.error(`prepare_external_dependency_script returned null`),null):e}Ho(){var e;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var t=K?.defaultView,n=t==null||(e=t.Node)==null?void 0:e.prototype;if(!t||!n)return()=>{};if(this.Do++,this.Uo)return this.zo();var r=[],i=this,a=new WeakSet,o=(e,t,n)=>{if(e!=null&&e[t]){var i=e[t];e[t]=n(i),r.push((()=>{e[t]=i}))}},s=e=>{if(a.has(e))return e;var t=i.jo(e);return t&&a.add(t),t},c=e=>e.map((e=>typeof e==`string`?e:s(e))).filter((e=>!gg(e)));return o(n,`appendChild`,(e=>function(t){var n=s(t);return n?e.call(this,n):t})),o(n,`insertBefore`,(e=>function(t,n){var r=s(t);return r?e.call(this,r,n):t})),o(n,`replaceChild`,(e=>function(t,n){var r=s(t);return r?e.call(this,r,n):n})),[t.Element?.prototype,t.Document?.prototype,t.DocumentFragment?.prototype].forEach((e=>{o(e,`append`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`prepend`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))}))})),[t.Element?.prototype,t.CharacterData?.prototype,t.DocumentType?.prototype].forEach((e=>{o(e,`before`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`after`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`replaceWith`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=c(n);return n.length&&!i.length?void 0:e.apply(this,i)}))})),o(t.Element?.prototype,`insertAdjacentElement`,(e=>function(t,n){var r=s(n);return r?e.call(this,t,r):null})),this.Uo=()=>{r.forEach((e=>e())),this.Uo=void 0},this.zo()}zo(){var e=!1;return()=>{var t;e||(e=!0,this.Do--,this.Do===0&&((t=this.Uo)==null||t.call(this)))}}Vo(e,t){t===void 0&&(t=!0);var n=this.Ho();try{var r=e(n);return t&&n(),r}catch(e){throw n(),e}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.No.length&&(nw.info(`Processing `+this.No.length+` events for site app with id `+e.id),this.No.forEach((e=>this.Vo((()=>t.processEvent==null?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.Bo)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,nw.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var{processEvent:a}=this.Vo((t=>e.init({posthog:this._instance,callback(e){t(),i(e)}})),!1);a&&(t.processEvent=a),r=!0}catch(t){nw.error(rw+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){nw.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}Wo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Go(e){var t=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e),r=function(r){try{t.Vo((()=>r.processEvent==null?void 0:r.processEvent(n)))}catch(t){nw.error(`Error while processing event `+e.event+` for site app `+r.id,t)}};for(var i of Object.values(this.apps))r(i)}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Wo(),void this._instance.on(`eventCaptured`,(e=>this.Go(e)))):void nw.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.Bo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(e){var t;q[`__$$ph_site_app_`+e]=i._instance,(t=q.__PosthogExtensions__)==null||t.loadSiteApp==null||t.loadSiteApp(i._instance,s,(t=>{if(t)return nw.error(rw+e,t)}))};for(var{id:o,url:s}of e.siteApps)a(o)}else nw.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}},jw={tracingHeaders:class{constructor(e){this.Zo=void 0,this.Qo=void 0,this.Jo=void 0,this.do=()=>{var e,t,n=this.Yo();n?(Z(this.Zo)&&(this.Zo=(e=q.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Z(this.Qo)&&(this.Qo=(t=q.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.mo()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Mt(e){var t,n;(t=q.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return HC.error(`failed to load script`,t);
18e()}))}Ko(){return this._instance.config.tracing_headers??this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}Yo(){var e=this.Ko();return X(e)?(X(this.Jo)?this.Jo.splice(0,this.Jo.length,...e):this.Jo=[...e],e.length>0?this.Jo:void 0):(X(this.Jo)&&this.Jo.splice(0),this.Jo=e||void 0,this.Jo)}mo(){var e,t;(e=this.Zo)==null||e.call(this),(t=this.Qo)==null||t.call(this),this.Zo=void 0,this.Qo=void 0}startIfEnabledOrStop(){this.Yo()?this.Mt(this.do):this.mo()}}},Mw=J({surveys:class{get Se(){return this._instance.config}constructor(e){this.Xo=void 0,this._surveyManager=null,this.ea=!1,this.ta=[],this.ra=null,this.ia=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(Q(t))return fC.warn(`Flags not loaded yet. Not loading surveys.`);var n=X(t);this.Xo=n?t.length>0:t,fC.info(`flags response received, isSurveysEnabled: `+this.Xo),this.loadIfEnabled()}}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem(`lastSeenSurveyDate`);for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(pC)||r!=null&&r.startsWith(`inProgressSurvey_`))&&t.push(r)}t.forEach((e=>localStorage.removeItem(e)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.ea)fC.info(`Already initializing surveys, skipping...`);else if(this.Se.disable_surveys)fC.info(lw);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())fC.info(`Not loading surveys in cookieless mode without consent.`);else{var e=q?.__PosthogExtensions__;if(e){if(!Z(this.Xo)||this.Se.advanced_enable_surveys){var t=this.Xo||this.Se.advanced_enable_surveys;this.ea=!0;try{var n=e.generateSurveys;if(n)return void this.na(n,t);var r=e.loadExternalDependency;if(!r)return void this.sa(Ay);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.sa(`Could not load surveys script`,n):this.na(e.generateSurveys,t)}))}catch(e){throw this.sa(`Error initializing surveys`,e),e}finally{this.ea=!1}}}else fC.error(`PostHog Extensions not found.`)}}na(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new sw(this._instance),fC.info(`Surveys loaded successfully`),this.oa({isLoaded:!0})}sa(e,t){fC.error(e,t),this.oa({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ta.push(e),this._surveyManager&&this.oa({isLoaded:!0}),()=>{this.ta=this.ta.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Se.disable_surveys)return fC.info(lw),e([]);var n,r=this._instance.get_property(uy);if(r&&!t)return e(r,{isLoaded:!0}),void(this.aa()&&this.getSurveys((()=>{}),!0));typeof Promise<`u`&&this.ra?this.ra.then((t=>{var{surveys:n,context:r}=t;return e(n,r)})):(typeof Promise<`u`&&(this.ra=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.Se.token),method:`GET`,timeout:this.Se.surveys_request_timeout_ms,callback:t=>{var r;this.ra=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;fC.error(a),this.ia=Date.now();var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}this.ia=null;var s,c=t.json.surveys||[],l=c.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}(e)||function(e){var t;return!((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null||!t.length)}(e))));l.length>0&&((s=this._surveyEventReceiver)==null||s.register(l)),(r=this._instance.persistence)==null||r.register({[uy]:c,[dy]:Date.now()});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}aa(){return this.la()&&!this.ra&&!this.ua()}la(){var e=this._instance.get_property(dy);return _g(e)&&Date.now()-e>3e5}ua(){return _g(this.ia)&&3e5>Date.now()-this.ia}markSurveyAsSeen(e,t){mC({id:e,current_iteration:t?.iteration??null});try{localStorage.setItem(`lastSeenSurveyDate`,new Date().toISOString())}catch{}}oa(e){for(var t of this.ta)try{if(!e.isLoaded)return t([],e);
18this.getSurveys(t)}catch(e){fC.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!Q(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);fC.warn(`init was not called`)}ha(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}da(e){if(Q(this._surveyManager))return{eligible:!1,reason:cw};var t=typeof e==`string`?this.ha(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(Q(this._surveyManager))return fC.warn(`init was not called`),{visible:!1,disabledReason:cw};var t=this.da(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Q(this._surveyManager)?(fC.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:cw})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.da(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}
18))}renderSurvey(e,t,n){var r;if(Q(this._surveyManager))fC.warn(`init was not called`);else{var i=typeof e==`string`?this.ha(e):e;if(i!=null&&i.id)if(hC.includes(i.type)){var a=K?.querySelector(t);if(a)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(fC.info(`Rendering survey `+i.id+` with delay of `+i.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;fC.info(`Rendering survey `+i.id+` with delay of `+i.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(i,a,n),fC.info(`Survey `+i.id+` rendered`)}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,a,n);fC.warn(`Survey element not found`)}else fC.warn(`Surveys of type `+i.type+` cannot be rendered in the app`);else fC.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(Q(this._surveyManager))fC.warn(`init was not called`);else{var r=this.ha(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=J({},r,{appearance:J({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Kx.Popover&&t.initialResponses&&fC.warn(`initialResponses is only supported for popover surveys. prefill will not be applied.`),!1===t.ignoreConditions){var a=this.canRenderSurvey(r);if(!a.visible)return void fC.warn(`Survey is not eligible to be displayed: `,a.disabledReason)}t.displayType===Kx.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else fC.warn(`Survey not found`)}}cancelPendingSurvey(e){Q(this._surveyManager)?fC.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},Tw),Nw={toolbar:class{constructor(e){this.instance=e}ca(e){q.ph_toolbar_state=e}va(){return q.ph_toolbar_state??0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),Qy(this.instance.config)||!G||!K)return!1;e??=G.location,n??=G.history;try{if(!t){try{G.localStorage.setItem(`test`,`test`),G.localStorage.removeItem(`test`)}catch{return!1}t=G?.localStorage}var r,i=uw||yx(e.hash,`__posthog`)||yx(e.hash,`state`),a=i?Ky((()=>JSON.parse(atob(decodeURIComponent(i)))))||Ky((()=>JSON.parse(decodeURIComponent(i)))):null;return a&&a.action===`ph_authorize`?((r=a).source=`url`,r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:n?n.replaceState(n.state,``,e.pathname+e.search):e.hash=``)):((r=JSON.parse(t.getItem(dw)||`{}`)).source=`localstorage`,delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}fa(e){var t=q.ph_load_toolbar||q.ph_load_editor;!Q(t)&&dg(t)?t(e,this.instance):fw.warn(`No toolbar load function found`)}loadToolbar(e){var t=!(K==null||!K.getElementById(Ty));if(!G||t)return!1;var n=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,r=J({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},n?{instrument:!1}:{});if(G.localStorage.setItem(dw,JSON.stringify(J({},r,{source:void 0}))),this.va()===2)this.fa(r);else if(this.va()===0){var i;this.ca(1),(i=q.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return fw.error(`[Toolbar] Failed to load`,e),void this.ca(0);this.ca(2),this.fa(r)})),Zy(G,`turbolinks:load`,(()=>{this.ca(0),this.loadToolbar(r)}))}return!0}pa(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},Pw=J({experiments:xw},Tw),Fw=J({},Tw,Ew,Dw,Ow,kw,Aw,Mw,jw,Nw,Pw,{conversations:class{constructor(e){this.ga=void 0,this._conversationsManager=null,this.ma=!1,this.ya=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Q(t)||(yg(t)?this.ga=t:(this.ga=t.enabled,this.ya=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.ga=void 0,this.ya=null}loadIfEnabled(){if(!(this._conversationsManager||this.ma||this._instance.config.disable_conversations||Qy(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=q?.__PosthogExtensions__;if(e&&!Z(this.ga)&&this.ga)if(this.ya&&this.ya.token){this.ma=!0;try{var t=e.initConversations;if(t)return this.ba(t),void(this.ma=!1);var n=e.loadExternalDependency;if(!n)return void this._a(Ay);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this._a(`Could not load conversations script`,t):this.ba(e.initConversations),this.ma=!1}))}catch(e){this._a(`Error initializing conversations`,e),this.ma=!1}}else Sw.error(`Conversations enabled but missing token in remote config.`)}}ba(e){if(this.ya)try{this._conversationsManager=e(this.ya,this._instance),Sw.info(`Conversations loaded successfully`)}
18catch(e){this._a(`Error completing conversations initialization`,e)}else Sw.error(`Cannot complete initialization: remote config is null`)}_a(e,t){Sw.error(e,t),this._conversationsManager=null,this.ma=!1}show(){this._conversationsManager?this._conversationsManager.show():Sw.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ga&&!gg(this._conversationsManager)}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return Vh((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(Sw.warn(Cw),null)}))()}getMessages(e,t){var n=this;return Vh((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(Sw.warn(Cw),null)}))()}markAsRead(e){var t=this;return Vh((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Sw.warn(Cw),null)}))()}getTickets(e){var t=this;return Vh((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Sw.warn(Cw),null)}))()}requestRestoreLink(e){var t=this;return Vh((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Sw.warn(Cw),null)}))()}restoreFromToken(e){var t=this;return Vh((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Sw.warn(Cw),null)}))()}restoreFromUrlToken(){var e=this;return Vh((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Sw.warn(Cw),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}en(){var e;(e=this._conversationsManager)==null||e.setIdentity()}tn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.wa=!1,this.xa=!1,this.Ae=kv(`[logs]`),this._r=[],this.ka=[],this.ss=0,this.Sa=()=>{var e,t;this.ss=0,(e=this.Ca)==null||e.onReconnect(),(t=this.Ia)==null||t.onReconnect()},this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.wa=!0),G&&Zy(G,`online`,this.Sa)}Ta(e,t,n,r){var i,a=function(e,t){var n=e?.flushIntervalMs??3e3,r=e?.maxBufferSize??100,i=t!=null&&t.consoleCapture?void 0:e?.maxLogsPerInterval??1e3,a=Z(i)?Math.max(r,2048):Math.max(r,i),o=e?.resourceAttributes;return{serviceName:o?.[`service.name`]??e?.serviceName??t?.serviceNameDefault,serviceVersion:o?.[`service.version`]??e?.serviceVersion,environment:o?.[`deployment.environment`]??e?.environment,resourceAttributes:o,beforeSend:e?.beforeSend,flushIntervalMs:n,maxBufferSize:r,maxQueueSize:a,maxBatchRecordsPerPost:100,rateCapWindowMs:n,maxLogsPerInterval:i,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,n);return[new q_(this.Ea(e,t),a,this.Ae,(()=>this.Ma()),(e=>e()),void 0,r),a]}Pa(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;return this.Ca&&this.Ra===n||((t=this.Ca)==null||t.reset(),this.Ra=n,[this.Ca,this.Oa]=this.Ta((()=>this._r),(e=>{this._r=e}))),this.Ca}La(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;return this.Ia&&this.Fa===n||((t=this.Ia)==null||t.reset(),this.Fa=n,[this.Ia,this.Aa]=this.Ta((()=>this.ka),(e=>{this.ka=e}),{serviceNameDefault:`posthog-browser-logs`,consoleCapture:!0},ww)),this.Ia}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t=e.logs?.captureConsoleLogs;!Q(t)&&t&&(this.wa=!0,this.loadIfEnabled())}reset(){var e,t;this._r=[],(e=this.Ca)==null||e.reset(),this.ka=[],(t=this.Ia)==null||t.reset(),this.ss=0}captureLog(e){this.Pa().captureLog(e)}le(e){this.La().captureLog(e)}get logger(){return this.$a||={trace:(e,t)=>this.captureLog({body:e,level:`trace`,attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:`debug`,attributes:t}),info:(e,t)=>this.captureLog({body:e,level:`info`,attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:`warn`,attributes:t}),error:(e,t)=>this.captureLog({body:e,level:`error`,attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:`fatal`,attributes:t})},this.$a}flushLogs(e){e?this.Da(e):(this.Ca&&this.Ca.flush().catch((e=>this.Ae.error(`PostHog logs flush failed:`,e))),this.Ia&&this.Ia.flush().catch((e=>this.Ae.error(`PostHog logs flush failed:`,e))))}loadIfEnabled(){if(this.wa&&!this.xa){var e=q?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.Ae.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.xa=!0)})):this.Ae.error(Ay)}else this.Ae.error(`PostHog Extensions not found.`)}}Ea(e,t){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:t=>t===qh.LogsQueue?e():void 0,setPersistedProperty(e,n){e===qh.LogsQueue&&t(n??[])},ht:e=>this.ht(e),getLibraryId:()=>zh.LIB_NAME,getLibraryVersion:()=>zh.LIB_VERSION}}ht(e){return new Promise((t=>{if(bx(this.ss,3))t({kind:`fatal`,error:Error(`logs endpoint is unreachable, dropping batch`)});else{var n=!1,r=e=>{n||(n=!0,clearTimeout(i),t(e))},i=setTimeout((()=>r({kind:`retry-later`,error:Error(`logs request timed out`)})),9e4);this._instance._send_request({method:`POST`,url:this.Na(),data:e,compression:`best-available`,batchKey:`logs`,fireCallbackOnDrop:!0,callback:e=>{var t=e.statusCode;this.qa(t),r(t>=200&&300>t?{kind:`ok`}:t===413?{kind:`too-large`}:t!==0&&t!==429&&500>t?{kind:`fatal`,error:Error(`logs request failed with status `+t)}
18:{kind:`retry-later`,error:e.error??Error(`logs request failed with status `+t)})}})}}))}qa(e){(e!==0||this._instance.__loaded)&&(this.ss=xx(e,this.ss,3,(()=>this.Ae.warn(`Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.`))))}Da(e){this._r.length>0&&this.Ba(e,this._r,this.Oa,zh.LIB_NAME,(e=>{this._r=e})),this.ka.length>0&&this.Ba(e,this.ka,this.Aa,ww,(e=>{this.ka=e}))}Ba(e,t,n,r,i){if(t.length!==0){var a=t.map((e=>e.record));i([]);var o=K_(a,G_(n,zh.LIB_NAME,zh.LIB_VERSION),r,zh.LIB_VERSION);this._instance._send_request({method:`POST`,url:this.Na(),data:o,compression:`best-available`,batchKey:`logs`,transport:e})}}Na(){return this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token)}Ma(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n,windowId:r,sessionStartTimestamp:i,lastActivityTimestamp:a}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n,t.windowId=r,Q(i)||(t.sessionStartTimestamp=i),Q(a)||(t.lastActivityTimestamp=a)}if(q!=null&&(e=q.location)!=null&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?L_(q.location.href):q.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}});NC.__defaultExtensionClasses=J({},Fw),function(){zh.SDK_DIST_CHANNEL=`npm`;var e=bC[DC]=new NC;return function(){function e(){e.done||(e.done=!0,OC=!1,Uy(bC,(function(e){e._dom_loaded()})))}K!=null&&K.addEventListener?K.readyState===`complete`?e():Zy(K,`DOMContentLoaded`,e,{capture:!1}):G&&$.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}().init(`phc_8N6NYge8Eb6D0k8xJ1HRvNFSGGgbgUBONvnDGO3PIMQ`,{api_host:`https://us.i.posthog.com`,person_profiles:`identified_only`}),(0,I.startTransition)(()=>{(0,Oh.hydrateRoot)(document,(0,L.jsx)(Dh,{}))});export{p as _,Vm as a,s as b,yf as c,lf as d,cf as f,Ts as g,_c as h,Bm as i,uf as l,Nu as m,eh as 
18n,Rm as o,Bu as p,Qm as r,zm as s,gh as t,of as u,d as v,l as x,o as y};

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