@zuplo/editor 1.0.31094607111 → 1.0.31661404480
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/adapters/memory-fs.d.ts +0 -1
- package/dist/adapters/memory-preferences.d.ts +0 -1
- package/dist/adapters/memory.d.ts +0 -1
- package/dist/adapters/memory.js +194 -10
- package/dist/adapters/memory.js.map +7 -1
- package/dist/app.d.ts +29 -10
- package/dist/app.js +10 -116
- package/dist/app.js.map +7 -1
- package/dist/chunks/chunk-54KOYG5C.js +10 -0
- package/dist/chunks/chunk-54KOYG5C.js.map +7 -0
- package/dist/chunks/chunk-C7VL3DX7.js +47 -0
- package/dist/chunks/chunk-C7VL3DX7.js.map +7 -0
- package/dist/chunks/chunk-FELEIEAB.js +40 -0
- package/dist/chunks/chunk-FELEIEAB.js.map +7 -0
- package/dist/chunks/chunk-HDZMPWV2.js +11390 -0
- package/dist/chunks/chunk-HDZMPWV2.js.map +7 -0
- package/dist/client/index.html +3 -3
- package/dist/client/static/css/main-D4ruAwAg.css +1 -0
- package/dist/client/static/js/GraphiQLConsole-C3mUtrG9.js +71 -0
- package/dist/client/static/js/{McpCapabilityFilterDesigner-CFYXS7Y4.js → McpCapabilityFilterDesigner-COGUyP07.js} +1 -1
- package/dist/client/static/js/{SchemaReference-DnRuA77Y.js → SchemaReference-BpeLq7I3.js} +1 -1
- package/dist/client/static/js/{dist-JDzf7X4h.js → dist-DP_G_tkV.js} +13 -13
- package/dist/client/static/js/{esm-CSg4wlYg.js → esm-BfamZtsm.js} +1 -1
- package/dist/client/static/js/{hint-8S237UzV.js → hint--tq9iIeq.js} +1 -1
- package/dist/client/static/js/{hint-BPU1gkpx.js → hint-BMbDJNc4.js} +1 -1
- package/dist/client/static/js/{info-Dekw9zL3.js → info-CdXcsT3t.js} +1 -1
- package/dist/client/static/js/{jump-wNrWwMpB.js → jump-D1TPL3ME.js} +1 -1
- package/dist/client/static/js/{lint-DjDCd_sO.js → lint-Cdq0ksKl.js} +1 -1
- package/dist/client/static/js/main-BfGOC9Wr.js +1585 -0
- package/dist/client/static/js/{mode-B0minaVe.js → mode-BNaswVl-.js} +1 -1
- package/dist/client/static/js/{mode-DdjZuoTn.js → mode-DshT-YZo.js} +1 -1
- package/dist/client/static/js/{mode--1945Gkn.js → mode-Dt0n7fTF.js} +1 -1
- package/dist/config.d.ts +0 -1
- package/dist/fixtures/preview-project.d.ts +0 -1
- package/dist/fixtures/preview-project.js +19 -20
- package/dist/fixtures/preview-project.js.map +7 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3426 -5
- package/dist/index.js.map +7 -1
- package/dist/interfaces.d.ts +0 -1
- package/dist/interfaces.portal.d.ts +0 -1
- package/dist/ports.d.ts +0 -1
- package/dist/ports.js +12 -71
- package/dist/ports.js.map +7 -1
- package/dist/server.d.ts +6 -3
- package/package.json +1 -27
- package/dist/adapters/memory-fs.d.ts.map +0 -1
- package/dist/adapters/memory-fs.js +0 -204
- package/dist/adapters/memory-fs.js.map +0 -1
- package/dist/adapters/memory-fs.spec.d.ts +0 -2
- package/dist/adapters/memory-fs.spec.d.ts.map +0 -1
- package/dist/adapters/memory-fs.spec.js +0 -74
- package/dist/adapters/memory-fs.spec.js.map +0 -1
- package/dist/adapters/memory-preferences.d.ts.map +0 -1
- package/dist/adapters/memory-preferences.js +0 -18
- package/dist/adapters/memory-preferences.js.map +0 -1
- package/dist/adapters/memory.d.ts.map +0 -1
- package/dist/adapters/node-fs.d.ts +0 -11
- package/dist/adapters/node-fs.d.ts.map +0 -1
- package/dist/adapters/node-fs.js +0 -133
- package/dist/adapters/node-fs.js.map +0 -1
- package/dist/adapters/node-preferences.d.ts +0 -10
- package/dist/adapters/node-preferences.d.ts.map +0 -1
- package/dist/adapters/node-preferences.js +0 -38
- package/dist/adapters/node-preferences.js.map +0 -1
- package/dist/app.d.ts.map +0 -1
- package/dist/client/static/css/main-DSfZObJX.css +0 -1
- package/dist/client/static/js/GraphiQLConsole-CDlqCZZz.js +0 -71
- package/dist/client/static/js/main-BdGwM1To.js +0 -1585
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -111
- package/dist/config.js.map +0 -1
- package/dist/constants.d.ts +0 -46
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -46
- package/dist/constants.js.map +0 -1
- package/dist/error-handler.d.ts +0 -14
- package/dist/error-handler.d.ts.map +0 -1
- package/dist/error-handler.js +0 -108
- package/dist/error-handler.js.map +0 -1
- package/dist/fixtures/preview-project.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/interfaces.d.ts.map +0 -1
- package/dist/interfaces.js +0 -2
- package/dist/interfaces.js.map +0 -1
- package/dist/interfaces.portal.d.ts.map +0 -1
- package/dist/interfaces.portal.js +0 -14
- package/dist/interfaces.portal.js.map +0 -1
- package/dist/ports.d.ts.map +0 -1
- package/dist/routes/api.d.ts +0 -16
- package/dist/routes/api.d.ts.map +0 -1
- package/dist/routes/api.js +0 -116
- package/dist/routes/api.js.map +0 -1
- package/dist/routes/api.spec.d.ts +0 -2
- package/dist/routes/api.spec.d.ts.map +0 -1
- package/dist/routes/api.spec.js +0 -220
- package/dist/routes/api.spec.js.map +0 -1
- package/dist/routes/editor.d.ts +0 -17
- package/dist/routes/editor.d.ts.map +0 -1
- package/dist/routes/editor.js +0 -131
- package/dist/routes/editor.js.map +0 -1
- package/dist/routes/editor.spec.d.ts +0 -2
- package/dist/routes/editor.spec.d.ts.map +0 -1
- package/dist/routes/editor.spec.js +0 -207
- package/dist/routes/editor.spec.js.map +0 -1
- package/dist/routes/fs-race-condition.spec.d.ts +0 -2
- package/dist/routes/fs-race-condition.spec.d.ts.map +0 -1
- package/dist/routes/fs-race-condition.spec.js +0 -235
- package/dist/routes/fs-race-condition.spec.js.map +0 -1
- package/dist/routes/fs.d.ts +0 -10
- package/dist/routes/fs.d.ts.map +0 -1
- package/dist/routes/fs.js +0 -325
- package/dist/routes/fs.js.map +0 -1
- package/dist/routes/fs.spec.d.ts +0 -2
- package/dist/routes/fs.spec.d.ts.map +0 -1
- package/dist/routes/fs.spec.js +0 -613
- package/dist/routes/fs.spec.js.map +0 -1
- package/dist/routes/test.d.ts +0 -8
- package/dist/routes/test.d.ts.map +0 -1
- package/dist/routes/test.js +0 -130
- package/dist/routes/test.js.map +0 -1
- package/dist/routes/test.spec.d.ts +0 -2
- package/dist/routes/test.spec.d.ts.map +0 -1
- package/dist/routes/test.spec.js +0 -250
- package/dist/routes/test.spec.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -147
- package/dist/server.js.map +0 -1
- package/dist/test-utils/setup.d.ts +0 -53
- package/dist/test-utils/setup.d.ts.map +0 -1
- package/dist/test-utils/setup.js +0 -82
- package/dist/test-utils/setup.js.map +0 -1
- package/dist/utils/path.d.ts +0 -20
- package/dist/utils/path.d.ts.map +0 -1
- package/dist/utils/path.js +0 -24
- package/dist/utils/path.js.map +0 -1
- package/dist/validation.d.ts +0 -31
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -42
- package/dist/validation.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/js/editor.main-B7ZQNwu9.js","static/js/chunk-6hGRweTZ.js","static/js/preload-helper-DxkSl20Q.js","static/js/editor.api2-DJi3_-IJ.js","static/css/editor-DU9oqspw.css","static/js/workers-CfQPK2eg.js","static/js/monaco.contribution-CZRO3JpP.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{n as e,o as t,r as n,t as r}from"./chunk-6hGRweTZ.js";import{t as i}from"./preload-helper-DxkSl20Q.js";var a=r((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},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+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+j(a,u),c+=N(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+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(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 ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(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 ne=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)},re={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=re,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)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},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,ne)}catch(e){ne(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`})),o=r(((e,t)=>{t.exports=a()})),s=r((e=>{var t=o();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 s(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 c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(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 s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=i.p;try{if(c.T=null,i.p=2,e)return e()}finally{c.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=l(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=l(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=l(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=l(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 c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),c=r(((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=s()})),l=r(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define(n):typeof t==`object`&&t.exports?t.exports=n():e.log=n()})(e,function(){var e=function(){},t=`undefined`,n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=[`trace`,`debug`,`info`,`warn`,`error`],i={},a=null;function o(e,t){var n=e[t];if(typeof n.bind==`function`)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch{return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(r){return r===`debug`&&(r=`log`),typeof console===t?!1:r===`trace`&&n?s:console[r]===void 0?console.log===void 0?e:o(console,`log`):o(console,r)}function l(){for(var n=this.getLevel(),i=0;i<r.length;i++){var a=r[i];this[a]=i<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return`No console available for logging`}function u(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function d(e,t,n){return c(e)||u.apply(this,arguments)}function f(e,n){var o=this,s,c,u,f=`loglevel`;typeof e==`string`?f+=`:`+e:typeof e==`symbol`&&(f=void 0);function p(e){var n=(r[e]||`silent`).toUpperCase();if(!(typeof window===t||!f)){try{window.localStorage[f]=n;return}catch{}try{window.document.cookie=encodeURIComponent(f)+`=`+n+`;`}catch{}}}function m(){var e;if(!(typeof window===t||!f)){try{e=window.localStorage[f]}catch{}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+`=`);i!==-1&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch{}return o.levels[e]===void 0&&(e=void 0),e}}function h(){if(!(typeof window===t||!f)){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+`=; expires=Thu, 01 Jan 1970 00:00:00 UTC`}catch{}}}function g(e){var t=e;if(typeof t==`string`&&o.levels[t.toUpperCase()]!==void 0&&(t=o.levels[t.toUpperCase()]),typeof t==`number`&&t>=0&&t<=o.levels.SILENT)return t;throw TypeError(`log.setLevel() called with invalid level: `+e)}o.name=e,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||d,o.getLevel=function(){return u??c??s},o.setLevel=function(e,t){return u=g(e),t!==!1&&p(u),l.call(o)},o.setDefaultLevel=function(e){c=g(e),m()||o.setLevel(e,!1)},o.resetLevel=function(){u=null,h(),l.call(o)},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)},o.rebuild=function(){if(a!==o&&(s=g(a.getLevel())),l.call(o),a===o)for(var e in i)i[e].rebuild()},s=g(a?a.getLevel():`WARN`);var _=m();_!=null&&(u=g(_)),l.call(o)}a=new f,a.getLogger=function(e){if(typeof e!=`symbol`&&typeof e!=`string`||e===``)throw TypeError(`You must supply a name when creating a logger.`);var t=i[e];return t||=i[e]=new f(e,a.methodFactory),t};var p=typeof window===t?void 0:window.log;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=p),a},a.getLoggers=function(){return i},a.default=a,a})})),u;(function(e){e[e.CONTINUE=100]=`CONTINUE`,e[e.SWITCHING_PROTOCOLS=101]=`SWITCHING_PROTOCOLS`,e[e.PROCESSING=102]=`PROCESSING`,e[e.OK=200]=`OK`,e[e.CREATED=201]=`CREATED`,e[e.ACCEPTED=202]=`ACCEPTED`,e[e.NON_AUTHORITATIVE_INFORMATION=203]=`NON_AUTHORITATIVE_INFORMATION`,e[e.NO_CONTENT=204]=`NO_CONTENT`,e[e.RESET_CONTENT=205]=`RESET_CONTENT`,e[e.PARTIAL_CONTENT=206]=`PARTIAL_CONTENT`,e[e.MULTI_STATUS=207]=`MULTI_STATUS`,e[e.ALREADY_REPORTED=208]=`ALREADY_REPORTED`,e[e.IM_USED=226]=`IM_USED`,e[e.MULTIPLE_CHOICES=300]=`MULTIPLE_CHOICES`,e[e.MOVED_PERMANENTLY=301]=`MOVED_PERMANENTLY`,e[e.FOUND=302]=`FOUND`,e[e.SEE_OTHER=303]=`SEE_OTHER`,e[e.NOT_MODIFIED=304]=`NOT_MODIFIED`,e[e.USE_PROXY=305]=`USE_PROXY`,e[e.SWITCH_PROXY=306]=`SWITCH_PROXY`,e[e.TEMPORARY_REDIRECT=307]=`TEMPORARY_REDIRECT`,e[e.PERMANENT_REDIRECT=308]=`PERMANENT_REDIRECT`,e[e.BAD_REQUEST=400]=`BAD_REQUEST`,e[e.UNAUTHORIZED=401]=`UNAUTHORIZED`,e[e.PAYMENT_REQUIRED=402]=`PAYMENT_REQUIRED`,e[e.FORBIDDEN=403]=`FORBIDDEN`,e[e.NOT_FOUND=404]=`NOT_FOUND`,e[e.METHOD_NOT_ALLOWED=405]=`METHOD_NOT_ALLOWED`,e[e.NOT_ACCEPTABLE=406]=`NOT_ACCEPTABLE`,e[e.PROXY_AUTHENTICATION_REQUIRED=407]=`PROXY_AUTHENTICATION_REQUIRED`,e[e.REQUEST_TIMEOUT=408]=`REQUEST_TIMEOUT`,e[e.CONFLICT=409]=`CONFLICT`,e[e.GONE=410]=`GONE`,e[e.LENGTH_REQUIRED=411]=`LENGTH_REQUIRED`,e[e.PRECONDITION_FAILED=412]=`PRECONDITION_FAILED`,e[e.PAYLOAD_TOO_LARGE=413]=`PAYLOAD_TOO_LARGE`,e[e.URI_TOO_LONG=414]=`URI_TOO_LONG`,e[e.UNSUPPORTED_MEDIA_TYPE=415]=`UNSUPPORTED_MEDIA_TYPE`,e[e.RANGE_NOT_SATISFIABLE=416]=`RANGE_NOT_SATISFIABLE`,e[e.EXPECTATION_FAILED=417]=`EXPECTATION_FAILED`,e[e.I_AM_A_TEAPOT=418]=`I_AM_A_TEAPOT`,e[e.MISDIRECTED_REQUEST=421]=`MISDIRECTED_REQUEST`,e[e.UNPROCESSABLE_ENTITY=422]=`UNPROCESSABLE_ENTITY`,e[e.LOCKED=423]=`LOCKED`,e[e.FAILED_DEPENDENCY=424]=`FAILED_DEPENDENCY`,e[e.UPGRADE_REQUIRED=426]=`UPGRADE_REQUIRED`,e[e.PRECONDITION_REQUIRED=428]=`PRECONDITION_REQUIRED`,e[e.TOO_MANY_REQUESTS=429]=`TOO_MANY_REQUESTS`,e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]=`REQUEST_HEADER_FIELDS_TOO_LARGE`,e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]=`UNAVAILABLE_FOR_LEGAL_REASONS`,e[e.INTERNAL_SERVER_ERROR=500]=`INTERNAL_SERVER_ERROR`,e[e.NOT_IMPLEMENTED=501]=`NOT_IMPLEMENTED`,e[e.BAD_GATEWAY=502]=`BAD_GATEWAY`,e[e.SERVICE_UNAVAILABLE=503]=`SERVICE_UNAVAILABLE`,e[e.GATEWAY_TIMEOUT=504]=`GATEWAY_TIMEOUT`,e[e.HTTP_VERSION_NOT_SUPPORTED=505]=`HTTP_VERSION_NOT_SUPPORTED`,e[e.VARIANT_ALSO_NEGOTIATES=506]=`VARIANT_ALSO_NEGOTIATES`,e[e.INSUFFICIENT_STORAGE=507]=`INSUFFICIENT_STORAGE`,e[e.LOOP_DETECTED=508]=`LOOP_DETECTED`,e[e.NOT_EXTENDED=510]=`NOT_EXTENDED`,e[e.NETWORK_AUTHENTICATION_REQUIRED=511]=`NETWORK_AUTHENTICATION_REQUIRED`})(u||={}),u.INTERNAL_SERVER_ERROR,u.BAD_REQUEST,u.CONFLICT,u.NOT_FOUND,u.METHOD_NOT_ALLOWED,u.UNAUTHORIZED,u.FORBIDDEN,u.NOT_FOUND,u.CONFLICT,u.NOT_FOUND;var d={type:`https://zup.fail/user-has-no-access-to-account`,title:`Forbidden`,detail:`You are not authorized to access the account resource.`,status:u.FORBIDDEN};u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.NOT_FOUND,u.CONFLICT,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.NOT_FOUND,u.NOT_FOUND,u.BAD_REQUEST,u.INTERNAL_SERVER_ERROR,u.BAD_REQUEST,u.BAD_REQUEST,u.NOT_FOUND,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN,u.NOT_FOUND,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.INTERNAL_SERVER_ERROR,u.FORBIDDEN,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST,u.CONFLICT,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN,u.NOT_FOUND,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.NOT_FOUND,u.NOT_FOUND,u.BAD_REQUEST,u.FORBIDDEN,u.NOT_FOUND,u.NOT_FOUND,u.NOT_FOUND,u.FORBIDDEN,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.NOT_FOUND,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST;var f={type:`https://zup.fail/user-has-no-access-to-project`,title:`Forbidden`,detail:`You are not a member of the project`,status:u.FORBIDDEN};u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN,u.NOT_FOUND,u.FORBIDDEN,u.INTERNAL_SERVER_ERROR,u.BAD_REQUEST,u.BAD_REQUEST;var p={type:`https://zup.fail/max-allowed-projects-limit-reached`,title:`Your account has reached the maximum number of projects allowed.`,status:u.BAD_REQUEST};u.INTERNAL_SERVER_ERROR,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.NOT_FOUND,u.BAD_GATEWAY,u.BAD_GATEWAY,u.UNAUTHORIZED,u.FORBIDDEN,u.FORBIDDEN,u.INTERNAL_SERVER_ERROR,u.BAD_REQUEST,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN;var m={type:`https://zup.fail/gh-app-revoked-access`,title:`Current Source Control credentials are invalid. Re-authenticate to GitHub via Profile UI and try again.`,status:u.UNAUTHORIZED};u.FORBIDDEN,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN,u.INTERNAL_SERVER_ERROR,u.NOT_FOUND,u.NOT_FOUND,u.INTERNAL_SERVER_ERROR,u.FAILED_DEPENDENCY,u.FAILED_DEPENDENCY,u.FAILED_DEPENDENCY,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.CONFLICT,u.NOT_FOUND,u.INTERNAL_SERVER_ERROR,u.BAD_REQUEST,u.INTERNAL_SERVER_ERROR,u.FORBIDDEN,u.BAD_REQUEST,u.NOT_FOUND,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_GATEWAY,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.FORBIDDEN,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.BAD_REQUEST,u.FORBIDDEN;var h=typeof window<`u`?window:void 0,g=typeof globalThis<`u`?globalThis:h;typeof self>`u`&&(g.self=g),typeof File>`u`&&(g.File=function(){});var _=g?.navigator,v=g?.document,y=g?.location,b=g?.fetch,x=g!=null&&g.XMLHttpRequest&&`withCredentials`in new g.XMLHttpRequest?g.XMLHttpRequest:void 0,S=g?.AbortController,C=g?.CompressionStream,w=_?.userAgent,T=h??{},E=`1.383.0`,D={DEBUG:!1,LIB_VERSION:E,LIB_NAME:`web`,JS_SDK_VERSION:E};function O(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 k(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){O(a,r,i,o,s,`next`,e)}function s(e){O(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function A(){return A=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},A.apply(null,arguments)}function j(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 M,N=function(e){return e.GZipJS=`gzip-js`,e.Base64=`base64`,e}({}),ee=[`$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`],te=`NativeGzipValidationError`,ne=e=>e.length>=2&&e[0]===31&&e[1]===139,re=e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`,ie=e=>{var t=Error(`Native gzip produced invalid output: `+e);throw t.name=te,t},ae=function(){var e=k((function*(e,t){18>e.size&&ie(`too-short`);var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());ne(n)&&n[2]===8||ie(`invalid-header`);var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(M)return M;M=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;M[e]=t>>>0}return M})(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0})(t)&&ie(`invalid-crc`);var i=t.length>>>0;r.getUint32(4,!0)!==i&&ie(`invalid-size`)}));return function(t,n){return e.apply(this,arguments)}}();function oe(){return oe=k((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=k((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 ae(c,r),c}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),oe.apply(this,arguments)}var se=`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(`,`),ce=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return se.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))};function P(e,t){return e.indexOf(t)!==-1}var le=function(e){return e.trim()},ue=function(e){return e.replace(/^\$/,``)},de=Object.prototype,fe=de.hasOwnProperty,pe=de.toString,F=Array.isArray||function(e){return pe.call(e)===`[object Array]`},me=e=>typeof e==`function`,he=e=>e===Object(e)&&!F(e),ge=e=>{if(he(e)){for(var t in e)if(fe.call(e,t))return!1;return!0}return!1},I=e=>e===void 0,L=e=>pe.call(e)==`[object String]`,_e=e=>L(e)&&e.trim().length===0,ve=e=>e===null,R=e=>I(e)||ve(e),ye=e=>pe.call(e)==`[object Number]`&&e==e,be=e=>ye(e)&&e>0,xe=e=>pe.call(e)===`[object Boolean]`,Se=e=>e instanceof FormData,Ce=e=>P(ee,e);function we(e){return typeof e!=`object`||!e}function Te(e,t){return{}.toString.call(e)===`[object `+t+`]`}function Ee(e){return typeof Event<`u`&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}var De=[!0,`true`,1,`1`,`yes`],Oe=e=>P(De,e),ke=[!1,`false`,0,`0`,`no`];function Ae(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),ye(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),Ae(i||n,t,n,r))}var je=class{constructor(e){this.$t={},this.zt=e.zt,this.Zt=Ae(e.bucketSize,0,100,e.Gt),this.Qt=Ae(e.refillRate,0,this.Zt,e.Gt),this.Jt=Ae(e.refillInterval,0,864e5,e.Gt)}Kt(e,t){var n=Math.floor((t-e.lastAccess)/this.Jt);n>0&&(e.tokens=Math.min(e.tokens+n*this.Qt,this.Zt),e.lastAccess+=n*this.Jt)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.$t[r];return i?this.Kt(i,n):this.$t[r]=i={tokens:this.Zt,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.zt)==null||t.call(this,e)),i.tokens===0)}stop(){this.$t={}}},Me,Ne,Pe,Fe=`Mobile`,Ie=`iOS`,Le=`Android`,Re=`Tablet`,ze=Le+` `+Re,Be=`iPad`,Ve=`Apple`,He=Ve+` Watch`,Ue=`Safari`,We=`BlackBerry`,Ge=`Samsung`,Ke=Ge+`Browser`,qe=Ge+` Internet`,Je=`Chrome`,Ye=Je+` OS`,Xe=Je+` `+Ie,Ze=`Internet Explorer`,Qe=Ze+` `+Fe,$e=`Opera`,et=$e+` Mini`,tt=`Edge`,nt=`Microsoft `+tt,rt=`Firefox`,it=rt+` `+Ie,at=`Nintendo`,ot=`PlayStation`,st=`Xbox`,ct=Le+` `+Fe,lt=Fe+` `+Ue,ut=`Windows`,dt=ut+` Phone`,ft=`Nokia`,pt=`Ouya`,mt=`Generic`,ht=mt+` `+Fe.toLowerCase(),gt=mt+` `+Re.toLowerCase(),_t=`Konqueror`,vt=`Oculus Browser`,yt=`Vivaldi`,bt=`Yandex`,xt=`Whale`,St=`DuckDuckGo`,Ct=`Pale Moon`,wt=`Waterfox`,Tt=`Brave`,Et=`(\\d+(\\.\\d+)?)`,Dt=RegExp(`Version/`+Et),Ot=new RegExp(st,`i`),kt=RegExp(ot+` \\w+`,`i`),At=RegExp(at+` \\w+`,`i`),jt=RegExp(We+`|PlayBook|BB10`,`i`),Mt={"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`},Nt=function(e,t,n){return t||=``,function(e){return e!=null&&e.brave?Tt:null}(n)||(P(e,` OPR/`)&&P(e,`Mini`)?et:P(e,` OPR/`)?$e:jt.test(e)?We:P(e,`IE`+Fe)||P(e,`WPDesktop`)?Qe:P(e,`OculusBrowser`)?vt:P(e,Ke)?qe:P(e,tt)||P(e,`Edg/`)?nt:P(e,yt+`/`)?yt:P(e,`YaBrowser/`)?bt:P(e,xt+`/`)?xt:P(e,St+`/`)||P(e,`Ddg/`)?St:P(e,`FBIOS`)?`Facebook `+Fe:P(e,`UCWEB`)||P(e,`UCBrowser`)?`UC Browser`:P(e,`CriOS`)?Xe:P(e,`CrMo`)||P(e,Je)?Je:P(e,Le)&&P(e,Ue)?ct:P(e,`FxiOS`)?it:P(e.toLowerCase(),_t.toLowerCase())?_t:P(e,Tt+`/`)?Tt:((e,t)=>t&&P(t,Ve)||function(e){return P(e,Ue)&&!P(e,Je)&&!P(e,Le)}(e))(e,t)?P(e,Fe)?lt:Ue:P(e,`PaleMoon/`)?Ct:P(e,wt+`/`)?wt:P(e,rt)?rt:P(e,`MSIE`)||P(e,`Trident/`)?Ze:P(e,`Gecko`)?rt:``)},Pt={[Qe]:[RegExp(`rv:`+Et)],[nt]:[RegExp(tt+`?\\/`+Et)],[Je]:[RegExp(`(`+Je+`|CrMo)\\/`+Et)],[Xe]:[RegExp(`CriOS\\/`+Et)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+Et)],[Ue]:[Dt],[lt]:[Dt],[$e]:[RegExp(`(Opera|OPR)\\/`+Et)],[rt]:[RegExp(rt+`\\/`+Et)],[it]:[RegExp(`FxiOS\\/`+Et)],[_t]:[RegExp(`Konqueror[:/]?`+Et,`i`)],[We]:[RegExp(We+` `+Et),Dt],[ct]:[RegExp(`android\\s`+Et,`i`)],[qe]:[RegExp(Ke+`\\/`+Et)],[vt]:[RegExp(`OculusBrowser\\/`+Et)],[yt]:[RegExp(yt+`\\/`+Et)],[bt]:[RegExp(`YaBrowser\\/`+Et)],[xt]:[RegExp(xt+`\\/`+Et)],[Tt]:[RegExp(Tt+`\\/`+Et)],[St]:[RegExp(`(DuckDuckGo|Ddg)\\/`+Et)],[Ct]:[RegExp(`PaleMoon\\/`+Et)],[wt]:[RegExp(wt+`\\/`+Et)],[Ze]:[RegExp(`(rv:|MSIE )`+Et)],Mozilla:[RegExp(`rv:`+Et)]},Ft=function(e,t,n){var r=Pt[Nt(e,t,n)];if(I(r))return null;for(var i=0;r.length>i;i++){var a=e.match(r[i]);if(a)return parseFloat(a[a.length-2])}return null},It=[[RegExp(st+`; `+st+` (.*?)[);]`,`i`),e=>[st,e&&e[1]||``]],[new RegExp(at,`i`),[at,``]],[new RegExp(ot,`i`),[ot,``]],[jt,[We,``]],[new RegExp(ut,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[dt,``];if(new RegExp(Fe).test(t)&&!/IEMobile\b/.test(t))return[ut+` `+Fe,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=Mt[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[ut,r]}return[ut,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Ie,[e[3],e[4],e[5]||`0`].join(`.`)]:[Ie,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=I(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+Le+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+Le+`)`,`i`),e=>e&&e[2]?[Le,[e[2],e[3],e[4]||`0`].join(`.`)]:[Le,``]],[/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/,[Ye,``]],[/Linux|debian/i,[`Linux`,``]]],Lt=function(e){return At.test(e)?at:kt.test(e)?ot:Ot.test(e)?st:new RegExp(pt,`i`).test(e)?pt:RegExp(`(`+dt+`|WPDesktop)`,`i`).test(e)?dt:/iPad/.test(e)?Be:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?He:jt.test(e)?We:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(ft,`i`).test(e)?ft:/(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(Fe).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)?Le:ze:RegExp(`(pda|`+Fe+`)`,`i`).test(e)?ht:new RegExp(Re,`i`).test(e)&&!RegExp(Re+` pc`,`i`).test(e)?gt:``},Rt=e=>e instanceof Error,zt={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}},Bt=zt.info;function Vt(e){if(xe(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(F(e))return{arrayValue:{values:e.map((e=>Vt(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function Ht(e){var t=[];for(var n in e){var r=e[n];ve(r)||I(r)||t.push({key:n,value:Vt(r)})}return t}function Ut(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return Pe&&n.length===Ne||(Ne=n.length,Pe=n.reduce(((n,r)=>{Me||={};var i=Me[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,Me[r]=[s,c];break}}return n}),{})),Pe}}var Wt=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 k((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&F(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)),A({},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 k((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,A({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:Ut(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 A({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},Gt=`?`;function Kt(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?Gt:n,in_app:!0};return I(r)||(a.lineno=r),I(i)||(a.colno=i),a}var qt=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?Gt:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},Jt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Yt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Xt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Zt=(e,t)=>{var n=Jt.exec(e);if(n){var[,r,i,a]=n;return Kt(t,r,Gt,+i,+a)}var o=Yt.exec(e);if(o){if(o[2]&&o[2].indexOf(`eval`)===0){var s=Xt.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[c,l]=qt(o[1]||Gt,o[2]);return Kt(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Qt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$t=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,en=(e,t)=>{var n=Qt.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=$t.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]||Gt;return[a,i]=qt(a,i),Kt(t,i,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},tn=/\(error: (.*)\)/,nn=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=L(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 Te(e,`DOMException`)}isDOMError(e){return Te(e,`DOMError`)}},rn=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}},an=class{constructor(){}match(e){return Te(e,`ErrorEvent`)&&e.error!=null}coerce(e,t){return t.apply(e.error)||{type:`ErrorEvent`,value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}},on=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,sn=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(on);return r&&(t=r[1],n=r[2]),[t,n]}},cn=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function ln(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 un=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 Ee(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: `+ln(e)}isSeverityLevel(e){return L(e)&&!_e(e)&&cn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(Rt(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},dn=class{match(e){return Ee(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+ln(e),stack:t.syntheticException?.stack,synthetic:!0}}},fn=class{match(e){return we(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},pn=class{match(e){return Te(e,`PromiseRejectionEvent`)||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Ee(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 we(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}},mn=`$message`,hn=`$timestamp`,gn=new Set([mn,hn]),_n={enabled:!0,max_bytes:32768};function vn(e){return e?{enabled:e.enabled??_n.enabled,max_bytes:bn(e.max_bytes,_n.max_bytes)}:A({},_n)}var yn=class{constructor(e){this.Yt=[],this.Xt=0,this.qt=vn(e)}setConfig(e){this.qt=vn(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`function`&&typeof n!=`symbol`){if(n instanceof Date)return n.toISOString();if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n==`object`){if(t.has(n))return`[Circular]`;t.add(n)}return n}}))}catch{return}}(e);if(t)try{var n=JSON.parse(t);if(!he(n))return;var r=n,i=r[mn],a=r[hn];return!L(i)||i.trim().length===0||!L(a)&&!ye(a)?void 0:{step:r,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.qt.max_bytes||(this.Yt.push({step:t.step,bytes:n}),this.Xt+=n,this.er())}}getAttachable(){return this.Yt.map((e=>e.step))}clear(){this.Yt=[],this.Xt=0}size(){return this.Yt.length}er(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var e=this.Yt.shift();e&&(this.Xt-=e.bytes)}}};function bn(e,t){if(!ye(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var xn=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k(t){if(h&&(D.DEBUG||T.POSTHOG_DEBUG||n)&&!I(h.console)&&h.console){for(var r=(`__rrweb_original__`in h.console[t])?h.console[t].__rrweb_original__:h.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)=>xn(e+` `+t,n)};return r},z=xn(`[PostHog.js]`),B=z.createLogger,Sn=B(`[ExternalScriptsLoader]`),Cn=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Sn.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var r=v?.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(!v)return n(`document not found`);var r=v.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`)v.head.appendChild(r);else{var i,a=v.querySelectorAll(`body > script`);a.length>0?(i=a[0].parentNode)==null||i.insertBefore(r,a[0]):v.body.appendChild(r)}};v!=null&&v.body?s():v?.addEventListener(`DOMContentLoaded`,s)};T.__PosthogExtensions__=T.__PosthogExtensions__||{},T.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.__preview_external_dependency_versioned_paths)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)}Cn(e,r,n)}else Cn(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},T.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{Cn(e,e.requestRouter.endpointFor(`api`,t),n)};var wn=`$people_distinct_id`,Tn=`$device_id`,En=`__alias`,Dn=`__timers`,On=`$autocapture_disabled_server_side`,kn=`$heatmaps_enabled_server_side`,An=`$exception_capture_enabled_server_side`,jn=`$error_tracking_suppression_rules`,Mn=`$error_tracking_capture_extension_exceptions`,Nn=`$web_vitals_enabled_server_side`,Pn=`$dead_clicks_enabled_server_side`,Fn=`$product_tours_enabled_server_side`,In=`$web_vitals_allowed_metrics`,Ln=`$session_recording_remote_config`,Rn=`$replay_override_sampling`,zn=`$replay_override_linked_flag`,Bn=`$replay_override_url_trigger`,Vn=`$replay_override_event_trigger`,Hn=`$sesid`,Un=`$session_is_sampled`,Wn=`$enabled_feature_flags`,Gn=`$active_feature_flags`,Kn=`$early_access_features`,qn=`$feature_flag_details`,Jn=`$feature_flag_payloads`,Yn=`$feature_flag_request_id`,Xn=`$override_feature_flags`,Zn=`$override_feature_flag_payloads`,Qn=`$stored_person_properties`,$n=`$stored_group_properties`,er=`$surveys`,tr=`$surveys_loaded_at`,nr=`$surveys_activated`,rr=`ph_product_tours`,ir=`$flag_call_reported`,ar=`$flag_call_reported_session_id`,or=`$feature_flag_errors`,sr=`$feature_flag_evaluated_at`,cr=`$user_state`,lr=`$client_session_props`,ur=`$capture_rate_limit`,dr=`$initial_campaign_params`,fr=`$initial_referrer_info`,pr=`$initial_person_info`,mr=`$epp`,hr=`__POSTHOG_TOOLBAR__`,gr=`$posthog_cookieless`,_r=`$sdk_debug_extensions_init_method`,vr=`$sdk_debug_extensions_init_time_ms`,yr=`$sdk_debug_recording_script_not_loaded`,br=`PostHog loadExternalDependency extension not found.`,xr=`on_reject`,Sr=`always`,Cr=`anonymous`,wr=`identified`,Tr=`identified_only`,Er=`visibilitychange`,Dr=`beforeunload`,Or=`$pageview`,kr=`$pageleave`,Ar=`$identify`,jr=`$groupidentify`;function Mr(e,t){F(e)&&e.forEach(t)}function V(e,t){if(!R(e))if(F(e))e.forEach(t);else if(Se(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)fe.call(e,n)&&t(e[n],n)}var H=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 Nr(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Pr=function(e){try{return e()}catch{return}},Fr=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){z.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),z.critical(e)}}},Ir=function(e){var t={};return V(e,(function(e,n){(L(e)&&e.length>0||ye(e))&&(t[n]=e)})),t},Lr=[`herokuapp.com`,`vercel.app`,`netlify.app`];function Rr(e){var t=e?.hostname;if(!L(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of Lr)if(n===r)return!1;return!0}function zr(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function Br(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 ye(e)&&isFinite(e)&&Math.floor(e)===e});var Vr=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+=`-`);if(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}},Hr=class{constructor(){this.S=0,this.C=0,this.I=new Gr}generate(){var e=this.generateOrAbort();if(I(e)){this.S=0;var t=this.generateOrAbort();if(I(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.T();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.T())}return Vr.fromFieldsV7(this.S,Math.trunc(this.C/2**30),this.C&2**30-1,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}},Ur,Wr=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};h&&!I(h.crypto)&&crypto.getRandomValues&&(Wr=e=>crypto.getRandomValues(e));var Gr=class{constructor(){this.M=new Uint32Array(8),this.R=1/0}nextUint32(){return this.M.length>this.R||(Wr(this.M),this.R=0),this.M[this.R++]}},Kr=()=>qr().toString(),qr=()=>(Ur||=new Hr).generate(),Jr=``,Yr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Xr={O:()=>!!v,D(e){z.error(`cookieStore error: `+e)},A(e){if(v){try{for(var t=e+`=`,n=v.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(Xr.A(e))||{}}catch{}return t},N(e,t,n,r,i){if(!v)return!1;try{var a=``,o=``,s=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=v),Jr)return Jr;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),r=Math.min(n.length,8),i=`dmn_chk_`+Kr();!Jr&&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`,Jr=a)}return Jr}(e);if(!n){var r=(e=>{var t=e.match(Yr);return t?t[0]:``})(e);r!==n&&z.info(`Warning: cookie subdomain discovery mismatch`,r,n),n=r}return n?`; domain=.`+n:``}return``}(v.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&&z.warn(`cookieStore warning: large cookie, len=`+l.length),v.cookie=l,!0}catch{return!1}},q(e,t){if(v!=null&&v.cookie)try{Xr.N(e,``,-1,t)}catch{return}}},Zr=null,U={O(){if(!ve(Zr))return Zr;var e=!0;if(I(h))e=!1;else try{var t=`__mplssupport__`;U.N(t,`xyz`),U.A(t)!==`"xyz"`&&(e=!1),U.q(t)}catch{e=!1}return e||z.error(`localStorage unsupported; falling back to cookie store`),Zr=e,e},D(e){z.error(`localStorage error: `+e)},A(e){try{return h?.localStorage.getItem(e)}catch(e){U.D(e)}return null},F(e){try{return JSON.parse(U.A(e))||{}}catch{}return null},N(e,t){try{return h?.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){U.D(e)}return!1},q(e){try{h?.localStorage.removeItem(e)}catch(e){U.D(e)}}},Qr=[Tn,`distinct_id`,Hn,Un,mr,pr,cr],$r={},ei={O:()=>!0,D(e){z.error(`memoryStorage error: `+e)},A:e=>$r[e]||null,F:e=>$r[e]||null,N:(e,t)=>($r[e]=t,!0),q(e){delete $r[e]}},ti=null,ni={O(){if(!ve(ti))return ti;if(ti=!0,I(h))ti=!1;else try{var e=`__support__`;ni.N(e,`xyz`),ni.A(e)!==`"xyz"`&&(ti=!1),ni.q(e)}catch{ti=!1}return ti},D(e){z.error(`sessionStorage error: `,e)},A(e){try{return h?.sessionStorage.getItem(e)}catch(e){ni.D(e)}return null},F(e){try{return JSON.parse(ni.A(e))||null}catch{}return null},N(e,t){try{return h?.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){ni.D(e)}return!1},q(e){try{h?.sessionStorage.removeItem(e)}catch(e){ni.D(e)}}},ri=class{constructor(e){this._instance=e}get qt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.qt.cookieless_mode===Sr||this.isRejected()||this.consent===-1&&this.qt.cookieless_mode===xr}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qt.opt_out_capturing_by_default}optInOut(e){this.nr.N(this.sr,e?1:0,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}get sr(){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 ir(){var e=this.nr.A(this.sr);return Oe(e)?1:P(ke,e)?0:-1}get nr(){var e=this.qt.opt_out_capturing_persistence_type,t=e===`localStorage`?U:Xr;if(!this.ar||this.ar!==t){this.ar=t;var n=e===`localStorage`?Xr:U;n.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(Oe(n.A(this.sr))),n.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[_?.doNotTrack,_?.msDoNotTrack,T.doNotTrack].some((e=>Oe(e)))}},ii=1,ai=3,oi=11;function si(e){return e instanceof Element&&(e.id===hr||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function ci(e){return!!e&&e.nodeType===ii}function li(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ui(e){return!!e&&e.nodeType===ai}function di(e){return!!e&&e.nodeType===oi&&ci(e.host)}function fi(e){return e?le(e).split(/\s+/):[]}function pi(e){var t=h?.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function mi(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 fi(t)}function hi(e){return R(e)?null:le(e).split(/(\s+)/).filter((e=>Li(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function gi(e){var t=``;return ki(e)&&!Ai(e)&&e.childNodes&&e.childNodes.length&&V(e.childNodes,(function(e){ui(e)&&e.textContent&&(t+=hi(e.textContent)??``)})),le(t)}function _i(e){return I(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var vi=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function yi(e,t){if(I(t))return!0;var n,r=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function bi(e){var t=e.parentNode;return!(!t||!ci(t))&&t}var xi=[`next`,`previous`,`prev`,`>`,`<`],Si=[...xi,`+`,`-`,`−`,`–`],Ci=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,wi=[`.ph-no-rageclick`,`.ph-no-capture`],Ti=[``,`text`,`search`,`email`,`password`,`url`,`tel`,`number`];function Ei(e,t){if(!h||Di(e))return!1;var n,r,i,a;if(xe(t)?(n=!!t&&wi,r=void 0,i=!1):(n=t?.css_selector_ignorelist??wi,r=t?.content_ignorelist,i=(a=t?.ignore_text_selection)!=null&&a),!1===n||i&&function(e){return!(!e||!ci(e))&&(!!li(e,`textarea`)||(li(e,`input`)?P(Ti,(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}=Oi(e,!1);return!function(e,t){if(!1===e||I(e))return!1;var n;if(!0===e)n=xi;else{if(!F(e))return!1;if(e.length>10)return z.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=>Ci(t,e)||Ci(r,e)))}))}(r,o.map((e=>({safeText:gi(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!yi(o,n)}var Di=e=>!e||li(e,`html`)||!ci(e),Oi=(e,t)=>{if(!h||Di(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!li(i,`body`);)if(di(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var a=bi(i);if(!a)break;if(t||vi.indexOf(a.tagName.toLowerCase())>-1)n=!0;else{var o=h.getComputedStyle(a);o&&o.getPropertyValue(`cursor`)===`pointer`&&(n=!0)}r.push(a),i=a}return{parentIsUsefulElement:n,targetElementList:r}};function ki(e){for(var t=e;t.parentNode&&!li(t,`body`);t=t.parentNode){var n=mi(t);if(P(n,`ph-sensitive`)||P(n,`ph-no-capture`))return!1}if(P(mi(e),`ph-include`))return!0;var r=e.type||``;if(L(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}var i=e.name||e.id||``;return!L(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 Ai(e){return!!(li(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||li(e,`select`)||li(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var ji=`(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})`,Mi=RegExp(`^(?:`+ji+`)$`),Ni=new RegExp(ji),Pi=`\\d{3}-?\\d{2}-?\\d{4}`,Fi=RegExp(`^(`+Pi+`)$`),Ii=RegExp(`(`+Pi+`)`);function Li(e,t){return t===void 0&&(t=!0),!(R(e)||L(e)&&(e=le(e),(t?Mi:Ni).test((e||``).replace(/[- ]/g,``))||(t?Fi:Ii).test(e)))}function Ri(e){var t=gi(e);return Li(t=(t+` `+zi(e)).trim())?t:``}function zi(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&V(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=gi(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+zi(e)).trim())}catch(e){z.error(`[AutoCapture]`,e)}})),t}function Bi(e){return e.replace(/"|\\"/g,`\\"`)}function Vi(e){var t=e.attr__class;return t?F(t)?t:fi(t):void 0}var Hi=B(`[Dead Clicks]`),Ui=()=>!0,Wi=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(Pn)),r=e.instance.config.capture_dead_clicks;return xe(r)?r:!!he(r)||n},Gi=class{get lazyLoadedDeadClicksAutocapture(){return this.ur}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({[Pn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(e){var t,n;(t=T.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?Hi.error(`failed to load script`,t):e()}))}hr(){var e;if(v){if(!this.ur&&(e=T.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=he(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.ur=T.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ur.start(v),Hi.info(`starting...`)}}else Hi.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,Hi.info(`stopping...`))}},Ki=B(`[SegmentIntegration]`),qi=`posthog-js`;function Ji(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=>A({},e,{stacktrace:e.stacktrace?A({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>A({},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 Yi=class{constructor(e,t,n,r,i,a){this.name=qi,this.setupOnce=function(o){o(Ji(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},Xi=class{constructor(e){this.cr=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&(z.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){this.pr=this._instance.sessionManager?.onSessionId(this.cr)}destroy(){var e;(e=this.pr)==null||e.call(this),this.pr=void 0}doPageView(e,t){var n=this.gr(e,t);return this.dr={pathname:h?.location.pathname??``,pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){return this.gr(e,this.dr?.pageViewId)}doEvent(){return{$pageview_id:this.dr?.pageViewId}}gr(e,t){var n=this.dr;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(!(I(a)||I(o)||I(s)||I(c)||I(l)||I(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?Ae(o/a,0,1,z):1,f=a>1?Ae(s/a,0,1,z):1,p=c>1?Ae(l/c,0,1,z):1,m=c>1?Ae(u/c,0,1,z):1;r=H(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}},Zi=[`flags`,`surveys`],Qi={[wn]:{exposure:`hidden`},[En]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[Dn]:{exposure:`hidden`},[On]:{exposure:`event`},[kn]:{exposure:`hidden`},[An]:{exposure:`event`},[jn]:{exposure:`hidden`},[Mn]:{exposure:`event`},[Nn]:{exposure:`event`},[Pn]:{exposure:`event`},[Fn]:{exposure:`hidden`},[In]:{exposure:`event`},[Ln]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[Hn]:{exposure:`hidden`},[Un]:{exposure:`event`},$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`},[Wn]:{exposure:`derived`,storageGroup:`flags`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!he(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[Gn]:{exposure:`event`,storageGroup:`flags`},[Kn]:{exposure:`hidden`},[qn]:{exposure:`hidden`,storageGroup:`flags`},[Jn]:{exposure:`event`,storageGroup:`flags`},[Yn]:{exposure:`event`,storageGroup:`flags`},[Xn]:{exposure:`event`},[Zn]:{exposure:`hidden`},[Qn]:{exposure:`hidden`},[$n]:{exposure:`hidden`},[er]:{exposure:`hidden`,storageGroup:`surveys`},[tr]:{exposure:`hidden`,storageGroup:`surveys`},[nr]:{exposure:`event`},[rr]:{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`},[ir]:{exposure:`hidden`},[ar]:{exposure:`hidden`},[or]:{exposure:`hidden`},[sr]:{exposure:`hidden`,storageGroup:`flags`},[cr]:{exposure:`hidden`},[lr]:{exposure:`hidden`},[ur]:{exposure:`hidden`},[dr]:{exposure:`hidden`},[fr]:{exposure:`hidden`},[pr]:{exposure:`hidden`},[mr]:{exposure:`hidden`},[Rn]:{exposure:`event`},[zn]:{exposure:`event`},[Bn]:{exposure:`event`},[Vn]:{exposure:`event`},[_r]:{exposure:`event`},[vr]:{exposure:`event`},[yr]:{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`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},$i=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],ea=e=>{var t=Qi[e];if(t)return t;for(var[n,r]of $i)if(e.indexOf(n)===0)return r},ta=e=>{var t=v?.createElement(`a`);return I(t)?null:(t.href=e,t)},na=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(!F(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{z.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},ra=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(`=`);F(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},ia=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},aa=`https?://(.*)`,oa=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],sa=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...oa],ca=`<masked>`,la=[`li_fat_id`];function ua(e,t,n){if(!v)return{};var r,i=t?[...oa,...n||[]]:[],a=da(ra(v.URL,i,ca),e);return H((r={},V(la,(function(e){var t=Xr.A(e);r[e]=t||null})),r),a)}function da(e,t){var n=sa.concat(t||[]),r={};return V(n,(function(t){r[t]=na(e,t)||null})),r}function fa(e){var t=function(e){return e?e.search(aa+`google.([^/?]*)`)===0?`google`:e.search(aa+`bing.com`)===0?`bing`:e.search(aa+`yahoo.com`)===0?`yahoo`:e.search(aa+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,r={};if(!ve(t)){r.$search_engine=t;var i=v?na(v.referrer,n):``;i.length&&(r.ph_keyword=i)}return r}function pa(){return navigator.language||navigator.userLanguage}var ma=`$direct`;function ha(){return v?.referrer||ma}function ga(e,t){var n=e?[...oa,...t||[]]:[],r=y?.href.substring(0,1e3);return{r:ha().substring(0,1e3),u:r?ra(r,n,ca):void 0}}function _a(e){var{r:t,u:n}=e,r={$referrer:t,$referring_domain:t==null?void 0:t==ma?ma:ta(t)?.host};if(n){r.$current_url=n;var i=ta(n);r.$host=i?.host,r.$pathname=i?.pathname,H(r,da(n))}return t&&H(r,fa(t)),r}function va(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ya(){try{return new Date().getTimezoneOffset()}catch{return}}var ba={flags:sr,surveys:tr},xa=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],Sa=`main`,Ca=class{constructor(e,t,n){if(n===void 0&&(n=!0),this.mr={},this.yr=!1,this.br=!1,this.qt=e,this._r=n,this.props={},this.wr=!1,this.Sr=(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.nr=this.kr(e),this.br=this.Cr(e),this.load(),e.debug&&z.info(`Persistence loaded`,e.persistence,A({},this.props)),this.update_config(e,e,t),this.save(),h){var r=()=>this.flush();zr(h,`beforeunload`,r,{capture:!1}),zr(h,`pagehide`,r,{capture:!1})}}Ir(){var e=this.qt?.persistence_save_debounce_ms;return ye(e)&&e>0?e:0}isDisabled(){return!!this.Tr}kr(e){xa.indexOf(e.persistence.toLowerCase())===-1&&(z.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=[...Qr,...e];return A({},U,{F(e){try{var n={};try{n=Xr.F(e)||{}}catch{}var r,i=JSON.parse(U.A(e)||`{}`);if(t){var a={};for(var o in n){var s=n[o];ve(s)||s===``||(a[o]=s)}r=H(i,a)}else r=H(n,i);return U.N(e,r),r}catch{}return null},N(e,t,r,i,a,o){var s=U.N(e,t,void 0,void 0,o);try{var c={};n.forEach((e=>{t[e]&&(c[e]=t[e])})),Object.keys(c).length&&Xr.N(e,c,r,i,a,o)}catch(e){U.D(e)}return s},q(e,t){try{h?.localStorage.removeItem(e),Xr.q(e,t)}catch(e){U.D(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),r=!1,i=e.persistence.toLowerCase();return i===`localstorage`&&U.O()?(t=U,r=!0):i===`localstorage+cookie`&&n.O()?(t=n,r=!0):i===`sessionstorage`&&ni.O()?t=ni:i===`memory`?t=ei:i===`cookie`?t=Xr:n.O()?(t=n,r=!0):t=Xr,this.yr=r,t}Er(e){return this.Sr+`__`+e}Cr(e){return this.yr&&!!e.split_storage}Mr(e){var t=e??this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[sr];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return V(this.props,((t,n)=>{var r=ea(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===Wn?()=>this.Mr():()=>!1))return;r.transformToEventProperties&&H(e,r.transformToEventProperties(t))}else r&&r.exposure!==`event`||(e[n]=t)})),e}load(){if(!this.Tr){var e=this.nr.F(this.Sr);e&&(this.props=H({},e)),this.br&&this.Rr()}}Rr(){for(var e of Zi){var t=U.F(this.Er(e));if(t&&!ge(t)){var n=this.Pr(e);n.persisted=!0,this.Or(e)||(n.fingerprint=this.Lr(t,e)),this.Fr(e,t)||H(this.props,t)}}}Or(e){return Object.keys(this.props).some((t=>ea(t)?.storageGroup===e))}Fr(e,t){var n=ba[e];if(!n)return!1;var r=t[n],i=this.props[n];return ye(r)&&ye(i)&&i>r}refreshKey(e){if(!this.Tr){var t=this.br?ea(e)?.storageGroup:void 0,n=t?U.F(this.Er(t)):this.nr.F(this.Sr);if(n&&e in n)this.Ar(e,n[e]);else{if(t){var r=this.nr.F(this.Sr);if(r&&e in r)return void this.Ar(e,r[e])}this.Nr(e)}}}save(){if(!this.Tr){var e=this.Ir();e>0?I(this.Dr)&&(this.Dr=setTimeout((()=>{this.Dr=void 0,this.$r()}),e)):this.$r()}}flush(){I(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0,this.$r())}$r(){this.Tr||(this.br?this.qr():this.jr(this.nr,this.Sr,this.props,Sa))}qr(){var{main:e,groups:t}=this.Hr();for(var n of(this.jr(this.nr,this.Sr,e,Sa),Zi)){var r,i=t[n];(!ge(i)||(r=this.mr[n])!=null&&r.persisted)&&this.jr(U,this.Er(n),i,n)}}Hr(){var e={},t={};for(var n of Zi)t[n]={};return V(this.props,((n,r)=>{var i=ea(r)?.storageGroup;i?t[i][r]=n:e[r]=n})),{main:e,groups:t}}Lr(e,t){var n=JSON.stringify(e);return t===Sa?n+`|`+this.Ur+`|`+this.Br+`|`+this.zr:n}jr(e,t,n,r){var i=this.Pr(r);if(r===Sa||i.dirty||I(i.fingerprint)){var a;try{if((a=this.Lr(n,r))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.N(t,n,this.Ur,this.Br,this.zr,this.qt.debug)?(i.dirty=!1,r!==Sa&&(i.persisted=!0),I(a)||(i.fingerprint=a)):this.qt.debug&&z.warn(`failed to persist storage entry "`+t+`"; will retry on next save`)}}remove(e){var{keepGroupEntries:t=!1}=e===void 0?{}:e;if(I(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0),this.nr.q(this.Sr,!1),this.nr.q(this.Sr,!0),!t&&this._r)for(var n of Zi)U.q(this.Er(n));t?delete this.mr[Sa]:this.mr={}}clear(){this.remove(),this.props={}}register_once(e,t,n){if(he(e)){I(t)&&(t=`None`),this.Ur=I(n)?this.Vr:n;var r=!1;if(V(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Ar(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(he(e)){this.Ur=I(t)?this.Vr:t;var n=!1;if(V(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Ar(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Nr(e),this.save())}update_campaign_params(){if(!this.wr){var e=ua(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);ge(Ir(e))||this.register(e),this.wr=!0}}update_search_keyword(){var e;this.register((e=v?.referrer)?fa(e):{})}update_referrer_info(){this.register_once({$referrer:ha(),$referring_domain:v!=null&&v.referrer&&ta(v.referrer)?.host||ma},void 0)}set_initial_person_info(){this.props[dr]||this.props[fr]||this.register_once({[pr]:ga(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};V([fr,dr],(t=>{var n=this.props[t];n&&V(n,(function(t,n){e[`$initial_`+ue(n)]=t}))}));var t,n,r=this.props[pr];return r&&H(e,(t=_a(r),n={},V(t,(function(e,t){n[`$initial_`+ue(t)]=e})),n)),e}safe_merge(e){return V(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){this.Vr=this.Ur=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.kr(e):this.nr,a=this.Cr(e);if(r||a!==this.br){var o=this.props;this.clear(),this.nr=i,this.br=a,this.props=o,this.save()}}set_disabled(e){this.Tr=e,this.Tr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Br&&(this.Br=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.zr&&(this.zr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var n=this.props[Dn]||{};n[e]=t,this.Ar(Dn,n),this.save()}remove_event_timer(e){var t=this.props[Dn]||{},n=t[e];return I(n)||(delete t[e],this.Ar(Dn,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Ar(e,t),this.save()}Ar(e,t){this.props[e]=t,this.Wr(e)}Nr(e){delete this.props[e],this.Wr(e)}Wr(e){var t=ea(e)?.storageGroup;t&&(this.Pr(t).dirty=!0)}Pr(e){return this.mr[e]||(this.mr[e]={})}},wa={Activation:`events`,Cancellation:`cancelEvents`},Ta={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},Ea={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},Da={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`},Oa={Popover:`popover`,Inline:`inline`},ka={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`},Aa={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`},ja=B(`[RateLimiter]`),Ma=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{ja.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){ja.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(ur)??{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(ur,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},Na=B(`[RemoteConfig]`),Pa=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=T._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Zr(e){var t,n;(t=T.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}Gr(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 Na.info(`Using preloaded remote config`,this.remoteConfig),this.Qr(this.remoteConfig),void this.Jr();if(this._instance.Kr())return void Na.warn(`Remote config is disabled. Falling back to local config.`);this.Zr((e=>{if(!e)return Na.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.Gr((e=>{this.Qr(e),this.Jr()}));this.Qr(e),this.Jr()}))}catch(e){Na.error(`Error loading remote config`,e)}}stop(){this.Yr&&=(clearInterval(this.Yr),void 0)}refresh(){!this._instance.Kr()&&v&&v.visibilityState!==`hidden`&&this._instance.reloadFeatureFlags()}Jr(){if(!this.Yr){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.Yr=setInterval((()=>{this.refresh()}),e))}}Qr(e){var t;e||Na.error(`Failed to fetch remote config from PostHog.`),this._instance.Qr(e??{}),!1!==e?.hasFeatureFlags&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},Fa={GZipJS:`gzip-js`,Base64:`base64`},Ia=Uint8Array,La=Uint16Array,Ra=Uint32Array,za=new Ia([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]),Ba=new Ia([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]),Va=new Ia([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ha=function(e,t){for(var n=new La(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new Ra(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]},Ua=Ha(za,2),Wa=Ua[1];Ua[0][28]=258,Wa[258]=28;for(var Ga=Ha(Ba,0)[1],Ka=new La(32768),W=0;32768>W;++W){var qa=(43690&W)>>>1|(21845&W)<<1;Ka[W]=((65280&(qa=(61680&(qa=(52428&qa)>>>2|(13107&qa)<<2))>>>4|(3855&qa)<<4))>>>8|(255&qa)<<8)>>>1}var Ja=function(e,t,n){for(var r=e.length,i=0,a=new La(t);r>i;++i)++a[e[i]-1];var o,s=new La(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new La(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[Ka[d]>>>c]=l}else for(o=new La(r),i=0;r>i;++i)o[i]=Ka[s[e[i]-1]++]>>>15-e[i];return o},Ya=new Ia(288);for(W=0;144>W;++W)Ya[W]=8;for(W=144;256>W;++W)Ya[W]=9;for(W=256;280>W;++W)Ya[W]=7;for(W=280;288>W;++W)Ya[W]=8;var Xa=new Ia(32);for(W=0;32>W;++W)Xa[W]=5;var Za=Ja(Ya,9,0),Qa=Ja(Xa,5,0),$a=function(e){return(e/8>>0)+(7&e&&1)},eo=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof La?La:e instanceof Ra?Ra:Ia)(n-t);return r.set(e.subarray(t,n)),r},to=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},no=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},ro=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 Ia(0),0];if(i==1){var o=new Ia(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 La(f+1),m=io(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 Ia(p),m]},io=function(e,t,n){return e.s==-1?Math.max(io(e.l,t,n+1),io(e.r,t,n+1)):t[e.s]=n},ao=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new La(++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>2&&(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]},oo=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},so=function(e,t,n){var r=n.length,i=$a(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)},co=function(e,t,n,r,i,a,o,s,c,l,u){to(t,u++,n),++i[256];for(var d=ro(i,15),f=d[0],p=d[1],m=ro(a,15),h=m[0],g=m[1],_=ao(f),v=_[0],y=_[1],b=ao(h),x=b[0],S=b[1],C=new La(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var T=ro(C,7),E=T[0],D=T[1],O=19;O>4&&!E[Va[O-1]];--O);var k,A,j,M,N=l+5<<3,ee=oo(i,Ya)+oo(a,Xa)+o,te=oo(i,f)+oo(a,h)+o+14+3*O+oo(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(ee>=N&&te>=N)return so(t,u,e.subarray(c,c+l));if(to(t,u,1+(ee>te)),u+=2,ee>te){k=Ja(f,p,0),A=f,j=Ja(h,g,0),M=h;var ne=Ja(E,D,0);for(to(t,u,y-257),to(t,u+5,S-1),to(t,u+10,O-4),u+=14,w=0;O>w;++w)to(t,u+3*w,E[Va[w]]);u+=3*O;for(var re=[v,x],ie=0;2>ie;++ie){var ae=re[ie];for(w=0;ae.length>w;++w)to(t,u,ne[oe=31&ae[w]]),u+=E[oe],oe>15&&(to(t,u,ae[w]>>>5&127),u+=ae[w]>>>12)}}else k=Za,A=Ya,j=Qa,M=Xa;for(w=0;s>w;++w)if(r[w]>255){var oe;no(t,u,k[257+(oe=r[w]>>>18&31)]),u+=A[oe+257],oe>7&&(to(t,u,r[w]>>>23&31),u+=za[oe]);var se=31&r[w];no(t,u,j[se]),u+=M[se],se>3&&(no(t,u,r[w]>>>5&8191),u+=Ba[se])}else no(t,u,k[r[w]]),u+=A[r[w]];return no(t,u,k[256]),u+A[256]},lo=new Ra([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),uo=function(){for(var e=new Ra(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),fo=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function po(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=uo[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 Ia(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=so(c,l,e.subarray(u,d)):(c[u]=!0,l=so(c,l,e.subarray(u,o)))}else{for(var f=lo[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new La(32768),_=new La(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 Ra(25e3),S=new La(288),C=new La(32),w=0,T=0,E=(u=0,0),D=0,O=0;o>u;++u){var k=b(u),A=32767&u,j=_[k];if(g[A]=j,_[k]=A,u>=D){var M=o-u;if((w>7e3||E>24576)&&M>423){l=co(e,c,0,x,S,C,T,E,O,u-O,l),E=w=T=0,O=u;for(var N=0;286>N;++N)S[N]=0;for(N=0;30>N;++N)C[N]=0}var ee=2,te=0,ne=m,re=A-j&32767;if(M>2&&k==b(u-re))for(var ie=Math.min(p,M)-1,ae=Math.min(32767,u),oe=Math.min(258,M);ae>=re&&--ne&&A!=j;){if(e[u+ee]==e[u+ee-re]){for(var se=0;oe>se&&e[u+se]==e[u+se-re];++se);if(se>ee){if(ee=se,te=re,se>ie)break;var ce=Math.min(re,se-2),P=0;for(N=0;ce>N;++N){var le=u-re+N+32768&32767,ue=le-g[le]+32768&32767;ue>P&&(P=ue,j=le)}}}re+=(A=j)-(j=g[A])+32768&32767}if(te){x[E++]=268435456|Wa[ee]<<18|Ga[te];var de=31&Wa[ee],fe=31&Ga[te];T+=za[de]+Ba[fe],++S[257+de],++C[fe],D=u+ee,++w}else x[E++]=e[u],++S[e[u]]}}l=co(e,c,!0,x,S,C,T,E,O,u-O,l)}return eo(s,0,r+$a(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&&fo(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),fo(l,u-8,n.d()),fo(l,u-4,r),l}var mo=!!x||!!b,ho=`text/plain`,go=!1,_o=(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:``)},vo=function(e,t,n){n===void 0&&(n=!0);var[r,i]=e.split(`?`),a=A({},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 V(e,(function(e,t){I(e)||I(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(`&`)},yo=(e,t)=>JSON.stringify(e,((e,t)=>typeof t==`bigint`?t.toString():t),t),bo=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===Fa.GZipJS){var r=po(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new Ia(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 Ia(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 eo(r,0,i)}(yo(t)),{mtime:0});return{contentType:ho,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Fa.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:yo(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(yo(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=yo(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},xo=e=>{var t,n,r,i=bo(e);return!i||(n=e.compression,r=na(e.url,`compression`),n!==N.GZipJS&&r!==N.GZipJS&&r!==`gzip`)||((t=i.body)instanceof ArrayBuffer?ne(new Uint8Array(t)):ArrayBuffer.isView(t)&&ne(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:i}:(go=!0,{url:_o(e.url,`compression`),encodedBody:bo(A({},e,{compression:void 0,tr:void 0}))})},So=function(){var e=k((function*(e){var t=yield function(e,t,n){return oe.apply(this,arguments)}(yo(e.data),D.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return A({},e,{tr:{contentType:ho,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Co=(e,t)=>vo(e,{_:new Date().getTime().toString(),ver:D.JS_SDK_VERSION,compression:t}),wo=[];b&&wo.push({transport:`fetch`,method(e){var{url:t,encodedBody:n}=xo(e),{contentType:r,body:i,estimatedSize:a}=n??{},o=new Headers;V(e.headers,(function(e,t){o.append(t,e)})),r&&o.append(`Content-Type`,r);var s=null;if(S){var c=new S;s={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}b(t,A({method:e?.method||`GET`,headers:o,keepalive:e.method===`POST`&&52428.8>(a||0),body:i,signal:s?.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){z.error(e)}e.callback==null||e.callback(r)})))).catch((t=>{z.error(t),e.callback==null||e.callback({statusCode:0,error:t})})).finally((()=>s?clearTimeout(s.timeout):null))}}),x&&wo.push({transport:`XHR`,method(e){var t=new x,{url:n,encodedBody:r}=xo(e);t.open(e.method||`GET`,n,!0);var{contentType:i,body:a}=r??{};V(e.headers,(function(e,n){t.setRequestHeader(n,e)})),i&&t.setRequestHeader(`Content-Type`,i),e.timeout&&(t.timeout=e.timeout),e.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}e.callback==null||e.callback(n)}},t.send(a)}}),_!=null&&_.sendBeacon&&wo.push({transport:`sendBeacon`,method(e){try{var{url:t,encodedBody:n}=xo(e),r=vo(t,{beacon:`1`}),{contentType:i,body:a}=n??{};if(!a)return;var o=a instanceof Blob?a:new Blob([a],{type:i});_.sendBeacon(r,o)}catch{}}});var To=3e3,Eo=class{constructor(e,t){this.Xr=!0,this.ei=[],this.ti=Ae(t?.flush_interval_ms||To,250,5e3,z.createLogger(`flush interval`),To),this.ri=e}enqueue(e){this.ei.push(e),this.ii||this.ni()}unload(){this.si();var e=this.ei.length>0?this.oi():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.ri(A({},e,{transport:`sendBeacon`}))}))}enable(){this.Xr=!1,this.ni()}ni(){var e=this;this.Xr||(this.ii=setTimeout((()=>{if(this.si(),this.ei.length>0){var t=this.oi(),n=function(){var n=t[r],i=new Date().getTime();n.data&&F(n.data)&&V(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.ri(n)};for(var r in t)n()}}),this.ti))}si(){clearTimeout(this.ii),this.ii=void 0}oi(){var e={};return V(this.ei,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;I(e[i])&&(e[i]=A({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.ei=[],e}},Do=[`retriesPerformedSoFar`],Oo=class{constructor(e){this.ai=!1,this.ui=3e3,this.ei=[],this._instance=e,this.ei=[],this.li=!0,!I(h)&&`onLine`in h.navigator&&(this.li=h.navigator.onLine,this.hi=()=>{this.li=!0,this.ci()},this.di=()=>{this.li=!1},zr(h,`online`,this.hi),zr(h,`offline`,this.di))}get length(){return this.ei.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=j(e,Do);be(t)&&(n.url=vo(n.url,{retry_count:t})),this._instance._send_request(A({},n,{callback:e=>{e.statusCode===200||e.statusCode>=400&&500>e.statusCode||(t??0)>=10?n.callback==null||n.callback(e):this.vi(A({retriesPerformedSoFar:t},n))}}))}vi(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.ei.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),z.warn(i),this.ai||(this.ai=!0,this.fi())}fi(){if(this.pi&&clearTimeout(this.pi),this.ei.length===0)return this.ai=!1,void(this.pi=void 0);this.pi=setTimeout((()=>{this.li&&this.ei.length>0&&this.ci(),this.fi()}),this.ui)}ci(){var e=Date.now(),t=[],n=this.ei.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this.ei=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.pi&&=(clearTimeout(this.pi),void 0),this.ai=!1,I(h)||(this.hi&&=(h.removeEventListener(`online`,this.hi),void 0),this.di&&=(h.removeEventListener(`offline`,this.di),void 0)),this.ei))try{this._instance._send_request(A({},e,{transport:`sendBeacon`}))}catch(e){z.error(e)}this.ei=[]}},ko=class{constructor(e){this.gi=()=>{this.mi||={};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.mi.lastScrollY=Math.ceil(t),this.mi.maxScrollY=Math.max(t,this.mi.maxScrollY??0),this.mi.maxScrollHeight=Math.max(n,this.mi.maxScrollHeight??0),this.mi.lastContentY=r,this.mi.maxContentY=Math.max(r,this.mi.maxContentY??0),this.mi.maxContentHeight=Math.max(i,this.mi.maxContentHeight??0)},this._instance=e}get yi(){return this._instance.config.scroll_root_selector}getContext(){return this.mi}resetContext(){var e=this.mi;return setTimeout(this.gi,0),e}startMeasuringScrollPosition(){zr(h,`scroll`,this.gi,{capture:!0}),zr(h,`scrollend`,this.gi,{capture:!0}),zr(h,`resize`,this.gi)}scrollElement(){if(!this.yi)return h?.document.documentElement;for(var e of F(this.yi)?this.yi:[this.yi]){var t=h?.document.querySelector(e);if(t)return t}}scrollY(){if(this.yi){var e=this.scrollElement();return e&&e.scrollTop||0}return h&&(h.scrollY||h.pageYOffset||h.document.documentElement.scrollTop)||0}scrollX(){if(this.yi){var e=this.scrollElement();return e&&e.scrollLeft||0}return h&&(h.scrollX||h.pageXOffset||h.document.documentElement.scrollLeft)||0}},Ao=e=>ga(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties),jo=class{constructor(e,t,n,r){this.bi=e=>{var t=this.wi();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.xi(this._instance)};this.Si.register({[lr]:n})}},this._instance=e,this.ki=t,this.Si=n,this.xi=r||Ao,this.ki.onSessionId(this.bi)}wi(){return this.Si.props[lr]}getSetOnceProps(){var e=this.wi()?.props;return e?`r`in e?_a(e):{$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 V(Ir(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+ue(n)]=t})),e}},Mo=class{constructor(){this.Ci={}}on(e,t){return this.Ci[e]||(this.Ci[e]=[]),this.Ci[e].push(t),()=>{this.Ci[e]=this.Ci[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.Ci[e]||[])n(t);for(var r of this.Ci[`*`]||[])r(e,t)}},No=B(`[SessionId]`),Po=class{on(e,t){return this.Ii.on(e,t)}constructor(e,t,n){var r;if(this.Ti=null,this.Ei=[],this.Mi=void 0,this.Ii=new Mo,this.Ri=(e,t)=>!(!be(e)||!be(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===Sr)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.qt=e.config,this.Si=e.persistence,this.Pi=void 0,this.Oi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Li=t||Kr,this.Fi=n||Kr;var i=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*Ae(this.qt.session_idle_timeout_seconds||1800,60,36e3,No.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ai(),this.Ni=`ph_`+i+`_window_id`,this.Di=`ph_`+i+`_primary_window_exists`,this.$i()){var a=ni.F(this.Ni),o=ni.F(this.Di);a&&!o?this.Pi=a:ni.q(this.Ni),ni.N(this.Di,!0)}if((r=this.qt.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.qt.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.qi(this.qt.bootstrap.sessionID,new Date().getTime(),s)}catch(e){No.error(`Invalid sessionID in bootstrap`,e)}this.ji()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return I(this.Ei)&&(this.Ei=[]),this.Ei.push(e),this.Oi&&e(this.Oi,this.Pi),()=>{this.Ei=this.Ei.filter((t=>t!==e))}}$i(){return this.qt.persistence!==`memory`&&!this.Si.Tr&&ni.O()}Hi(e){e!==this.Pi&&(this.Pi=e,this.$i()&&ni.N(this.Ni,e))}Ui(){return this.Pi?this.Pi:this.$i()?ni.F(this.Ni):null}Bi(e){var t=this.Ti;return!ve(t)&&!ve(e)&&5e3>Math.abs(e-t)}qi(e,t,n){var r=t!==this._sessionActivityTimestamp,i=!(e!==this.Oi||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Oi=e,i&&!r||i&&this.Bi(t)||(this.Ti=t,this.Si.register({[Hn]:[t,e,n]}))}zi(){var e=this.qt?.persistence_save_debounce_ms;return be(e)&&e>0}Vi(){if(!ve(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ti){this.zi()?this.Si.refreshKey(Hn):(this.Si.flush(),this.Si.load());var[,e,t]=this.Wi();e===this.Oi&&t===this._sessionStartTimestamp&&(this.Ti=this._sessionActivityTimestamp,this.Si.register({[Hn]:[this._sessionActivityTimestamp,this.Oi??null,this._sessionStartTimestamp]}),this.Si.flush())}}Zi(){var[e]=this.Wi(),t=be(e)?e:0,n=be(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}Wi(){var e=this.Si.props[Hn];return F(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ti=null,clearTimeout(this.Gi),this.Gi=void 0,this.qi(null,null,null)}destroy(){this.Vi(),clearTimeout(this.Gi),this.Gi=void 0,this.Mi&&h&&(h.removeEventListener(Dr,this.Mi,{capture:!1}),this.Mi=void 0),this.Ei=[]}ji(){this.Mi=()=>{this.Vi(),this.$i()&&ni.q(this.Di)},zr(h,Dr,this.Mi,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.qt.cookieless_mode===Sr)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),[,r,i]=this.Wi(),a=this.Zi(),o=this.Ui(),s=be(i)&&Math.abs(n-i)>864e5,c=!1,l=!r,u=!l&&!e&&this.Ri(n,a);l||u||s?(r=this.Li(),o=this.Fi(),No.info(`new session ID generated`,{sessionId:r,windowId:o,changeReason:{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}}),i=n,c=!0):o||(o=this.Fi(),c=!0);var d=be(a)&&e&&!s?a:n,f=be(i)?i:new Date().getTime();return this.Hi(o),this.qi(r,d,f),e||this.Ai(),c&&this.Ei.forEach((e=>e(r,o,c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0))),{sessionId:r,windowId:o,sessionStartTimestamp:f,changeReason:c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0,lastActivityTimestamp:a}}Ai(){clearTimeout(this.Gi),this.Gi=setTimeout((()=>{var e=this.Zi();if(this.Ri(new Date().getTime(),e)){var t=this.Oi;this.resetSessionId(),this.Ii.emit(`forcedIdleReset`,{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}},Fo=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&ce(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>ce(e?.brand,t))))return!0}catch{}return!!e.webdriver},Io=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 Lo(e,t,n){return yo({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var Ro={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=>Io(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Io(t,e))))),icontains:(e,t)=>t.map(zo).some((t=>e.map(zo).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(zo).every((t=>e.map(zo).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)))}))},zo=e=>e.toLowerCase();function Bo(e,t){return!e||Object.entries(e).every((e=>{var[n,r]=e,i=t?.[n];if(I(i)||ve(i))return!1;var a=[String(i)],o=Ro[r.operator];return!!o&&o(r.values,a)}))}var Vo=`custom`,Ho=`i.posthog.com`,Uo=/^\/static\//,Wo=class{constructor(e){this.Qi={},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(`.`+Ho,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.Qi[this.apiHost]||(this.Qi[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`:Vo),this.Qi[this.apiHost]}Ji(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof t==`string`&&Uo.test(e))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.Ji(t);if(n)return``+n+t}if(this.region===Vo)return this.apiHost+t;var r=Ho+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}},G=B(`[Surveys]`),Go=`seenSurvey_`,Ko=[Ta.Popover,Ta.Widget,Ta.API],qo={ignoreConditions:!1,ignoreDelay:!1,displayType:Oa.Popover},Jo=B(`[PostHog ExternalIntegrations]`),Yo={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},Xo=class{constructor(e){this._instance=e}lr(e,t){var n;(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return Jo.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var n,i,a;!r||(n=T.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[t]||e.lr(Yo[t],(()=>{var n;(n=T.__PosthogExtensions__)==null||(n=n.integrations)==null||(n=n[t])==null||n.start(e._instance)})),!r&&(i=T.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[t]&&((a=T.__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)}}},Zo,Qo={},$o=0,es=()=>{},ts=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,ns=`Surveys module not available`,rs=`sanitize_properties is deprecated. Use before_send instead`,is=`Invalid value for property_denylist config: `,as=`posthog`,os=!mo&&w?.indexOf(`MSIE`)===-1&&w?.indexOf(`Mozilla`)===-1,ss=e=>{var t;return A({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,token:``,autocapture:!0,cross_subdomain_cookie:Rr(v?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:es,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:y&&L(y?.search)&&y.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(h==null||(t=h.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){z.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:Tr,before_send:void 0,request_queue_config:{flush_interval_ms:To},error_tracking:{},_onCapture:es,__preview_eager_load_replay:!1},(e=>({rageclick:e&&e>=`2026-05-30`?{content_ignorelist:Si,ignore_text_selection:!0}:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording: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)}))(e))},cs=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`]],ls=e=>{var t={};for(var[n,r]of cs)I(e[n])||(t[r]=e[n]);var i=H({},t,e);return F(e.property_blacklist)&&(I(e.property_denylist)?i.property_denylist=e.property_blacklist:F(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:z.error(is+e.property_denylist)),i},us=class{constructor(){this.__forceAllowLocalhost=!1}get Ki(){return this.__forceAllowLocalhost}set Ki(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},ds=class e{Yi(e,t){if(e){var n=this.Xi.indexOf(e);n!==-1&&this.Xi.splice(n,1)}return this.Xi.push(t),t.initialize==null||t.initialize(),t}en(){return this.config.cookieless_mode===Sr||this.config.cookieless_mode===xr&&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 us,this.tn=!1,this.version=D.LIB_VERSION,this.rn=new Mo,this.Xi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ss(),this.SentryIntegration=Yi,this.sentryIntegration=e=>function(e,t){var n=Ji(e,t);return{name:qi,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.nn=!1,this.sn=null,this.an=null,this.un=null,this.scrollManager=new ko(this),this.pageViewManager=new Xi(this),this.rateLimiter=new Ma(this),this.requestRouter=new Wo(this),this.consent=new ri(this),this.externalIntegrations=new Xo(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=L(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=L(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>z.info(`send "`+e?.event+`"`,e)))}init(t,n,r){if(r&&r!==as){var i=Qo[r]??new e;return i._init(t,n,r),Qo[r]=i,Qo[as][r]=i,i}return this._init(t,n,r)}_init(e,t,n){var r;t===void 0&&(t={});var i=L(e)?e.trim():``;if(!i)return z.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.ln(t.debug),this.hn=t,this.cn=[],t.person_profiles?this.an=t.person_profiles:t.process_person&&(this.an=t.process_person);var a=ss(t.defaults),o=ls(t),s=H({},a,o,{name:n,token:i});he(a.rageclick)&&he(o.rageclick)&&(s.rageclick=H({},a.rageclick,o.rageclick)),this.set_config(s),this.config.on_xhr_error&&z.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=t.disable_compression?void 0:Fa.GZipJS;var c=this.dn();this.persistence=new Ca(this.config,c),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new Ca(A({},this.config,{persistence:`sessionStorage`}),c,!1);var l=A({},this.persistence.props),u=A({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.vn=new Eo((e=>this.fn(e)),this.config.request_queue_config),this.pn=new Oo(this),this.__request_queue=[];var d=this.en();if(d||(this.sessionManager=new Po(this),this.sessionPropsManager=new jo(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(z.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.gn(d)}),0)):(z.info(`Initializing extensions synchronously`),this.gn(d)),D.DEBUG=D.DEBUG||this.config.debug,D.DEBUG&&z.info(`Starting in debug mode`,{this:this,config:t,thisC:A({},this.config),p:l,s:u}),!this.config.identity_distinct_id||(r=t.bootstrap)!=null&&r.distinctID||(t.bootstrap=A({},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(cr);if(t.bootstrap.isIdentifiedID&&p!=null&&p!==f&&m===Cr)this.identify(f);else if(t.bootstrap.isIdentifiedID&&p!=null&&p!==f&&m===wr)z.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 g=this.config.get_device_id(Kr()),_=t.bootstrap.isIdentifiedID?g:f;this.persistence.set_property(cr,t.bootstrap.isIdentifiedID?wr:Cr),this.register({distinct_id:f,$device_id:_})}}if(d)this.register_once({distinct_id:gr,$device_id:null},``);else if(!this.get_distinct_id()){var v=this.config.get_device_id(Kr());this.register_once({distinct_id:v,$device_id:v},``),this.persistence.set_property(cr,Cr)}return zr(h,`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()||Kr();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(cr,wr)),t()},i=n.user();`then`in i&&me(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{Promise&&Promise.resolve||Ki.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()||(Ki.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Ki.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,Or),identify:e=>t(e,Ar),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.mn())):this.mn(),me(this.config._onCapture)&&this.config._onCapture!==es&&(z.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&z.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}gn(t){var n=performance.now(),r=A({},e.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.Xi.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.Xi.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.Xi.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.Xi.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.Xi.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!t&&this.Xi.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.Xi.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.Xi.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.Xi.push(this.logs=this.logs??new r.logs(this)),r.conversations&&this.Xi.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.Xi.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Xi.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Xi.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Xi.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Xi.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Wi)),r.toolbar&&this.Xi.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.Xi.push(this.experiments=this.experiments??new r.experiments(this)),this.Xi.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>{if(this.yn){var e=this.yn;this.yn=void 0,this.Qr(e)}})),this.bn(i,n)}bn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.bn(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){z.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[_r]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[vr]:r}),this.config.__preview_deferred_init_extensions&&z.info(`PostHog extensions initialized (`+r+`ms)`)}Qr(e){var t;if(!v||!v.body)return z.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.Qr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.yn=e),this._n=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=P(e.supportedCompression,Fa.GZipJS)?Fa.GZipJS:P(e.supportedCompression,Fa.Base64)?Fa.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.an?this.an:Tr}),this.Xi.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}mn(){try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}if(this.wn(),this.config.internal_or_test_user_hostname&&y!=null&&y.hostname){var e=y.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.en())&&this.xn()}),1),this.Sn=new Pa(this),this.Sn.load()}wn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.vn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Mr(this.__request_queue,(e=>this.fn(e))),this.__request_queue=[],this.wn()}_handle_unload(){var e,t,n,r;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.kn()&&this.capture(kr),(t=this.logs)==null||t.flushLogs(`sendBeacon`),(n=this.vn)==null||n.unload(),(r=this.pn)==null||r.unload()):this.kn()&&this.capture(kr,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded&&(os?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=vo(e.url,{ip:this.config.ip?1:0}),e.headers=A({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=A({},e);t.timeout=t.timeout||6e4,t.url=Co(t.url,t.compression);var n=t.transport??`fetch`,r=wo.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===Fa.GZipJS&&C&&!go?So(t).then((e=>{i(e)})).catch((n=>{if(re(n))return go=!0,void i(A({},t,{compression:void 0,url:Co(e.url,void 0)}));(e=>{if(!e||typeof e!=`object`)return!1;var t=`name`in e?String(e.name):``;return re(e)||t===te})(n)&&(go=!0),i(t)})):i(t)})(A({},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)}}))))}fn(e){this.pn?this.pn.retriableRequest(e):this._send_request(e)}_execute_array(e){$o++;try{var t,n=[],r=[],i=[];Mr(e,(e=>{if(e)if(F(t=e[0]))i.push(e);else if(me(e))try{e.call(this)}catch(t){z.error(`Error executing queued PostHog call`,e,t)}else F(e)&&t===`alias`?n.push(e):F(e)&&t.indexOf(`capture`)!==-1&&me(this[t])?i.push(e):r.push(e)}));var a=function(e,t){Mr(e,(function(e){try{if(F(e[0])){var n=t;V(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){z.error(`Error executing queued PostHog call`,e,t)}}))};a(n,this),a(r,this),a(i,this)}finally{$o--}}push(t){if($o>0&&F(t)&&L(t[0])){var n=e.prototype[t[0]];me(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.vn){if(this.is_capturing())if(!I(e)&&L(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&&!L(t?.$current_url)&&(z.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.Cn||z.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=n?.uuid||Kr(),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===Or&&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,m,h,g=this.In(n?.$set_once,e!==jr,e===Ar);if(g&&(f.$set_once=g),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>L(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),F(t)?(r=[],Mr(t,(t=>{r.push(e(t))}))):(r={},V(t,((t,n)=>{o.has(t)||(r[n]=e(t,n))}))),r):a?a(t):t;var r}(i)),f.timestamp=u,I(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===Ea.DISMISSED||e===Ea.SENT){var _=t?.[Da.SURVEY_ID],v=t?.[Da.SURVEY_ITERATION];(e=>{try{var t=(e=>((e,t)=>{var n=``+Go+t.id;return t.current_iteration&&t.current_iteration>0&&(n=``+Go+t.id+`_`+t.current_iteration),n})(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){G.error(`Failed to persist survey seen state`,e)}})({id:_,current_iteration:v}),f.$set=A({},f.$set,{[(p={id:_,current_iteration:v},m=e===Ea.SENT?`responded`:`dismissed`,h=`$survey_`+m+`/`+p.id,p.current_iteration&&p.current_iteration>0&&(h=`$survey_`+m+`/`+p.id+`/`+p.current_iteration),h)]:!0})}else e===Ea.SHOWN&&(f.$set=A({},f.$set,{[Da.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===ka.SHOWN){var y=t?.[Aa.TOUR_TYPE];y&&(f.$set=A({},f.$set,{[Aa.TOUR_LAST_SEEN_DATE+`/`+y]:new Date().toISOString()}))}var b=A({},f.properties.$set,f.$set);if(ge(b)||this.setPersonPropertiesForFlags(b),!R(this.config.before_send)){var x=this.Tn(f);if(!x)return;f=x}this.rn.emit(`eventCaptured`,f);var S={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.fn(S):this.vn.enqueue(S),f}z.critical(`This capture call is ignored due to client rate limiting.`)}}else z.error(`No event name provided to posthog.capture`)}else z.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=A({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.en()&&(o.$cookieless_mode=!0),e===`$snapshot`){var s=A({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,(!L(o.distinct_id)&&!ye(o.distinct_id)||_e(o.distinct_id))&&z.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),o}var c,l=function(e,t){var n,r,i;if(!w)return{};var a,o,s,c,l,u=e?[...oa,...t||[]]:[],[d,f]=function(e){for(var t=0;It.length>t;t++){var[n,r]=It[t],i=n.exec(e),a=i&&(me(r)?r(i,e):r);if(a)return a}return[``,``]}(w),p=(a=typeof navigator<`u`?navigator:void 0)!=null&&a.brave?{brave:!0}:{},m=H(Ir({$os:d,$os_version:f,$browser:Nt(w,navigator.vendor,p),$device:Lt(w),$device_type:(s=w,c={userAgentDataPlatform:(n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform,maxTouchPoints:navigator?.maxTouchPoints,screenWidth:h==null||(r=h.screen)==null?void 0:r.width,screenHeight:h==null||(i=h.screen)==null?void 0:i.height,devicePixelRatio:h?.devicePixelRatio},l=Lt(s),l===Be||l===ze||l===`Kobo`||l===`Kindle Fire`||l===gt?Re:l===at||l===st||l===ot||l===pt?`Console`:l===He?`Wearable`:l?Fe:c?.userAgentDataPlatform===`Android`&&(c?.maxTouchPoints??0)>0?600>Math.min(c?.screenWidth??0,c?.screenHeight??0)/(c?.devicePixelRatio??1)?Fe:Re:`Desktop`),$timezone:va(),$timezone_offset:ya()}),{$current_url:ra(y?.href,u,ca),$host:y?.host,$pathname:y?.pathname,$raw_user_agent:w.length>1e3?w.substring(0,997)+`...`:w,$browser_version:Ft(w,navigator.vendor,p),$browser_language:pa(),$browser_language_prefix:(o=pa(),typeof o==`string`?o.split(`-`)[0]:void 0),$screen_height:h?.screen.height,$screen_width:h?.screen.width,$viewport_height:h?.innerHeight,$viewport_width:h?.innerWidth,$lib:D.LIB_NAME,$lib_version:D.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return D.SDK_DIST_CHANNEL&&(m.$sdk_dist_channel=D.SDK_DIST_CHANNEL),m}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:u,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime());o.$session_id=u,o.$window_id=d}this.sessionPropsManager&&H(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&H(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=this.pn?.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Vo&&(o.$lib_custom_api_host=this.config.api_host),c=e!==Or||i?e!==kr||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),o=H(o,c),e===Or&&v&&(o.title=v.title),!I(a)){var f=n.getTime()-a;o.$duration=parseFloat((f/1e3).toFixed(3))}w&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?`bot`:`browser`),(o=H({},l,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),F(this.config.property_denylist)?V(this.config.property_denylist,(function(e){delete o[e]})):z.error(is+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(z.error(rs),o=p(o,e));var m=this.En();return o.$process_person_profile=m,m&&!i&&this.Mn(`_calculate_event_properties`),o}In(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.En()||this.tn&&!n)return e;var r=H({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(z.error(rs),r=i(r,`$set_once`)),t&&(this.tn=!0),ge(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)}Rn(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)}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(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.rn.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:ns}),()=>{})}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:ns})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:ns})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=qo),(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:ns}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:ns})}Pn(e){return!e||_e(e)?(z.critical(`Unique user id has not been set in posthog.identify`),!1):e===gr?(z.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())||(z.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 z.uninitializedWarning(`posthog.identify`);if(ye(e)&&(e=e.toString(),z.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.Pn(e)&&this.Mn(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Tn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(En)&&(this.unregister(En),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(cr)||Cr)===Cr;e!==r&&a?(this.persistence.set_property(cr,wr),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(Ar,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.un=Lo(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(ir))}}setPersonProperties(e,t){if((e||t)&&this.Mn(`posthog.setPersonProperties`)){var n=Lo(this.get_distinct_id(),e,t);this.un===n?z.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.un=n)}}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:A({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(jr,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else z.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(){var e;(e=this.featureFlags)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.Mn(`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;if(z.info(`reset`),!this.__loaded)return z.uninitializedWarning(`posthog.reset`);var l,u=this.get_property(Tn),d=this.get_property(Ln);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),I(d)||(l=this.persistence)==null||l.register({[Ln]:d}),(r=this.surveys)==null||r.reset(),(i=this.Sn)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(s=this.persistence)==null||s.set_property(cr,Cr),(c=this.sessionManager)==null||c.resetSessionId(),this.un=null,this.config.cookieless_mode===Sr)this.register_once({distinct_id:gr,$device_id:null},``);else{var f=this.config.get_device_id(Kr());this.register_once({distinct_id:f,$device_id:e?f:u},``)}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.On()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Ln()}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(wn)?(z.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.Mn(`posthog.alias`)?(I(t)&&(t=this.get_distinct_id()),e===t?(z.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.Rn(En,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=A({},this.config);if(he(e)){var n,r,i,a,o,s,c,l,u,d,f;H(this.config,ls(e));var p=this.dn();(n=this.persistence)==null||n.update_config(this.config,t,p),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new Ca(A({},this.config,{persistence:`sessionStorage`}),p,!1);var m=this.ln(this.config.debug);xe(m)&&(this.config.debug=m),xe(this.config.debug)&&(this.config.debug?(D.DEBUG=!0,U.O()&&U.N(`ph_debug`,!0),z.info(`set_config`,{config:e,oldConfig:t,newConfig:A({},this.config)})):(D.DEBUG=!1,U.O()&&U.q(`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.Fn(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){D.LIB_NAME=e,D.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(A({},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.An}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??as;return e!==as&&(e=as+`.`+e),e}_isIdentified(){return this.persistence?.get_property(cr)===wr||this.sessionPersistence?.get_property(cr)===wr}En(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===Tr&&!this._isIdentified()&&ge(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[En])&&((t=this.persistence)==null||(t=t.props)==null||!t[mr]))}kn(){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.En()||this.Mn(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Mn(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}Mn(e){return this.config.person_profiles===`never`?(z.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.Rn(mr,!0),!0)}dn(){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!==xr)}Fn(){var e,t,n=this.dn();return this.persistence?.Tr!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.Tr!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==Sr){if(this.en()){var r,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new Po(this),this.pageViewManager=new Xi(this),this.persistence&&(this.sessionPropsManager=new jo(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??e.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.Yi(this.sessionRecording,new o(this)),this._n&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this._n)))}var s;this.consent.optInOut(!0),this.Fn(),this.wn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==xr&&((s=this.surveys)==null||s.loadIfEnabled()),(I(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture(t?.captureEventName??`$opt_in`,t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.xn()}else z.warn(ts)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===Sr?z.warn(ts):(this.config.cookieless_mode===xr&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Fn(),this.config.cookieless_mode===xr&&(this.register({distinct_id:gr,$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.xn(),this.wn()))}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===Sr||(this.config.cookieless_mode===xr?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Fn()}_is_bot(){return _?Fo(_,this.config.custom_blocked_useragents):void 0}xn(){v&&(v.visibilityState===`visible`?this.nn||(this.nn=!0,this.capture(Or,{title:v.title},{send_instantly:!0}),this.sn&&=(v.removeEventListener(Er,this.sn),null)):this.sn||(this.sn=this.xn.bind(this),zr(v,Er,this.sn)))}debug(e){!1===e?(h?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(h?.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}))}Kr(){var e,t,n,r,i,a,o=this.hn||{};return`advanced_disable_flags`in o?!!o.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(z.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=z,i=(t=`advanced_disable_flags`)in(e=o)&&!R(e[t]),a=n in e&&!R(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}Tn(e){if(R(this.config.before_send))return e;var t=F(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),R(n)){var i=`Event '`+e.event+`' was rejected in beforeSend function`;return Ce(e.event)?z.warn(i+`. This can cause unexpected behavior.`):z.info(i),null}n.properties&&!ge(n.properties)||z.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}return n}getPageViewId(){return this.pageViewManager.dr?.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)})}ln(e){var t=xe(e)&&!e,n=U.O()&&U.A(`ph_debug`)===`true`;return!t&&(!!n||e)}};ds.__defaultExtensionClasses={},ds.An={trace:Zo=()=>{},debug:Zo,info:Zo,warn:Zo,error:Zo,fatal:Zo},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Fr(e.prototype[t[n]])}(ds,[`identify`]);var fs=class{constructor(e){this.disabled=!1===e;var t=he(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}},ps=`$copy_autocapture`,ms=B(`[AutoCapture]`);function hs(e,t){return t.length>e?t.slice(0,e)+`...`:t}function gs(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ci(t));return t}function _s(e,t){var n,{e:r,maskAllElementAttributes:i,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:s}=t;if(!ci(e))return{props:{}};for(var c=[e],l=e;l.parentNode&&!li(l,`body`);)if(di(l.parentNode))c.push(l.parentNode.host),l=l.parentNode.host;else{if(!ci(l.parentNode))break;c.push(l.parentNode),l=l.parentNode}var u,d,f=[],p={},m=!1,g=!1;if(V(c,(e=>{var t=ki(e);if(li(e,`a`)){var n=e.getAttribute(`href`);m=t&&!!n&&Li(n)&&n}P(mi(e),`ph-no-capture`)&&(g=!0),f.push(function(e,t,n,r){var i=e.tagName.toLowerCase(),a={tag_name:i};vi.indexOf(i)>-1&&!n&&(a.$el_text=i.toLowerCase()===`a`||i.toLowerCase()===`button`?hs(1024,Ri(e)):hs(1024,gi(e)));var o=mi(e);o.length>0&&(a.classes=o.filter((function(e){return e!==``}))),V(e.attributes,(function(n){var i;if((!Ai(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&Li(n.value)&&(!L(i=n.name)||i.substring(0,10)!==`_ngcontent`&&i.substring(0,7)!==`_nghost`)){var o=n.value;n.name===`class`&&(o=fi(o).join(` `)),a[`attr__`+n.name]=hs(1024,o)}}));for(var s=1,c=1,l=e;l=gs(l);)s++,l.tagName===e.tagName&&c++;return a.nth_child=s,a.nth_of_type=c,a}(e,i,a,o)),H(p,function(e){if(!ki(e))return{};var t={};return V(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&&Li(r)&&(t[n]=r)}})),t}(e))})),g)return{props:{},explicitNoCapture:g};if(a||(f[0].$el_text=li(e,`a`)||li(e,`button`)?Ri(e):gi(e)),m){var _;f[0].attr__href=m;var v=ta(m)?.host,y=h==null||(_=h.location)==null?void 0:_.host;v&&y&&v!==y&&(u=m)}return{props:H({$event_type:r.type,$ce_version:1},s?{}:{$elements:f},{$elements_chain:(d=f,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=A({},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 Nr(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[Bi(t.toString())]=Bi(n.toString())})),(t+=`:`)+Nr(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:Vi(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Nr(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(d)))},(n=f[0])!=null&&n.$el_text?{$el_text:f[0]?.$el_text}:{},u&&r.type===`click`?{$external_click_url:u}:{},p)}}var vs=B(`[ExceptionAutocapture]`);function ys(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return me(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]===i&&(e[t]=r)}}catch{return()=>{}}}var bs=B(`[TracingHeaders]`),xs=B(`[Web Vitals]`),Ss=9e5,Cs=`disabled`,ws=`lazy_loading`,Ts=`awaiting_config`,Es=`missing_config`;B(`[SessionRecording]`),B(`[SessionRecording]`);var Ds=`[SessionRecording]`,Os=B(Ds),ks=B(`[Heatmaps]`);function As(e){return he(e)&&`clientX`in e&&`clientY`in e&&ye(e.clientX)&&ye(e.clientY)}var js=B(`[Product Tours]`),Ms=[`$set_once`,`$set`],Ns=B(`[SiteApps]`),Ps=`Error while initializing PostHog app with config id `;function Fs(e,t,n){if(R(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 Is=class{constructor(e){this.Nn=new Mo,this.Dn=(e,t)=>this.$n(e,t)&&this.qn(e,t)&&this.jn(e,t)&&this.Hn(e,t),this.$n=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.Un=new Set,this.Bn=new Set}init(){var e;I(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!I(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.Bn)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.Un)==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)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.Un.has(e)||this.Un.has(t?.event))&&this.Bn&&this.Bn?.size>0&&this.Bn.forEach((e=>{this.zn(t,e)&&this.Nn.emit(`actionCaptured`,e.name)}))}Vn(e){this.onAction(`actionCaptured`,(t=>e(t)))}zn(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.Dn(e,n))return!0;return!1}onAction(e,t){return this.Nn.on(e,t)}qn(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`||!Fs(r,t.url,t.url_matching||`contains`))return!1}return!0}jn(e,t){return!!this.Wn(e,t)&&!!this.Zn(e,t)&&!!this.Gn(e,t)}Wn(e,t){var n;if(t==null||!t.href)return!0;var r=this.Qn(e);if(r.length>0)return r.some((e=>Fs(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&Fs((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}Zn(e,t){var n;if(t==null||!t.text)return!0;var r=this.Qn(e);if(r.length>0)return r.some((e=>Fs(e.text,t.text,t.text_matching||`exact`)||Fs(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;!R(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=>Fs(e,a,o))))}Gn(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}Qn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}Hn(e,t){return t==null||!t.properties||t.properties.length===0||Bo(t.properties.reduce(((e,t)=>{var n=F(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)}},Ls=class{constructor(e){this._instance=e,this.Jn=new Map,this.Kn=new Map,this.Yn=new Map}Xn(e,t){return!!e&&Bo(e.propertyFilters,t?.properties)}es(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}ts(e,t,n){var r=(n===wa.Activation?this.Jn:this.Kn).get(e),i=[];return this.rs((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.Xn(a,t)}))}register(e){I(this._instance?._addCaptureHook)||(this.ns(e),this.ss(e))}ss(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.os??(this.os=new Is(this._instance),this.os.init(),this.os.Vn((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.os)==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.Yn.get(t.name);n&&n.push(e.id),this.Yn.set(t.name,n||[e.id])}})))})))}ns(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.Jn=this.es(e,wa.Activation),this.Kn=this.es(e,wa.Cancellation))}onEvent(e,t){var n,r=this.le(),i=this.us(),a=this.ls(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[i])||[];if(a===e&&t&&o.length>0){var s,c;r.info(`event matched, removing item from activated items`,{event:e,eventPayload:t,existingActivatedItems:o});var l=(t==null||(s=t.properties)==null?void 0:s.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(l){var u=o.indexOf(l);0>u||(o.splice(u,1),this.hs(o))}}else{if(this.Kn.has(e)){var d=this.ts(e,t,wa.Cancellation);d.length>0&&(r.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.cs(e.id)})),this.hs(o))}if(this.Jn.has(e)){r.info(`event name matched`,{event:e,eventPayload:t,items:this.Jn.get(e)});var f=this.ts(e,t,wa.Activation);this.hs(o.concat(f.map((e=>e.id))||[]))}}}onAction(e){var t,n=this.us(),r=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[];this.Yn.has(e)&&this.hs(r.concat(this.Yn.get(e)||[]))}hs(e){var t=this.le(),n=[...new Set(e)].filter((e=>!this.ds(e)));t.info(`updating activated items`,{activatedItems:n}),this.vs(n)}getActivatedIds(){var e,t=this.us();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Jn}fs(){return this.os}},Rs=class extends Ls{constructor(e){super(e)}us(){return nr}ls(){return Ea.SHOWN}rs(e){var t;(t=this._instance)==null||t.getSurveys(e)}cs(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}le(){return G}vs(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[nr]:e})}ds(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},zs=`SDK is not enabled or survey functionality is not yet loaded`,Bs=`Disabled. Not loading surveys.`,Vs=h!=null&&h.location?ia(h.location.hash,`__posthog`)||ia(location.hash,`state`):null,Hs=`_postHogToolbarParams`,Us=B(`[Toolbar]`),Ws=B(`[FeatureFlags]`),Gs=B(`[FeatureFlags]`,{debugEnabled:!0}),Ks=`" failed. Feature flags didn't load in time.`,qs=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},Js=e=>{var t={};for(var[n,r]of Nr(e||{}))r&&(t[n]=r);return t},Ys=B(`[Error tracking]`),Xs=`Refusing to render web experiment since the viewer is a likely bot`,Zs={icontains:(e,t)=>!!h&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!h&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!h&&Io(t.href,e),not_regex:(e,t)=>!!h&&!Io(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},Qs=class e{get qt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){t===void 0&&(t=!1),n.getWebExperiments((t=>{e.ps(`retrieved web experiments from the server`),n.gs=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;n.gs&&(e.ps(`setting flag key `,t.feature_flag_key,` to web experiment `,t),(r=n.gs)==null||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);L(i)&&t.variants[i]&&n.ys(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var a in t.variants){var o=t.variants[a];e.bs(o)&&n.ys(t.name,a,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())e.ps(Xs);else if(!this.qt.disable_web_experiments){if(R(this.gs))return this.gs=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.ps(`applying feature flags`,t),t.forEach((e=>{var t;if(this.gs&&(t=this.gs)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.gs?.get(e);n&&r!=null&&r.variants[n]&&this.ys(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var t=e.getWindowLocation();if(t!=null&&t.search){var n=na(t?.search,`__experiment_id`),r=na(t?.search,`__experiment_variant`);n&&r&&(e.ps(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this._s(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.qt.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.qt.token),method:`GET`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}_s(t,n,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(e.ps(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.ys(i[0].name,n,i[0].variants[n].transforms))}static bs(t){return!R(t.conditions)&&e.ws(t)&&e.xs(t)}static ws(t){if(R(t.conditions)||R(t.conditions?.url))return!0;var n,r=e.getWindowLocation();return!!r&&((n=t.conditions)==null||!n.url||Zs[t.conditions?.urlMatchType??`icontains`](t.conditions.url,r))}static getWindowLocation(){return h?.location}static xs(e){if(R(e.conditions)||R(e.conditions?.utm))return!0;var t=ua();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 ps(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];z.info(`[WebExperiments] `+e,n)}ys(t,n,r){this._is_bot()?e.ps(Xs):n===`control`?e.ps(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(e.ps(`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 _&&this._instance?Fo(_,this.qt.custom_blocked_useragents):void 0}},$s=B(`[Conversations]`),ec=`Conversations not available yet.`,tc={featureFlags:class{constructor(e){this.Ss=!1,this.ks=!1,this.Cs=!1,this.Is=!1,this.Ts=!1,this.Es=!1,this.Ms=!1,this.Rs=!1,this._instance=e,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get Si(){return this._instance.persistence}Ps(e){return this._instance.get_property(e)}Os(){var e;return(e=this.Si?.Mr(this.qt.feature_flag_cache_ttl_ms))!=null&&e}Ls(){return!!this.Os()&&(this.Rs||this.Cs||(this.Rs=!0,Ws.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}Fs(){var e=this.qt.evaluation_contexts??this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.Ms||(Ws.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.Ms=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||Ws.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}As(){return this.Fs().length>0}Ns(){var e=this.qt.flag_keys;if(!I(e)){if(F(e))return e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||Ws.error(`Invalid flag key found:`,e,`Expected non-empty string`),t}));Ws.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=n!=null&&n.merge?this.getFlagVariants():{},i=n!=null&&n.merge?this.getFlagPayloads():{},a=A({},r,e),o=A({},i,t),s={};for(var[c,l]of Object.entries(a)){var u=typeof l==`string`;s[c]={key:c,enabled:!!u||!!l,variant:u?l:void 0,reason:void 0,metadata:I(o?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:o[c]}}}this.receivedFeatureFlags({flags:s})}get hasLoadedFlags(){return this.ks}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Ps(qn),t=this.Ps(Xn),n=this.Ps(Zn);if(!n&&!t)return e||{};var r=H({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=I(c)?(a=s?.enabled)!=null&&a:!!c,u=I(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=A({},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=A({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.Ss||=(Ws.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getFlagVariants(){var e=this.Ps(Wn),t=this.Ps(Xn);if(!t)return e||{};for(var n=H({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Ss||=(Ws.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.Ps(Jn),t=this.Ps(Zn);if(!t)return e||{};for(var n=H({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Ss||=(Ws.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.Is||this.qt.advanced_disable_feature_flags||this.Ds||(this._instance.rn.emit(`featureFlagsReloading`,!0),this.Ds=setTimeout((()=>{this.$s()}),5))}qs(){clearTimeout(this.Ds),this.Ds=void 0}ensureFlagsLoaded(){this.ks||this.Cs||this.Ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Is=e}$s(e){if(this.qs(),!this._instance.Kr())if(this.Cs)this.Ts=!0;else{var t=this.qt.token,n=this.Ps(Tn),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:A({},this.Si?.get_initial_props()||{},this.Ps(Qn)||{}),group_properties:this.Ps($n),timezone:va()};ve(n)||I(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.qt.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.As()&&(r.evaluation_contexts=this.Fs());var i=this.Ns();I(i)||(r.flag_keys=i);var a=!!this.qt.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.qt.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.Cs=!0,this._instance._send_request({method:`POST`,url:o,data:r,compression:this.qt.disable_compression?void 0:Fa.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,o=!0;if(e.statusCode===200&&(this.Ts||(this.$anon_distinct_id=void 0),o=!1),this.Cs=!1,!r.disable_flags||this.Ts){this.Es=!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.Si)==null||i.register({[or]:s}),c?Ws.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.Ts&&(this.Ts=!1,this.$s()))}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.Es)if(this.ks||this.getFlags()&&this.getFlags().length>0){if(!this.Ls()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else Ws.warn(`getFeatureFlag for key "`+e+Ks)}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.Es)if(this.ks||this.getFlags()&&this.getFlags().length>0){if(!this.Ls()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.Ps(Yn)||void 0,c=this.Ps(sr)||void 0,l=this.Ps(ir)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.Ps(ar);d&&d!==f&&(l={},(u=this.Si)==null||u.register({[ir]:l,[ar]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,_,v,y,b;F(l[e])?l[e].push(o):l[e]=[o],(p=this.Si)==null||p.register({[ir]:l});var x=this.getFeatureFlagDetails(e),S=[...this.Ps(or)??[]];I(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.qt.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.qt.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.Es};I(x==null||(g=x.metadata)==null?void 0:g.version)||(C.$feature_flag_version=x.metadata.version);var w,T=(x==null||(_=x.reason)==null?void 0:_.description)??(x==null||(v=x.reason)==null?void 0:v.code);T&&(C.$feature_flag_reason=T),x!=null&&(y=x.metadata)!=null&&y.id&&(C.$feature_flag_id=x.metadata.id),I(x?.original_variant)&&I(x?.original_enabled)||(C.$feature_flag_original_response=I(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){var E=a;if(!I(a))try{E=JSON.parse(a)}catch{}return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:E}}}}else Ws.warn(`getFeatureFlagResult for key "`+e+Ks)}getRemoteConfigPayload(e,t){var n=this.qt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.As()&&(r.evaluation_contexts=this.Fs());var i=this.Ns();I(i)||(r.flag_keys=i),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.qt.disable_compression?void 0:Fa.Base64,timeout:this.qt.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.Es){if(this.ks||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return I(n)?void 0:!!n}Ws.warn(`isFeatureEnabled for key "`+e+Ks)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.Si){this.ks=!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])))):Ws.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(F(c)){Ws.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({[Gn]:c,[Wn]:f})}else{var m=c,h=l,g=s;if(a!=null&&a.partialResponse)m=A({},n,m),h=A({},r,h),g=A({},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=A({},n,Object.fromEntries(Object.entries(m).filter((e=>{var[t]=e;return _.has(t)})))),h=A({},r,Object.fromEntries(Object.entries(h||{}).filter((e=>{var[t]=e;return _.has(t)})))),g=A({},i,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return _.has(t)}))))}else m=A({},n,m),h=A({},r,h),g=A({},i,g);t&&t.register(A({[Gn]:Object.keys(Js(m)),[Wn]:m||{},[Jn]:h||{},[qn]:g||{}},u?{[Yn]:u}:{},d?{[sr]:d}:{}))}}})(e,this.Si,r,i,a,n),t||(this.Rs=!1),this.js(t)}}override(e,t){t===void 0&&(t=!1),Ws.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Si)return Ws.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.Si.unregister(Xn),this.Si.unregister(Zn),this.js(),Gs.info(`All overrides cleared`);if(F(e)){var t=qs(e);return this.Si.register({[Xn]:t}),this.js(),Gs.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.Ss=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.Si.unregister(Xn),Gs.info(`Flag overrides cleared`);else if(r.flags){if(F(r.flags)){var i=qs(r.flags);this.Si.register({[Xn]:i})}else this.Si.register({[Xn]:r.flags});Gs.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.Si.unregister(Zn),Gs.info(`Payload overrides cleared`)):r.payloads&&(this.Si.register({[Zn]:r.payloads}),Gs.info(`Payload overrides set`,{payloads:r.payloads}))),this.js();return}if(e&&typeof e==`object`)return this.Si.register({[Xn]:e}),this.js(),Gs.info(`Flag overrides set`,{flags:e});Ws.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ks){var{flags:t,flagVariants:n}=this.Hs();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.Ps(Kn)||[]).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=A({},this.getFlagVariants(),{[e]:t});(r=this.Si)==null||r.register({[Gn]:Object.keys(Js(s)),[Wn]:s}),this.js()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.Ps(Kn),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.qt.token+i),method:`GET`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.Si)==null||n.unregister(Kn),(r=this.Si)==null||r.register({[Kn]:i}),e(i)}}})}Hs(){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)),{})}}js(e){var{flags:t,flagVariants:n}=this.Hs();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.Ps(Qn)||{},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({[Qn]:A({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Qn)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.Ps($n)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=A({},n[t],e[t]),delete e[t]})),this._instance.register({[$n]:A({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Ps($n)||{};this._instance.register({[$n]:A({},t,{[e]:{}})})}else this._instance.unregister($n)}reset(){this.ks=!1,this.Cs=!1,this.Is=!1,this.Ts=!1,this.Es=!1,this.$anon_distinct_id=void 0,this.qs(),this.Ss=!1}}},nc={sessionRecording:class{get qt(){return this._instance.config}get Si(){return this._instance.persistence}get started(){var e;return!((e=this.Us)==null||!e.isStarted)}get status(){return this.Bs===Ts||this.Bs===Es?this.Bs:this.Us?.status??this.Bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Bs=Cs,this.zs=void 0,this._instance=e,!this._instance.sessionManager)throw Os.error(`started without valid sessionManager`),Error(Ds+` started without valid sessionManager. This is a bug.`);if(this.qt.cookieless_mode===Sr)throw Error(Ds+` cannot be used with cookieless_mode="always"`)}initialize(){this.startIfEnabledOrStop()}get Vs(){var e,t=!((e=this._instance.get_property(Ln))==null||!e.enabled),n=!this.qt.disable_session_recording,r=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return h&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.Vs||(t=this.Us)==null||!t.isStarted){var n=!I(Object.assign)&&!I(Array.from);this.Vs&&n?(this.Ws(e),Os.info(`starting`)):(this.Bs=Cs,this.stopRecording())}}Ws(e){var t,n,r;this.Vs&&(this.Bs!==Ts&&this.Bs!==Es&&(this.Bs=ws),T!=null&&(t=T.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=T.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Zs(e):(r=T.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Gs,(t=>{if(t)return Os.error(`could not load recorder`,t);this.Zs(e)})))}stopRecording(){var e,t;(e=this.zs)==null||e.call(this),this.zs=void 0,(t=this.Us)==null||t.stop()}Qs(){var e,t;(e=this.zs)==null||e.call(this),this.zs=void 0,(t=this.Us)==null||t.discard()}Js(){var e;(e=this.Si)==null||e.unregister(Un)}Ks(e,t){if(R(e))return null;var n,r=ye(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(Os.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}Ys(e){if(this.Si){var t,n=this.Si,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ks(this.qt.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Ks(t?.sampleRate,`remote config sampleRate`),a=r??i;R(a)&&this.Js();var o=t?.minimumDurationMilliseconds;n.register({[Ln]:A({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:A({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:I(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this.zs)==null||t.call(this),this.zs=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){`sessionRecording`in e?!1===e.sessionRecording?(this.Ys(e),this.Qs()):(this.Ys(e),this.startIfEnabledOrStop()):(this.Bs===Ts&&(this.Bs=Es,Os.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.Us)!=null&&n.log?this.Us.log(e,t):Os.warn(`log called before recorder was ready`)}get Gs(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Ln);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Xs(){var e,t=this._instance.get_property(Ln);if(!t)return!1;try{e=typeof t==`object`?t:JSON.parse(t)}catch(e){return Os.warn(`persisted remote config for session recording is invalid and will be ignored`,e),!1}var n=e.cache_timestamp??Date.now();return 36e5>=Date.now()-n}Zs(e){var t;if((t=T.__PosthogExtensions__)==null||!t.initSessionRecording)return Os.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[yr]:!0});if(this.Us||(this.Us=T.__PosthogExtensions__?.initSessionRecording(this._instance),this.Us._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Xs()){if(this.Bs===Es||this.Bs===Ts)return;this.Bs=Ts,Os.info(`persisted remote config is stale, requesting fresh config before starting`),new Pa(this._instance).load();return}this.Bs=ws,this.Us.start(e)}onRRwebEmit(e){var t;(t=this.Us)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Us||(t=this.Si)==null||t.register({[zn]:!0}),(e=this.Us)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Us||(t=this.Si)==null||t.register({[Rn]:!0}),(e=this.Us)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.Us||(n=this.Si)==null||n.register({[e===`url`?Bn:Vn]:!0}),(t=this.Us)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.Us?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.Us)==null||!n.tryAddCustomEvent(e,t))}}},rc={autocapture:class{constructor(e){this.eo=!1,this.ro=null,this.io=!1,this.instance=e,this.rageclicks=new fs(e.config.rageclick),this.no=null}initialize(){this.startIfEnabled()}get qt(){var e=he(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}so(){if(this.isBrowserSupported()){if(h&&v){var e=e=>{e||=h?.event;try{this.oo(e)}catch(e){ms.error(`Failed to capture event`,e)}};if(zr(v,`submit`,e,{capture:!0}),zr(v,`change`,e,{capture:!0}),zr(v,`click`,e,{capture:!0}),this.qt.capture_copied_text){var t=e=>{e||=h?.event;try{this.oo(e,ps)}catch(e){ms.error(`Failed to capture copy/cut event`,e)}};zr(v,`copy`,t,{capture:!0}),zr(v,`cut`,t,{capture:!0})}}}else ms.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.eo&&(this.so(),this.eo=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.io=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[On]:!!e.autocapture_opt_out}),this.ro=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.no=e}getElementSelectors(e){var t,n=[];return(t=this.no)==null||t.forEach((t=>{(v?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[On];if(ve(this.ro)&&!xe(e)&&!this.instance.Kr())return!1;var t=this.ro??!!e;return!!this.instance.config.autocapture&&!t}oo(e,t){if(t===void 0&&(t=`$autocapture`),this.isEnabled){var n,r=_i(e);ui(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())&&Ei(r,this.instance.config.rageclick)&&this.oo(e,`$rageclick`);var i=t===ps;if(r&&function(e,t,n,r,i){var a,o,s;if(n===void 0&&(n=void 0),!h||Di(e)||(a=n)!=null&&a.url_allowlist&&!pi(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&pi(n.url_ignorelist))return!1;if((s=n)!=null&&s.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:l,targetElementList:u}=Oi(e,r);if(!function(e,t){var n=t?.element_allowlist;if(I(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}(u,n)||!yi(u,n?.css_selector_allowlist))return!1;var d=h.getComputedStyle(e);if(d&&d.getPropertyValue(`cursor`)===`pointer`&&t.type===`click`)return!0;var f=e.tagName.toLowerCase();switch(f){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 l?(i||[`click`]).indexOf(t.type)>=0:(i||[`click`]).indexOf(t.type)>=0&&(vi.indexOf(f)>-1||e.getAttribute(`contenteditable`)===`true`)}}(r,e,this.qt,i,i?[`copy`,`cut`]:void 0)){var{props:a,explicitNoCapture:o}=_s(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.io});if(o)return!1;var s=this.getElementSelectors(r);if(s&&s.length>0&&(a.$element_selectors=s),t===ps){var c,l=hi(h==null||(c=h.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 me(v?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ao=(h==null||(t=h.location)==null?void 0:t.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(z.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.uo&&this.uo(),this.uo=void 0,z.info(`History API monitoring stopped`)}monitorHistoryChanges(){var e,t;if(h&&h.history){var n=this;(e=h.history.pushState)!=null&&e.__posthog_wrapped__||ys(h.history,`pushState`,(e=>function(t,r,i){e.call(this,t,r,i),n.lo(`pushState`)})),(t=h.history.replaceState)!=null&&t.__posthog_wrapped__||ys(h.history,`replaceState`,(e=>function(t,r,i){e.call(this,t,r,i),n.lo(`replaceState`)})),this.ho()}}lo(e){try{var t,n=h==null||(t=h.location)==null?void 0:t.pathname;if(!n)return;n!==this.ao&&this.isEnabled&&this._instance.capture(Or,{navigation_type:e}),this.ao=n}catch(t){z.error(`Error capturing `+e+` pageview`,t)}}ho(){if(!this.uo){var e=()=>{this.lo(`popstate`)};zr(h,`popstate`,e),this.uo=()=>{h&&h.removeEventListener(`popstate`,e)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(e){var t;this.co=!1,this.eo=!1,this.do=null,this.instance=e,this.co=!((t=this.instance.persistence)==null||!t.props[kn]),this.rageclicks=new fs(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return he(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(e=this.qt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return R(this.qt.capture_heatmaps)?R(this.qt.enable_heatmaps)?this.co:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.eo)return;ks.info(`starting...`),this.vo(),this.At()}else clearInterval(this.do??void 0),this.fo(),this.getAndClearBuffer()}onRemoteConfig(e){if(`heatmaps`in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[kn]:t}),this.co=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}po(e){this.Mt(e.originalEvent,`deadclick`)}At(){this.do&&clearInterval(this.do),this.do=v?.visibilityState===`visible`?setInterval(this.ci.bind(this),this.flushIntervalMilliseconds):null}vo(){h&&v&&(this.mo=this.ci.bind(this),zr(h,Dr,this.mo),this.yo=e=>this.Mt(e||h?.event),zr(v,`click`,this.yo,{capture:!0}),this.bo=e=>this._o(e||h?.event),zr(v,`mousemove`,this.bo,{capture:!0}),this.wo=new Gi(this.instance,Ui,this.po.bind(this)),this.wo.startIfEnabledOrStop(),this.xo=this.At.bind(this),zr(v,Er,this.xo),this.eo=!0)}fo(){var e;h&&v&&(this.mo&&h.removeEventListener(Dr,this.mo),this.yo&&v.removeEventListener(`click`,this.yo,{capture:!0}),this.bo&&v.removeEventListener(`mousemove`,this.bo,{capture:!0}),this.xo&&v.removeEventListener(Er,this.xo),clearTimeout(this.So),(e=this.wo)==null||e.stop(),this.eo=!1)}ko(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&&ci(r)&&!li(r,`body`);){if(r===n)return!1;if(P(t,h?.getComputedStyle(r).position))return!0;r=bi(r)}return!1}(_i(e),[`fixed`,`sticky`],i);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:n),target_fixed:a,type:t}}Mt(e,t){var n;if(t===void 0&&(t=`click`),!si(e.target)&&As(e)){var r=this.ko(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&Ei(_i(e),this.instance.config.rageclick)&&this.Co(A({},r,{type:`rageclick`})),this.Co(r)}}_o(e){!si(e.target)&&As(e)&&(clearTimeout(this.So),this.So=setTimeout((()=>{this.Co(this.ko(e,`mousemove`))}),500))}Co(e){if(h){var t=h.location.href,n=this.qt.custom_personal_data_properties,r=ra(t,this.qt.mask_personal_data_properties?[...oa,...n||[]]:[],ca);this.M=this.M||{},this.M[r]||(this.M[r]=[]),this.M[r].push(e)}}ci(){this.M&&!ge(this.M)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Gi,webVitalsAutocapture:class{constructor(e){var t;this.co=!1,this.eo=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Io=()=>{clearTimeout(this.To),this.M.metrics.length!==0&&(this._instance.capture(`$web_vitals`,this.M.metrics.reduce(((e,t)=>A({},e,{[`$web_vitals_`+t.name+`_event`]:A({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.dt=e=>{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t=this.Eo();if(!I(t))if(R(e?.name)||R(e?.value))xs.error(`Invalid metric received`,e);else if(!this.Mo||this.Mo>e.value){this.M.url!==t&&(this.Io(),this.To=setTimeout(this.Io,this.flushToCaptureTimeoutMs)),I(this.M.url)&&(this.M.url=t),this.M.firstMetricTimestamp=I(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0),r=A({},e,{$current_url:t,timestamp:Date.now()});I(n)||(r.$session_id=n.sessionId,r.$window_id=n.windowId),this.M.metrics.push(r),this.M.metrics.length===this.allowedMetrics.length&&this.Io()}else xs.error(`Ignoring metric with value >= `+this.Mo,e)},this.Ro=()=>{if(!this.eo){var e,t,n,r,i=T.__PosthogExtensions__;I(i)||I(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.dt.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.dt.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.dt.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.dt.bind(this)),this.eo=!0):xs.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[Nn]),this.startIfEnabled()}get Po(){return this._instance.config.capture_performance}get allowedMetrics(){var e=he(this.Po)?this.Po?.web_vitals_allowed_metrics:void 0;return R(e)?this._instance.persistence?.props[In]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(he(this.Po)?this.Po.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=he(this.Po)?this.Po.web_vitals_attribution:void 0;return e!=null&&e}get Mo(){var e=he(this.Po)&&ye(this.Po.__web_vitals_max_value)?this.Po.__web_vitals_max_value:Ss;return e>0&&6e4>=e?Ss:e}get isEnabled(){var e=y?.protocol;if(e!==`http:`&&e!==`https:`)return xs.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=he(this.Po)?this.Po.web_vitals:xe(this.Po)?this.Po:void 0;return xe(t)?t:this.co}startIfEnabled(){this.isEnabled&&!this.eo&&(xs.info(`enabled, starting...`),this.lr(this.Ro))}onRemoteConfig(e){if(`capturePerformance`in e){var t=he(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=he(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Nn]:t}),this._instance.persistence.register({[In]:n})),this.co=t,this.startIfEnabled()}}lr(e){var t,n;(t=T.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?`web-vitals-with-attribution`:`web-vitals`,(t=>{t?xs.error(`failed to load script`,t):e()}))}Eo(){var e=h?h.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return ra(e,this._instance.config.mask_personal_data_properties?[...oa,...t||[]]:[],ca)}xs.error(`Could not determine current URL`)}}},ic={exceptionObserver:class{constructor(e){var t;this.Ro=()=>{var e;if(h&&this.isEnabled&&(e=T.__PosthogExtensions__)!=null&&e.errorWrappingFunctions){var t=T.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=T.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=T.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Oo&&this.qt.capture_unhandled_errors&&(this.Oo=t(this.captureException.bind(this))),!this.Lo&&this.qt.capture_unhandled_rejections&&(this.Lo=n(this.captureException.bind(this))),!this.Fo&&this.qt.capture_console_errors&&(this.Fo=r(this.captureException.bind(this)))}catch(e){vs.error(`failed to start`,e),this.Ao()}}},this._instance=e,this.No=!((t=this._instance.persistence)==null||!t.props[An]),this.Do=new je({refillRate:this._instance.config.error_tracking.__exceptionRateLimiterRefillRate??1,bucketSize:this._instance.config.error_tracking.__exceptionRateLimiterBucketSize??10,refillInterval:1e4,Gt:vs}),this.qt=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 he(e)?t=A({},t,e):(I(e)?this.No:e)&&(t=A({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(vs.info(`enabled`),this.Ao(),this.lr(this.Ro)):this.Ao()}lr(e){var t,n;(t=T.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return vs.error(`failed to load script`,t);e()}))}Ao(){var e,t,n;(e=this.Oo)==null||e.call(this),this.Oo=void 0,(t=this.Lo)==null||t.call(this),this.Lo=void 0,(n=this.Fo)==null||n.call(this),this.Fo=void 0}onRemoteConfig(e){`autocaptureExceptions`in e&&(this.No=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[An]:this.No}),this.qt=this.$o(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=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.Do.consumeRateLimit(r)?vs.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.qo=[],this.jo=new Wt([new nn,new pn,new an,new rn,new dn,new un,new sn,new fn],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(`
|
|
3
|
-
`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=tn.test(s)?s.replace(tn,`$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 A({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||Gt});var n}))}(i)}}(`web:javascript`,Zt,en)),this._instance=e,this.qo=this._instance.persistence?.get_property(jn)??[],this.Ho=vn(this.Uo()),this.Bo=new yn(this.Ho)}onConfigChange(){this.Ho=vn(this.Uo()),this.Bo.setConfig(this.Ho)}onRemoteConfig(e){if(`errorTracking`in e){var t=e.errorTracking?.suppressionRules??[],n=e.errorTracking?.captureExtensionExceptions;this.qo=t,this._instance.persistence&&this._instance.persistence.register({[jn]:this.qo,[Mn]:n})}}get zo(){var e,t=!!this._instance.get_property(Mn);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.jo.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.Ho.enabled)try{if(!L(e)||e.trim().length===0)return void Ys.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)=>gn.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this.Vo(t));r.length>0&&Ys.warn(`Ignoring reserved exception step fields`,{droppedKeys:r}),this.Bo.add(A({[mn]:e,[hn]:new Date().toISOString()},n))}catch(e){Ys.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Wo(t)){if(this.Zo(t))return this.Go(`Exception dropped: matched a suppression rule`),void Ys.info(`Skipping exception capture because a suppression rule matched`);if(!this.zo&&this.Qo(t))return this.Go(`Exception dropped: thrown by a browser extension`),void Ys.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Jo(t))return this.Go(`Exception dropped: thrown by the PostHog SDK`),void Ys.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.Ho.enabled&&R(e.$exception_steps)?this.Ko(e):e;try{var r=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,Cn:!0});return r&&this.Bo.clear(),r}catch(e){Ys.error(`Failed to capture exception event. Dropping this exception.`,e),this.Bo.clear();return}}catch(e){Ys.error(`Failed to process exception event. Ignoring this exception.`,e);return}}Ko(e){try{var t=this.Bo.getAttachable();return t.length===0?e:A({},e,{$exception_steps:t})}catch(t){return Ys.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}Go(e){this.Ho.enabled&&this.Bo.add({[mn]:e,[hn]:new Date().toISOString()})}Vo(e){return he(e)?A({},e):{}}Uo(){return this._instance.config.error_tracking?.exception_steps??{}}Zo(e){if(e.length===0)return!1;var t=e.reduce(((e,t)=>{var{type:n,value:r}=t;return L(n)&&n.length>0&&e.$exception_types.push(n),L(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.qo.some((e=>{var n=e.values.map((e=>{var n=Ro[e.operator],r=F(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)}))}Qo(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}Jo(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}Wo(e){return!R(e)&&F(e)}}},ac=A({productTours:class{get Si(){return this._instance.persistence}constructor(e){this.Yo=null,this.Xo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){`productTours`in e&&(this.Si&&this.Si.register({[Fn]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Yo||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(Fn)||this.lr((()=>this.ea()))}lr(e){var t,n;(t=T.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?js.error(`Could not load product tours script`,t):e()}))}ea(){var e;!this.Yo&&(e=T.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Yo=T.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!F(this.Xo)||t){var n=this.Si;if(n){var r=n.props[rr];if(F(r)&&!t)return this.Xo=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=>{var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;js.error(i),e([],{isLoaded:!1,error:i});return}var a=F(t.json.product_tours)?t.json.product_tours:[];this.Xo=a,n&&n.register({[rr]:a}),e(a,{isLoaded:!0})}})}else e(this.Xo,{isLoaded:!0})}getActiveProductTours(e){R(this.Yo)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Yo.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Yo)==null||t.showTourById(e)}previewTour(e){this.Yo?this.Yo.previewTour(e):this.lr((()=>{var t;this.ea(),(t=this.Yo)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Yo)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Yo)==null||e.nextStep()}previousStep(){var e;(e=this.Yo)==null||e.previousStep()}clearCache(){var e;this.Xo=null,(e=this.Si)==null||e.unregister(rr)}resetTour(e){var t;(t=this.Yo)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Yo)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Yo)==null||t.cancelPendingTour(e)}}},tc),oc={siteApps:class{constructor(e){this._instance=e,this.ta=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ra(e,t){if(t){var n=this.globalsForEvent(t);this.ta.push(n),this.ta.length>1e3&&(this.ta=this.ta.slice(10))}}get siteAppLoaders(){var e;return(e=T._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.ra.bind(this));this.ia=()=>{e(),this.ta=[],this.ia=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:A({},j(e,Ms),{properties:A({},e.properties,s?{$set:A({},e.properties?.$set??{},s)}:{},o?{$set_once:A({},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}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.ta.length&&(Ns.info(`Processing `+this.ta.length+` events for site app with id `+e.id),this.ta.forEach((e=>t.processEvent==null?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.ia)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,Ns.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback(e){i(e)}});a&&(t.processEvent=a),r=!0}catch(t){Ns.error(Ps+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){Ns.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}na(){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)}sa(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(t){Ns.error(`Error while processing event `+e.event+` for site app `+n.id,t)}}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.na(),void this._instance.on(`eventCaptured`,(e=>this.sa(e)))):void Ns.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.ia)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(e){var t;T[`__$$ph_site_app_`+e]=i._instance,(t=T.__PosthogExtensions__)==null||t.loadSiteApp==null||t.loadSiteApp(i._instance,s,(t=>{if(t)return Ns.error(Ps+e,t)}))};for(var{id:o,url:s}of e.siteApps)a(o)}else Ns.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}},sc={tracingHeaders:class{constructor(e){this.oa=void 0,this.aa=void 0,this.ua=void 0,this.Ro=()=>{var e,t,n=this.la();n?(I(this.oa)&&(this.oa=(e=T.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),I(this.aa)&&(this.aa=(t=T.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ao()},this._instance=e}initialize(){this.startIfEnabledOrStop()}lr(e){var t,n;(t=T.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return bs.error(`failed to load script`,t);e()}))}ha(){return this._instance.config.tracing_headers??this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}la(){var e=this.ha();return F(e)?(F(this.ua)?this.ua.splice(0,this.ua.length,...e):this.ua=[...e],e.length>0?this.ua:void 0):(F(this.ua)&&this.ua.splice(0),this.ua=e||void 0,this.ua)}Ao(){var e,t;(e=this.oa)==null||e.call(this),(t=this.aa)==null||t.call(this),this.oa=void 0,this.aa=void 0}startIfEnabledOrStop(){this.la()?this.lr(this.Ro):this.Ao()}}},cc=A({surveys:class{get qt(){return this._instance.config}constructor(e){this.ca=void 0,this._surveyManager=null,this.da=!1,this.va=[],this.fa=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qt.disable_surveys){var t=e.surveys;if(R(t))return G.warn(`Flags not loaded yet. Not loading surveys.`);this.ca=F(t)?t.length>0:t,G.info(`flags response received, isSurveysEnabled: `+this.ca),this.loadIfEnabled()}}reset(){localStorage.removeItem(`lastSeenSurveyDate`);for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(Go)||n!=null&&n.startsWith(`inProgressSurvey_`))&&e.push(n)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.da)G.info(`Already initializing surveys, skipping...`);else if(this.qt.disable_surveys)G.info(Bs);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())G.info(`Not loading surveys in cookieless mode without consent.`);else{var e=T?.__PosthogExtensions__;if(e){if(!I(this.ca)||this.qt.advanced_enable_surveys){var t=this.ca||this.qt.advanced_enable_surveys;this.da=!0;try{var n=e.generateSurveys;if(n)return void this.pa(n,t);var r=e.loadExternalDependency;if(!r)return void this.ga(br);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.ga(`Could not load surveys script`,n):this.pa(e.generateSurveys,t)}))}catch(e){throw this.ga(`Error initializing surveys`,e),e}finally{this.da=!1}}}else G.error(`PostHog Extensions not found.`)}}pa(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Rs(this._instance),G.info(`Surveys loaded successfully`),this.ma({isLoaded:!0})}ga(e,t){G.error(e,t),this.ma({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.va.push(e),this._surveyManager&&this.ma({isLoaded:!0}),()=>{this.va=this.va.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.qt.disable_surveys)return G.info(Bs),e([]);var n,r=this._instance.get_property(er);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<`u`&&this.fa?this.fa.then((t=>{var{surveys:n,context:r}=t;return e(n,r)})):(typeof Promise<`u`&&(this.fa=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.qt.token),method:`GET`,timeout:this.qt.surveys_request_timeout_ms,callback:t=>{var r;this.fa=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;G.error(a);var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}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({[er]:c,[tr]:Date.now()});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}ma(e){for(var t of this.va)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){G.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!R(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);G.warn(`init was not called`)}ya(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}ba(e){if(R(this._surveyManager))return{eligible:!1,reason:zs};var t=typeof e==`string`?this.ya(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(R(this._surveyManager))return G.warn(`init was not called`),{visible:!1,disabledReason:zs};var t=this.ba(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return R(this._surveyManager)?(G.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:zs})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.ba(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var r;if(R(this._surveyManager))G.warn(`init was not called`);else{var i=typeof e==`string`?this.ya(e):e;if(i!=null&&i.id)if(Ko.includes(i.type)){var a=v?.querySelector(t);if(a)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(G.info(`Rendering survey `+i.id+` with delay of `+i.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;G.info(`Rendering survey `+i.id+` with delay of `+i.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(i,a,n),G.info(`Survey `+i.id+` rendered`)}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,a,n);G.warn(`Survey element not found`)}else G.warn(`Surveys of type `+i.type+` cannot be rendered in the app`);else G.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(R(this._surveyManager))G.warn(`init was not called`);else{var r=this.ya(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=A({},r,{appearance:A({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Oa.Popover&&t.initialResponses&&G.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 G.warn(`Survey is not eligible to be displayed: `,a.disabledReason)}t.displayType===Oa.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else G.warn(`Survey not found`)}}cancelPendingSurvey(e){R(this._surveyManager)?G.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},tc),lc={toolbar:class{constructor(e){this.instance=e}_a(e){T.ph_toolbar_state=e}wa(){return T.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),Br(this.instance.config)||!h||!v)return!1;e??=h.location,n??=h.history;try{if(!t){try{h.localStorage.setItem(`test`,`test`),h.localStorage.removeItem(`test`)}catch{return!1}t=h?.localStorage}var r,i=Vs||ia(e.hash,`__posthog`)||ia(e.hash,`state`),a=i?Pr((()=>JSON.parse(atob(decodeURIComponent(i)))))||Pr((()=>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(Hs)||`{}`)).source=`localstorage`,delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}xa(e){var t=T.ph_load_toolbar||T.ph_load_editor;!R(t)&&me(t)?t(e,this.instance):Us.warn(`No toolbar load function found`)}loadToolbar(e){var t=!(v==null||!v.getElementById(hr));if(!h||t)return!1;var n=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,r=A({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},n?{instrument:!1}:{});if(h.localStorage.setItem(Hs,JSON.stringify(A({},r,{source:void 0}))),this.wa()===2)this.xa(r);else if(this.wa()===0){var i;this._a(1),(i=T.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return Us.error(`[Toolbar] Failed to load`,e),void this._a(0);this._a(2),this.xa(r)})),zr(h,`turbolinks:load`,(()=>{this._a(0),this.loadToolbar(r)}))}return!0}Sa(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)}}},uc=A({experiments:Qs},tc),dc=A({},tc,nc,rc,ic,ac,oc,cc,sc,lc,uc,{conversations:class{constructor(e){this.ka=void 0,this._conversationsManager=null,this.Ca=!1,this.Ia=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;R(t)||(xe(t)?this.ka=t:(this.ka=t.enabled,this.Ia=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.ka=void 0,this.Ia=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ca||this._instance.config.disable_conversations||Br(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=T?.__PosthogExtensions__;if(e&&!I(this.ka)&&this.ka)if(this.Ia&&this.Ia.token){this.Ca=!0;try{var t=e.initConversations;if(t)return this.Ta(t),void(this.Ca=!1);var n=e.loadExternalDependency;if(!n)return void this.Ea(br);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.Ea(`Could not load conversations script`,t):this.Ta(e.initConversations),this.Ca=!1}))}catch(e){this.Ea(`Error initializing conversations`,e),this.Ca=!1}}else $s.error(`Conversations enabled but missing token in remote config.`)}}Ta(e){if(this.Ia)try{this._conversationsManager=e(this.Ia,this._instance),$s.info(`Conversations loaded successfully`)}catch(e){this.Ea(`Error completing conversations initialization`,e)}else $s.error(`Cannot complete initialization: remote config is null`)}Ea(e,t){$s.error(e,t),this._conversationsManager=null,this.Ca=!1}show(){this._conversationsManager?this._conversationsManager.show():$s.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ka&&!ve(this._conversationsManager)}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return k((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):($s.warn(ec),null)}))()}getMessages(e,t){var n=this;return k((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):($s.warn(ec),null)}))()}markAsRead(e){var t=this;return k((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):($s.warn(ec),null)}))()}getTickets(e){var t=this;return k((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):($s.warn(ec),null)}))()}requestRestoreLink(e){var t=this;return k((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):($s.warn(ec),null)}))()}restoreFromToken(e){var t=this;return k((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):($s.warn(ec),null)}))()}restoreFromUrlToken(){var e=this;return k((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():($s.warn(ec),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}On(){var e;(e=this._conversationsManager)==null||e.setIdentity()}Ln(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.Ma=!1,this.Ra=!1,this.Gt=B(`[logs]`),this.Pa=[],this.Oa=0,this.La=0,this.Fa=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.Ma=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t=e.logs?.captureConsoleLogs;!R(t)&&t&&(this.Ma=!0,this.loadIfEnabled())}reset(){this.Pa=[],this.ii&&=(clearTimeout(this.ii),void 0),this.Oa=0,this.La=0,this.Fa=!1}loadIfEnabled(){if(this.Ma&&!this.Ra){var e=T?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.Gt.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.Ra=!0)})):this.Gt.error(br)}else this.Gt.error(`PostHog Extensions not found.`)}}captureLog(e){if(this._instance.is_capturing())if(e&&e.body){var t=this._instance.config.logs?.flushIntervalMs??3e3,n=this._instance.config.logs?.maxLogsPerInterval??1e3,r=Date.now();if(t>r-this.La||(this.La=r,this.Oa=0,this.Fa=!1),n>this.Oa){this.Oa++;var i=function(e,t){var{text:n,number:r}=zt[e.level||`info`]||Bt,i=String(Date.now())+`000000`,a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),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=A({},a,e.attributes||{}),s={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:Ht(o)};return e.trace_id&&(s.traceId=e.trace_id),e.span_id&&(s.spanId=e.span_id),I(e.trace_flags)||(s.flags=e.trace_flags),s}(e,this.Aa());this.Pa.push({record:i}),(this._instance.config.logs?.maxBufferSize??100)>this.Pa.length?this.Na():this.flushLogs()}else this.Fa||=(this.Gt.warn(`captureLog dropping logs: exceeded `+n+` logs per `+t+`ms`),!0)}else this.Gt.warn(`captureLog requires a body`)}get logger(){return this.Da||={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.Da}flushLogs(e){if(this.ii&&=(clearTimeout(this.ii),void 0),this.Pa.length!==0){var t=this.Pa;this.Pa=[];var n=this._instance.config.logs,r=A({"service.name":n?.serviceName||`unknown_service`},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),i=function(e,t,n,r){return{resourceLogs:[{resource:{attributes:Ht(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}(t.map((e=>e.record)),r,D.LIB_NAME,D.LIB_VERSION),a=this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token);this._instance.fn({method:`POST`,url:a,data:i,compression:`best-available`,batchKey:`logs`,transport:e})}}Na(){this.ii||=setTimeout((()=>{this.ii=void 0,this.flushLogs()}),this._instance.config.logs?.flushIntervalMs??3e3)}Aa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(T!=null&&(e=T.location)!=null&&e.href&&(t.currentUrl=T.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}});ds.__defaultExtensionClasses=A({},dc);var fc=function(){D.SDK_DIST_CHANNEL=`npm`;var e=Qo[as]=new ds;return function(){function e(){e.done||(e.done=!0,os=!1,V(Qo,(function(e){e._dom_loaded()})))}v!=null&&v.addEventListener?v.readyState===`complete`?e():zr(v,`DOMContentLoaded`,e,{capture:!1}):h&&z.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}(),pc=t(l()),mc={trace:null,debug:null,info:`info`,warn:`warn`,error:`error`},hc=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]=r instanceof Error?{name:r.name,message:r.message,stack:r.stack}:r;return t},gc=(e,t,n)=>{let r=mc[e];if(!r)return;let i=fc.logger?.[r];if(i)try{i(t,n?hc(n):void 0)}catch{}},_c=e=>(t,n)=>{n===void 0?pc.default[e](t):pc.default[e](t,n),gc(e,t,n)},vc={trace:_c(`trace`),debug:_c(`debug`),info:_c(`info`),warn:_c(`warn`),error:_c(`error`)},yc=[d.type,f.type,p.type,`https://zup.fail/account-not-found`,`https://zup.fail/project-not-found`,`https://zup.fail/environment-not-found`],bc=`https://zup.fail/api-request-failed`,xc=[`failed to fetch`,`networkerror`,`network request failed`,`load failed`,`the network connection was lost`,`the internet connection appears to be offline`];function Sc(e){if(e instanceof Cc)return e.type===bc;if(e instanceof TypeError){let t=e.message.toLowerCase();return xc.some(e=>t.includes(e))}return!1}var Cc=class extends Error{type;status;detail;instance;traceId;constructor({title:e,type:t,status:n,detail:r,instance:i,traceId:a},o){super(e,o),this.name=`ZuploError`,this.type=t,this.status=n,this.detail=r,this.instance=i,this.traceId=a}},wc=class extends Error{code;type;status;detail;instance;traceId;title;body;constructor(e,t){super(e,t),this.traceId=t?.traceId,this.name=`ZuploApiError`}async tryReadResponse(e){try{this.status=e.status;let t=await e.clone().text();if(t){let e=JSON.parse(t);this.body=e,`code`in e&&typeof e.code==`number`?this.code=e.code:`code`in e&&typeof e.code==`string`&&(this.code=Number(e.code)),`type`in e&&typeof e.type==`string`&&(this.type=e.type),`detail`in e&&typeof e.detail==`string`&&(this.detail=e.detail),`instance`in e&&typeof e.instance==`string`&&(this.instance=e.instance),`title`in e&&typeof e.title==`string`&&(this.title=e.title),`title`in e&&typeof e.title==`string`?this.message=e.title:`message`in e&&typeof e.message==`string`&&(this.message=e.message)}}catch(e){vc.debug(`Failed to parse error response body`,{error:e})}}setTraceId(e){this.traceId=e}};function Tc(e,t){if(e===void 0)throw Error(`Environment variable ${t} was undefined`);return e}var Ec=!1;Tc(`unused`,`VITE_AUTH0_DOMAIN`),Tc(`unused`,`VITE_AUTH0_CLIENT_ID`),Tc(`unused`,`VITE_GITHUB_CLIENT_ID`);var Dc=`/api`,Oc=`openid profile email`,kc=`https://api.zuplo.com/`,K=`/api`,Ac=Tc(`https://cdn.zuplo.com`,`VITE_CDN_URL`),jc=(void 0)?.trim()||`https://mcp-proxy.zuplo.io`,Mc=(void 0)?.trim()||`https://agent-z.zuplo-exp.workers.dev/agent-z/chat`,Nc=`agent-z-api-url-override`,Pc=`_assistantApiUrl`;function Fc(){if(typeof window>`u`)return!1;let{hostname:e}=window.location;return e===`localhost`||e===`127.0.0.1`||e.startsWith(`portal-`)&&e.endsWith(`.zuplosite.com`)||e.endsWith(`.vercel.app`)}function Ic(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`&&t.protocol!==`http:`)return null;let{hostname:n}=t;return n===`localhost`||n===`127.0.0.1`||n===`agent-z.zuplo-exp.workers.dev`||n.endsWith(`-agent-z.zuplo-exp.workers.dev`)?t.href:null}function Lc(){if(!Fc())return null;try{let e=new URLSearchParams(window.location.search);if(e.has(Pc)){let t=e.get(Pc)?.trim()??``;if(!t)return window.sessionStorage.removeItem(Nc),null;let n=Ic(t);if(n)return window.sessionStorage.setItem(Nc,n),n}let t=window.sessionStorage.getItem(Nc);return t?Ic(t):null}catch{return null}}var Rc=Lc()??Mc;Fc()&&(window.setAssistantUrl=e=>{let t=e?.trim();if(!t){window.sessionStorage.removeItem(Nc),window.location.reload();return}let n=Ic(t);if(!n)throw Error(`setAssistantUrl: URL must be http(s) and point at the agent-z worker (…agent-z.zuplo-exp.workers.dev) or localhost`);window.sessionStorage.setItem(Nc,n),window.location.reload()});var zc=[];for(let e=0;e<256;++e)zc.push((e+256).toString(16).slice(1));function Bc(e,t=0){return(zc[e[t+0]]+zc[e[t+1]]+zc[e[t+2]]+zc[e[t+3]]+`-`+zc[e[t+4]]+zc[e[t+5]]+`-`+zc[e[t+6]]+zc[e[t+7]]+`-`+zc[e[t+8]]+zc[e[t+9]]+`-`+zc[e[t+10]]+zc[e[t+11]]+zc[e[t+12]]+zc[e[t+13]]+zc[e[t+14]]+zc[e[t+15]]).toLowerCase()}var Vc,Hc=new Uint8Array(16);function Uc(){if(!Vc){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Vc=crypto.getRandomValues.bind(crypto)}return Vc(Hc)}var Wc={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Gc(e,t,n){if(Wc.randomUUID&&!t&&!e)return Wc.randomUUID();e||={};let r=e.random??e.rng?.()??Uc();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Bc(r)}var Kc,qc=new Promise(e=>{Kc=e});function Jc(e){Kc(e)}function Yc(){return qc}var q=t(o(),1);function Xc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Zc(...e){return t=>{let n=!1,r=e.map(e=>{let r=Xc(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Xc(e[t],null)}}}}function Qc(...e){return q.useCallback(Zc(...e),e)}var $c=r((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})),el=r(((e,t)=>{t.exports=$c()})),J=el();function tl(e,t){let n=q.createContext(t),r=e=>{let{children:t,...r}=e,i=q.useMemo(()=>r,Object.values(r));return(0,J.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=q.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function nl(e,t=[]){let n=[];function r(t,r){let i=q.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=q.useMemo(()=>o,Object.values(o));return(0,J.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=q.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>q.createContext(e));return function(n){let r=n?.[e]||t;return q.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,rl(i,...t)]}function rl(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return q.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function il(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function al(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ol(...e){return t=>{let n=!1,r=e.map(e=>{let r=al(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():al(e[t],null)}}}}function sl(...e){return q.useCallback(ol(...e),e)}function cl(e){let t=q.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];hl(r)&&typeof yl==`function`&&(r=yl(r._payload)),q.Children.forEach(r,e=>{if(pl(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;hl(n)&&typeof yl==`function`&&(n=yl(n._payload)),a=ul(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=q.cloneElement(a,void 0,s):!o&&q.Children.count(r)===1&&q.isValidElement(r)&&(a=r);let c=a?fl(a):void 0,l=sl(n,c);if(!a){if(r||r===0)throw Error(o?vl(e):_l(e));return r}let u=dl(i,a.props??{});return a.type!==q.Fragment&&(u.ref=n?l:c),q.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var ll=Symbol.for(`radix.slottable`),ul=(e,t)=>{if(`child`in e.props){let t=e.props.child;return q.isValidElement(t)?q.cloneElement(t,void 0,e.props.children(t.props.children)):null}return q.isValidElement(t)?t:null};function dl(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function fl(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function pl(e){return q.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ll}var ml=Symbol.for(`react.lazy`);function hl(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ml&&`_payload`in e&&gl(e._payload)}function gl(e){return typeof e==`object`&&!!e&&`then`in e}var _l=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,vl=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,yl=q.use,bl=t(c(),1),xl=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=cl(`Primitive.${t}`),r=q.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,J.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Sl(e,t){e&&bl.flushSync(()=>e.dispatchEvent(t))}function Cl(e){let t=q.useRef(e);return q.useEffect(()=>{t.current=e}),q.useMemo(()=>((...e)=>t.current?.(...e)),[])}function wl(e,t=globalThis?.document){let n=Cl(e);q.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Tl=`DismissableLayer`,El=`dismissableLayer.update`,Dl=`dismissableLayer.pointerDownOutside`,Ol=`dismissableLayer.focusOutside`,kl,Al=q.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jl=q.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=q.useContext(Al),[u,d]=q.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=q.useState({}),m=sl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Pl(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Fl(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return wl(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),q.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(kl=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Il(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=kl))}},[u,f,n,l]),q.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Il())},[u,l]),q.useEffect(()=>{let e=()=>p({});return document.addEventListener(El,e),()=>document.removeEventListener(El,e)},[]),(0,J.jsx)(xl.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:il(e.onFocusCapture,S.onFocusCapture),onBlurCapture:il(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:il(e.onPointerDownCapture,x.onPointerDownCapture)})});jl.displayName=Tl;var Ml=`DismissableLayerBranch`,Nl=q.forwardRef((e,t)=>{let n=q.useContext(Al),r=q.useRef(null),i=sl(t,r);return q.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,J.jsx)(xl.div,{...e,ref:i})});Nl.displayName=Ml;function Pl(e,t=globalThis?.document){let n=Cl(e),r=q.useRef(!1),i=q.useRef(()=>{});return q.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Ll(Dl,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Fl(e,t=globalThis?.document){let n=Cl(e),r=q.useRef(!1);return q.useEffect(()=>{let e=e=>{e.target&&!r.current&&Ll(Ol,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Il(){let e=new CustomEvent(El);document.dispatchEvent(e)}function Ll(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Sl(i,a):i.dispatchEvent(a)}var Rl=jl,zl=Nl,Bl=globalThis?.document?q.useLayoutEffect:()=>{};function Vl(e){let t=q.useRef(e);return q.useEffect(()=>{t.current=e}),q.useMemo(()=>(...e)=>t.current?.(...e),[])}var Hl=q.useInsertionEffect||Bl;function Ul({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Wl({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=q.useRef(e!==void 0);q.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,q.useCallback(t=>{if(s){let n=Gl(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Wl({defaultProp:e,onChange:t}){let[n,r]=q.useState(e),i=q.useRef(n),a=q.useRef(t);return Hl(()=>{a.current=t},[t]),q.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Gl(e){return typeof e==`function`}var Kl=function(e,t){return Kl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Kl(e,t)};function ql(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Kl(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Jl=function(){return Jl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Jl.apply(this,arguments)};function Yl(e,t){this.v=e,this.k=t}function Xl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Y(e,t,n){return(t=function(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ql(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Zl(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if(typeof e==`string`)return Xl(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function eu(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Yl;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}eu.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},eu.prototype.next=function(e){return this._invoke(`next`,e)},eu.prototype.throw=function(e){return this._invoke(`throw`,e)},eu.prototype.return=function(e){return this._invoke(`return`,e)};var tu=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},nu={},ru={};Object.defineProperty(ru,`__esModule`,{value:!0});var iu=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);r===void 0?n===void 0?e.locked.set(t,[]):e.locked.set(t,[n]):n!==void 0&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())})},this.unlock=function(t){var n=e.locked.get(t);if(n!==void 0&&n.length!==0){var r=n.pop();e.locked.set(t,n),r!==void 0&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return e.instance===void 0&&(e.instance=new e),e.instance},e}();ru.default=function(){return iu.getInstance()};var au=tu&&tu.__awaiter||function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,s)}c((r=r.apply(e,t||[])).next())})},ou=tu&&tu.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw TypeError(`Generator is already executing.`);for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||a[0]!==6&&a[0]!==2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},su=tu;Object.defineProperty(nu,`__esModule`,{value:!0});var cu=ru,lu=`browser-tabs-lock-key`,uu={key:function(e){return au(su,void 0,void 0,function(){return ou(this,function(e){throw Error(`Unsupported`)})})},getItem:function(e){return au(su,void 0,void 0,function(){return ou(this,function(e){throw Error(`Unsupported`)})})},clear:function(){return au(su,void 0,void 0,function(){return ou(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return au(su,void 0,void 0,function(){return ou(this,function(e){throw Error(`Unsupported`)})})},setItem:function(e,t){return au(su,void 0,void 0,function(){return ou(this,function(e){throw Error(`Unsupported`)})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function du(e){return new Promise(function(t){return setTimeout(t,e)})}function fu(e){for(var t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz`,n=``,r=0;r<e;r++)n+=t[Math.floor(61*Math.random())];return n}nu.default=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+fu(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,e.waiters===void 0&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return n===void 0&&(n=5e3),au(this,void 0,void 0,function(){var r,i,a,o,s,c,l;return ou(this,function(u){switch(u.label){case 0:r=Date.now()+fu(4),i=Date.now()+n,a=lu+`-`+t,o=this.storageHandler===void 0?uu:this.storageHandler,u.label=1;case 1:return Date.now()<i?[4,du(30)]:[3,8];case 2:return u.sent(),o.getItemSync(a)===null?(s=this.id+`-`+t+`-`+r,[4,du(Math.floor(25*Math.random()))]):[3,5];case 3:return u.sent(),o.setItemSync(a,JSON.stringify({id:this.id,iat:r,timeoutKey:s,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,du(30)];case 4:return u.sent(),(c=o.getItemSync(a))!==null&&(l=JSON.parse(c)).id===this.id&&l.iat===r?(this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(a,r),[2,!0]):[3,7];case 5:return e.lockCorrector(this.storageHandler===void 0?uu:this.storageHandler),[4,this.waitForSomethingToChange(i)];case 6:u.sent(),u.label=7;case 7:return r=Date.now()+fu(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return au(this,void 0,void 0,function(){var n=this;return ou(this,function(r){return setTimeout(function(){return au(n,void 0,void 0,function(){var n,r,i;return ou(this,function(a){switch(a.label){case 0:return[4,cu.default().lock(t)];case 1:return a.sent(),this.acquiredIatSet.has(t)?(n=this.storageHandler===void 0?uu:this.storageHandler,(r=n.getItemSync(e))===null?(cu.default().unlock(t),[2]):((i=JSON.parse(r)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(i)),cu.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(cu.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return au(this,void 0,void 0,function(){return ou(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,i=Date.now(),a=!1;function o(){if(a||=(window.removeEventListener(`storage`,o),e.removeFromWaiting(o),clearTimeout(s),!0),!r){r=!0;var t=50-(Date.now()-i);t>0?setTimeout(n,t):n(null)}}window.addEventListener(`storage`,o),e.addToWaiting(o);var s=setTimeout(o,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),e.waiters!==void 0&&e.waiters.push(t)},e.removeFromWaiting=function(t){e.waiters!==void 0&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){e.waiters!==void 0&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return au(this,void 0,void 0,function(){return ou(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return au(this,void 0,void 0,function(){var n,r,i,a;return ou(this,function(o){switch(o.label){case 0:return n=this.storageHandler===void 0?uu:this.storageHandler,r=lu+`-`+t,(i=n.getItemSync(r))===null?[2]:(a=JSON.parse(i)).id===this.id?[4,cu.default().lock(a.iat)]:[3,2];case 1:o.sent(),this.acquiredIatSet.delete(a.iat),n.removeItemSync(r),cu.default().unlock(a.iat),e.notifyWaiters(),o.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,i=[],a=0;;){var o=r.keySync(a);if(o===null)break;i.push(o),a++}for(var s=!1,c=0;c<i.length;c++){var l=i[c];if(l.includes(lu)){var u=r.getItemSync(l);if(u!==null){var d=JSON.parse(u);(d.timeRefreshed===void 0&&d.timeAcquired<n||d.timeRefreshed!==void 0&&d.timeRefreshed<n)&&(r.removeItemSync(l),s=!0)}}}s&&e.notifyWaiters()},e.waiters=void 0,e}(),new TextEncoder,new TextDecoder,Uint8Array.prototype.toBase64;var pu=tu&&tu.__assign||function(){return pu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pu.apply(this,arguments)},mu;(function(e){e.Code=`code`,e.ConnectCode=`connect_code`})(mu||={});var hu;(function(e){e.Bearer=`Bearer`,e.DPoP=`DPoP`})(hu||={});var gu,_u,vu;(typeof navigator>`u`||(gu=navigator.userAgent)==null||(_u=gu.startsWith)==null||!_u.call(gu,`Mozilla/5.0 `))&&(vu=`oauth4webapi/v3.8.6`);function yu(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}var bu=`ERR_INVALID_ARG_VALUE`,xu=`ERR_INVALID_ARG_TYPE`;function Su(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}var Cu=Symbol(),wu=Symbol(),Tu=Symbol(),Eu=Symbol(),Du=Symbol(),Ou=new TextEncoder,ku=new TextDecoder;function Au(e){return typeof e==`string`?Ou.encode(e):ku.decode(e)}var ju,Mu;if(Uint8Array.prototype.toBase64)ju=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;ju=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join(``)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}}function Nu(e){return typeof e==`string`?Mu(e):ju(e)}Mu=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw Su(`The input to be decoded is not correctly encoded.`,bu,e)}}:e=>{try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw Su(`The input to be decoded is not correctly encoded.`,bu,e)}};var Pu=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`code`,void 0),this.name=this.constructor.name,this.code=Od,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}},Fu=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`code`,void 0),this.name=this.constructor.name,t!=null&&t.code&&(this.code=t?.code),(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}};function X(e,t,n){return new Fu(e,{code:t,cause:n})}function Iu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Lu(e){yu(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e??{});if(vu&&!t.has(`user-agent`)&&t.set(`user-agent`,vu),t.has(`authorization`))throw Su(`"options.headers" must not include the "authorization" header name`,bu);return t}function Ru(e,t){if(t!==void 0){if(typeof t==`function`&&(t=t(e.href)),!(t instanceof AbortSignal))throw Su(`"options.signal" must return or be an instance of AbortSignal`,xu);return t}}function zu(e,t,n,r,i){try{if(typeof e!=`number`||!Number.isFinite(e))throw Su(`${n} must be a number`,xu,i);if(e>0)return;if(t){if(e!==0)throw Su(`${n} must be a non-negative number`,bu,i);return}throw Su(`${n} must be a positive number`,bu,i)}catch(e){throw r?X(e.message,r,i):e}}function Bu(e,t,n,r){try{if(typeof e!=`string`)throw Su(`${t} must be a string`,xu,r);if(e.length===0)throw Su(`${t} must not be empty`,bu,r)}catch(e){throw n?X(e.message,n,r):e}}function Vu(e){(function(e,t){if(ud(e)!==t)throw function(e){let t=`"response" content-type must be `;var n=[...arguments].slice(1);if(n.length>2){let e=n.pop();t+=`${n.join(`, `)}, or ${e}`}else n.length===2?t+=`${n[0]} or ${n[1]}`:t+=n[0];return X(t,jd,e)}(e,t)})(e,`application/json`)}function Hu(e){let t=e?.[wu];return typeof t==`number`&&Number.isFinite(t)?t:0}function Uu(e){let t=e?.[Tu];return typeof t==`number`&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function Wu(){return Math.floor(Date.now()/1e3)}function Gu(e){if(typeof e!=`object`||!e)throw Su(`"as" must be an object`,xu);Bu(e.issuer,`"as.issuer"`)}function Ku(e){if(typeof e!=`object`||!e)throw Su(`"client" must be an object`,xu);Bu(e.client_id,`"client.client_id"`)}function qu(e){return Bu(e,`"clientSecret"`),(t,n,r,i)=>{r.set(`client_id`,n.client_id),r.set(`client_secret`,e)}}var Ju=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function Yu(e,t){if(t&&e.protocol!==`https:`)throw X(`only requests to HTTPS are allowed`,Nd,e);if(e.protocol!==`https:`&&e.protocol!==`http:`)throw X(`only HTTP and HTTPS requests are allowed`,Pd,e)}function Xu(e,t,n,r){let i;if(typeof e!=`string`||!(i=Ju(e)))throw X(`authorization server metadata does not contain a valid ${n?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,e===void 0?Rd:zd,{attribute:n?`mtls_endpoint_aliases.${t}`:t});return Yu(i,r),i}function Zu(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Xu(e.mtls_endpoint_aliases[t],t,n,r):Xu(e[t],t,n,r)}var Qu=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`cause`,void 0),Y(this,`code`,void 0),Y(this,`error`,void 0),Y(this,`status`,void 0),Y(this,`error_description`,void 0),Y(this,`response`,void 0),this.name=this.constructor.name,this.code=Dd,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,`response`,{enumerable:!1,value:t.response}),(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}},$u=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`cause`,void 0),Y(this,`code`,void 0),Y(this,`error`,void 0),Y(this,`error_description`,void 0),this.name=this.constructor.name,this.code=kd,this.cause=t.cause,this.error=t.cause.get(`error`),this.error_description=t.cause.get(`error_description`)??void 0,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}},ed=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`cause`,void 0),Y(this,`code`,void 0),Y(this,`response`,void 0),Y(this,`status`,void 0),this.name=this.constructor.name,this.code=Ed,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,`response`,{enumerable:!1}),(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}},td="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",nd=`(`+td+`)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"`,rd=`(`+td+")\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)",id=RegExp(`^[,\\s]*(`+td+`)`),ad=RegExp(`^[,\\s]*`+nd+`[,\\s]*(.*)`),od=RegExp(`^[,\\s]*`+rd+`[,\\s]*(.*)`),sd=RegExp(`^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)`);async function cd(e,t,n){if(e.status!==t){let t;throw function(e){let t;if(t=function(e){if(!yu(e,Response))throw Su(`"response" must be an instance of Response`,xu);let t=e.headers.get(`www-authenticate`);if(t===null)return;let n=[],r=t;for(;r;){let e=r.match(id),t=e?.[1].toLowerCase();if(!t)return;let s=r.substring(e[0].length);if(s&&!s.match(/^[\s,]/))return;let c=s.match(/^\s+(.*)$/),l=!!c;r=c?c[1]:void 0;let u={},d;if(l)for(;r;){let t,n;if(e=r.match(ad)){var i=$l(e,4);if(t=i[1],n=i[2],r=i[3],n.includes(`\\`))try{n=JSON.parse(`"${n}"`)}catch{}u[t.toLowerCase()]=n}else{if(!(e=r.match(od))){if(e=r.match(sd)){if(Object.keys(u).length)break;var a=$l(e,3);d=a[1],r=a[2];break}return}var o=$l(e,4);t=o[1],n=o[2],r=o[3],u[t.toLowerCase()]=n}}else r=s||void 0;let f={scheme:t,parameters:u};d&&(f.token68=d),n.push(f)}return n.length?n:void 0}(e))throw new ed(`server responded with a challenge in the WWW-Authenticate HTTP Header`,{cause:t,response:e})}(e),(t=await async function(e){if(e.status>399&&e.status<500){Bd(e),Vu(e);try{let t=await e.clone().json();if(Iu(t)&&typeof t.error==`string`&&t.error.length)return t}catch{}}}(e))?(await e.body?.cancel(),new Qu(`server responded with an error in the response body`,{cause:t,response:e})):X(`"response" is not a conform ${n} response (unexpected HTTP status code)`,Md,e)}}function ld(e){if(!yd.has(e))throw Su(`"options.DPoP" is not a valid DPoPHandle`,bu)}function ud(e){return e.headers.get(`content-type`)?.split(`;`)[0]}async function dd(e,t,n,r,i,a,o){return await n(e,t,i,a),a.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`),(o?.[Eu]||fetch)(r.href,{body:i,headers:Object.fromEntries(a.entries()),method:`POST`,redirect:`manual`,signal:Ru(r,o?.signal)})}async function fd(e,t,n,r,i,a){var o;let s=Zu(e,`token_endpoint`,t.use_mtls_endpoint_aliases,!0!==a?.[Cu]);i.set(`grant_type`,r);let c=Lu(a?.headers);c.set(`accept`,`application/json`),a?.DPoP!==void 0&&(ld(a.DPoP),await a.DPoP.addProof(s,c,`POST`));let l=await dd(e,t,n,s,i,c,a);return a==null||(o=a.DPoP)==null||o.cacheNonce(l,s),l}var pd=new WeakMap,md=new WeakMap;function hd(e){if(!e.id_token)return;let t=pd.get(e);if(!t)throw Su(`"ref" was already garbage collected or did not resolve from the proper sources`,bu);return t}async function gd(e,t,n,r,i,a){if(Gu(e),Ku(t),!yu(n,Response))throw Su(`"response" must be an instance of Response`,xu);await cd(n,200,`Token Endpoint`),Bd(n);let o=await qd(n);if(Bu(o.access_token,`"response" body "access_token" property`,Z,{body:o}),Bu(o.token_type,`"response" body "token_type" property`,Z,{body:o}),o.token_type=o.token_type.toLowerCase(),o.expires_in!==void 0){let e=typeof o.expires_in==`number`?o.expires_in:parseFloat(o.expires_in);zu(e,!0,`"response" body "expires_in" property`,Z,{body:o}),o.expires_in=e}if(o.refresh_token!==void 0&&Bu(o.refresh_token,`"response" body "refresh_token" property`,Z,{body:o}),o.scope!==void 0&&typeof o.scope!=`string`)throw X(`"response" body "scope" property must be a string`,Z,{body:o});if(o.id_token!==void 0){Bu(o.id_token,`"response" body "id_token" property`,Z,{body:o});let a=[`aud`,`exp`,`iat`,`iss`,`sub`];!0===t.require_auth_time&&a.push(`auth_time`),t.default_max_age!==void 0&&(zu(t.default_max_age,!0,`"client.default_max_age"`),a.push(`auth_time`)),r!=null&&r.length&&a.push(...r);let s=await async function(e,t,n,r,i){let a,o,s=e.split(`.`),c=s[0],l=s[1],u=s.length;if(u===5){if(i===void 0)throw new Pu(`JWE decryption is not configured`,{cause:e});var d=(e=await i(e)).split(`.`);c=d[0],l=d[1],u=d.length}if(u!==3)throw X(`Invalid JWT`,Z,e);try{a=JSON.parse(Au(Nu(c)))}catch(e){throw X(`failed to parse JWT Header body as base64url encoded JSON`,Ad,e)}if(!Iu(a))throw X(`JWT Header must be a top level object`,Z,e);if(t(a),a.crit!==void 0)throw new Pu(`no JWT "crit" header parameter extensions are supported`,{cause:{header:a}});try{o=JSON.parse(Au(Nu(l)))}catch(e){throw X(`failed to parse JWT Payload body as base64url encoded JSON`,Ad,e)}if(!Iu(o))throw X(`JWT Payload must be a top level object`,Z,e);let f=Wu()+n;if(o.exp!==void 0){if(typeof o.exp!=`number`)throw X(`unexpected JWT "exp" (expiration time) claim type`,Z,{claims:o});if(o.exp<=f-r)throw X(`unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp`,Fd,{claims:o,now:f,tolerance:r,claim:`exp`})}if(o.iat!==void 0&&typeof o.iat!=`number`)throw X(`unexpected JWT "iat" (issued at) claim type`,Z,{claims:o});if(o.iss!==void 0&&typeof o.iss!=`string`)throw X(`unexpected JWT "iss" (issuer) claim type`,Z,{claims:o});if(o.nbf!==void 0){if(typeof o.nbf!=`number`)throw X(`unexpected JWT "nbf" (not before) claim type`,Z,{claims:o});if(o.nbf>f+r)throw X(`unexpected JWT "nbf" (not before) claim value`,Fd,{claims:o,now:f,tolerance:r,claim:`nbf`})}if(o.aud!==void 0&&typeof o.aud!=`string`&&!Array.isArray(o.aud))throw X(`unexpected JWT "aud" (audience) claim type`,Z,{claims:o});return{header:a,claims:o,jwt:e}}(o.id_token,Hd.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,`RS256`),Hu(t),Uu(t),i).then(Sd.bind(void 0,a)).then(vd.bind(void 0,e)).then(_d.bind(void 0,t.client_id)),c=s.claims,l=s.jwt;if(Array.isArray(c.aud)&&c.aud.length!==1){if(c.azp===void 0)throw X(`ID Token "aud" (audience) claim includes additional untrusted audiences`,Id,{claims:c,claim:`aud`});if(c.azp!==t.client_id)throw X(`unexpected ID Token "azp" (authorized party) claim value`,Id,{expected:t.client_id,claims:c,claim:`azp`})}c.auth_time!==void 0&&zu(c.auth_time,!0,`ID Token "auth_time" (authentication time)`,Z,{claims:c}),md.set(n,l),pd.set(o,c)}if(a?.[o.token_type]!==void 0)a[o.token_type](n,o);else if(o.token_type!==`dpop`&&o.token_type!==`bearer`)throw new Pu("unsupported `token_type` value",{cause:{body:o}});return o}function _d(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw X(`unexpected JWT "aud" (audience) claim value`,Id,{expected:e,claims:t.claims,claim:`aud`})}else if(t.claims.aud!==e)throw X(`unexpected JWT "aud" (audience) claim value`,Id,{expected:e,claims:t.claims,claim:`aud`});return t}function vd(e,t){let n=e[Jd]?.call(e,t)??e.issuer;if(t.claims.iss!==n)throw X(`unexpected JWT "iss" (issuer) claim value`,Id,{expected:n,claims:t.claims,claim:`iss`});return t}var yd=new WeakSet,bd=Symbol(),xd={aud:`audience`,c_hash:`code hash`,client_id:`client id`,exp:`expiration time`,iat:`issued at`,iss:`issuer`,jti:`jwt id`,nonce:`nonce`,s_hash:`state hash`,sub:`subject`,ath:`access token hash`,htm:`http method`,htu:`http uri`,cnf:`confirmation`,auth_time:`authentication time`};function Sd(e,t){for(let n of e)if(t.claims[n]===void 0)throw X(`JWT "${n}" (${xd[n]}) claim missing`,Z,{claims:t.claims});return t}var Cd=Symbol(),wd=Symbol();async function Td(e,t,n,r){return typeof r?.expectedNonce==`string`||typeof r?.maxAge==`number`||r!=null&&r.requireIdToken?async function(e,t,n,r,i,a,o){let s=[];switch(r){case void 0:r=Cd;break;case Cd:break;default:Bu(r,`"expectedNonce" argument`),s.push(`nonce`)}switch(i??=t.default_max_age,i){case void 0:i=wd;break;case wd:break;default:zu(i,!0,`"maxAge" argument`),s.push(`auth_time`)}let c=await gd(e,t,n,s,a,o);Bu(c.id_token,`"response" body "id_token" property`,Z,{body:c});let l=hd(c);if(i!==wd){let e=Wu()+Hu(t),n=Uu(t);if(l.auth_time+i<e-n)throw X(`too much time has elapsed since the last End-User authentication`,Fd,{claims:l,now:e,tolerance:n,claim:`auth_time`})}if(r===Cd){if(l.nonce!==void 0)throw X(`unexpected ID Token "nonce" claim value`,Id,{expected:void 0,claims:l,claim:`nonce`})}else if(l.nonce!==r)throw X(`unexpected ID Token "nonce" claim value`,Id,{expected:r,claims:l,claim:`nonce`});return c}(e,t,n,r.expectedNonce,r.maxAge,r[Du],r.recognizedTokenTypes):async function(e,t,n,r,i){let a=await gd(e,t,n,void 0,r,i),o=hd(a);if(o){if(t.default_max_age!==void 0){zu(t.default_max_age,!0,`"client.default_max_age"`);let e=Wu()+Hu(t),n=Uu(t);if(o.auth_time+t.default_max_age<e-n)throw X(`too much time has elapsed since the last End-User authentication`,Fd,{claims:o,now:e,tolerance:n,claim:`auth_time`})}if(o.nonce!==void 0)throw X(`unexpected ID Token "nonce" claim value`,Id,{expected:void 0,claims:o,claim:`nonce`})}return a}(e,t,n,r?.[Du],r?.recognizedTokenTypes)}var Ed=`OAUTH_WWW_AUTHENTICATE_CHALLENGE`,Dd=`OAUTH_RESPONSE_BODY_ERROR`,Od=`OAUTH_UNSUPPORTED_OPERATION`,kd=`OAUTH_AUTHORIZATION_RESPONSE_ERROR`,Ad=`OAUTH_PARSE_ERROR`,Z=`OAUTH_INVALID_RESPONSE`,jd=`OAUTH_RESPONSE_IS_NOT_JSON`,Md=`OAUTH_RESPONSE_IS_NOT_CONFORM`,Nd=`OAUTH_HTTP_REQUEST_FORBIDDEN`,Pd=`OAUTH_REQUEST_PROTOCOL_FORBIDDEN`,Fd=`OAUTH_JWT_TIMESTAMP_CHECK_FAILED`,Id=`OAUTH_JWT_CLAIM_COMPARISON_FAILED`,Ld=`OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED`,Rd=`OAUTH_MISSING_SERVER_METADATA`,zd=`OAUTH_INVALID_SERVER_METADATA`;function Bd(e){if(e.bodyUsed)throw Su(`"response" body has been used already`,bu)}async function Vd(e){if(e.method!==`POST`)throw Su(`form_post responses are expected to use the POST method`,bu,{cause:e});if(ud(e)!==`application/x-www-form-urlencoded`)throw Su(`form_post responses are expected to use the application/x-www-form-urlencoded content-type`,bu,{cause:e});return async function(e){if(e.bodyUsed)throw Su(`form_post Request instances must contain a readable body`,bu,{cause:e});return e.text()}(e)}function Hd(e,t,n,r){if(e===void 0)if(Array.isArray(t)){if(!t.includes(r.alg))throw X(`unexpected JWT "alg" header parameter`,Z,{header:r,expected:t,reason:`authorization server metadata`})}else{if(n===void 0)throw X(`missing client or server configuration to verify used JWT "alg" header parameter`,void 0,{client:e,issuer:t,fallback:n});if(typeof n==`string`?r.alg!==n:typeof n==`function`?!n(r.alg):!n.includes(r.alg))throw X(`unexpected JWT "alg" header parameter`,Z,{header:r,expected:n,reason:`default value`})}else if(typeof e==`string`?r.alg!==e:!e.includes(r.alg))throw X(`unexpected JWT "alg" header parameter`,Z,{header:r,expected:e,reason:`client configuration`})}function Ud(e,t){let n=e.getAll(t),r=n[0];if(n.length>1)throw X(`"${t}" parameter must be provided only once`,Z);return r}var Wd=Symbol(),Gd=Symbol();function Kd(e,t,n,r){if(Gu(e),Ku(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Su(`"parameters" must be an instance of URLSearchParams, or URL`,xu);if(Ud(n,`response`))throw X(`"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()`,Z,{parameters:n});let i=Ud(n,`iss`),a=Ud(n,`state`);if(!i&&e.authorization_response_iss_parameter_supported)throw X(`response parameter "iss" (issuer) missing`,Z,{parameters:n});if(i&&i!==e.issuer)throw X(`unexpected "iss" (issuer) response parameter value`,Z,{expected:e.issuer,parameters:n});switch(r){case void 0:case Gd:if(a!==void 0)throw X(`unexpected "state" response parameter encountered`,Z,{expected:void 0,parameters:n});break;case Wd:break;default:if(Bu(r,`"expectedState" argument`),a!==r)throw X(a===void 0?`response parameter "state" missing`:`unexpected "state" response parameter value`,Z,{expected:r,parameters:n})}if(Ud(n,`error`))throw new $u(`authorization response from the server is an error`,{cause:n});let o=Ud(n,`id_token`),s=Ud(n,`token`);if(o!==void 0||s!==void 0)throw new Pu(`implicit and hybrid flows are not supported`);return c=new URLSearchParams(n),yd.add(c),c;var c}async function qd(e){let t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vu;try{t=await e.json()}catch(t){throw n(e),X(`failed to parse "response" body as JSON`,Ad,t)}if(!Iu(t))throw X(`"response" body must be a top level object`,Z,{body:t});return t}var Jd=Symbol();new TextEncoder,new TextDecoder;var Yd=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`code`,`ERR_JOSE_GENERIC`),this.name=this.constructor.name,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}};Y(Yd,`code`,`ERR_JOSE_GENERIC`),Y(class extends Yd{constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`unspecified`,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`unspecified`;super(e,{cause:{claim:n,reason:r,payload:t}}),Y(this,`code`,`ERR_JWT_CLAIM_VALIDATION_FAILED`),Y(this,`claim`,void 0),Y(this,`reason`,void 0),Y(this,`payload`,void 0),this.claim=n,this.reason=r,this.payload=t}},`code`,`ERR_JWT_CLAIM_VALIDATION_FAILED`),Y(class extends Yd{constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`unspecified`,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`unspecified`;super(e,{cause:{claim:n,reason:r,payload:t}}),Y(this,`code`,`ERR_JWT_EXPIRED`),Y(this,`claim`,void 0),Y(this,`reason`,void 0),Y(this,`payload`,void 0),this.claim=n,this.reason=r,this.payload=t}},`code`,`ERR_JWT_EXPIRED`),Y(class extends Yd{constructor(){super(...arguments),Y(this,`code`,`ERR_JOSE_ALG_NOT_ALLOWED`)}},`code`,`ERR_JOSE_ALG_NOT_ALLOWED`),Y(class extends Yd{constructor(){super(...arguments),Y(this,`code`,`ERR_JOSE_NOT_SUPPORTED`)}},`code`,`ERR_JOSE_NOT_SUPPORTED`),Y(class extends Yd{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`decryption operation failed`,arguments.length>1?arguments[1]:void 0),Y(this,`code`,`ERR_JWE_DECRYPTION_FAILED`)}},`code`,`ERR_JWE_DECRYPTION_FAILED`),Y(class extends Yd{constructor(){super(...arguments),Y(this,`code`,`ERR_JWE_INVALID`)}},`code`,`ERR_JWE_INVALID`),Y(class extends Yd{constructor(){super(...arguments),Y(this,`code`,`ERR_JWS_INVALID`)}},`code`,`ERR_JWS_INVALID`),Y(class extends Yd{constructor(){super(...arguments),Y(this,`code`,`ERR_JWT_INVALID`)}},`code`,`ERR_JWT_INVALID`),Y(class extends Yd{constructor(){super(...arguments),Y(this,`code`,`ERR_JWK_INVALID`)}},`code`,`ERR_JWK_INVALID`),Y(class extends Yd{constructor(){super(...arguments),Y(this,`code`,`ERR_JWKS_INVALID`)}},`code`,`ERR_JWKS_INVALID`),Y(class extends Yd{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`no applicable key found in the JSON Web Key Set`,arguments.length>1?arguments[1]:void 0),Y(this,`code`,`ERR_JWKS_NO_MATCHING_KEY`)}},`code`,`ERR_JWKS_NO_MATCHING_KEY`),Y(class extends Yd{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`multiple matching keys found in the JSON Web Key Set`,arguments.length>1?arguments[1]:void 0),Y(this,Symbol.asyncIterator,void 0),Y(this,`code`,`ERR_JWKS_MULTIPLE_MATCHING_KEYS`)}},`code`,`ERR_JWKS_MULTIPLE_MATCHING_KEYS`),Y(class extends Yd{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`request timed out`,arguments.length>1?arguments[1]:void 0),Y(this,`code`,`ERR_JWKS_TIMEOUT`)}},`code`,`ERR_JWKS_TIMEOUT`),Y(class extends Yd{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`signature verification failed`,arguments.length>1?arguments[1]:void 0),Y(this,`code`,`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`)}},`code`,`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`);var Xd,Zd,Qd,$d;(typeof navigator>`u`||(Xd=navigator.userAgent)==null||(Zd=Xd.startsWith)==null||!Zd.call(Xd,`Mozilla/5.0 `))&&($d=`openid-client/v6.8.4`,Qd={"user-agent":$d});var ef=e=>tf.get(e),tf,nf;function rf(e){return e===void 0?(nf||=new WeakMap,(e,t,n,r)=>{let i;return(i=nf.get(t))||(function(e,t){if(typeof e!=`string`)throw cf(`${t} must be a string`,sf);if(e.length===0)throw cf(`${t} must not be empty`,of)}(t.client_secret,`"metadata.client_secret"`),i=qu(t.client_secret),nf.set(t,i)),i(e,t,n,r)}):qu(e)}var af=Eu,of=`ERR_INVALID_ARG_VALUE`,sf=`ERR_INVALID_ARG_TYPE`;function cf(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}var lf=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`code`,void 0),this.name=this.constructor.name,this.code=t?.code,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}};function uf(e,t,n){return new lf(e,{cause:t,code:n})}function df(e){if(e instanceof TypeError||e instanceof lf||e instanceof Qu||e instanceof $u||e instanceof ed)throw e;if(e instanceof Fu)switch(e.code){case Nd:throw uf(`only requests to HTTPS are allowed`,e,e.code);case Pd:throw uf(`only requests to HTTP or HTTPS are allowed`,e,e.code);case Md:throw uf(`unexpected HTTP response status code`,e.cause,e.code);case jd:throw uf(`unexpected response content-type`,e.cause,e.code);case Ad:throw uf(`parsing error occured`,e,e.code);case Z:throw uf(`invalid response encountered`,e,e.code);case Id:throw uf(`unexpected JWT claim value encountered`,e,e.code);case Ld:throw uf(`unexpected JSON attribute value encountered`,e,e.code);case Fd:throw uf(`JWT timestamp claim value failed validation`,e,e.code);default:throw uf(e.message,e,e.code)}if(e instanceof Pu)throw uf(`unsupported operation`,e,e.code);if(e instanceof DOMException)switch(e.name){case`OperationError`:throw uf(`runtime operation error`,e,Od);case`NotSupportedError`:throw uf(`runtime unsupported operation`,e,Od);case`TimeoutError`:throw uf(`operation timed out`,e,`OAUTH_TIMEOUT`);case`AbortError`:throw uf(`operation aborted`,e,`OAUTH_ABORT`)}throw new lf(`something went wrong`,{cause:e})}new TextDecoder;var ff=Symbol(),pf=class{constructor(e,t,n,r){if(typeof t!=`string`||!t.length)throw cf(`"clientId" must be a non-empty string`,sf);if(typeof n==`string`&&(n={client_secret:n}),n?.client_id!==void 0&&t!==n.client_id)throw cf(`"clientId" and "metadata.client_id" must be the same`,of);let i=Ql(Ql({},structuredClone(n)),{},{client_id:t}),a;i[wu]=n?.[wu]??0,i[Tu]=n?.[Tu]??30,a=r||(typeof i.client_secret==`string`&&i.client_secret.length?rf(i.client_secret):(e,t,n,r)=>{n.set(`client_id`,t.client_id)});let o=Object.freeze(i),s=structuredClone(e);ff in e&&(s[Jd]=t=>{let n=t.claims.tid;return e.issuer.replace(`{tenantid}`,n)});let c=Object.freeze(s);tf||=new WeakMap,tf.set(this,{__proto__:null,as:c,c:o,auth:a,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(ef(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`S256`;return!0===e.code_challenge_methods_supported?.includes(t)}}}}(e))}(e),e}clientMetadata(){return structuredClone(ef(this).c)}get timeout(){return ef(this).timeout}set timeout(e){ef(this).timeout=e}get[af](){return ef(this).fetch}set[af](e){ef(this).fetch=e}};function mf(e){Object.defineProperties(e,function(e){let t;if(e.expires_in!==void 0){let n=new Date;n.setSeconds(n.getSeconds()+e.expires_in),t=n.getTime()}return{expiresIn:{__proto__:null,value(){if(t){let e=Date.now();return t>e?Math.floor((t-e)/1e3):0}}},claims:{__proto__:null,value(){try{return hd(this)}catch{return}}}}}(e))}async function hf(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=e.headers.get(`retry-after`)?.trim();if(i===void 0)return;let a;if(/^\d+$/.test(i))a=parseInt(i,10);else{let e=new Date(i);if(Number.isFinite(e.getTime())){let t=new Date,n=e.getTime()-t.getTime();n>0&&(a=Math.ceil(n/1e3))}}if(r&&!Number.isFinite(a))throw new Fu(`invalid Retry-After header value`,{cause:e});a>t&&await gf(a-t,n)}function gf(e,t){return new Promise((n,r)=>{let i=e=>{try{t.throwIfAborted()}catch(e){r(e);return}if(e<=0)return void n();let a=Math.min(e,5);setTimeout(()=>i(e-a),1e3*a)};i(e)})}async function _f(e,t,n,r){Cf(e),n=new URLSearchParams(n);let i=t.interval??5,a=r?.signal??AbortSignal.timeout(1e3*t.expires_in);try{await gf(i,a)}catch(e){df(e)}let o=ef(e),s=o.as,c=o.c,l=o.auth,u=o.fetch,d=o.tlsOnly,f=o.nonRepudiation,p=o.timeout,m=o.decrypt,h=(i,o)=>_f(e,Ql(Ql({},t),{},{interval:i}),n,Ql(Ql({},r),{},{signal:a,flag:o})),g=function(e,t){let n=wf(t);if(!n)return{signal:e,cleanup(){}};let r=new AbortController,i=e=>{let t=e.target;r.abort(t.reason)};return e.aborted?r.abort(e.reason):n.aborted?r.abort(n.reason):(e.addEventListener(`abort`,i,{once:!0}),n.addEventListener(`abort`,i,{once:!0})),{signal:r.signal,cleanup(){e.removeEventListener(`abort`,i),n.removeEventListener(`abort`,i)}}}(a,p),_=await async function(e,t,n,r,i){Gu(e),Ku(t),Bu(r,`"authReqId"`);let a=new URLSearchParams(i?.additionalParameters);return a.set(`auth_req_id`,r),fd(e,t,n,`urn:openid:params:grant-type:ciba`,a,i)}(s,c,l,t.auth_req_id,{[Eu]:u,[Cu]:!d,additionalParameters:n,DPoP:r?.DPoP,headers:new Headers(Qd),signal:g.signal}).catch(df).finally(g.cleanup);if(_.status===503&&_.headers.has(`retry-after`))return await hf(_,i,a,!0),await _.body?.cancel(),h(i);let v=async function(e,t,n,r){return gd(e,t,n,void 0,r?.[Du],r?.recognizedTokenTypes)}(s,c,_,{[Du]:m}),y;try{y=await v}catch(e){if(Tf(e,r))return h(i,Ef);if(e instanceof Qu)switch(e.error){case`slow_down`:i+=5;case`authorization_pending`:return await hf(e.response,i,a),h(i)}df(e)}return y.id_token&&await f?.(_),mf(y),y}async function vf(e,t,n,r,i){if(Cf(e),!(i?.flag===Ef||t instanceof URL||function(e,t){try{return Object.getPrototypeOf(e)[Symbol.toStringTag]===t}catch{return!1}}(t,`Request`)))throw cf(`"currentUrl" must be an instance of URL, or Request`,sf);let a,o,s=ef(e),c=s.as,l=s.c,u=s.auth,d=s.fetch,f=s.tlsOnly,p=s.jarm,m=s.hybrid,h=s.nonRepudiation,g=s.timeout,_=s.decrypt,v=s.implicit;if(i?.flag===Ef)a=i.authResponse,o=i.redirectUri;else{if(!(t instanceof URL)){let e=t;switch(t=new URL(t.url),e.method){case`GET`:break;case`POST`:let n=new URLSearchParams(await Vd(e));if(m)t.hash=n.toString();else for(let e of n.entries()){var y=$l(e,2);let n=y[0],r=y[1];t.searchParams.append(n,r)}break;default:throw cf(`unexpected Request HTTP method`,of)}}switch(o=function(e){return(e=new URL(e)).search=``,e.hash=``,e.href}(t),!0){case!!p:a=await p(t,n?.expectedState);break;case!!m:a=await m(t,n?.expectedNonce,n?.expectedState,n?.maxAge);break;case!!v:throw TypeError(`authorizationCodeGrant() cannot be used by response_type=id_token clients`);default:try{a=Kd(c,l,t.searchParams,n?.expectedState)}catch(e){df(e)}}}let b=await async function(e,t,n,r,i,a,o){if(Gu(e),Ku(t),!yd.has(r))throw Su(`"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()`,bu);Bu(i,`"redirectUri"`);let s=Ud(r,`code`);if(!s)throw X(`no authorization code in "callbackParameters"`,Z);let c=new URLSearchParams(o?.additionalParameters);return c.set(`redirect_uri`,i),c.set(`code`,s),a!==bd&&(Bu(a,`"codeVerifier"`),c.set(`code_verifier`,a)),fd(e,t,n,`authorization_code`,c,o)}(c,l,u,a,o,n?.pkceCodeVerifier||bd,{additionalParameters:r,[Eu]:d,[Cu]:!f,DPoP:i?.DPoP,headers:new Headers(Qd),signal:wf(g)}).catch(df);typeof n?.expectedNonce!=`string`&&typeof n?.maxAge!=`number`||(n.idTokenExpected=!0);let x=Td(c,l,b,{expectedNonce:n?.expectedNonce,maxAge:n?.maxAge,requireIdToken:n?.idTokenExpected,[Du]:_}),S;try{S=await x}catch(t){if(Tf(t,i))return vf(e,void 0,n,r,Ql(Ql({},i),{},{flag:Ef,authResponse:a,redirectUri:o}));df(t)}return S.id_token&&await h?.(b),mf(S),S}async function yf(e,t,n,r){Cf(e),n=new URLSearchParams(n);let i=ef(e),a=i.as,o=i.c,s=i.auth,c=i.fetch,l=i.tlsOnly,u=i.nonRepudiation,d=i.timeout,f=i.decrypt,p=await async function(e,t,n,r,i){Gu(e),Ku(t),Bu(r,`"refreshToken"`);let a=new URLSearchParams(i?.additionalParameters);return a.set(`refresh_token`,r),fd(e,t,n,`refresh_token`,a,i)}(a,o,s,t,{[Eu]:c,[Cu]:!l,additionalParameters:n,DPoP:r?.DPoP,headers:new Headers(Qd),signal:wf(d)}).catch(df),m=async function(e,t,n,r){return gd(e,t,n,void 0,r?.[Du],r?.recognizedTokenTypes)}(a,o,p,{[Du]:f}),h;try{h=await m}catch(i){if(Tf(i,r))return yf(e,t,n,Ql(Ql({},r),{},{flag:Ef}));df(i)}return h.id_token&&await u?.(p),mf(h),h}async function bf(e,t,n){Cf(e),t=new URLSearchParams(t);let r=ef(e),i=r.as,a=r.c,o=r.auth,s=r.fetch,c=r.tlsOnly,l=r.timeout,u=async function(e,t,n,r){return gd(e,t,n,void 0,r?.[Du],r?.recognizedTokenTypes)}(i,a,await async function(e,t,n,r,i){return Gu(e),Ku(t),fd(e,t,n,`client_credentials`,new URLSearchParams(r),i)}(i,a,o,t,{[Eu]:s,[Cu]:!c,DPoP:n?.DPoP,headers:new Headers(Qd),signal:wf(l)}).catch(df)),d;try{d=await u}catch(r){if(Tf(r,n))return bf(e,t,Ql(Ql({},n),{},{flag:Ef}));df(r)}return mf(d),d}function xf(e,t){Cf(e);let n=ef(e),r=n.as,i=n.c,a=n.tlsOnly,o=n.hybrid,s=n.jarm,c=n.implicit,l=Zu(r,`authorization_endpoint`,!1,a);if((t=new URLSearchParams(t)).has(`client_id`)||t.set(`client_id`,i.client_id),!t.has(`request_uri`)&&!t.has(`request`)){if(t.has(`response_type`)||t.set(`response_type`,o?`code id_token`:c?`id_token`:`code`),c&&!t.has(`nonce`))throw cf(`response_type=id_token clients must provide a nonce parameter in their authorization request parameters`,of);s&&t.set(`response_mode`,`jwt`)}for(let e of t.entries()){var u=$l(e,2);let t=u[0],n=u[1];l.searchParams.append(t,n)}return l}async function Sf(e,t,n){Cf(e);let r=xf(e,t),i=ef(e),a=i.as,o=i.c,s=i.auth,c=i.fetch,l=i.tlsOnly,u=i.timeout,d=async function(e,t,n){if(Gu(e),Ku(t),!yu(n,Response))throw Su(`"response" must be an instance of Response`,xu);await cd(n,201,`Pushed Authorization Request Endpoint`),Bd(n);let r=await qd(n);Bu(r.request_uri,`"response" body "request_uri" property`,Z,{body:r});let i=typeof r.expires_in==`number`?r.expires_in:parseFloat(r.expires_in);return zu(i,!0,`"response" body "expires_in" property`,Z,{body:r}),r.expires_in=i,r}(a,o,await async function(e,t,n,r,i){var a;Gu(e),Ku(t);let o=Zu(e,`pushed_authorization_request_endpoint`,t.use_mtls_endpoint_aliases,!0!==i?.[Cu]),s=new URLSearchParams(r);s.set(`client_id`,t.client_id);let c=Lu(i?.headers);c.set(`accept`,`application/json`),i?.DPoP!==void 0&&(ld(i.DPoP),await i.DPoP.addProof(o,c,`POST`));let l=await dd(e,t,n,o,s,c,i);return i==null||(a=i.DPoP)==null||a.cacheNonce(l,o),l}(a,o,s,r.searchParams,{[Eu]:c,[Cu]:!l,DPoP:n?.DPoP,headers:new Headers(Qd),signal:wf(u)}).catch(df)),f;try{f=await d}catch(r){if(Tf(r,n))return Sf(e,t,Ql(Ql({},n),{},{flag:Ef}));df(r)}return xf(e,{request_uri:f.request_uri})}function Cf(e){if(!(e instanceof pf))throw cf(`"config" must be an instance of Configuration`,sf);if(Object.getPrototypeOf(e)!==pf.prototype)throw cf(`subclassing Configuration is not allowed`,of)}function wf(e){return e?AbortSignal.timeout(1e3*e):void 0}function Tf(e,t){return!(t==null||!t.DPoP||t.flag===Ef)&&function(e){if(e instanceof ed){let t=e.cause,n=t[0];return t.length===1&&n.scheme===`dpop`&&n.parameters.error===`use_dpop_nonce`}return e instanceof Qu&&e.error===`use_dpop_nonce`}(e)}Object.freeze(pf.prototype);var Ef=Symbol();async function Df(e,t,n,r){Cf(e);let i=ef(e),a=i.as,o=i.c,s=i.auth,c=i.fetch,l=i.tlsOnly,u=i.timeout,d=i.decrypt,f=i.nonRepudiation,p=await async function(e,t,n,r,i,a){return Gu(e),Ku(t),Bu(r,`"grantType"`),fd(e,t,n,r,new URLSearchParams(i),a)}(a,o,s,t,new URLSearchParams(n),{[Eu]:c,[Cu]:!l,DPoP:r?.DPoP,headers:new Headers(Qd),signal:wf(u)}).catch(df),m;t===`urn:ietf:params:oauth:grant-type:token-exchange`&&(m={n_a:()=>{}});let h=async function(e,t,n,r){return gd(e,t,n,void 0,r?.[Du],r?.recognizedTokenTypes)}(a,o,p,{[Du]:d,recognizedTokenTypes:m}),g;try{g=await h}catch(i){if(Tf(i,r))return Df(e,t,n,Ql(Ql({},r),{},{flag:Ef}));df(i)}return g.id_token&&await f?.(p),mf(g),g}var Of,kf;typeof navigator>`u`||(Of=navigator.userAgent)==null||(kf=Of.startsWith)==null||kf.call(Of,`Mozilla/5.0 `),Object.freeze(new Set([`grant_type`,`client_id`,`client_secret`,`client_assertion`,`client_assertion_type`,`subject_token`,`subject_token_type`,`requested_token_type`,`actor_token`,`actor_token_type`,`audience`,`aud`,`resource`,`resources`,`resource_indicator`,`scope`,`connection`,`login_hint`,`organization`,`assertion`]));var Af={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},Q=function(){throw Error(`You forgot to wrap your component in <Auth0Provider>.`)},jf=Jl(Jl({},Af),{buildAuthorizeUrl:Q,buildLogoutUrl:Q,getAccessTokenSilently:Q,getAccessTokenWithPopup:Q,getIdTokenClaims:Q,loginWithCustomTokenExchange:Q,customTokenExchange:Q,exchangeToken:Q,loginWithRedirect:Q,loginWithPopup:Q,connectAccountWithRedirect:Q,logout:Q,handleRedirectCallback:Q,getDpopNonce:Q,setDpopNonce:Q,generateDpopProof:Q,createFetcher:Q,getConfiguration:Q,mfa:{getAuthenticators:Q,enroll:Q,challenge:Q,verify:Q,getEnrollmentFactors:Q},passkey:{signup:Q,login:Q},myAccount:{getFactors:Q,getAuthenticationMethods:Q,getAuthenticationMethod:Q,updateAuthenticationMethod:Q,deleteAuthenticationMethod:Q,enrollmentChallenge:Q,enrollmentVerify:Q}}),Mf=(0,q.createContext)(jf);(function(e){ql(t,e);function t(n,r){var i=e.call(this,r??n)||this;return i.error=n,i.error_description=r,Object.setPrototypeOf(i,t.prototype),i}return t})(Error);var Nf=function(e){return e===void 0&&(e=Mf),(0,q.useContext)(e)},Pf;function Ff(e){Pf=e}function If(){return Pf}var Lf=(0,q.createContext)({get client(){return If()},bootstrap:void 0}),Rf=function(e){return typeof e==`function`},zf=function(){return(0,q.useContext)(Lf).client},Bf=function(e,t){return Bf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Bf(e,t)};function Vf(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Bf(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Hf={componentStack:null,exceptionEvent:null,error:null},Uf={INVALID_FALLBACK:`[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element.`};(function(e){Vf(t,e);function t(t){var n=e.call(this,t)||this;return n.state=Hf,n}return t.prototype.componentDidCatch=function(e,t){var n=this.props.additionalProperties,r;Rf(n)?r=n(e):typeof n==`object`&&(r=n);var i=this.context.client.captureException(e,r),a=t.componentStack;this.setState({error:e,componentStack:a??null,exceptionEvent:i})},t.prototype.render=function(){var e=this.props,t=e.children,n=e.fallback,r=this.state;if(r.componentStack==null)return Rf(t)?t():t;var i=Rf(n)?q.createElement(n,{error:r.error,componentStack:r.componentStack,exceptionEvent:r.exceptionEvent}):n;return q.isValidElement(i)?i:(console.warn(Uf.INVALID_FALLBACK),q.createElement(q.Fragment,null))},t.contextType=Lf,t})(q.Component),Ff(fc);var Wf=(e=>{let t=Object.create(e);return t.capture=function(t,...n){let[r,i]=n;return e.capture(t,r,i)},t.captureRaw=function(t,n,r){return e.capture(t,n,r)},new Proxy(t,{get(t,n){return n in t?t[n]:e[n]},set(t,n,r){return e[n]=r,!0}})})(fc),Gf=()=>(zf(),Wf),Kf=()=>{let e=Gf();return{logEvent:(0,q.useCallback)(((t,n,r)=>{let i=e.capture;i(t,n,r)}),[e]),captureRaw:(0,q.useCallback)((t,n)=>{e.captureRaw(t,n)},[e]),captureException:(t,n)=>{e.captureException(t,n)}}},qf=`acts_as`,Jf=`https://zuplo.com/claims/acts_as`,Yf=`as_user`,Xf=e=>{let t=e?.[qf];if(typeof t==`string`)return t;let n=e?.[Jf];return typeof n==`string`?n:void 0},Zf=new Set([`login_required`,`interaction_required`,`invalid_grant`,`missing_refresh_token`,`mfa_required`,`MfaRequiredError`,`MissingRefreshTokenError`]),Qf=[`failed to fetch`,`load failed`,`timeout`,`no cached access token`],$f=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.error==`string`)return t.error;if(typeof t.name==`string`)return t.name}},ep=e=>{let t=$f(e);if(t===`timeout`||t===`TimeoutError`)return!0;if(typeof e==`object`&&e){let t=e;if(typeof t.message==`string`){let e=t.message.toLowerCase();return Qf.some(t=>e.includes(t))}}return!1},tp=e=>{let t=$f(e);return t!==void 0&&Zf.has(t)?`session-ended`:ep(e)?`transient`:`unknown`},np=e=>{if(typeof e==`object`&&e){let t=e;return{code:typeof t.error==`string`?t.error:typeof t.name==`string`?t.name:`unknown`,description:typeof t.error_description==`string`?t.error_description:void 0}}return{code:`unknown`}},rp=!1,ip=new Set,ap=()=>{if(!rp){rp=!0;try{`${window.location.pathname}${window.location.search}${window.location.hash}`}catch{}for(let e of ip)e()}},op=(0,q.createContext)(void 0),sp=()=>{let e=(0,q.useContext)(op),{user:t}=Nf();if(e)return e;if(!t)throw Error(`This hook should never be used outside of a protected route.`);if(!t.sub)throw Error(`The user returned from Auth0 does not contain a 'sub'. Invalid state.`);return{email:t.email??`unknown@example.com`,name:t.name??``,userId:t.sub,asUser:Xf(t)}},cp=(e,t)=>{let{code:n,description:r}=np(e);return{auth0_error_code:n,...r?{auth0_error_description:r}:{},error_name:e instanceof Error?e.name:typeof e,failure_kind:t.kind,force_refresh:t.cacheMode===`off`,is_impersonating:t.isImpersonating,cache_mode:t.cacheMode,is_authenticated:t.isAuthenticated,cache_location:`memory`,online:typeof navigator>`u`?void 0:navigator.onLine,cookies_enabled:typeof navigator>`u`?void 0:navigator.cookieEnabled,visibility_state:typeof document>`u`?void 0:document.visibilityState,page_age_ms:typeof performance>`u`?void 0:Math.round(performance.now())}},lp=()=>{let e=(0,q.useContext)(op),t=Nf(),{captureException:n}=Kf();return(0,q.useCallback)(async r=>{if(e)return`local-access-token`;let i=!!Xf(t.user),a=typeof document<`u`&&document.visibilityState===`hidden`,o=i?`cache-only`:r?.forceRefresh?`off`:a?`cache-only`:`on`;try{let e=await t.getAccessTokenSilently({cacheMode:o,authorizationParams:{audience:kc,...i?{scope:`${Oc} ${qf} ${Yf}`}:{}}});if(!e){let e=Error(`No cached access token available`);throw e.error=`no_cached_access_token`,e}return e}catch(e){let r=tp(e),a=cp(e,{isImpersonating:i,cacheMode:o,isAuthenticated:t.isAuthenticated,kind:r});r===`session-ended`&&!i?(vc.info(`Access-token renewal failed; session ended`,a),ap()):r===`transient`?vc.info(`Access-token renewal failed transiently; not surfaced`,a):(vc.error(`Access-token renewal failed`,{error:e,...a}),n(e,a));let s=new wc(`Error retrieving access token`,e instanceof Error?e:Error(e));throw s.status=500,s}},[e,t,n])},up=/\{[^{}]+\}/g,dp=()=>typeof process==`object`&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function fp(){return Math.random().toString(36).slice(2,11)}function pp(e){let{baseUrl:t=``,Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,headers:o,requestInitExt:s=void 0,...c}={...e};s=dp()?s:void 0,t=Sp(t);let l=[];async function u(e,u){let{baseUrl:d,fetch:f=r,Request:p=n,headers:m,params:h={},parseAs:g=`json`,querySerializer:_,bodySerializer:v=a??yp,body:y,middleware:b=[],...x}=u||{},S=t;d&&(S=Sp(d)??t);let C=typeof i==`function`?i:_p(i);_&&(C=typeof _==`function`?_:_p({...typeof i==`object`?i:{},..._}));let w=y===void 0?void 0:v(y,xp(o,m,h.header)),T=xp(w===void 0||w instanceof FormData?{}:{"Content-Type":`application/json`},o,m,h.header),E=[...l,...b],D={redirect:`follow`,...c,...x,body:w,headers:T},O,k,A=new p(bp(e,{baseUrl:S,params:h,querySerializer:C}),D),j;for(let e in x)e in A||(A[e]=x[e]);if(E.length){O=fp(),k=Object.freeze({baseUrl:S,fetch:f,parseAs:g,querySerializer:C,bodySerializer:v});for(let t of E)if(t&&typeof t==`object`&&typeof t.onRequest==`function`){let n=await t.onRequest({request:A,schemaPath:e,params:h,options:k,id:O});if(n)if(n instanceof p)A=n;else if(n instanceof Response){j=n;break}else throw Error(`onRequest: must return new Request() or Response() when modifying the request`)}}if(!j){try{j=await f(A,s)}catch(t){let n=t;if(E.length)for(let t=E.length-1;t>=0;t--){let r=E[t];if(r&&typeof r==`object`&&typeof r.onError==`function`){let t=await r.onError({request:A,error:n,schemaPath:e,params:h,options:k,id:O});if(t){if(t instanceof Response){n=void 0,j=t;break}if(t instanceof Error){n=t;continue}throw Error(`onError: must return new Response() or instance of Error`)}}}if(n)throw n}if(E.length)for(let t=E.length-1;t>=0;t--){let n=E[t];if(n&&typeof n==`object`&&typeof n.onResponse==`function`){let t=await n.onResponse({request:A,response:j,schemaPath:e,params:h,options:k,id:O});if(t){if(!(t instanceof Response))throw Error(`onResponse: must return new Response() when modifying the response`);j=t}}}}if(j.status===204||A.method===`HEAD`||j.headers.get(`Content-Length`)===`0`)return j.ok?{data:void 0,response:j}:{error:void 0,response:j};if(j.ok)return g===`stream`?{data:j.body,response:j}:{data:await j[g](),response:j};let M=await j.text();try{M=JSON.parse(M)}catch{}return{error:M,response:j}}return{request(e,t,n){return u(t,{...n,method:e.toUpperCase()})},GET(e,t){return u(e,{...t,method:`GET`})},PUT(e,t){return u(e,{...t,method:`PUT`})},POST(e,t){return u(e,{...t,method:`POST`})},DELETE(e,t){return u(e,{...t,method:`DELETE`})},OPTIONS(e,t){return u(e,{...t,method:`OPTIONS`})},HEAD(e,t){return u(e,{...t,method:`HEAD`})},PATCH(e,t){return u(e,{...t,method:`PATCH`})},TRACE(e,t){return u(e,{...t,method:`TRACE`})},use(...e){for(let t of e)if(t){if(typeof t!=`object`||!(`onRequest`in t||`onResponse`in t||`onError`in t))throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");l.push(t)}},eject(...e){for(let t of e){let e=l.indexOf(t);e!==-1&&l.splice(e,1)}}}}function mp(e,t,n){if(t==null)return``;if(typeof t==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function hp(e,t,n){if(!t||typeof t!=`object`)return``;let r=[],i={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`;if(n.style!==`deepObject`&&n.explode===!1){for(let e in t)r.push(e,n.allowReserved===!0?t[e]:encodeURIComponent(t[e]));let i=r.join(`,`);switch(n.style){case`form`:return`${e}=${i}`;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return i}}for(let i in t){let a=n.style===`deepObject`?`${e}[${i}]`:i;r.push(mp(a,t[i],n))}let a=r.join(i);return n.style===`label`||n.style===`matrix`?`${i}${a}`:a}function gp(e,t,n){if(!Array.isArray(t))return``;if(n.explode===!1){let r={form:`,`,spaceDelimited:`%20`,pipeDelimited:`|`}[n.style]||`,`,i=(n.allowReserved===!0?t:t.map(e=>encodeURIComponent(e))).join(r);switch(n.style){case`simple`:return i;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return`${e}=${i}`}}let r={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`,i=[];for(let r of t)n.style===`simple`||n.style===`label`?i.push(n.allowReserved===!0?r:encodeURIComponent(r)):i.push(mp(e,r,n));return n.style===`label`||n.style===`matrix`?`${r}${i.join(r)}`:i.join(r)}function _p(e){return function(t){let n=[];if(t&&typeof t==`object`)for(let r in t){let i=t[r];if(i!=null){if(Array.isArray(i)){if(i.length===0)continue;n.push(gp(r,i,{style:`form`,explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof i==`object`){n.push(hp(r,i,{style:`deepObject`,explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(mp(r,i,e))}}return n.join(`&`)}}function vp(e,t){let n=e;for(let r of e.match(up)??[]){let e=r.substring(1,r.length-1),i=!1,a=`simple`;if(e.endsWith(`*`)&&(i=!0,e=e.substring(0,e.length-1)),e.startsWith(`.`)?(a=`label`,e=e.substring(1)):e.startsWith(`;`)&&(a=`matrix`,e=e.substring(1)),!t||t[e]===void 0||t[e]===null)continue;let o=t[e];if(Array.isArray(o)){n=n.replace(r,gp(e,o,{style:a,explode:i}));continue}if(typeof o==`object`){n=n.replace(r,hp(e,o,{style:a,explode:i}));continue}if(a===`matrix`){n=n.replace(r,`;${mp(e,o)}`);continue}n=n.replace(r,a===`label`?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function yp(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get(`Content-Type`)??t.get(`content-type`):t[`Content-Type`]??t[`content-type`])===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}function bp(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=vp(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith(`?`)&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function xp(...e){let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,r)}return t}function Sp(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}var Cp=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wp={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Tp=new class{#e=wp;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Ep(e){setTimeout(e,0)}var Dp=typeof window>`u`||`Deno`in globalThis;function Op(){}function kp(e,t){return typeof e==`function`?e(t):e}function Ap(e){return typeof e==`number`&&e>=0&&e!==1/0}function jp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Mp(e,t){return typeof e==`function`?e(t):e}function Np(e,t){return typeof e==`function`?e(t):e}function Pp(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ip(o,t.options))return!1}else if(!Rp(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Fp(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Lp(t.options.mutationKey)!==Lp(a))return!1}else if(!Rp(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ip(e,t){return(t?.queryKeyHashFn||Lp)(e)}function Lp(e){return JSON.stringify(e,(e,t)=>Up(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Rp(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Rp(e[n],t[n])):!1}var zp=Object.prototype.hasOwnProperty;function Bp(e,t){if(e===t)return e;let n=Hp(e)&&Hp(t);if(!n&&!(Up(e)&&Up(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:zp.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=Bp(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function Vp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Hp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Up(e){if(!Wp(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Wp(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Wp(e){return Object.prototype.toString.call(e)===`[object Object]`}function Gp(e){return new Promise(t=>{Tp.setTimeout(t,e)})}function Kp(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Bp(e,t)}function qp(e){return e}function Jp(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Yp(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Xp=Symbol();function Zp(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Xp?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Qp(e,t){return typeof e==`function`?e(...t):!!e}var $p=new class extends Cp{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Dp&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function em(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var tm=Ep;function nm(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=tm,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var rm=nm(),im=new class extends Cp{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Dp&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function am(e){return Math.min(1e3*2**e,3e4)}function om(e){return(e??`online`)===`online`?im.isOnline():!0}var sm=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function cm(e){let t=!1,n=0,r,i=em(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new sm(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>$p.isFocused()&&(e.networkMode===`always`||im.isOnline())&&e.canRun(),u=()=>om(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Dp?0:3),o=e.retryDelay??am,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Gp(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var lm=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ap(this.gcTime)&&(this.#e=Tp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Dp?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Tp.clearTimeout(this.#e),void 0)}},um=class extends lm{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=pm(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=pm(this.options);e.data!==void 0&&(this.setState(fm(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=Kp(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Op).catch(Op):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Np(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Mp(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!jp(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=Zp(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=cm({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof sm&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof sm){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...dm(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...fm(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),rm.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function dm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:om(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function fm(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function pm(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var mm=class extends Cp{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=em(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),gm(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _m(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _m(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Np(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Vp(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&vm(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Np(this.options.enabled,this.#t)!==Np(t.enabled,this.#t)||Mp(this.options.staleTime,this.#t)!==Mp(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Np(this.options.enabled,this.#t)!==Np(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return bm(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Op)),t}#g(){this.#b();let e=Mp(this.options.staleTime,this.#t);if(Dp||this.#r.isStale||!Ap(e))return;let t=jp(this.#r.dataUpdatedAt,e)+1;this.#d=Tp.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Dp||Np(this.options.enabled,this.#t)===!1||!Ap(this.#p)||this.#p===0)&&(this.#f=Tp.setInterval(()=>{(this.options.refetchIntervalInBackground||$p.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(Tp.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(Tp.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&gm(e,t),o=i&&vm(e,n,t,r);(a||o)&&(l={...l,...dm(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Kp(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Kp(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:ym(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Np(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=em())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Vp(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){rm.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function hm(e,t){return Np(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function gm(e,t){return hm(e,t)||e.state.data!==void 0&&_m(e,t,t.refetchOnMount)}function _m(e,t,n){if(Np(t.enabled,e)!==!1&&Mp(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&ym(e,t)}return!1}function vm(e,t,n,r){return(e!==t||Np(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ym(e,n)}function ym(e,t){return Np(t.enabled,e)!==!1&&e.isStaleByTime(Mp(t.staleTime,e))}function bm(e,t){return!Vp(e.getCurrentResult(),t)}function xm(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=Zp(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Yp:Jp;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Cm:Sm,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Sm(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Sm(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Cm(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function wm(e,t){return t?Sm(e,t)!=null:!1}function Tm(e,t){return!t||!e.getPreviousPageParam?!1:Cm(e,t)!=null}var Em=class extends mm{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:xm()})}getOptimisticResult(e){return e.behavior=xm(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:wm(t,n.data),hasPreviousPage:Tm(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Dm=class extends lm{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Om(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=cm({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{throw await this.#n.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#i({type:`error`,error:t})}}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),rm.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Om(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var km=class extends Cp{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Vp(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Lp(t.mutationKey)!==Lp(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Om();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){rm.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type===`success`?(this.#r.onSuccess?.(e.data,t,n,r),this.#r.onSettled?.(e.data,null,t,n,r)):e?.type===`error`&&(this.#r.onError?.(e.error,t,n,r),this.#r.onSettled?.(void 0,e.error,t,n,r))}this.listeners.forEach(e=>{e(this.#t)})})}},Am=q.createContext(void 0),jm=e=>{let t=q.useContext(Am);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Mm=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(Am.Provider,{value:e,children:t})),Nm=q.createContext(!1),Pm=()=>q.useContext(Nm);Nm.Provider;function Fm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Im=q.createContext(Fm()),Lm=()=>q.useContext(Im),Rm=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},zm=e=>{q.useEffect(()=>{e.clearReset()},[e])},Bm=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Qp(n,[e.error,r])),Vm=(e,t)=>t.state.data===void 0,Hm=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Um=(e,t)=>e.isLoading&&e.isFetching&&!t,Wm=(e,t)=>e?.suspense&&t.isPending,Gm=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Km(e,t,n){let r=Pm(),i=Lm(),a=jm(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,Hm(o),Rm(o,i),zm(i);let s=!a.getQueryCache().get(o.queryHash),[c]=q.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=u?c.subscribe(rm.batchCalls(e)):Op;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),q.useEffect(()=>{c.setOptions(o)},[o,c]),Wm(o,l))throw Gm(o,c,i);if(Bm({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!Dp&&Um(l,r)&&(s?Gm(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(Op).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function qm(e,t){return Km(e,mm,t)}function Jm(e,t){return Km({...e,enabled:!0,suspense:!0,throwOnError:Vm,placeholderData:void 0},mm,t)}function Ym(e,t){let n=jm(t),[r]=q.useState(()=>new km(n,e));q.useEffect(()=>{r.setOptions(e)},[r,e]);let i=q.useSyncExternalStore(q.useCallback(e=>r.subscribe(rm.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=q.useCallback((e,t)=>{r.mutate(e,t).catch(Op)},[r]);if(i.error&&Qp(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Xm(e,t){return Km(e,Em,t)}function Zm(e){let t=async({queryKey:[t,n,r],signal:i})=>{let a=e[t.toUpperCase()],{data:o,error:s,response:c}=await a(n,{signal:i,...r});if(s)throw s;return c.status===204||c.headers.get(`Content-Length`)===`0`?o??null:o},n=(t,n)=>async r=>{let i=e[t.toUpperCase()],{data:a,error:o}=await i(n,r);if(o)throw o;return a},r=(e,n,...[r,i])=>({queryKey:r===void 0?[e,n]:[e,n,r],queryFn:t,...i});return{queryOptions:r,mutationOptions:(e,t,r)=>({mutationKey:[e,t],mutationFn:n(e,t),...r}),useQuery:(e,t,...[n,i,a])=>qm(r(e,t,n,i),a),useSuspenseQuery:(e,t,...[n,i,a])=>Jm(r(e,t,n,i),a),useInfiniteQuery:(t,n,i,a,o)=>{let{pageParamName:s=`cursor`,...c}=a,{queryKey:l}=r(t,n,i);return Xm({queryKey:l,queryFn:async({queryKey:[t,n,r],pageParam:i=0,signal:a})=>{let o=e[t.toUpperCase()],{data:c,error:l}=await o(n,{...r,signal:a,params:{...r?.params||{},query:{...r?.params?.query,[s]:i}}});if(l)throw l;return c},...c},o)},useMutation:(e,t,r,i)=>Ym({mutationKey:[e,t],mutationFn:n(e,t),...r},i)}}async function Qm(e,t,n){let r=await e(await t());if(r.status!==401)return r;let i=await e(await t({forceRefresh:!0}));return i.status===401&&n(),i}function $m(){let e=new Map;return{async onRequest({request:t,id:n}){let{getAccessToken:r}=await Yc(),i=await r(),a=Gc();return t.headers.set(`authorization`,`Bearer ${i}`),t.headers.set(`zuplo-request-id`,a),t.headers.set(`x-trace-id`,a),e.set(n,t.clone()),t},onError({id:t}){e.delete(t)},async onResponse({request:t,response:n,id:r}){let i=e.get(r);e.delete(r);let a=t.headers.get(`x-trace-id`)||`unknown`,{getAccessToken:o}=await Yc(),s=n;if(n.status===401&&i){let e=await o({forceRefresh:!0});i.headers.set(`authorization`,`Bearer ${e}`),s=await fetch(i)}if(s.status===401){ap();let e=new wc(`Your session has expired. Please log in again.`,{traceId:a});throw e.status=401,e}if(!s.ok){let e=new wc(`Error while making request. Please try again or contact support if the problem persists.`,{traceId:a});throw await e.tryReadResponse(s.clone()),e}return s}}}var eh=pp({baseUrl:K});eh.use($m());var th=Zm(eh);typeof window<`u`&&window.document&&window.document.createElement;function nh(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var rh=q.useId||(()=>void 0),ih=0;function ah(e){let[t,n]=q.useState(rh());return Bl(()=>{e||n(e=>e??String(ih++))},[e]),e||(t?`radix-${t}`:``)}var oh=`focusScope.autoFocusOnMount`,sh=`focusScope.autoFocusOnUnmount`,ch={bubbles:!1,cancelable:!0},lh=`FocusScope`,uh=q.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=q.useState(null),l=Cl(i),u=Cl(a),d=q.useRef(null),f=sl(t,e=>c(e)),p=q.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;q.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:_h(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||_h(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_h(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),q.useEffect(()=>{if(s){vh.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(oh,ch);s.addEventListener(oh,l),s.dispatchEvent(t),t.defaultPrevented||(dh(xh(ph(s)),{select:!0}),document.activeElement===e&&_h(s))}return()=>{s.removeEventListener(oh,l),setTimeout(()=>{let t=new CustomEvent(sh,ch);s.addEventListener(sh,u),s.dispatchEvent(t),t.defaultPrevented||_h(e??document.body,{select:!0}),s.removeEventListener(sh,u),vh.remove(p)},0)}}},[s,l,u,p]);let m=q.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=fh(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&_h(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&_h(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,J.jsx)(xl.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});uh.displayName=lh;function dh(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(_h(r,{select:t}),document.activeElement!==n)return}function fh(e){let t=ph(e);return[mh(t,e),mh(t.reverse(),e)]}function ph(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mh(e,t){for(let n of e)if(!hh(n,{upTo:t}))return n}function hh(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function gh(e){return e instanceof HTMLInputElement&&`select`in e}function _h(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gh(e)&&t&&e.select()}}var vh=yh();function yh(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=bh(e,t),e.unshift(t)},remove(t){e=bh(e,t),e[0]?.resume()}}}function bh(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xh(e){return e.filter(e=>e.tagName!==`A`)}function Sh(e){let t=Ch(e),n=q.forwardRef((e,n)=>{let{children:r,...i}=e,a=q.Children.toArray(r),o=a.find(Eh);if(o){let e=o.props.children,r=a.map(t=>t===o?q.Children.count(e)>1?q.Children.only(null):q.isValidElement(e)?e.props.children:null:t);return(0,J.jsx)(t,{...i,ref:n,children:q.isValidElement(e)?q.cloneElement(e,void 0,r):null})}return(0,J.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Ch(e){let t=q.forwardRef((e,t)=>{let{children:n,...r}=e;if(q.isValidElement(n)){let e=Oh(n),i=Dh(r,n.props);return n.type!==q.Fragment&&(i.ref=t?Zc(t,e):e),q.cloneElement(n,i)}return q.Children.count(n)>1?q.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wh=Symbol(`radix.slottable`);function Th(e){let t=({children:e})=>(0,J.jsx)(J.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=wh,t}function Eh(e){return q.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===wh}function Dh(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Oh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kh=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Sh(`Primitive.${t}`),r=q.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,J.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ah(e,t){e&&bl.flushSync(()=>e.dispatchEvent(t))}var jh=`Portal`,Mh=q.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=q.useState(!1);Bl(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?bl.createPortal((0,J.jsx)(kh.div,{...r,ref:t}),o):null});Mh.displayName=jh;function Nh(e,t){return q.useReducer((e,n)=>t[e][n]??e,e)}var Ph=e=>{let{present:t,children:n}=e,r=Fh(t),i=typeof n==`function`?n({present:r.isPresent}):q.Children.only(n),a=Qc(r.ref,Lh(i));return typeof n==`function`||r.isPresent?q.cloneElement(i,{ref:a}):null};Ph.displayName=`Presence`;function Fh(e){let[t,n]=q.useState(),r=q.useRef(null),i=q.useRef(e),a=q.useRef(`none`),[o,s]=Nh(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return q.useEffect(()=>{let e=Ih(r.current);a.current=o===`mounted`?e:`none`},[o]),Bl(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ih(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Bl(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ih(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ih(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:q.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ih(e){return e?.animationName||`none`}function Lh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rh=0;function zh(){q.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Bh()),document.body.insertAdjacentElement(`beforeend`,e[1]??Bh()),Rh++,()=>{Rh===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Rh--}},[])}function Bh(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Vh=function(){return Vh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Vh.apply(this,arguments)};function Hh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Uh(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Wh=`right-scroll-bar-position`,Gh=`width-before-scroll-bar`,Kh=`with-scroll-bars-hidden`,qh=`--removed-body-scroll-bar-size`;function Jh(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Yh(e,t){var n=(0,q.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Xh=typeof window<`u`?q.useLayoutEffect:q.useEffect,Zh=new WeakMap;function Qh(e,t){var n=Yh(t||null,function(t){return e.forEach(function(e){return Jh(e,t)})});return Xh(function(){var t=Zh.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Jh(e,null)}),i.forEach(function(e){r.has(e)||Jh(e,a)})}Zh.set(n,e)},[e]),n}function $h(e){return e}function eg(e,t){t===void 0&&(t=$h);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function tg(e){e===void 0&&(e={});var t=eg(null);return t.options=Vh({async:!0,ssr:!1},e),t}var ng=function(e){var t=e.sideCar,n=Hh(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return q.createElement(r,Vh({},n))};ng.isSideCarExport=!0;function rg(e,t){return e.useMedium(t),ng}var ig=tg(),ag=function(){},og=q.forwardRef(function(e,t){var n=q.useRef(null),r=q.useState({onScrollCapture:ag,onWheelCapture:ag,onTouchMoveCapture:ag}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Hh(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Qh([n,t]),C=Vh(Vh({},b),i);return q.createElement(q.Fragment,null,u&&q.createElement(x,{sideCar:ig,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?q.cloneElement(q.Children.only(s),Vh(Vh({},C),{ref:S})):q.createElement(v,Vh({},C,{className:c,ref:S}),s))});og.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},og.classNames={fullWidth:Gh,zeroRight:Wh};var sg,cg=function(){if(sg)return sg;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function lg(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=cg();return t&&e.setAttribute(`nonce`,t),e}function ug(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dg(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var fg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lg())&&(ug(t,n),dg(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pg=function(){var e=fg();return function(t,n){q.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mg=function(){var e=pg();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},hg={left:0,top:0,right:0,gap:0},gg=function(e){return parseInt(e||``,10)||0},_g=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[gg(n),gg(r),gg(i)]},vg=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return hg;var t=_g(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yg=mg(),bg=`data-scroll-locked`,xg=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
5
|
-
.${
|
|
3
|
+
`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=tn.test(s)?s.replace(tn,`$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 A({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||Gt});var n}))}(i)}}(`web:javascript`,Zt,en)),this._instance=e,this.qo=this._instance.persistence?.get_property(jn)??[],this.Ho=vn(this.Uo()),this.Bo=new yn(this.Ho)}onConfigChange(){this.Ho=vn(this.Uo()),this.Bo.setConfig(this.Ho)}onRemoteConfig(e){if(`errorTracking`in e){var t=e.errorTracking?.suppressionRules??[],n=e.errorTracking?.captureExtensionExceptions;this.qo=t,this._instance.persistence&&this._instance.persistence.register({[jn]:this.qo,[Mn]:n})}}get zo(){var e,t=!!this._instance.get_property(Mn);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.jo.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.Ho.enabled)try{if(!L(e)||e.trim().length===0)return void Ys.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)=>gn.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this.Vo(t));r.length>0&&Ys.warn(`Ignoring reserved exception step fields`,{droppedKeys:r}),this.Bo.add(A({[mn]:e,[hn]:new Date().toISOString()},n))}catch(e){Ys.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Wo(t)){if(this.Zo(t))return this.Go(`Exception dropped: matched a suppression rule`),void Ys.info(`Skipping exception capture because a suppression rule matched`);if(!this.zo&&this.Qo(t))return this.Go(`Exception dropped: thrown by a browser extension`),void Ys.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Jo(t))return this.Go(`Exception dropped: thrown by the PostHog SDK`),void Ys.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.Ho.enabled&&R(e.$exception_steps)?this.Ko(e):e;try{var r=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,Cn:!0});return r&&this.Bo.clear(),r}catch(e){Ys.error(`Failed to capture exception event. Dropping this exception.`,e),this.Bo.clear();return}}catch(e){Ys.error(`Failed to process exception event. Ignoring this exception.`,e);return}}Ko(e){try{var t=this.Bo.getAttachable();return t.length===0?e:A({},e,{$exception_steps:t})}catch(t){return Ys.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}Go(e){this.Ho.enabled&&this.Bo.add({[mn]:e,[hn]:new Date().toISOString()})}Vo(e){return he(e)?A({},e):{}}Uo(){return this._instance.config.error_tracking?.exception_steps??{}}Zo(e){if(e.length===0)return!1;var t=e.reduce(((e,t)=>{var{type:n,value:r}=t;return L(n)&&n.length>0&&e.$exception_types.push(n),L(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.qo.some((e=>{var n=e.values.map((e=>{var n=Ro[e.operator],r=F(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)}))}Qo(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}Jo(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}Wo(e){return!R(e)&&F(e)}}},ac=A({productTours:class{get Si(){return this._instance.persistence}constructor(e){this.Yo=null,this.Xo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){`productTours`in e&&(this.Si&&this.Si.register({[Fn]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Yo||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(Fn)||this.lr((()=>this.ea()))}lr(e){var t,n;(t=T.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?js.error(`Could not load product tours script`,t):e()}))}ea(){var e;!this.Yo&&(e=T.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Yo=T.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!F(this.Xo)||t){var n=this.Si;if(n){var r=n.props[rr];if(F(r)&&!t)return this.Xo=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=>{var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;js.error(i),e([],{isLoaded:!1,error:i});return}var a=F(t.json.product_tours)?t.json.product_tours:[];this.Xo=a,n&&n.register({[rr]:a}),e(a,{isLoaded:!0})}})}else e(this.Xo,{isLoaded:!0})}getActiveProductTours(e){R(this.Yo)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Yo.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Yo)==null||t.showTourById(e)}previewTour(e){this.Yo?this.Yo.previewTour(e):this.lr((()=>{var t;this.ea(),(t=this.Yo)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Yo)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Yo)==null||e.nextStep()}previousStep(){var e;(e=this.Yo)==null||e.previousStep()}clearCache(){var e;this.Xo=null,(e=this.Si)==null||e.unregister(rr)}resetTour(e){var t;(t=this.Yo)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Yo)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Yo)==null||t.cancelPendingTour(e)}}},tc),oc={siteApps:class{constructor(e){this._instance=e,this.ta=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ra(e,t){if(t){var n=this.globalsForEvent(t);this.ta.push(n),this.ta.length>1e3&&(this.ta=this.ta.slice(10))}}get siteAppLoaders(){var e;return(e=T._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.ra.bind(this));this.ia=()=>{e(),this.ta=[],this.ia=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:A({},j(e,Ms),{properties:A({},e.properties,s?{$set:A({},e.properties?.$set??{},s)}:{},o?{$set_once:A({},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}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.ta.length&&(Ns.info(`Processing `+this.ta.length+` events for site app with id `+e.id),this.ta.forEach((e=>t.processEvent==null?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.ia)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,Ns.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback(e){i(e)}});a&&(t.processEvent=a),r=!0}catch(t){Ns.error(Ps+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){Ns.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}na(){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)}sa(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(t){Ns.error(`Error while processing event `+e.event+` for site app `+n.id,t)}}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.na(),void this._instance.on(`eventCaptured`,(e=>this.sa(e)))):void Ns.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.ia)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(e){var t;T[`__$$ph_site_app_`+e]=i._instance,(t=T.__PosthogExtensions__)==null||t.loadSiteApp==null||t.loadSiteApp(i._instance,s,(t=>{if(t)return Ns.error(Ps+e,t)}))};for(var{id:o,url:s}of e.siteApps)a(o)}else Ns.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}},sc={tracingHeaders:class{constructor(e){this.oa=void 0,this.aa=void 0,this.ua=void 0,this.Ro=()=>{var e,t,n=this.la();n?(I(this.oa)&&(this.oa=(e=T.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),I(this.aa)&&(this.aa=(t=T.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ao()},this._instance=e}initialize(){this.startIfEnabledOrStop()}lr(e){var t,n;(t=T.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=T.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return bs.error(`failed to load script`,t);e()}))}ha(){return this._instance.config.tracing_headers??this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}la(){var e=this.ha();return F(e)?(F(this.ua)?this.ua.splice(0,this.ua.length,...e):this.ua=[...e],e.length>0?this.ua:void 0):(F(this.ua)&&this.ua.splice(0),this.ua=e||void 0,this.ua)}Ao(){var e,t;(e=this.oa)==null||e.call(this),(t=this.aa)==null||t.call(this),this.oa=void 0,this.aa=void 0}startIfEnabledOrStop(){this.la()?this.lr(this.Ro):this.Ao()}}},cc=A({surveys:class{get qt(){return this._instance.config}constructor(e){this.ca=void 0,this._surveyManager=null,this.da=!1,this.va=[],this.fa=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qt.disable_surveys){var t=e.surveys;if(R(t))return G.warn(`Flags not loaded yet. Not loading surveys.`);this.ca=F(t)?t.length>0:t,G.info(`flags response received, isSurveysEnabled: `+this.ca),this.loadIfEnabled()}}reset(){localStorage.removeItem(`lastSeenSurveyDate`);for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(Go)||n!=null&&n.startsWith(`inProgressSurvey_`))&&e.push(n)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.da)G.info(`Already initializing surveys, skipping...`);else if(this.qt.disable_surveys)G.info(Bs);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())G.info(`Not loading surveys in cookieless mode without consent.`);else{var e=T?.__PosthogExtensions__;if(e){if(!I(this.ca)||this.qt.advanced_enable_surveys){var t=this.ca||this.qt.advanced_enable_surveys;this.da=!0;try{var n=e.generateSurveys;if(n)return void this.pa(n,t);var r=e.loadExternalDependency;if(!r)return void this.ga(br);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.ga(`Could not load surveys script`,n):this.pa(e.generateSurveys,t)}))}catch(e){throw this.ga(`Error initializing surveys`,e),e}finally{this.da=!1}}}else G.error(`PostHog Extensions not found.`)}}pa(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Rs(this._instance),G.info(`Surveys loaded successfully`),this.ma({isLoaded:!0})}ga(e,t){G.error(e,t),this.ma({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.va.push(e),this._surveyManager&&this.ma({isLoaded:!0}),()=>{this.va=this.va.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.qt.disable_surveys)return G.info(Bs),e([]);var n,r=this._instance.get_property(er);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<`u`&&this.fa?this.fa.then((t=>{var{surveys:n,context:r}=t;return e(n,r)})):(typeof Promise<`u`&&(this.fa=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.qt.token),method:`GET`,timeout:this.qt.surveys_request_timeout_ms,callback:t=>{var r;this.fa=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;G.error(a);var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}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({[er]:c,[tr]:Date.now()});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}ma(e){for(var t of this.va)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){G.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!R(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);G.warn(`init was not called`)}ya(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}ba(e){if(R(this._surveyManager))return{eligible:!1,reason:zs};var t=typeof e==`string`?this.ya(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(R(this._surveyManager))return G.warn(`init was not called`),{visible:!1,disabledReason:zs};var t=this.ba(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return R(this._surveyManager)?(G.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:zs})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.ba(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var r;if(R(this._surveyManager))G.warn(`init was not called`);else{var i=typeof e==`string`?this.ya(e):e;if(i!=null&&i.id)if(Ko.includes(i.type)){var a=v?.querySelector(t);if(a)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(G.info(`Rendering survey `+i.id+` with delay of `+i.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;G.info(`Rendering survey `+i.id+` with delay of `+i.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(i,a,n),G.info(`Survey `+i.id+` rendered`)}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,a,n);G.warn(`Survey element not found`)}else G.warn(`Surveys of type `+i.type+` cannot be rendered in the app`);else G.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(R(this._surveyManager))G.warn(`init was not called`);else{var r=this.ya(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=A({},r,{appearance:A({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Oa.Popover&&t.initialResponses&&G.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 G.warn(`Survey is not eligible to be displayed: `,a.disabledReason)}t.displayType===Oa.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else G.warn(`Survey not found`)}}cancelPendingSurvey(e){R(this._surveyManager)?G.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},tc),lc={toolbar:class{constructor(e){this.instance=e}_a(e){T.ph_toolbar_state=e}wa(){return T.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),Br(this.instance.config)||!h||!v)return!1;e??=h.location,n??=h.history;try{if(!t){try{h.localStorage.setItem(`test`,`test`),h.localStorage.removeItem(`test`)}catch{return!1}t=h?.localStorage}var r,i=Vs||ia(e.hash,`__posthog`)||ia(e.hash,`state`),a=i?Pr((()=>JSON.parse(atob(decodeURIComponent(i)))))||Pr((()=>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(Hs)||`{}`)).source=`localstorage`,delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}xa(e){var t=T.ph_load_toolbar||T.ph_load_editor;!R(t)&&me(t)?t(e,this.instance):Us.warn(`No toolbar load function found`)}loadToolbar(e){var t=!(v==null||!v.getElementById(hr));if(!h||t)return!1;var n=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,r=A({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},n?{instrument:!1}:{});if(h.localStorage.setItem(Hs,JSON.stringify(A({},r,{source:void 0}))),this.wa()===2)this.xa(r);else if(this.wa()===0){var i;this._a(1),(i=T.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return Us.error(`[Toolbar] Failed to load`,e),void this._a(0);this._a(2),this.xa(r)})),zr(h,`turbolinks:load`,(()=>{this._a(0),this.loadToolbar(r)}))}return!0}Sa(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)}}},uc=A({experiments:Qs},tc),dc=A({},tc,nc,rc,ic,ac,oc,cc,sc,lc,uc,{conversations:class{constructor(e){this.ka=void 0,this._conversationsManager=null,this.Ca=!1,this.Ia=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;R(t)||(xe(t)?this.ka=t:(this.ka=t.enabled,this.Ia=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.ka=void 0,this.Ia=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ca||this._instance.config.disable_conversations||Br(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=T?.__PosthogExtensions__;if(e&&!I(this.ka)&&this.ka)if(this.Ia&&this.Ia.token){this.Ca=!0;try{var t=e.initConversations;if(t)return this.Ta(t),void(this.Ca=!1);var n=e.loadExternalDependency;if(!n)return void this.Ea(br);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.Ea(`Could not load conversations script`,t):this.Ta(e.initConversations),this.Ca=!1}))}catch(e){this.Ea(`Error initializing conversations`,e),this.Ca=!1}}else $s.error(`Conversations enabled but missing token in remote config.`)}}Ta(e){if(this.Ia)try{this._conversationsManager=e(this.Ia,this._instance),$s.info(`Conversations loaded successfully`)}catch(e){this.Ea(`Error completing conversations initialization`,e)}else $s.error(`Cannot complete initialization: remote config is null`)}Ea(e,t){$s.error(e,t),this._conversationsManager=null,this.Ca=!1}show(){this._conversationsManager?this._conversationsManager.show():$s.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ka&&!ve(this._conversationsManager)}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return k((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):($s.warn(ec),null)}))()}getMessages(e,t){var n=this;return k((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):($s.warn(ec),null)}))()}markAsRead(e){var t=this;return k((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):($s.warn(ec),null)}))()}getTickets(e){var t=this;return k((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):($s.warn(ec),null)}))()}requestRestoreLink(e){var t=this;return k((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):($s.warn(ec),null)}))()}restoreFromToken(e){var t=this;return k((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):($s.warn(ec),null)}))()}restoreFromUrlToken(){var e=this;return k((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():($s.warn(ec),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}On(){var e;(e=this._conversationsManager)==null||e.setIdentity()}Ln(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.Ma=!1,this.Ra=!1,this.Gt=B(`[logs]`),this.Pa=[],this.Oa=0,this.La=0,this.Fa=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.Ma=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t=e.logs?.captureConsoleLogs;!R(t)&&t&&(this.Ma=!0,this.loadIfEnabled())}reset(){this.Pa=[],this.ii&&=(clearTimeout(this.ii),void 0),this.Oa=0,this.La=0,this.Fa=!1}loadIfEnabled(){if(this.Ma&&!this.Ra){var e=T?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.Gt.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.Ra=!0)})):this.Gt.error(br)}else this.Gt.error(`PostHog Extensions not found.`)}}captureLog(e){if(this._instance.is_capturing())if(e&&e.body){var t=this._instance.config.logs?.flushIntervalMs??3e3,n=this._instance.config.logs?.maxLogsPerInterval??1e3,r=Date.now();if(t>r-this.La||(this.La=r,this.Oa=0,this.Fa=!1),n>this.Oa){this.Oa++;var i=function(e,t){var{text:n,number:r}=zt[e.level||`info`]||Bt,i=String(Date.now())+`000000`,a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),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=A({},a,e.attributes||{}),s={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:Ht(o)};return e.trace_id&&(s.traceId=e.trace_id),e.span_id&&(s.spanId=e.span_id),I(e.trace_flags)||(s.flags=e.trace_flags),s}(e,this.Aa());this.Pa.push({record:i}),(this._instance.config.logs?.maxBufferSize??100)>this.Pa.length?this.Na():this.flushLogs()}else this.Fa||=(this.Gt.warn(`captureLog dropping logs: exceeded `+n+` logs per `+t+`ms`),!0)}else this.Gt.warn(`captureLog requires a body`)}get logger(){return this.Da||={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.Da}flushLogs(e){if(this.ii&&=(clearTimeout(this.ii),void 0),this.Pa.length!==0){var t=this.Pa;this.Pa=[];var n=this._instance.config.logs,r=A({"service.name":n?.serviceName||`unknown_service`},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),i=function(e,t,n,r){return{resourceLogs:[{resource:{attributes:Ht(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}(t.map((e=>e.record)),r,D.LIB_NAME,D.LIB_VERSION),a=this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token);this._instance.fn({method:`POST`,url:a,data:i,compression:`best-available`,batchKey:`logs`,transport:e})}}Na(){this.ii||=setTimeout((()=>{this.ii=void 0,this.flushLogs()}),this._instance.config.logs?.flushIntervalMs??3e3)}Aa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(T!=null&&(e=T.location)!=null&&e.href&&(t.currentUrl=T.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}});ds.__defaultExtensionClasses=A({},dc);var fc=function(){D.SDK_DIST_CHANNEL=`npm`;var e=Qo[as]=new ds;return function(){function e(){e.done||(e.done=!0,os=!1,V(Qo,(function(e){e._dom_loaded()})))}v!=null&&v.addEventListener?v.readyState===`complete`?e():zr(v,`DOMContentLoaded`,e,{capture:!1}):h&&z.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}(),pc=t(l()),mc={trace:null,debug:null,info:`info`,warn:`warn`,error:`error`},hc=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]=r instanceof Error?{name:r.name,message:r.message,stack:r.stack}:r;return t},gc=(e,t,n)=>{let r=mc[e];if(!r)return;let i=fc.logger?.[r];if(i)try{i(t,n?hc(n):void 0)}catch{}},_c=e=>(t,n)=>{n===void 0?pc.default[e](t):pc.default[e](t,n),gc(e,t,n)},vc={trace:_c(`trace`),debug:_c(`debug`),info:_c(`info`),warn:_c(`warn`),error:_c(`error`)},yc=[d.type,f.type,p.type,`https://zup.fail/account-not-found`,`https://zup.fail/project-not-found`,`https://zup.fail/environment-not-found`],bc=`https://zup.fail/api-request-failed`,xc=[`failed to fetch`,`networkerror`,`network request failed`,`load failed`,`the network connection was lost`,`the internet connection appears to be offline`];function Sc(e){if(e instanceof Cc)return e.type===bc;if(e instanceof TypeError){let t=e.message.toLowerCase();return xc.some(e=>t.includes(e))}return!1}var Cc=class extends Error{type;status;detail;instance;traceId;constructor({title:e,type:t,status:n,detail:r,instance:i,traceId:a},o){super(e,o),this.name=`ZuploError`,this.type=t,this.status=n,this.detail=r,this.instance=i,this.traceId=a}},wc=class extends Error{code;type;status;detail;instance;traceId;title;body;constructor(e,t){super(e,t),this.traceId=t?.traceId,this.name=`ZuploApiError`}async tryReadResponse(e){try{this.status=e.status;let t=await e.clone().text();if(t){let e=JSON.parse(t);this.body=e,`code`in e&&typeof e.code==`number`?this.code=e.code:`code`in e&&typeof e.code==`string`&&(this.code=Number(e.code)),`type`in e&&typeof e.type==`string`&&(this.type=e.type),`detail`in e&&typeof e.detail==`string`&&(this.detail=e.detail),`instance`in e&&typeof e.instance==`string`&&(this.instance=e.instance),`title`in e&&typeof e.title==`string`&&(this.title=e.title),`title`in e&&typeof e.title==`string`?this.message=e.title:`message`in e&&typeof e.message==`string`&&(this.message=e.message)}}catch(e){vc.debug(`Failed to parse error response body`,{error:e})}}setTraceId(e){this.traceId=e}};function Tc(e,t){if(e===void 0)throw Error(`Environment variable ${t} was undefined`);return e}var Ec=!1;Tc(`unused`,`VITE_AUTH0_DOMAIN`),Tc(`unused`,`VITE_AUTH0_CLIENT_ID`),Tc(`unused`,`VITE_GITHUB_CLIENT_ID`);var Dc=`/api`,Oc=`openid profile email`,kc=`https://api.zuplo.com/`,K=`/api`,Ac=Tc(`https://cdn.zuplo.com`,`VITE_CDN_URL`),jc=(void 0)?.trim()||`https://mcp-proxy.zuplo.io`,Mc=(void 0)?.trim()||`https://agent-z.zuplo-exp.workers.dev/agent-z/chat`,Nc=`agent-z-api-url-override`,Pc=`_assistantApiUrl`;function Fc(){if(typeof window>`u`)return!1;let{hostname:e}=window.location;return e===`localhost`||e===`127.0.0.1`||e.startsWith(`portal-`)&&e.endsWith(`.zuplosite.com`)||e.endsWith(`.vercel.app`)}function Ic(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`&&t.protocol!==`http:`)return null;let{hostname:n}=t;return n===`localhost`||n===`127.0.0.1`||n===`agent-z.zuplo-exp.workers.dev`||n.endsWith(`-agent-z.zuplo-exp.workers.dev`)?t.href:null}function Lc(){if(!Fc())return null;try{let e=new URLSearchParams(window.location.search);if(e.has(Pc)){let t=e.get(Pc)?.trim()??``;if(!t)return window.sessionStorage.removeItem(Nc),null;let n=Ic(t);if(n)return window.sessionStorage.setItem(Nc,n),n}let t=window.sessionStorage.getItem(Nc);return t?Ic(t):null}catch{return null}}var Rc=Lc()??Mc;Fc()&&(window.setAssistantUrl=e=>{let t=e?.trim();if(!t){window.sessionStorage.removeItem(Nc),window.location.reload();return}let n=Ic(t);if(!n)throw Error(`setAssistantUrl: URL must be http(s) and point at the agent-z worker (…agent-z.zuplo-exp.workers.dev) or localhost`);window.sessionStorage.setItem(Nc,n),window.location.reload()});var zc=[];for(let e=0;e<256;++e)zc.push((e+256).toString(16).slice(1));function Bc(e,t=0){return(zc[e[t+0]]+zc[e[t+1]]+zc[e[t+2]]+zc[e[t+3]]+`-`+zc[e[t+4]]+zc[e[t+5]]+`-`+zc[e[t+6]]+zc[e[t+7]]+`-`+zc[e[t+8]]+zc[e[t+9]]+`-`+zc[e[t+10]]+zc[e[t+11]]+zc[e[t+12]]+zc[e[t+13]]+zc[e[t+14]]+zc[e[t+15]]).toLowerCase()}var Vc,Hc=new Uint8Array(16);function Uc(){if(!Vc){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Vc=crypto.getRandomValues.bind(crypto)}return Vc(Hc)}var Wc={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Gc(e,t,n){if(Wc.randomUUID&&!t&&!e)return Wc.randomUUID();e||={};let r=e.random??e.rng?.()??Uc();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Bc(r)}var Kc,qc=new Promise(e=>{Kc=e});function Jc(e){Kc(e)}function Yc(){return qc}var Xc=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Zc=e=>e?Xc(e):Xc,q=t(o(),1),Qc=e=>e;function $c(e,t=Qc){let n=q.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return q.useDebugValue(n),n}var el=e=>{let t=Zc(e),n=e=>$c(t,e);return Object.assign(n,t),n},tl=e=>e?el(e):el;function nl(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function rl(...e){return t=>{let n=!1,r=e.map(e=>{let r=nl(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():nl(e[t],null)}}}}function il(...e){return q.useCallback(rl(...e),e)}var al=r((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})),ol=r(((e,t)=>{t.exports=al()})),J=ol();function sl(e,t){let n=q.createContext(t),r=e=>{let{children:t,...r}=e,i=q.useMemo(()=>r,Object.values(r));return(0,J.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=q.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function cl(e,t=[]){let n=[];function r(t,r){let i=q.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=q.useMemo(()=>o,Object.values(o));return(0,J.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=q.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>q.createContext(e));return function(n){let r=n?.[e]||t;return q.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,ll(i,...t)]}function ll(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return q.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function ul(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function dl(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function fl(...e){return t=>{let n=!1,r=e.map(e=>{let r=dl(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():dl(e[t],null)}}}}function pl(...e){return q.useCallback(fl(...e),e)}function ml(e){let t=q.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];xl(r)&&typeof Tl==`function`&&(r=Tl(r._payload)),q.Children.forEach(r,e=>{if(yl(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;xl(n)&&typeof Tl==`function`&&(n=Tl(n._payload)),a=gl(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=q.cloneElement(a,void 0,s):!o&&q.Children.count(r)===1&&q.isValidElement(r)&&(a=r);let c=a?vl(a):void 0,l=pl(n,c);if(!a){if(r||r===0)throw Error(o?wl(e):Cl(e));return r}let u=_l(i,a.props??{});return a.type!==q.Fragment&&(u.ref=n?l:c),q.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var hl=Symbol.for(`radix.slottable`),gl=(e,t)=>{if(`child`in e.props){let t=e.props.child;return q.isValidElement(t)?q.cloneElement(t,void 0,e.props.children(t.props.children)):null}return q.isValidElement(t)?t:null};function _l(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function vl(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function yl(e){return q.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===hl}var bl=Symbol.for(`react.lazy`);function xl(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===bl&&`_payload`in e&&Sl(e._payload)}function Sl(e){return typeof e==`object`&&!!e&&`then`in e}var Cl=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,wl=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Tl=q.use,El=t(c(),1),Dl=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ml(`Primitive.${t}`),r=q.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,J.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ol(e,t){e&&El.flushSync(()=>e.dispatchEvent(t))}function kl(e){let t=q.useRef(e);return q.useEffect(()=>{t.current=e}),q.useMemo(()=>((...e)=>t.current?.(...e)),[])}function Al(e,t=globalThis?.document){let n=kl(e);q.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var jl=`DismissableLayer`,Ml=`dismissableLayer.update`,Nl=`dismissableLayer.pointerDownOutside`,Pl=`dismissableLayer.focusOutside`,Fl,Il=q.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ll=q.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=q.useContext(Il),[u,d]=q.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=q.useState({}),m=pl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Bl(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Vl(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Al(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),q.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Fl=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Hl(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=Fl))}},[u,f,n,l]),q.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Hl())},[u,l]),q.useEffect(()=>{let e=()=>p({});return document.addEventListener(Ml,e),()=>document.removeEventListener(Ml,e)},[]),(0,J.jsx)(Dl.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:ul(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ul(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ul(e.onPointerDownCapture,x.onPointerDownCapture)})});Ll.displayName=jl;var Rl=`DismissableLayerBranch`,zl=q.forwardRef((e,t)=>{let n=q.useContext(Il),r=q.useRef(null),i=pl(t,r);return q.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,J.jsx)(Dl.div,{...e,ref:i})});zl.displayName=Rl;function Bl(e,t=globalThis?.document){let n=kl(e),r=q.useRef(!1),i=q.useRef(()=>{});return q.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Ul(Nl,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Vl(e,t=globalThis?.document){let n=kl(e),r=q.useRef(!1);return q.useEffect(()=>{let e=e=>{e.target&&!r.current&&Ul(Pl,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Hl(){let e=new CustomEvent(Ml);document.dispatchEvent(e)}function Ul(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ol(i,a):i.dispatchEvent(a)}var Wl=Ll,Gl=zl,Kl=globalThis?.document?q.useLayoutEffect:()=>{};function ql(e){let t=q.useRef(e);return q.useEffect(()=>{t.current=e}),q.useMemo(()=>(...e)=>t.current?.(...e),[])}var Jl=q.useInsertionEffect||Kl;function Yl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Xl({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=q.useRef(e!==void 0);q.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,q.useCallback(t=>{if(s){let n=Zl(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Xl({defaultProp:e,onChange:t}){let[n,r]=q.useState(e),i=q.useRef(n),a=q.useRef(t);return Jl(()=>{a.current=t},[t]),q.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Zl(e){return typeof e==`function`}var Ql=function(e,t){return Ql=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ql(e,t)};function $l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Ql(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var eu=function(){return eu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},eu.apply(this,arguments)};function tu(e,t){this.v=e,this.k=t}function nu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Y(e,t,n){return(t=function(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ru(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function iu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ru(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ru(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function au(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if(typeof e==`string`)return nu(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nu(e,t):void 0}}(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ou(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof tu;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ou.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ou.prototype.next=function(e){return this._invoke(`next`,e)},ou.prototype.throw=function(e){return this._invoke(`throw`,e)},ou.prototype.return=function(e){return this._invoke(`return`,e)};var su=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},cu={},lu={};Object.defineProperty(lu,`__esModule`,{value:!0});var uu=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);r===void 0?n===void 0?e.locked.set(t,[]):e.locked.set(t,[n]):n!==void 0&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())})},this.unlock=function(t){var n=e.locked.get(t);if(n!==void 0&&n.length!==0){var r=n.pop();e.locked.set(t,n),r!==void 0&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return e.instance===void 0&&(e.instance=new e),e.instance},e}();lu.default=function(){return uu.getInstance()};var du=su&&su.__awaiter||function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,s)}c((r=r.apply(e,t||[])).next())})},fu=su&&su.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw TypeError(`Generator is already executing.`);for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||a[0]!==6&&a[0]!==2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},pu=su;Object.defineProperty(cu,`__esModule`,{value:!0});var mu=lu,hu=`browser-tabs-lock-key`,gu={key:function(e){return du(pu,void 0,void 0,function(){return fu(this,function(e){throw Error(`Unsupported`)})})},getItem:function(e){return du(pu,void 0,void 0,function(){return fu(this,function(e){throw Error(`Unsupported`)})})},clear:function(){return du(pu,void 0,void 0,function(){return fu(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return du(pu,void 0,void 0,function(){return fu(this,function(e){throw Error(`Unsupported`)})})},setItem:function(e,t){return du(pu,void 0,void 0,function(){return fu(this,function(e){throw Error(`Unsupported`)})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function _u(e){return new Promise(function(t){return setTimeout(t,e)})}function vu(e){for(var t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz`,n=``,r=0;r<e;r++)n+=t[Math.floor(61*Math.random())];return n}cu.default=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+vu(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,e.waiters===void 0&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return n===void 0&&(n=5e3),du(this,void 0,void 0,function(){var r,i,a,o,s,c,l;return fu(this,function(u){switch(u.label){case 0:r=Date.now()+vu(4),i=Date.now()+n,a=hu+`-`+t,o=this.storageHandler===void 0?gu:this.storageHandler,u.label=1;case 1:return Date.now()<i?[4,_u(30)]:[3,8];case 2:return u.sent(),o.getItemSync(a)===null?(s=this.id+`-`+t+`-`+r,[4,_u(Math.floor(25*Math.random()))]):[3,5];case 3:return u.sent(),o.setItemSync(a,JSON.stringify({id:this.id,iat:r,timeoutKey:s,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,_u(30)];case 4:return u.sent(),(c=o.getItemSync(a))!==null&&(l=JSON.parse(c)).id===this.id&&l.iat===r?(this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(a,r),[2,!0]):[3,7];case 5:return e.lockCorrector(this.storageHandler===void 0?gu:this.storageHandler),[4,this.waitForSomethingToChange(i)];case 6:u.sent(),u.label=7;case 7:return r=Date.now()+vu(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return du(this,void 0,void 0,function(){var n=this;return fu(this,function(r){return setTimeout(function(){return du(n,void 0,void 0,function(){var n,r,i;return fu(this,function(a){switch(a.label){case 0:return[4,mu.default().lock(t)];case 1:return a.sent(),this.acquiredIatSet.has(t)?(n=this.storageHandler===void 0?gu:this.storageHandler,(r=n.getItemSync(e))===null?(mu.default().unlock(t),[2]):((i=JSON.parse(r)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(i)),mu.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(mu.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return du(this,void 0,void 0,function(){return fu(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,i=Date.now(),a=!1;function o(){if(a||=(window.removeEventListener(`storage`,o),e.removeFromWaiting(o),clearTimeout(s),!0),!r){r=!0;var t=50-(Date.now()-i);t>0?setTimeout(n,t):n(null)}}window.addEventListener(`storage`,o),e.addToWaiting(o);var s=setTimeout(o,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),e.waiters!==void 0&&e.waiters.push(t)},e.removeFromWaiting=function(t){e.waiters!==void 0&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){e.waiters!==void 0&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return du(this,void 0,void 0,function(){return fu(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return du(this,void 0,void 0,function(){var n,r,i,a;return fu(this,function(o){switch(o.label){case 0:return n=this.storageHandler===void 0?gu:this.storageHandler,r=hu+`-`+t,(i=n.getItemSync(r))===null?[2]:(a=JSON.parse(i)).id===this.id?[4,mu.default().lock(a.iat)]:[3,2];case 1:o.sent(),this.acquiredIatSet.delete(a.iat),n.removeItemSync(r),mu.default().unlock(a.iat),e.notifyWaiters(),o.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,i=[],a=0;;){var o=r.keySync(a);if(o===null)break;i.push(o),a++}for(var s=!1,c=0;c<i.length;c++){var l=i[c];if(l.includes(hu)){var u=r.getItemSync(l);if(u!==null){var d=JSON.parse(u);(d.timeRefreshed===void 0&&d.timeAcquired<n||d.timeRefreshed!==void 0&&d.timeRefreshed<n)&&(r.removeItemSync(l),s=!0)}}}s&&e.notifyWaiters()},e.waiters=void 0,e}(),new TextEncoder,new TextDecoder,Uint8Array.prototype.toBase64;var yu=su&&su.__assign||function(){return yu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},yu.apply(this,arguments)},bu;(function(e){e.Code=`code`,e.ConnectCode=`connect_code`})(bu||={});var xu;(function(e){e.Bearer=`Bearer`,e.DPoP=`DPoP`})(xu||={});var Su,Cu,wu;(typeof navigator>`u`||(Su=navigator.userAgent)==null||(Cu=Su.startsWith)==null||!Cu.call(Su,`Mozilla/5.0 `))&&(wu=`oauth4webapi/v3.8.6`);function Tu(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}var Eu=`ERR_INVALID_ARG_VALUE`,Du=`ERR_INVALID_ARG_TYPE`;function Ou(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}var ku=Symbol(),Au=Symbol(),ju=Symbol(),Mu=Symbol(),Nu=Symbol(),Pu=new TextEncoder,Fu=new TextDecoder;function Iu(e){return typeof e==`string`?Pu.encode(e):Fu.decode(e)}var Lu,Ru;if(Uint8Array.prototype.toBase64)Lu=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;Lu=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join(``)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}}function zu(e){return typeof e==`string`?Ru(e):Lu(e)}Ru=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw Ou(`The input to be decoded is not correctly encoded.`,Eu,e)}}:e=>{try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw Ou(`The input to be decoded is not correctly encoded.`,Eu,e)}};var Bu=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`code`,void 0),this.name=this.constructor.name,this.code=Pd,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}},Vu=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`code`,void 0),this.name=this.constructor.name,t!=null&&t.code&&(this.code=t?.code),(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}};function X(e,t,n){return new Vu(e,{code:t,cause:n})}function Hu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Uu(e){Tu(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e??{});if(wu&&!t.has(`user-agent`)&&t.set(`user-agent`,wu),t.has(`authorization`))throw Ou(`"options.headers" must not include the "authorization" header name`,Eu);return t}function Wu(e,t){if(t!==void 0){if(typeof t==`function`&&(t=t(e.href)),!(t instanceof AbortSignal))throw Ou(`"options.signal" must return or be an instance of AbortSignal`,Du);return t}}function Gu(e,t,n,r,i){try{if(typeof e!=`number`||!Number.isFinite(e))throw Ou(`${n} must be a number`,Du,i);if(e>0)return;if(t){if(e!==0)throw Ou(`${n} must be a non-negative number`,Eu,i);return}throw Ou(`${n} must be a positive number`,Eu,i)}catch(e){throw r?X(e.message,r,i):e}}function Ku(e,t,n,r){try{if(typeof e!=`string`)throw Ou(`${t} must be a string`,Du,r);if(e.length===0)throw Ou(`${t} must not be empty`,Eu,r)}catch(e){throw n?X(e.message,n,r):e}}function qu(e){(function(e,t){if(gd(e)!==t)throw function(e){let t=`"response" content-type must be `;var n=[...arguments].slice(1);if(n.length>2){let e=n.pop();t+=`${n.join(`, `)}, or ${e}`}else n.length===2?t+=`${n[0]} or ${n[1]}`:t+=n[0];return X(t,Ld,e)}(e,t)})(e,`application/json`)}function Ju(e){let t=e?.[Au];return typeof t==`number`&&Number.isFinite(t)?t:0}function Yu(e){let t=e?.[ju];return typeof t==`number`&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function Xu(){return Math.floor(Date.now()/1e3)}function Zu(e){if(typeof e!=`object`||!e)throw Ou(`"as" must be an object`,Du);Ku(e.issuer,`"as.issuer"`)}function Qu(e){if(typeof e!=`object`||!e)throw Ou(`"client" must be an object`,Du);Ku(e.client_id,`"client.client_id"`)}function $u(e){return Ku(e,`"clientSecret"`),(t,n,r,i)=>{r.set(`client_id`,n.client_id),r.set(`client_secret`,e)}}var ed=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function td(e,t){if(t&&e.protocol!==`https:`)throw X(`only requests to HTTPS are allowed`,zd,e);if(e.protocol!==`https:`&&e.protocol!==`http:`)throw X(`only HTTP and HTTPS requests are allowed`,Bd,e)}function nd(e,t,n,r){let i;if(typeof e!=`string`||!(i=ed(e)))throw X(`authorization server metadata does not contain a valid ${n?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,e===void 0?Wd:Gd,{attribute:n?`mtls_endpoint_aliases.${t}`:t});return td(i,r),i}function rd(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?nd(e.mtls_endpoint_aliases[t],t,n,r):nd(e[t],t,n,r)}var id=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`cause`,void 0),Y(this,`code`,void 0),Y(this,`error`,void 0),Y(this,`status`,void 0),Y(this,`error_description`,void 0),Y(this,`response`,void 0),this.name=this.constructor.name,this.code=Nd,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,`response`,{enumerable:!1,value:t.response}),(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}},ad=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`cause`,void 0),Y(this,`code`,void 0),Y(this,`error`,void 0),Y(this,`error_description`,void 0),this.name=this.constructor.name,this.code=Fd,this.cause=t.cause,this.error=t.cause.get(`error`),this.error_description=t.cause.get(`error_description`)??void 0,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}},od=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`cause`,void 0),Y(this,`code`,void 0),Y(this,`response`,void 0),Y(this,`status`,void 0),this.name=this.constructor.name,this.code=Md,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,`response`,{enumerable:!1}),(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}},sd="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",cd=`(`+sd+`)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"`,ld=`(`+sd+")\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)",ud=RegExp(`^[,\\s]*(`+sd+`)`),dd=RegExp(`^[,\\s]*`+cd+`[,\\s]*(.*)`),fd=RegExp(`^[,\\s]*`+ld+`[,\\s]*(.*)`),pd=RegExp(`^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)`);async function md(e,t,n){if(e.status!==t){let t;throw function(e){let t;if(t=function(e){if(!Tu(e,Response))throw Ou(`"response" must be an instance of Response`,Du);let t=e.headers.get(`www-authenticate`);if(t===null)return;let n=[],r=t;for(;r;){let e=r.match(ud),t=e?.[1].toLowerCase();if(!t)return;let s=r.substring(e[0].length);if(s&&!s.match(/^[\s,]/))return;let c=s.match(/^\s+(.*)$/),l=!!c;r=c?c[1]:void 0;let u={},d;if(l)for(;r;){let t,n;if(e=r.match(dd)){var i=au(e,4);if(t=i[1],n=i[2],r=i[3],n.includes(`\\`))try{n=JSON.parse(`"${n}"`)}catch{}u[t.toLowerCase()]=n}else{if(!(e=r.match(fd))){if(e=r.match(pd)){if(Object.keys(u).length)break;var a=au(e,3);d=a[1],r=a[2];break}return}var o=au(e,4);t=o[1],n=o[2],r=o[3],u[t.toLowerCase()]=n}}else r=s||void 0;let f={scheme:t,parameters:u};d&&(f.token68=d),n.push(f)}return n.length?n:void 0}(e))throw new od(`server responded with a challenge in the WWW-Authenticate HTTP Header`,{cause:t,response:e})}(e),(t=await async function(e){if(e.status>399&&e.status<500){Kd(e),qu(e);try{let t=await e.clone().json();if(Hu(t)&&typeof t.error==`string`&&t.error.length)return t}catch{}}}(e))?(await e.body?.cancel(),new id(`server responded with an error in the response body`,{cause:t,response:e})):X(`"response" is not a conform ${n} response (unexpected HTTP status code)`,Rd,e)}}function hd(e){if(!Td.has(e))throw Ou(`"options.DPoP" is not a valid DPoPHandle`,Eu)}function gd(e){return e.headers.get(`content-type`)?.split(`;`)[0]}async function _d(e,t,n,r,i,a,o){return await n(e,t,i,a),a.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`),(o?.[Mu]||fetch)(r.href,{body:i,headers:Object.fromEntries(a.entries()),method:`POST`,redirect:`manual`,signal:Wu(r,o?.signal)})}async function vd(e,t,n,r,i,a){var o;let s=rd(e,`token_endpoint`,t.use_mtls_endpoint_aliases,!0!==a?.[ku]);i.set(`grant_type`,r);let c=Uu(a?.headers);c.set(`accept`,`application/json`),a?.DPoP!==void 0&&(hd(a.DPoP),await a.DPoP.addProof(s,c,`POST`));let l=await _d(e,t,n,s,i,c,a);return a==null||(o=a.DPoP)==null||o.cacheNonce(l,s),l}var yd=new WeakMap,bd=new WeakMap;function xd(e){if(!e.id_token)return;let t=yd.get(e);if(!t)throw Ou(`"ref" was already garbage collected or did not resolve from the proper sources`,Eu);return t}async function Sd(e,t,n,r,i,a){if(Zu(e),Qu(t),!Tu(n,Response))throw Ou(`"response" must be an instance of Response`,Du);await md(n,200,`Token Endpoint`),Kd(n);let o=await $d(n);if(Ku(o.access_token,`"response" body "access_token" property`,Z,{body:o}),Ku(o.token_type,`"response" body "token_type" property`,Z,{body:o}),o.token_type=o.token_type.toLowerCase(),o.expires_in!==void 0){let e=typeof o.expires_in==`number`?o.expires_in:parseFloat(o.expires_in);Gu(e,!0,`"response" body "expires_in" property`,Z,{body:o}),o.expires_in=e}if(o.refresh_token!==void 0&&Ku(o.refresh_token,`"response" body "refresh_token" property`,Z,{body:o}),o.scope!==void 0&&typeof o.scope!=`string`)throw X(`"response" body "scope" property must be a string`,Z,{body:o});if(o.id_token!==void 0){Ku(o.id_token,`"response" body "id_token" property`,Z,{body:o});let a=[`aud`,`exp`,`iat`,`iss`,`sub`];!0===t.require_auth_time&&a.push(`auth_time`),t.default_max_age!==void 0&&(Gu(t.default_max_age,!0,`"client.default_max_age"`),a.push(`auth_time`)),r!=null&&r.length&&a.push(...r);let s=await async function(e,t,n,r,i){let a,o,s=e.split(`.`),c=s[0],l=s[1],u=s.length;if(u===5){if(i===void 0)throw new Bu(`JWE decryption is not configured`,{cause:e});var d=(e=await i(e)).split(`.`);c=d[0],l=d[1],u=d.length}if(u!==3)throw X(`Invalid JWT`,Z,e);try{a=JSON.parse(Iu(zu(c)))}catch(e){throw X(`failed to parse JWT Header body as base64url encoded JSON`,Id,e)}if(!Hu(a))throw X(`JWT Header must be a top level object`,Z,e);if(t(a),a.crit!==void 0)throw new Bu(`no JWT "crit" header parameter extensions are supported`,{cause:{header:a}});try{o=JSON.parse(Iu(zu(l)))}catch(e){throw X(`failed to parse JWT Payload body as base64url encoded JSON`,Id,e)}if(!Hu(o))throw X(`JWT Payload must be a top level object`,Z,e);let f=Xu()+n;if(o.exp!==void 0){if(typeof o.exp!=`number`)throw X(`unexpected JWT "exp" (expiration time) claim type`,Z,{claims:o});if(o.exp<=f-r)throw X(`unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp`,Vd,{claims:o,now:f,tolerance:r,claim:`exp`})}if(o.iat!==void 0&&typeof o.iat!=`number`)throw X(`unexpected JWT "iat" (issued at) claim type`,Z,{claims:o});if(o.iss!==void 0&&typeof o.iss!=`string`)throw X(`unexpected JWT "iss" (issuer) claim type`,Z,{claims:o});if(o.nbf!==void 0){if(typeof o.nbf!=`number`)throw X(`unexpected JWT "nbf" (not before) claim type`,Z,{claims:o});if(o.nbf>f+r)throw X(`unexpected JWT "nbf" (not before) claim value`,Vd,{claims:o,now:f,tolerance:r,claim:`nbf`})}if(o.aud!==void 0&&typeof o.aud!=`string`&&!Array.isArray(o.aud))throw X(`unexpected JWT "aud" (audience) claim type`,Z,{claims:o});return{header:a,claims:o,jwt:e}}(o.id_token,Jd.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,`RS256`),Ju(t),Yu(t),i).then(Od.bind(void 0,a)).then(wd.bind(void 0,e)).then(Cd.bind(void 0,t.client_id)),c=s.claims,l=s.jwt;if(Array.isArray(c.aud)&&c.aud.length!==1){if(c.azp===void 0)throw X(`ID Token "aud" (audience) claim includes additional untrusted audiences`,Hd,{claims:c,claim:`aud`});if(c.azp!==t.client_id)throw X(`unexpected ID Token "azp" (authorized party) claim value`,Hd,{expected:t.client_id,claims:c,claim:`azp`})}c.auth_time!==void 0&&Gu(c.auth_time,!0,`ID Token "auth_time" (authentication time)`,Z,{claims:c}),bd.set(n,l),yd.set(o,c)}if(a?.[o.token_type]!==void 0)a[o.token_type](n,o);else if(o.token_type!==`dpop`&&o.token_type!==`bearer`)throw new Bu("unsupported `token_type` value",{cause:{body:o}});return o}function Cd(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw X(`unexpected JWT "aud" (audience) claim value`,Hd,{expected:e,claims:t.claims,claim:`aud`})}else if(t.claims.aud!==e)throw X(`unexpected JWT "aud" (audience) claim value`,Hd,{expected:e,claims:t.claims,claim:`aud`});return t}function wd(e,t){let n=e[ef]?.call(e,t)??e.issuer;if(t.claims.iss!==n)throw X(`unexpected JWT "iss" (issuer) claim value`,Hd,{expected:n,claims:t.claims,claim:`iss`});return t}var Td=new WeakSet,Ed=Symbol(),Dd={aud:`audience`,c_hash:`code hash`,client_id:`client id`,exp:`expiration time`,iat:`issued at`,iss:`issuer`,jti:`jwt id`,nonce:`nonce`,s_hash:`state hash`,sub:`subject`,ath:`access token hash`,htm:`http method`,htu:`http uri`,cnf:`confirmation`,auth_time:`authentication time`};function Od(e,t){for(let n of e)if(t.claims[n]===void 0)throw X(`JWT "${n}" (${Dd[n]}) claim missing`,Z,{claims:t.claims});return t}var kd=Symbol(),Ad=Symbol();async function jd(e,t,n,r){return typeof r?.expectedNonce==`string`||typeof r?.maxAge==`number`||r!=null&&r.requireIdToken?async function(e,t,n,r,i,a,o){let s=[];switch(r){case void 0:r=kd;break;case kd:break;default:Ku(r,`"expectedNonce" argument`),s.push(`nonce`)}switch(i??=t.default_max_age,i){case void 0:i=Ad;break;case Ad:break;default:Gu(i,!0,`"maxAge" argument`),s.push(`auth_time`)}let c=await Sd(e,t,n,s,a,o);Ku(c.id_token,`"response" body "id_token" property`,Z,{body:c});let l=xd(c);if(i!==Ad){let e=Xu()+Ju(t),n=Yu(t);if(l.auth_time+i<e-n)throw X(`too much time has elapsed since the last End-User authentication`,Vd,{claims:l,now:e,tolerance:n,claim:`auth_time`})}if(r===kd){if(l.nonce!==void 0)throw X(`unexpected ID Token "nonce" claim value`,Hd,{expected:void 0,claims:l,claim:`nonce`})}else if(l.nonce!==r)throw X(`unexpected ID Token "nonce" claim value`,Hd,{expected:r,claims:l,claim:`nonce`});return c}(e,t,n,r.expectedNonce,r.maxAge,r[Nu],r.recognizedTokenTypes):async function(e,t,n,r,i){let a=await Sd(e,t,n,void 0,r,i),o=xd(a);if(o){if(t.default_max_age!==void 0){Gu(t.default_max_age,!0,`"client.default_max_age"`);let e=Xu()+Ju(t),n=Yu(t);if(o.auth_time+t.default_max_age<e-n)throw X(`too much time has elapsed since the last End-User authentication`,Vd,{claims:o,now:e,tolerance:n,claim:`auth_time`})}if(o.nonce!==void 0)throw X(`unexpected ID Token "nonce" claim value`,Hd,{expected:void 0,claims:o,claim:`nonce`})}return a}(e,t,n,r?.[Nu],r?.recognizedTokenTypes)}var Md=`OAUTH_WWW_AUTHENTICATE_CHALLENGE`,Nd=`OAUTH_RESPONSE_BODY_ERROR`,Pd=`OAUTH_UNSUPPORTED_OPERATION`,Fd=`OAUTH_AUTHORIZATION_RESPONSE_ERROR`,Id=`OAUTH_PARSE_ERROR`,Z=`OAUTH_INVALID_RESPONSE`,Ld=`OAUTH_RESPONSE_IS_NOT_JSON`,Rd=`OAUTH_RESPONSE_IS_NOT_CONFORM`,zd=`OAUTH_HTTP_REQUEST_FORBIDDEN`,Bd=`OAUTH_REQUEST_PROTOCOL_FORBIDDEN`,Vd=`OAUTH_JWT_TIMESTAMP_CHECK_FAILED`,Hd=`OAUTH_JWT_CLAIM_COMPARISON_FAILED`,Ud=`OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED`,Wd=`OAUTH_MISSING_SERVER_METADATA`,Gd=`OAUTH_INVALID_SERVER_METADATA`;function Kd(e){if(e.bodyUsed)throw Ou(`"response" body has been used already`,Eu)}async function qd(e){if(e.method!==`POST`)throw Ou(`form_post responses are expected to use the POST method`,Eu,{cause:e});if(gd(e)!==`application/x-www-form-urlencoded`)throw Ou(`form_post responses are expected to use the application/x-www-form-urlencoded content-type`,Eu,{cause:e});return async function(e){if(e.bodyUsed)throw Ou(`form_post Request instances must contain a readable body`,Eu,{cause:e});return e.text()}(e)}function Jd(e,t,n,r){if(e===void 0)if(Array.isArray(t)){if(!t.includes(r.alg))throw X(`unexpected JWT "alg" header parameter`,Z,{header:r,expected:t,reason:`authorization server metadata`})}else{if(n===void 0)throw X(`missing client or server configuration to verify used JWT "alg" header parameter`,void 0,{client:e,issuer:t,fallback:n});if(typeof n==`string`?r.alg!==n:typeof n==`function`?!n(r.alg):!n.includes(r.alg))throw X(`unexpected JWT "alg" header parameter`,Z,{header:r,expected:n,reason:`default value`})}else if(typeof e==`string`?r.alg!==e:!e.includes(r.alg))throw X(`unexpected JWT "alg" header parameter`,Z,{header:r,expected:e,reason:`client configuration`})}function Yd(e,t){let n=e.getAll(t),r=n[0];if(n.length>1)throw X(`"${t}" parameter must be provided only once`,Z);return r}var Xd=Symbol(),Zd=Symbol();function Qd(e,t,n,r){if(Zu(e),Qu(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Ou(`"parameters" must be an instance of URLSearchParams, or URL`,Du);if(Yd(n,`response`))throw X(`"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()`,Z,{parameters:n});let i=Yd(n,`iss`),a=Yd(n,`state`);if(!i&&e.authorization_response_iss_parameter_supported)throw X(`response parameter "iss" (issuer) missing`,Z,{parameters:n});if(i&&i!==e.issuer)throw X(`unexpected "iss" (issuer) response parameter value`,Z,{expected:e.issuer,parameters:n});switch(r){case void 0:case Zd:if(a!==void 0)throw X(`unexpected "state" response parameter encountered`,Z,{expected:void 0,parameters:n});break;case Xd:break;default:if(Ku(r,`"expectedState" argument`),a!==r)throw X(a===void 0?`response parameter "state" missing`:`unexpected "state" response parameter value`,Z,{expected:r,parameters:n})}if(Yd(n,`error`))throw new ad(`authorization response from the server is an error`,{cause:n});let o=Yd(n,`id_token`),s=Yd(n,`token`);if(o!==void 0||s!==void 0)throw new Bu(`implicit and hybrid flows are not supported`);return c=new URLSearchParams(n),Td.add(c),c;var c}async function $d(e){let t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qu;try{t=await e.json()}catch(t){throw n(e),X(`failed to parse "response" body as JSON`,Id,t)}if(!Hu(t))throw X(`"response" body must be a top level object`,Z,{body:t});return t}var ef=Symbol();new TextEncoder,new TextDecoder;var tf=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`code`,`ERR_JOSE_GENERIC`),this.name=this.constructor.name,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}};Y(tf,`code`,`ERR_JOSE_GENERIC`),Y(class extends tf{constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`unspecified`,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`unspecified`;super(e,{cause:{claim:n,reason:r,payload:t}}),Y(this,`code`,`ERR_JWT_CLAIM_VALIDATION_FAILED`),Y(this,`claim`,void 0),Y(this,`reason`,void 0),Y(this,`payload`,void 0),this.claim=n,this.reason=r,this.payload=t}},`code`,`ERR_JWT_CLAIM_VALIDATION_FAILED`),Y(class extends tf{constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`unspecified`,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`unspecified`;super(e,{cause:{claim:n,reason:r,payload:t}}),Y(this,`code`,`ERR_JWT_EXPIRED`),Y(this,`claim`,void 0),Y(this,`reason`,void 0),Y(this,`payload`,void 0),this.claim=n,this.reason=r,this.payload=t}},`code`,`ERR_JWT_EXPIRED`),Y(class extends tf{constructor(){super(...arguments),Y(this,`code`,`ERR_JOSE_ALG_NOT_ALLOWED`)}},`code`,`ERR_JOSE_ALG_NOT_ALLOWED`),Y(class extends tf{constructor(){super(...arguments),Y(this,`code`,`ERR_JOSE_NOT_SUPPORTED`)}},`code`,`ERR_JOSE_NOT_SUPPORTED`),Y(class extends tf{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`decryption operation failed`,arguments.length>1?arguments[1]:void 0),Y(this,`code`,`ERR_JWE_DECRYPTION_FAILED`)}},`code`,`ERR_JWE_DECRYPTION_FAILED`),Y(class extends tf{constructor(){super(...arguments),Y(this,`code`,`ERR_JWE_INVALID`)}},`code`,`ERR_JWE_INVALID`),Y(class extends tf{constructor(){super(...arguments),Y(this,`code`,`ERR_JWS_INVALID`)}},`code`,`ERR_JWS_INVALID`),Y(class extends tf{constructor(){super(...arguments),Y(this,`code`,`ERR_JWT_INVALID`)}},`code`,`ERR_JWT_INVALID`),Y(class extends tf{constructor(){super(...arguments),Y(this,`code`,`ERR_JWK_INVALID`)}},`code`,`ERR_JWK_INVALID`),Y(class extends tf{constructor(){super(...arguments),Y(this,`code`,`ERR_JWKS_INVALID`)}},`code`,`ERR_JWKS_INVALID`),Y(class extends tf{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`no applicable key found in the JSON Web Key Set`,arguments.length>1?arguments[1]:void 0),Y(this,`code`,`ERR_JWKS_NO_MATCHING_KEY`)}},`code`,`ERR_JWKS_NO_MATCHING_KEY`),Y(class extends tf{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`multiple matching keys found in the JSON Web Key Set`,arguments.length>1?arguments[1]:void 0),Y(this,Symbol.asyncIterator,void 0),Y(this,`code`,`ERR_JWKS_MULTIPLE_MATCHING_KEYS`)}},`code`,`ERR_JWKS_MULTIPLE_MATCHING_KEYS`),Y(class extends tf{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`request timed out`,arguments.length>1?arguments[1]:void 0),Y(this,`code`,`ERR_JWKS_TIMEOUT`)}},`code`,`ERR_JWKS_TIMEOUT`),Y(class extends tf{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:`signature verification failed`,arguments.length>1?arguments[1]:void 0),Y(this,`code`,`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`)}},`code`,`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`);var nf,rf,af,of;(typeof navigator>`u`||(nf=navigator.userAgent)==null||(rf=nf.startsWith)==null||!rf.call(nf,`Mozilla/5.0 `))&&(of=`openid-client/v6.8.4`,af={"user-agent":of});var sf=e=>cf.get(e),cf,lf;function uf(e){return e===void 0?(lf||=new WeakMap,(e,t,n,r)=>{let i;return(i=lf.get(t))||(function(e,t){if(typeof e!=`string`)throw mf(`${t} must be a string`,pf);if(e.length===0)throw mf(`${t} must not be empty`,ff)}(t.client_secret,`"metadata.client_secret"`),i=$u(t.client_secret),lf.set(t,i)),i(e,t,n,r)}):$u(e)}var df=Mu,ff=`ERR_INVALID_ARG_VALUE`,pf=`ERR_INVALID_ARG_TYPE`;function mf(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}var hf=class extends Error{constructor(e,t){var n;super(e,t),Y(this,`code`,void 0),this.name=this.constructor.name,this.code=t?.code,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}};function gf(e,t,n){return new hf(e,{cause:t,code:n})}function _f(e){if(e instanceof TypeError||e instanceof hf||e instanceof id||e instanceof ad||e instanceof od)throw e;if(e instanceof Vu)switch(e.code){case zd:throw gf(`only requests to HTTPS are allowed`,e,e.code);case Bd:throw gf(`only requests to HTTP or HTTPS are allowed`,e,e.code);case Rd:throw gf(`unexpected HTTP response status code`,e.cause,e.code);case Ld:throw gf(`unexpected response content-type`,e.cause,e.code);case Id:throw gf(`parsing error occured`,e,e.code);case Z:throw gf(`invalid response encountered`,e,e.code);case Hd:throw gf(`unexpected JWT claim value encountered`,e,e.code);case Ud:throw gf(`unexpected JSON attribute value encountered`,e,e.code);case Vd:throw gf(`JWT timestamp claim value failed validation`,e,e.code);default:throw gf(e.message,e,e.code)}if(e instanceof Bu)throw gf(`unsupported operation`,e,e.code);if(e instanceof DOMException)switch(e.name){case`OperationError`:throw gf(`runtime operation error`,e,Pd);case`NotSupportedError`:throw gf(`runtime unsupported operation`,e,Pd);case`TimeoutError`:throw gf(`operation timed out`,e,`OAUTH_TIMEOUT`);case`AbortError`:throw gf(`operation aborted`,e,`OAUTH_ABORT`)}throw new hf(`something went wrong`,{cause:e})}new TextDecoder;var vf=Symbol(),yf=class{constructor(e,t,n,r){if(typeof t!=`string`||!t.length)throw mf(`"clientId" must be a non-empty string`,pf);if(typeof n==`string`&&(n={client_secret:n}),n?.client_id!==void 0&&t!==n.client_id)throw mf(`"clientId" and "metadata.client_id" must be the same`,ff);let i=iu(iu({},structuredClone(n)),{},{client_id:t}),a;i[Au]=n?.[Au]??0,i[ju]=n?.[ju]??30,a=r||(typeof i.client_secret==`string`&&i.client_secret.length?uf(i.client_secret):(e,t,n,r)=>{n.set(`client_id`,t.client_id)});let o=Object.freeze(i),s=structuredClone(e);vf in e&&(s[ef]=t=>{let n=t.claims.tid;return e.issuer.replace(`{tenantid}`,n)});let c=Object.freeze(s);cf||=new WeakMap,cf.set(this,{__proto__:null,as:c,c:o,auth:a,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(sf(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`S256`;return!0===e.code_challenge_methods_supported?.includes(t)}}}}(e))}(e),e}clientMetadata(){return structuredClone(sf(this).c)}get timeout(){return sf(this).timeout}set timeout(e){sf(this).timeout=e}get[df](){return sf(this).fetch}set[df](e){sf(this).fetch=e}};function bf(e){Object.defineProperties(e,function(e){let t;if(e.expires_in!==void 0){let n=new Date;n.setSeconds(n.getSeconds()+e.expires_in),t=n.getTime()}return{expiresIn:{__proto__:null,value(){if(t){let e=Date.now();return t>e?Math.floor((t-e)/1e3):0}}},claims:{__proto__:null,value(){try{return xd(this)}catch{return}}}}}(e))}async function xf(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=e.headers.get(`retry-after`)?.trim();if(i===void 0)return;let a;if(/^\d+$/.test(i))a=parseInt(i,10);else{let e=new Date(i);if(Number.isFinite(e.getTime())){let t=new Date,n=e.getTime()-t.getTime();n>0&&(a=Math.ceil(n/1e3))}}if(r&&!Number.isFinite(a))throw new Vu(`invalid Retry-After header value`,{cause:e});a>t&&await Sf(a-t,n)}function Sf(e,t){return new Promise((n,r)=>{let i=e=>{try{t.throwIfAborted()}catch(e){r(e);return}if(e<=0)return void n();let a=Math.min(e,5);setTimeout(()=>i(e-a),1e3*a)};i(e)})}async function Cf(e,t,n,r){kf(e),n=new URLSearchParams(n);let i=t.interval??5,a=r?.signal??AbortSignal.timeout(1e3*t.expires_in);try{await Sf(i,a)}catch(e){_f(e)}let o=sf(e),s=o.as,c=o.c,l=o.auth,u=o.fetch,d=o.tlsOnly,f=o.nonRepudiation,p=o.timeout,m=o.decrypt,h=(i,o)=>Cf(e,iu(iu({},t),{},{interval:i}),n,iu(iu({},r),{},{signal:a,flag:o})),g=function(e,t){let n=Af(t);if(!n)return{signal:e,cleanup(){}};let r=new AbortController,i=e=>{let t=e.target;r.abort(t.reason)};return e.aborted?r.abort(e.reason):n.aborted?r.abort(n.reason):(e.addEventListener(`abort`,i,{once:!0}),n.addEventListener(`abort`,i,{once:!0})),{signal:r.signal,cleanup(){e.removeEventListener(`abort`,i),n.removeEventListener(`abort`,i)}}}(a,p),_=await async function(e,t,n,r,i){Zu(e),Qu(t),Ku(r,`"authReqId"`);let a=new URLSearchParams(i?.additionalParameters);return a.set(`auth_req_id`,r),vd(e,t,n,`urn:openid:params:grant-type:ciba`,a,i)}(s,c,l,t.auth_req_id,{[Mu]:u,[ku]:!d,additionalParameters:n,DPoP:r?.DPoP,headers:new Headers(af),signal:g.signal}).catch(_f).finally(g.cleanup);if(_.status===503&&_.headers.has(`retry-after`))return await xf(_,i,a,!0),await _.body?.cancel(),h(i);let v=async function(e,t,n,r){return Sd(e,t,n,void 0,r?.[Nu],r?.recognizedTokenTypes)}(s,c,_,{[Nu]:m}),y;try{y=await v}catch(e){if(jf(e,r))return h(i,Mf);if(e instanceof id)switch(e.error){case`slow_down`:i+=5;case`authorization_pending`:return await xf(e.response,i,a),h(i)}_f(e)}return y.id_token&&await f?.(_),bf(y),y}async function wf(e,t,n,r,i){if(kf(e),!(i?.flag===Mf||t instanceof URL||function(e,t){try{return Object.getPrototypeOf(e)[Symbol.toStringTag]===t}catch{return!1}}(t,`Request`)))throw mf(`"currentUrl" must be an instance of URL, or Request`,pf);let a,o,s=sf(e),c=s.as,l=s.c,u=s.auth,d=s.fetch,f=s.tlsOnly,p=s.jarm,m=s.hybrid,h=s.nonRepudiation,g=s.timeout,_=s.decrypt,v=s.implicit;if(i?.flag===Mf)a=i.authResponse,o=i.redirectUri;else{if(!(t instanceof URL)){let e=t;switch(t=new URL(t.url),e.method){case`GET`:break;case`POST`:let n=new URLSearchParams(await qd(e));if(m)t.hash=n.toString();else for(let e of n.entries()){var y=au(e,2);let n=y[0],r=y[1];t.searchParams.append(n,r)}break;default:throw mf(`unexpected Request HTTP method`,ff)}}switch(o=function(e){return(e=new URL(e)).search=``,e.hash=``,e.href}(t),!0){case!!p:a=await p(t,n?.expectedState);break;case!!m:a=await m(t,n?.expectedNonce,n?.expectedState,n?.maxAge);break;case!!v:throw TypeError(`authorizationCodeGrant() cannot be used by response_type=id_token clients`);default:try{a=Qd(c,l,t.searchParams,n?.expectedState)}catch(e){_f(e)}}}let b=await async function(e,t,n,r,i,a,o){if(Zu(e),Qu(t),!Td.has(r))throw Ou(`"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()`,Eu);Ku(i,`"redirectUri"`);let s=Yd(r,`code`);if(!s)throw X(`no authorization code in "callbackParameters"`,Z);let c=new URLSearchParams(o?.additionalParameters);return c.set(`redirect_uri`,i),c.set(`code`,s),a!==Ed&&(Ku(a,`"codeVerifier"`),c.set(`code_verifier`,a)),vd(e,t,n,`authorization_code`,c,o)}(c,l,u,a,o,n?.pkceCodeVerifier||Ed,{additionalParameters:r,[Mu]:d,[ku]:!f,DPoP:i?.DPoP,headers:new Headers(af),signal:Af(g)}).catch(_f);typeof n?.expectedNonce!=`string`&&typeof n?.maxAge!=`number`||(n.idTokenExpected=!0);let x=jd(c,l,b,{expectedNonce:n?.expectedNonce,maxAge:n?.maxAge,requireIdToken:n?.idTokenExpected,[Nu]:_}),S;try{S=await x}catch(t){if(jf(t,i))return wf(e,void 0,n,r,iu(iu({},i),{},{flag:Mf,authResponse:a,redirectUri:o}));_f(t)}return S.id_token&&await h?.(b),bf(S),S}async function Tf(e,t,n,r){kf(e),n=new URLSearchParams(n);let i=sf(e),a=i.as,o=i.c,s=i.auth,c=i.fetch,l=i.tlsOnly,u=i.nonRepudiation,d=i.timeout,f=i.decrypt,p=await async function(e,t,n,r,i){Zu(e),Qu(t),Ku(r,`"refreshToken"`);let a=new URLSearchParams(i?.additionalParameters);return a.set(`refresh_token`,r),vd(e,t,n,`refresh_token`,a,i)}(a,o,s,t,{[Mu]:c,[ku]:!l,additionalParameters:n,DPoP:r?.DPoP,headers:new Headers(af),signal:Af(d)}).catch(_f),m=async function(e,t,n,r){return Sd(e,t,n,void 0,r?.[Nu],r?.recognizedTokenTypes)}(a,o,p,{[Nu]:f}),h;try{h=await m}catch(i){if(jf(i,r))return Tf(e,t,n,iu(iu({},r),{},{flag:Mf}));_f(i)}return h.id_token&&await u?.(p),bf(h),h}async function Ef(e,t,n){kf(e),t=new URLSearchParams(t);let r=sf(e),i=r.as,a=r.c,o=r.auth,s=r.fetch,c=r.tlsOnly,l=r.timeout,u=async function(e,t,n,r){return Sd(e,t,n,void 0,r?.[Nu],r?.recognizedTokenTypes)}(i,a,await async function(e,t,n,r,i){return Zu(e),Qu(t),vd(e,t,n,`client_credentials`,new URLSearchParams(r),i)}(i,a,o,t,{[Mu]:s,[ku]:!c,DPoP:n?.DPoP,headers:new Headers(af),signal:Af(l)}).catch(_f)),d;try{d=await u}catch(r){if(jf(r,n))return Ef(e,t,iu(iu({},n),{},{flag:Mf}));_f(r)}return bf(d),d}function Df(e,t){kf(e);let n=sf(e),r=n.as,i=n.c,a=n.tlsOnly,o=n.hybrid,s=n.jarm,c=n.implicit,l=rd(r,`authorization_endpoint`,!1,a);if((t=new URLSearchParams(t)).has(`client_id`)||t.set(`client_id`,i.client_id),!t.has(`request_uri`)&&!t.has(`request`)){if(t.has(`response_type`)||t.set(`response_type`,o?`code id_token`:c?`id_token`:`code`),c&&!t.has(`nonce`))throw mf(`response_type=id_token clients must provide a nonce parameter in their authorization request parameters`,ff);s&&t.set(`response_mode`,`jwt`)}for(let e of t.entries()){var u=au(e,2);let t=u[0],n=u[1];l.searchParams.append(t,n)}return l}async function Of(e,t,n){kf(e);let r=Df(e,t),i=sf(e),a=i.as,o=i.c,s=i.auth,c=i.fetch,l=i.tlsOnly,u=i.timeout,d=async function(e,t,n){if(Zu(e),Qu(t),!Tu(n,Response))throw Ou(`"response" must be an instance of Response`,Du);await md(n,201,`Pushed Authorization Request Endpoint`),Kd(n);let r=await $d(n);Ku(r.request_uri,`"response" body "request_uri" property`,Z,{body:r});let i=typeof r.expires_in==`number`?r.expires_in:parseFloat(r.expires_in);return Gu(i,!0,`"response" body "expires_in" property`,Z,{body:r}),r.expires_in=i,r}(a,o,await async function(e,t,n,r,i){var a;Zu(e),Qu(t);let o=rd(e,`pushed_authorization_request_endpoint`,t.use_mtls_endpoint_aliases,!0!==i?.[ku]),s=new URLSearchParams(r);s.set(`client_id`,t.client_id);let c=Uu(i?.headers);c.set(`accept`,`application/json`),i?.DPoP!==void 0&&(hd(i.DPoP),await i.DPoP.addProof(o,c,`POST`));let l=await _d(e,t,n,o,s,c,i);return i==null||(a=i.DPoP)==null||a.cacheNonce(l,o),l}(a,o,s,r.searchParams,{[Mu]:c,[ku]:!l,DPoP:n?.DPoP,headers:new Headers(af),signal:Af(u)}).catch(_f)),f;try{f=await d}catch(r){if(jf(r,n))return Of(e,t,iu(iu({},n),{},{flag:Mf}));_f(r)}return Df(e,{request_uri:f.request_uri})}function kf(e){if(!(e instanceof yf))throw mf(`"config" must be an instance of Configuration`,pf);if(Object.getPrototypeOf(e)!==yf.prototype)throw mf(`subclassing Configuration is not allowed`,ff)}function Af(e){return e?AbortSignal.timeout(1e3*e):void 0}function jf(e,t){return!(t==null||!t.DPoP||t.flag===Mf)&&function(e){if(e instanceof od){let t=e.cause,n=t[0];return t.length===1&&n.scheme===`dpop`&&n.parameters.error===`use_dpop_nonce`}return e instanceof id&&e.error===`use_dpop_nonce`}(e)}Object.freeze(yf.prototype);var Mf=Symbol();async function Nf(e,t,n,r){kf(e);let i=sf(e),a=i.as,o=i.c,s=i.auth,c=i.fetch,l=i.tlsOnly,u=i.timeout,d=i.decrypt,f=i.nonRepudiation,p=await async function(e,t,n,r,i,a){return Zu(e),Qu(t),Ku(r,`"grantType"`),vd(e,t,n,r,new URLSearchParams(i),a)}(a,o,s,t,new URLSearchParams(n),{[Mu]:c,[ku]:!l,DPoP:r?.DPoP,headers:new Headers(af),signal:Af(u)}).catch(_f),m;t===`urn:ietf:params:oauth:grant-type:token-exchange`&&(m={n_a:()=>{}});let h=async function(e,t,n,r){return Sd(e,t,n,void 0,r?.[Nu],r?.recognizedTokenTypes)}(a,o,p,{[Nu]:d,recognizedTokenTypes:m}),g;try{g=await h}catch(i){if(jf(i,r))return Nf(e,t,n,iu(iu({},r),{},{flag:Mf}));_f(i)}return g.id_token&&await f?.(p),bf(g),g}var Pf,Ff;typeof navigator>`u`||(Pf=navigator.userAgent)==null||(Ff=Pf.startsWith)==null||Ff.call(Pf,`Mozilla/5.0 `),Object.freeze(new Set([`grant_type`,`client_id`,`client_secret`,`client_assertion`,`client_assertion_type`,`subject_token`,`subject_token_type`,`requested_token_type`,`actor_token`,`actor_token_type`,`audience`,`aud`,`resource`,`resources`,`resource_indicator`,`scope`,`connection`,`login_hint`,`organization`,`assertion`]));var If={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},Q=function(){throw Error(`You forgot to wrap your component in <Auth0Provider>.`)},Lf=eu(eu({},If),{buildAuthorizeUrl:Q,buildLogoutUrl:Q,getAccessTokenSilently:Q,getAccessTokenWithPopup:Q,getIdTokenClaims:Q,loginWithCustomTokenExchange:Q,customTokenExchange:Q,exchangeToken:Q,loginWithRedirect:Q,loginWithPopup:Q,connectAccountWithRedirect:Q,logout:Q,handleRedirectCallback:Q,getDpopNonce:Q,setDpopNonce:Q,generateDpopProof:Q,createFetcher:Q,getConfiguration:Q,mfa:{getAuthenticators:Q,enroll:Q,challenge:Q,verify:Q,getEnrollmentFactors:Q},passkey:{signup:Q,login:Q},myAccount:{getFactors:Q,getAuthenticationMethods:Q,getAuthenticationMethod:Q,updateAuthenticationMethod:Q,deleteAuthenticationMethod:Q,enrollmentChallenge:Q,enrollmentVerify:Q}}),Rf=(0,q.createContext)(Lf);(function(e){$l(t,e);function t(n,r){var i=e.call(this,r??n)||this;return i.error=n,i.error_description=r,Object.setPrototypeOf(i,t.prototype),i}return t})(Error);var zf=function(e){return e===void 0&&(e=Rf),(0,q.useContext)(e)};function Bf(e){if(e!==void 0)return e>=500?`5xx`:e>=400?`4xx`:`other`}var Vf=new Set([`blastRadius`,`errorClass`,`errorType`,`errorStatus`,`errorStatusClass`,`errorTraceId`,`errorDetail`,`errorInstance`,`errorExpected`]);function Hf(e){if(e)return Object.fromEntries(Object.entries(e).filter(([e])=>!Vf.has(e)))}function Uf(e){return e instanceof Error?e.name:e===null?`null`:typeof e}function Wf(e,t,n){let r={blastRadius:t,errorClass:Uf(e)};(e instanceof Cc||e instanceof wc)&&(r.errorType=e.type,r.errorStatus=e.status,r.errorStatusClass=Bf(e.status),r.errorTraceId=e.traceId,r.errorDetail=e.detail,r.errorInstance=e.instance,r.errorExpected=e.type!==void 0&&yc.includes(e.type));let i=Object.fromEntries(Object.entries(r).filter(([,e])=>e!==void 0));return{...Hf(n),...i}}var Gf;function Kf(e){Gf=e}function qf(){return Gf}var Jf=(0,q.createContext)({get client(){return qf()},bootstrap:void 0}),Yf=function(e){return typeof e==`function`},Xf=function(){return(0,q.useContext)(Jf).client},Zf=function(e,t){return Zf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Zf(e,t)};function Qf(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Zf(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var $f={componentStack:null,exceptionEvent:null,error:null},ep={INVALID_FALLBACK:`[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element.`};(function(e){Qf(t,e);function t(t){var n=e.call(this,t)||this;return n.state=$f,n}return t.prototype.componentDidCatch=function(e,t){var n=this.props.additionalProperties,r;Yf(n)?r=n(e):typeof n==`object`&&(r=n);var i=this.context.client.captureException(e,r),a=t.componentStack;this.setState({error:e,componentStack:a??null,exceptionEvent:i})},t.prototype.render=function(){var e=this.props,t=e.children,n=e.fallback,r=this.state;if(r.componentStack==null)return Yf(t)?t():t;var i=Yf(n)?q.createElement(n,{error:r.error,componentStack:r.componentStack,exceptionEvent:r.exceptionEvent}):n;return q.isValidElement(i)?i:(console.warn(ep.INVALID_FALLBACK),q.createElement(q.Fragment,null))},t.contextType=Jf,t})(q.Component),Kf(fc);var tp=(e=>{let t=Object.create(e);return t.capture=function(t,...n){let[r,i]=n;return e.capture(t,r,i)},t.captureRaw=function(t,n,r){return e.capture(t,n,r)},new Proxy(t,{get(t,n){return n in t?t[n]:e[n]},set(t,n,r){return e[n]=r,!0}})})(fc),np=()=>(Xf(),tp),rp=()=>{let e=np();return{logEvent:(0,q.useCallback)(((t,n,r)=>{let i=e.capture;i(t,n,r)}),[e]),captureRaw:(0,q.useCallback)((t,n)=>{e.captureRaw(t,n)},[e]),captureException:(t,n,r=`action-failed`)=>{e.captureException(t,Wf(t,r,n))}}},ip=`acts_as`,ap=`https://zuplo.com/claims/acts_as`,op=`as_user`,sp=e=>{let t=e?.[ip];if(typeof t==`string`)return t;let n=e?.[ap];return typeof n==`string`?n:void 0},cp=new Set([`login_required`,`interaction_required`,`invalid_grant`,`missing_refresh_token`,`mfa_required`,`MfaRequiredError`,`MissingRefreshTokenError`]),lp=[`failed to fetch`,`load failed`,`timeout`,`no cached access token`],up=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.error==`string`)return t.error;if(typeof t.name==`string`)return t.name}},dp=e=>{let t=up(e);if(t===`timeout`||t===`TimeoutError`)return!0;if(typeof e==`object`&&e){let t=e;if(typeof t.message==`string`){let e=t.message.toLowerCase();return lp.some(t=>e.includes(t))}}return!1},fp=e=>{let t=up(e);return t!==void 0&&cp.has(t)?`session-ended`:dp(e)?`transient`:`unknown`},pp=e=>{if(typeof e==`object`&&e){let t=e;return{code:typeof t.error==`string`?t.error:typeof t.name==`string`?t.name:`unknown`,description:typeof t.error_description==`string`?t.error_description:void 0}}return{code:`unknown`}},mp=!1,hp=new Set,gp=()=>{if(!mp){mp=!0;try{`${window.location.pathname}${window.location.search}${window.location.hash}`}catch{}for(let e of hp)e()}},_p=(0,q.createContext)(void 0),vp=()=>{let e=(0,q.useContext)(_p),{user:t}=zf();if(e)return e;if(!t)throw Error(`This hook should never be used outside of a protected route.`);if(!t.sub)throw Error(`The user returned from Auth0 does not contain a 'sub'. Invalid state.`);return{email:t.email??`unknown@example.com`,name:t.name??``,userId:t.sub,asUser:sp(t)}},yp=(e,t)=>{let{code:n,description:r}=pp(e);return{auth0_error_code:n,...r?{auth0_error_description:r}:{},error_name:e instanceof Error?e.name:typeof e,failure_kind:t.kind,force_refresh:t.cacheMode===`off`,is_impersonating:t.isImpersonating,cache_mode:t.cacheMode,is_authenticated:t.isAuthenticated,cache_location:`memory`,online:typeof navigator>`u`?void 0:navigator.onLine,cookies_enabled:typeof navigator>`u`?void 0:navigator.cookieEnabled,visibility_state:typeof document>`u`?void 0:document.visibilityState,page_age_ms:typeof performance>`u`?void 0:Math.round(performance.now())}},bp=()=>{let e=(0,q.useContext)(_p),t=zf(),{captureException:n}=rp();return(0,q.useCallback)(async r=>{if(e)return`local-access-token`;let i=!!sp(t.user),a=typeof document<`u`&&document.visibilityState===`hidden`,o=i?`cache-only`:r?.forceRefresh?`off`:a?`cache-only`:`on`;try{let e=await t.getAccessTokenSilently({cacheMode:o,authorizationParams:{audience:kc,...i?{scope:`${Oc} ${ip} ${op}`}:{}}});if(!e){let e=Error(`No cached access token available`);throw e.error=`no_cached_access_token`,e}return e}catch(e){let r=fp(e),a=yp(e,{isImpersonating:i,cacheMode:o,isAuthenticated:t.isAuthenticated,kind:r});r===`session-ended`&&!i?(vc.info(`Access-token renewal failed; session ended`,a),gp()):r===`transient`?vc.info(`Access-token renewal failed transiently; not surfaced`,a):(vc.error(`Access-token renewal failed`,{error:e,...a}),n(e,a));let s=new wc(`Error retrieving access token`,e instanceof Error?e:Error(e));throw s.status=500,s}},[e,t,n])},xp=/\{[^{}]+\}/g,Sp=()=>typeof process==`object`&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function Cp(){return Math.random().toString(36).slice(2,11)}function wp(e){let{baseUrl:t=``,Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,headers:o,requestInitExt:s=void 0,...c}={...e};s=Sp()?s:void 0,t=Np(t);let l=[];async function u(e,u){let{baseUrl:d,fetch:f=r,Request:p=n,headers:m,params:h={},parseAs:g=`json`,querySerializer:_,bodySerializer:v=a??Ap,body:y,middleware:b=[],...x}=u||{},S=t;d&&(S=Np(d)??t);let C=typeof i==`function`?i:Op(i);_&&(C=typeof _==`function`?_:Op({...typeof i==`object`?i:{},..._}));let w=y===void 0?void 0:v(y,Mp(o,m,h.header)),T=Mp(w===void 0||w instanceof FormData?{}:{"Content-Type":`application/json`},o,m,h.header),E=[...l,...b],D={redirect:`follow`,...c,...x,body:w,headers:T},O,k,A=new p(jp(e,{baseUrl:S,params:h,querySerializer:C}),D),j;for(let e in x)e in A||(A[e]=x[e]);if(E.length){O=Cp(),k=Object.freeze({baseUrl:S,fetch:f,parseAs:g,querySerializer:C,bodySerializer:v});for(let t of E)if(t&&typeof t==`object`&&typeof t.onRequest==`function`){let n=await t.onRequest({request:A,schemaPath:e,params:h,options:k,id:O});if(n)if(n instanceof p)A=n;else if(n instanceof Response){j=n;break}else throw Error(`onRequest: must return new Request() or Response() when modifying the request`)}}if(!j){try{j=await f(A,s)}catch(t){let n=t;if(E.length)for(let t=E.length-1;t>=0;t--){let r=E[t];if(r&&typeof r==`object`&&typeof r.onError==`function`){let t=await r.onError({request:A,error:n,schemaPath:e,params:h,options:k,id:O});if(t){if(t instanceof Response){n=void 0,j=t;break}if(t instanceof Error){n=t;continue}throw Error(`onError: must return new Response() or instance of Error`)}}}if(n)throw n}if(E.length)for(let t=E.length-1;t>=0;t--){let n=E[t];if(n&&typeof n==`object`&&typeof n.onResponse==`function`){let t=await n.onResponse({request:A,response:j,schemaPath:e,params:h,options:k,id:O});if(t){if(!(t instanceof Response))throw Error(`onResponse: must return new Response() when modifying the response`);j=t}}}}if(j.status===204||A.method===`HEAD`||j.headers.get(`Content-Length`)===`0`)return j.ok?{data:void 0,response:j}:{error:void 0,response:j};if(j.ok)return g===`stream`?{data:j.body,response:j}:{data:await j[g](),response:j};let M=await j.text();try{M=JSON.parse(M)}catch{}return{error:M,response:j}}return{request(e,t,n){return u(t,{...n,method:e.toUpperCase()})},GET(e,t){return u(e,{...t,method:`GET`})},PUT(e,t){return u(e,{...t,method:`PUT`})},POST(e,t){return u(e,{...t,method:`POST`})},DELETE(e,t){return u(e,{...t,method:`DELETE`})},OPTIONS(e,t){return u(e,{...t,method:`OPTIONS`})},HEAD(e,t){return u(e,{...t,method:`HEAD`})},PATCH(e,t){return u(e,{...t,method:`PATCH`})},TRACE(e,t){return u(e,{...t,method:`TRACE`})},use(...e){for(let t of e)if(t){if(typeof t!=`object`||!(`onRequest`in t||`onResponse`in t||`onError`in t))throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");l.push(t)}},eject(...e){for(let t of e){let e=l.indexOf(t);e!==-1&&l.splice(e,1)}}}}function Tp(e,t,n){if(t==null)return``;if(typeof t==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function Ep(e,t,n){if(!t||typeof t!=`object`)return``;let r=[],i={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`;if(n.style!==`deepObject`&&n.explode===!1){for(let e in t)r.push(e,n.allowReserved===!0?t[e]:encodeURIComponent(t[e]));let i=r.join(`,`);switch(n.style){case`form`:return`${e}=${i}`;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return i}}for(let i in t){let a=n.style===`deepObject`?`${e}[${i}]`:i;r.push(Tp(a,t[i],n))}let a=r.join(i);return n.style===`label`||n.style===`matrix`?`${i}${a}`:a}function Dp(e,t,n){if(!Array.isArray(t))return``;if(n.explode===!1){let r={form:`,`,spaceDelimited:`%20`,pipeDelimited:`|`}[n.style]||`,`,i=(n.allowReserved===!0?t:t.map(e=>encodeURIComponent(e))).join(r);switch(n.style){case`simple`:return i;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return`${e}=${i}`}}let r={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`,i=[];for(let r of t)n.style===`simple`||n.style===`label`?i.push(n.allowReserved===!0?r:encodeURIComponent(r)):i.push(Tp(e,r,n));return n.style===`label`||n.style===`matrix`?`${r}${i.join(r)}`:i.join(r)}function Op(e){return function(t){let n=[];if(t&&typeof t==`object`)for(let r in t){let i=t[r];if(i!=null){if(Array.isArray(i)){if(i.length===0)continue;n.push(Dp(r,i,{style:`form`,explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof i==`object`){n.push(Ep(r,i,{style:`deepObject`,explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(Tp(r,i,e))}}return n.join(`&`)}}function kp(e,t){let n=e;for(let r of e.match(xp)??[]){let e=r.substring(1,r.length-1),i=!1,a=`simple`;if(e.endsWith(`*`)&&(i=!0,e=e.substring(0,e.length-1)),e.startsWith(`.`)?(a=`label`,e=e.substring(1)):e.startsWith(`;`)&&(a=`matrix`,e=e.substring(1)),!t||t[e]===void 0||t[e]===null)continue;let o=t[e];if(Array.isArray(o)){n=n.replace(r,Dp(e,o,{style:a,explode:i}));continue}if(typeof o==`object`){n=n.replace(r,Ep(e,o,{style:a,explode:i}));continue}if(a===`matrix`){n=n.replace(r,`;${Tp(e,o)}`);continue}n=n.replace(r,a===`label`?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function Ap(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get(`Content-Type`)??t.get(`content-type`):t[`Content-Type`]??t[`content-type`])===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}function jp(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=kp(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith(`?`)&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function Mp(...e){let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,r)}return t}function Np(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}var Pp=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fp={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ip=new class{#e=Fp;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Lp(e){setTimeout(e,0)}var Rp=typeof window>`u`||`Deno`in globalThis;function zp(){}function Bp(e,t){return typeof e==`function`?e(t):e}function Vp(e){return typeof e==`number`&&e>=0&&e!==1/0}function Hp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Up(e,t){return typeof e==`function`?e(t):e}function Wp(e,t){return typeof e==`function`?e(t):e}function Gp(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==qp(o,t.options))return!1}else if(!Yp(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Kp(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Jp(t.options.mutationKey)!==Jp(a))return!1}else if(!Yp(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function qp(e,t){return(t?.queryKeyHashFn||Jp)(e)}function Jp(e){return JSON.stringify(e,(e,t)=>em(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Yp(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Yp(e[n],t[n])):!1}var Xp=Object.prototype.hasOwnProperty;function Zp(e,t){if(e===t)return e;let n=$p(e)&&$p(t);if(!n&&!(em(e)&&em(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:Xp.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=Zp(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function Qp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function $p(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function em(e){if(!tm(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!tm(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function tm(e){return Object.prototype.toString.call(e)===`[object Object]`}function nm(e){return new Promise(t=>{Ip.setTimeout(t,e)})}function rm(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Zp(e,t)}function im(e){return e}function am(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function om(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var sm=Symbol();function cm(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===sm?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lm(e,t){return typeof e==`function`?e(...t):!!e}var um=new class extends Pp{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Rp&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function dm(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var fm=Lp;function pm(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=fm,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var mm=pm(),hm=new class extends Pp{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Rp&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function gm(e){return Math.min(1e3*2**e,3e4)}function _m(e){return(e??`online`)===`online`?hm.isOnline():!0}var vm=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ym(e){let t=!1,n=0,r,i=dm(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new vm(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>um.isFocused()&&(e.networkMode===`always`||hm.isOnline())&&e.canRun(),u=()=>_m(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Rp?0:3),o=e.retryDelay??gm,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),nm(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var bm=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vp(this.gcTime)&&(this.#e=Ip.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Rp?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Ip.clearTimeout(this.#e),void 0)}},xm=class extends bm{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=wm(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=wm(this.options);e.data!==void 0&&(this.setState(Cm(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=rm(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(zp).catch(zp):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Wp(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Up(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Hp(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=cm(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=ym({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof vm&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof vm){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Sm(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Cm(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),mm.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Sm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_m(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Cm(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function wm(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Tm=class extends Pp{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=dm(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Dm(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Om(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Om(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Wp(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Qp(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&km(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Wp(this.options.enabled,this.#t)!==Wp(t.enabled,this.#t)||Up(this.options.staleTime,this.#t)!==Up(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Wp(this.options.enabled,this.#t)!==Wp(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return jm(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(zp)),t}#g(){this.#b();let e=Up(this.options.staleTime,this.#t);if(Rp||this.#r.isStale||!Vp(e))return;let t=Hp(this.#r.dataUpdatedAt,e)+1;this.#d=Ip.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Rp||Wp(this.options.enabled,this.#t)===!1||!Vp(this.#p)||this.#p===0)&&(this.#f=Ip.setInterval(()=>{(this.options.refetchIntervalInBackground||um.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(Ip.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(Ip.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Dm(e,t),o=i&&km(e,n,t,r);(a||o)&&(l={...l,...Sm(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=rm(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=rm(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Am(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Wp(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=dm())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Qp(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){mm.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Em(e,t){return Wp(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function Dm(e,t){return Em(e,t)||e.state.data!==void 0&&Om(e,t,t.refetchOnMount)}function Om(e,t,n){if(Wp(t.enabled,e)!==!1&&Up(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Am(e,t)}return!1}function km(e,t,n,r){return(e!==t||Wp(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Am(e,n)}function Am(e,t){return Wp(t.enabled,e)!==!1&&e.isStaleByTime(Up(t.staleTime,e))}function jm(e,t){return!Qp(e.getCurrentResult(),t)}function Mm(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=cm(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?om:am;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Pm:Nm,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Nm(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Nm(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Pm(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Fm(e,t){return t?Nm(e,t)!=null:!1}function Im(e,t){return!t||!e.getPreviousPageParam?!1:Pm(e,t)!=null}var Lm=class extends Tm{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Mm()})}getOptimisticResult(e){return e.behavior=Mm(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Fm(t,n.data),hasPreviousPage:Im(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Rm=class extends bm{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||zm(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ym({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{throw await this.#n.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#i({type:`error`,error:t})}}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),mm.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function zm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Bm=class extends Pp{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Qp(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Jp(t.mutationKey)!==Jp(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??zm();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){mm.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type===`success`?(this.#r.onSuccess?.(e.data,t,n,r),this.#r.onSettled?.(e.data,null,t,n,r)):e?.type===`error`&&(this.#r.onError?.(e.error,t,n,r),this.#r.onSettled?.(void 0,e.error,t,n,r))}this.listeners.forEach(e=>{e(this.#t)})})}},Vm=q.createContext(void 0),Hm=e=>{let t=q.useContext(Vm);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Um=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(Vm.Provider,{value:e,children:t})),Wm=q.createContext(!1),Gm=()=>q.useContext(Wm);Wm.Provider;function Km(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qm=q.createContext(Km()),Jm=()=>q.useContext(qm),Ym=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Xm=e=>{q.useEffect(()=>{e.clearReset()},[e])},Zm=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||lm(n,[e.error,r])),Qm=(e,t)=>t.state.data===void 0,$m=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},eh=(e,t)=>e.isLoading&&e.isFetching&&!t,th=(e,t)=>e?.suspense&&t.isPending,nh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rh(e,t,n){let r=Gm(),i=Jm(),a=Hm(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,$m(o),Ym(o,i),Xm(i);let s=!a.getQueryCache().get(o.queryHash),[c]=q.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=u?c.subscribe(mm.batchCalls(e)):zp;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),q.useEffect(()=>{c.setOptions(o)},[o,c]),th(o,l))throw nh(o,c,i);if(Zm({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!Rp&&eh(l,r)&&(s?nh(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(zp).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function ih(e,t){return rh(e,Tm,t)}function ah(e,t){return rh({...e,enabled:!0,suspense:!0,throwOnError:Qm,placeholderData:void 0},Tm,t)}function oh(e,t){let n=Hm(t),[r]=q.useState(()=>new Bm(n,e));q.useEffect(()=>{r.setOptions(e)},[r,e]);let i=q.useSyncExternalStore(q.useCallback(e=>r.subscribe(mm.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=q.useCallback((e,t)=>{r.mutate(e,t).catch(zp)},[r]);if(i.error&&lm(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function sh(e,t){return rh(e,Lm,t)}function ch(e){let t=async({queryKey:[t,n,r],signal:i})=>{let a=e[t.toUpperCase()],{data:o,error:s,response:c}=await a(n,{signal:i,...r});if(s)throw s;return c.status===204||c.headers.get(`Content-Length`)===`0`?o??null:o},n=(t,n)=>async r=>{let i=e[t.toUpperCase()],{data:a,error:o}=await i(n,r);if(o)throw o;return a},r=(e,n,...[r,i])=>({queryKey:r===void 0?[e,n]:[e,n,r],queryFn:t,...i});return{queryOptions:r,mutationOptions:(e,t,r)=>({mutationKey:[e,t],mutationFn:n(e,t),...r}),useQuery:(e,t,...[n,i,a])=>ih(r(e,t,n,i),a),useSuspenseQuery:(e,t,...[n,i,a])=>ah(r(e,t,n,i),a),useInfiniteQuery:(t,n,i,a,o)=>{let{pageParamName:s=`cursor`,...c}=a,{queryKey:l}=r(t,n,i);return sh({queryKey:l,queryFn:async({queryKey:[t,n,r],pageParam:i=0,signal:a})=>{let o=e[t.toUpperCase()],{data:c,error:l}=await o(n,{...r,signal:a,params:{...r?.params||{},query:{...r?.params?.query,[s]:i}}});if(l)throw l;return c},...c},o)},useMutation:(e,t,r,i)=>oh({mutationKey:[e,t],mutationFn:n(e,t),...r},i)}}async function lh(e,t,n){let r=await e(await t());if(r.status!==401)return r;let i=await e(await t({forceRefresh:!0}));return i.status===401&&n(),i}function uh(){let e=new Map;return{async onRequest({request:t,id:n}){let{getAccessToken:r}=await Yc(),i=await r(),a=Gc();return t.headers.set(`authorization`,`Bearer ${i}`),t.headers.set(`zuplo-request-id`,a),t.headers.set(`x-trace-id`,a),e.set(n,t.clone()),t},onError({id:t}){e.delete(t)},async onResponse({request:t,response:n,id:r}){let i=e.get(r);e.delete(r);let a=t.headers.get(`x-trace-id`)||`unknown`,{getAccessToken:o}=await Yc(),s=n;if(n.status===401&&i){let e=await o({forceRefresh:!0});i.headers.set(`authorization`,`Bearer ${e}`),s=await fetch(i)}if(s.status===401){gp();let e=new wc(`Your session has expired. Please log in again.`,{traceId:a});throw e.status=401,e}if(!s.ok){let e=new wc(`Error while making request. Please try again or contact support if the problem persists.`,{traceId:a});throw await e.tryReadResponse(s.clone()),e}return s}}}var dh=wp({baseUrl:K});dh.use(uh());var fh=ch(dh);typeof window<`u`&&window.document&&window.document.createElement;function ph(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var mh=q.useId||(()=>void 0),hh=0;function gh(e){let[t,n]=q.useState(mh());return Kl(()=>{e||n(e=>e??String(hh++))},[e]),e||(t?`radix-${t}`:``)}var _h=`focusScope.autoFocusOnMount`,vh=`focusScope.autoFocusOnUnmount`,yh={bubbles:!1,cancelable:!0},bh=`FocusScope`,xh=q.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=q.useState(null),l=kl(i),u=kl(a),d=q.useRef(null),f=pl(t,e=>c(e)),p=q.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;q.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Oh(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Oh(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Oh(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),q.useEffect(()=>{if(s){kh.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(_h,yh);s.addEventListener(_h,l),s.dispatchEvent(t),t.defaultPrevented||(Sh(Mh(wh(s)),{select:!0}),document.activeElement===e&&Oh(s))}return()=>{s.removeEventListener(_h,l),setTimeout(()=>{let t=new CustomEvent(vh,yh);s.addEventListener(vh,u),s.dispatchEvent(t),t.defaultPrevented||Oh(e??document.body,{select:!0}),s.removeEventListener(vh,u),kh.remove(p)},0)}}},[s,l,u,p]);let m=q.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ch(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Oh(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Oh(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,J.jsx)(Dl.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});xh.displayName=bh;function Sh(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Oh(r,{select:t}),document.activeElement!==n)return}function Ch(e){let t=wh(e);return[Th(t,e),Th(t.reverse(),e)]}function wh(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Th(e,t){for(let n of e)if(!Eh(n,{upTo:t}))return n}function Eh(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Dh(e){return e instanceof HTMLInputElement&&`select`in e}function Oh(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dh(e)&&t&&e.select()}}var kh=Ah();function Ah(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=jh(e,t),e.unshift(t)},remove(t){e=jh(e,t),e[0]?.resume()}}}function jh(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mh(e){return e.filter(e=>e.tagName!==`A`)}function Nh(e){let t=Ph(e),n=q.forwardRef((e,n)=>{let{children:r,...i}=e,a=q.Children.toArray(r),o=a.find(Lh);if(o){let e=o.props.children,r=a.map(t=>t===o?q.Children.count(e)>1?q.Children.only(null):q.isValidElement(e)?e.props.children:null:t);return(0,J.jsx)(t,{...i,ref:n,children:q.isValidElement(e)?q.cloneElement(e,void 0,r):null})}return(0,J.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Ph(e){let t=q.forwardRef((e,t)=>{let{children:n,...r}=e;if(q.isValidElement(n)){let e=zh(n),i=Rh(r,n.props);return n.type!==q.Fragment&&(i.ref=t?rl(t,e):e),q.cloneElement(n,i)}return q.Children.count(n)>1?q.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fh=Symbol(`radix.slottable`);function Ih(e){let t=({children:e})=>(0,J.jsx)(J.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Fh,t}function Lh(e){return q.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Fh}function Rh(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function zh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bh=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Nh(`Primitive.${t}`),r=q.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,J.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Vh(e,t){e&&El.flushSync(()=>e.dispatchEvent(t))}var Hh=`Portal`,Uh=q.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=q.useState(!1);Kl(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?El.createPortal((0,J.jsx)(Bh.div,{...r,ref:t}),o):null});Uh.displayName=Hh;function Wh(e,t){return q.useReducer((e,n)=>t[e][n]??e,e)}var Gh=e=>{let{present:t,children:n}=e,r=Kh(t),i=typeof n==`function`?n({present:r.isPresent}):q.Children.only(n),a=il(r.ref,Jh(i));return typeof n==`function`||r.isPresent?q.cloneElement(i,{ref:a}):null};Gh.displayName=`Presence`;function Kh(e){let[t,n]=q.useState(),r=q.useRef(null),i=q.useRef(e),a=q.useRef(`none`),[o,s]=Wh(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return q.useEffect(()=>{let e=qh(r.current);a.current=o===`mounted`?e:`none`},[o]),Kl(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=qh(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Kl(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=qh(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=qh(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:q.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function qh(e){return e?.animationName||`none`}function Jh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yh=0;function Xh(){q.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Zh()),document.body.insertAdjacentElement(`beforeend`,e[1]??Zh()),Yh++,()=>{Yh===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Yh--}},[])}function Zh(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Qh=function(){return Qh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Qh.apply(this,arguments)};function $h(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function eg(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tg=`right-scroll-bar-position`,ng=`width-before-scroll-bar`,rg=`with-scroll-bars-hidden`,ig=`--removed-body-scroll-bar-size`;function ag(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function og(e,t){var n=(0,q.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var sg=typeof window<`u`?q.useLayoutEffect:q.useEffect,cg=new WeakMap;function lg(e,t){var n=og(t||null,function(t){return e.forEach(function(e){return ag(e,t)})});return sg(function(){var t=cg.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ag(e,null)}),i.forEach(function(e){r.has(e)||ag(e,a)})}cg.set(n,e)},[e]),n}function ug(e){return e}function dg(e,t){t===void 0&&(t=ug);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function fg(e){e===void 0&&(e={});var t=dg(null);return t.options=Qh({async:!0,ssr:!1},e),t}var pg=function(e){var t=e.sideCar,n=$h(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return q.createElement(r,Qh({},n))};pg.isSideCarExport=!0;function mg(e,t){return e.useMedium(t),pg}var hg=fg(),gg=function(){},_g=q.forwardRef(function(e,t){var n=q.useRef(null),r=q.useState({onScrollCapture:gg,onWheelCapture:gg,onTouchMoveCapture:gg}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=$h(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=lg([n,t]),C=Qh(Qh({},b),i);return q.createElement(q.Fragment,null,u&&q.createElement(x,{sideCar:hg,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?q.cloneElement(q.Children.only(s),Qh(Qh({},C),{ref:S})):q.createElement(v,Qh({},C,{className:c,ref:S}),s))});_g.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_g.classNames={fullWidth:ng,zeroRight:tg};var vg,yg=function(){if(vg)return vg;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function bg(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=yg();return t&&e.setAttribute(`nonce`,t),e}function xg(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Sg(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Cg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bg())&&(xg(t,n),Sg(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wg=function(){var e=Cg();return function(t,n){q.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Tg=function(){var e=wg();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Eg={left:0,top:0,right:0,gap:0},Dg=function(e){return parseInt(e||``,10)||0},Og=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Dg(n),Dg(r),Dg(i)]},kg=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Eg;var t=Og(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ag=Tg(),jg=`data-scroll-locked`,Mg=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
5
|
+
.${rg} {
|
|
6
6
|
overflow: hidden ${r};
|
|
7
7
|
padding-right: ${s}px ${r};
|
|
8
8
|
}
|
|
9
|
-
body[${
|
|
9
|
+
body[${jg}] {
|
|
10
10
|
overflow: hidden ${r};
|
|
11
11
|
overscroll-behavior: contain;
|
|
12
12
|
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
@@ -19,30 +19,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
19
19
|
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.${
|
|
22
|
+
.${tg} {
|
|
23
23
|
right: ${s}px ${r};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.${
|
|
26
|
+
.${ng} {
|
|
27
27
|
margin-right: ${s}px ${r};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.${
|
|
30
|
+
.${tg} .${tg} {
|
|
31
31
|
right: 0 ${r};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.${
|
|
34
|
+
.${ng} .${ng} {
|
|
35
35
|
margin-right: 0 ${r};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
body[${
|
|
39
|
-
${
|
|
38
|
+
body[${jg}] {
|
|
39
|
+
${ig}: ${s}px;
|
|
40
40
|
}
|
|
41
|
-
`},
|
|
41
|
+
`},Ng=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Pg=function(){q.useEffect(function(){return document.body.setAttribute(jg,(Ng()+1).toString()),function(){var e=Ng()-1;e<=0?document.body.removeAttribute(jg):document.body.setAttribute(jg,e.toString())}},[])},Fg=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Pg();var a=q.useMemo(function(){return kg(i)},[i]);return q.createElement(Ag,{styles:Mg(a,!t,i,n?``:`!important`)})},Ig=!1;if(typeof window<`u`)try{var Lg=Object.defineProperty({},`passive`,{get:function(){return Ig=!0,!0}});window.addEventListener(`test`,Lg,Lg),window.removeEventListener(`test`,Lg,Lg)}catch{Ig=!1}var Rg=Ig?{passive:!1}:!1,zg=function(e){return e.tagName===`TEXTAREA`},Bg=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!zg(e)&&n[t]===`visible`)},Vg=function(e){return Bg(e,`overflowY`)},Hg=function(e){return Bg(e,`overflowX`)},Ug=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Kg(e,r)){var i=qg(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Wg=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Gg=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Kg=function(e,t){return e===`v`?Vg(t):Hg(t)},qg=function(e,t){return e===`v`?Wg(t):Gg(t)},Jg=function(e,t){return e===`h`&&t===`rtl`?-1:1},Yg=function(e,t,n,r,i){var a=Jg(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=qg(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Kg(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Xg=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zg=function(e){return[e.deltaX,e.deltaY]},Qg=function(e){return e&&`current`in e?e.current:e},$g=function(e,t){return e[0]===t[0]&&e[1]===t[1]},e_=function(e){return`
|
|
42
42
|
.block-interactivity-${e} {pointer-events: none;}
|
|
43
43
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
44
|
-
`},
|
|
44
|
+
`},t_=0,n_=[];function r_(e){var t=q.useRef([]),n=q.useRef([0,0]),r=q.useRef(),i=q.useState(t_++)[0],a=q.useState(Tg)[0],o=q.useRef(e);q.useEffect(function(){o.current=e},[e]),q.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=eg([e.lockRef.current],(e.shards||[]).map(Qg),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=q.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Xg(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ug(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ug(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Yg(h,t,e,h===`h`?s:c,!0)},[]),c=q.useCallback(function(e){var n=e;if(!(!n_.length||n_[n_.length-1]!==a)){var r=`deltaY`in n?Zg(n):Xg(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&$g(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Qg).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=q.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:i_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=q.useCallback(function(e){n.current=Xg(e),r.current=void 0},[]),d=q.useCallback(function(t){l(t.type,Zg(t),t.target,s(t,e.lockRef.current))},[]),f=q.useCallback(function(t){l(t.type,Xg(t),t.target,s(t,e.lockRef.current))},[]);q.useEffect(function(){return n_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Rg),document.addEventListener(`touchmove`,c,Rg),document.addEventListener(`touchstart`,u,Rg),function(){n_=n_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Rg),document.removeEventListener(`touchmove`,c,Rg),document.removeEventListener(`touchstart`,u,Rg)}},[]);var p=e.removeScrollBar,m=e.inert;return q.createElement(q.Fragment,null,m?q.createElement(a,{styles:e_(i)}):null,p?q.createElement(Fg,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function i_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var a_=mg(hg,r_),o_=q.forwardRef(function(e,t){return q.createElement(_g,Qh({},e,{ref:t,sideCar:a_}))});o_.classNames=_g.classNames;var s_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},c_=new WeakMap,l_=new WeakMap,u_={},d_=0,f_=function(e){return e&&(e.host||f_(e.parentNode))},p_=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=f_(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},m_=function(e,t,n,r){var i=p_(t,Array.isArray(e)?e:[e]);u_[n]||(u_[n]=new WeakMap);var a=u_[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(c_.get(e)||0)+1,l=(a.get(e)||0)+1;c_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&l_.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),d_++,function(){o.forEach(function(e){var t=c_.get(e)-1,i=a.get(e)-1;c_.set(e,t),a.set(e,i),t||(l_.has(e)||e.removeAttribute(r),l_.delete(e)),i||e.removeAttribute(n)}),d_--,d_||(c_=new WeakMap,c_=new WeakMap,l_=new WeakMap,u_={})}},h_=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||s_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),m_(r,i,n,`aria-hidden`)):function(){return null}},g_=`Dialog`,[__,v_]=cl(g_),[y_,b_]=__(g_),x_=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=q.useRef(null),c=q.useRef(null),[l,u]=Yl({prop:r,defaultProp:i??!1,onChange:a,caller:g_});return(0,J.jsx)(y_,{scope:t,triggerRef:s,contentRef:c,contentId:gh(),titleId:gh(),descriptionId:gh(),open:l,onOpenChange:u,onOpenToggle:q.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};x_.displayName=g_;var S_=`DialogTrigger`,C_=q.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=b_(S_,n),a=il(t,i.triggerRef);return(0,J.jsx)(Bh.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":U_(i.open),...r,ref:a,onClick:ph(e.onClick,i.onOpenToggle)})});C_.displayName=S_;var w_=`DialogPortal`,[T_,E_]=__(w_,{forceMount:void 0}),D_=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=b_(w_,t);return(0,J.jsx)(T_,{scope:t,forceMount:n,children:q.Children.map(r,e=>(0,J.jsx)(Gh,{present:n||a.open,children:(0,J.jsx)(Uh,{asChild:!0,container:i,children:e})}))})};D_.displayName=w_;var O_=`DialogOverlay`,k_=q.forwardRef((e,t)=>{let n=E_(O_,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=b_(O_,e.__scopeDialog);return a.modal?(0,J.jsx)(Gh,{present:r||a.open,children:(0,J.jsx)(j_,{...i,ref:t})}):null});k_.displayName=O_;var A_=Nh(`DialogOverlay.RemoveScroll`),j_=q.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=b_(O_,n);return(0,J.jsx)(o_,{as:A_,allowPinchZoom:!0,shards:[i.contentRef],children:(0,J.jsx)(Bh.div,{"data-state":U_(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),M_=`DialogContent`,N_=q.forwardRef((e,t)=>{let n=E_(M_,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=b_(M_,e.__scopeDialog);return(0,J.jsx)(Gh,{present:r||a.open,children:a.modal?(0,J.jsx)(P_,{...i,ref:t}):(0,J.jsx)(F_,{...i,ref:t})})});N_.displayName=M_;var P_=q.forwardRef((e,t)=>{let n=b_(M_,e.__scopeDialog),r=q.useRef(null),i=il(t,n.contentRef,r);return q.useEffect(()=>{let e=r.current;if(e)return h_(e)},[]),(0,J.jsx)(I_,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ph(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ph(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ph(e.onFocusOutside,e=>e.preventDefault())})}),F_=q.forwardRef((e,t)=>{let n=b_(M_,e.__scopeDialog),r=q.useRef(!1),i=q.useRef(!1);return(0,J.jsx)(I_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),I_=q.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=b_(M_,n),c=q.useRef(null),l=il(t,c);return Xh(),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(xh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,J.jsx)(Ll,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":U_(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(q_,{titleId:s.titleId}),(0,J.jsx)(Y_,{contentRef:c,descriptionId:s.descriptionId})]})]})}),L_=`DialogTitle`,R_=q.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=b_(L_,n);return(0,J.jsx)(Bh.h2,{id:i.titleId,...r,ref:t})});R_.displayName=L_;var z_=`DialogDescription`,B_=q.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=b_(z_,n);return(0,J.jsx)(Bh.p,{id:i.descriptionId,...r,ref:t})});B_.displayName=z_;var V_=`DialogClose`,H_=q.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=b_(V_,n);return(0,J.jsx)(Bh.button,{type:`button`,...r,ref:t,onClick:ph(e.onClick,()=>i.onOpenChange(!1))})});H_.displayName=V_;function U_(e){return e?`open`:`closed`}var W_=`DialogTitleWarning`,[G_,K_]=sl(W_,{contentName:M_,titleName:L_,docsSlug:`dialog`}),q_=({titleId:e})=>{let t=K_(W_),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
45
45
|
|
|
46
46
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
47
47
|
|
|
48
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return q.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},L_=`DialogDescriptionWarning`,R_=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${F_(L_).contentName}}.`;return q.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},z_=u_,B_=f_,V_=g_,H_=v_,U_=S_,W_=D_,G_=k_,K_=j_;function q_(e){let t=new Date;switch(e){case`7d`:t.setUTCDate(t.getUTCDate()-7);break;case`30d`:t.setUTCDate(t.getUTCDate()-30);break;case`3m`:t.setUTCMonth(t.getUTCMonth()-3);break}return t.toISOString()}async function J_(e,t){let n=t.pageSize??30,{page:r,pageSize:i,order:a=`DESC`,orderBy:o=`periodStart`,...s}=t,{data:c,error:l}=await eh.GET(`/v3/metering/{bucketId}/billing/invoices`,{params:{path:{bucketId:e},query:{page:r,pageSize:n,expand:[`lines`],order:a,orderBy:o,...s}}});if(l||!c)throw l??Error(`Failed to load invoices`);return c}var Y_=15;async function X_(e,t,n=6){let r=await J_(e,{page:1,pageSize:n,createdAfter:q_(`3m`),order:`DESC`,orderBy:`periodStart`,customers:[t]}),i=r.items??[];if(i.length===0||i.every(e=>e.customer?.id===t))return r;let a=[],o=1;for(;a.length<n&&o<=Y_;){let r=await J_(e,{page:o,pageSize:30,createdAfter:q_(`3m`),order:`DESC`,orderBy:`periodStart`}),i=r.items??[];if(i.length===0)break;for(let e of i)if(e.customer?.id===t&&(a.push(e),a.length>=n))break;let s=r.pageSize??30,c=Math.max(1,Math.ceil((r.totalCount??0)/s));if(o>=c)break;o++}let s=a.slice(0,n);return{...r,items:s,totalCount:s.length,page:1,pageSize:n}}var Z_={orderBy:`createdAt`,order:`DESC`},Q_=`/v3/metering/{bucketId}/plans`,$_=`/v3/metering/{bucketId}/customers`;function ev(e){if(!e)return;let t={};return e.page!=null&&(t.page=e.page,t.pageSize=e.pageSize??30),e.status?.length&&(t.status=e.status),Object.keys(t).length>0?t:void 0}function tv(e,t){let n=ev(t);return n?{params:{path:{bucketId:e},query:n}}:{params:{path:{bucketId:e}}}}function nv(e){if(!e)return;let t={orderBy:e.orderBy??Z_.orderBy,order:e.order??Z_.order};return e.page!=null&&(t.page=e.page,t.pageSize=e.pageSize??30),e.planKey&&(t.planKey=e.planKey),e.name&&(t.name=e.name),e.key&&(t.key=e.key),e.primaryEmail&&(t.primaryEmail=e.primaryEmail),Object.keys(t).length>0?t:void 0}function rv(e,t){let n=nv(t);return n?{params:{path:{bucketId:e},query:n}}:{params:{path:{bucketId:e}}}}function iv(e){let t={page:e.page??1,pageSize:e.pageSize??30};return e.includeArchived!=null&&(t.includeArchived=e.includeArchived),t}function av(e,t,n){return Array.isArray(e)?{items:e,totalCount:e.length,page:t,pageSize:n}:e}var ov={ai:{providerAssignments:{list:(e,t)=>th.queryOptions(`get`,`/v1/accounts/{accountName}/projects/{projectName}/ai-provider-assignments`,{params:{path:{accountName:e,projectName:t}}},{select:e=>e.data})}},deployments:{list:(e,t)=>th.queryOptions(`get`,`/v1/accounts/{accountName}/projects/{projectName}/deployments`,{params:{path:{accountName:e,projectName:t}}}),versions:{list:e=>th.queryOptions(`get`,`/v1/deployments/{deploymentName}/versions`,{params:{path:{deploymentName:e}}})}},metering:{customers:{list:(e,t)=>th.queryOptions(`get`,$_,rv(e,t),t?.page==null?void 0:{placeholderData:qp}),get:(e,t)=>th.queryOptions(`get`,`/v3/metering/{bucketId}/customers/{customerIdOrKey}`,{params:{path:{bucketId:e,customerIdOrKey:t}}}),subscriptions:(e,t)=>th.queryOptions(`get`,`/v3/metering/{bucketId}/customers/{customerIdOrKey}/subscriptions`,{params:{path:{bucketId:e,customerIdOrKey:t}}})},plans:{list:(e,t)=>th.queryOptions(`get`,Q_,tv(e,t),t?.page==null?void 0:{placeholderData:qp}),get:(e,t)=>th.queryOptions(`get`,`/v3/metering/{bucketId}/plans/{planId}`,{params:{path:{bucketId:e,planId:t}}}),listByKey:(e,t)=>th.queryOptions(`get`,Q_,{params:{path:{bucketId:e},query:{key:[t]}}})},meters:{list:e=>th.queryOptions(`get`,`/v3/metering/{bucketId}/meters`,{params:{path:{bucketId:e}}})},configuration:{get:e=>th.queryOptions(`get`,`/v3/metering/{bucketId}/monetization-configuration`,{params:{path:{bucketId:e}}})},features:{list:(e,t)=>th.queryOptions(`get`,`/v3/metering/{bucketId}/features`,{params:{path:{bucketId:e},query:t?{includeArchived:t}:void 0}},{select:e=>Array.isArray(e)?e:e.items}),listPaginated:(e,t)=>{let n=t.page??1,r=t.pageSize??30;return th.queryOptions(`get`,`/v3/metering/{bucketId}/features`,{params:{path:{bucketId:e},query:iv(t)}},{select:e=>av(e,n,r),placeholderData:qp})}},planInvites:{list:e=>th.queryOptions(`get`,`/v3/metering/{bucketId}/plan-invites`,{params:{path:{bucketId:e}}})},billingReadiness:{get:e=>th.queryOptions(`get`,`/v3/metering/{bucketId}/billing-readiness`,{params:{path:{bucketId:e}}})},stripe:{setup:e=>th.queryOptions(`get`,`/v3/metering/{bucketId}/setup/stripe`,{params:{path:{bucketId:e}}})},subscriptions:{get:(e,t)=>th.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}`,{params:{path:{bucketId:e,subscriptionId:t}}}),access:(e,t)=>th.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}/access`,{params:{path:{bucketId:e,subscriptionId:t}}}),usage:(e,t)=>th.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}/usage`,{params:{path:{bucketId:e,subscriptionId:t}}})},invoices:{list:(e,t,n,r,i,a)=>({queryKey:[`metering`,e,`invoices`,t,n,r??`all`,a,i],queryFn:()=>J_(e,{page:n,pageSize:30,createdAfter:q_(t),order:i,orderBy:a,...r?.statuses?.length?{statuses:r.statuses}:{},...r?.extendedStatuses?.length?{extendedStatuses:r.extendedStatuses}:{}}),placeholderData:qp}),forCustomer:(e,t)=>({queryKey:[`metering`,e,`invoices`,`customer`,t],queryFn:()=>X_(e,t)})}}},sv=async e=>cv(e,await i(()=>import(`./editor.main-B7ZQNwu9.js`),__vite__mapDeps([0,1,2,3,4,5,6]))),cv=(e,t)=>{let n=e.split(`.`).pop();if(n)return t.languages.getLanguages().find(e=>e.extensions?.includes(`.${n}`))},lv=e=>{let t=Object.entries(e).flatMap(([e,t])=>t?[[e,t]]:[]);return new URLSearchParams(t).toString()},$={user:{preferences:()=>({url:`${K}/v1/users/me/preferences`})},authApiKey:e=>({url:`${K}/v1/auth/api-keys/${e}`}),authAccountApiKeys:e=>({url:`${K}/v1/auth/api-keys?accountName=${e}`}),authCurrentUserAccountRoles:e=>({url:`${K}/v1/auth/users/me?accountName=${e}`}),authUserAccountRoles:(e,t)=>({url:`${K}/v1/auth/users/${t}?accountName=${e}`}),authProjectUsersRoles:(e,t,{includeInheritedRoles:n}={includeInheritedRoles:!1})=>({url:`${K}/v1/auth/users?accountName=${e}&projectName=${t}&includeInheritedRoles=${n}`}),authAccountUsersRoles:e=>({url:`${K}/v1/auth/users?accountName=${e}`}),mfaFactors:()=>({url:`${K}/v1/mfa/factors`}),accountMemberInviteDetails:e=>({url:`${K}/v1/account-member-invites/${e}`}),accountMemberInvites:e=>({url:`${K}/v1/accounts/${e}/account-member-invites`}),accountAuditLogs:(e,t)=>{let n=new URLSearchParams;t?.limit&&n.append(`limit`,t.limit.toString()),t?.offset&&n.append(`offset`,t.offset.toString()),t?.action&&n.append(`action`,t.action),t?.startDate&&n.append(`startDate`,t.startDate),t?.endDate&&n.append(`endDate`,t.endDate),t?.actor&&n.append(`actor`,t.actor),t?.success!==void 0&&n.append(`success`,t.success.toString());let r=n.toString();return{url:`${K}/v1/accounts/${e}/audit-logs${r?`?${r}`:``}`}},account:e=>({url:`${K}/v1/accounts/${e}`}),bucketAuditLogsEvents:(e,t)=>{let n=new URLSearchParams;t?.limit!==void 0&&n.append(`limit`,String(t.limit)),t?.cursor&&n.append(`cursor`,t.cursor),t?.type&&n.append(`type`,t.type),t?.actorSub&&n.append(`actorSub`,t.actorSub),t?.subject&&n.append(`subject`,t.subject),t?.startDate&&n.append(`startDate`,t.startDate),t?.endDate&&n.append(`endDate`,t.endDate);let r=n.toString();return{url:`${K}/v1/audit-logs/${e}/events${r?`?${r}`:``}`}},bucketAuditLogsStats:(e,t)=>{let n=new URLSearchParams;return n.append(`groupBy`,t.groupBy),t.limit!==void 0&&n.append(`limit`,String(t.limit)),t.startDate&&n.append(`startDate`,t.startDate),t.endDate&&n.append(`endDate`,t.endDate),{url:`${K}/v1/audit-logs/${e}/stats?${n.toString()}`}},accounts:()=>({url:`${K}/v1/accounts`}),accountSourceControlRepoList:e=>({url:`${K}/v1/accounts/${e}/$repo-list`}),accountSourceControlAzureProjects:(e,t)=>({url:`${K}/v1/accounts/${e}/source-control/$azure-projects?organization=${t}`}),accountSourceControlNamespaces:e=>({url:`${K}/v1/accounts/${e}/$namespaces`}),accountSourceControlRepos:(e,t,n)=>({url:`${K}/v1/accounts/${e}/$repos?${new URLSearchParams({namespace:t,query:n??``})}`}),accountsSourceControlConfigurations:()=>({url:`${K}/v1/user/me/source-control-configs`}),billing:e=>({url:`${K}/v1/accounts/${e}/billings`}),buildLogs:(e,t)=>({url:`${K}/v2/deployments/${e}/build-logs/${t}`}),cdnContent:e=>({url:`${Ac}${e}`}),chatIdentity:()=>({url:`${K}/v1/chat-identity`}),knockIdentity:()=>({url:`${K}/v1/knock-identity`}),bucketConfigurations:e=>({url:`${K}/v1/buckets/${e}/configurations`}),bucketConfigurationTeams:e=>({url:`${K}/v1/buckets/${e}/configurations/teams`}),bucketConfigurationApps:e=>({url:`${K}/v1/buckets/${e}/configurations/apps`}),bucketConfiguration:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations/${t}`}),bucketConfigurationUsage:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/usage`}),bucketConfigurationMembers:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members`}),bucketConfigurationMember:(e,t,n)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`}),supportedAiProviders:e=>({url:`${K}/v1/buckets/${e}/providers`}),aiProviderAssignments:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/ai-provider-assignments`}),hierarchicalQuota:e=>({url:`${K}/v1/hierarchical-quota/${e}`}),consumer:(e,t)=>({url:`${K}/v1/api-keys/${e}/consumers/${t}`}),consumersForBucket:(e,t)=>{let n=lv({limit:t?.limit?.toString(),offset:t?.offset?.toString(),name:t?.name,email:t?.email});return{url:`${K}/v1/api-keys/${e}/consumers${n?`?${n}`:``}`}},customDomains:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/custom-domains`}),accountCustomDomains:e=>({url:`${K}/v1/accounts/${e}/custom-domains`}),deploymentVersions:e=>({url:`${K}/v1/deployments/${e}/versions`}),environments:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/deployments`}),environmentVariables:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/environment-variables`}),file:(e,t)=>({url:`${K}/v1/deployments/${e}/fs/file?path=${t}`}),fsStats:e=>({url:`${K}/v1/deployments/${e}/fs/stats`}),gitBranches:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$branches`}),projectSyncStatus:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/sync-status`}),meteringBucket:(e,t)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/`}),meteringPlans:(e,t)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/plans`}),meteringSubscriptions:(e,t)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/subscriptions`}),meteringSubscriptionQuotas:(e,t,n)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/subscriptions/${n}/quotas`}),project:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}`}),projects:e=>({url:`${K}/v1/accounts/${e}/projects`}),permissions:(e,t)=>({url:`${K}/v1/permissions/${e}/${t}`}),permissionsProject:(e,t)=>({url:`${K}/v1/permissions/project/${e}|${t}`}),permissionsAiTeam:e=>({url:`${K}/v1/permissions/ai_team/${e}`}),logViewerRequests:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.cursor&&n.append(`cursor`,t.cursor),t.since&&n.append(`since`,t.since),t.sinceId&&n.append(`sinceId`,t.sinceId),t.limit&&n.append(`limit`,t.limit.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/deployments/${e}/logs/requests?${n}`}},logViewerRequestDetail:(e,t,n)=>{let r=new URLSearchParams;n&&r.append(`timestamp`,n);let i=r.toString();return{url:`${K}/v2/deployments/${e}/logs/requests/${t}${i?`?${i}`:``}`}},logViewerHistogram:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/deployments/${e}/logs/histogram?${n}`}},logViewerFacets:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.facets&&n.append(`facets`,t.facets),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/deployments/${e}/logs/facets?${n}`}},logViewerRequestsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.cursor&&n.append(`cursor`,t.cursor),t.since&&n.append(`since`,t.since),t.sinceId&&n.append(`sinceId`,t.sinceId),t.limit&&n.append(`limit`,t.limit.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/logs/requests?${n}`}},logViewerRequestDetailScoped:(e,t,n)=>{let r=new URLSearchParams;return r.append(`account`,e.accountName),e.projectName&&r.append(`project`,e.projectName),e.deploymentName&&r.append(`deploymentName`,e.deploymentName),n&&r.append(`timestamp`,n),{url:`${K}/v2/logs/requests/${t}?${r}`}},logViewerHistogramScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/logs/histogram?${n}`}},logViewerFacetsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.facets&&n.append(`facets`,t.facets),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/logs/facets?${n}`}},tracesListScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),t.limit&&n.append(`limit`,String(t.limit)),t.cursor&&n.append(`cursor`,t.cursor),{url:`${K}/v2/traces?${n}`}},traceDetailScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),{url:`${K}/v2/traces/${encodeURIComponent(t)}?${n}`}},traceStatsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),{url:`${K}/v2/trace-stats?${n}`}},traceFacetsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.facets&&n.append(`facets`,t.facets),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),{url:`${K}/v2/trace-facets?${n}`}},serviceMapScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),{url:`${K}/v2/service-map?${n}`}},usersMe:()=>({url:`${K}/v1/users/me`}),identityConnections:e=>({url:`${K}/v1/accounts/${e}/identity-connections`}),identityConnectionTicket:e=>({url:`${K}/v1/accounts/${e}/identity-connections/ticket`}),analyticsRequests:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return e.compare&&t.append(`compare`,`previous`),{url:`${K}/v2/analytics/requests?${t}`}},analyticsRequestsField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/requests/fields/${encodeURIComponent(e)}?${n}`}},analyticsConsumers:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/consumers?${t}`}},analyticsAgents:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.includeOther===!0&&t.append(`includeOther`,`true`),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/agents?${t}`}},analyticsAgentsTimeSeries:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.includeOther===!0&&t.append(`includeOther`,`true`),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/agents/timeseries?${t}`}},analyticsBackend:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/backend?${t}`}},analyticsEdge:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/edge?${t}`}},analyticsAiGateway:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/ai-gateway?${t}`}},analyticsAiGatewayField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/ai-gateway/fields/${encodeURIComponent(e)}?${n}`}},analyticsCache:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/cache?${t}`}},analyticsCacheField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/cache/fields/${encodeURIComponent(e)}?${n}`}},analyticsMcp:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/mcp?${t}`}},analyticsGraphql:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/graphql?${t}`}},analyticsMcpField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/mcp/fields/${encodeURIComponent(e)}?${n}`}},analyticsMcpCapabilities:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.view&&t.append(`view`,e.view),e.capabilityType&&t.append(`capabilityType`,e.capabilityType),e.limit&&t.append(`limit`,e.limit.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/mcp/capabilities?${t}`}},analyticsMcpEvents:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.limit!=null&&t.append(`limit`,e.limit.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/mcp/events?${t}`}},analyticsMcpBreakdown:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/mcp/breakdowns/${e}?${n}`}},analyticsUsage:e=>{let t=new URLSearchParams;return t.append(`account`,e.accountName),t.append(`from`,e.from),t.append(`to`,e.to),{url:`${K}/v2/analytics/usage?${t}`}}},uv=`x-test-proxy-error`,dv=`The gateway URL isn't ready yet — this environment is still being provisioned for its first deploy. Wait for the build to finish, then try again.`,fv=class extends Error{constructor(e=dv){super(e),this.name=`GatewayUrlUnavailableError`}},pv=[200,400,413,502],mv=({pathname:e,overrideUrl:t})=>{if(!t)throw new fv;return new URL(e??``,t).toString()},hv=({testRequest:e,overrideUrl:t,environmentName:n})=>({url:mv({pathname:e.pathname,overrideUrl:t}),method:e.method,deployment:n,headers:e.headers,body:e.body}),gv={invalid_request:`The Zuplo test proxy rejected the request as invalid.`,get_or_head_with_body:`The Zuplo test proxy rejected the request because GET and HEAD requests can't include a body.`,invalid_request_body:`The Zuplo test proxy couldn't read the request body.`,request_too_large:`The Zuplo test proxy rejected the request because it exceeds the 250 KB limit.`,upstream_request_failed:`The Zuplo test proxy couldn't reach your API — it was unreachable, timed out, or refused the connection.`},_v=e=>{let t=(e.code?gv[e.code]:void 0)??e.detail??e.title??`The Zuplo test proxy couldn't run this request.`;return`${t}${e.detail&&e.detail!==t?` ${e.detail}`:``} This is an error from the Zuplo test proxy, not a response from your API.`},vv=class extends Error{code;status;detail;title;constructor(e){super(_v(e)),this.name=`TestProxyError`,this.code=e.code,this.status=e.status,this.detail=e.detail,this.title=e.title}},yv=async e=>{let t=e.headers.get(uv),n;try{let t=await e.clone().json();t&&typeof t==`object`&&(n=t)}catch{}return new vv({code:n?.code??t??void 0,detail:typeof n?.detail==`string`?n.detail:void 0,title:typeof n?.title==`string`?n.title:void 0,status:typeof n?.status==`number`?n.status:e.status})},bv={auth:{createApiKey:e=>({url:`${K}/v1/auth/api-keys`,method:`POST`,json:!0,body:JSON.stringify(e),invalidateKeys:[$.authAccountApiKeys(e.accountName)],acceptableStatuses:[200]}),deleteApiKey:(e,t)=>({url:`${K}/v1/auth/api-keys/${e}`,method:`DELETE`,invalidateKeys:[$.authApiKey(e),$.authAccountApiKeys(t)],acceptableStatuses:[204]}),updateUsersRole:({userId:e,accountName:t,projectName:n,role:r})=>({url:`${K}/v1/auth/users/${e}`,method:`PATCH`,json:!0,body:JSON.stringify({accountName:t,projectName:n,role:r}),parseResponse:!1,invalidateKeys:n?[$.authProjectUsersRoles(t,n,{includeInheritedRoles:!1}),$.authProjectUsersRoles(t,n,{includeInheritedRoles:!0}),$.authAccountUsersRoles(t)]:[$.authAccountUsersRoles(t)],acceptableStatuses:[201,200]})},accounts:{createAccount:e=>({url:`${K}/v1/accounts`,method:`POST`,json:!0,body:JSON.stringify(e),invalidateKeys:[$.accounts()],acceptableStatuses:[201]}),deleteAccount:e=>({url:`${K}/v1/accounts/${e.name}`,method:`DELETE`,invalidateKeys:[$.accounts()],acceptableStatuses:[200]}),createCustomDomain:({accountName:e,projectName:t,isAlias:n,hostname:r,deploymentName:i,stage:a})=>({url:`${K}/v1/accounts/${e}/custom-domains`,method:`POST`,body:JSON.stringify({hostname:r,isAlias:n,deploymentName:i,stage:a}),invalidateKeys:[$.accounts(),$.projects(e),$.environments(e,t),$.customDomains(e,t),$.accountCustomDomains(e),ov.deployments.list(e,t).queryKey],acceptableStatuses:[200]}),deleteAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${K}/v1/accounts/${e}/account-member-invites/${t}`,method:`DELETE`,invalidateKeys:[$.accountMemberInvites(e)],acceptableStatuses:[204]}),deleteCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${K}/v1/accounts/${e}/custom-domains?hostname=${n}&deploymentName=${r}`,method:`DELETE`,invalidateKeys:[$.accounts(),$.projects(e),$.environments(e,t),$.customDomains(e,t),ov.deployments.list(e,t).queryKey],acceptableStatuses:[204]}),editCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${K}/v1/accounts/${e}/custom-domains`,method:`PATCH`,body:JSON.stringify({hostname:n,deploymentName:r}),invalidateKeys:[$.accounts(),$.projects(e),$.environments(e,t),$.customDomains(e,t),ov.deployments.list(e,t).queryKey],acceptableStatuses:[200]}),resendAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${K}/v1/accounts/${e}/account-member-invites/${t}/$resend`,method:`PATCH`,body:JSON.stringify({}),invalidateKeys:[$.accountMemberInvites(e)],acceptableStatuses:[201]}),billingUpgrade:(e,t,n,r)=>({method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({successUrl:n,cancelUrl:r}),url:`${K}/v1/accounts/${e}/upgrade/${t}`}),updateAccount:({accountName:e,...t})=>({url:`${K}/v1/accounts/${e}`,method:`PATCH`,body:JSON.stringify(t),json:!0,invalidateKeys:[$.accounts()],acceptableStatuses:[200]})},ai:{createBucketConfiguration:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations`,method:`POST`,json:!0,body:JSON.stringify(t),acceptableStatuses:[201,200],invalidateKeys:[$.bucketConfigurations(e),$.bucketConfigurationTeams(e)]}),updateBucketConfiguration:(e,t,n)=>({url:`${K}/v1/buckets/${e}/configurations/${t}`,method:`PATCH`,json:!0,body:JSON.stringify(n),acceptableStatuses:[200,201],invalidateKeys:[$.bucketConfigurationTeams(e),$.bucketConfiguration(e,t),$.bucketConfigurations(e)]}),deleteBucketConfiguration:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations/${t}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[$.bucketConfigurations(e)]}),createBucketConfigurationMember:(e,t,n,r)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members`,method:`POST`,json:!0,body:JSON.stringify({sub:n,role:r}),acceptableStatuses:[201,200],invalidateKeys:[$.bucketConfiguration(e,t),$.bucketConfigurationMembers(e,t)]}),putBucketConfigurationMemberRole:(e,t,n,r)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`PUT`,json:!0,body:JSON.stringify({role:r}),acceptableStatuses:[204,200],invalidateKeys:[$.bucketConfiguration(e,t),$.bucketConfigurationMembers(e,t),$.bucketConfigurationTeams(e)]}),deleteBucketConfigurationMember:(e,t,n)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[$.bucketConfigurationMembers(e,t)]}),updateBucketConfigurationMember:(e,t,n,r)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`PATCH`,json:!0,body:JSON.stringify({role:r}),acceptableStatuses:[200],invalidateKeys:[$.bucketConfigurationMembers(e,t)]}),createBucketAiProvider:(e,{name:t,baseURL:n,description:r})=>({url:`${K}/v1/buckets/${e}/providers`,method:`POST`,json:!0,body:JSON.stringify({baseURL:n,name:t,description:r})}),createAiProviderModel:(e,t,{model:n,kind:r,inputCostPerToken:i,outputCostPerToken:a,status:o})=>({url:`${K}/v1/buckets/${e}/providers/${t}/models`,method:`POST`,json:!0,body:JSON.stringify({model:n,kind:r,inputCostPerToken:i,outputCostPerToken:a,status:o}),invalidateKeys:[$.supportedAiProviders(e)],acceptableStatuses:[200]}),updateAiProviderModel:(e,t,n,{inputCostPerToken:r,outputCostPerToken:i,status:a})=>({url:`${K}/v1/buckets/${e}/providers/${t}/models/${n}`,method:`PATCH`,json:!0,body:JSON.stringify({inputCostPerToken:r,outputCostPerToken:i,status:a}),invalidateKeys:[$.supportedAiProviders(e)],acceptableStatuses:[200]}),deleteAiProviderModel:(e,t,n)=>({url:`${K}/v1/buckets/${e}/providers/${t}/models/${n}`,method:`DELETE`,invalidateKeys:[$.supportedAiProviders(e)],acceptableStatuses:[204]}),createAiProviderAssignment:(e,t,n)=>({url:`${K}/v1/accounts/${e}/projects/${t}/ai-provider-assignments`,method:`POST`,body:JSON.stringify({...n,metadata:JSON.stringify(n.metadata)}),headers:{"content-type":`application/json`},invalidateKeys:[$.aiProviderAssignments(e,t)],acceptableStatuses:[201]}),updateAiProviderAssignment:(e,t,n,r)=>({url:`${K}/v1/accounts/${e}/projects/${t}/ai-provider-assignments/${n}`,method:`PATCH`,body:JSON.stringify({...r,...r.metadata?{metadata:JSON.stringify(r.metadata)}:{}}),headers:{"content-type":`application/json`},invalidateKeys:[$.aiProviderAssignments(e,t)],acceptableStatuses:[200]}),deleteAiProviderAssignment:(e,t,n)=>({url:`${K}/v1/accounts/${e}/projects/${t}/ai-provider-assignments/${n}`,method:`DELETE`,invalidateKeys:[$.aiProviderAssignments(e,t)],acceptableStatuses:[204]})},projects:{createProject:(e,t,{productType:n,...r}={})=>({url:`${K}/v1/accounts/${e}/projects`,method:`POST`,body:JSON.stringify({name:t,productType:n,options:r}),removeKeys:[$.projects(e)],acceptableStatuses:[201]}),createProjectWithRepo:(e,t,n,r,i)=>({url:`${K}/v1/accounts/${e}/projects/$create-with-repo`,method:`POST`,body:JSON.stringify({projectName:t,orgName:n,repositoryName:r,defaultBranch:i}),removeKeys:[$.projects(e)],acceptableStatuses:[201]}),createProjectFromRepo:(e,t,n,r)=>({url:`${K}/v1/accounts/${e}/projects/$create-from-repo`,method:`POST`,body:JSON.stringify({projectName:t,sourceRepoUrl:n,defaultBranch:r}),removeKeys:[$.projects(e)],acceptableStatuses:[201]}),createRepoFromProject:(e,t,n,r,i,a)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$create-repo`,method:`POST`,body:JSON.stringify({orgName:n,repositoryName:r,defaultBranch:i,otherParams:a}),invalidateKeys:[$.projects(e),$.environments(e,t),ov.deployments.list(e,t).queryKey],acceptableStatuses:[201]}),connectProjectToRepo:(e,t,n,r,i,a)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$connect`,method:`PATCH`,body:JSON.stringify({orgName:n,repositoryURL:r,defaultBranch:i,forceConnect:a}),invalidateKeys:[$.projects(e),$.environments(e,t),ov.deployments.list(e,t).queryKey],acceptableStatuses:[201]}),disconnectProjectFromRepo:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$disconnect`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[$.projects(e)],acceptableStatuses:[201]}),initProject:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$init`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[$.projects(e)],acceptableStatuses:[201]}),deleteProject:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}`,method:`DELETE`,invalidateKeys:[$.projects(e),ov.deployments.list(e,t).queryKey],removeKeys:[$.environments(e,t)],acceptableStatuses:[204]}),archiveProject:e=>({url:`${K}/v1/deployments/${e}/archive`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[200]}),updateDefaultBranch:({accountName:e,projectName:t,defaultBranch:n,sourceRepoUrl:r})=>({url:`${K}/v1/accounts/${e}/projects/${t}/$update-default-branch`,method:`PATCH`,body:JSON.stringify({defaultBranch:n,sourceRepoUrl:r}),headers:{"content-type":`application/json`},invalidateKeys:[$.projects(e),ov.deployments.list(e,t).queryKey],removeKeys:[$.environments(e,t)],acceptableStatuses:[200]})},consumers:{createConsumer:e=>{let t={...e.consumer,accountName:e.accountName,projectName:e.projectName,environmentType:e.environmentType};return{url:`${K}/v1/api-keys/${e.bucketId}/consumers`,method:`POST`,body:JSON.stringify(t),headers:{"content-type":`application/json`},invalidateKeys:[$.consumersForBucket(e.bucketId)],acceptableStatuses:[201]}},updateConsumer:e=>({url:`${K}/v1/api-keys/${e.bucketId}/consumers/${e.consumer.id}`,method:`PATCH`,body:JSON.stringify({...e.consumer}),headers:{"content-type":`application/json`},invalidateKeys:[$.consumersForBucket(e.bucketId)],acceptableStatuses:[200]}),removeConsumer:e=>({url:`${K}/v1/api-keys/${e.bucketId}/consumers/${e.consumer.id}`,method:`DELETE`,invalidateKeys:[$.consumersForBucket(e.bucketId)]})},environmentVariables:{updateEnvironmentVariable:e=>({url:`${K}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.variableData.id}`,method:`PATCH`,body:JSON.stringify(e.variableData),invalidateKeys:[$.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[200]}),createEnvironmentVariable:e=>({url:`${K}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables`,method:`POST`,body:JSON.stringify(e.variableData),json:!0,invalidateKeys:[$.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[201]}),deleteEnvironmentVariable:e=>({url:`${K}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.id}`,method:`DELETE`,invalidateKeys:[$.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[204]})},users:{updatePreferences:e=>({url:`${K}/v1/users/me/preferences`,method:`PUT`,invalidateKeys:[$.user.preferences()],body:JSON.stringify({data:e}),headers:{"content-type":`application/json`},acceptableStatuses:[200]}),requestVerificationEmail:()=>({url:`${K}/v1/users/me/$send-verification-email`,method:`POST`,invalidateKeys:[],acceptableStatuses:[201]}),enrollMfaFactor:e=>({url:`${K}/v1/mfa/factors/enroll`,method:`POST`,body:JSON.stringify({factor:e}),invalidateKeys:[$.mfaFactors()],acceptableStatuses:[200],json:!0}),deleteMfaEnrollment:e=>({url:`${K}/v1/mfa/factors/enrollments/${e}`,method:`DELETE`,invalidateKeys:[$.mfaFactors()],acceptableStatuses:[200]})},sourceControlCredentials:{tokenExchangeSourceControlCredentials:(e,t,n)=>({url:`${K}/v1/accounts/${e}/source-control-configs/${t}/$token-exchange`,method:`POST`,body:JSON.stringify({code:n}),invalidateKeys:[$.accountsSourceControlConfigurations()],acceptableStatuses:[201]}),revokeSourceControlCredentials:(e,t)=>({url:`${K}/v1/accounts/${e}/source-control-configs/${t}/$revoke-token`,method:`DELETE`,invalidateKeys:[$.accountsSourceControlConfigurations()],acceptableStatuses:[204]})},sourceControlOperations:{commitPush:(e,t,n,r)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$commit-push`,method:`POST`,body:JSON.stringify({branchName:r,commitMessage:n}),acceptableStatuses:[201]}),sync:(e,t,n)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$sync`,method:`POST`,body:JSON.stringify({branchName:n}),acceptableStatuses:[201,200],invalidateKeys:[]})},testDesigner:{makeTestRequest:({environmentName:e,testRequest:t,overrideUrl:n})=>({url:`${Dc}/v1/test`,method:`POST`,body:JSON.stringify(hv({testRequest:t,overrideUrl:n,environmentName:e})),acceptableStatuses:pv,headers:{"content-type":`application/json`}})},featureRequest:{requestFeature:({email:e,featureName:t,information:n})=>{let r={featureName:t,information:{email:e,...n}};return{url:`${K}/v1/feature-access-request`,method:`POST`,body:JSON.stringify(r),acceptableStatuses:[200],headers:{"content-type":`application/json`}}}},fileTransactions:{saveFile:({environmentName:e,file:t})=>{let n={"content-type":`text/plain`};return t.lastModified&&(n[`if-unmodified-since`]=new Date(t.lastModified).toUTCString()),{url:`${K}/v1/deployments/${e}/fs/file?path=${t.path}`,method:`POST`,body:t.content,headers:n,acceptableStatuses:[204,200],invalidateKeys:[$.file(e,t.path),$.deploymentVersions(e),ov.deployments.versions.list(e).queryKey]}},renameFile:({environmentName:e,path:t,newPath:n})=>({url:`${K}/v1/deployments/${e}/fs/file?path=${t}`,method:`PATCH`,body:JSON.stringify({newPath:n}),acceptableStatuses:[204,200],headers:{"content-type":`application/json`},invalidateKeys:[]}),saveMultipleFiles:async({environmentName:e,files:t})=>{let n=new FormData,r={};for(let e of t)if(e.lastModified){let t=`x-if-unmodified-since-${encodeURIComponent(e.path)}`;r[t]=new Date(e.lastModified).toUTCString()}for(let{content:e,path:r}of t){let t=(await sv(r))?.id;n.append(`files[]`,new File([e??``],r,{type:t===`text/typescript`?`text/javascript`:t}),r)}let i=t.map(({path:t})=>$.file(e,t));return{url:`${K}/v1/deployments/${e}/fs/files`,method:`POST`,body:n,headers:r,acceptableStatuses:[204,200],invalidateKeys:[...i,$.deploymentVersions(e),ov.deployments.versions.list(e).queryKey]}},deleteFile:({environmentName:e,filePath:t})=>({url:`${K}/v1/deployments/${e}/fs/delete?path=${t}`,method:`DELETE`,acceptableStatuses:[204,200]})},directories:{createDirectory:({environmentName:e,path:t})=>({url:`${K}/v1/deployments/${e}/fs/dir?path=${t}`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[201]})},environments:{redeploy:({environmentName:e,isWorkingCopy:t,version:n})=>({url:t?`${K}/v1/deployments/${e}/$redeploy`:`${K}/v1/deployments/${e}/versions/${n}/$redeploy`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[200],invalidateKeys:[$.deploymentVersions(e),ov.deployments.versions.list(e).queryKey]}),delete:({environmentName:e})=>({url:`${K}/v1/deployments/${e}`,method:`DELETE`,body:JSON.stringify({}),acceptableStatuses:[200]})},accountInvite:{acceptAccountInvite:e=>({url:`${K}/v1/account-member-invites/${e}`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[$.accounts()],acceptableStatuses:[201]}),createAccountInvite:(e,t,n)=>{let r=n?.project?.name?[$.authProjectUsersRoles(e,n.project.name),n.team?.id?$.bucketConfigurationMembers(n.team?.bucketId,n.team?.id):[],$.authProjectUsersRoles(e,n.project.name,{includeInheritedRoles:!1}),$.authProjectUsersRoles(e,n.project.name,{includeInheritedRoles:!0})].flat():[];return{url:`${K}/v1/accounts/${e}/account-member-invites`,method:`POST`,body:JSON.stringify({userEmail:t,metadata:n}),invalidateKeys:[$.accountMemberInvites(e),$.authAccountUsersRoles(e),...r],acceptableStatuses:[201]}}},identity:{chatIdentity:e=>({url:`${K}/v1/chat-identity`,method:`POST`,json:!0,headers:{"content-type":`application/json`},body:JSON.stringify(e),invalidateKeys:[$.chatIdentity()],acceptableStatuses:[200]})},metering:{createMeteringPlan:(e,t,n)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/plans`,method:`POST`,headers:{"Content-Type":`application/json`},invalidateKeys:[$.meteringPlans(e,t),$.meteringBucket(e,t)],body:JSON.stringify(n)}),deleteMeteringPlan:(e,t,n)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/plans/${n}`,invalidateKeys:[$.meteringPlans(e,t),$.meteringBucket(e,t)],method:`DELETE`}),updateMeteringPlan:(e,t,{id:n,...r})=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/plans/${n}`,invalidateKeys:[$.meteringPlans(e,t),$.meteringBucket(e,t)],method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})},logs:{sourcemap:e=>({url:`${K}/v1/logs/sourcemap`,method:`POST`,json:!0,body:JSON.stringify(e),acceptableStatuses:[200]})},identityConnections:{createTicket:e=>({url:`${K}/v1/accounts/${e}/identity-connections/ticket`,method:`POST`,json:!0,body:JSON.stringify({}),invalidateKeys:[$.identityConnections(e)],acceptableStatuses:[200]})},migration:{migrateDevPortal:e=>({url:`${K}/v1/migrate/dev-portal`,method:`POST`,json:!1,body:JSON.stringify({deploymentName:e}),headers:{"content-type":`application/json`},acceptableStatuses:[200]})}},xv=e=>{let t=jm(),n=lp();return{fetch:async r=>{let i=Gc(),a;try{a=await Qm(t=>{let n=new Headers(r.headers);return r.json&&r.method!==`DELETE`&&n.set(`content-type`,`application/json`),n.set(`authorization`,`Bearer ${t}`),n.set(`zuplo-request-id`,i),fetch(r.url,{...e,method:r.method,headers:n,body:r.body})},n,ap)}catch(e){throw e instanceof wc&&e.setTraceId(i),e instanceof TypeError?new Cc({type:`https://zup.fail/api-request-failed`,title:`API request failed`,status:500,instance:r.url,traceId:i}):e}if(!(r.acceptableStatuses??[200]).includes(a.status)){let e=new wc(`Unexpected response: ${a.status} calling ${r.method}: ${r.url}`,{traceId:i});throw await e.tryReadResponse(a),e}return r.invalidateKeys?.forEach(e=>{if(Array.isArray(e))t.invalidateQueries({queryKey:e,exact:!1});else if(`url`in e&&e.url){let n=e.url.split(`?`)[0];t.invalidateQueries({predicate:e=>{let t=e.queryKey[0];return typeof t==`string`&&t.split(`?`)[0]===n}})}}),r.removeKeys?.forEach(e=>{t.removeQueries({queryKey:[e.url]})}),r.parseResponse===!1?a:r.json?await a.json():a}}};function Sv(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Cv=e((()=>{})),wv=n({default:()=>Ev}),Tv,Ev,Dv=e((()=>{Cv(),Tv=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ev=Sv(function(e){return Tv.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),Ov=[`top`,`right`,`bottom`,`left`],kv=Math.min,Av=Math.max,jv=Math.round,Mv=Math.floor,Nv=e=>({x:e,y:e}),Pv={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Fv={start:`end`,end:`start`};function Iv(e,t,n){return Av(e,kv(t,n))}function Lv(e,t){return typeof e==`function`?e(t):e}function Rv(e){return e.split(`-`)[0]}function zv(e){return e.split(`-`)[1]}function Bv(e){return e===`x`?`y`:`x`}function Vv(e){return e===`y`?`height`:`width`}var Hv=new Set([`top`,`bottom`]);function Uv(e){return Hv.has(Rv(e))?`y`:`x`}function Wv(e){return Bv(Uv(e))}function Gv(e,t,n){n===void 0&&(n=!1);let r=zv(e),i=Wv(e),a=Vv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ey(o)),[o,ey(o)]}function Kv(e){let t=ey(e);return[qv(e),t,qv(t)]}function qv(e){return e.replace(/start|end/g,e=>Fv[e])}var Jv=[`left`,`right`],Yv=[`right`,`left`],Xv=[`top`,`bottom`],Zv=[`bottom`,`top`];function Qv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Yv:Jv:t?Jv:Yv;case`left`:case`right`:return t?Xv:Zv;default:return[]}}function $v(e,t,n,r){let i=zv(e),a=Qv(Rv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(qv)))),a}function ey(e){return e.replace(/left|right|bottom|top/g,e=>Pv[e])}function ty(e){return{top:0,right:0,bottom:0,left:0,...e}}function ny(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ty(e)}function ry(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function iy(){return typeof window<`u`}function ay(e){return cy(e)?(e.nodeName||``).toLowerCase():`#document`}function oy(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sy(e){return((cy(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function cy(e){return iy()?e instanceof Node||e instanceof oy(e).Node:!1}function ly(e){return iy()?e instanceof Element||e instanceof oy(e).Element:!1}function uy(e){return iy()?e instanceof HTMLElement||e instanceof oy(e).HTMLElement:!1}function dy(e){return!iy()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof oy(e).ShadowRoot}var fy=new Set([`inline`,`contents`]);function py(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ey(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!fy.has(i)}var my=new Set([`table`,`td`,`th`]);function hy(e){return my.has(ay(e))}var gy=[`:popover-open`,`:modal`];function _y(e){return gy.some(t=>{try{return e.matches(t)}catch{return!1}})}var vy=[`transform`,`translate`,`scale`,`rotate`,`perspective`],yy=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],by=[`paint`,`layout`,`strict`,`content`];function xy(e){let t=Cy(),n=ly(e)?Ey(e):e;return vy.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||yy.some(e=>(n.willChange||``).includes(e))||by.some(e=>(n.contain||``).includes(e))}function Sy(e){let t=Oy(e);for(;uy(t)&&!Ty(t);){if(xy(t))return t;if(_y(t))return null;t=Oy(t)}return null}function Cy(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var wy=new Set([`html`,`body`,`#document`]);function Ty(e){return wy.has(ay(e))}function Ey(e){return oy(e).getComputedStyle(e)}function Dy(e){return ly(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oy(e){if(ay(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||dy(e)&&e.host||sy(e);return dy(t)?t.host:t}function ky(e){let t=Oy(e);return Ty(t)?e.ownerDocument?e.ownerDocument.body:e.body:uy(t)&&py(t)?t:ky(t)}function Ay(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ky(e),i=r===e.ownerDocument?.body,a=oy(r);if(i){let e=jy(a);return t.concat(a,a.visualViewport||[],py(r)?r:[],e&&n?Ay(e):[])}return t.concat(r,Ay(r,[],n))}function jy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function My(e){let[t,n]=q.useState(void 0);return Bl(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Ny=(0,q.createContext)(null),Py=()=>{let e=(0,q.useContext)(Ny);if(!e)throw Error(`useTheme must be used within a ThemeProvider`);return e},Fy=()=>{let{colorScheme:e,colorSchemePreference:t,setColorSchemePreference:n,toggleColorScheme:r}=Py();return{colorScheme:e,preference:t,setPreference:n,toggle:r}};function Iy(e,t,n){let{reference:r,floating:i}=e,a=Uv(t),o=Wv(t),s=Vv(o),c=Rv(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(zv(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var Ly=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Iy(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Iy(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function Ry(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Lv(t,e),p=ny(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ry(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ry(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var zy=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Lv(e,t)||{};if(l==null)return{};let d=ny(u),f={x:n,y:r},p=Wv(i),m=Vv(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=kv(d[_],T),D=kv(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Iv(O,A,k),M=!c.arrow&&zv(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),By=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Lv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Rv(r),_=Uv(o),v=Rv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ey(o)]:Kv(o)),x=p!==`none`;!d&&x&&b.push(...$v(o,m,p,y));let S=[o,...b],C=await Ry(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Gv(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Uv(t))||T.every(e=>Uv(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Uv(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Vy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hy(e){return Ov.some(t=>e[t]>=0)}var Uy=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=Lv(e,t);switch(r){case`referenceHidden`:{let e=Vy(await Ry(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Hy(e)}}}case`escaped`:{let e=Vy(await Ry(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Hy(e)}}}default:return{}}}}},Wy=new Set([`left`,`top`]);async function Gy(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rv(n),s=zv(n),c=Uv(n)===`y`,l=Wy.has(o)?-1:1,u=a&&c?-1:1,d=Lv(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ky=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Gy(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},qy=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Lv(e,t),l={x:n,y:r},u=await Ry(t,c),d=Uv(Rv(i)),f=Bv(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=Iv(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=Iv(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Jy=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Lv(e,t),u={x:n,y:r},d=Uv(i),f=Bv(d),p=u[f],m=u[d],h=Lv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Wy.has(Rv(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Yy=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Lv(e,t),u=await Ry(t,l),d=Rv(i),f=zv(i),p=Uv(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=kv(h-u[g],v),x=kv(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Av(u.left,0),t=Av(u.right,0),n=Av(u.top,0),r=Av(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Av(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Av(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Xy(e){let t=Ey(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=uy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jv(n)!==a||jv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Zy(e){return ly(e)?e:e.contextElement}function Qy(e){let t=Zy(e);if(!uy(t))return Nv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xy(t),o=(a?jv(n.width):n.width)/r,s=(a?jv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $y=Nv(0);function eb(e){let t=oy(e);return!Cy()||!t.visualViewport?$y:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==oy(e)?!1:t}function nb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Zy(e),o=Nv(1);t&&(r?ly(r)&&(o=Qy(r)):o=Qy(e));let s=tb(a,n,r)?eb(a):Nv(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=oy(a),t=r&&ly(r)?oy(r):r,n=e,i=jy(n);for(;i&&r&&t!==n;){let e=Qy(i),t=i.getBoundingClientRect(),r=Ey(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=oy(i),i=jy(n)}}return ry({width:u,height:d,x:c,y:l})}function rb(e,t){let n=Dy(e).scrollLeft;return t?t.left+n:nb(sy(e)).left+n}function ib(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-rb(e,n),y:n.top+t.scrollTop}}function ab(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=sy(r),s=t?_y(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Nv(1),u=Nv(0),d=uy(r);if((d||!d&&!a)&&((ay(r)!==`body`||py(o))&&(c=Dy(r)),uy(r))){let e=nb(r);l=Qy(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ib(o,c):Nv(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ob(e){return Array.from(e.getClientRects())}function sb(e){let t=sy(e),n=Dy(e),r=e.ownerDocument.body,i=Av(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Av(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+rb(e),s=-n.scrollTop;return Ey(r).direction===`rtl`&&(o+=Av(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var cb=25;function lb(e,t){let n=oy(e),r=sy(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Cy();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=rb(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=cb&&(a-=o)}else l<=cb&&(a+=l);return{width:a,height:o,x:s,y:c}}var ub=new Set([`absolute`,`fixed`]);function db(e,t){let n=nb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=uy(e)?Qy(e):Nv(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function fb(e,t,n){let r;if(t===`viewport`)r=lb(e,n);else if(t===`document`)r=sb(sy(e));else if(ly(t))r=db(t,n);else{let n=eb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ry(r)}function pb(e,t){let n=Oy(e);return n===t||!ly(n)||Ty(n)?!1:Ey(n).position===`fixed`||pb(n,t)}function mb(e,t){let n=t.get(e);if(n)return n;let r=Ay(e,[],!1).filter(e=>ly(e)&&ay(e)!==`body`),i=null,a=Ey(e).position===`fixed`,o=a?Oy(e):e;for(;ly(o)&&!Ty(o);){let t=Ey(o),n=xy(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&ub.has(i.position)||py(o)&&!n&&pb(e,o))?r=r.filter(e=>e!==o):i=t,o=Oy(o)}return t.set(e,r),r}function hb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?_y(t)?[]:mb(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=fb(t,n,i);return e.top=Av(r.top,e.top),e.right=kv(r.right,e.right),e.bottom=kv(r.bottom,e.bottom),e.left=Av(r.left,e.left),e},fb(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function gb(e){let{width:t,height:n}=Xy(e);return{width:t,height:n}}function _b(e,t,n){let r=uy(t),i=sy(t),a=n===`fixed`,o=nb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Nv(0);function l(){c.x=rb(i)}if(r||!r&&!a)if((ay(t)!==`body`||py(i))&&(s=Dy(t)),r){let e=nb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?ib(i,s):Nv(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function vb(e){return Ey(e).position===`static`}function yb(e,t){if(!uy(e)||Ey(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return sy(e)===n&&(n=n.ownerDocument.body),n}function bb(e,t){let n=oy(e);if(_y(e))return n;if(!uy(e)){let t=Oy(e);for(;t&&!Ty(t);){if(ly(t)&&!vb(t))return t;t=Oy(t)}return n}let r=yb(e,t);for(;r&&hy(r)&&vb(r);)r=yb(r,t);return r&&Ty(r)&&vb(r)&&!xy(r)?n:r||Sy(e)||n}var xb=async function(e){let t=this.getOffsetParent||bb,n=this.getDimensions,r=await n(e.floating);return{reference:_b(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sb(e){return Ey(e).direction===`rtl`}var Cb={convertOffsetParentRelativeRectToViewportRelativeRect:ab,getDocumentElement:sy,getClippingRect:hb,getOffsetParent:bb,getElementRects:xb,getClientRects:ob,getDimensions:gb,getScale:Qy,isElement:ly,isRTL:Sb};function wb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tb(e,t){let n=null,r,i=sy(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Mv(d),h=Mv(i.clientWidth-(u+f)),g=Mv(i.clientHeight-(d+p)),_=Mv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Av(0,kv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!wb(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Eb(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Zy(e),u=i||a?[...l?Ay(l):[],...Ay(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tb(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?nb(e):null;c&&g();function g(){let t=nb(e);h&&!wb(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Db=Ry,Ob=Ky,kb=qy,Ab=By,jb=Yy,Mb=Uy,Nb=zy,Pb=Jy,Fb=(e,t,n)=>{let r=new Map,i={platform:Cb,...n},a={...i.platform,_c:r};return Ly(e,t,{...i,platform:a})},Ib=typeof document<`u`?q.useLayoutEffect:function(){};function Lb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Lb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zb(e,t){let n=Rb(e);return Math.round(t*n)/n}function Bb(e){let t=q.useRef(e);return Ib(()=>{t.current=e}),t}function Vb(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=q.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=q.useState(r);Lb(f,r)||p(r);let[m,h]=q.useState(null),[g,_]=q.useState(null),v=q.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=q.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=q.useRef(null),C=q.useRef(null),w=q.useRef(u),T=c!=null,E=Bb(c),D=Bb(i),O=Bb(l),k=q.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Fb(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Lb(w.current,t)&&(w.current=t,bl.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Ib(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=q.useRef(!1);Ib(()=>(A.current=!0,()=>{A.current=!1}),[]),Ib(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=q.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=q.useMemo(()=>({reference:b,floating:x}),[b,x]),N=q.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=zb(M.floating,u.x),r=zb(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rb(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return q.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Hb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Nb({element:r.current,padding:i}).fn(n):r?Nb({element:r,padding:i}).fn(n):{}}}},Ub=(e,t)=>({...Ob(e),options:[e,t]}),Wb=(e,t)=>({...kb(e),options:[e,t]}),Gb=(e,t)=>({...Pb(e),options:[e,t]}),Kb=(e,t)=>({...Ab(e),options:[e,t]}),qb=(e,t)=>({...jb(e),options:[e,t]}),Jb=(e,t)=>({...Mb(e),options:[e,t]}),Yb=(e,t)=>({...Hb(e),options:[e,t]}),Xb=`Arrow`,Zb=q.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,J.jsx)(kh.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,J.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Zb.displayName=Xb;var Qb=Zb,$b=`Popper`,[ex,tx]=nl($b),[nx,rx]=ex($b),ix=e=>{let{__scopePopper:t,children:n}=e,[r,i]=q.useState(null);return(0,J.jsx)(nx,{scope:t,anchor:r,onAnchorChange:i,children:n})};ix.displayName=$b;var ax=`PopperAnchor`,ox=q.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=rx(ax,n),o=q.useRef(null),s=Qc(t,o),c=q.useRef(null);return q.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,J.jsx)(kh.div,{...i,ref:s})});ox.displayName=ax;var sx=`PopperContent`,[cx,lx]=ex(sx),ux=q.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=rx(sx,n),[_,v]=q.useState(null),y=Qc(t,e=>v(e)),[b,x]=q.useState(null),S=My(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(mx),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:ee}=Vb({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Eb(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Ub({mainAxis:i+w,alignmentAxis:o}),c&&Wb({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Gb():void 0,...k}),c&&Kb({...k}),qb({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Yb({element:b,padding:s}),hx({arrowWidth:C,arrowHeight:w}),f&&Jb({strategy:`referenceHidden`,...k})]}),[te,ne]=gx(M),re=Vl(m);Bl(()=>{N&&re?.()},[N,re]);let ie=ee.arrow?.x,ae=ee.arrow?.y,oe=ee.arrow?.centerOffset!==0,[se,ce]=q.useState();return Bl(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,J.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(` `),...ee.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,J.jsx)(cx,{scope:n,placedSide:te,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,J.jsx)(kh.div,{"data-side":te,"data-align":ne,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});ux.displayName=sx;var dx=`PopperArrow`,fx={top:`bottom`,right:`left`,bottom:`top`,left:`right`},px=q.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=lx(dx,n),a=fx[i.placedSide];return(0,J.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,J.jsx)(Qb,{...r,ref:t,style:{...r.style,display:`block`}})})});px.displayName=dx;function mx(e){return e!==null}var hx=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=gx(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function gx(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var _x=ix,vx=ox,yx=ux,bx=px,xx=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Sx=`VisuallyHidden`,Cx=q.forwardRef((e,t)=>(0,J.jsx)(kh.span,{...e,ref:t,style:{...xx,...e.style}}));Cx.displayName=Sx;var wx=Cx,Tx=q.createContext(void 0);function Ex(e){let t=q.useContext(Tx);return e||t||`ltr`}function Dx(e){let t=e+`CollectionProvider`,[n,r]=nl(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=q.useRef(null),a=q.useRef(new Map).current;return(0,J.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Sh(s),l=q.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,J.jsx)(c,{ref:Qc(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Sh(u),p=q.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=q.useRef(null),s=Qc(t,o),c=a(u,n);return q.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,J.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return q.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}export{Av as $,mm as $t,xy as A,el as An,Ah as At,Lv as B,jc as Bn,Hm as Bt,sy as C,Ul as Cn,s_ as Ct,Ay as D,jl as Dn,Ph as Dt,Dy as E,zl as En,zh as Et,hy as F,Gc as Fn,nh as Ft,Vv as G,vc as Gn,Bm as Gt,zv as H,wc as Hn,Wm as Ht,_y as I,Rc as In,Qm as It,$v as J,l as Jn,Pm as Jt,Kv as K,fc as Kn,zm as Kt,Cy as L,Ac as Ln,Ym as Lt,uy as M,Qc as Mn,Th as Mt,Ty as N,Yc as Nn,uh as Nt,Oy as O,Rl as On,Mh as Ot,py as P,Jc as Pn,ah as Pt,Uv as Q,xm as Qt,Iv as R,Ec as Rn,Jm as Rt,Sy as S,Nf as Sn,P_ as St,ay as T,Bl as Tn,Yg as Tt,Wv as U,Cc as Un,Um as Ut,Mv as V,yc as Vn,Gm as Vt,Gv as W,Sc as Wn,Rm as Wt,ny as X,o as Xn,jm as Xt,ey as Y,c as Yn,Mm as Yt,Rv as Z,Dm as Zt,Fy as _,op as _n,H_ as _t,vx as a,Lp as an,Dv as at,My as b,Kf as bn,W_ as bt,_x as c,Pp as cn,dv as ct,Ub as d,Bp as dn,$ as dt,um as en,kv as et,Wb as f,Mp as fn,cv as ft,Db as g,lp as gn,G_ as gt,Eb as h,Cp as hn,U_ as ht,xx as i,kp as in,wv as it,ly as j,Zc as jn,Sh as jt,oy as k,nl as kn,kh as kt,tx as l,Op as ln,vv as lt,Vb as m,Xp as mn,K_ as mt,Ex as n,rm as nn,jv as nt,bx as o,Ip as on,xv as ot,qb as p,Vp as pn,ov as pt,Bv as q,m as qn,Lm as qt,wx as r,$p as rn,Ov as rt,yx as s,Fp as sn,bv as st,Dx as t,im as tn,ry as tt,Kb as u,Rp as un,yv as ut,Py as v,sp as vn,V_ as vt,jy as w,Vl as wn,i_ as wt,Ey as x,Gf as xn,B_ as xt,Ny as y,ap as yn,z_ as yt,Nv as z,K as zn,qm as zt};
|
|
48
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return q.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},J_=`DialogDescriptionWarning`,Y_=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${K_(J_).contentName}}.`;return q.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},X_=x_,Z_=C_,Q_=D_,$_=k_,ev=N_,tv=R_,nv=B_,rv=H_;function iv(e){let t=new Date;switch(e){case`7d`:t.setUTCDate(t.getUTCDate()-7);break;case`30d`:t.setUTCDate(t.getUTCDate()-30);break;case`3m`:t.setUTCMonth(t.getUTCMonth()-3);break}return t.toISOString()}async function av(e,t){let n=t.pageSize??30,{page:r,pageSize:i,order:a=`DESC`,orderBy:o=`periodStart`,...s}=t,{data:c,error:l}=await dh.GET(`/v3/metering/{bucketId}/billing/invoices`,{params:{path:{bucketId:e},query:{page:r,pageSize:n,expand:[`lines`],order:a,orderBy:o,...s}}});if(l||!c)throw l??Error(`Failed to load invoices`);return c}var ov=15;async function sv(e,t,n=6){let r=await av(e,{page:1,pageSize:n,createdAfter:iv(`3m`),order:`DESC`,orderBy:`periodStart`,customers:[t]}),i=r.items??[];if(i.length===0||i.every(e=>e.customer?.id===t))return r;let a=[],o=1;for(;a.length<n&&o<=ov;){let r=await av(e,{page:o,pageSize:30,createdAfter:iv(`3m`),order:`DESC`,orderBy:`periodStart`}),i=r.items??[];if(i.length===0)break;for(let e of i)if(e.customer?.id===t&&(a.push(e),a.length>=n))break;let s=r.pageSize??30,c=Math.max(1,Math.ceil((r.totalCount??0)/s));if(o>=c)break;o++}let s=a.slice(0,n);return{...r,items:s,totalCount:s.length,page:1,pageSize:n}}var cv={orderBy:`createdAt`,order:`DESC`},lv=`/v3/metering/{bucketId}/plans`,uv=`/v3/metering/{bucketId}/customers`;function dv(e){if(!e)return;let t={};return e.page!=null&&(t.page=e.page,t.pageSize=e.pageSize??30),e.status?.length&&(t.status=e.status),Object.keys(t).length>0?t:void 0}function fv(e,t){let n=dv(t);return n?{params:{path:{bucketId:e},query:n}}:{params:{path:{bucketId:e}}}}function pv(e){if(!e)return;let t={orderBy:e.orderBy??cv.orderBy,order:e.order??cv.order};return e.page!=null&&(t.page=e.page,t.pageSize=e.pageSize??30),e.planKey&&(t.planKey=e.planKey),e.name&&(t.name=e.name),e.key&&(t.key=e.key),e.primaryEmail&&(t.primaryEmail=e.primaryEmail),Object.keys(t).length>0?t:void 0}function mv(e,t){let n=pv(t);return n?{params:{path:{bucketId:e},query:n}}:{params:{path:{bucketId:e}}}}function hv(e){let t={page:e.page??1,pageSize:e.pageSize??30};return e.includeArchived!=null&&(t.includeArchived=e.includeArchived),t}function gv(e,t,n){return Array.isArray(e)?{items:e,totalCount:e.length,page:t,pageSize:n}:e}var _v={ai:{providerAssignments:{list:(e,t)=>fh.queryOptions(`get`,`/v1/accounts/{accountName}/projects/{projectName}/ai-provider-assignments`,{params:{path:{accountName:e,projectName:t}}},{select:e=>e.data})}},deployments:{list:(e,t)=>fh.queryOptions(`get`,`/v1/accounts/{accountName}/projects/{projectName}/deployments`,{params:{path:{accountName:e,projectName:t}}}),versions:{list:e=>fh.queryOptions(`get`,`/v1/deployments/{deploymentName}/versions`,{params:{path:{deploymentName:e}}})}},metering:{customers:{list:(e,t)=>fh.queryOptions(`get`,uv,mv(e,t),t?.page==null?void 0:{placeholderData:im}),get:(e,t)=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/customers/{customerIdOrKey}`,{params:{path:{bucketId:e,customerIdOrKey:t}}}),subscriptions:(e,t)=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/customers/{customerIdOrKey}/subscriptions`,{params:{path:{bucketId:e,customerIdOrKey:t}}})},plans:{list:(e,t)=>fh.queryOptions(`get`,lv,fv(e,t),t?.page==null?void 0:{placeholderData:im}),get:(e,t)=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/plans/{planId}`,{params:{path:{bucketId:e,planId:t}}}),listByKey:(e,t)=>fh.queryOptions(`get`,lv,{params:{path:{bucketId:e},query:{key:[t]}}})},meters:{list:e=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/meters`,{params:{path:{bucketId:e}}})},configuration:{get:e=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/monetization-configuration`,{params:{path:{bucketId:e}}})},features:{list:(e,t)=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/features`,{params:{path:{bucketId:e},query:t?{includeArchived:t}:void 0}},{select:e=>Array.isArray(e)?e:e.items}),listPaginated:(e,t)=>{let n=t.page??1,r=t.pageSize??30;return fh.queryOptions(`get`,`/v3/metering/{bucketId}/features`,{params:{path:{bucketId:e},query:hv(t)}},{select:e=>gv(e,n,r),placeholderData:im})}},planInvites:{list:e=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/plan-invites`,{params:{path:{bucketId:e}}})},billingReadiness:{get:e=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/billing-readiness`,{params:{path:{bucketId:e}}})},stripe:{setup:e=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/setup/stripe`,{params:{path:{bucketId:e}}})},subscriptions:{get:(e,t)=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}`,{params:{path:{bucketId:e,subscriptionId:t}}}),access:(e,t)=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}/access`,{params:{path:{bucketId:e,subscriptionId:t}}}),usage:(e,t)=>fh.queryOptions(`get`,`/v3/metering/{bucketId}/subscriptions/{subscriptionId}/usage`,{params:{path:{bucketId:e,subscriptionId:t}}})},invoices:{list:(e,t,n,r,i,a)=>({queryKey:[`metering`,e,`invoices`,t,n,r??`all`,a,i],queryFn:()=>av(e,{page:n,pageSize:30,createdAfter:iv(t),order:i,orderBy:a,...r?.statuses?.length?{statuses:r.statuses}:{},...r?.extendedStatuses?.length?{extendedStatuses:r.extendedStatuses}:{}}),placeholderData:im}),forCustomer:(e,t)=>({queryKey:[`metering`,e,`invoices`,`customer`,t],queryFn:()=>sv(e,t)})}}},vv=async e=>yv(e,await i(()=>import(`./editor.main-B7ZQNwu9.js`),__vite__mapDeps([0,1,2,3,4,5,6]))),yv=(e,t)=>{let n=e.split(`.`).pop();if(n)return t.languages.getLanguages().find(e=>e.extensions?.includes(`.${n}`))},bv=e=>{let t=Object.entries(e).flatMap(([e,t])=>t?[[e,t]]:[]);return new URLSearchParams(t).toString()},$={user:{preferences:()=>({url:`${K}/v1/users/me/preferences`})},authApiKey:e=>({url:`${K}/v1/auth/api-keys/${e}`}),authAccountApiKeys:e=>({url:`${K}/v1/auth/api-keys?accountName=${e}`}),authCurrentUserAccountRoles:e=>({url:`${K}/v1/auth/users/me?accountName=${e}`}),authUserAccountRoles:(e,t)=>({url:`${K}/v1/auth/users/${t}?accountName=${e}`}),authProjectUsersRoles:(e,t,{includeInheritedRoles:n}={includeInheritedRoles:!1})=>({url:`${K}/v1/auth/users?accountName=${e}&projectName=${t}&includeInheritedRoles=${n}`}),authAccountUsersRoles:e=>({url:`${K}/v1/auth/users?accountName=${e}`}),mfaFactors:()=>({url:`${K}/v1/mfa/factors`}),accountMemberInviteDetails:e=>({url:`${K}/v1/account-member-invites/${e}`}),accountMemberInvites:e=>({url:`${K}/v1/accounts/${e}/account-member-invites`}),accountAuditLogs:(e,t)=>{let n=new URLSearchParams;t?.limit&&n.append(`limit`,t.limit.toString()),t?.offset&&n.append(`offset`,t.offset.toString()),t?.action&&n.append(`action`,t.action),t?.startDate&&n.append(`startDate`,t.startDate),t?.endDate&&n.append(`endDate`,t.endDate),t?.actor&&n.append(`actor`,t.actor),t?.success!==void 0&&n.append(`success`,t.success.toString());let r=n.toString();return{url:`${K}/v1/accounts/${e}/audit-logs${r?`?${r}`:``}`}},account:e=>({url:`${K}/v1/accounts/${e}`}),bucketAuditLogsEvents:(e,t)=>{let n=new URLSearchParams;t?.limit!==void 0&&n.append(`limit`,String(t.limit)),t?.cursor&&n.append(`cursor`,t.cursor),t?.type&&n.append(`type`,t.type),t?.actorSub&&n.append(`actorSub`,t.actorSub),t?.subject&&n.append(`subject`,t.subject),t?.startDate&&n.append(`startDate`,t.startDate),t?.endDate&&n.append(`endDate`,t.endDate);let r=n.toString();return{url:`${K}/v1/audit-logs/${e}/events${r?`?${r}`:``}`}},bucketAuditLogsStats:(e,t)=>{let n=new URLSearchParams;return n.append(`groupBy`,t.groupBy),t.limit!==void 0&&n.append(`limit`,String(t.limit)),t.startDate&&n.append(`startDate`,t.startDate),t.endDate&&n.append(`endDate`,t.endDate),{url:`${K}/v1/audit-logs/${e}/stats?${n.toString()}`}},accounts:()=>({url:`${K}/v1/accounts`}),accountSourceControlRepoList:e=>({url:`${K}/v1/accounts/${e}/$repo-list`}),accountSourceControlAzureProjects:(e,t)=>({url:`${K}/v1/accounts/${e}/source-control/$azure-projects?organization=${t}`}),accountSourceControlNamespaces:e=>({url:`${K}/v1/accounts/${e}/$namespaces`}),accountSourceControlRepos:(e,t,n)=>({url:`${K}/v1/accounts/${e}/$repos?${new URLSearchParams({namespace:t,query:n??``})}`}),accountsSourceControlConfigurations:()=>({url:`${K}/v1/user/me/source-control-configs`}),billing:e=>({url:`${K}/v1/accounts/${e}/billings`}),buildLogs:(e,t)=>({url:`${K}/v2/deployments/${e}/build-logs/${t}`}),cdnContent:e=>({url:`${Ac}${e}`}),chatIdentity:()=>({url:`${K}/v1/chat-identity`}),knockIdentity:()=>({url:`${K}/v1/knock-identity`}),bucketConfigurations:e=>({url:`${K}/v1/buckets/${e}/configurations`}),bucketConfigurationTeams:e=>({url:`${K}/v1/buckets/${e}/configurations/teams`}),bucketConfigurationApps:e=>({url:`${K}/v1/buckets/${e}/configurations/apps`}),bucketConfiguration:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations/${t}`}),bucketConfigurationUsage:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/usage`}),bucketConfigurationMembers:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members`}),bucketConfigurationMember:(e,t,n)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`}),supportedAiProviders:e=>({url:`${K}/v1/buckets/${e}/providers`}),aiProviderAssignments:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/ai-provider-assignments`}),hierarchicalQuota:e=>({url:`${K}/v1/hierarchical-quota/${e}`}),consumer:(e,t)=>({url:`${K}/v1/api-keys/${e}/consumers/${t}`}),consumersForBucket:(e,t)=>{let n=bv({limit:t?.limit?.toString(),offset:t?.offset?.toString(),name:t?.name,email:t?.email});return{url:`${K}/v1/api-keys/${e}/consumers${n?`?${n}`:``}`}},customDomains:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/custom-domains`}),accountCustomDomains:e=>({url:`${K}/v1/accounts/${e}/custom-domains`}),deploymentVersions:e=>({url:`${K}/v1/deployments/${e}/versions`}),environments:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/deployments`}),environmentVariables:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/environment-variables`}),file:(e,t)=>({url:`${K}/v1/deployments/${e}/fs/file?path=${t}`}),fsStats:e=>({url:`${K}/v1/deployments/${e}/fs/stats`}),gitBranches:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$branches`}),projectSyncStatus:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/sync-status`}),meteringBucket:(e,t)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/`}),meteringPlans:(e,t)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/plans`}),meteringSubscriptions:(e,t)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/subscriptions`}),meteringSubscriptionQuotas:(e,t,n)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/subscriptions/${n}/quotas`}),project:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}`}),projects:e=>({url:`${K}/v1/accounts/${e}/projects`}),permissions:(e,t)=>({url:`${K}/v1/permissions/${e}/${t}`}),permissionsProject:(e,t)=>({url:`${K}/v1/permissions/project/${e}|${t}`}),permissionsAiTeam:e=>({url:`${K}/v1/permissions/ai_team/${e}`}),logViewerRequests:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.cursor&&n.append(`cursor`,t.cursor),t.since&&n.append(`since`,t.since),t.sinceId&&n.append(`sinceId`,t.sinceId),t.limit&&n.append(`limit`,t.limit.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/deployments/${e}/logs/requests?${n}`}},logViewerRequestDetail:(e,t,n)=>{let r=new URLSearchParams;n&&r.append(`timestamp`,n);let i=r.toString();return{url:`${K}/v2/deployments/${e}/logs/requests/${t}${i?`?${i}`:``}`}},logViewerHistogram:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/deployments/${e}/logs/histogram?${n}`}},logViewerFacets:(e,t)=>{let n=new URLSearchParams;return n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.facets&&n.append(`facets`,t.facets),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/deployments/${e}/logs/facets?${n}`}},logViewerRequestsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.cursor&&n.append(`cursor`,t.cursor),t.since&&n.append(`since`,t.since),t.sinceId&&n.append(`sinceId`,t.sinceId),t.limit&&n.append(`limit`,t.limit.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/logs/requests?${n}`}},logViewerRequestDetailScoped:(e,t,n)=>{let r=new URLSearchParams;return r.append(`account`,e.accountName),e.projectName&&r.append(`project`,e.projectName),e.deploymentName&&r.append(`deploymentName`,e.deploymentName),n&&r.append(`timestamp`,n),{url:`${K}/v2/logs/requests/${t}?${r}`}},logViewerHistogramScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/logs/histogram?${n}`}},logViewerFacetsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.facets&&n.append(`facets`,t.facets),t.httpMethod&&n.append(`httpMethod`,t.httpMethod),t.httpStatus&&n.append(`httpStatus`,t.httpStatus),t.routePath&&n.append(`routePath`,t.routePath),t.search&&n.append(`search`,t.search),t.severity&&n.append(`severity`,t.severity),{url:`${K}/v2/logs/facets?${n}`}},tracesListScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),t.limit&&n.append(`limit`,String(t.limit)),t.cursor&&n.append(`cursor`,t.cursor),{url:`${K}/v2/traces?${n}`}},traceDetailScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),{url:`${K}/v2/traces/${encodeURIComponent(t)}?${n}`}},traceStatsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.intervalSeconds&&n.append(`intervalSeconds`,t.intervalSeconds.toString()),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),{url:`${K}/v2/trace-stats?${n}`}},traceFacetsScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.facets&&n.append(`facets`,t.facets),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),t.service&&n.append(`service`,t.service),t.hasError!==void 0&&n.append(`hasError`,String(t.hasError)),t.search&&n.append(`search`,t.search),{url:`${K}/v2/trace-facets?${n}`}},serviceMapScoped:(e,t)=>{let n=new URLSearchParams;return n.append(`account`,e.accountName),e.projectName&&n.append(`project`,e.projectName),e.deploymentName&&n.append(`deploymentName`,e.deploymentName),n.append(`start`,t.start),n.append(`end`,t.end),t.statusCode&&n.append(`statusCode`,t.statusCode),t.method&&n.append(`method`,t.method),t.route&&n.append(`route`,t.route),{url:`${K}/v2/service-map?${n}`}},usersMe:()=>({url:`${K}/v1/users/me`}),identityConnections:e=>({url:`${K}/v1/accounts/${e}/identity-connections`}),identityConnectionTicket:e=>({url:`${K}/v1/accounts/${e}/identity-connections/ticket`}),analyticsRequests:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return e.compare&&t.append(`compare`,`previous`),{url:`${K}/v2/analytics/requests?${t}`}},analyticsRequestsField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/requests/fields/${encodeURIComponent(e)}?${n}`}},analyticsConsumers:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/consumers?${t}`}},analyticsAgents:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.includeOther===!0&&t.append(`includeOther`,`true`),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/agents?${t}`}},analyticsAgentsTimeSeries:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.includeOther===!0&&t.append(`includeOther`,`true`),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/agents/timeseries?${t}`}},analyticsBackend:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/backend?${t}`}},analyticsEdge:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/edge?${t}`}},analyticsAiGateway:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/ai-gateway?${t}`}},analyticsAiGatewayField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/ai-gateway/fields/${encodeURIComponent(e)}?${n}`}},analyticsCache:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/cache?${t}`}},analyticsCacheField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/cache/fields/${encodeURIComponent(e)}?${n}`}},analyticsMcp:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/mcp?${t}`}},analyticsGraphql:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.intervalSeconds&&t.append(`intervalSeconds`,e.intervalSeconds.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/graphql?${t}`}},analyticsMcpField:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/mcp/fields/${encodeURIComponent(e)}?${n}`}},analyticsMcpCapabilities:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.view&&t.append(`view`,e.view),e.capabilityType&&t.append(`capabilityType`,e.capabilityType),e.limit&&t.append(`limit`,e.limit.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/mcp/capabilities?${t}`}},analyticsMcpEvents:e=>{let t=new URLSearchParams;if(t.append(`account`,e.accountName),e.projectName&&t.append(`project`,e.projectName),t.append(`startTime`,e.startTime),t.append(`endTime`,e.endTime),e.offset!=null&&t.append(`offset`,e.offset.toString()),e.limit!=null&&t.append(`limit`,e.limit.toString()),e.filters)for(let n of e.filters)t.append(`filter`,n);return{url:`${K}/v2/analytics/mcp/events?${t}`}},analyticsMcpBreakdown:(e,t)=>{let n=new URLSearchParams;if(n.append(`account`,t.accountName),t.projectName&&n.append(`project`,t.projectName),n.append(`startTime`,t.startTime),n.append(`endTime`,t.endTime),t.offset!=null&&n.append(`offset`,t.offset.toString()),t.limit!=null&&n.append(`limit`,t.limit.toString()),t.filters)for(let e of t.filters)n.append(`filter`,e);return{url:`${K}/v2/analytics/mcp/breakdowns/${e}?${n}`}},analyticsUsage:e=>{let t=new URLSearchParams;return t.append(`account`,e.accountName),t.append(`from`,e.from),t.append(`to`,e.to),{url:`${K}/v2/analytics/usage?${t}`}}},xv=`x-test-proxy-error`,Sv=`The gateway URL isn't ready yet — this environment is still being provisioned for its first deploy. Wait for the build to finish, then try again.`,Cv=class extends Error{constructor(e=Sv){super(e),this.name=`GatewayUrlUnavailableError`}},wv=[200,400,413,502],Tv=({pathname:e,overrideUrl:t})=>{if(!t)throw new Cv;return new URL(e??``,t).toString()},Ev=`zp-build-id`,Dv=({testRequest:e,overrideUrl:t,environmentName:n,buildId:r})=>({url:Tv({pathname:e.pathname,overrideUrl:t}),method:e.method,deployment:n,headers:r&&!Ov(e.headers)?{[Ev]:r,...e.headers}:e.headers,body:e.body}),Ov=e=>Object.keys(e??{}).some(e=>e.toLowerCase()===Ev),kv=e=>{if(typeof e!=`object`||!e)return!1;let{status:t,body:n}=e;if(t!==404||typeof n!=`string`)return!1;try{return JSON.parse(n)?.title===`Build Not Found`}catch{return!1}},Av={invalid_request:`The Zuplo test proxy rejected the request as invalid.`,get_or_head_with_body:`The Zuplo test proxy rejected the request because GET and HEAD requests can't include a body.`,invalid_request_body:`The Zuplo test proxy couldn't read the request body.`,request_too_large:`The Zuplo test proxy rejected the request because it exceeds the 250 KB limit.`,upstream_request_failed:`The Zuplo test proxy couldn't reach your API — it was unreachable, timed out, or refused the connection.`},jv=e=>{let t=(e.code?Av[e.code]:void 0)??e.detail??e.title??`The Zuplo test proxy couldn't run this request.`;return`${t}${e.detail&&e.detail!==t?` ${e.detail}`:``} This is an error from the Zuplo test proxy, not a response from your API.`},Mv=class extends Error{code;status;detail;title;constructor(e){super(jv(e)),this.name=`TestProxyError`,this.code=e.code,this.status=e.status,this.detail=e.detail,this.title=e.title}},Nv=async e=>{let t=e.headers.get(xv),n;try{let t=await e.clone().json();t&&typeof t==`object`&&(n=t)}catch{}return new Mv({code:n?.code??t??void 0,detail:typeof n?.detail==`string`?n.detail:void 0,title:typeof n?.title==`string`?n.title:void 0,status:typeof n?.status==`number`?n.status:e.status})},Pv={createApiKey:e=>({url:`${K}/v1/auth/api-keys`,method:`POST`,json:!0,body:JSON.stringify(e),invalidateKeys:[$.authAccountApiKeys(e.accountName)],acceptableStatuses:[200]}),deleteApiKey:(e,t)=>({url:`${K}/v1/auth/api-keys/${e}`,method:`DELETE`,invalidateKeys:[$.authApiKey(e),$.authAccountApiKeys(t)],acceptableStatuses:[204]}),updateUsersRole:({userId:e,accountName:t,projectName:n,role:r})=>({url:`${K}/v1/auth/users/${e}`,method:`PATCH`,json:!0,body:JSON.stringify({accountName:t,projectName:n,role:r}),parseResponse:!1,invalidateKeys:n?[$.authProjectUsersRoles(t,n,{includeInheritedRoles:!1}),$.authProjectUsersRoles(t,n,{includeInheritedRoles:!0}),$.authAccountUsersRoles(t)]:[$.authAccountUsersRoles(t)],acceptableStatuses:[201,200]})},Fv={createAccount:e=>({url:`${K}/v1/accounts`,method:`POST`,json:!0,body:JSON.stringify(e),invalidateKeys:[$.accounts()],acceptableStatuses:[201]}),deleteAccount:e=>({url:`${K}/v1/accounts/${e.name}`,method:`DELETE`,invalidateKeys:[$.accounts()],acceptableStatuses:[200]}),createCustomDomain:({accountName:e,projectName:t,isAlias:n,hostname:r,deploymentName:i,stage:a})=>({url:`${K}/v1/accounts/${e}/custom-domains`,method:`POST`,body:JSON.stringify({hostname:r,isAlias:n,deploymentName:i,stage:a}),invalidateKeys:[$.accounts(),$.projects(e),$.environments(e,t),$.customDomains(e,t),$.accountCustomDomains(e),_v.deployments.list(e,t).queryKey],acceptableStatuses:[200]}),deleteAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${K}/v1/accounts/${e}/account-member-invites/${t}`,method:`DELETE`,invalidateKeys:[$.accountMemberInvites(e)],acceptableStatuses:[204]}),deleteCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${K}/v1/accounts/${e}/custom-domains?hostname=${n}&deploymentName=${r}`,method:`DELETE`,invalidateKeys:[$.accounts(),$.projects(e),$.environments(e,t),$.customDomains(e,t),_v.deployments.list(e,t).queryKey],acceptableStatuses:[204]}),editCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${K}/v1/accounts/${e}/custom-domains`,method:`PATCH`,body:JSON.stringify({hostname:n,deploymentName:r}),invalidateKeys:[$.accounts(),$.projects(e),$.environments(e,t),$.customDomains(e,t),_v.deployments.list(e,t).queryKey],acceptableStatuses:[200]}),resendAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${K}/v1/accounts/${e}/account-member-invites/${t}/$resend`,method:`PATCH`,body:JSON.stringify({}),invalidateKeys:[$.accountMemberInvites(e)],acceptableStatuses:[201]}),billingUpgrade:(e,t,n,r)=>({method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({successUrl:n,cancelUrl:r}),url:`${K}/v1/accounts/${e}/upgrade/${t}`}),updateAccount:({accountName:e,...t})=>({url:`${K}/v1/accounts/${e}`,method:`PATCH`,body:JSON.stringify(t),json:!0,invalidateKeys:[$.accounts()],acceptableStatuses:[200]})},Iv={createProject:(e,t,{productType:n,...r}={})=>({url:`${K}/v1/accounts/${e}/projects`,method:`POST`,body:JSON.stringify({name:t,productType:n,options:r}),removeKeys:[$.projects(e)],acceptableStatuses:[201]}),createProjectWithRepo:(e,t,n,r,i)=>({url:`${K}/v1/accounts/${e}/projects/$create-with-repo`,method:`POST`,body:JSON.stringify({projectName:t,orgName:n,repositoryName:r,defaultBranch:i}),removeKeys:[$.projects(e)],acceptableStatuses:[201]}),createProjectFromRepo:(e,t,n,r)=>({url:`${K}/v1/accounts/${e}/projects/$create-from-repo`,method:`POST`,body:JSON.stringify({projectName:t,sourceRepoUrl:n,defaultBranch:r}),removeKeys:[$.projects(e)],acceptableStatuses:[201]}),createRepoFromProject:(e,t,n,r,i,a)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$create-repo`,method:`POST`,body:JSON.stringify({orgName:n,repositoryName:r,defaultBranch:i,otherParams:a}),invalidateKeys:[$.projects(e),$.environments(e,t),_v.deployments.list(e,t).queryKey],acceptableStatuses:[201]}),connectProjectToRepo:(e,t,n,r,i,a)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$connect`,method:`PATCH`,body:JSON.stringify({orgName:n,repositoryURL:r,defaultBranch:i,forceConnect:a}),invalidateKeys:[$.projects(e),$.environments(e,t),_v.deployments.list(e,t).queryKey],acceptableStatuses:[201]}),disconnectProjectFromRepo:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$disconnect`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[$.projects(e)],acceptableStatuses:[201]}),initProject:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$init`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[$.projects(e)],acceptableStatuses:[201]}),deleteProject:(e,t)=>({url:`${K}/v1/accounts/${e}/projects/${t}`,method:`DELETE`,invalidateKeys:[$.projects(e),_v.deployments.list(e,t).queryKey],removeKeys:[$.environments(e,t)],acceptableStatuses:[204]}),archiveProject:e=>({url:`${K}/v1/deployments/${e}/archive`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[200]}),updateDefaultBranch:({accountName:e,projectName:t,defaultBranch:n,sourceRepoUrl:r})=>({url:`${K}/v1/accounts/${e}/projects/${t}/$update-default-branch`,method:`PATCH`,body:JSON.stringify({defaultBranch:n,sourceRepoUrl:r}),headers:{"content-type":`application/json`},invalidateKeys:[$.projects(e),_v.deployments.list(e,t).queryKey],removeKeys:[$.environments(e,t)],acceptableStatuses:[200]})},Lv={createConsumer:e=>{let t={...e.consumer,accountName:e.accountName,projectName:e.projectName,environmentType:e.environmentType};return{url:`${K}/v1/api-keys/${e.bucketId}/consumers`,method:`POST`,body:JSON.stringify(t),headers:{"content-type":`application/json`},invalidateKeys:[$.consumersForBucket(e.bucketId)],acceptableStatuses:[201]}},updateConsumer:e=>({url:`${K}/v1/api-keys/${e.bucketId}/consumers/${e.consumer.id}`,method:`PATCH`,body:JSON.stringify({...e.consumer}),headers:{"content-type":`application/json`},invalidateKeys:[$.consumersForBucket(e.bucketId)],acceptableStatuses:[200]}),removeConsumer:e=>({url:`${K}/v1/api-keys/${e.bucketId}/consumers/${e.consumer.id}`,method:`DELETE`,invalidateKeys:[$.consumersForBucket(e.bucketId)]})},Rv={updateEnvironmentVariable:e=>({url:`${K}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.variableData.id}`,method:`PATCH`,body:JSON.stringify(e.variableData),invalidateKeys:[$.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[200]}),createEnvironmentVariable:e=>({url:`${K}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables`,method:`POST`,body:JSON.stringify(e.variableData),json:!0,invalidateKeys:[$.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[201]}),deleteEnvironmentVariable:e=>({url:`${K}/v1/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.id}`,method:`DELETE`,invalidateKeys:[$.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[204]})},zv={updatePreferences:e=>({url:`${K}/v1/users/me/preferences`,method:`PUT`,invalidateKeys:[$.user.preferences()],body:JSON.stringify({data:e}),headers:{"content-type":`application/json`},acceptableStatuses:[200]}),requestVerificationEmail:()=>({url:`${K}/v1/users/me/$send-verification-email`,method:`POST`,invalidateKeys:[],acceptableStatuses:[201]}),enrollMfaFactor:e=>({url:`${K}/v1/mfa/factors/enroll`,method:`POST`,body:JSON.stringify({factor:e}),invalidateKeys:[$.mfaFactors()],acceptableStatuses:[200],json:!0}),deleteMfaEnrollment:e=>({url:`${K}/v1/mfa/factors/enrollments/${e}`,method:`DELETE`,invalidateKeys:[$.mfaFactors()],acceptableStatuses:[200]})},Bv={tokenExchangeSourceControlCredentials:(e,t,n)=>({url:`${K}/v1/accounts/${e}/source-control-configs/${t}/$token-exchange`,method:`POST`,body:JSON.stringify({code:n}),invalidateKeys:[$.accountsSourceControlConfigurations()],acceptableStatuses:[201]}),revokeSourceControlCredentials:(e,t)=>({url:`${K}/v1/accounts/${e}/source-control-configs/${t}/$revoke-token`,method:`DELETE`,invalidateKeys:[$.accountsSourceControlConfigurations()],acceptableStatuses:[204]})},Vv={commitPush:(e,t,n,r)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$commit-push`,method:`POST`,body:JSON.stringify({branchName:r,commitMessage:n}),acceptableStatuses:[201]}),sync:(e,t,n)=>({url:`${K}/v1/accounts/${e}/projects/${t}/$sync`,method:`POST`,body:JSON.stringify({branchName:n}),acceptableStatuses:[201,200],invalidateKeys:[]})},Hv={makeTestRequest:({environmentName:e,testRequest:t,overrideUrl:n,buildId:r})=>({url:`${Dc}/v1/test`,method:`POST`,body:JSON.stringify(Dv({testRequest:t,overrideUrl:n,environmentName:e,buildId:r})),acceptableStatuses:wv,headers:{"content-type":`application/json`}})},Uv={requestFeature:({email:e,featureName:t,information:n})=>{let r={featureName:t,information:{email:e,...n}};return{url:`${K}/v1/feature-access-request`,method:`POST`,body:JSON.stringify(r),acceptableStatuses:[200],headers:{"content-type":`application/json`}}}},Wv={saveFile:({environmentName:e,file:t})=>{let n={"content-type":`text/plain`};return t.lastModified&&(n[`if-unmodified-since`]=new Date(t.lastModified).toUTCString()),{url:`${K}/v1/deployments/${e}/fs/file?path=${t.path}`,method:`POST`,body:t.content,headers:n,acceptableStatuses:[204,200],invalidateKeys:[$.file(e,t.path),$.deploymentVersions(e),_v.deployments.versions.list(e).queryKey]}},renameFile:({environmentName:e,path:t,newPath:n})=>({url:`${K}/v1/deployments/${e}/fs/file?path=${t}`,method:`PATCH`,body:JSON.stringify({newPath:n}),acceptableStatuses:[204,200],headers:{"content-type":`application/json`},invalidateKeys:[]}),saveMultipleFiles:async({environmentName:e,files:t})=>{let n=new FormData,r={};for(let e of t)if(e.lastModified){let t=`x-if-unmodified-since-${encodeURIComponent(e.path)}`;r[t]=new Date(e.lastModified).toUTCString()}for(let{content:e,path:r}of t){let t=(await vv(r))?.id;n.append(`files[]`,new File([e??``],r,{type:t===`text/typescript`?`text/javascript`:t}),r)}let i=t.map(({path:t})=>$.file(e,t));return{url:`${K}/v1/deployments/${e}/fs/files`,method:`POST`,body:n,headers:r,acceptableStatuses:[204,200],invalidateKeys:[...i,$.deploymentVersions(e),_v.deployments.versions.list(e).queryKey]}},deleteFile:({environmentName:e,filePath:t})=>({url:`${K}/v1/deployments/${e}/fs/delete?path=${t}`,method:`DELETE`,acceptableStatuses:[204,200]})},Gv={createDirectory:({environmentName:e,path:t})=>({url:`${K}/v1/deployments/${e}/fs/dir?path=${t}`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[201]})},Kv={redeploy:({environmentName:e,isWorkingCopy:t,version:n})=>({url:t?`${K}/v1/deployments/${e}/$redeploy`:`${K}/v1/deployments/${e}/versions/${n}/$redeploy`,method:`POST`,body:JSON.stringify({}),acceptableStatuses:[200],invalidateKeys:[$.deploymentVersions(e),_v.deployments.versions.list(e).queryKey]}),delete:({environmentName:e})=>({url:`${K}/v1/deployments/${e}`,method:`DELETE`,body:JSON.stringify({}),acceptableStatuses:[200]})},qv={acceptAccountInvite:e=>({url:`${K}/v1/account-member-invites/${e}`,method:`POST`,body:JSON.stringify({}),invalidateKeys:[$.accounts()],acceptableStatuses:[201]}),createAccountInvite:(e,t,n)=>{let r=n?.project?.name?[$.authProjectUsersRoles(e,n.project.name),n.team?.id?$.bucketConfigurationMembers(n.team?.bucketId,n.team?.id):[],$.authProjectUsersRoles(e,n.project.name,{includeInheritedRoles:!1}),$.authProjectUsersRoles(e,n.project.name,{includeInheritedRoles:!0})].flat():[];return{url:`${K}/v1/accounts/${e}/account-member-invites`,method:`POST`,body:JSON.stringify({userEmail:t,metadata:n}),invalidateKeys:[$.accountMemberInvites(e),$.authAccountUsersRoles(e),...r],acceptableStatuses:[201]}}},Jv={chatIdentity:e=>({url:`${K}/v1/chat-identity`,method:`POST`,json:!0,headers:{"content-type":`application/json`},body:JSON.stringify(e),invalidateKeys:[$.chatIdentity()],acceptableStatuses:[200]})},Yv={createMeteringPlan:(e,t,n)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/plans`,method:`POST`,headers:{"Content-Type":`application/json`},invalidateKeys:[$.meteringPlans(e,t),$.meteringBucket(e,t)],body:JSON.stringify(n)}),deleteMeteringPlan:(e,t,n)=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/plans/${n}`,invalidateKeys:[$.meteringPlans(e,t),$.meteringBucket(e,t)],method:`DELETE`}),updateMeteringPlan:(e,t,{id:n,...r})=>({url:`${K}/v1/metering/accounts/${e}/buckets/${t}/plans/${n}`,invalidateKeys:[$.meteringPlans(e,t),$.meteringBucket(e,t)],method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})},Xv=e=>({urlPrefix:`${K}/v1/buckets/${e}/configurations`}),Zv={auth:Pv,accounts:Fv,ai:{createBucketConfiguration:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations`,method:`POST`,json:!0,body:JSON.stringify(t),acceptableStatuses:[201,200],invalidateKeys:[$.bucketConfigurations(e),$.bucketConfigurationTeams(e),$.bucketConfigurationApps(e)]}),updateBucketConfiguration:(e,t,n)=>({url:`${K}/v1/buckets/${e}/configurations/${t}`,method:`PATCH`,json:!0,body:JSON.stringify(n),acceptableStatuses:[200,201],invalidateKeys:[Xv(e)]}),deleteBucketConfiguration:(e,t)=>({url:`${K}/v1/buckets/${e}/configurations/${t}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[$.bucketConfigurations(e),$.bucketConfigurationTeams(e),$.bucketConfigurationApps(e)]}),createBucketConfigurationMember:(e,t,n,r)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members`,method:`POST`,json:!0,body:JSON.stringify({sub:n,role:r}),acceptableStatuses:[201,200],invalidateKeys:[$.bucketConfiguration(e,t),$.bucketConfigurationMembers(e,t)]}),putBucketConfigurationMemberRole:(e,t,n,r)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`PUT`,json:!0,body:JSON.stringify({role:r}),acceptableStatuses:[204,200],invalidateKeys:[$.bucketConfiguration(e,t),$.bucketConfigurationMembers(e,t),$.bucketConfigurationTeams(e)]}),deleteBucketConfigurationMember:(e,t,n)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`DELETE`,acceptableStatuses:[204],invalidateKeys:[$.bucketConfigurationMembers(e,t)]}),updateBucketConfigurationMember:(e,t,n,r)=>({url:`${K}/v1/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`,method:`PATCH`,json:!0,body:JSON.stringify({role:r}),acceptableStatuses:[200],invalidateKeys:[$.bucketConfigurationMembers(e,t)]}),createBucketAiProvider:(e,{name:t,baseURL:n,description:r})=>({url:`${K}/v1/buckets/${e}/providers`,method:`POST`,json:!0,body:JSON.stringify({baseURL:n,name:t,description:r})}),createAiProviderModel:(e,t,{model:n,kind:r,inputCostPerToken:i,outputCostPerToken:a,status:o})=>({url:`${K}/v1/buckets/${e}/providers/${t}/models`,method:`POST`,json:!0,body:JSON.stringify({model:n,kind:r,inputCostPerToken:i,outputCostPerToken:a,status:o}),invalidateKeys:[$.supportedAiProviders(e)],acceptableStatuses:[200]}),updateAiProviderModel:(e,t,n,{inputCostPerToken:r,outputCostPerToken:i,status:a})=>({url:`${K}/v1/buckets/${e}/providers/${t}/models/${n}`,method:`PATCH`,json:!0,body:JSON.stringify({inputCostPerToken:r,outputCostPerToken:i,status:a}),invalidateKeys:[$.supportedAiProviders(e)],acceptableStatuses:[200]}),deleteAiProviderModel:(e,t,n)=>({url:`${K}/v1/buckets/${e}/providers/${t}/models/${n}`,method:`DELETE`,invalidateKeys:[$.supportedAiProviders(e)],acceptableStatuses:[204]}),createAiProviderAssignment:(e,t,n)=>({url:`${K}/v1/accounts/${e}/projects/${t}/ai-provider-assignments`,method:`POST`,body:JSON.stringify({...n,metadata:JSON.stringify(n.metadata)}),headers:{"content-type":`application/json`},invalidateKeys:[$.aiProviderAssignments(e,t)],acceptableStatuses:[201]}),updateAiProviderAssignment:(e,t,n,r)=>({url:`${K}/v1/accounts/${e}/projects/${t}/ai-provider-assignments/${n}`,method:`PATCH`,body:JSON.stringify({...r,...r.metadata?{metadata:JSON.stringify(r.metadata)}:{}}),headers:{"content-type":`application/json`},invalidateKeys:[$.aiProviderAssignments(e,t)],acceptableStatuses:[200]}),deleteAiProviderAssignment:(e,t,n)=>({url:`${K}/v1/accounts/${e}/projects/${t}/ai-provider-assignments/${n}`,method:`DELETE`,invalidateKeys:[$.aiProviderAssignments(e,t)],acceptableStatuses:[204]})},projects:Iv,consumers:Lv,environmentVariables:Rv,users:zv,sourceControlCredentials:Bv,sourceControlOperations:Vv,testDesigner:Hv,featureRequest:Uv,fileTransactions:Wv,directories:Gv,environments:Kv,accountInvite:qv,identity:Jv,metering:Yv,logs:{sourcemap:e=>({url:`${K}/v1/logs/sourcemap`,method:`POST`,json:!0,body:JSON.stringify(e),acceptableStatuses:[200]})},identityConnections:{createTicket:e=>({url:`${K}/v1/accounts/${e}/identity-connections/ticket`,method:`POST`,json:!0,body:JSON.stringify({}),invalidateKeys:[$.identityConnections(e)],acceptableStatuses:[200]})},migration:{migrateDevPortal:e=>({url:`${K}/v1/migrate/dev-portal`,method:`POST`,json:!1,body:JSON.stringify({deploymentName:e}),headers:{"content-type":`application/json`},acceptableStatuses:[200]})}},Qv=e=>{let t=Hm(),n=bp();return{fetch:async r=>{let i=Gc(),a;try{a=await lh(t=>{let n=new Headers(r.headers);return r.json&&r.method!==`DELETE`&&n.set(`content-type`,`application/json`),n.set(`authorization`,`Bearer ${t}`),n.set(`zuplo-request-id`,i),fetch(r.url,{...e,method:r.method,headers:n,body:r.body})},n,gp)}catch(e){throw e instanceof wc&&e.setTraceId(i),e instanceof TypeError?new Cc({type:`https://zup.fail/api-request-failed`,title:`API request failed`,status:500,instance:r.url,traceId:i}):e}if(!(r.acceptableStatuses??[200]).includes(a.status)){let e=new wc(`Unexpected response: ${a.status} calling ${r.method}: ${r.url}`,{traceId:i});throw await e.tryReadResponse(a),e}let o=e=>e.split(`?`)[0];return r.invalidateKeys?.forEach(e=>{if(Array.isArray(e))t.invalidateQueries({queryKey:e,exact:!1});else if(`urlPrefix`in e&&e.urlPrefix){let n=o(e.urlPrefix);t.invalidateQueries({predicate:e=>{let t=e.queryKey[0];if(typeof t!=`string`)return!1;let r=o(t);return r===n||r.startsWith(`${n}/`)}})}else if(`url`in e&&e.url){let n=o(e.url);t.invalidateQueries({predicate:e=>{let t=e.queryKey[0];return typeof t==`string`&&o(t)===n}})}}),r.removeKeys?.forEach(e=>{t.removeQueries({queryKey:[e.url]})}),r.parseResponse===!1?a:r.json?await a.json():a}}},$v=[`top`,`right`,`bottom`,`left`],ey=Math.min,ty=Math.max,ny=Math.round,ry=Math.floor,iy=e=>({x:e,y:e}),ay={left:`right`,right:`left`,bottom:`top`,top:`bottom`},oy={start:`end`,end:`start`};function sy(e,t,n){return ty(e,ey(t,n))}function cy(e,t){return typeof e==`function`?e(t):e}function ly(e){return e.split(`-`)[0]}function uy(e){return e.split(`-`)[1]}function dy(e){return e===`x`?`y`:`x`}function fy(e){return e===`y`?`height`:`width`}var py=new Set([`top`,`bottom`]);function my(e){return py.has(ly(e))?`y`:`x`}function hy(e){return dy(my(e))}function gy(e,t,n){n===void 0&&(n=!1);let r=uy(e),i=hy(e),a=fy(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ty(o)),[o,Ty(o)]}function _y(e){let t=Ty(e);return[vy(e),t,vy(t)]}function vy(e){return e.replace(/start|end/g,e=>oy[e])}var yy=[`left`,`right`],by=[`right`,`left`],xy=[`top`,`bottom`],Sy=[`bottom`,`top`];function Cy(e,t,n){switch(e){case`top`:case`bottom`:return n?t?by:yy:t?yy:by;case`left`:case`right`:return t?xy:Sy;default:return[]}}function wy(e,t,n,r){let i=uy(e),a=Cy(ly(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(vy)))),a}function Ty(e){return e.replace(/left|right|bottom|top/g,e=>ay[e])}function Ey(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dy(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ey(e)}function Oy(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ky(){return typeof window<`u`}function Ay(e){return Ny(e)?(e.nodeName||``).toLowerCase():`#document`}function jy(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function My(e){return((Ny(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ny(e){return ky()?e instanceof Node||e instanceof jy(e).Node:!1}function Py(e){return ky()?e instanceof Element||e instanceof jy(e).Element:!1}function Fy(e){return ky()?e instanceof HTMLElement||e instanceof jy(e).HTMLElement:!1}function Iy(e){return!ky()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof jy(e).ShadowRoot}var Ly=new Set([`inline`,`contents`]);function Ry(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Zy(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ly.has(i)}var zy=new Set([`table`,`td`,`th`]);function By(e){return zy.has(Ay(e))}var Vy=[`:popover-open`,`:modal`];function Hy(e){return Vy.some(t=>{try{return e.matches(t)}catch{return!1}})}var Uy=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Wy=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Gy=[`paint`,`layout`,`strict`,`content`];function Ky(e){let t=Jy(),n=Py(e)?Zy(e):e;return Uy.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Wy.some(e=>(n.willChange||``).includes(e))||Gy.some(e=>(n.contain||``).includes(e))}function qy(e){let t=$y(e);for(;Fy(t)&&!Xy(t);){if(Ky(t))return t;if(Hy(t))return null;t=$y(t)}return null}function Jy(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Yy=new Set([`html`,`body`,`#document`]);function Xy(e){return Yy.has(Ay(e))}function Zy(e){return jy(e).getComputedStyle(e)}function Qy(e){return Py(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $y(e){if(Ay(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Iy(e)&&e.host||My(e);return Iy(t)?t.host:t}function eb(e){let t=$y(e);return Xy(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fy(t)&&Ry(t)?t:eb(t)}function tb(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=eb(e),i=r===e.ownerDocument?.body,a=jy(r);if(i){let e=nb(a);return t.concat(a,a.visualViewport||[],Ry(r)?r:[],e&&n?tb(e):[])}return t.concat(r,tb(r,[],n))}function nb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rb(e){let[t,n]=q.useState(void 0);return Kl(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}function ib(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var ab=e((()=>{})),ob=n({default:()=>cb}),sb,cb,lb=e((()=>{ab(),sb=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,cb=ib(function(e){return sb.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),ub=(0,q.createContext)(null),db=()=>{let e=(0,q.useContext)(ub);if(!e)throw Error(`useTheme must be used within a ThemeProvider`);return e},fb=()=>{let{colorScheme:e,colorSchemePreference:t,setColorSchemePreference:n,toggleColorScheme:r}=db();return{colorScheme:e,preference:t,setPreference:n,toggle:r}};function pb(e,t,n){let{reference:r,floating:i}=e,a=my(t),o=hy(t),s=fy(o),c=ly(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(uy(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var mb=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pb(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=pb(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function hb(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=cy(t,e),p=Dy(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Oy(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Oy(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var gb=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=cy(e,t)||{};if(l==null)return{};let d=Dy(u),f={x:n,y:r},p=hy(i),m=fy(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=ey(d[_],T),D=ey(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=sy(O,A,k),M=!c.arrow&&uy(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),_b=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=cy(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ly(r),_=my(o),v=ly(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ty(o)]:_y(o)),x=p!==`none`;!d&&x&&b.push(...wy(o,m,p,y));let S=[o,...b],C=await hb(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=gy(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==my(t))||T.every(e=>my(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=my(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function vb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yb(e){return $v.some(t=>e[t]>=0)}var bb=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=cy(e,t);switch(r){case`referenceHidden`:{let e=vb(await hb(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:yb(e)}}}case`escaped`:{let e=vb(await hb(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:yb(e)}}}default:return{}}}}},xb=new Set([`left`,`top`]);async function Sb(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ly(n),s=uy(n),c=my(n)===`y`,l=xb.has(o)?-1:1,u=a&&c?-1:1,d=cy(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Cb=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Sb(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},wb=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=cy(e,t),l={x:n,y:r},u=await hb(t,c),d=my(ly(i)),f=dy(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=sy(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=sy(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Tb=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=cy(e,t),u={x:n,y:r},d=my(i),f=dy(d),p=u[f],m=u[d],h=cy(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=xb.has(ly(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Eb=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=cy(e,t),u=await hb(t,l),d=ly(i),f=uy(i),p=my(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=ey(h-u[g],v),x=ey(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=ty(u.left,0),t=ty(u.right,0),n=ty(u.top,0),r=ty(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:ty(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:ty(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Db(e){let t=Zy(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Fy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ny(n)!==a||ny(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ob(e){return Py(e)?e:e.contextElement}function kb(e){let t=Ob(e);if(!Fy(t))return iy(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Db(t),o=(a?ny(n.width):n.width)/r,s=(a?ny(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ab=iy(0);function jb(e){let t=jy(e);return!Jy()||!t.visualViewport?Ab:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jy(e)?!1:t}function Nb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ob(e),o=iy(1);t&&(r?Py(r)&&(o=kb(r)):o=kb(e));let s=Mb(a,n,r)?jb(a):iy(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=jy(a),t=r&&Py(r)?jy(r):r,n=e,i=nb(n);for(;i&&r&&t!==n;){let e=kb(i),t=i.getBoundingClientRect(),r=Zy(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=jy(i),i=nb(n)}}return Oy({width:u,height:d,x:c,y:l})}function Pb(e,t){let n=Qy(e).scrollLeft;return t?t.left+n:Nb(My(e)).left+n}function Fb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Pb(e,n),y:n.top+t.scrollTop}}function Ib(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=My(r),s=t?Hy(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=iy(1),u=iy(0),d=Fy(r);if((d||!d&&!a)&&((Ay(r)!==`body`||Ry(o))&&(c=Qy(r)),Fy(r))){let e=Nb(r);l=kb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Fb(o,c):iy(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Lb(e){return Array.from(e.getClientRects())}function Rb(e){let t=My(e),n=Qy(e),r=e.ownerDocument.body,i=ty(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ty(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Pb(e),s=-n.scrollTop;return Zy(r).direction===`rtl`&&(o+=ty(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var zb=25;function Bb(e,t){let n=jy(e),r=My(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Jy();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Pb(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=zb&&(a-=o)}else l<=zb&&(a+=l);return{width:a,height:o,x:s,y:c}}var Vb=new Set([`absolute`,`fixed`]);function Hb(e,t){let n=Nb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Fy(e)?kb(e):iy(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ub(e,t,n){let r;if(t===`viewport`)r=Bb(e,n);else if(t===`document`)r=Rb(My(e));else if(Py(t))r=Hb(t,n);else{let n=jb(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Oy(r)}function Wb(e,t){let n=$y(e);return n===t||!Py(n)||Xy(n)?!1:Zy(n).position===`fixed`||Wb(n,t)}function Gb(e,t){let n=t.get(e);if(n)return n;let r=tb(e,[],!1).filter(e=>Py(e)&&Ay(e)!==`body`),i=null,a=Zy(e).position===`fixed`,o=a?$y(e):e;for(;Py(o)&&!Xy(o);){let t=Zy(o),n=Ky(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Vb.has(i.position)||Ry(o)&&!n&&Wb(e,o))?r=r.filter(e=>e!==o):i=t,o=$y(o)}return t.set(e,r),r}function Kb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Hy(t)?[]:Gb(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Ub(t,n,i);return e.top=ty(r.top,e.top),e.right=ey(r.right,e.right),e.bottom=ey(r.bottom,e.bottom),e.left=ty(r.left,e.left),e},Ub(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function qb(e){let{width:t,height:n}=Db(e);return{width:t,height:n}}function Jb(e,t,n){let r=Fy(t),i=My(t),a=n===`fixed`,o=Nb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=iy(0);function l(){c.x=Pb(i)}if(r||!r&&!a)if((Ay(t)!==`body`||Ry(i))&&(s=Qy(t)),r){let e=Nb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Fb(i,s):iy(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Yb(e){return Zy(e).position===`static`}function Xb(e,t){if(!Fy(e)||Zy(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return My(e)===n&&(n=n.ownerDocument.body),n}function Zb(e,t){let n=jy(e);if(Hy(e))return n;if(!Fy(e)){let t=$y(e);for(;t&&!Xy(t);){if(Py(t)&&!Yb(t))return t;t=$y(t)}return n}let r=Xb(e,t);for(;r&&By(r)&&Yb(r);)r=Xb(r,t);return r&&Xy(r)&&Yb(r)&&!Ky(r)?n:r||qy(e)||n}var Qb=async function(e){let t=this.getOffsetParent||Zb,n=this.getDimensions,r=await n(e.floating);return{reference:Jb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $b(e){return Zy(e).direction===`rtl`}var ex={convertOffsetParentRelativeRectToViewportRelativeRect:Ib,getDocumentElement:My,getClippingRect:Kb,getOffsetParent:Zb,getElementRects:Qb,getClientRects:Lb,getDimensions:qb,getScale:kb,isElement:Py,isRTL:$b};function tx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nx(e,t){let n=null,r,i=My(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ry(d),h=ry(i.clientWidth-(u+f)),g=ry(i.clientHeight-(d+p)),_=ry(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ty(0,ey(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!tx(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function rx(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ob(e),u=i||a?[...l?tb(l):[],...tb(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?nx(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Nb(e):null;c&&g();function g(){let t=Nb(e);h&&!tx(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ix=hb,ax=Cb,ox=wb,sx=_b,cx=Eb,lx=bb,ux=gb,dx=Tb,fx=(e,t,n)=>{let r=new Map,i={platform:ex,...n},a={...i.platform,_c:r};return mb(e,t,{...i,platform:a})},px=typeof document<`u`?q.useLayoutEffect:function(){};function mx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mx(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!mx(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function hx(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gx(e,t){let n=hx(e);return Math.round(t*n)/n}function _x(e){let t=q.useRef(e);return px(()=>{t.current=e}),t}function vx(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=q.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=q.useState(r);mx(f,r)||p(r);let[m,h]=q.useState(null),[g,_]=q.useState(null),v=q.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=q.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=q.useRef(null),C=q.useRef(null),w=q.useRef(u),T=c!=null,E=_x(c),D=_x(i),O=_x(l),k=q.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),fx(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!mx(w.current,t)&&(w.current=t,El.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);px(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=q.useRef(!1);px(()=>(A.current=!0,()=>{A.current=!1}),[]),px(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=q.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=q.useMemo(()=>({reference:b,floating:x}),[b,x]),N=q.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=gx(M.floating,u.x),r=gx(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...hx(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return q.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var yx=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ux({element:r.current,padding:i}).fn(n):r?ux({element:r,padding:i}).fn(n):{}}}},bx=(e,t)=>({...ax(e),options:[e,t]}),xx=(e,t)=>({...ox(e),options:[e,t]}),Sx=(e,t)=>({...dx(e),options:[e,t]}),Cx=(e,t)=>({...sx(e),options:[e,t]}),wx=(e,t)=>({...cx(e),options:[e,t]}),Tx=(e,t)=>({...lx(e),options:[e,t]}),Ex=(e,t)=>({...yx(e),options:[e,t]}),Dx=`Arrow`,Ox=q.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,J.jsx)(Bh.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,J.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Ox.displayName=Dx;var kx=Ox,Ax=`Popper`,[jx,Mx]=cl(Ax),[Nx,Px]=jx(Ax),Fx=e=>{let{__scopePopper:t,children:n}=e,[r,i]=q.useState(null);return(0,J.jsx)(Nx,{scope:t,anchor:r,onAnchorChange:i,children:n})};Fx.displayName=Ax;var Ix=`PopperAnchor`,Lx=q.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Px(Ix,n),o=q.useRef(null),s=il(t,o),c=q.useRef(null);return q.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,J.jsx)(Bh.div,{...i,ref:s})});Lx.displayName=Ix;var Rx=`PopperContent`,[zx,Bx]=jx(Rx),Vx=q.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Px(Rx,n),[_,v]=q.useState(null),y=il(t,e=>v(e)),[b,x]=q.useState(null),S=rb(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Gx),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:ee}=vx({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>rx(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[bx({mainAxis:i+w,alignmentAxis:o}),c&&xx({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Sx():void 0,...k}),c&&Cx({...k}),wx({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Ex({element:b,padding:s}),Kx({arrowWidth:C,arrowHeight:w}),f&&Tx({strategy:`referenceHidden`,...k})]}),[te,ne]=qx(M),re=ql(m);Kl(()=>{N&&re?.()},[N,re]);let ie=ee.arrow?.x,ae=ee.arrow?.y,oe=ee.arrow?.centerOffset!==0,[se,ce]=q.useState();return Kl(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,J.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(` `),...ee.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,J.jsx)(zx,{scope:n,placedSide:te,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,J.jsx)(Bh.div,{"data-side":te,"data-align":ne,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});Vx.displayName=Rx;var Hx=`PopperArrow`,Ux={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Wx=q.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Bx(Hx,n),a=Ux[i.placedSide];return(0,J.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,J.jsx)(kx,{...r,ref:t,style:{...r.style,display:`block`}})})});Wx.displayName=Hx;function Gx(e){return e!==null}var Kx=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=qx(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function qx(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Jx=Fx,Yx=Lx,Xx=Vx,Zx=Wx,Qx=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),$x=`VisuallyHidden`,eS=q.forwardRef((e,t)=>(0,J.jsx)(Bh.span,{...e,ref:t,style:{...Qx,...e.style}}));eS.displayName=$x;var tS=eS,nS=tl(e=>({pins:{},setBuildPin:(t,n)=>e(e=>({pins:{...e.pins,[t]:n}})),clearBuildPin:t=>e(e=>{let{[t]:n,...r}=e.pins;return{pins:r}})})),rS=e=>e?nS.getState().pins[e]:void 0,iS=(e,t)=>nS.getState().setBuildPin(e,t),aS=e=>nS.getState().clearBuildPin(e),oS=q.createContext(void 0);function sS(e){let t=q.useContext(oS);return e||t||`ltr`}function cS(e){let t=e+`CollectionProvider`,[n,r]=cl(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=q.useRef(null),a=q.useRef(new Map).current;return(0,J.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Nh(s),l=q.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,J.jsx)(c,{ref:il(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Nh(u),p=q.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=q.useRef(null),s=il(t,o),c=a(u,n);return q.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,J.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return q.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}export{wy as $,Sc as $n,Um as $t,Ay as A,ql as An,Xh as At,By as B,$c as Bn,lh as Bt,ob as C,gp as Cn,X_ as Ct,qy as D,Wf as Dn,v_ as Dt,Zy as E,tp as En,G_ as Et,Ky as F,cl as Fn,Nh as Ft,cy as G,Rc as Gn,nh as Gt,Jy as H,Yc as Hn,ah as Ht,Py as I,ol as In,Ih as It,hy as J,K as Jn,Ym as Jt,ry as K,Ac as Kn,th as Kt,Fy as L,rl as Ln,xh as Lt,tb as M,Gl as Mn,Uh as Mt,$y as N,Ll as Nn,Bh as Nt,My as O,zf as On,h_ as Ot,jy as P,Wl as Pn,Vh as Pt,dy as Q,Cc as Qn,Gm as Qt,Xy as R,il as Rn,gh as Rt,ub as S,vp as Sn,Q_ as St,rb as T,np as Tn,Z_ as Tt,sy as U,Jc as Un,ih as Ut,Hy as V,Zc as Vn,oh as Vt,iy as W,Gc as Wn,$m as Wt,fy as X,yc as Xn,Xm as Xt,gy as Y,jc as Yn,Zm as Yt,_y as Z,wc as Zn,Jm as Zt,vx as _,Qp as _n,_v as _t,iS as a,hm as an,o as ar,ey as at,fb as b,bp as bn,nv as bt,Yx as c,Bp as cn,$v as ct,Jx as d,Kp as dn,Sv as dt,Hm as en,vc as er,Ty as et,Mx as f,Gp as fn,Mv as ft,wx as g,Up as gn,yv as gt,xx as h,Zp as hn,$ as ht,rS as i,xm as in,c as ir,ty as it,Qy as j,Kl as jn,Gh as jt,nb as k,Yl as kn,o_ as kt,Zx as l,Jp as ln,Qv as lt,bx as m,Yp as mn,Nv as mt,sS as n,Mm as nn,m as nr,ly as nt,tS as o,mm as on,Oy as ot,Cx as p,zp as pn,kv as pt,uy as q,Ec as qn,eh as qt,aS as r,Tm as rn,l as rr,my as rt,Qx as s,um as sn,ny as st,cS as t,Rm as tn,fc as tr,Dy as tt,Xx as u,qp as un,Zv as ut,rx as v,sm as vn,rv as vt,lb as w,rp as wn,tv as wt,db as x,_p as xn,$_ as xt,ix as y,Pp as yn,ev as yt,Ry as z,tl as zn,ph as zt};
|