rivet-design 0.14.12 → 0.14.13

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.
Files changed (82) hide show
  1. package/dist/agent-variants/WorktreeOrchestrator.d.ts +17 -3
  2. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  3. package/dist/agent-variants/WorktreeOrchestrator.js +238 -31
  4. package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
  5. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +1 -0
  6. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -1
  7. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +1 -0
  8. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -1
  9. package/dist/agent-variants/contracts.d.ts +1 -1
  10. package/dist/agent-variants/contracts.d.ts.map +1 -1
  11. package/dist/agent-variants/contracts.js.map +1 -1
  12. package/dist/cli/commands/mcpServe.d.ts.map +1 -1
  13. package/dist/cli/commands/mcpServe.js +4 -0
  14. package/dist/cli/commands/mcpServe.js.map +1 -1
  15. package/dist/cli/commands/shared.d.ts +0 -1
  16. package/dist/cli/commands/shared.d.ts.map +1 -1
  17. package/dist/cli/commands/shared.js +9 -1
  18. package/dist/cli/commands/shared.js.map +1 -1
  19. package/dist/cli/envelope.d.ts +8 -1
  20. package/dist/cli/envelope.d.ts.map +1 -1
  21. package/dist/cli/envelope.js +31 -9
  22. package/dist/cli/envelope.js.map +1 -1
  23. package/dist/cli/router.d.ts.map +1 -1
  24. package/dist/cli/router.js +29 -7
  25. package/dist/cli/router.js.map +1 -1
  26. package/dist/install/legacyMcp.d.ts +13 -0
  27. package/dist/install/legacyMcp.d.ts.map +1 -1
  28. package/dist/install/legacyMcp.js +40 -4
  29. package/dist/install/legacyMcp.js.map +1 -1
  30. package/dist/routes/mcp.d.ts.map +1 -1
  31. package/dist/routes/mcp.js +0 -5
  32. package/dist/routes/mcp.js.map +1 -1
  33. package/dist/services/ConfigManager.d.ts +8 -0
  34. package/dist/services/ConfigManager.d.ts.map +1 -1
  35. package/dist/services/ConfigManager.js +14 -0
  36. package/dist/services/ConfigManager.js.map +1 -1
  37. package/dist/services/DevServerRuntimeService.d.ts +5 -17
  38. package/dist/services/DevServerRuntimeService.d.ts.map +1 -1
  39. package/dist/services/DevServerRuntimeService.js +43 -81
  40. package/dist/services/DevServerRuntimeService.js.map +1 -1
  41. package/dist/services/ProjectDetectionService.d.ts.map +1 -1
  42. package/dist/services/ProjectDetectionService.js +6 -1
  43. package/dist/services/ProjectDetectionService.js.map +1 -1
  44. package/dist/services/TelemetryService.d.ts +8 -0
  45. package/dist/services/TelemetryService.d.ts.map +1 -1
  46. package/dist/services/TelemetryService.js +12 -0
  47. package/dist/services/TelemetryService.js.map +1 -1
  48. package/dist/services/VariantRunService.d.ts +1 -0
  49. package/dist/services/VariantRunService.d.ts.map +1 -1
  50. package/dist/services/VariantRunService.js +12 -1
  51. package/dist/services/VariantRunService.js.map +1 -1
  52. package/dist/services/WorktreeManager.d.ts +3 -3
  53. package/dist/services/WorktreeManager.d.ts.map +1 -1
  54. package/dist/services/WorktreeManager.js +41 -25
  55. package/dist/services/WorktreeManager.js.map +1 -1
  56. package/dist/services/createAgentVariantsOrchestrator.d.ts.map +1 -1
  57. package/dist/services/createAgentVariantsOrchestrator.js +4 -1
  58. package/dist/services/createAgentVariantsOrchestrator.js.map +1 -1
  59. package/dist/utils/devServerCommand.d.ts +10 -0
  60. package/dist/utils/devServerCommand.d.ts.map +1 -1
  61. package/dist/utils/devServerCommand.js +37 -1
  62. package/dist/utils/devServerCommand.js.map +1 -1
  63. package/dist/utils/devServerError.d.ts +2 -1
  64. package/dist/utils/devServerError.d.ts.map +1 -1
  65. package/dist/utils/devServerError.js +12 -0
  66. package/dist/utils/devServerError.js.map +1 -1
  67. package/dist/utils/loginShellPath.d.ts +2 -2
  68. package/dist/utils/loginShellPath.d.ts.map +1 -1
  69. package/dist/utils/loginShellPath.js +18 -12
  70. package/dist/utils/loginShellPath.js.map +1 -1
  71. package/dist/utils/skills/claude-skill.d.ts +1 -1
  72. package/dist/utils/skills/claude-skill.d.ts.map +1 -1
  73. package/dist/utils/skills/cli-guidance.d.ts +2 -2
  74. package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
  75. package/dist/utils/skills/cli-guidance.js +4 -2
  76. package/dist/utils/skills/cli-guidance.js.map +1 -1
  77. package/dist/utils/skills/cursor-rules.d.ts +1 -1
  78. package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
  79. package/package.json +1 -1
  80. package/src/ui/dist/assets/main-BfVGaiD6.js +422 -0
  81. package/src/ui/dist/index.html +1 -1
  82. package/src/ui/dist/assets/main-CgF_gMPR.js +0 -422
@@ -1,422 +0,0 @@
1
- var RO=Object.defineProperty;var tE=t=>{throw TypeError(t)};var AO=(t,e,n)=>e in t?RO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Do=(t,e,n)=>AO(t,typeof e!="symbol"?e+"":e,n),fv=(t,e,n)=>e.has(t)||tE("Cannot "+n);var U=(t,e,n)=>(fv(t,e,"read from private field"),n?n.call(t):e.get(t)),ze=(t,e,n)=>e.has(t)?tE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ae=(t,e,n,r)=>(fv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ut=(t,e,n)=>(fv(t,e,"access private method"),n);var Uh=(t,e,n,r)=>({set _(s){Ae(t,e,s,n)},get _(){return U(t,e,r)}});function IO(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function t0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hv={exports:{}},Zc={},pv={exports:{}},it={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var nE;function MO(){if(nE)return it;nE=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(j){return j===null||typeof j!="object"?null:(j=p&&j[p]||j["@@iterator"],typeof j=="function"?j:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function w(j,X,te){this.props=j,this.context=X,this.refs=_,this.updater=te||y}w.prototype.isReactComponent={},w.prototype.setState=function(j,X){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,X,"setState")},w.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function E(){}E.prototype=w.prototype;function P(j,X,te){this.props=j,this.context=X,this.refs=_,this.updater=te||y}var T=P.prototype=new E;T.constructor=P,x(T,w.prototype),T.isPureReactComponent=!0;var k=Array.isArray,R=Object.prototype.hasOwnProperty,L={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function A(j,X,te){var ie,ae={},ue=null,Se=null;if(X!=null)for(ie in X.ref!==void 0&&(Se=X.ref),X.key!==void 0&&(ue=""+X.key),X)R.call(X,ie)&&!O.hasOwnProperty(ie)&&(ae[ie]=X[ie]);var oe=arguments.length-2;if(oe===1)ae.children=te;else if(1<oe){for(var se=Array(oe),ye=0;ye<oe;ye++)se[ye]=arguments[ye+2];ae.children=se}if(j&&j.defaultProps)for(ie in oe=j.defaultProps,oe)ae[ie]===void 0&&(ae[ie]=oe[ie]);return{$$typeof:t,type:j,key:ue,ref:Se,props:ae,_owner:L.current}}function M(j,X){return{$$typeof:t,type:j.type,key:X,ref:j.ref,props:j.props,_owner:j._owner}}function D(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function F(j){var X={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(te){return X[te]})}var N=/\/+/g;function G(j,X){return typeof j=="object"&&j!==null&&j.key!=null?F(""+j.key):X.toString(36)}function Z(j,X,te,ie,ae){var ue=typeof j;(ue==="undefined"||ue==="boolean")&&(j=null);var Se=!1;if(j===null)Se=!0;else switch(ue){case"string":case"number":Se=!0;break;case"object":switch(j.$$typeof){case t:case e:Se=!0}}if(Se)return Se=j,ae=ae(Se),j=ie===""?"."+G(Se,0):ie,k(ae)?(te="",j!=null&&(te=j.replace(N,"$&/")+"/"),Z(ae,X,te,"",function(ye){return ye})):ae!=null&&(D(ae)&&(ae=M(ae,te+(!ae.key||Se&&Se.key===ae.key?"":(""+ae.key).replace(N,"$&/")+"/")+j)),X.push(ae)),1;if(Se=0,ie=ie===""?".":ie+":",k(j))for(var oe=0;oe<j.length;oe++){ue=j[oe];var se=ie+G(ue,oe);Se+=Z(ue,X,te,se,ae)}else if(se=m(j),typeof se=="function")for(j=se.call(j),oe=0;!(ue=j.next()).done;)ue=ue.value,se=ie+G(ue,oe++),Se+=Z(ue,X,te,se,ae);else if(ue==="object")throw X=String(j),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return Se}function Y(j,X,te){if(j==null)return j;var ie=[],ae=0;return Z(j,ie,"","",function(ue){return X.call(te,ue,ae++)}),ie}function B(j){if(j._status===-1){var X=j._result;X=X(),X.then(function(te){(j._status===0||j._status===-1)&&(j._status=1,j._result=te)},function(te){(j._status===0||j._status===-1)&&(j._status=2,j._result=te)}),j._status===-1&&(j._status=0,j._result=X)}if(j._status===1)return j._result.default;throw j._result}var K={current:null},$={transition:null},J={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:$,ReactCurrentOwner:L};function H(){throw Error("act(...) is not supported in production builds of React.")}return it.Children={map:Y,forEach:function(j,X,te){Y(j,function(){X.apply(this,arguments)},te)},count:function(j){var X=0;return Y(j,function(){X++}),X},toArray:function(j){return Y(j,function(X){return X})||[]},only:function(j){if(!D(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},it.Component=w,it.Fragment=n,it.Profiler=s,it.PureComponent=P,it.StrictMode=r,it.Suspense=c,it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,it.act=H,it.cloneElement=function(j,X,te){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var ie=x({},j.props),ae=j.key,ue=j.ref,Se=j._owner;if(X!=null){if(X.ref!==void 0&&(ue=X.ref,Se=L.current),X.key!==void 0&&(ae=""+X.key),j.type&&j.type.defaultProps)var oe=j.type.defaultProps;for(se in X)R.call(X,se)&&!O.hasOwnProperty(se)&&(ie[se]=X[se]===void 0&&oe!==void 0?oe[se]:X[se])}var se=arguments.length-2;if(se===1)ie.children=te;else if(1<se){oe=Array(se);for(var ye=0;ye<se;ye++)oe[ye]=arguments[ye+2];ie.children=oe}return{$$typeof:t,type:j.type,key:ae,ref:ue,props:ie,_owner:Se}},it.createContext=function(j){return j={$$typeof:a,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:i,_context:j},j.Consumer=j},it.createElement=A,it.createFactory=function(j){var X=A.bind(null,j);return X.type=j,X},it.createRef=function(){return{current:null}},it.forwardRef=function(j){return{$$typeof:u,render:j}},it.isValidElement=D,it.lazy=function(j){return{$$typeof:h,_payload:{_status:-1,_result:j},_init:B}},it.memo=function(j,X){return{$$typeof:d,type:j,compare:X===void 0?null:X}},it.startTransition=function(j){var X=$.transition;$.transition={};try{j()}finally{$.transition=X}},it.unstable_act=H,it.useCallback=function(j,X){return K.current.useCallback(j,X)},it.useContext=function(j){return K.current.useContext(j)},it.useDebugValue=function(){},it.useDeferredValue=function(j){return K.current.useDeferredValue(j)},it.useEffect=function(j,X){return K.current.useEffect(j,X)},it.useId=function(){return K.current.useId()},it.useImperativeHandle=function(j,X,te){return K.current.useImperativeHandle(j,X,te)},it.useInsertionEffect=function(j,X){return K.current.useInsertionEffect(j,X)},it.useLayoutEffect=function(j,X){return K.current.useLayoutEffect(j,X)},it.useMemo=function(j,X){return K.current.useMemo(j,X)},it.useReducer=function(j,X,te){return K.current.useReducer(j,X,te)},it.useRef=function(j){return K.current.useRef(j)},it.useState=function(j){return K.current.useState(j)},it.useSyncExternalStore=function(j,X,te){return K.current.useSyncExternalStore(j,X,te)},it.useTransition=function(){return K.current.useTransition()},it.version="18.3.1",it}var rE;function g2(){return rE||(rE=1,pv.exports=MO()),pv.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var sE;function OO(){if(sE)return Zc;sE=1;var t=g2(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(u,c,d){var h,p={},m=null,y=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(y=c.ref);for(h in c)r.call(c,h)&&!i.hasOwnProperty(h)&&(p[h]=c[h]);if(u&&u.defaultProps)for(h in c=u.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:e,type:u,key:m,ref:y,props:p,_owner:s.current}}return Zc.Fragment=n,Zc.jsx=a,Zc.jsxs=a,Zc}var iE;function LO(){return iE||(iE=1,hv.exports=OO()),hv.exports}var S=LO(),g=g2();const ve=t0(g),bf=IO({__proto__:null,default:ve},[g]);var Sf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},al,Vo,Du,I8,DO=(I8=class extends Sf{constructor(){super();ze(this,al);ze(this,Vo);ze(this,Du);Ae(this,Du,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Vo)||this.setEventListener(U(this,Du))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Vo))==null||e.call(this),Ae(this,Vo,void 0))}setEventListener(e){var n;Ae(this,Du,e),(n=U(this,Vo))==null||n.call(this),Ae(this,Vo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){U(this,al)!==e&&(Ae(this,al,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof U(this,al)=="boolean"?U(this,al):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},al=new WeakMap,Vo=new WeakMap,Du=new WeakMap,I8),v2=new DO,NO={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},$o,m2,M8,jO=(M8=class{constructor(){ze(this,$o,NO);ze(this,m2,!1)}setTimeoutProvider(t){Ae(this,$o,t)}setTimeout(t,e){return U(this,$o).setTimeout(t,e)}clearTimeout(t){U(this,$o).clearTimeout(t)}setInterval(t,e){return U(this,$o).setInterval(t,e)}clearInterval(t){U(this,$o).clearInterval(t)}},$o=new WeakMap,m2=new WeakMap,M8),nl=new jO;function FO(t){setTimeout(t,0)}var VO=typeof window>"u"||"Deno"in globalThis;function Pr(){}function $O(t,e){return typeof t=="function"?t(e):t}function G1(t){return typeof t=="number"&&t>=0&&t!==1/0}function H8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Qo(t,e){return typeof t=="function"?t(e):t}function Gr(t,e){return typeof t=="function"?t(e):t}function oE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==y2(a,e.options))return!1}else if(!qu(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||s&&s!==e.state.fetchStatus||i&&!i(e))}function aE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(jd(e.options.mutationKey)!==jd(i))return!1}else if(!qu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function y2(t,e){return((e==null?void 0:e.queryKeyHashFn)||jd)(t)}function jd(t){return JSON.stringify(t,(e,n)=>q1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function qu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){for(let r=0;r<e.length;r++)if(!qu(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!qu(t[r],e[r]))return!1;return!0}return!1}var HO=Object.prototype.hasOwnProperty;function z8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=lE(t)&&lE(e);if(!r&&!(q1(t)&&q1(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),u=a.length,c=r?new Array(u):{};let d=0;for(let h=0;h<u;h++){const p=r?h:a[h],m=t[p],y=e[p];if(m===y){c[p]=m,(r?h<i:HO.call(t,p))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){c[p]=y;continue}const x=z8(m,y,n+1);c[p]=x,x===m&&d++}return i===u&&d===i?t:c}function K1(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function lE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function q1(t){if(!uE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!uE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function uE(t){return Object.prototype.toString.call(t)==="[object Object]"}function zO(t){return new Promise(e=>{nl.setTimeout(e,t)})}function Z1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?z8(t,e):e}function UO(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function BO(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var _2=Symbol();function U8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===_2?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function B8(t,e){return typeof t=="function"?t(...e):!!t}function WO(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var Fd=(()=>{let t=()=>VO;return{isServer(){return t()},setIsServer(e){t=e}}})();function Y1(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var GO=FO;function KO(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=GO;const i=u=>{e?t.push(u):s(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{i(()=>{u(...c)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var Vn=KO(),Nu,Ho,ju,O8,qO=(O8=class extends Sf{constructor(){super();ze(this,Nu,!0);ze(this,Ho);ze(this,ju);Ae(this,ju,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){U(this,Ho)||this.setEventListener(U(this,ju))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Ho))==null||e.call(this),Ae(this,Ho,void 0))}setEventListener(e){var n;Ae(this,ju,e),(n=U(this,Ho))==null||n.call(this),Ae(this,Ho,e(this.setOnline.bind(this)))}setOnline(e){U(this,Nu)!==e&&(Ae(this,Nu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return U(this,Nu)}},Nu=new WeakMap,Ho=new WeakMap,ju=new WeakMap,O8),Jp=new qO;function ZO(t){return Math.min(1e3*2**t,3e4)}function W8(t){return(t??"online")==="online"?Jp.isOnline():!0}var X1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function G8(t){let e=!1,n=0,r;const s=Y1(),i=()=>s.status!=="pending",a=_=>{var w;if(!i()){const E=new X1(_);m(E),(w=t.onCancel)==null||w.call(t,E)}},u=()=>{e=!0},c=()=>{e=!1},d=()=>v2.isFocused()&&(t.networkMode==="always"||Jp.isOnline())&&t.canRun(),h=()=>W8(t.networkMode)&&t.canRun(),p=_=>{i()||(r==null||r(),s.resolve(_))},m=_=>{i()||(r==null||r(),s.reject(_))},y=()=>new Promise(_=>{var w;r=E=>{(i()||d())&&_(E)},(w=t.onPause)==null||w.call(t)}).then(()=>{var _;r=void 0,i()||(_=t.onContinue)==null||_.call(t)}),x=()=>{if(i())return;let _;const w=n===0?t.initialPromise:void 0;try{_=w??t.fn()}catch(E){_=Promise.reject(E)}Promise.resolve(_).then(p).catch(E=>{var L;if(i())return;const P=t.retry??(Fd.isServer()?0:3),T=t.retryDelay??ZO,k=typeof T=="function"?T(n,E):T,R=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,E);if(e||!R){m(E);return}n++,(L=t.onFail)==null||L.call(t,n,E),zO(k).then(()=>d()?void 0:y()).then(()=>{e?m(E):x()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?x():y().then(x),s)}}var ll,L8,K8=(L8=class{constructor(){ze(this,ll)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),G1(this.gcTime)&&Ae(this,ll,nl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Fd.isServer()?1/0:300*1e3))}clearGcTimeout(){U(this,ll)!==void 0&&(nl.clearTimeout(U(this,ll)),Ae(this,ll,void 0))}},ll=new WeakMap,L8);function YO(t){return{onFetch:(e,n)=>{var h,p,m,y,x;const r=e.options,s=(m=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((y=e.state.data)==null?void 0:y.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const d=async()=>{let _=!1;const w=T=>{WO(T,()=>e.signal,()=>_=!0)},E=U8(e.options,e.fetchOptions),P=async(T,k,R)=>{if(_)return Promise.reject(e.signal.reason);if(k==null&&T.pages.length)return Promise.resolve(T);const O=(()=>{const F={client:e.client,queryKey:e.queryKey,pageParam:k,direction:R?"backward":"forward",meta:e.options.meta};return w(F),F})(),A=await E(O),{maxPages:M}=e.options,D=R?BO:UO;return{pages:D(T.pages,A,M),pageParams:D(T.pageParams,k,M)}};if(s&&i.length){const T=s==="backward",k=T?XO:cE,R={pages:i,pageParams:a},L=k(r,R);u=await P(R,L,T)}else{const T=t??i.length;do{const k=c===0?a[0]??r.initialPageParam:cE(r,u);if(c>0&&k==null)break;u=await P(u,k),c++}while(c<T)}return u};e.options.persister?e.fetchFn=()=>{var _,w;return(w=(_=e.options).persister)==null?void 0:w.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function cE(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function XO(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Fu,ul,Vu,ys,cl,Pn,vf,dl,Br,q8,$i,D8,QO=(D8=class extends K8{constructor(e){super();ze(this,Br);ze(this,Fu);ze(this,ul);ze(this,Vu);ze(this,ys);ze(this,cl);ze(this,Pn);ze(this,vf);ze(this,dl);Ae(this,dl,!1),Ae(this,vf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ae(this,cl,e.client),Ae(this,ys,U(this,cl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ae(this,ul,fE(this.options)),this.state=e.state??U(this,ul),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return U(this,Fu)}get promise(){var e;return(e=U(this,Pn))==null?void 0:e.promise}setOptions(e){if(this.options={...U(this,vf),...e},e!=null&&e._type&&Ae(this,Fu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=fE(this.options);n.data!==void 0&&(this.setState(dE(n.data,n.dataUpdatedAt)),Ae(this,ul,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,ys).remove(this)}setData(e,n){const r=Z1(this.state.data,e,this.options);return ut(this,Br,$i).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){ut(this,Br,$i).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=U(this,Pn))==null?void 0:r.promise;return(s=U(this,Pn))==null||s.cancel(e),n?n.then(Pr).catch(Pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return U(this,ul)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Gr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_2||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Qo(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:!H8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=U(this,Pn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=U(this,Pn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),U(this,ys).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(U(this,Pn)&&(U(this,dl)||ut(this,Br,q8).call(this)?U(this,Pn).cancel({revert:!0}):U(this,Pn).cancelRetry()),this.scheduleGc()),U(this,ys).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,Br,$i).call(this,{type:"invalidate"})}async fetch(e,n){var d,h,p,m,y,x,_,w,E,P,T;if(this.state.fetchStatus!=="idle"&&((d=U(this,Pn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Pn))return U(this,Pn).continueRetry(),U(this,Pn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(R=>R.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Ae(this,dl,!0),r.signal)})},i=()=>{const k=U8(this.options,n),L=(()=>{const O={client:U(this,cl),queryKey:this.queryKey,meta:this.meta};return s(O),O})();return Ae(this,dl,!1),this.options.persister?this.options.persister(k,L,this):k(L)},u=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,cl),state:this.state,fetchFn:i};return s(k),k})(),c=U(this,Fu)==="infinite"?YO(this.options.pages):this.options.behavior;c==null||c.onFetch(u,this),Ae(this,Vu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&ut(this,Br,$i).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),Ae(this,Pn,G8({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:k=>{k instanceof X1&&k.revert&&this.setState({...U(this,Vu),fetchStatus:"idle"}),r.abort()},onFail:(k,R)=>{ut(this,Br,$i).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{ut(this,Br,$i).call(this,{type:"pause"})},onContinue:()=>{ut(this,Br,$i).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const k=await U(this,Pn).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(y=(m=U(this,ys).config).onSuccess)==null||y.call(m,k,this),(_=(x=U(this,ys).config).onSettled)==null||_.call(x,k,this.state.error,this),k}catch(k){if(k instanceof X1){if(k.silent)return U(this,Pn).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw ut(this,Br,$i).call(this,{type:"error",error:k}),(E=(w=U(this,ys).config).onError)==null||E.call(w,k,this),(T=(P=U(this,ys).config).onSettled)==null||T.call(P,this.state.data,k,this),k}finally{this.scheduleGc()}}},Fu=new WeakMap,ul=new WeakMap,Vu=new WeakMap,ys=new WeakMap,cl=new WeakMap,Pn=new WeakMap,vf=new WeakMap,dl=new WeakMap,Br=new WeakSet,q8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},$i=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Z8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...dE(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,Vu,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Vn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),U(this,ys).notify({query:this,type:"updated",action:e})})},D8);function Z8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:W8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function dE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function fE(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Er,ct,yf,or,fl,$u,Zi,zo,_f,Hu,zu,hl,pl,Uo,Uu,gt,fd,Q1,J1,ey,ty,ny,ry,sy,Y8,N8,JO=(N8=class extends Sf{constructor(e,n){super();ze(this,gt);ze(this,Er);ze(this,ct);ze(this,yf);ze(this,or);ze(this,fl);ze(this,$u);ze(this,Zi);ze(this,zo);ze(this,_f);ze(this,Hu);ze(this,zu);ze(this,hl);ze(this,pl);ze(this,Uo);ze(this,Uu,new Set);this.options=n,Ae(this,Er,e),Ae(this,zo,null),Ae(this,Zi,Y1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,ct).addObserver(this),hE(U(this,ct),this.options)?ut(this,gt,fd).call(this):this.updateResult(),ut(this,gt,ty).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iy(U(this,ct),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iy(U(this,ct),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ut(this,gt,ny).call(this),ut(this,gt,ry).call(this),U(this,ct).removeObserver(this)}setOptions(e){const n=this.options,r=U(this,ct);if(this.options=U(this,Er).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Gr(this.options.enabled,U(this,ct))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ut(this,gt,sy).call(this),U(this,ct).setOptions(this.options),n._defaulted&&!K1(this.options,n)&&U(this,Er).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,ct),observer:this});const s=this.hasListeners();s&&pE(U(this,ct),r,this.options,n)&&ut(this,gt,fd).call(this),this.updateResult(),s&&(U(this,ct)!==r||Gr(this.options.enabled,U(this,ct))!==Gr(n.enabled,U(this,ct))||Qo(this.options.staleTime,U(this,ct))!==Qo(n.staleTime,U(this,ct)))&&ut(this,gt,Q1).call(this);const i=ut(this,gt,J1).call(this);s&&(U(this,ct)!==r||Gr(this.options.enabled,U(this,ct))!==Gr(n.enabled,U(this,ct))||i!==U(this,Uo))&&ut(this,gt,ey).call(this,i)}getOptimisticResult(e){const n=U(this,Er).getQueryCache().build(U(this,Er),e),r=this.createResult(n,e);return tL(this,r)&&(Ae(this,or,r),Ae(this,$u,this.options),Ae(this,fl,U(this,ct).state)),r}getCurrentResult(){return U(this,or)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&U(this,Zi).status==="pending"&&U(this,Zi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){U(this,Uu).add(e)}getCurrentQuery(){return U(this,ct)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=U(this,Er).defaultQueryOptions(e),r=U(this,Er).getQueryCache().build(U(this,Er),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ut(this,gt,fd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,or)))}createResult(e,n){var M;const r=U(this,ct),s=this.options,i=U(this,or),a=U(this,fl),u=U(this,$u),d=e!==r?e.state:U(this,yf),{state:h}=e;let p={...h},m=!1,y;if(n._optimisticResults){const D=this.hasListeners(),F=!D&&hE(e,n),N=D&&pE(e,r,n,s);(F||N)&&(p={...p,...Z8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:_,status:w}=p;y=p.data;let E=!1;if(n.placeholderData!==void 0&&y===void 0&&w==="pending"){let D;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(D=i.data,E=!0):D=typeof n.placeholderData=="function"?n.placeholderData((M=U(this,zu))==null?void 0:M.state.data,U(this,zu)):n.placeholderData,D!==void 0&&(w="success",y=Z1(i==null?void 0:i.data,D,n),m=!0)}if(n.select&&y!==void 0&&!E)if(i&&y===(a==null?void 0:a.data)&&n.select===U(this,_f))y=U(this,Hu);else try{Ae(this,_f,n.select),y=n.select(y),y=Z1(i==null?void 0:i.data,y,n),Ae(this,Hu,y),Ae(this,zo,null)}catch(D){Ae(this,zo,D)}U(this,zo)&&(x=U(this,zo),y=U(this,Hu),_=Date.now(),w="error");const P=p.fetchStatus==="fetching",T=w==="pending",k=w==="error",R=T&&P,L=y!==void 0,A={status:w,fetchStatus:p.fetchStatus,isPending:T,isSuccess:w==="success",isError:k,isInitialLoading:R,isLoading:R,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:P,isRefetching:P&&!T,isLoadingError:k&&!L,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&L,isStale:x2(e,n),refetch:this.refetch,promise:U(this,Zi),isEnabled:Gr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=A.data!==void 0,F=A.status==="error"&&!D,N=Y=>{F?Y.reject(A.error):D&&Y.resolve(A.data)},G=()=>{const Y=Ae(this,Zi,A.promise=Y1());N(Y)},Z=U(this,Zi);switch(Z.status){case"pending":e.queryHash===r.queryHash&&N(Z);break;case"fulfilled":(F||A.data!==Z.value)&&G();break;case"rejected":(!F||A.error!==Z.reason)&&G();break}}return A}updateResult(){const e=U(this,or),n=this.createResult(U(this,ct),this.options);if(Ae(this,fl,U(this,ct).state),Ae(this,$u,this.options),U(this,fl).data!==void 0&&Ae(this,zu,U(this,ct)),K1(n,e))return;Ae(this,or,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!U(this,Uu).size)return!0;const a=new Set(i??U(this,Uu));return this.options.throwOnError&&a.add("error"),Object.keys(U(this,or)).some(u=>{const c=u;return U(this,or)[c]!==e[c]&&a.has(c)})};ut(this,gt,Y8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ut(this,gt,ty).call(this)}},Er=new WeakMap,ct=new WeakMap,yf=new WeakMap,or=new WeakMap,fl=new WeakMap,$u=new WeakMap,Zi=new WeakMap,zo=new WeakMap,_f=new WeakMap,Hu=new WeakMap,zu=new WeakMap,hl=new WeakMap,pl=new WeakMap,Uo=new WeakMap,Uu=new WeakMap,gt=new WeakSet,fd=function(e){ut(this,gt,sy).call(this);let n=U(this,ct).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Pr)),n},Q1=function(){ut(this,gt,ny).call(this);const e=Qo(this.options.staleTime,U(this,ct));if(Fd.isServer()||U(this,or).isStale||!G1(e))return;const r=H8(U(this,or).dataUpdatedAt,e)+1;Ae(this,hl,nl.setTimeout(()=>{U(this,or).isStale||this.updateResult()},r))},J1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,ct)):this.options.refetchInterval)??!1},ey=function(e){ut(this,gt,ry).call(this),Ae(this,Uo,e),!(Fd.isServer()||Gr(this.options.enabled,U(this,ct))===!1||!G1(U(this,Uo))||U(this,Uo)===0)&&Ae(this,pl,nl.setInterval(()=>{(this.options.refetchIntervalInBackground||v2.isFocused())&&ut(this,gt,fd).call(this)},U(this,Uo)))},ty=function(){ut(this,gt,Q1).call(this),ut(this,gt,ey).call(this,ut(this,gt,J1).call(this))},ny=function(){U(this,hl)!==void 0&&(nl.clearTimeout(U(this,hl)),Ae(this,hl,void 0))},ry=function(){U(this,pl)!==void 0&&(nl.clearInterval(U(this,pl)),Ae(this,pl,void 0))},sy=function(){const e=U(this,Er).getQueryCache().build(U(this,Er),this.options);if(e===U(this,ct))return;const n=U(this,ct);Ae(this,ct,e),Ae(this,yf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},Y8=function(e){Vn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(U(this,or))}),U(this,Er).getQueryCache().notify({query:U(this,ct),type:"observerResultsUpdated"})})},N8);function eL(t,e){return Gr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Gr(e.retryOnMount,t)===!1)}function hE(t,e){return eL(t,e)||t.state.data!==void 0&&iy(t,e,e.refetchOnMount)}function iy(t,e,n){if(Gr(e.enabled,t)!==!1&&Qo(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&x2(t,e)}return!1}function pE(t,e,n,r){return(t!==e||Gr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&x2(t,n)}function x2(t,e){return Gr(e.enabled,t)!==!1&&t.isStaleByTime(Qo(e.staleTime,t))}function tL(t,e){return!K1(t.getCurrentResult(),e)}var xf,ai,Xn,ml,li,jo,j8,nL=(j8=class extends K8{constructor(e){super();ze(this,li);ze(this,xf);ze(this,ai);ze(this,Xn);ze(this,ml);Ae(this,xf,e.client),this.mutationId=e.mutationId,Ae(this,Xn,e.mutationCache),Ae(this,ai,[]),this.state=e.state||rL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){U(this,ai).includes(e)||(U(this,ai).push(e),this.clearGcTimeout(),U(this,Xn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ae(this,ai,U(this,ai).filter(n=>n!==e)),this.scheduleGc(),U(this,Xn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){U(this,ai).length||(this.state.status==="pending"?this.scheduleGc():U(this,Xn).remove(this))}continue(){var e;return((e=U(this,ml))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,c,d,h,p,m,y,x,_,w,E,P,T,k,R,L,O;const n=()=>{ut(this,li,jo).call(this,{type:"continue"})},r={client:U(this,xf),meta:this.options.meta,mutationKey:this.options.mutationKey};Ae(this,ml,G8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,M)=>{ut(this,li,jo).call(this,{type:"failed",failureCount:A,error:M})},onPause:()=>{ut(this,li,jo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,Xn).canRun(this)}));const s=this.state.status==="pending",i=!U(this,ml).canStart();try{if(s)n();else{ut(this,li,jo).call(this,{type:"pending",variables:e,isPaused:i}),U(this,Xn).config.onMutate&&await U(this,Xn).config.onMutate(e,this,r);const M=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,r));M!==this.state.context&&ut(this,li,jo).call(this,{type:"pending",context:M,variables:e,isPaused:i})}const A=await U(this,ml).start();return await((d=(c=U(this,Xn).config).onSuccess)==null?void 0:d.call(c,A,e,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,A,e,this.state.context,r)),await((y=(m=U(this,Xn).config).onSettled)==null?void 0:y.call(m,A,null,this.state.variables,this.state.context,this,r)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,A,null,e,this.state.context,r)),ut(this,li,jo).call(this,{type:"success",data:A}),A}catch(A){try{await((E=(w=U(this,Xn).config).onError)==null?void 0:E.call(w,A,e,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((T=(P=this.options).onError)==null?void 0:T.call(P,A,e,this.state.context,r))}catch(M){Promise.reject(M)}try{await((R=(k=U(this,Xn).config).onSettled)==null?void 0:R.call(k,void 0,A,this.state.variables,this.state.context,this,r))}catch(M){Promise.reject(M)}try{await((O=(L=this.options).onSettled)==null?void 0:O.call(L,void 0,A,e,this.state.context,r))}catch(M){Promise.reject(M)}throw ut(this,li,jo).call(this,{type:"error",error:A}),A}finally{U(this,Xn).runNext(this)}}},xf=new WeakMap,ai=new WeakMap,Xn=new WeakMap,ml=new WeakMap,li=new WeakSet,jo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Vn.batch(()=>{U(this,ai).forEach(r=>{r.onMutationUpdate(e)}),U(this,Xn).notify({mutation:this,type:"updated",action:e})})},j8);function rL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yi,zs,wf,F8,sL=(F8=class extends Sf{constructor(e={}){super();ze(this,Yi);ze(this,zs);ze(this,wf);this.config=e,Ae(this,Yi,new Set),Ae(this,zs,new Map),Ae(this,wf,0)}build(e,n,r){const s=new nL({client:e,mutationCache:this,mutationId:++Uh(this,wf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){U(this,Yi).add(e);const n=Bh(e);if(typeof n=="string"){const r=U(this,zs).get(n);r?r.push(e):U(this,zs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(U(this,Yi).delete(e)){const n=Bh(e);if(typeof n=="string"){const r=U(this,zs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&U(this,zs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Bh(e);if(typeof n=="string"){const r=U(this,zs).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=Bh(e);if(typeof n=="string"){const s=(r=U(this,zs).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vn.batch(()=>{U(this,Yi).forEach(e=>{this.notify({type:"removed",mutation:e})}),U(this,Yi).clear(),U(this,zs).clear()})}getAll(){return Array.from(U(this,Yi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>aE(n,r))}findAll(e={}){return this.getAll().filter(n=>aE(e,n))}notify(e){Vn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Vn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Pr))))}},Yi=new WeakMap,zs=new WeakMap,wf=new WeakMap,F8);function Bh(t){var e;return(e=t.options.scope)==null?void 0:e.id}var ui,V8,iL=(V8=class extends Sf{constructor(e={}){super();ze(this,ui);this.config=e,Ae(this,ui,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??y2(s,n);let a=this.get(i);return a||(a=new QO({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){U(this,ui).has(e.queryHash)||(U(this,ui).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=U(this,ui).get(e.queryHash);n&&(e.destroy(),n===e&&U(this,ui).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Vn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return U(this,ui).get(e)}getAll(){return[...U(this,ui).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>oE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>oE(e,r)):n}notify(e){Vn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Vn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Vn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ui=new WeakMap,V8),Jt,Bo,Wo,Bu,Wu,Go,Gu,Ku,$8,oL=($8=class{constructor(t={}){ze(this,Jt);ze(this,Bo);ze(this,Wo);ze(this,Bu);ze(this,Wu);ze(this,Go);ze(this,Gu);ze(this,Ku);Ae(this,Jt,t.queryCache||new iL),Ae(this,Bo,t.mutationCache||new sL),Ae(this,Wo,t.defaultOptions||{}),Ae(this,Bu,new Map),Ae(this,Wu,new Map),Ae(this,Go,0)}mount(){Uh(this,Go)._++,U(this,Go)===1&&(Ae(this,Gu,v2.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,Jt).onFocus())})),Ae(this,Ku,Jp.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,Jt).onOnline())})))}unmount(){var t,e;Uh(this,Go)._--,U(this,Go)===0&&((t=U(this,Gu))==null||t.call(this),Ae(this,Gu,void 0),(e=U(this,Ku))==null||e.call(this),Ae(this,Ku,void 0))}isFetching(t){return U(this,Jt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return U(this,Bo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,Jt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=U(this,Jt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Qo(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return U(this,Jt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=U(this,Jt).get(r.queryHash),i=s==null?void 0:s.state.data,a=$O(e,i);if(a!==void 0)return U(this,Jt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Vn.batch(()=>U(this,Jt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,Jt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=U(this,Jt);Vn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=U(this,Jt);return Vn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Vn.batch(()=>U(this,Jt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Pr).catch(Pr)}invalidateQueries(t,e={}){return Vn.batch(()=>(U(this,Jt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Vn.batch(()=>U(this,Jt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Pr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Pr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=U(this,Jt).build(this,e);return n.isStaleByTime(Qo(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Pr).catch(Pr)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Pr).catch(Pr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Jp.isOnline()?U(this,Bo).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,Jt)}getMutationCache(){return U(this,Bo)}getDefaultOptions(){return U(this,Wo)}setDefaultOptions(t){Ae(this,Wo,t)}setQueryDefaults(t,e){U(this,Bu).set(jd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...U(this,Bu).values()],n={};return e.forEach(r=>{qu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){U(this,Wu).set(jd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...U(this,Wu).values()],n={};return e.forEach(r=>{qu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...U(this,Wo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=y2(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===_2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...U(this,Wo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){U(this,Jt).clear(),U(this,Bo).clear()}},Jt=new WeakMap,Bo=new WeakMap,Wo=new WeakMap,Bu=new WeakMap,Wu=new WeakMap,Go=new WeakMap,Gu=new WeakMap,Ku=new WeakMap,$8),X8=g.createContext(void 0),Q8=t=>{const e=g.useContext(X8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},aL=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(X8.Provider,{value:t,children:e})),J8=g.createContext(!1),lL=()=>g.useContext(J8);J8.Provider;function uL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var cL=g.createContext(uL()),dL=()=>g.useContext(cL),fL=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?B8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},hL=t=>{g.useEffect(()=>{t.clearReset()},[t])},pL=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||B8(n,[t.error,r])),mL=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},gL=(t,e)=>t.isLoading&&t.isFetching&&!e,vL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,mE=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function yL(t,e,n){var y,x,_,w;const r=lL(),s=dL(),i=Q8(),a=i.defaultQueryOptions(t);(x=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||x.call(y,a);const u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,mL(a),fL(a,s,u),hL(s);const d=!i.getQueryCache().get(a.queryHash),[h]=g.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),m=!r&&c;if(g.useSyncExternalStore(g.useCallback(E=>{const P=m?h.subscribe(Vn.batchCalls(E)):Pr;return h.updateResult(),P},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),g.useEffect(()=>{h.setOptions(a)},[a,h]),vL(a,p))throw mE(a,h,s);if(pL({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((w=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||w.call(_,a,p),a.experimental_prefetchInRender&&!Fd.isServer()&&gL(p,r)){const E=d?mE(a,h,s):u==null?void 0:u.promise;E==null||E.catch(Pr).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function oy(t,e){return yL(t,JO)}var ne=typeof window<"u"?window:void 0,Jn=typeof globalThis<"u"?globalThis:ne,lr=Jn==null?void 0:Jn.navigator,ke=Jn==null?void 0:Jn.document,on=Jn==null?void 0:Jn.location,w2=Jn==null?void 0:Jn.fetch,ay=Jn!=null&&Jn.XMLHttpRequest&&"withCredentials"in new Jn.XMLHttpRequest?Jn.XMLHttpRequest:void 0,gE=Jn==null?void 0:Jn.AbortController,_L=Jn==null?void 0:Jn.CompressionStream,Cr=lr==null?void 0:lr.userAgent;function e6(){return!(!ne||ne.navigator.onLine===!1)}var Yc=typeof globalThis<"u"?globalThis:ne;Yc&&typeof self>"u"&&(Yc.self=Yc),Yc&&typeof File>"u"&&(Yc.File=function(){});var He=ne??{},vE="0.2.0",xt={DEBUG:!1,LIB_VERSION:vE,LIB_NAME:"browser-common",JS_SDK_VERSION:vE};function yE(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(d){return void n(d)}u.done?e(c):Promise.resolve(c).then(r,s)}function tn(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){yE(i,r,s,a,u,"next",c)}function u(c){yE(i,r,s,a,u,"throw",c)}a(void 0)}))}}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},de.apply(null,arguments)}function t6(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var _E=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function xE(t){return typeof t=="string"||t}function wE(t){return typeof t=="string"?t:void 0}var Xc,xL=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Bi=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),bE=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),wL=["$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"],bL=["token"],n6="NativeGzipValidationError",ly=t=>t.length>=2&&t[0]===31&&t[1]===139,SE=(t,e)=>t===bE.GZipJS||e===bE.GZipJS||e==="gzip",EE=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Wh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=n6,e},SL=(function(){var t=tn((function*(e,n){18>e.size&&Wh("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());ly(r)&&r[2]===8||Wh("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(Xc)return Xc;Xc=[];for(var h=0;256>h;h++){for(var p=h,m=0;8>m;m++)p=1&p?3988292384^p>>>1:p>>>1;Xc[h]=p>>>0}return Xc})(),c=4294967295,d=0;a.length>d;d++)c=u[255&(c^a[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&Wh("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Wh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function uy(){return uy=tn((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var d=tn((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return d.apply(this,arguments)}})()),u=new Response(s.readable).blob(),c=(yield Promise.all([u,a]))[0];return yield SL(c,r),c}catch(d){if(n!=null&&n.rethrow)throw d;return e&&console.error("Failed to gzip compress data",d),null}})),uy.apply(this,arguments)}var EL=["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"],CE=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return EL.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function qe(t,e){return t.indexOf(e)!==-1}var n0=function(t){return t.trim()},cy=function(t){return t.replace(/^\$/,"")};function r6(t){var e,n=[];return(e=JSON.stringify(t,(function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}})))!==null&&e!==void 0?e:"null"}var s6=Object.prototype,i6=s6.hasOwnProperty,r0=s6.toString,nt=Array.isArray||function(t){return r0.call(t)==="[object Array]"},Us=t=>typeof t=="function",Dt=t=>t===Object(t)&&!nt(t),Ko=t=>{if(Dt(t)){for(var e in t)if(i6.call(t,e))return!1;return!0}return!1},ge=t=>t===void 0,wt=t=>r0.call(t)=="[object String]",dy=t=>wt(t)&&t.trim().length===0,fr=t=>t===null,tt=t=>ge(t)||fr(t),Hn=t=>r0.call(t)=="[object Number]"&&t==t,Hi=t=>Hn(t)&&t>0,Bs=t=>r0.call(t)==="[object Boolean]",CL=t=>t instanceof FormData,kL=t=>qe(wL,t),PL=t=>qe(bL,t);function o6(t){return t===null||typeof t!="object"}function em(t,e){return{}.toString.call(t)==="[object "+e+"]"}function b2(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var TL=[!0,"true",1,"1","yes"],mv=t=>qe(TL,t),RL=[!1,"false",0,"0","no"];function hi(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Hn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),hi(s||n,e,n,r))}class AL{constructor(e){this.tt={},this.et=e.et,this.rt=hi(e.bucketSize,0,100,e.it),this.nt=hi(e.refillRate,0,this.rt,e.it),this.st=hi(e.refillInterval,0,864e5,e.it)}ot(e,n){var r=Math.floor((n-e.lastAccess)/this.st);r>0&&(e.tokens=Math.min(e.tokens+r*this.nt,this.rt),e.lastAccess=e.lastAccess+r*this.st)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.tt[s];return i?this.ot(i,r):this.tt[s]=i={tokens:this.rt,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.et)==null||n.call(this,e)),i.tokens===0)}stop(){this.tt={}}}var Qr="Mobile",tm="iOS",no="Android",Zu="Tablet",a6=no+" "+Zu,l6="iPad",u6="Apple",c6=u6+" Watch",wd="Safari",Yu="BlackBerry",d6="Samsung",f6=d6+"Browser",h6=d6+" Internet",gl="Chrome",IL=gl+" OS",p6=gl+" "+tm,S2="Internet Explorer",m6=S2+" "+Qr,E2="Opera",ML=E2+" Mini",C2="Edge",g6="Microsoft "+C2,ku="Firefox",v6=ku+" "+tm,Vd="Nintendo",$d="PlayStation",Pu="Xbox",y6=no+" "+Qr,_6=Qr+" "+wd,hd="Windows",fy=hd+" Phone",kE="Nokia",hy="Ouya",x6="Generic",OL=x6+" "+Qr.toLowerCase(),w6=x6+" "+Zu.toLowerCase(),py="Konqueror",b6="Oculus Browser",nm="Vivaldi",S6="Yandex",rm="Whale",my="DuckDuckGo",E6="Pale Moon",sm="Waterfox",bd="Brave",C6="Google Search App",Ht="(\\d+(\\.\\d+)?)",gv=new RegExp("Version/"+Ht),LL=new RegExp(Pu,"i"),DL=new RegExp($d+" \\w+","i"),NL=new RegExp(Vd+" \\w+","i"),k2=new RegExp(Yu+"|PlayBook|BB10","i"),jL={"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"},k6=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?bd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&qe(t,"GSA/")?C6:qe(t," OPR/")&&qe(t,"Mini")?ML:qe(t," OPR/")?E2:k2.test(t)?Yu:qe(t,"IE"+Qr)||qe(t,"WPDesktop")?m6:qe(t,"OculusBrowser")?b6:qe(t,f6)?h6:qe(t,C2)||qe(t,"Edg/")?g6:qe(t,nm+"/")?nm:qe(t,"YaBrowser/")?S6:qe(t,rm+"/")?rm:qe(t,my+"/")||qe(t,"Ddg/")?my:qe(t,"FBIOS")?"Facebook "+Qr:qe(t,"UCWEB")||qe(t,"UCBrowser")?"UC Browser":qe(t,"CriOS")?p6:qe(t,"CrMo")||qe(t,gl)?gl:qe(t,no)&&qe(t,wd)?y6:qe(t,"FxiOS")?v6:qe(t.toLowerCase(),py.toLowerCase())?py:qe(t,bd+"/")?bd:((i,a)=>a&&qe(a,u6)||(function(u){return qe(u,wd)&&!qe(u,gl)&&!qe(u,no)})(i))(t,e)?qe(t,Qr)?_6:wd:qe(t,"PaleMoon/")?E6:qe(t,sm+"/")?sm:qe(t,ku)?ku:qe(t,"MSIE")||qe(t,"Trident/")?S2:qe(t,"Gecko")?ku:"")},FL={[m6]:[new RegExp("rv:"+Ht)],[g6]:[new RegExp(C2+"?\\/"+Ht)],[gl]:[new RegExp("("+gl+"|CrMo)\\/"+Ht)],[p6]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[wd]:[gv],[_6]:[gv],[E2]:[new RegExp("(Opera|OPR)\\/"+Ht)],[ku]:[new RegExp(ku+"\\/"+Ht)],[v6]:[new RegExp("FxiOS\\/"+Ht)],[py]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[Yu]:[new RegExp(Yu+" "+Ht),gv],[y6]:[new RegExp("android\\s"+Ht,"i")],[h6]:[new RegExp(f6+"\\/"+Ht)],[b6]:[new RegExp("OculusBrowser\\/"+Ht)],[nm]:[new RegExp(nm+"\\/"+Ht)],[S6]:[new RegExp("YaBrowser\\/"+Ht)],[rm]:[new RegExp(rm+"\\/"+Ht)],[bd]:[new RegExp(bd+"\\/"+Ht)],[my]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ht)],[E6]:[new RegExp("PaleMoon\\/"+Ht)],[sm]:[new RegExp(sm+"\\/"+Ht)],[C6]:[new RegExp("GSA\\/"+Ht)],[S2]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},VL=function(t,e,n,r){var s=k6(t,e,n,r),i=FL[s];if(ge(i))return null;for(var a=0;i.length>a;a++){var u=t.match(i[a]);if(u)return parseFloat(u[u.length-2])}return null},PE=[[new RegExp(Pu+"; "+Pu+" (.*?)[);]","i"),t=>[Pu,t&&t[1]||""]],[new RegExp(Vd,"i"),[Vd,""]],[new RegExp($d,"i"),[$d,""]],[k2,[Yu,""]],[new RegExp(hd,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[fy,""];if(new RegExp(Qr).test(e)&&!/IEMobile\b/.test(e))return[hd+" "+Qr,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=jL[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[hd,r]}return[hd,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[tm,[t[3],t[4],t[5]||"0"].join(".")]:[tm,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ge(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+no+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+no+")","i"),t=>t&&t[2]?[no,[t[2],t[3],t[4]||"0"].join(".")]:[no,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[IL,""]],[/Linux|debian/i,["Linux",""]]],TE=function(t){return NL.test(t)?Vd:DL.test(t)?$d:LL.test(t)?Pu:new RegExp(hy,"i").test(t)?hy:new RegExp("("+fy+"|WPDesktop)","i").test(t)?fy:/iPad/.test(t)?l6:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?c6:k2.test(t)?Yu:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(kE,"i").test(t)?kE:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Qr).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?no:a6:new RegExp("(pda|"+Qr+")","i").test(t)?OL:new RegExp(Zu,"i").test(t)&&!new RegExp(Zu+" pc","i").test(t)?w6:""},$L=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function RE(t,e){return typeof(n=t)=="string"&&$L.test(n)?t:e();var n}function ra(t){return t&&t.split("#")[0]}function Sp(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var HL=t=>t instanceof Error,P6={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}},zL=P6.info;function T6(t){if(Bs(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(nt(t))return{arrayValue:{values:t.map((e=>T6(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function im(t){var e=[];for(var n in t){var r=t[n];fr(r)||ge(r)||e.push({key:n,value:T6(r)})}return e}function UL(t,e){var n=P6[t.level||"info"]||zL,r=n.text,s=n.number,i=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),tt(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),tt(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var u=de({},a,t.attributes||{}),c={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:im(u)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),ge(t.trace_flags)||(c.flags=t.trace_flags),c}function R6(t,e,n){return de({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function A6(t,e,n,r){return{resourceLogs:[{resource:{attributes:im(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let BL=class{constructor(t,e,n,r,s,i,a){var u;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Te=e,this.it=n,this.ut=r,this.ht=s,this.dt=i,this.ct=a,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max((u=e.maxQueueSize)!==null&&u!==void 0?u:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.It=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Mt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Te.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.Rt(t);if(e!==null)if(e.body){if(this.Pt()){var n={record:UL(e,this.ut())};this.ht((()=>this.Ot(n)))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var n=nt(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.it.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.it.error("Error in beforeSend function for log:",a),null}return r}Pt(){if(this.Tt===void 0)return!0;var t=Date.now(),e=t-this.bt;return this.It>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.It+"ms"),this.wt=!0),!1)}flush(){var t=this;return tn((function*(){if(!t._instance.isDisabled)return t.vt||(t.vt=t.Ft().finally((()=>{t.vt=null}))),t.vt}))()}Ft(){var t=this;return tn((function*(){var e;t.Mt();var n=(e=t._instance.getPersistedProperty(Bi.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var i,a;t.ft=0;var u=Math.min(n.length,t.Ct),c=n.slice(0,u),d=A6(c.map((p=>p.record)),t.Lt(),(i=t.ct)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.$t(d);if(h.kind==="too-large"&&c.length>1)t.Ct=Math.max(1,Math.floor(c.length/2)),t.it.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+t.Ct);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.it.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Te.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Te.maxBatchRecordsPerPost,t.Ct+1)),yield t.At(c.length),n=(a=t._instance.getPersistedProperty(Bi.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,h.kind==="fatal"))throw h.error}}))()}At(t){var e=this;return tn((function*(){var n,r=Math.max(0,t-e.ft),s=(n=e._instance.getPersistedProperty(Bi.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Bi.LogsQueue,s.slice(r)),yield e.dt()}))()}Lt(){return R6(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Bi.LogsQueue))!==null&&e!==void 0?e:[];this.kt>n.length||(n.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Bi.LogsQueue,n),this.xt>n.length?this.Nt():this.Et()}}Nt(t){t===void 0&&(t=this.St),this.Dt||(this.Dt=Sp((()=>{this.Dt=void 0,this.Et()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(Bi.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return tn((function*(){e.Mt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>Sp(r,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return tn((function*(){var n=!1,r=e.flush(),s=new Promise((i=>Sp((()=>{n=!0,i()}),t)));try{yield Promise.race([r,s])}finally{n&&r.catch((()=>{}))}}))()}Et(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.it.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.Nt(this.qt())}))}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}};var vv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function AE(t){return String(t)+"000000"}function IE(t,e,n,r){var s="";return r&&(s=Object.keys(r).sort().map((i=>JSON.stringify(i)+":"+JSON.stringify(r[i]))).join(",")),t+"\0"+e+"\0"+(n??"")+"\0"+s}let WL=class{constructor(t,e,n){this._instance=t,this.Te=e,this.it=n,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(t,e,n){e===void 0&&(e=1),this.Wt({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Wt({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Wt({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.vt,n=(function(){var s=tn((function*(){e&&(yield e.catch((()=>{}))),yield t.Zt()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.vt===r&&(this.vt=null)}));return this.vt=r,r}drainWindow(){if(this.Ht.size===0)return null;var t=this.Ht;return this.Ht=new Map,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Vt++,this.Mt(),this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set}Wt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rt(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.it.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?de({},e.attributes):void 0,r=IE(e.type,e.name,e.unit,n)}catch(a){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.Ht.get(r);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Ht.set(r,s)}var i=this.Ut.get(e.name);i===void 0?this.Ut.set(e.name,e.type):i===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.warn("Metric name '"+e.name+"' is already used as a "+i+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.Nt()}else this.it.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Te.maxSeriesPerFlush>this.Ht.size||(this.Bt||(this.Bt=!0,this.it.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(vv.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(var a=0;i.length>a;a++)if(i[a]>=s)return a;return i.length})(e,vv)]+=1}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var n=nt(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.it.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.it.error("Error in beforeSend function for metric:",a),null}return r}Nt(){this.Dt||(this.Dt=Sp((()=>{this.Dt=void 0,this.flush().catch((t=>{this.it.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}Zt(){var t=this;return tn((function*(){if(t.Ht.size!==0){var e=t.Ht;t.Ht=new Map,t.Bt=!1,t.Ut=new Map,t.zt=new Set;var n=t.Vt,r=yield t._instance.Kt(t.Gt(e));if(n===t.Vt)switch(r.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.Nt();case"too-large":return void t.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.it.error("Failed to send metrics batch:",r.error)}}}))()}Gt(t){return e=this.Xt(t),n=(function(i,a,u){return de({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":u})})(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:im(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}Xt(t){var e=AE(Date.now()),n=new Map;for(var r of t.values()){var s,i=IE(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=de({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var u=im((s=r.attributes)!==null&&s!==void 0?s:{}),c=AE(r.windowStartMs);if(r.type==="count"){var d,h={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(d=r.total)!==null&&d!==void 0?d:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,m={attributes:u,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(m)}else r.hist&&a.histogram.dataPoints.push({attributes:u,startTimeUnixNano:c,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:vv})}return Array.from(n.values())}Yt(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.Ht.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,i.windowStartMs),a.type){case"count":a.total=((e=a.total)!==null&&e!==void 0?e:0)+((n=i.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(i.hist)if(a.hist){a.hist.count+=i.hist.count,a.hist.sum+=i.hist.sum,a.hist.min=Math.min(a.hist.min,i.hist.min),a.hist.max=Math.max(a.hist.max,i.hist.max);for(var u=0;a.hist.bucketCounts.length>u;u++)a.hist.bucketCounts[u]+=i.hist.bucketCounts[u]}else a.hist=i.hist}else this.Qt()&&this.Ht.set(s,i)}}};var Gh,ME,yv;function GL(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return yv&&n.length===ME||(ME=n.length,yv=n.reduce(((r,s)=>{Gh||(Gh={});var i=Gh[s];if(i)r[i[0]]=i[1];else for(var a=t(s),u=a.length-1;u>=0;u--){var c=a[u],d=c==null?void 0:c.filename,h=e[s];if(d&&h){r[d]=h,Gh[s]=[d,h];break}}return r}),{})),yv}}class KL{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),a=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return tn((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&nt(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),de({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return tn((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,i,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var u=[a];return e.cause!=null&&u.push(...this.convertToExceptionList(e.cause,de({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:GL(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,a)=>{if(4>=a){var u=this.buildCoercingContext(e,n,a);return this.applyCoercers(i,u)}};return de({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Xu="?";function gy(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?Xu:n,in_app:!0};return ge(r)||(i.lineno=r),ge(s)||(i.colno=s),i}var I6=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Xu,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},qL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ZL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,YL=/\((\S*)(?::(\d+))(?::(\d+))\)/,XL=(t,e)=>{var n=qL.exec(t);if(n)return gy(e,n[1],Xu,+n[2],+n[3]);var r=ZL.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=YL.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=I6(r[1]||Xu,r[2]);return gy(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},QL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,JL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,eD=(t,e)=>{var n=QL.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=JL.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Xu,a=I6(i,s);return gy(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},OE=/\(error: (.*)\)/;class tD{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=wt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return em(e,"DOMException")}isDOMError(e){return em(e,"DOMError")}}class nD{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class rD{constructor(){}match(e){return em(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var sD=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class iD{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),i=s[0],a=s[1];return{type:i??"Error",value:a??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(sD);return s&&(n=s[1],r=s[2]),[n,r]}}var oD=["fatal","error","warning","log","info","debug"];function M6(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class aD{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return b2(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+M6(e)}isSeverityLevel(e){return wt(e)&&!dy(e)&&oD.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(HL(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class lD{match(e){return b2(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+M6(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class uD{match(e){return o6(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class cD{match(e){return em(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!b2(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return o6(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){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}}var om="$message",am="$timestamp",dD=new Set([om,am]),_v={enabled:!0,max_bytes:32768};function lm(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:_v.enabled,max_bytes:hD(t.max_bytes,_v.max_bytes)}:de({},_v)}class fD{constructor(e){this.$e=[],this.ze=0,this.Te=lm(e)}setConfig(e){this.Te=lm(e),this.Ze()}add(e){var n=(function(s){var i;try{i=r6(s)}catch{return}try{var a=JSON.parse(i);if(!Dt(a))return;var u=a,c=u[om],d=u[am];return!wt(c)||c.trim().length===0||!wt(d)&&!Hn(d)?void 0:{step:u,json:i}}catch{return}})(e);if(n){var r=(function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),a=0,u=0;i.length>u;u++)i[u]==="%"?(a+=1,u+=2):a+=1;return a})(n.json);r>this.Te.max_bytes||(this.$e.push({step:n.step,bytes:r}),this.ze+=r,this.Ze())}}getAttachable(){return this.$e.map((e=>e.step))}clear(){this.$e=[],this.ze=0}size(){return this.$e.length}Ze(){for(;this.ze>this.Te.max_bytes&&this.$e.length>0;){var e=this.$e.shift();e&&(this.ze-=e.bytes)}}}function hD(t,e){if(!Hn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var O6=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(ne&&(xt.DEBUG||ne.POSTHOG_DEBUG||n)&&!ge(ne.console)&&ne.console){for(var i=("__rrweb_original__"in ne.console[s])?ne.console[s].__rrweb_original__:ne.console[s],a=arguments.length,u=new Array(a>1?a-1:0),c=1;a>c;c++)u[c-1]=arguments[c];i(t,...u)}},debug(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>O6(t+" "+s,i)};return r},xe=O6("[PostHog.js]"),Vt=xe.createLogger,pD=Vt("[ExternalScriptsLoader]"),xv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return pD.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=ke==null?void 0:ke.querySelectorAll("script");if(r){for(var s,i=function(){if(r[a].src===e){var c=r[a];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(d=>{c.__posthog_loading_callback_fired=!0,n(void 0,d)})),c.onerror=d=>n(d),{v:void 0})}},a=0;r.length>a;a++)if(s=i())return s.v}var u=()=>{if(!ke)return n("document not found");var c=ke.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=e,c.onload=p=>{c.__posthog_loading_callback_fired=!0,n(void 0,p)},c.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(c=t.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")ke.head.appendChild(c);else{var d,h=ke.querySelectorAll("body > script");h.length>0?(d=h[0].parentNode)==null||d.insertBefore(c,h[0]):ke.body.appendChild(c)}};ke!=null&&ke.body?u():ke==null||ke.addEventListener("DOMContentLoaded",u)};He.__PosthogExtensions__=He.__PosthogExtensions__||{},He.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var i=3e5;s=s+"&t="+Math.floor(Date.now()/i)*i}r=t.requestRouter.endpointFor("assets",s)}xv(t,r,n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");xv(t,a,n)}},He.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);xv(t,r,n)};var LE="1.407.2";xt.DEBUG=!1,xt.LIB_VERSION=LE,xt.LIB_NAME="web",xt.JS_SDK_VERSION=LE;var L6="$people_distinct_id",um="$device_id",wv="$device_model",pd="__alias",md="__timers",vy="$autocapture_disabled_server_side",yy="$heatmaps_enabled_server_side",_y="$exception_capture_enabled_server_side",xy="$error_tracking_suppression_rules",wy="$error_tracking_capture_extension_exceptions",by="$web_vitals_enabled_server_side",P2="$dead_clicks_enabled_server_side",T2="$product_tours_enabled_server_side",Sy="$web_vitals_allowed_metrics",rl="$session_recording_remote_config",D6="$replay_sample_rate",N6="$replay_override_sampling",j6="$replay_override_linked_flag",F6="$replay_override_url_trigger",V6="$replay_override_event_trigger",_u="$sesid",R2="$session_is_sampled",el="$enabled_feature_flags",Ep="$active_feature_flags",gd="$early_access_features",Ey="$feature_flag_details",Cp="$feature_flag_payloads",Cy="$feature_flag_request_id",cm="$minimal_flag_called_events",zi="$override_feature_flags",pu="$override_feature_flag_payloads",Za="$stored_person_properties",Ya="$stored_group_properties",ky="$surveys",dm="$surveys_loaded_at",Py="$surveys_activated",kp="$surveys_activated_session",vd="ph_product_tours",Sd="$flag_call_reported",Ty="$flag_call_reported_session_id",Ry="$feature_flag_errors",Hd="$feature_flag_evaluated_at",Vs="$user_state",Ay="$client_session_props",Iy="$capture_rate_limit",My="$initial_campaign_params",Oy="$initial_referrer_info",fm="$initial_person_info",hm="$epp",Kh="$posthog_cookieless",$6="$cookieless_mode",H6="$sdk_debug_extensions_init_method",z6="$sdk_debug_extensions_init_time_ms",U6="$sdk_debug_recording_script_not_loaded",A2="PostHog loadExternalDependency extension not found.",Xa="on_reject",Xi="always",ru="anonymous",su="identified",Ly="identified_only",pm="visibilitychange",mm="beforeunload",mu="$pageview",bv="$pageleave",Sv="$identify",DE="$groupidentify";function qh(t,e){nt(t)&&t.forEach(e)}function bt(t,e){if(!tt(t))if(nt(t))t.forEach(e);else if(CL(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)i6.call(t,n)&&e(t[n],n)}var At=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var s of n)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function Pp(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var NE=function(t){try{return t()}catch{return}},mD=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){xe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),xe.critical(s)}}},I2=function(t){var e={};return bt(t,(function(n,r){(wt(n)&&n.length>0||Hn(n))&&(e[r]=n)})),e},gD=["herokuapp.com","vercel.app","netlify.app"];function vD(t){var e=t==null?void 0:t.hostname;if(!wt(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of gD)if(n===r)return!1;return!0}function zt(t,e,n,r){var s=r??{},i=s.capture,a=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:a===void 0||a})}function B6(t){return t.name==="ph_toolbar_internal"}var W6=t=>{if(ke){try{for(var e=t+"=",n=ke.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Hn(t)&&isFinite(t)&&Math.floor(t)===t});class gm{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new gm(i)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new gm(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class yD{generate(){var e=this.generateOrAbort();if(!ge(e))return e;this.S=0;var n=this.generateOrAbort();if(ge(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return gm.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new _D}}var jE,G6=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};ne&&!ge(ne.crypto)&&crypto.getRandomValues&&(G6=t=>crypto.getRandomValues(t));class _D{nextUint32(){return this.R.length>this.O||(G6(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Ki=()=>xD().toString(),xD=()=>(jE||(jE=new yD)).generate(),Qc="",wD=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Qi={N:()=>!!ke,D(t){xe.error("cookieStore error: "+t)},A:W6,F(t){var e;try{e=JSON.parse(Qi.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!ke)return!1;try{var i="",a="",u=(function(h,p){if(p){var m=(function(x,_){if(_===void 0&&(_=ke),Qc)return Qc;if(!_||["localhost","127.0.0.1"].includes(x))return"";for(var w=x.split("."),E=Math.min(w.length,8),P="dmn_chk_"+Ki();!Qc&&E--;){var T=w.slice(E).join("."),k=P+"=1;domain=."+T+";path=/";_.cookie=k+";max-age=3",_.cookie.includes(P)&&(_.cookie=k+";max-age=0",Qc=T)}return Qc})(h);if(!m){var y=(x=>{var _=x.match(wD);return _?_[0]:""})(h);y!==m&&xe.info("Warning: cookie subdomain discovery mismatch",y,m),m=y}return m?"; domain=."+m:""}return""})(ke.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(a="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+u+a;return d.length>3686.4&&xe.warn("cookieStore warning: large cookie, len="+d.length),ke.cookie=d,!0}catch{return!1}},P(t,e){if(ke!=null&&ke.cookie)try{Qi.q(t,"",-1,e)}catch{return}}},Ev=null,Et={N(){if(!fr(Ev))return Ev;var t=!0;if(ge(ne))t=!1;else try{var e="__mplssupport__";Et.q(e,"xyz"),Et.A(e)!=='"xyz"'&&(t=!1),Et.P(e)}catch{t=!1}return t||xe.error("localStorage unsupported; falling back to cookie store"),Ev=t,t},D(t){xe.error("localStorage error: "+t)},A(t){try{return ne==null?void 0:ne.localStorage.getItem(t)}catch(e){Et.D(e)}return null},F(t){try{return JSON.parse(Et.A(t))||{}}catch{}return null},q(t,e){try{return ne==null||ne.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Et.D(n)}return!1},P(t){try{ne==null||ne.localStorage.removeItem(t)}catch(e){Et.D(e)}}},bD=[um,"distinct_id",_u,R2,hm,fm,Vs],Zh={},SD={N:()=>!0,D(t){xe.error("memoryStorage error: "+t)},A:t=>Zh[t]||null,F:t=>Zh[t]||null,q:(t,e)=>(Zh[t]=e,!0),P(t){delete Zh[t]}},Na=null,Fn={N(){if(!fr(Na))return Na;if(Na=!0,ge(ne))Na=!1;else try{var t="__support__";Fn.q(t,"xyz"),Fn.A(t)!=='"xyz"'&&(Na=!1),Fn.P(t)}catch{Na=!1}return Na},D(t){xe.error("sessionStorage error: ",t)},A(t){try{return ne==null?void 0:ne.sessionStorage.getItem(t)}catch(e){Fn.D(e)}return null},F(t){try{return JSON.parse(Fn.A(t))||null}catch{}return null},q(t,e){try{return ne==null||ne.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Fn.D(n)}return!1},P(t){try{ne==null||ne.sessionStorage.removeItem(t)}catch(e){Fn.D(e)}}};class ED{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Ge()?0:this.Qe}isOptedOut(){return this.Te.cookieless_mode===Xi||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===Xa}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Je.q(this.Ke,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Je.P(this.Ke,this.Te.cross_subdomain_cookie)}get Ke(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get Qe(){var e=this.Je.A(this.Ke);return mv(e)?1:qe(RL,e)?0:-1}get Je(){var e=this.Te.opt_out_capturing_persistence_type,n=e==="localStorage"?Et:Qi;if(!this.Ye||this.Ye!==n){this.Ye=n;var r=e==="localStorage"?Qi:Et;r.A(this.Ke)&&(this.Ye.A(this.Ke)||this.optInOut(mv(r.A(this.Ke))),r.P(this.Ke,this.Te.cross_subdomain_cookie))}return this.Ye}Ge(){return!!this.Te.respect_dnt&&[lr==null?void 0:lr.doNotTrack,lr==null?void 0:lr.msDoNotTrack,He.doNotTrack].some((e=>mv(e)))}}function K6(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Us(r))return e;try{var s=r(e);return wt(s)&&s?s:e}catch(i){return xe.error("Error in get_current_url, falling back to window.location.href",i),e}}var q6="__POSTHOG_TOOLBAR__",CD=1,kD=3,PD=11;function FE(t){return t instanceof Element&&(t.id===q6||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function sa(t){return!!t&&t.nodeType===CD}function Zr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Z6(t){return!!t&&t.nodeType===kD}function Y6(t){return!!t&&t.nodeType===PD&&sa(t.host)}var X6=1e3;function M2(t){return t?n0(t).split(/\s+/):[]}function VE(t,e){var n=(function(r){var s,i=ne==null||(s=ne.location)==null?void 0:s.href;return ge(i)?void 0:K6(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function vm(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return M2(e)}function Q6(t){return tt(t)?null:n0(t).split(/(\s+)/).filter((e=>Ed(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function zd(t){var e="";return Ny(t)&&!nP(t)&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;Z6(n)&&n.textContent&&(e+=(r=Q6(n.textContent))!==null&&r!==void 0?r:"")})),n0(e)}function Cv(t){var e;return ge(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var O2=["a","button","form","input","select","textarea","label"];function Dy(t,e){if(ge(e))return!0;var n,r=function(i){if(e.some((a=>(function(u,c){var d=u.matches||u.matchesSelector||u.msMatchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector;try{return!!d&&d.call(u,c)}catch{return!1}})(i,a))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function J6(t){var e=t.parentNode;return!(!e||!sa(e))&&e}var TD=[".ph-no-autocapture","[data-ph-no-autocapture]"],eP=["next","previous","prev",">","<"],RD=[...eP,"+","-","−","–"],$E=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,HE=[".ph-no-rageclick",".ph-no-capture"],AD=["","text","search","email","password","url","tel","number"];function zE(t,e){if(!ne||L2(t))return!1;var n,r,s,i,a;if(Bs(e)?(n=!!e&&HE,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:HE,r=e==null?void 0:e.content_ignorelist,s=(a=e==null?void 0:e.ignore_text_selection)!==null&&a!==void 0&&a),n===!1||s&&(function(c){return!(!c||!sa(c))&&(!!Zr(c,"textarea")||(Zr(c,"input")?qe(AD,(c.getAttribute("type")||"").toLowerCase()):(function(d){if(d.isContentEditable)return!0;var h=d.getAttribute==null?void 0:d.getAttribute("contenteditable");return h==="true"||h===""})(c)))})(t))return!1;var u=tP(t,!1).targetElementList;return!(function(c,d){if(c===!1||ge(c))return!1;var h;if(c===!0)h=eP;else{if(!nt(c))return!1;if(c.length>10)return xe.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=c.map((p=>p.toLowerCase()))}return d.some((p=>{var m=p.safeText,y=p.ariaLabel;return h.some((x=>$E(m,x)||$E(y,x)))}))})(r,u.map((c=>{var d;return{safeText:zd(c).toLowerCase(),ariaLabel:((d=c.getAttribute("aria-label"))==null?void 0:d.toLowerCase().trim())||""}})))&&!Dy(u,n)}var L2=t=>!t||Zr(t,"html")||!sa(t),tP=(t,e)=>{if(!ne||L2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Zr(s,"body");)if(Y6(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=J6(s);if(!i)break;if(e||O2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=ne.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function Ny(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Zr(r,"body");r=r.parentNode){if(n++>=X6||e.has(r))return!1;e.add(r);var s=vm(r);if(qe(s,"ph-sensitive")||qe(s,"ph-no-capture"))return!1}if(qe(vm(t),"ph-include"))return!0;var i=t.type||"";if(wt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!wt(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function nP(t){return!!(Zr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Zr(t,"select")||Zr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var rP="(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})",ID=new RegExp("^(?:"+rP+")$"),MD=new RegExp(rP),sP="\\d{3}-?\\d{2}-?\\d{4}",OD=new RegExp("^("+sP+")$"),LD=new RegExp("("+sP+")");function Ed(t,e){return e===void 0&&(e=!0),!(tt(t)||wt(t)&&(t=n0(t),(e?ID:MD).test((t||"").replace(/[- ]/g,""))||(e?OD:LD).test(t)))}function UE(t){var e=zd(t);return Ed(e=(e+" "+iP(t)).trim())?e:""}function iP(t){var e="";return t&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=zd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+iP(n)).trim())}catch(i){xe.error("[AutoCapture]",i)}})),e}function BE(t){return t.replace(/"|\\"/g,'\\"')}function DD(t){var e=t.attr__class;if(e)return nt(e)?e:M2(e)}var Yh=Vt("[Dead Clicks]"),ND=()=>!0,jD=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(P2)),r=t.instance.config.capture_dead_clicks;return Bs(r)?r:!!Dt(r)||n};class WE{get lazyLoadedDeadClicksAutocapture(){return this.Xe}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[P2]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.tr((()=>{this.er()})):this.stop()}tr(e){var n,r;(n=He.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=He.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Yh.error("failed to load script",s):e()}))}er(){var e;if(ke){if(!this.Xe&&(e=He.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Dt(this.instance.config.capture_dead_clicks)?de({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Xe=He.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Xe.start(ke),Yh.info("starting...")}}else Yh.error("`document` not found. Cannot start.")}stop(){this.Xe&&(this.Xe.stop(),this.Xe=void 0,Yh.info("stopping..."))}}var kv=Vt("[SegmentIntegration]"),oP="posthog-js";function aP(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,a=n.severityAllowList,u=a===void 0?["error"]:a,c=n.sendExceptionsToPostHog,d=c===void 0||c;return h=>{var p,m,y,x,_;if(u!=="*"&&!u.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var w=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=w,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var E,P=((p=h.exception)==null?void 0:p.values)||[],T=P.map((R=>de({},R,{stacktrace:R.stacktrace?de({},R.stacktrace,{type:"raw",frames:(R.stacktrace.frames||[]).map((L=>de({},L,{platform:"web:javascript"})))}):void 0}))),k={$exception_message:((m=P[0])==null?void 0:m.value)||h.message,$exception_type:(y=P[0])==null?void 0:y.type,$exception_level:h.level,$exception_list:T,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((x=P[0])==null?void 0:x.value)||h.message,$sentry_exception_type:(_=P[0])==null?void 0:_.type,$sentry_tags:h.tags};return r&&s&&(k.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),d&&((E=t.exceptions)==null||E.sendExceptionEvent(k)),h}}class FD{constructor(e,n,r,s,i,a){this.name=oP,this.setupOnce=function(u){u(aP(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class GE{constructor(e){this.rr=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(xe.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.rr)}destroy(){var e;(e=this.sr)==null||e.call(this),this.sr=void 0}doPageView(e,n){var r,s=this.ar(e,n);return this.ir={pathname:(r=ne==null?void 0:ne.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.ar(e,(n=this.ir)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ir)==null?void 0:e.pageViewId}}ar(e,n){var r=this.ir;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var a=i.maxScrollHeight,u=i.lastScrollY,c=i.maxScrollY,d=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(ge(a)||ge(u)||ge(c)||ge(d)||ge(h)||ge(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d),h=Math.ceil(h),p=Math.ceil(p);var m=a>1?hi(u/a,0,1,xe):1,y=a>1?hi(c/a,0,1,xe):1,x=d>1?hi(h/d,0,1,xe):1,_=d>1?hi(p/d,0,1,xe):1;s=At(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Pv=["flags","surveys"],VD={[L6]:{exposure:"hidden"},[pd]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[md]:{exposure:"hidden"},[vy]:{exposure:"event"},[yy]:{exposure:"hidden"},[_y]:{exposure:"event"},[xy]:{exposure:"hidden"},[wy]:{exposure:"event"},[by]:{exposure:"event"},[P2]:{exposure:"event"},[T2]:{exposure:"hidden"},[Sy]:{exposure:"event"},[rl]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[_u]:{exposure:"hidden"},[R2]:{exposure:"event"},[D6]:{exposure:"event",shouldSkipFromEventProperties:t=>fr(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[el]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Dt(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[Ep]:{exposure:"event",storageGroup:"flags"},[gd]:{exposure:"hidden"},[Ey]:{exposure:"hidden",storageGroup:"flags"},[Cp]:{exposure:"event",storageGroup:"flags"},[Cy]:{exposure:"event",storageGroup:"flags",volatile:!0},[cm]:{exposure:"hidden",storageGroup:"flags"},[zi]:{exposure:"event"},[pu]:{exposure:"hidden"},[Za]:{exposure:"hidden"},[Ya]:{exposure:"hidden"},[ky]:{exposure:"hidden",storageGroup:"surveys"},[dm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Py]:{exposure:"event"},[kp]:{exposure:"hidden"},[vd]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Sd]:{exposure:"hidden"},[Ty]:{exposure:"hidden"},[Ry]:{exposure:"hidden"},[Hd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Vs]:{exposure:"hidden"},[Ay]:{exposure:"hidden"},[Iy]:{exposure:"hidden"},[My]:{exposure:"hidden"},[Oy]:{exposure:"hidden"},[fm]:{exposure:"hidden"},[hm]:{exposure:"hidden"},[N6]:{exposure:"event"},[j6]:{exposure:"event"},[F6]:{exposure:"event"},[V6]:{exposure:"event"},[H6]:{exposure:"event"},[z6]:{exposure:"event"},[U6]:{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"}},$D=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ja=t=>{var e=VD[t];if(e)return e;for(var n of $D){var r=n[1];if(t.indexOf(n[0])===0)return r}},xu=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return r6(t)}},Ud=t=>{var e=ke==null?void 0:ke.createElement("a");return ge(e)?null:(e.href=t,e)},Qu=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!nt(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{xe.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Bd=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),a=i[1],u=i[0],c=(a||"").split("&"),d=[],h=0;c.length>h;h++){var p=c[h].split("=");nt(p)&&(e.includes(p[0])?d.push(p[0]+"="+n):d.push(c[h]))}var m=u;return a!=null&&(m+="?"+d.join("&")),s!=null&&(m+="#"+s),m},ym=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},lP=(t,e)=>t>=e&&e6(),uP=(t,e,n,r)=>{if(t===0){if(e6()){var s=e+1;return s===n&&r(),s}return e}return 0},Xh="https?://(.*)",Ju=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],HD=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ju],Wd="<masked>",zD=["li_fat_id"];function cP(t,e,n){if(!ke)return{};var r,s=e?[...Ju,...n||[]]:[],i=dP(Bd(ke.URL,s,Wd),t),a=(r={},bt(zD,(function(u){var c=W6(u);r[u]=c||null})),r);return At(a,i)}function dP(t,e){var n=HD.concat(e||[]),r={};return bt(n,(function(s){var i=Qu(t,s);r[s]=i||null})),r}function fP(t){var e=(function(i){return i?i.search(Xh+"google.([^/?]*)")===0?"google":i.search(Xh+"bing.com")===0?"bing":i.search(Xh+"yahoo.com")===0?"yahoo":i.search(Xh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!fr(e)){r.$search_engine=e;var s=ke?Qu(ke.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function KE(){return navigator.language||navigator.userLanguage}var _m="$direct";function hP(){return(ke==null?void 0:ke.referrer)||_m}function pP(t,e,n){n===void 0&&(n=!1);var r=t?[...Ju,...e||[]]:[],s=n?ra(on==null?void 0:on.href):on==null?void 0:on.href,i=s==null?void 0:s.substring(0,1e3);return{r:hP().substring(0,1e3),u:i?Bd(i,r,Wd):void 0}}function mP(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?ra(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==_m?_m:(n=Ud(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=Ud(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=dP(i);At(a,c)}if(r){var d=fP(r);At(a,d)}return a}function gP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function UD(){try{return new Date().getTimezoneOffset()}catch{return}}var BD={flags:Hd,surveys:dm},WD=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],iu="main";class Tv{constructor(e,n,r){if(r===void 0&&(r=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=r,this.props={},this.cr=!1,this.vr=(i=>{var a="";return i.token&&(a=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+a+"_posthog"})(e),this.Je=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&xe.info("Persistence loaded",e.persistence,de({},this.props)),this.update_config(e,e,n),this.save(),ne){var s=()=>this.flush();zt(ne,"beforeunload",s,{capture:!1}),zt(ne,"pagehide",s,{capture:!1})}}mr(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Hn(n)&&n>0?n:0}isDisabled(){return!!this.yr}pr(e){WD.indexOf(e.persistence.toLowerCase())===-1&&(xe.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(a,u){a===void 0&&(a=[]),u===void 0&&(u=!1);var c=[...bD,...a];return de({},Et,{F(d){try{var h={};try{h=Qi.F(d)||{}}catch{}var p,m=JSON.parse(Et.A(d)||"{}");if(u){var y={};for(var x in h){var _=h[x];fr(_)||_===""||(y[x]=_)}p=At(m,y)}else p=At(h,m);return Et.q(d,p),p}catch{}return null},q(d,h,p,m,y,x){var _=Et.q(d,h,void 0,void 0,x);try{var w={};c.forEach((E=>{h[E]&&(w[E]=h[E])})),Object.keys(w).length&&Qi.q(d,w,p,m,y,x)}catch(E){Et.D(E)}return _},P(d,h){try{ne==null||ne.localStorage.removeItem(d),Qi.P(d,h)}catch(p){Et.D(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&Et.N()?(n=Et,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&Fn.N()?n=Fn:i==="memory"?n=SD:i==="cookie"?n=Qi:r.N()?(n=r,s=!0):n=Qi,this.ur=s,n}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var n=e??this.Te.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[Hd];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return bt(this.props,((n,r)=>{var s=ja(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===el?()=>this._r():()=>!1))return;s.transformToEventProperties&&At(e,s.transformToEventProperties(n))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,(()=>!1)))return;e[r]=n}})),e}load(){if(!this.yr){var e=this.Je.F(this.vr);e&&(this.props=At({},e)),this.hr&&this.wr()}}wr(){for(var e of Pv){var n=Et.F(this.br(e));if(n&&!Ko(n)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(n,e)),this.Ir(e,n)||At(this.props,n)}}}Sr(e){return Object.keys(this.props).some((n=>{var r;return((r=ja(n))==null?void 0:r.storageGroup)===e}))}Ir(e,n){var r=BD[e];if(!r)return!1;var s=n[r],i=this.props[r];return Hn(s)&&Hn(i)&&i>s}refreshKey(e){var n;if(!this.yr){var r=this.hr?(n=ja(e))==null?void 0:n.storageGroup:void 0,s=r?Et.F(this.br(r)):this.Je.F(this.vr);if(s&&e in s)this.Tr(e,s[e]);else{if(r){var i=this.Je.F(this.vr);if(i&&e in i)return void this.Tr(e,i[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?ge(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){ge(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Je,this.vr,this.props,iu))}Pr(){var e=this.Fr(),n=e.main,r=e.groups;for(var s of(this.Or(this.Je,this.vr,n,iu),Pv)){var i,a=r[s];(!Ko(a)||(i=this.lr[s])!=null&&i.persisted)&&this.Or(Et,this.br(s),a,s)}}Fr(){var e={},n={flags:{},surveys:{}};return bt(this.props,((r,s)=>{var i,a=(i=ja(s))==null?void 0:i.storageGroup;a?n[a][s]=r:e[s]=r})),{main:e,groups:n}}Cr(e,n){if(n===iu)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return bt(e,((s,i)=>{var a;r[i]=(a=ja(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}Or(e,n,r,s){var i=this.kr(s);if(s===iu||i.dirty||ge(i.fingerprint)){var a;try{if((a=this.Cr(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(n,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(i.dirty=!1,s!==iu&&(i.persisted=!0),ge(a)||(i.fingerprint=a)):this.Te.debug&&xe.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(ge(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Je.P(this.vr,!1),this.Je.P(this.vr,!0),!r&&this.dr)for(var s of Pv)Et.P(this.br(s));r?delete this.lr[iu]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Dt(e)){ge(n)&&(n="None"),this.Lr=ge(r)?this.Nr:r;var s=!1;if(bt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.Tr(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(Dt(e)){this.Lr=ge(n)?this.Nr:n;var r=!1;if(bt(e,((s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.Tr(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=cP(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Ko(I2(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=ke==null?void 0:ke.referrer)?fP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:hP(),$referring_domain:ke!=null&&ke.referrer&&((e=Ud(ke.referrer))==null?void 0:e.host)||_m},void 0)}set_initial_person_info(){this.props[My]||this.props[Oy]||this.register_once({[fm]:pP(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};bt([Oy,My],(s=>{var i=this.props[s];i&&bt(i,(function(a,u){e["$initial_"+cy(u)]=a}))}));var n=this.props[fm];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=mP(s,i),u={};return bt(a,(function(c,d){u["$initial_"+cy(d)]=c})),u})(n,this.Te.disable_capture_url_hashes);At(e,r)}return e}safe_merge(e){return bt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){this.Nr=this.Lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((c,d)=>{if(c.length!==d.length)return!1;var h=[...c].sort(),p=[...d].sort();return h.every(((m,y)=>m===p[y]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),i=s?this.pr(e):this.Je,a=this.gr(e);if(s||a!==this.hr){var u=this.props;this.clear(),this.Je=i,this.hr=a,this.props=u,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[md]||{};r[e]=n,this.Tr(md,r),this.save()}remove_event_timer(e){var n=this.props[md]||{},r=n[e];return ge(r)||(delete n[e],this.Tr(md,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Tr(e,n),this.save()}Tr(e,n){var r;this.props[e]=n,(r=ja(e))!=null&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var n,r=(n=ja(e))==null?void 0:n.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var Jc={Activation:"events",Cancellation:"cancelEvents"},Rv={Popover:"popover",API:"api",Widget:"widget"},Ji={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Av={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},jy={Popover:"popover",Inline:"inline"},GD={SHOWN:"product tour shown"},qE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},ZE=Vt("[RateLimiter]");class KD{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{ZE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void ZE.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var i=this.captureEventsBurstLimit,a=this.captureEventsPerSecond,u=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Iy))!==null&&n!==void 0?n:{tokens:i,last:u};c.tokens+=(u-c.last)/1e3*a,c.last=u,c.tokens>i&&(c.tokens=i);var d=1>c.tokens;return d||e||(c.tokens=Math.max(0,c.tokens-1)),!d||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=d,(s=this.instance.persistence)==null||s.set_property(Iy,c),{isRateLimited:d,remainingTokens:c.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var ed=Vt("[RemoteConfig]");class vP{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=He._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}qr(e){var n,r;(n=He.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=He.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}jr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){e(n.json)}})}load(){try{if(this.remoteConfig)return ed.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void ed.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return ed.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((n=>{this.Hr(n),this.Br()}));this.Hr(e),this.Br()}))}catch(e){ed.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&ke&&ke.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.zr=setInterval((()=>{this.refresh()}),n))}}Hr(e){var n;e||ed.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var ar={GZipJS:"gzip-js",Base64:"base64"},Es=Uint8Array,Rr=Uint16Array,ec=Uint32Array,D2=new Es([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),N2=new Es([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),YE=new Es([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yP=function(t,e){for(var n=new Rr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new ec(n[30]);for(r=1;30>r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},_P=yP(D2,2),Fy=_P[1];_P[0][28]=258,Fy[258]=28;for(var XE=yP(N2,0)[1],xP=new Rr(32768),jt=0;32768>jt;++jt){var ou=(43690&jt)>>>1|(21845&jt)<<1;xP[jt]=((65280&(ou=(61680&(ou=(52428&ou)>>>2|(13107&ou)<<2))>>>4|(3855&ou)<<4))>>>8|(255&ou)<<8)>>>1}var Cd=function(t,e,n){for(var r=t.length,s=0,i=new Rr(e);r>s;++s)++i[t[s]-1];var a,u=new Rr(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new Rr(r),s=0;r>s;++s)a[s]=xP[u[t[s]-1]++]>>>15-t[s];return a},El=new Es(288);for(jt=0;144>jt;++jt)El[jt]=8;for(jt=144;256>jt;++jt)El[jt]=9;for(jt=256;280>jt;++jt)El[jt]=7;for(jt=280;288>jt;++jt)El[jt]=8;var xm=new Es(32);for(jt=0;32>jt;++jt)xm[jt]=5;var qD=Cd(El,9),ZD=Cd(xm,5),wP=function(t){return(t/8>>0)+(7&t&&1)},bP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Rr?Rr:t instanceof ec?ec:Es)(n-e);return r.set(t.subarray(e,n)),r},Oi=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},td=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Iv=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new Es(0),0];if(s==1){var a=new Es(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(R,L){return R.f-L.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],d=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=s-1;)u=n[n[p].f>n[d].f?d++:p++],c=n[d!=h&&n[p].f>n[d].f?d++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var y=new Rr(m+1),x=Vy(n[h-1],y,0);if(x>e){r=0;var _=0,w=x-e,E=1<<w;for(i.sort((function(R,L){return y[L.s]-y[R.s]||R.f-L.f}));s>r;++r){var P=i[r].s;if(e>=y[P])break;_+=E-(1<<x-y[P]),y[P]=e}for(_>>>=w;_>0;){var T=i[r].s;e>y[T]?_-=1<<e-y[T]++-1:++r}for(;r>=0&&_;--r){var k=i[r].s;y[k]==e&&(--y[k],++_)}x=e}return[new Es(y),x]},Vy=function(t,e,n){return t.s==-1?Math.max(Vy(t.l,e,n+1),Vy(t.r,e,n+1)):e[t.s]=n},QE=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Rr(++e),r=0,s=t[0],i=1,a=function(c){n[r++]=c},u=1;e>=u;++u)if(t[u]==s&&u!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(s),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(s);i=1,s=t[u]}return[n.subarray(0,r),e]},nd=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},$y=function(t,e,n){var r=n.length,s=wP(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},JE=function(t,e,n,r,s,i,a,u,c,d,h){Oi(e,h++,n),++s[256];for(var p=Iv(s,15),m=p[0],y=p[1],x=Iv(i,15),_=x[0],w=x[1],E=QE(m),P=E[0],T=E[1],k=QE(_),R=k[0],L=k[1],O=new Rr(19),A=0;P.length>A;++A)O[31&P[A]]++;for(A=0;R.length>A;++A)O[31&R[A]]++;for(var M=Iv(O,7),D=M[0],F=M[1],N=19;N>4&&!D[YE[N-1]];--N);var G,Z,Y,B,K=d+5<<3,$=nd(s,El)+nd(i,xm)+a,J=nd(s,m)+nd(i,_)+a+14+3*N+nd(O,D)+(2*O[16]+3*O[17]+7*O[18]);if($>=K&&J>=K)return $y(e,h,t.subarray(c,c+d));if(Oi(e,h,1+($>J)),h+=2,$>J){G=Cd(m,y),Z=m,Y=Cd(_,w),B=_;var H=Cd(D,F);for(Oi(e,h,T-257),Oi(e,h+5,L-1),Oi(e,h+10,N-4),h+=14,A=0;N>A;++A)Oi(e,h+3*A,D[YE[A]]);h+=3*N;for(var j=[P,R],X=0;2>X;++X){var te=j[X];for(A=0;te.length>A;++A)Oi(e,h,H[ie=31&te[A]]),h+=D[ie],ie>15&&(Oi(e,h,te[A]>>>5&127),h+=te[A]>>>12)}}else G=qD,Z=El,Y=ZD,B=xm;for(A=0;u>A;++A)if(r[A]>255){var ie;td(e,h,G[257+(ie=r[A]>>>18&31)]),h+=Z[ie+257],ie>7&&(Oi(e,h,r[A]>>>23&31),h+=D2[ie]);var ae=31&r[A];td(e,h,Y[ae]),h+=B[ae],ae>3&&(td(e,h,r[A]>>>5&8191),h+=N2[ae])}else td(e,h,G[r[A]]),h+=Z[r[A]];return td(e,h,G[256]),h+Z[256]},YD=new ec([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),XD=(function(){for(var t=new ec(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Mv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function QD(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var y=p,x=0;m.length>x;++x)y=XD[255&y^m[x]]^y>>>8;p=y},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,u,c,d=(u=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(p,m,y,x,_,w){var E=p.length,P=new Es(x+E+5*(1+Math.floor(E/7e3))+_),T=P.subarray(x,P.length-_),k=0;if(!m||8>E)for(var R=0;E>=R;R+=65535){var L=R+65535;E>L?k=$y(T,k,p.subarray(R,L)):(T[R]=!0,k=$y(T,k,p.subarray(R,E)))}else{for(var O=YD[m-1],A=O>>>13,M=8191&O,D=(1<<y)-1,F=new Rr(32768),N=new Rr(D+1),G=Math.ceil(y/3),Z=2*G,Y=function(at){return(p[at]^p[at+1]<<G^p[at+2]<<Z)&D},B=new ec(25e3),K=new Rr(288),$=new Rr(32),J=0,H=0,j=(R=0,0),X=0,te=0;E>R;++R){var ie=Y(R),ae=32767&R,ue=N[ie];if(F[ae]=ue,N[ie]=ae,R>=X){var Se=E-R;if((J>7e3||j>24576)&&Se>423){k=JE(p,T,0,B,K,$,H,j,te,R-te,k),j=J=H=0,te=R;for(var oe=0;286>oe;++oe)K[oe]=0;for(oe=0;30>oe;++oe)$[oe]=0}var se=2,ye=0,be=M,Fe=ae-ue&32767;if(Se>2&&ie==Y(R-Fe))for(var Re=Math.min(A,Se)-1,We=Math.min(32767,R),Tt=Math.min(258,Se);We>=Fe&&--be&&ae!=ue;){if(p[R+se]==p[R+se-Fe]){for(var Ye=0;Tt>Ye&&p[R+Ye]==p[R+Ye-Fe];++Ye);if(Ye>se){if(se=Ye,ye=Fe,Ye>Re)break;var we=Math.min(Fe,Ye-2),It=0;for(oe=0;we>oe;++oe){var Ee=R-Fe+oe+32768&32767,Xe=Ee-F[Ee]+32768&32767;Xe>It&&(It=Xe,ue=Ee)}}}Fe+=(ae=ue)-(ue=F[ae])+32768&32767}if(ye){B[j++]=268435456|Fy[se]<<18|XE[ye];var vt=31&Fy[se],Ge=31&XE[ye];H+=D2[vt]+N2[Ge],++K[257+vt],++$[Ge],X=R+se,++J}else B[j++]=p[R],++K[p[R]]}}k=JE(p,T,!0,B,K,$,H,j,te,R-te,k)}return bP(P,0,x+wP(k)+_)})(i=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,u,c)),h=d.length;return(function(p,m){var y=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&Mv(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),y){p[3]=8;for(var x=0;y.length>=x;++x)p[x+10]=y.charCodeAt(x)}})(d,e),Mv(d,h-8,n.d()),Mv(d,h-4,r),d}var JD=!!ay||!!w2,SP="text/plain",Tp=!1,Hy=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],a=s[1];if(!a)return t;var u=a.split("&").filter((c=>c.split("=")[0]!==e)).join("&");return i+(u?"?"+u:"")+(r?"#"+r:"")},j2=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],u=de({},e),c=(r=a==null?void 0:a.split("&").map((h=>{var p,m=h.split("="),y=m[0],x=n&&(p=u[y])!==null&&p!==void 0?p:m[1];return delete u[y],y+"="+x})))!==null&&r!==void 0?r:[],d=(function(h,p){var m,y;p===void 0&&(p="&");var x=[];return bt(h,(function(_,w){ge(_)||ge(w)||w==="undefined"||(m=encodeURIComponent((E=>E instanceof File)(_)?_.name:_.toString()),y=encodeURIComponent(w),x[x.length]=y+"="+m)})),x.join(p)})(u);return d&&c.push(d),c.length>0?i+"?"+c.join("&"):i},Ov=t=>{if(t.Vr)return t.Vr;var e=t.data,n=t.compression;if(e){if(n===ar.GZipJS){var r=QD((function(u,c){var d=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var h=new Es(u.length+(u.length>>>1)),p=0,m=function(w){h[p++]=w},y=0;d>y;++y){if(p+5>h.length){var x=new Es(p+8+(d-y<<1));x.set(h),h=x}var _=u.charCodeAt(y);128>_?m(_):2048>_?(m(192|_>>>6),m(128|63&_)):_>55295&&57344>_?(m(240|(_=65536+(1047552&_)|1023&u.charCodeAt(++y))>>>18),m(128|_>>>12&63),m(128|_>>>6&63),m(128|63&_)):(m(224|_>>>12),m(128|_>>>6&63),m(128|63&_))}return bP(h,0,p)})(xu(e)),{mtime:0});return{contentType:SP,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===ar.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,d)=>String.fromCharCode(parseInt(d,16)))))})(xu(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:xu(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=xu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},EP=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:j2(t.url,{compression:ar.Base64}),encodedBody:Ov(de({},t,{compression:ar.Base64,Vr:void 0}))}:{url:Hy(t.url,"compression"),encodedBody:Ov(de({},t,{compression:void 0,Vr:void 0}))};try{e=Ov(t)}catch(s){if(SE(t.compression,Qu(t.url,"compression")))return xe.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&SE(t.compression,Qu(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?ly(new Uint8Array(n)):ArrayBuffer.isView(n)&&ly(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Tp=!0,r()):{url:t.url,encodedBody:e}},CP=t=>{try{return EP(t)}catch(e){return xe.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},eN=(function(){var t=tn((function*(e){var n=xu(e.data),r=yield(function(i,a,u){return uy.apply(this,arguments)})(n,xt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return de({},e,{Vr:{contentType:SP,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),tN=/Failed to fetch|NetworkError|Load failed/i,kP=t=>{var e=CP(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,a=s.body,u=s.estimatedSize,c=new Headers;bt(t.headers,(function(x,_){c.append(_,x)})),i&&c.append("Content-Type",i);var d=null,h=!1;if(gE){var p=new gE;d={signal:p.signal,timeout:setTimeout((()=>{var x,_;h=!0,p.abort((x=t.timeout,(_=new Error("PostHog request timed out"+(x?" after "+x+"ms":""))).name="AbortError",_))}),t.timeout)}}var m=x=>{h&&(x==null?void 0:x.name)==="AbortError"||(_=>(_==null?void 0:_.name)==="TypeError"&&tN.test((_==null?void 0:_.message)||""))(x)?xe.warn(x):xe.error(x),t.callback==null||t.callback({statusCode:0,error:x})};try{var y;w2(n,de({method:(t==null?void 0:t.method)||"GET",headers:c,keepalive:t.method==="POST"&&!t.Wr&&52428.8>(u||0),body:a,signal:(y=d)==null?void 0:y.signal},t.fetchOptions)).then((x=>x.text().then((_=>{var w={statusCode:x.status,text:_};if(x.status===200)try{w.json=JSON.parse(_)}catch(E){xe.error(E)}t.callback==null||t.callback(w)})))).catch(m).finally((()=>d?clearTimeout(d.timeout):null))}catch(x){d&&clearTimeout(d.timeout),m(x)}}},zy=t=>{try{var e=EP(t),n=e.url,r=e.encodedBody,s=r??{},i=s.body,a=s.estimatedSize;if(!i)return;var u=i instanceof Blob?i:new Blob([i],{type:s.contentType});if(lr.sendBeacon(n,u))return;if(nt(t.data)&&t.data.length>1&&(a??0)>16384){var c=Math.ceil(t.data.length/2);return zy(de({},t,{data:t.data.slice(0,c)})),void zy(de({},t,{data:t.data.slice(c)}))}xe.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),kP(de({},t,{Wr:!0}))}catch(d){xe.warn("Beacon send failed",d)}},nN=["/e/","/s/"],eC=(t,e,n,r)=>{var s=(u=>{var c=(d=>{var h=Ud(d),p=(h==null?void 0:h.pathname)||d.split(/[?#]/)[0];return p?p[0]==="/"?p:"/"+p:"/"})(u);return nN.some((d=>((h,p)=>h.slice(h.length-p.length)===p)(c,d)))})(t),i=s?Hy(t,"ver"):t,a=r==="query"?e==="POST"?"sent_at":"_":void 0;return j2(n===ar.GZipJS?Hy(i,"compression"):i,de({},a?{[a]:Date.now().toString()}:{},s?{}:{ver:xt.JS_SDK_VERSION},n===ar.GZipJS?{}:{compression:n}))},Rp=[];w2&&Rp.push({transport:"fetch",method:kP}),ay&&Rp.push({transport:"XHR",method(t){var e=CP(t);if(e){var n=new ay,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;bt(t.headers,(function(u,c){n.setRequestHeader(c,u)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(u)}},n.send(a)}}}),lr!=null&&lr.sendBeacon&&Rp.push({transport:"sendBeacon",method:zy});var Uy=3e3;class rN{constructor(e,n){this.Zr=!0,this.Gr=[],this.Qr=hi((n==null?void 0:n.flush_interval_ms)||Uy,250,5e3,xe.createLogger("flush interval"),Uy),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ti():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ei(de({},r,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var n=this.ti(),r=function(){var i=n[s],a=new Date().getTime();i.data&&nt(i.data)&&bt(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.ei(i)};for(var s in n)r()}}),this.Qr))}ei(e){try{this.Jr(e)}catch(n){xe.error(n)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var e={};return bt(this.Gr,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;ge(e[i])&&(e[i]=de({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Gr=[],e}}var sN=["retriesPerformedSoFar"];class iN{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!ge(ne)&&"onLine"in ne.navigator&&(this.ni=ne.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},zt(ne,"online",this.si),zt(ne,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=t6(e,sN);Hi(n)&&(r.url=j2(r.url,{retry_count:n})),this._instance._send_request(de({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ot(de({retriesPerformedSoFar:n},r));s.statusCode===0&&xe.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(s)}}))}Ot(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var u=3e3*Math.pow(2,a),c=u/2,d=Math.min(18e5,u),h=Math.random()-.5;return Math.ceil(d+h*(d-c))})(n),s=Date.now()+r;this.Gr.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),xe.warn(i),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),this.Gr.length===0)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var e=Date.now(),n=[],r=this.Gr.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.Gr=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,ge(ne)||(this.si&&(ne.removeEventListener("online",this.si),this.si=void 0),this.ai&&(ne.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var n=e.requestOptions;try{this._instance._send_request(de({},n,{transport:"sendBeacon"}))}catch(r){xe.error(r)}}this.Gr=[]}}class oN{constructor(e){this.hi=()=>{var n,r,s,i;this.di||(this.di={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=u+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.di.lastScrollY=Math.ceil(u),this.di.maxScrollY=Math.max(u,(n=this.di.maxScrollY)!==null&&n!==void 0?n:0),this.di.maxScrollHeight=Math.max(c,(r=this.di.maxScrollHeight)!==null&&r!==void 0?r:0),this.di.lastContentY=d,this.di.maxContentY=Math.max(d,(s=this.di.maxContentY)!==null&&s!==void 0?s:0),this.di.maxContentHeight=Math.max(h,(i=this.di.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){zt(ne,"scroll",this.hi,{capture:!0}),zt(ne,"scrollend",this.hi,{capture:!0}),zt(ne,"resize",this.hi)}scrollElement(){if(!this.ci)return ne==null?void 0:ne.document.documentElement;var e=nt(this.ci)?this.ci:[this.ci];for(var n of e){var r=ne==null?void 0:ne.document.querySelector(n);if(r)return r}}vi(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[n]||0}return ne?e==="y"?ne.scrollY||ne.pageYOffset||ne.document.documentElement.scrollTop||0:ne.scrollX||ne.pageXOffset||ne.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var aN=t=>pP(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);class tC{constructor(e,n,r,s){this.fi=i=>{var a=this.pi();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.gi(this._instance)};this.mi.register({[Ay]:u})}},this._instance=e,this.yi=n,this.mi=r,this.gi=s||aN,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Ay]}getSetOnceProps(){var e,n=(e=this.pi())==null?void 0:e.props;return n?"r"in n?mP(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return bt(I2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+cy(r)]=n})),e}}class F2{on(e,n){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(n),()=>{this.bi[e]=this.bi[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.bi[e]||[])r(n);for(var s of this.bi["*"]||[])s(e,n)}constructor(){this.bi={}}}var rd=Vt("[SessionId]");class nC{on(e,n){return this.wi.on(e,n)}constructor(e,n,r){var s;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new F2,this.Ii=(d,h)=>!(!Hi(d)||!Hi(h))&&Math.abs(d-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Xi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ti=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=n||Ki,this.Ri=r||Ki;var i=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*hi(this.Te.session_idle_timeout_seconds||1800,60,36e3,rd.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+i+"_window_id",this.Fi="ph_"+i+"_primary_window_exists",this.Li()){var a=Fn.F(this.Oi),u=Fn.F(this.Fi);a&&!u?this.Ti=a:Fn.P(this.Oi),Fn.q(this.Fi,!0)}if((s=this.Te.bootstrap)!=null&&s.sessionID)try{var c=(d=>{var h=this.Te.bootstrap.sessionID.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,new Date().getTime(),c)}catch(d){rd.error("Invalid sessionID in bootstrap",d)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ge(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ti),()=>{this.ki=this.ki.filter((n=>n!==e))}}Li(){return this.Te.persistence!=="memory"&&!this.mi.yr&&Fn.N()}Ni(e){e!==this.Ti&&(this.Ti=e,this.Li()&&Fn.q(this.Oi,e))}Di(){return this.Ti?this.Ti:this.Li()?Fn.F(this.Oi):null}qi(e){var n=this.xi;return!fr(n)&&!fr(e)&&5e3>Math.abs(e-n)}$i(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Mi=e,i&&!s||i&&this.qi(n)||(this.xi=n,this.mi.register({[_u]:[n,e,r]}))}ji(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Hi(n)&&n>0}Hi(){this.ji()?this.mi.refreshKey(_u):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!fr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var n=this.Ui();n[1]===this.Mi&&n[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[_u]:[this._sessionActivityTimestamp,(e=this.Mi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],n=Hi(e)?e:0,r=Hi(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Vi(e){return this.Hi(),this.Ii(e,this.zi())}Ui(){var e=this.mi.props[_u];return nt(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&ne&&(ne.removeEventListener(mm,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&Fn.P(this.Fi)},zt(ne,mm,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Te.cookieless_mode===Xi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),s=this.Ui(),i=s[1],a=s[2],u=this.zi(),c=this.Di(),d=Hi(a)&&Math.abs(r-a)>864e5,h=!1,p=!1,m=!i,y=i,x=!m&&!e&&this.Ii(r,u);if(x){(x=this.Vi(r))||rd.info("cross-tab refresh kept the session alive",{sessionId:i});var _=this.Ui();i=_[1],a=_[2]}m||x||d?(i=this.Ei(),c=this.Ri(),rd.info("new session ID generated",{sessionId:i,windowId:c,changeReason:{noSessionId:m,activityTimeout:x,sessionPastMaximumLength:d}}),a=r,h=!0):(c||(c=this.Ri(),h=!0),(p=i!==y)&&(rd.info("adopted cross-tab session id",{sessionId:i,windowId:c}),h=!0));var w=Hi(u)&&e&&!d?u:r,E=Hi(a)?a:new Date().getTime();this.Ni(c),this.$i(i,w,E),e||this.Pi();var P={noSessionId:m,activityTimeout:x,sessionPastMaximumLength:d,crossTabAdoption:p};return h&&this.ki.forEach((T=>T(i,c,P))),{sessionId:i,windowId:c,sessionStartTimestamp:E,changeReason:h?P:void 0,lastActivityTimestamp:u}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var PP=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&CE(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>CE(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function TP(){return(TP=tn((function*(){var t=lr==null?void 0:lr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return wt(n)&&n.length>0?n:void 0}catch(r){return void xe.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var wm=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function rC(t,e,n){return xu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var RP={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>wm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!wm(n,r))))),icontains:(t,e)=>e.map(Qh).some((n=>t.map(Qh).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Qh).every((n=>t.map(Qh).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r>parseFloat(s)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r<parseFloat(s)))}))},Qh=t=>t.toLowerCase();function AP(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(ge(s)||fr(s))return!1;var i=[String(s)],a=RP[r.operator];return!!a&&a(r.values,i)}))}var By="custom",sC="i.posthog.com",lN=/^\/static\//;class uN{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+sC,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Zi[this.apiHost]||(this.Zi[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":By),this.Zi[this.apiHost]}Gi(e){if(lN.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(e==="assets"){var r=this.Gi(n);if(r)return""+r+n}if(this.region===By)return this.apiHost+n;var s=sC+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function IP(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var yt=Vt("[Surveys]"),MP="seenSurvey_",OP=t=>{try{var e=(n=>((r,s)=>""+MP+(function(i){return i.current_iteration&&i.current_iteration>0?i.id+"_"+i.current_iteration:i.id})(s))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){yt.error("Failed to persist survey seen state",n)}},cN=[Rv.Popover,Rv.Widget,Rv.API],dN={ignoreConditions:!1,ignoreDelay:!1,displayType:jy.Popover},fN=Vt("[PostHog ExternalIntegrations]"),hN={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class pN{constructor(e){this._instance=e}tr(e,n){var r;(r=He.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return fN.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,u,c=r[0],d=r[1];!d||(i=He.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[c]||e.tr(hN[c],(()=>{var h;(h=He.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[c])==null||h.start(e._instance)})),!d&&(a=He.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[c]&&((u=He.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[c])==null||u.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}var kd={},Lv=0,bm=()=>{},iC='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',sd="Surveys module not available",oC="sanitize_properties is deprecated. Use before_send instead",LP="Invalid value for property_denylist config: ",mN=["token","distinct_id",$6],gu="posthog",DP=!JD&&(Cr==null?void 0:Cr.indexOf("MSIE"))===-1&&(Cr==null?void 0:Cr.indexOf("Mozilla"))===-1,Dv=t=>{var e;return de({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:vD(ke==null?void 0:ke.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:bm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:on&&wt(on==null?void 0:on.search)&&on.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(ne==null||(e=ne.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_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(n){xe.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Ly,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Uy},error_tracking:{},_onCapture:bm},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:RD,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},gN=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],aC=t=>{var e={};for(var n of gN){var r=n[0],s=n[1];ge(t[r])||(e[s]=t[r])}var i=At({},e,t),a=t.__preview_external_dependency_versioned_paths;return ge(a)||(ge(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),wt(a)&&ge(t.asset_host)&&(i.asset_host=a)),nt(t.property_blacklist)&&(ge(t.property_denylist)?i.property_denylist=t.property_blacklist:nt(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:xe.error(LP+t.property_denylist)),i};class vN{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){xe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class _s{Ji(e,n){if(e){var r=this.Ki.indexOf(e);r!==-1&&this.Ki.splice(r,1)}return this.Ki.push(n),n.initialize==null||n.initialize(),n}Yi(){return this.config.cookieless_mode===Xi||this.config.cookieless_mode===Xa&&this.consent.isRejected()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new vN,this.Xi=!1,this.version=xt.LIB_VERSION,this.tn=new F2,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Dv(),this.SentryIntegration=FD,this.sentryIntegration=r=>(function(s,i){var a=aP(s,i);return{name:oP,processEvent:u=>a(u)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.en=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new oN(this),this.pageViewManager=new GE(this),this.rateLimiter=new KD(this),this.requestRouter=new uN(this),this.consent=new ED(this),this.externalIntegrations=new pN(this);var n=(e=_s.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{var a=wt(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=wt(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>xe.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==gu){var s,i=(s=kd[r])!==null&&s!==void 0?s:new _s;return i._init(e,n,r),kd[r]=i,kd[gu][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a=wt(e)?e.trim():"";if(!a)return xe.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=Dv(n.defaults),n.debug=this.an(n.debug),this.ln=n,this.un=[],n.person_profiles?this.nn=n.person_profiles:n.process_person&&(this.nn=n.process_person);var u=Dv(n.defaults),c=aC(n),d=At({},u,c,{name:r,token:a});Dt(u.rageclick)&&Dt(c.rageclick)&&(d.rageclick=At({},u.rageclick,c.rageclick)),Dt(u.session_recording)&&Dt(c.session_recording)&&(d.session_recording=At({},u.session_recording,c.session_recording)),this.set_config(d),this.config.on_xhr_error&&xe.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:ar.GZipJS;var h=this.hn();this.persistence=new Tv(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Tv(de({},this.config,{persistence:"sessionStorage"}),h,!1);var p=de({},this.persistence.props),m=de({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new rN((k=>this.cn(k)),this.config.request_queue_config),this.vn=new iN(this),this.__request_queue=[];var y=this.Yi();if(y||(this.sessionManager=new nC(this),this.sessionPropsManager=new tC(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(xe.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.fn(y)}),0)):(xe.info("Initializing extensions synchronously"),this.fn(y)),xt.DEBUG=xt.DEBUG||this.config.debug,xt.DEBUG&&xe.info("Starting in debug mode",{this:this,config:n,thisC:de({},this.config),p,s:m}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=de({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var x=n.bootstrap.distinctID,_=this.get_distinct_id(),w=this.persistence.get_property(Vs);if(n.bootstrap.isIdentifiedID&&_!=null&&_!==x&&w===ru)this.identify(x);else if(n.bootstrap.isIdentifiedID&&_!=null&&_!==x&&w===su)xe.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 E=this.config.get_device_id(Ki()),P=n.bootstrap.isIdentifiedID?E:x;this.persistence.set_property(Vs,n.bootstrap.isIdentifiedID?su:ru),this.register({distinct_id:x,$device_id:P})}}if(y)this.register_once({distinct_id:Kh,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id(Ki());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(Vs,ru)}return zt(ne,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(k,R){var L=k.config.segment;if(!L)return R();(function(O,A){var M=O.config.segment;if(!M)return A();var D=N=>{var G=()=>N.anonymousId()||Ki();O.config.get_device_id=G,N.id()&&(O.register({distinct_id:N.id(),$device_id:G()}),O.persistence.set_property(Vs,su)),A()},F=M.user();"then"in F&&Us(F.then)?F.then(D):D(F)})(k,(()=>{L.register((O=>{typeof Promise<"u"&&Promise.resolve||kv.warn("This browser does not have Promise support, and can not use the segment integration");var A=(M,D)=>{if(!D)return M;M.event.userId||M.event.anonymousId===O.get_distinct_id()||(kv.info("No userId set, resetting PostHog"),O.reset()),M.event.userId&&M.event.userId!==O.get_distinct_id()&&(kv.info("UserId set, identifying with PostHog"),O.identify(M.event.userId));var F=O.calculateEventProperties(D,M.event.properties);return M.event.properties=Object.assign({},F,M.event.properties),M};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:M=>A(M,M.event.event),page:M=>A(M,mu),identify:M=>A(M,Sv),screen:M=>A(M,"$screen")}})(k)).then((()=>{R()}))}))})(this,(()=>this.pn())):this.pn(),Us(this.config._onCapture)&&this.config._onCapture!==bm&&(xe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(k=>this.config._onCapture(k.event,k)))),this.config.ip&&xe.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return TP.apply(this,arguments)})().then((k=>{k&&this.register({[wv]:k})})).catch(bm),this}fn(e){var n,r,s,i,a,u,c,d,h=performance.now(),p=de({},_s.__defaultExtensionClasses,this.config.__extensionClasses),m=[];p.featureFlags&&this.Ki.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ki.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ki.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ki.push(this.tracingHeaders=new p.tracingHeaders(this)),p.siteApps&&this.Ki.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||m.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ki.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ki.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new p.surveys(this)),p.logs&&this.Ki.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new p.logs(this)),p.metrics&&this.Ki.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new p.metrics(this)),p.conversations&&this.Ki.push(this.conversations=(u=this.conversations)!==null&&u!==void 0?u:new p.conversations(this)),p.productTours&&this.Ki.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ki.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ki.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,jD)),p.toolbar&&this.Ki.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Ki.push(this.experiments=(d=this.experiments)!==null&&d!==void 0?d:new p.experiments(this)),this.Ki.forEach((y=>{y.initialize&&m.push((()=>{y.initialize==null||y.initialize()}))})),m.push((()=>{if(this.gn){var y=this.gn;this.gn=void 0,this.Hr(y)}})),this.mn(m,h)}mn(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.mn(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){xe.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[H6]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[z6]:s}),this.config.__preview_deferred_init_extensions&&xe.info("PostHog extensions initialized ("+s+"ms)")}Hr(e){if(!ke||!ke.body)return xe.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var n,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=qe(r.supportedCompression,ar.GZipJS)?ar.GZipJS:qe(r.supportedCompression,ar.Base64)?ar.Base64:void 0),(n=r.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:Ly}),this.Ki.forEach((s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e)))}pn(){try{this.config.loaded(this)}catch(r){xe.critical("`loaded` function failed",r)}if(this.bn(),this.config.internal_or_test_user_hostname&&on!=null&&on.hostname){var e=on.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new vP(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.dn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&qh(this.__request_queue,(e=>this.cn(e))),this.__request_queue=[],this.bn()}_handle_unload(){var e,n,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(bv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.dn)==null||s.unload(),(i=this.vn)==null||i.unload()):this.xn()&&this.capture(bv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?DP?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=de({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(ge(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,a=de({},n);a.timeout=a.timeout||6e4;var u=(r=a.transport)!==null&&r!==void 0?r:"fetch";u==="sendBeacon"&&ge(a.compression)&&a.data&&(a.compression=ar.Base64),a.timestampMode==="body"&&a.method==="POST"&&a.data&&!nt(a.data)&&(a.data=de({},a.data,{sent_at:new Date().toISOString()})),a.url=eC(a.url,a.method,a.compression,a.timestampMode);var c=Rp.filter((h=>!a.disableTransport||!h.transport||!a.disableTransport.includes(h.transport))),d=(s=(i=(function(h,p){for(var m=0;h.length>m;m++)if(h[m].transport===u)return h[m]})(c))==null?void 0:i.method)!==null&&s!==void 0?s:c[0].method;if(!d)throw new Error("No available transport method");u!=="sendBeacon"&&a.data&&a.compression===ar.GZipJS&&_L&&typeof Promise<"u"&&!Tp?eN(a).then((h=>{d(h)})).catch((h=>{if(EE(h))return Tp=!0,void d(de({},a,{compression:void 0,url:eC(n.url,n.method,void 0,n.timestampMode)}));(p=>{if(!p||typeof p!="object")return!1;var m="name"in p?String(p.name):"";return EE(p)||m===n6})(h)&&(Tp=!0),d(a)})):d(a)})(de({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){Lv++;try{var n,r=[],s=[],i=[];qh(e,(u=>{if(u)if(nt(n=u[0]))i.push(u);else if(Us(u))try{u.call(this)}catch(c){xe.error("Error executing queued PostHog call",u,c)}else nt(u)&&n==="alias"?r.push(u):nt(u)&&n.indexOf("capture")!==-1&&Us(this[n])?i.push(u):s.push(u)}));var a=function(u,c){qh(u,(function(d){try{if(nt(d[0])){var h=c;bt(d,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else c[d[0]].apply(c,d.slice(1))}catch(p){xe.error("Error executing queued PostHog call",d,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Lv--}}push(e){if(Lv>0&&nt(e)&&wt(e[0])){var n=_s.prototype[e[0]];Us(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,i,a,u,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!ge(e)&&wt(e)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var h=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(h==null||!h.isRateLimited){n!=null&&n.$current_url&&!wt(n==null?void 0:n.$current_url)&&(xe.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.kn||xe.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 p=new Date,m=(r==null?void 0:r.timestamp)||p,y=RE(r==null?void 0:r.uuid,Ki),x={uuid:y,event:e,properties:this.calculateEventProperties(e,n||{},m,y)};e===mu&&this.config.__preview_capture_bot_pageviews&&d&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),h&&(x.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var _=e==="$feature_flag_called"&&x.properties.$feature_flag_has_experiment===!1&&this.get_property(cm)===!0;r!=null&&r.$set&&!_&&(x.$set=r==null?void 0:r.$set);var w=r==null?void 0:r.$unset;w&&(x.$unset=w);var E,P,T,k=_?void 0:this.Sn(r==null?void 0:r.$set_once,e!==DE,e===Sv);if(k&&(x.$set_once=k),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=x,u=F=>wt(F)?F.slice(0,i):F,c=new Set,x=(function F(N,G){if(N!==Object(N))return u?u(N):N;if(!c.has(N)){var Z;if(c.add(N),nt(N))Z=[],qh(N,(B=>{Z.push(F(B))}));else{var Y={};bt(N,((B,K)=>{c.has(B)||(Y[K]=F(B))})),Z=Y}return Z}})(a)),x.timestamp=m,ge(r==null?void 0:r.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=p),_&&(x.properties=(function(F,N){N===void 0&&(N=[]);var G={},Z=Y=>{F[Y]!==void 0&&(G[Y]=F[Y])};return xL.forEach(Z),N.forEach(Z),G})(x.properties,mN)),e===Ji.DISMISSED||e===Ji.SENT){var R=n==null?void 0:n[Av.SURVEY_ID],L=n==null?void 0:n[Av.SURVEY_ITERATION];OP({id:R,current_iteration:L}),x.$set=de({},x.$set,{[(E={id:R,current_iteration:L},P=e===Ji.SENT?"responded":"dismissed",T="$survey_"+P+"/"+E.id,E.current_iteration&&E.current_iteration>0&&(T="$survey_"+P+"/"+E.id+"/"+E.current_iteration),T)]:!0})}else e===Ji.SHOWN&&(x.$set=de({},x.$set,{[Av.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===GD.SHOWN){var O=n==null?void 0:n[qE.TOUR_TYPE];O&&(x.$set=de({},x.$set,{[qE.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var A=de({},x.properties.$set,x.$set);if(Ko(A)||this.setPersonPropertiesForFlags(A),!tt(this.config.before_send)){var M=this.Rt(x);if(!M)return;(x=M).uuid=RE(x.uuid,Ki)}this.tn.emit("eventCaptured",x);var D={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:x,compression:"best-available",timestampMode:"query",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.cn(D):this.dn.enqueue(D),x}xe.critical("This capture call is ignored due to client rate limiting.")}}else xe.error("No event name provided to posthog.capture")}else xe.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=i?void 0:this.persistence.remove_event_timer(e),u=de({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Yi()&&(u[$6]=!0),e==="$snapshot"){var c=de({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!wt(u.distinct_id)&&!Hn(u.distinct_id)||dy(u.distinct_id))&&xe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,h=(function(T,k,R,L){var O,A,M,D;if(L===void 0&&(L=!1),!Cr)return{};var F,N=T?[...Ju,...k||[]]:[],G=(function(Re){for(var We=0;PE.length>We;We++){var Tt=PE[We],Ye=Tt[1],we=Tt[0].exec(Re),It=we&&(Us(Ye)?Ye(we,Re):Ye);if(It)return It}return["",""]})(Cr),Z=G[0],Y=G[1],B=(F=typeof navigator<"u"?navigator:void 0)!=null&&F.brave?{brave:!0}:{},K={};ge(R)||(K.detectGoogleSearchApp=R);var $={},J=(O=navigator)==null||(O=O.userAgentData)==null?void 0:O.platform,H=(A=navigator)==null?void 0:A.maxTouchPoints,j=ne==null||(M=ne.screen)==null?void 0:M.width,X=ne==null||(D=ne.screen)==null?void 0:D.height,te=ne==null?void 0:ne.devicePixelRatio;ge(J)||($.userAgentDataPlatform=J),ge(H)||($.maxTouchPoints=H),ge(j)||($.screenWidth=j),ge(X)||($.screenHeight=X),ge(te)||($.devicePixelRatio=te);var ie,ae,ue,Se,oe,se,ye,be,Fe=At(I2({$os:Z,$os_version:Y,$browser:k6(Cr,navigator.vendor,B,K),$device:TE(Cr),$device_type:(ae=Cr,ue=$,be=TE(ae),be===l6||be===a6||be==="Kobo"||be==="Kindle Fire"||be===w6?Zu:be===Vd||be===Pu||be===$d||be===hy?"Console":be===c6?"Wearable":be?Qr:(ue==null?void 0:ue.userAgentDataPlatform)==="Android"&&((Se=ue==null?void 0:ue.maxTouchPoints)!==null&&Se!==void 0?Se:0)>0?600>Math.min((oe=ue==null?void 0:ue.screenWidth)!==null&&oe!==void 0?oe:0,(se=ue==null?void 0:ue.screenHeight)!==null&&se!==void 0?se:0)/((ye=ue==null?void 0:ue.devicePixelRatio)!==null&&ye!==void 0?ye:1)?Qr:Zu:"Desktop"),$timezone:gP(),$timezone_offset:UD()}),{$current_url:Bd(L?ra(on==null?void 0:on.href):on==null?void 0:on.href,N,Wd),$host:on==null?void 0:on.host,$pathname:on==null?void 0:on.pathname,$raw_user_agent:Cr.length>1e3?Cr.substring(0,997)+"...":Cr,$browser_version:VL(Cr,navigator.vendor,B,K),$browser_language:KE(),$browser_language_prefix:(ie=KE(),typeof ie=="string"?ie.split("-")[0]:void 0),$screen_height:ne==null?void 0:ne.screen.height,$screen_width:ne==null?void 0:ne.screen.width,$viewport_height:ne==null?void 0:ne.innerHeight,$viewport_width:ne==null?void 0:ne.innerWidth,$lib:xt.LIB_NAME,$lib_version:xt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return xt.SDK_DIST_CHANNEL&&(Fe.$sdk_dist_channel=xt.SDK_DIST_CHANNEL),Fe})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var p=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime()),m=p.windowId;u.$session_id=p.sessionId,u.$window_id=m}this.sessionPropsManager&&At(u,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&At(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(y=this.vn)==null?void 0:y.length}catch(T){u.$sdk_debug_error_capturing_properties=String(T)}if(this.requestRouter.region===By&&(u.$lib_custom_api_host=this.config.api_host),d=e!==mu||i?e!==bv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=At(u,d),e===mu&&ke&&(u.title=ke.title),!ge(a)){var x=r.getTime()-a;u.$duration=parseFloat((x/1e3).toFixed(3))}Cr&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),w=this.sessionPersistence.properties();bt(["$referrer","$referring_domain"],(T=>{T in _&&delete w[T]})),(u=At({},h,_,w,u)).$is_identified=this._isIdentified(),nt(this.config.property_denylist)?bt(this.config.property_denylist,(function(T){delete u[T]})):xe.error(LP+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(xe.error(oC),u=E(u,e));var P=this.Cn();return u.$process_person_profile=P,P&&!i&&this.In("_calculate_event_properties"),u}Sn(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.Cn()||this.Xi&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),u=At({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(xe.error(oC),u=c(u,"$set_once")),n&&(this.Xi=!0),Ko(u)?void 0:u}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Tn(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.tn.on(e,n)}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:sd}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:sd})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:sd})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=dN),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:sd}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:sd})}Mn(e){return!e||dy(e)?(xe.critical("Unique user id has not been set in posthog.identify"),!1):e===Kh?(xe.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())||(xe.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,n,r){if(!this.__loaded||!this.persistence)return xe.uninitializedWarning("posthog.identify");if(Hn(e)&&(e=e.toString(),xe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.In("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(um)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(pd)&&(this.unregister(pd),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Vs)||ru)===ru;e!==s&&a?(this.persistence.set_property(Vs,su),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(Sv,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.sn=rC(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(Sd))}}setPersonProperties(e,n){if((e||n)&&this.In("posthog.setPersonProperties")){var r=rC(this.get_distinct_id(),e,n);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.sn=r):xe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(nt(e)?e:[e]).filter((s=>wt(s)&&s.length>0));r.length!==0&&this.In("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),i=s[e]!==n;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:de({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(DE,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else xe.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.In("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,i,a,u,c,d,h,p;if(xe.info("reset"),!this.__loaded)return xe.uninitializedWarning("posthog.reset");var m,y=this.get_property(um),x=this.get_property(wv),_=this.get_property(rl);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),ge(_)||(m=this.persistence)==null||m.register({[rl]:_}),(s=this.surveys)==null||s.reset(),(i=this.wn)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(u=this.conversations)==null||u.reset(),(c=this.logs)==null||c.reset(),(d=this.metrics)==null||d.reset(),(h=this.persistence)==null||h.set_property(Vs,ru),(p=this.sessionManager)==null||p.resetSessionId(),this.sn=null,this.config.cookieless_mode===Xi)this.register_once({distinct_id:Kh,$device_id:null},"");else{var w=this.config.get_device_id(Ki());this.register_once({distinct_id:w,$device_id:e?w:y},""),e||ge(x)||this.register({[wv]:x})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return tn((function*(){var r,s,i,a,u;n.__loaded?((r=n.logs)==null||r.flushLogs("sendBeacon"),(s=n.metrics)==null||s.flush("sendBeacon"),(i=n.dn)==null||i.unload(),(a=n.vn)==null||a.unload(),(u=n.featureFlags)==null||u.destroy()):xe.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var i,a=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return s}alias(e,n){return e===this.get_property(L6)?(xe.critical("Attempting to create alias for existing People user - aborting."),-2):this.In("posthog.alias")?(ge(n)&&(n=this.get_distinct_id()),e!==n?(this.Tn(pd,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(xe.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=de({},this.config);if(Dt(e)){var r,s,i,a,u,c,d,h,p,m,y;At(this.config,aC(e));var x=this.hn();(r=this.persistence)==null||r.update_config(this.config,n,x),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Tv(de({},this.config,{persistence:"sessionStorage"}),x,!1);var _=this.an(this.config.debug);Bs(_)&&(this.config.debug=_),Bs(this.config.debug)&&(this.config.debug?(xt.DEBUG=!0,Et.N()&&Et.q("ph_debug",!0),xe.info("set_config",{config:e,oldConfig:n,newConfig:de({},this.config)})):(xt.DEBUG=!1,Et.N()&&Et.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(u=this.tracingHeaders)==null||u.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(d=this.heatmaps)==null||d.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(m=this.surveys)==null||m.loadIfEnabled(),this.Pn(),(y=this.externalIntegrations)==null||y.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){xt.LIB_NAME=e,xt.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,a,u=e===!0,c={sampling:u||!(e==null||!e.sampling),linked_flag:u||!(e==null||!e.linked_flag),url_trigger:u||!(e==null||!e.url_trigger),event_trigger:u||!(e==null||!e.event_trigger)};Object.values(c).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),c.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),c.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),c.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),c.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,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(de({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:_s.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:gu;return n!==gu&&(n=gu+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Vs))===su||((n=this.sessionPersistence)==null?void 0:n.get_property(Vs))===su}Cn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Ly&&!this._isIdentified()&&Ko(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[pd])&&((n=this.persistence)==null||(n=n.props)==null||!n[hm]))}xn(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Cn()||this.In("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.In("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}In(e){return this.config.person_profiles==="never"?(xe.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Tn(hm,!0),!0)}hn(){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!==Xa)}Pn(){var e,n,r,s,i=this.hn();return((e=this.persistence)==null?void 0:e.yr)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.yr)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Xi){if(this.Yi()){var r,s,i,a,u;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new nC(this),this.pageViewManager=new GE(this),this.persistence&&(this.sessionPropsManager=new tC(this,this.sessionManager,this.persistence));var c,d=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=_s.__defaultExtensionClasses)==null?void 0:u.sessionRecording;d&&(this.sessionRecording=this.Ji(this.sessionRecording,new d(this)),this.yn&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.yn)))}var h,p;this.consent.optInOut(!0),this.Pn(),this.bn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Xa&&((h=this.surveys)==null||h.loadIfEnabled()),(ge(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((p=e==null?void 0:e.captureEventName)!==null&&p!==void 0?p:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else xe.warn(iC)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==Xi?(this.config.cookieless_mode===Xa&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Xa&&(this.register({distinct_id:Kh,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):xe.warn(iC)}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===Xi||(this.config.cookieless_mode===Xa?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return lr?PP(lr,this.config.custom_blocked_useragents):void 0}_n(){ke&&(ke.visibilityState==="visible"?this.en||(this.en=!0,this.capture(mu,{title:ke.title},{send_instantly:!0}),this.rn&&(ke.removeEventListener(pm,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),zt(ke,pm,this.rn)))}debug(e){e===!1?(ne==null||ne.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ne==null||ne.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}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(xe.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):(function(n,r,s,i,a){var u=r in n&&!tt(n[r]),c=s in n&&!tt(n[s]);return u?n[r]:!!c&&(a&&a.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,xe)}Rt(e){var n;if(tt(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(PL),s=nt(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),tt(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return kL(e.event)?xe.warn(u+". This can cause unexpected behavior."):xe.info(u),null}i.properties&&!Ko(i.properties)||xe.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var c of r)if(i.properties&&tt(i.properties[c]))return xe.warn("Event '"+e.event+"' had its '"+c+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.ir)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}an(e){var n=Bs(e)&&!e,r=Et.N()&&Et.A("ph_debug")==="true";return!n&&(!!r||e)}}_s.__defaultExtensionClasses={},_s.On=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=mD(t.prototype[e[n]])})(_s,["identify"]);class lC{constructor(e){this.disabled=e===!1;var n=Dt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Nv="$copy_autocapture",jv=Vt("[AutoCapture]");function Fv(t,e){return e.length>t?e.slice(0,t)+"...":e}function yN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!sa(e));return e}function _N(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,c=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!sa(t))return{props:{}};for(var h=[t],p=new Set([t]),m=t;m.parentNode&&!Zr(m,"body")&&X6>h.length;)if(Y6(m.parentNode)){var y=m.parentNode.host;if(p.has(y))break;p.add(y),h.push(y),m=y}else{if(!sa(m.parentNode)||p.has(m.parentNode))break;p.add(m.parentNode),h.push(m.parentNode),m=m.parentNode}var x,_,w=[],E={},P=!1,T=!1;if(bt(h,(A=>{var M=Ny(A);if(Zr(A,"a")){var D=A.getAttribute("href");P=!!(M&&D&&Ed(D))&&(d?ra(D):D)}qe(vm(A),"ph-no-capture")&&(T=!0),w.push((function(N,G,Z,Y,B){B===void 0&&(B=!1);var K=N.tagName.toLowerCase(),$={tag_name:K};O2.indexOf(K)>-1&&!Z&&($.$el_text=K.toLowerCase()==="a"||K.toLowerCase()==="button"?Fv(1024,UE(N)):Fv(1024,zd(N)));var J=vm(N);J.length>0&&($.classes=J.filter((function(te){return te!==""}))),bt(N.attributes,(function(te){var ie;if((!nP(N)||["name","id","class","aria-label"].indexOf(te.name)!==-1)&&(Y==null||!Y.includes(te.name))&&!G&&Ed(te.value)&&(!wt(ie=te.name)||ie.substring(0,10)!=="_ngcontent"&&ie.substring(0,7)!=="_nghost")){var ae=te.value;te.name==="class"&&(ae=M2(ae).join(" ")),$["attr__"+te.name]=Fv(1024,te.name==="href"&&B?ra(ae):ae)}}));for(var H=1,j=1,X=N;X=yN(X);)H++,X.tagName===N.tagName&&j++;return $.nth_child=H,$.nth_of_type=j,$})(A,i,a,u,d));var F=(function(N){if(!Ny(N))return{};var G={};return bt(N.attributes,(function(Z){if(Z.name&&Z.name.indexOf("data-ph-capture-attribute")===0){var Y=Z.name.replace("data-ph-capture-attribute-",""),B=Z.value;Y&&B&&Ed(B)&&(G[Y]=B)}})),G})(A);At(E,F)})),T)return{props:{},explicitNoCapture:T};if(a||(w[0].$el_text=Zr(t,"a")||Zr(t,"button")?UE(t):zd(t)),P){var k,R;w[0].attr__href=P;var L=(k=Ud(P))==null?void 0:k.host,O=ne==null||(R=ne.location)==null?void 0:R.host;L&&O&&L!==O&&(x=P)}return{props:At({$event_type:s.type,$ce_version:1},c?{}:{$elements:w},{$elements_chain:(_=w,(function(A){return A.map((M=>{var D,F,N="";if(M.tag_name&&(N+=M.tag_name),M.attr_class)for(var G of(M.attr_class.sort(),M.attr_class))N+="."+G.replace(/"/g,"");var Z=de({},M.text?{text:M.text}:{},{"nth-child":(D=M.nth_child)!==null&&D!==void 0?D:0,"nth-of-type":(F=M.nth_of_type)!==null&&F!==void 0?F:0},M.href?{href:M.href}:{},M.attr_id?{attr_id:M.attr_id}:{},M.attributes),Y={};return Pp(Z).sort(((B,K)=>B[0].localeCompare(K[0]))).forEach((B=>{var K=B[1];return Y[BE(B[0].toString())]=BE(K.toString())})),(N+=":")+Pp(Y).map((B=>B[0]+'="'+B[1]+'"')).join("")})).join(";")})((function(A){return A.map((M=>{var D,F,N={text:(D=M.$el_text)==null?void 0:D.slice(0,400),tag_name:M.tag_name,href:(F=M.attr__href)==null?void 0:F.slice(0,2048),attr_class:DD(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return Pp(M).filter((G=>G[0].indexOf("attr__")===0)).forEach((G=>N.attributes[G[0]]=G[1])),N}))})(_)))},(n=w[0])!=null&&n.$el_text?{$el_text:(r=w[0])==null?void 0:r.$el_text}:{},x&&s.type==="click"?{$external_click_url:x}:{},E)}}var id=Vt("[ExceptionAutocapture]"),uC=()=>{},xN=Vt("[TracingHeaders]"),Fa=Vt("[Web Vitals]"),cC=9e5,dC="disabled",fC="lazy_loading",od="awaiting_config",Jh="missing_config";Vt("[SessionRecording]"),Vt("[SessionRecording]");var Wy="[SessionRecording]",Li=Vt(Wy),wN=Vt("[Heatmaps]");function Vv(t){return Dt(t)&&"clientX"in t&&"clientY"in t&&Hn(t.clientX)&&Hn(t.clientY)}var $v=Vt("[Product Tours]"),Hv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(T2))},bN=["$set_once","$set"],ti=Vt("[SiteApps]"),hC="Error while initializing PostHog app with config id ";function au(t,e,n){if(tt(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class SN{constructor(e){this.Fn=new F2,this.Ln=(n,r)=>this.$n(n,r)&&this.An(n,r)&&this.Nn(n,r)&&this.Dn(n,r),this.$n=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,n;ge((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(e){var n,r;if(!ge((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var u,c;(u=this.jn)==null||u.add(a),(c=a.steps)==null||c.forEach((d=>{var h;(h=this.qn)==null||h.add((d==null?void 0:d.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach((a=>{var u;(u=a.steps)==null||u.forEach((c=>{c!=null&&c.selector&&i.add(c==null?void 0:c.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.qn.has(e)||this.qn.has(n.event))&&this.jn&&((r=this.jn)==null?void 0:r.size)>0&&this.jn.forEach((s=>{this.Hn(n,s)&&this.Fn.emit("actionCaptured",s.name)}))}Bn(e){this.onAction("actionCaptured",(n=>e(n)))}Hn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,n){return this.Fn.on(e,n)}An(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!au(s,n.url,n.url_matching||"contains"))return!1}return!0}Nn(e,n){return!!this.Un(e,n)&&!!this.zn(e,n)&&!!this.Vn(e,n)}Un(e,n){var r;if(n==null||!n.href)return!0;var s=this.Wn(e);if(s.length>0)return s.some((u=>au(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&au((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}zn(e,n){var r;if(n==null||!n.text)return!0;var s=this.Wn(e);if(s.length>0)return s.some((d=>au(d.text,n.text,n.text_matching||"exact")||au(d.$el_text,n.text,n.text_matching||"exact")));var i,a,u,c=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(i=(function(d){for(var h,p=[],m=/(?::|")text="(.*?)"/g;!tt(h=m.exec(d));)p.includes(h[1])||p.push(h[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((d=>au(d,a,u))))}Vn(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}Wn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Dn(e,n){return n==null||!n.properties||n.properties.length===0||AP(n.properties.reduce(((r,s)=>{var i=nt(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class EN{constructor(e){var n;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,(n=this._instance)==null||n.onSessionId==null||n.onSessionId((r=>this.Kn(r)))}Yn(e,n){return!!e&&AP(e.propertyFilters,n==null?void 0:n.properties)}Xn(e,n){var r=new Map;return e.forEach((s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((a=>{if(a!=null&&a.name){var u=r.get(a.name)||[];u.push(s.id),r.set(a.name,u)}}))})),r}ts(e,n,r){var s=(r===Jc.Activation?this.Gn:this.Qn).get(e),i=[];return this.es((a=>{i=a.filter((u=>s==null?void 0:s.includes(u.id)))})),i.filter((a=>{var u,c=(u=a.conditions)==null||(u=u[r])==null||(u=u.values)==null?void 0:u.find((d=>d.name===e));return this.Yn(c,n)}))}register(e){var n;ge((n=this._instance)==null?void 0:n._addCaptureHook)||(this.rs(e),this.ns(e))}ns(e){var n=e.filter((r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.ss==null&&(this.ss=new SN(this._instance),this.ss.init(),this.ss.Bn((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,a,u,c;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((u=this.ss)==null||u.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((d=>{if(d&&d.name){var h=this.Jn.get(d.name);h&&h.push(r.id),this.Jn.set(d.name,h||[r.id])}})))})))}rs(e){var n,r=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.events)&&((u=i.conditions)==null||(u=u.events)==null||(u=u.values)==null?void 0:u.length)>0})),s=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((u=i.conditions)==null||(u=u.cancelEvents)==null||(u=u.values)==null?void 0:u.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,a)=>{this.onEvent(i,a)})),this.Gn=this.Xn(e,Jc.Activation),this.Qn=this.Xn(e,Jc.Cancellation))}onEvent(e,n){var r,s,i=this.os(),a=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var u=this.ls(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.us([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.hs(a)}if(this.Qn.has(e)){var c=this.ts(e,n,Jc.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((h=>h.id))}),this.us(c.map((h=>h.id))),c.forEach((h=>this.ds(h.id))))}if(this.Gn.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Gn.get(e)});var d=this.ts(e,n,Jc.Activation);this.cs(d.map((h=>h.id)))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter((r=>r!==e));var n=this.vs();n.includes(e)||(this.fs([...n,e]),this.ps())}us(e){var n=new Set(e);this.Zn=this.Zn.filter((i=>!n.has(i)));var r=this.gs(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&(this.fs(s),s.length===0&&this.ys())}gs(){var e,n=this.bs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}vs(){var e,n,r=this.gs();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this._s()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}ps(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.ws(n)}ys(){this.xs()}Kn(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((e=>!this.ks(e)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class CN extends EN{constructor(e){super(e)}bs(){return Py}_s(){return kp}Cs(){return Ji.SHOWN}es(e){var n;(n=this._instance)==null||n.getSurveys(e)}ds(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}os(){return yt}fs(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Py]:e})}ws(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[kp]:e})}xs(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(kp)}ks(){return!1}ls(e,n){var r;this.es((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return IP(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===Ji.SHOWN?"consume":"ignore":e===Ji.SHOWN?"persist":e===Ji.DISMISSED||e===Ji.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var zv="SDK is not enabled or survey functionality is not yet loaded",pC="Disabled. Not loading surveys.",kN=ne!=null&&ne.location?ym(ne.location.hash,"__posthog")||ym(location.hash,"state"):null,mC="_postHogToolbarParams",gC=Vt("[Toolbar]"),fn=Vt("[FeatureFlags]"),Va=Vt("[FeatureFlags]",{debugEnabled:!0}),Uv=`" failed. Feature flags didn't load in time.`,vC=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},yC=t=>{var e={};for(var n of Pp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Di=Vt("[Error tracking]"),_C="Refusing to render web experiment since the viewer is a likely bot",PN={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>wm(e,t),not_regex:(t,e)=>!wm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Yn{get Te(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Yn.Is("retrieved web experiments from the server"),n.Ts=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.Ts&&(Yn.Is("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.Ts)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);wt(u)&&i.variants[u]&&n.Ms(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var d=i.variants[c];Yn.Es(d,n._instance)&&n.Ms(i.name,c,d.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Yn.Is(_C);else if(!this.Te.disable_web_experiments){if(tt(this.Ts))return this.Ts=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Yn.Is("applying feature flags",e),e.forEach((n=>{var r;if(this.Ts&&(r=this.Ts)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.Ts)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.Ms(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Yn.getWindowLocation();if(e!=null&&e.search){var n=Qu(e==null?void 0:e.search,"__experiment_id"),r=Qu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Yn.Is("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.Rs(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Te.disable_web_experiments&&!r)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Rs(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Yn.Is("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ms(s[0].name,n,s[0].variants[n].transforms))}static Es(e,n){return!tt(e.conditions)&&Yn.Ps(e,n)&&Yn.Os(e)}static Ps(e,n){var r;if(tt(e.conditions)||tt((r=e.conditions)==null?void 0:r.url))return!0;var s=Yn.getWindowLocation();if(s){var i,a,u,c=K6(n,s.href);return(i=e.conditions)==null||!i.url||PN[(a=(u=e.conditions)==null?void 0:u.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return ne==null?void 0:ne.location}static Os(e){var n;if(tt(e.conditions)||tt((n=e.conditions)==null?void 0:n.utm))return!0;var r=cP();if(r.utm_source){var s,i,a,u,c,d,h,p,m=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,y=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_source)==r.utm_source,x=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,_=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return m&&x&&_&&y}return!1}static Is(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];xe.info("[WebExperiments] "+e,r)}Ms(e,n,r){this._is_bot()?Yn.Is(_C):n!=="control"?r.forEach((s=>{if(s.selector){var i;Yn.Is("applying transform of variant "+n+" for experiment "+e+" ",s);var a=(i=document)==null?void 0:i.querySelectorAll(s.selector);a==null||a.forEach((u=>{var c=u;s.html&&(c.innerHTML=s.html),s.css&&c.setAttribute("style",s.css)}))}})):Yn.Is("Control variants leave the page unmodified.")}_is_bot(){return lr&&this._instance?PP(lr,this.Te.custom_blocked_useragents):void 0}}var gs=Vt("[Conversations]"),$a="Conversations not available yet.",xC="console",s0={featureFlags:class{constructor(t){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],ne&&zt(ne,"online",this.Bs)}destroy(){ne==null||ne.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(t){return this._instance.get_property(t)}Vs(){var t,e;return(t=(e=this.mi)==null?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,fn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var t,e=(t=this.Te.evaluation_contexts)!==null&&t!==void 0?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(fn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||fn.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Gs(){return this.Zs().length>0}Qs(){var t=this.Te.flag_keys;if(!ge(t)){if(nt(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||fn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));fn.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,n=this._instance.config,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,a=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},u=Object.keys(r).filter((d=>!!r[d])).reduce(((d,h)=>(d[h]=r[h]||!1,d)),{}),c=Object.keys(a).filter((d=>u[d])).reduce(((d,h)=>(a[h]&&(d[h]=a[h]),d)),{});this.receivedFeatureFlags({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.zs(el))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.zs(Cp))!==null&&s!==void 0?s:{},u=de({},i,t),c=de({},a,e),d={};for(var h of Object.entries(u)){var p=h[0],m=h[1];d[p]={key:p,enabled:xE(m),variant:wE(m),reason:void 0,metadata:ge(c==null?void 0:c[p])?void 0:{id:0,version:void 0,description:void 0,payload:c[p]}}}this.receivedFeatureFlags({flags:d})}get hasLoadedFlags(){return this.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.zs(Ey),e=this.zs(zi),n=this.zs(pu);if(!n&&!e)return t||{};var r=At({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,u,c=r[i],d=e==null?void 0:e[i],h=ge(d)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!d,p=ge(d)?c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[i],y=de({},c,{enabled:h,variant:h?p??(c==null?void 0:c.variant):void 0});h!==(c==null?void 0:c.enabled)&&(y.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(y.original_variant=c==null?void 0:c.variant),m&&(y.metadata=de({},c==null?void 0:c.metadata,{payload:m,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=y}return this.Fs||(fn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Fs=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:xE(r),variant:wE(r),payload:_E(e[n])}}))}getFlagVariants(){var t=this.zs(el),e=this.zs(zi);if(!e)return t||{};for(var n=At({},t),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(fn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Fs=!0),n}getFlagPayloads(){var t=this.zs(Cp),e=this.zs(pu);if(!e)return t||{};for(var n=At({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(fn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Fs=!0),n}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.tn.emit("featureFlagsReloading",!0),this.Js=setTimeout((()=>{this.Ks()}),5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.As=t}Ks(t){var e;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var n=this.Te.token,r=this.zs(um),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:de({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.zs(Za)||{}),group_properties:this.zs(Ya),timezone:gP()};fr(r)||ge(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var i=this.Qs();ge(i)||(s.flag_keys=i);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.Te.disable_compression?void 0:ar.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:c=>{var d,h,p,m=!0;if(this.Xs(c.statusCode),c.statusCode===200&&(this.Ns||(this.$anon_distinct_id=void 0),m=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!m;var y=[];c.error?c.error instanceof Error?y.push(c.error.name==="AbortError"?"timeout":"connection_error"):y.push("unknown_error"):c.statusCode!==200&&y.push("api_error_"+c.statusCode),(d=c.json)!=null&&d.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var x,_=!((h=c.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));_&&y.push("quota_limited"),(p=this.mi)==null||p.register({[Ry]:y}),_?fn.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."):(s.disable_flags||this.receivedFeatureFlags((x=c.json)!==null&&x!==void 0?x:{},m,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks()))}}})}}Us(){return lP(this.Hs,3)}Xs(t){this.Hs=uP(t,this.Hs,3,(()=>fn.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else fn.warn('getFeatureFlag for key "'+t+Uv)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],a=String(s),u=this.zs(Cy)||void 0,c=this.zs(Hd)||void 0,d=this.zs(Sd)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,p=this._instance.get_session_id(),m=this.zs(Ty);p&&p!==m&&(d={},(h=this.mi)==null||h.register({[Sd]:d,[Ty]:p}))}if((e.send_event||!("send_event"in e))&&(!(t in d)||!d[t].includes(a))){var y,x,_,w,E,P,T,k,R,L,O;nt(d[t])?d[t].push(a):d[t]=[a],(y=this.mi)==null||y.register({[Sd]:d});var A=this.getFeatureFlagDetails(t),M=[...(x=this.zs(Ry))!==null&&x!==void 0?x:[]];ge(s)&&M.push("flag_missing");var D={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:u,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((_=this.Te.bootstrap)==null||(_=_.featureFlags)==null?void 0:_[t])||null,$feature_flag_bootstrapped_payload:((w=this.Te.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[t])||null,$used_bootstrap_value:!this.Ds};ge(A==null||(E=A.metadata)==null?void 0:E.has_experiment)||(D.$feature_flag_has_experiment=A.metadata.has_experiment),ge(A==null||(P=A.metadata)==null?void 0:P.version)||(D.$feature_flag_version=A.metadata.version);var F,N=(T=A==null||(k=A.reason)==null?void 0:k.description)!==null&&T!==void 0?T:A==null||(R=A.reason)==null?void 0:R.code;N&&(D.$feature_flag_reason=N),A!=null&&(L=A.metadata)!=null&&L.id&&(D.$feature_flag_id=A.metadata.id),ge(A==null?void 0:A.original_variant)&&ge(A==null?void 0:A.original_enabled)||(D.$feature_flag_original_response=ge(A.original_variant)?A.original_enabled:A.original_variant),A!=null&&(O=A.metadata)!=null&&O.original_payload&&(D.$feature_flag_original_payload=A==null||(F=A.metadata)==null?void 0:F.original_payload),M.length&&(D.$feature_flag_error=M.join(",")),this._instance.capture("$feature_flag_called",D)}if(r)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:_E(i)}}}else fn.warn('getFeatureFlagResult for key "'+t+Uv)}getRemoteConfigPayload(t,e){var n=this.Te.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Gs()&&(r.evaluation_contexts=this.Zs());var s=this.Qs();ge(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Te.disable_compression?void 0:ar.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(i){var a,u=(a=i.json)==null?void 0:a.featureFlagPayloads;e((u==null?void 0:u[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.Ds)return e.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return fn.warn('isFeatureEnabled for key "'+t+Uv),e.defaultValue;var n=this.getFeatureFlag(t,e);return ge(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.mi){this.Ls=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,u,c,d,h,p){c===void 0&&(c={}),d===void 0&&(d={}),h===void 0&&(h={});var m=(A=>{var M=A.flags;return M?(A.featureFlags=Object.fromEntries(Object.keys(M).map((D=>{var F;return[D,(F=M[D].variant)!==null&&F!==void 0?F:M[D].enabled]}))),A.featureFlagPayloads=Object.fromEntries(Object.keys(M).filter((D=>M[D].enabled)).filter((D=>{var F;return(F=M[D].metadata)==null?void 0:F.payload})).map((D=>{var F;return[D,(F=M[D].metadata)==null?void 0:F.payload]})))):A.featureFlags&&fn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),A})(a),y=m.flags,x=m.featureFlags,_=m.featureFlagPayloads;if(x){var w=a.requestId,E=a.evaluatedAt;if(nt(x)){fn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var P={};if(x)for(var T=0;x.length>T;T++)P[x[T]]=!0;u&&u.register({[Ep]:x,[el]:P,[cm]:!1})}else{var k=x,R=_,L=y;if(p!=null&&p.partialResponse)k=de({},c,k),R=de({},d,R),L=de({},h,L);else if(a.errorsWhileComputingFlags)if(y){var O=new Set(Object.keys(y).filter((A=>{var M;return!((M=y[A])!=null&&M.failed)})));k=de({},c,Object.fromEntries(Object.entries(k).filter((A=>O.has(A[0]))))),R=de({},d,Object.fromEntries(Object.entries(R||{}).filter((A=>O.has(A[0]))))),L=de({},h,Object.fromEntries(Object.entries(L||{}).filter((A=>O.has(A[0])))))}else k=de({},c,k),R=de({},d,R),L=de({},h,L);u&&u.register(de({[Ep]:Object.keys(yC(k)),[el]:k||{},[Cp]:R||{},[Ey]:L||{},[cm]:a.minimalFlagCalledEvents===!0},w?{[Cy]:w}:{},E?{[Hd]:E}:{}))}}})(t,this.mi,r,s,i,n),e||(this.js=!1),this.eo(e)}}override(t,e){e===void 0&&(e=!1),fn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return fn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.mi.unregister(zi),this.mi.unregister(pu),this.eo(),Va.info("All overrides cleared");if(nt(t)){var e=vC(t);return this.mi.register({[zi]:e}),this.eo(),Va.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.Fs=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.mi.unregister(zi),Va.info("Flag overrides cleared");else if(r.flags){if(nt(r.flags)){var s=vC(r.flags);this.mi.register({[zi]:s})}else this.mi.register({[zi]:r.flags});Va.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.mi.unregister(pu),Va.info("Payload overrides cleared")):r.payloads&&(this.mi.register({[pu]:r.payloads}),Va.info("Payload overrides set",{payloads:r.payloads}))),void this.eo()}if(t&&typeof t=="object")return this.mi.register({[zi]:t}),this.eo(),Va.info("Flag overrides set",{flags:t});fn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ls){var e=this.ro(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){fn.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.zs(gd)||[]).find((c=>c.flagKey===t)),i={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(a.$early_access_feature_name=s.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var u=de({},this.getFlagVariants(),{[t]:e});(r=this.mi)==null||r.register({[Ep]:Object.keys(yC(u)),[el]:u}),this.eo()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.zs(gd),s=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+s),method:"GET",timestampMode:"query",callback:i=>{var a,u;if(i.json){var c=i.json.earlyAccessFeatures;return(a=this.mi)==null||a.unregister(gd),(u=this.mi)==null||u.register({[gd]:c}),t(c)}}})}ro(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((n=>e[n])),flagVariants:Object.keys(e).filter((n=>e[n])).reduce(((n,r)=>(n[r]=e[r],n)),{})}}eo(t){var e=this.ro(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){fn.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(Za)||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in n||(i[a]=s[a]));this._instance.register({[Za]:de({},n,i,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=de({},this.zs(Za)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[Za]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Za),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(Ya)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=de({},n[r],t[r]),delete t[r]})),this._instance.register({[Ya]:de({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.zs(Ya)||{};this._instance.register({[Ya]:de({},e,{[t]:{}})})}else this._instance.unregister(Ya)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},TN={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!((t=this.io)==null||!t.isStarted)}get status(){var t,e;return this.no===od||this.no===Jh?this.no:(t=(e=this.io)==null?void 0:e.status)!==null&&t!==void 0?t:this.no}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=dC,this.so=void 0,this._instance=t,!this._instance.sessionManager)throw Li.error("started without valid sessionManager"),new Error(Wy+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Xi)throw new Error(Wy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var t,e=!((t=this._instance.get_property(rl))==null||!t.enabled),n=!this.Te.disable_session_recording,r=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return ne&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.oo||(e=this.io)==null||!e.isStarted){var n=!ge(Object.assign)&&!ge(Array.from);this.oo&&n?(this.ao(t),Li.info("starting")):(this.no=dC,this.stopRecording())}}ao(t){var e,n,r;this.oo&&(this.no!==od&&this.no!==Jh&&(this.no=fC),He!=null&&(e=He.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=He.__PosthogExtensions__)!=null&&n.initSessionRecording?this.lo(t):(r=He.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.uo,(s=>{if(s)return Li.error("could not load recorder",s);this.lo(t)})))}stopRecording(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.stop()}ho(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.discard()}do(){var t,e;(t=this.mi)==null||t.unregister(R2),(e=this.mi)==null||e.unregister(D6)}co(t,e){if(tt(t))return null;var n,r=Hn(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Li.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}vo(t){if(this.mi){var e,n,r=this.mi,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.co((i=this.Te.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.co(a==null?void 0:a.sampleRate,"remote config sampleRate"),d=u??c;tt(d)&&this.do();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[rl]:de({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:de({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:d,minimumDurationMilliseconds:ge(h)?null:h,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};s(),(e=this.so)==null||e.call(this),this.so=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.vo(e),void this.ho()):(this.vo(e),void this.startIfEnabledOrStop()):(this.no===od&&(this.no=Jh,Li.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.io)!=null&&n.log?this.io.log(t,e):Li.warn("log called before recorder was ready")}get uo(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(rl);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}fo(){var t,e,n=this._instance.get_property(rl);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return Li.warn("persisted remote config for session recording is invalid and will be ignored",s),!1}var r=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-r}lo(t){var e,n;if((e=He.__PosthogExtensions__)==null||!e.initSessionRecording)return Li.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[U6]:!0});if(this.io||(this.io=(n=He.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo())return this.no===Jh||this.no===od?void 0:(this.no=od,Li.info("persisted remote config is stale, requesting fresh config before starting"),void new vP(this._instance).load());this.no=fC,this.io.start(t)}onRRwebEmit(t){var e;(e=this.io)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.io||(e=this.mi)==null||e.register({[j6]:!0}),(t=this.io)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.io||(e=this.mi)==null||e.register({[N6]:!0}),(t=this.io)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.io||(n=this.mi)==null||n.register({[t==="url"?F6:V6]:!0}),(e=this.io)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.io)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.io)==null||!n.tryAddCustomEvent(t,e))}}},RN={autocapture:class{constructor(t){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=t,this.rageclicks=new lC(t.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var t,e,n=Dt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((r=>new RegExp(r))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((r=>new RegExp(r))),n}wo(){if(this.isBrowserSupported()){if(ne&&ke){var t=n=>{n=n||(ne==null?void 0:ne.event);try{this.xo(n)}catch(r){jv.error("Failed to capture event",r)}};if(zt(ke,"submit",t,{capture:!0}),zt(ke,"change",t,{capture:!0}),zt(ke,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=n=>{n=n||(ne==null?void 0:ne.event);try{this.xo(n,Nv)}catch(r){jv.error("Failed to capture copy/cut event",r)}};zt(ke,"copy",e,{capture:!0}),zt(ke,"cut",e,{capture:!0})}}}else jv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(t){if(this.yo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.bo=e.elementsChainAsString);var n=e.autocapture_opt_out;Bs(n)&&(this.instance.persistence&&this.instance.persistence.register({[vy]:n}),this.mo=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this._o=t}getElementSelectors(t){var e,n=[];return(e=this._o)==null||e.forEach((r=>{var s=ke==null?void 0:ke.querySelectorAll(r);s==null||s.forEach((i=>{t===i&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[vy],r=this.mo,s=this.instance.Ur()&&!this.yo;if(fr(r)&&!Bs(n)&&!s)return!1;var i=(e=this.mo)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!i}xo(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=Cv(t);Z6(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&zE(r,this.instance.config.rageclick)&&this.xo(t,"$rageclick");var s=e===Nv;if(r&&(function(p,m,y,x,_,w){var E;if(!ne||L2(p)||y!=null&&y.url_allowlist&&!VE(y.url_allowlist,w)||y!=null&&y.url_ignorelist&&VE(y.url_ignorelist,w))return!1;if(y!=null&&y.dom_event_allowlist){var P=y.dom_event_allowlist;if(P&&!P.some((A=>m.type===A)))return!1}var T=tP(p,x),k=T.parentIsUsefulElement,R=T.targetElementList;if(!(function(A,M){var D=M==null?void 0:M.element_allowlist;if(ge(D))return!0;var F,N=function(Z){if(D.some((Y=>Z.tagName.toLowerCase()===Y)))return{v:!0}};for(var G of A)if(F=N(G))return F.v;return!1})(R,y)||!Dy(R,y==null?void 0:y.css_selector_allowlist)||Dy(R,(E=y==null?void 0:y.css_selector_ignorelist)!==null&&E!==void 0?E:TD))return!1;try{var L=ne.getComputedStyle(p);if(L&&L.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}var O=p.tagName.toLowerCase();switch(O){case"html":return!1;case"form":return(_||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(m.type)>=0;default:return k?(_||["click"]).indexOf(m.type)>=0:(_||["click"]).indexOf(m.type)>=0&&(O2.indexOf(O)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Te,s,s?["copy","cut"]:void 0,this.instance)){var i=_N(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var u=this.getElementSelectors(r);if(u&&u.length>0&&(a.$element_selectors=u),e===Nv){var c,d=Q6(ne==null||(c=ne.getSelection())==null?void 0:c.toString()),h=t.type||"clipboard";if(!d)return!1;a.$selected_content=d,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Us(ke==null?void 0:ke.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ko=(ne==null||(e=ne.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(xe.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,xe.info("History API monitoring stopped")}monitorHistoryChanges(){ne&&ne.history&&(this.Co("pushState"),this.Co("replaceState"),this.Io())}Co(t){var e;if(ne&&((e=ne.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return uC;var a={next:r[s]},u=i((function(){for(var c=arguments.length,d=new Array(c),h=0;c>h;h++)d[h]=arguments[h];return a.next.apply(this,d)}));return Us(u)&&(u.prototype=u.prototype||{},Object.defineProperties(u,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),r[s]=u,()=>{if(r[s]!==u)for(var c=r[s];Us(c)&&c.__posthog_layer__;){var d=c.__posthog_layer__;if(d.next===u)return void(d.next=a.next);c=d.next}else r[s]=a.next}}catch{return uC}})(ne.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n.To(t)}))}}To(t){try{var e,n=ne==null||(e=ne.location)==null?void 0:e.pathname;if(!n)return;n!==this.ko&&this.isEnabled&&this._instance.capture(mu,{navigation_type:t}),this.ko=n}catch(r){xe.error("Error capturing "+t+" pageview",r)}}Io(){if(!this.So){var t=()=>{this.To("popstate")};zt(ne,"popstate",t),this.So=()=>{ne&&ne.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=t,this.Mo=!((e=this.instance.persistence)==null||!e.props[yy]),this.rageclicks=new lC(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Dt(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return tt(this.Te.capture_heatmaps)?tt(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.po)return;wN.info("starting..."),this.Ro(),this.ke()}else{var t;clearInterval((t=this.Eo)!==null&&t!==void 0?t:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[yy]:n}),this.Mo=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Oo(t){Vv(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo=(ke==null?void 0:ke.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){ne&&ke&&(this.Fo=this.oi.bind(this),zt(ne,mm,this.Fo),this.Lo=t=>this.pe(t||(ne==null?void 0:ne.event)),zt(ke,"click",this.Lo,{capture:!0}),this.$o=t=>this.Ao(t||(ne==null?void 0:ne.event)),zt(ke,"mousemove",this.$o,{capture:!0}),this.No=new WE(this.instance,ND,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),zt(ke,pm,this.Do),this.po=!0)}Po(){var t;ne&&ke&&(this.Fo&&ne.removeEventListener(mm,this.Fo),this.Lo&&ke.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&ke.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&ke.removeEventListener(pm,this.Do),clearTimeout(this.qo),(t=this.No)==null||t.stop(),this.po=!1)}jo(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(a,u,c){for(var d=a;d&&sa(d)&&!Zr(d,"body");){if(d===c)return!1;var h=void 0;try{var p,m,y;h=(p=(m=(y=d.ownerDocument)==null?void 0:y.defaultView)!==null&&m!==void 0?m:ne)==null?void 0:p.getComputedStyle(d).position}catch{return!1}if(qe(u,h))return!0;d=J6(d)}return!1})(Cv(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}pe(t,e){var n;if(e===void 0&&(e="click"),!FE(t.target)&&Vv(t)){var r=this.jo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&zE(Cv(t),this.instance.config.rageclick)&&this.Wt(de({},r,{type:"rageclick"})),this.Wt(r)}}Ao(t){!FE(t.target)&&Vv(t)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Wt(this.jo(t,"mousemove"))}),500))}Wt(t){if(ne){var e=this.Te.disable_capture_url_hashes?ra(ne.location.href):ne.location.href,n=this.Te.custom_personal_data_properties,r=this.Te.mask_personal_data_properties?[...Ju,...n||[]]:[],s=Bd(e,r,Wd);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}oi(){this.R&&!Ko(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:WE,webVitalsAutocapture:class{constructor(t){var e;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>de({},n,{["$web_vitals_"+r.name+"_event"]:de({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.zo();if(!ge(s))if(tt(n==null?void 0:n.name)||tt(n==null?void 0:n.value))Fa.error("Invalid metric received",n);else if(!this.Vo||this.Vo>n.value){this.R.url!==s&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),ge(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=ge(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var i=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),a=de({},n,{$current_url:s,timestamp:Date.now()});ge(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else Fa.error("Ignoring metric with value >= "+this.Vo,n)},this.Wo=()=>{if(!this.po){var n,r,s,i,a=He.__PosthogExtensions__;if(!ge(a)&&!ge(a.postHogWebVitalsCallbacks)){var u=a.postHogWebVitalsCallbacks;n=u.onLCP,r=u.onCLS,s=u.onFCP,i=u.onINP}n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Uo.bind(this)),this.po=!0):Fa.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Mo=!((e=this._instance.persistence)==null||!e.props[by]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=Dt(this.Zo)?(t=this.Zo)==null?void 0:t.web_vitals_allowed_metrics:void 0;return tt(n)?((e=this._instance.persistence)==null?void 0:e.props[Sy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Dt(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Dt(this.Zo)?this.Zo.web_vitals_attribution:void 0;return t!=null&&t}get Vo(){var t=Dt(this.Zo)&&Hn(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:cC;return t>0&&6e4>=t?cC:t}get isEnabled(){var t=on==null?void 0:on.protocol;if(t!=="http:"&&t!=="https:")return Fa.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Dt(this.Zo)?this.Zo.web_vitals:Bs(this.Zo)?this.Zo:void 0;return Bs(e)?e:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(Fa.info("enabled, starting..."),this.tr(this.Wo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=Dt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Dt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[by]:n}),this._instance.persistence.register({[Sy]:r})),this.Mo=n,this.startIfEnabled()}}}tr(t){var e,n;(e=He.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=He.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Fa.error("failed to load script",r):t()}))}zo(){var t=ne?this._instance.config.disable_capture_url_hashes?ra(ne.location.href):ne.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Ju,...e||[]]:[];return Bd(t,n,Wd)}Fa.error("Could not determine current URL")}}},AN={exceptionObserver:class{constructor(t){var e;this.Wo=()=>{var n;if(ne&&this.isEnabled&&(n=He.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=He.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=He.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=He.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=r(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=s(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=i(this.captureException.bind(this)))}catch(a){id.error("failed to start",a),this.Ko()}}},this._instance=t,this.Yo=!((e=this._instance.persistence)==null||!e.props[_y]),this.Xo=new AL(de({},(function(n){var r,s,i,a;return n===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(a=n.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking),{refillInterval:1e4,it:id})),this.Te=this.ta(),this.startIfEnabledOrStop()}ta(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Dt(t)?e=de({},e,t):(ge(t)?this.Yo:t)&&(e=de({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(id.info("enabled"),this.Ko(),this.tr(this.Wo)):this.Ko()}tr(t){var e,n;(e=He.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=He.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return id.error("failed to load script",r);t()}))}Ko(){var t,e,n;(t=this.Go)==null||t.call(this),this.Go=void 0,(e=this.Qo)==null||e.call(this),this.Qo=void 0,(n=this.Jo)==null||n.call(this),this.Jo=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[_y]:this.Yo}),this.Te=this.ta(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ta()}captureException(t){var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.Xo.consumeRateLimit(s)?id.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.ea=[],this.ra=new KL([new tD,new cD,new rD,new nD,new lD,new aD,new iD,new uD],(function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),a=1;s>a;a++)i[a-1]=arguments[a];return function(u,c){c===void 0&&(c=0);for(var d=[],h=u.split(`
18
- `),p=c;h.length>p;p++){var m=h[p];if(1024>=m.length){var y=OE.test(m)?m.replace(OE,"$1"):m;if(!y.match(/\S*Error: /)){for(var x of i){var _=x(y,r);if(_){d.push(_);break}}if(d.length>=50)break}}}return(function(w){if(!w.length)return[];var E=Array.from(w);return E.reverse(),E.slice(0,50).map((P=>{return de({},P,{filename:P.filename||(T=E,T[T.length-1]||{}).filename,function:P.function||Xu});var T}))})(d)}})("web:javascript",XL,eD)),this._instance=t,this.ea=(e=(n=this._instance.persistence)==null?void 0:n.get_property(xy))!==null&&e!==void 0?e:[],this.ia=lm(this.na()),this.sa=new fD(this.ia)}onConfigChange(){this.ia=lm(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var i=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],a=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.ea=i,this._instance.persistence&&this._instance.persistence.register({[xy]:this.ea,[wy]:a})}}}get oa(){var t,e=!!this._instance.get_property(wy),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.ra.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.ia.enabled)try{if(!wt(t)||t.trim().length===0)return void Di.warn("Ignoring exception step because message must be a non-empty string");var n=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(i).reduce(((u,c)=>dD.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(this.aa(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Di.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(de({[om]:t,[am]:new Date().toISOString()},r))}catch(i){Di.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.la(e)){if(this.ua(e))return this.ha("Exception dropped: matched a suppression rule"),void Di.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(e))return this.ha("Exception dropped: thrown by a browser extension"),void Di.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(e))return this.ha("Exception dropped: thrown by the PostHog SDK"),void Di.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.ia.enabled&&tt(t.$exception_steps)?this.va(t):t;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return r&&this.sa.clear(),r}catch(s){return Di.error("Failed to capture exception event. Dropping this exception.",s),void this.sa.clear()}}catch(s){return void Di.error("Failed to process exception event. Ignoring this exception.",s)}}va(t){try{var e=this.sa.getAttachable();return e.length===0?t:de({},t,{$exception_steps:e})}catch(n){return Di.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}ha(t){this.ia.enabled&&this.sa.add({[om]:t,[am]:new Date().toISOString()})}aa(t){return Dt(t)?de({},t):{}}na(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ua(t){if(t.length===0)return!1;var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return wt(s)&&s.length>0&&n.$exception_types.push(s),wt(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.ea.some((n=>{var r=n.values.map((s=>{var i,a=RP[s.operator],u=nt(s.value)?s.value:[s.value],c=(i=e[s.key])!==null&&i!==void 0?i:[];return u.length>0&&a(u,c)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}da(t){return t.flatMap((e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}ca(t){if(t.length>0){var e,n,r,s,i=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],a=i[i.length-1];return(r=a==null||(s=a.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}la(t){return!tt(t)&&nt(t)}}},IN=de({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.fa=null,this.pa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.mi&&this.mi.register({[T2]:!!e.productTours}),!Hv(this._instance))return!this.fa&&tt((n=this.mi)==null?void 0:n.props[vd])||$v.info("product tours disabled; stopping and clearing cached tours"),(r=this.fa)==null||r.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&Hv(this._instance)&&this.tr((()=>this.ga()))}tr(t){var e,n;(e=He.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=He.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?$v.error("Could not load product tours script",r):t()}))}ga(){var t;!this.fa&&(t=He.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.fa=He.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!nt(this.pa)||e){var n=this.mi;if(n){var r=n.props[vd];if(nt(r)&&!e)return this.pa=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:s=>{if(Hv(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return $v.error(a),void t([],{isLoaded:!1,error:a})}var u=nt(s.json.product_tours)?s.json.product_tours:[];this.pa=u,n&&n.register({[vd]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.pa,{isLoaded:!0})}getActiveProductTours(t){tt(this.fa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(t)}showProductTour(t){var e;(e=this.fa)==null||e.showTourById(t)}previewTour(t){this.fa?this.fa.previewTour(t):this.tr((()=>{var e;this.ga(),(e=this.fa)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.fa)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.fa)==null||t.nextStep()}previousStep(){var t;(t=this.fa)==null||t.previousStep()}clearCache(){var t;this.pa=null,(t=this.mi)==null||t.unregister(vd)}resetTour(t){var e;(e=this.fa)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.fa)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.fa)==null||e.cancelPendingTour(t)}}},s0),MN={siteApps:class{constructor(t){this.ma=0,this._instance=t,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(t,e){if(e){var n=this.globalsForEvent(e);this.ya.push(n),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var t;return(t=He._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{t(),this.ya=[],this._a=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,u;if(!t)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var m=p[0];c[m]={id:d[m],type:m,properties:p[1]}}var y=t.$set_once,x=t.$set;return{event:de({},t6(t,bN),{properties:de({},t.properties,x?{$set:de({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},x)}:{},y?{$set_once:de({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},y)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(u=t.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}wa(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(ti.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(ti.error("prepare_external_dependency_script returned null"),null):t}xa(){var t,e,n,r,s,i,a,u;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var c=ke==null?void 0:ke.defaultView,d=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!d)return()=>{};if(this.ma++,this.ka)return this.Sa();var h=[],p=this,m=new WeakSet,y=(w,E,P)=>{if(w!=null&&w[E]){var T=w[E];w[E]=P(T),h.push((()=>{w[E]=T}))}},x=w=>{if(m.has(w))return w;var E=p.wa(w);return E&&m.add(E),E},_=w=>w.map((E=>typeof E=="string"?E:x(E))).filter((E=>!fr(E)));return y(d,"appendChild",(w=>function(E){var P=x(E);return P?w.call(this,P):E})),y(d,"insertBefore",(w=>function(E,P){var T=x(E);return T?w.call(this,T,P):E})),y(d,"replaceChild",(w=>function(E,P){var T=x(E);return T?w.call(this,T,P):P})),[(e=c.Element)==null?void 0:e.prototype,(n=c.Document)==null?void 0:n.prototype,(r=c.DocumentFragment)==null?void 0:r.prototype].forEach((w=>{y(w,"append",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return E.apply(this,_(T))})),y(w,"prepend",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return E.apply(this,_(T))}))})),[(s=c.Element)==null?void 0:s.prototype,(i=c.CharacterData)==null?void 0:i.prototype,(a=c.DocumentType)==null?void 0:a.prototype].forEach((w=>{y(w,"before",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return E.apply(this,_(T))})),y(w,"after",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return E.apply(this,_(T))})),y(w,"replaceWith",(E=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];var R=_(T);return T.length&&!R.length?void 0:E.apply(this,R)}))})),y((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(w=>function(E,P){var T=x(P);return T?w.call(this,E,T):null})),this.ka=()=>{h.forEach((w=>w())),this.ka=void 0},this.Sa()}Sa(){var t=!1;return()=>{var e;t||(t=!0,this.ma--,this.ma===0&&((e=this.ka)==null||e.call(this)))}}Ca(t,e){e===void 0&&(e=!0);var n=this.xa();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var a;!e.errored&&this.ya.length&&(ti.info("Processing "+this.ya.length+" events for site app with id "+t.id),this.ya.forEach((u=>this.Ca((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this._a)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,ti.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.Ca((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){ti.error(hC+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){ti.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}Ia(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}Ta(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.Ca((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){ti.error("Error while processing event "+t.event+" for site app "+i.id,a)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Ia(),void this._instance.on("eventCaptured",(c=>this.Ta(c)))):void ti.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this._a)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(){var c,d=u.id,h=u.url;He["__$$ph_site_app_"+d]=s._instance,(c=He.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,h,(p=>{if(p)return ti.error(hC+d,p)}))};for(var u of i.siteApps)a()}else ti.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},ON={tracingHeaders:class{constructor(t){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,n,r=this.Pa();r?(ge(this.Ma)&&(this.Ma=(e=He.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),ge(this.Ea)&&(this.Ea=(n=He.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=t}initialize(){this.startIfEnabledOrStop()}tr(t){var e,n;(e=He.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=He.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return xN.error("failed to load script",r);t()}))}Oa(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}Pa(){var t=this.Oa();return nt(t)?(nt(this.Ra)?this.Ra.splice(0,this.Ra.length,...t):this.Ra=[...t],t.length>0?this.Ra:void 0):(nt(this.Ra)&&this.Ra.splice(0),this.Ra=t||void 0,this.Ra)}Ko(){var t,e;(t=this.Ma)==null||t.call(this),(e=this.Ea)==null||e.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.tr(this.Wo):this.Ko()}}},LN=de({surveys:class{get Te(){return this._instance.config}constructor(t){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return yt.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(tt(e))return yt.warn("Flags not loaded yet. Not loading surveys.");var n=nt(e);this.Fa=n?e.length>0:e,yt.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(MP)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.La)yt.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)yt.info(pC);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())yt.info("Not loading surveys in cookieless mode without consent.");else{var t=He==null?void 0:He.__PosthogExtensions__;if(t){if(!ge(this.Fa)||this.Te.advanced_enable_surveys){var e=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var n=t.generateSurveys;if(n)return void this.Da(n,e);var r=t.loadExternalDependency;if(!r)return void this.qa(A2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.qa("Could not load surveys script",s):this.Da(t.generateSurveys,e)}))}catch(s){throw this.qa("Error initializing surveys",s),s}finally{this.La=!1}}}else yt.error("PostHog Extensions not found.")}}Da(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new CN(this._instance),yt.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(t,e){yt.error(t,e),this.ja({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.$a.push(t),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return yt.info(pC),t([]);var n,r=this._instance.get_property(ky);if(r&&!e)return t(r,{isLoaded:!0}),void(this.Ha()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.Aa?this.Aa.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.Aa=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:s=>{var i;this.Aa=null;var a=s.statusCode;if(a!==200||!s.json){var u="Surveys API could not be loaded, status: "+a;yt.error(u),this.Na=Date.now();var c={isLoaded:!1,error:u};return t([],c),void(n==null||n({surveys:[],context:c}))}this.Na=null;var d,h=s.json.surveys||[],p=h.filter((y=>(function(x){return!(!x.start_date||x.end_date)})(y)&&(IP(y)||(function(x){var _;return!((_=x.conditions)==null||(_=_.actions)==null||(_=_.values)==null||!_.length)})(y))));p.length>0&&((d=this._surveyEventReceiver)==null||d.register(p)),(i=this._instance.persistence)==null||i.register({[ky]:h,[dm]:Date.now()});var m={isLoaded:!0};t(h,m),n==null||n({surveys:h,context:m})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var t=this._instance.get_property(dm);return Hn(t)&&Date.now()-t>3e5}Ua(){return Hn(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};OP(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ja(t){for(var e of this.$a)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){yt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!tt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);yt.warn("init was not called")}za(t){var e=null;return this.getSurveys((n=>{var r;e=(r=n.find((s=>s.id===t)))!==null&&r!==void 0?r:null})),e}Va(t){if(tt(this._surveyManager))return{eligible:!1,reason:zv};var e=typeof t=="string"?this.za(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(tt(this._surveyManager))return yt.warn("init was not called"),{visible:!1,disabledReason:zv};var e=this.Va(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return tt(this._surveyManager)?(yt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:zv})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((u=>u.id===t)))!==null&&s!==void 0?s:null;if(i){var a=this.Va(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(tt(this._surveyManager))yt.warn("init was not called");else{var s=typeof t=="string"?this.za(t):t;if(s!=null&&s.id)if(cN.includes(s.type)){var i=ke==null?void 0:ke.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(yt.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;yt.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,i,n),yt.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);yt.warn("Survey element not found")}else yt.warn("Surveys of type "+s.type+" cannot be rendered in the app");else yt.warn("Survey not found")}}displaySurvey(t,e){var n;if(tt(this._surveyManager))yt.warn("init was not called");else{var r=this.za(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=de({},r,{appearance:de({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==jy.Popover&&e.initialResponses&&yt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void yt.warn("Survey is not eligible to be displayed: ",i.disabledReason)}e.displayType!==jy.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else yt.warn("Survey not found")}}cancelPendingSurvey(t){tt(this._surveyManager)?yt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},s0),DN={toolbar:class{constructor(t){this.instance=t}Wa(t){He.ph_toolbar_state=t}Za(){var t;return(t=He.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),B6(this.instance.config)||!ne||!ke)return!1;t=t??ne.location,n=n??ne.history;try{if(!e){try{ne.localStorage.setItem("test","test"),ne.localStorage.removeItem("test")}catch{return!1}e=ne==null?void 0:ne.localStorage}var r,s=kN||ym(t.hash,"__posthog")||ym(t.hash,"state"),i=s?NE((()=>JSON.parse(atob(decodeURIComponent(s)))))||NE((()=>JSON.parse(decodeURIComponent(s)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(mC)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Ga(t){var e=He.ph_load_toolbar||He.ph_load_editor;!tt(e)&&Us(e)?e(t,this.instance):gC.warn("No toolbar load function found")}loadToolbar(t){var e=!(ke==null||!ke.getElementById(q6));if(!ne||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=de({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ne.localStorage.setItem(mC,JSON.stringify(de({},r,{source:void 0}))),this.Za()===2)this.Ga(r);else if(this.Za()===0){var s;this.Wa(1),(s=He.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return gC.error("[Toolbar] Failed to load",i),void this.Wa(0);this.Wa(2),this.Ga(r)})),zt(ne,"turbolinks:load",(()=>{this.Wa(0),this.loadToolbar(r)}))}return!0}Qa(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},NN=de({experiments:Yn},s0),jN={conversations:class{constructor(t){this.Ja=void 0,this._conversationsManager=null,this.Ka=!1,this.Ya=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;tt(e)||(Bs(e)?this.Ja=e:(this.Ja=e.enabled,this.Ya=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ja=void 0,this.Ya=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ka||this._instance.config.disable_conversations||B6(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=He==null?void 0:He.__PosthogExtensions__;if(t&&!ge(this.Ja)&&this.Ja)if(this.Ya&&this.Ya.token){this.Ka=!0;try{var e=t.initConversations;if(e)return this.Xa(e),void(this.Ka=!1);var n=t.loadExternalDependency;if(!n)return void this.tl(A2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.tl("Could not load conversations script",r):this.Xa(t.initConversations),this.Ka=!1}))}catch(r){this.tl("Error initializing conversations",r),this.Ka=!1}}else gs.error("Conversations enabled but missing token in remote config.")}}Xa(t){if(this.Ya)try{this._conversationsManager=t(this.Ya,this._instance),gs.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else gs.error("Cannot complete initialization: remote config is null")}tl(t,e){gs.error(t,e),this._conversationsManager=null,this.Ka=!1}show(){this._conversationsManager?this._conversationsManager.show():gs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ja===!0&&!fr(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return tn((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(gs.warn($a),null)}))()}getMessages(t,e){var n=this;return tn((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(gs.warn($a),null)}))()}markAsRead(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(gs.warn($a),null)}))()}getTickets(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(gs.warn($a),null)}))()}requestRestoreLink(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(gs.warn($a),null)}))()}restoreFromToken(t){var e=this;return tn((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(gs.warn($a),null)}))()}restoreFromUrlToken(){var t=this;return tn((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(gs.warn($a),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}En(){var t;(t=this._conversationsManager)==null||t.setIdentity()}Rn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},FN={logs:class{constructor(t){var e;this.el=!1,this.rl=!1,this.it=Vt("[logs]"),this.Gr=[],this.il=[],this.Hs=0,this.nl=()=>{var n,r;this.Hs=0,(n=this.sl)==null||n.onReconnect(),(r=this.ol)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.el=!0),ne&&zt(ne,"online",this.nl)}al(t,e,n,r){var s,i=(function(a,u){var c,d,h,p,m,y,x,_=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,w=(d=a==null?void 0:a.maxBufferSize)!==null&&d!==void 0?d:100,E=u!=null&&u.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,P=ge(E)?Math.max(w,2048):Math.max(w,E),T=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(m=T==null?void 0:T["service.name"])!==null&&m!==void 0?m:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:u==null?void 0:u.serviceNameDefault,serviceVersion:(y=T==null?void 0:T["service.version"])!==null&&y!==void 0?y:a==null?void 0:a.serviceVersion,environment:(x=T==null?void 0:T["deployment.environment"])!==null&&x!==void 0?x:a==null?void 0:a.environment,resourceAttributes:T,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:_,maxBufferSize:w,maxQueueSize:P,maxBatchRecordsPerPost:100,rateCapWindowMs:_,maxLogsPerInterval:E,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new BL(this.ll(t,e),i,this.it,(()=>this.ul()),(a=>a()),void 0,r),i]}hl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.sl||this.dl!==e){var n;(n=this.sl)==null||n.reset(),this.dl=e;var r=this.al((()=>this.Gr),(s=>{this.Gr=s}));this.sl=r[0],this.cl=r[1]}return this.sl}vl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.ol||this.fl!==e){var n;(n=this.ol)==null||n.reset(),this.fl=e;var r=this.al((()=>this.il),(s=>{this.il=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},xC);this.ol=r[0],this.pl=r[1]}return this.ol}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!tt(n)&&n&&(this.el=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],(t=this.sl)==null||t.reset(),this.il=[],(e=this.ol)==null||e.reset(),this.Hs=0}captureLog(t){this.hl().captureLog(t)}le(t){this.vl().captureLog(t)}get logger(){return this.gl||(this.gl={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.gl}flushLogs(t){t?this.ml(t):(this.sl&&this.sl.flush().catch((e=>this.it.error("PostHog logs flush failed:",e))),this.ol&&this.ol.flush().catch((e=>this.it.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.el&&!this.rl){var t=He==null?void 0:He.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.it.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.rl=!0)})):this.it.error(A2)}else this.it.error("PostHog Extensions not found.")}}ll(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Bi.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Bi.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},$t:r=>this.$t(r),getLibraryId:()=>xt.LIB_NAME,getLibraryVersion:()=>xt.LIB_VERSION}}$t(t){return new Promise((e=>{if(lP(this.Hs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>r({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.yl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this.bl(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var u;r({kind:"retry-later",error:(u=i.error)!==null&&u!==void 0?u:new Error("logs request failed with status "+a)})}}})}}))}bl(t){(t!==0||this._instance.__loaded)&&(this.Hs=uP(t,this.Hs,3,(()=>this.it.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}ml(t){this.Gr.length>0&&this._l(t,this.Gr,this.cl,xt.LIB_NAME,(e=>{this.Gr=e})),this.il.length>0&&this._l(t,this.il,this.pl,xC,(e=>{this.il=e}))}_l(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=A6(i,R6(n,xt.LIB_NAME,xt.LIB_VERSION),r,xt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.yl(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}yl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ul(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,tt(s)||(e.sessionStartTimestamp=s),tt(i)||(e.lastActivityTimestamp=i)}if(He!=null&&(t=He.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ra(He.location.href):He.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},VN={metrics:class{constructor(t){this.it=Vt("[metrics]"),this._instance=t}initialize(){}hl(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.sl&&this.dl===n||((e=this.sl)==null||e.reset(),this.dl=n,this.sl=new WL(this.ll(),(function(r){var s,i,a,u,c,d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(a=d==null?void 0:d["deployment.environment"])!==null&&a!==void 0?a:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(u=r==null?void 0:r.flushIntervalMs)!==null&&u!==void 0?u:1e4,maxSeriesPerFlush:(c=r==null?void 0:r.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(n),this.it)),this.sl}count(t,e,n){e===void 0&&(e=1),this.hl().count(t,e,n)}gauge(t,e,n){this.hl().gauge(t,e,n)}histogram(t,e,n){this.hl().histogram(t,e,n)}flush(t){if(!this.sl)return Promise.resolve();if(t){var e=this.sl.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.sl.flush().catch((n=>this.it.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.sl)==null||t.reset()}ll(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:n=>e.Kt(n),getLibraryId:()=>xt.LIB_NAME,getLibraryVersion:()=>xt.LIB_VERSION}}Kt(t,e){return new Promise((n=>{var r=!1,s=a=>{r||(r=!0,clearTimeout(i),n(a))},i=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(de({method:"POST",url:this.wl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var u=a.statusCode;if(u>=200&&300>u)s({kind:"ok"});else if(u===413)s({kind:"too-large"});else if(u!==0&&u!==429&&500>u)s({kind:"fatal",error:new Error("metrics request failed with status "+u)});else{var c;s({kind:"retry-later",error:(c=a.error)!==null&&c!==void 0?c:new Error("metrics request failed with status "+u)})}}}))}))}wl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},$N=de({},s0,TN,RN,AN,IN,MN,LN,ON,DN,NN,jN,FN,VN);_s.__defaultExtensionClasses=de({},$N);var Ce=(function(){xt.SDK_DIST_CHANNEL="npm";var t=kd[gu]=new _s;return(function(){function e(){e.done||(e.done=!0,DP=!1,bt(kd,(function(n){n._dom_loaded()})))}ke!=null&&ke.addEventListener?ke.readyState==="complete"?e():zt(ke,"DOMContentLoaded",e,{capture:!1}):ne&&xe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),NP;function HN(t){NP=t}function Gy(){return NP}var V2=g.createContext({get client(){return Gy()},bootstrap:void 0});function jP(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,a=r;i<a.length;i++){var u=a[i];if(!s.includes(u)||!jP(t[u],e[u],n))return!1}return!0}function zN(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,u=g.useRef(null),c=g.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=Gy();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(a)]);return g.useEffect(function(){if(!(s||!i)){var d=Gy(),h=u.current;h?(i!==h.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!jP(a,h.options)&&d.set_config(a),u.current={apiKey:i,options:a??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,a),u.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),ve.createElement(V2.Provider,{value:{client:c,bootstrap:(e=a==null?void 0:a.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var Bv=function(t){return typeof t=="function"},i0=function(){var t=g.useContext(V2).client;return t},Ky=function(t,e){return Ky=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Ky(t,e)};function UN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ky(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var BN={componentStack:null,exceptionEvent:null,error:null},WN={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},GN=(function(t){UN(e,t);function e(n){var r=t.call(this,n)||this;return r.state=BN,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Bv(s)?i=s(n):typeof s=="object"&&(i=s);var a=this.context.client,u=a.captureException(n,i),c=r.componentStack;this.setState({error:n,componentStack:c??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Bv(r)?r():r;var a=Bv(s)?ve.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ve.isValidElement(a)?a:(console.warn(WN.INVALID_FALLBACK),ve.createElement(ve.Fragment,null))},e.contextType=V2,e})(ve.Component);HN(Ce);var ep={},Wv={exports:{}},Sr={},Gv={exports:{}},Kv={};/**
19
- * @license React
20
- * scheduler.production.min.js
21
- *
22
- * Copyright (c) Facebook, Inc. and its affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var wC;function KN(){return wC||(wC=1,(function(t){function e($,J){var H=$.length;$.push(J);e:for(;0<H;){var j=H-1>>>1,X=$[j];if(0<s(X,J))$[j]=J,$[H]=X,H=j;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var J=$[0],H=$.pop();if(H!==J){$[0]=H;e:for(var j=0,X=$.length,te=X>>>1;j<te;){var ie=2*(j+1)-1,ae=$[ie],ue=ie+1,Se=$[ue];if(0>s(ae,H))ue<X&&0>s(Se,ae)?($[j]=Se,$[ue]=H,j=ue):($[j]=ae,$[ie]=H,j=ie);else if(ue<X&&0>s(Se,H))$[j]=Se,$[ue]=H,j=ue;else break e}}return J}function s($,J){var H=$.sortIndex-J.sortIndex;return H!==0?H:$.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],d=[],h=1,p=null,m=3,y=!1,x=!1,_=!1,w=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T($){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=$)r(d),J.sortIndex=J.expirationTime,e(c,J);else break;J=n(d)}}function k($){if(_=!1,T($),!x)if(n(c)!==null)x=!0,B(R);else{var J=n(d);J!==null&&K(k,J.startTime-$)}}function R($,J){x=!1,_&&(_=!1,E(A),A=-1),y=!0;var H=m;try{for(T(J),p=n(c);p!==null&&(!(p.expirationTime>J)||$&&!F());){var j=p.callback;if(typeof j=="function"){p.callback=null,m=p.priorityLevel;var X=j(p.expirationTime<=J);J=t.unstable_now(),typeof X=="function"?p.callback=X:p===n(c)&&r(c),T(J)}else r(c);p=n(c)}if(p!==null)var te=!0;else{var ie=n(d);ie!==null&&K(k,ie.startTime-J),te=!1}return te}finally{p=null,m=H,y=!1}}var L=!1,O=null,A=-1,M=5,D=-1;function F(){return!(t.unstable_now()-D<M)}function N(){if(O!==null){var $=t.unstable_now();D=$;var J=!0;try{J=O(!0,$)}finally{J?G():(L=!1,O=null)}}else L=!1}var G;if(typeof P=="function")G=function(){P(N)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,Y=Z.port2;Z.port1.onmessage=N,G=function(){Y.postMessage(null)}}else G=function(){w(N,0)};function B($){O=$,L||(L=!0,G())}function K($,J){A=w(function(){$(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){x||y||(x=!0,B(R))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var H=m;m=J;try{return $()}finally{m=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,J){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=m;m=$;try{return J()}finally{m=H}},t.unstable_scheduleCallback=function($,J,H){var j=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?j+H:j):H=j,$){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=H+X,$={id:h++,callback:J,priorityLevel:$,startTime:H,expirationTime:X,sortIndex:-1},H>j?($.sortIndex=H,e(d,$),n(c)===null&&$===n(d)&&(_?(E(A),A=-1):_=!0,K(k,H-j))):($.sortIndex=X,e(c,$),x||y||(x=!0,B(R))),$},t.unstable_shouldYield=F,t.unstable_wrapCallback=function($){var J=m;return function(){var H=m;m=J;try{return $.apply(this,arguments)}finally{m=H}}}})(Kv)),Kv}var bC;function qN(){return bC||(bC=1,Gv.exports=KN()),Gv.exports}/**
27
- * @license React
28
- * react-dom.production.min.js
29
- *
30
- * Copyright (c) Facebook, Inc. and its affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var SC;function ZN(){if(SC)return Sr;SC=1;var t=g2(),e=qN();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(s[o]=l,o=0;o<l.length;o++)r.add(l[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function m(o){return c.call(p,o)?!0:c.call(h,o)?!1:d.test(o)?p[o]=!0:(h[o]=!0,!1)}function y(o,l,f,v){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return v?!1:f!==null?!f.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,l,f,v){if(l===null||typeof l>"u"||y(o,l,f,v))return!0;if(v)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function _(o,l,f,v,b,C,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=v,this.attributeNamespace=b,this.mustUseProperty=f,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=I}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new _(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];w[l]=new _(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new _(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new _(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){w[o]=new _(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new _(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new _(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new _(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new _(o,5,!1,o.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function P(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var l=o.replace(E,P);w[l]=new _(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(E,P);w[l]=new _(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(E,P);w[l]=new _(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new _(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new _(o,1,!1,o.toLowerCase(),null,!0,!0)});function T(o,l,f,v){var b=w.hasOwnProperty(l)?w[l]:null;(b!==null?b.type!==0:v||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,f,b,v)&&(f=null),v||b===null?m(l)&&(f===null?o.removeAttribute(l):o.setAttribute(l,""+f)):b.mustUseProperty?o[b.propertyName]=f===null?b.type===3?!1:"":f:(l=b.attributeName,v=b.attributeNamespace,f===null?o.removeAttribute(l):(b=b.type,f=b===3||b===4&&f===!0?"":""+f,v?o.setAttributeNS(v,l,f):o.setAttribute(l,f))))}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),L=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),F=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),$=Symbol.iterator;function J(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var H=Object.assign,j;function X(o){if(j===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);j=l&&l[1]||""}return`
35
- `+j+o}var te=!1;function ie(o,l){if(!o||te)return"";te=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(re){var v=re}Reflect.construct(o,[],l)}else{try{l.call()}catch(re){v=re}o.call(l.prototype)}else{try{throw Error()}catch(re){v=re}o()}}catch(re){if(re&&v&&typeof re.stack=="string"){for(var b=re.stack.split(`
36
- `),C=v.stack.split(`
37
- `),I=b.length-1,V=C.length-1;1<=I&&0<=V&&b[I]!==C[V];)V--;for(;1<=I&&0<=V;I--,V--)if(b[I]!==C[V]){if(I!==1||V!==1)do if(I--,V--,0>V||b[I]!==C[V]){var W=`
38
- `+b[I].replace(" at new "," at ");return o.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",o.displayName)),W}while(1<=I&&0<=V);break}}}finally{te=!1,Error.prepareStackTrace=f}return(o=o?o.displayName||o.name:"")?X(o):""}function ae(o){switch(o.tag){case 5:return X(o.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return o=ie(o.type,!1),o;case 11:return o=ie(o.type.render,!1),o;case 1:return o=ie(o.type,!0),o;default:return""}}function ue(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case O:return"Fragment";case L:return"Portal";case M:return"Profiler";case A:return"StrictMode";case G:return"Suspense";case Z:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case F:return(o.displayName||"Context")+".Consumer";case D:return(o._context.displayName||"Context")+".Provider";case N:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Y:return l=o.displayName||null,l!==null?l:ue(o.type)||"Memo";case B:l=o._payload,o=o._init;try{return ue(o(l))}catch{}}return null}function Se(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(l);case 8:return l===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function oe(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function se(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ye(o){var l=se(o)?"checked":"value",f=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),v=""+o[l];if(!o.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,C=f.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(I){v=""+I,C.call(this,I)}}),Object.defineProperty(o,l,{enumerable:f.enumerable}),{getValue:function(){return v},setValue:function(I){v=""+I},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function be(o){o._valueTracker||(o._valueTracker=ye(o))}function Fe(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var f=l.getValue(),v="";return o&&(v=se(o)?o.checked?"true":"false":o.value),o=v,o!==f?(l.setValue(o),!0):!1}function Re(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function We(o,l){var f=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??o._wrapperState.initialChecked})}function Tt(o,l){var f=l.defaultValue==null?"":l.defaultValue,v=l.checked!=null?l.checked:l.defaultChecked;f=oe(l.value!=null?l.value:f),o._wrapperState={initialChecked:v,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Ye(o,l){l=l.checked,l!=null&&T(o,"checked",l,!1)}function we(o,l){Ye(o,l);var f=oe(l.value),v=l.type;if(f!=null)v==="number"?(f===0&&o.value===""||o.value!=f)&&(o.value=""+f):o.value!==""+f&&(o.value=""+f);else if(v==="submit"||v==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?Ee(o,l.type,f):l.hasOwnProperty("defaultValue")&&Ee(o,l.type,oe(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function It(o,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var v=l.type;if(!(v!=="submit"&&v!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,f||l===o.value||(o.value=l),o.defaultValue=l}f=o.name,f!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,f!==""&&(o.name=f)}function Ee(o,l,f){(l!=="number"||Re(o.ownerDocument)!==o)&&(f==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+f&&(o.defaultValue=""+f))}var Xe=Array.isArray;function vt(o,l,f,v){if(o=o.options,l){l={};for(var b=0;b<f.length;b++)l["$"+f[b]]=!0;for(f=0;f<o.length;f++)b=l.hasOwnProperty("$"+o[f].value),o[f].selected!==b&&(o[f].selected=b),b&&v&&(o[f].defaultSelected=!0)}else{for(f=""+oe(f),l=null,b=0;b<o.length;b++){if(o[b].value===f){o[b].selected=!0,v&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function Ge(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function at(o,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(n(92));if(Xe(f)){if(1<f.length)throw Error(n(93));f=f[0]}l=f}l==null&&(l=""),f=l}o._wrapperState={initialValue:oe(f)}}function tr(o,l){var f=oe(l.value),v=oe(l.defaultValue);f!=null&&(f=""+f,f!==o.value&&(o.value=f),l.defaultValue==null&&o.defaultValue!==f&&(o.defaultValue=f)),v!=null&&(o.defaultValue=""+v)}function vn(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function Bt(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ss(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?Bt(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var nr,is=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,v,b){MSApp.execUnsafeLocalFunction(function(){return o(l,f,v,b)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(nr=nr||document.createElement("div"),nr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=nr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function rn(o,l){if(l){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=l;return}}o.textContent=l}var pr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qs=["Webkit","ms","Moz","O"];Object.keys(pr).forEach(function(o){qs.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),pr[l]=pr[o]})});function Al(o,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||pr.hasOwnProperty(o)&&pr[o]?(""+l).trim():l+"px"}function Mn(o,l){o=o.style;for(var f in l)if(l.hasOwnProperty(f)){var v=f.indexOf("--")===0,b=Al(f,l[f],v);f==="float"&&(f="cssFloat"),v?o.setProperty(f,b):o[f]=b}}var Si=H({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ps(o,l){if(l){if(Si[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Zs(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var os=null;function yn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var mo=null,jr=null,as=null;function Ei(o){if(o=Lc(o)){if(typeof mo!="function")throw Error(n(280));var l=o.stateNode;l&&(l=sh(l),mo(o.stateNode,o.type,l))}}function Ze(o){jr?as?as.push(o):as=[o]:jr=o}function Mt(){if(jr){var o=jr,l=as;if(as=jr=null,Ei(o),l)for(o=0;o<l.length;o++)Ei(l[o])}}function Wt(o,l){return o(l)}function Sn(){}var Fr=!1;function Xt(o,l,f){if(Fr)return o(l,f);Fr=!0;try{return Wt(o,l,f)}finally{Fr=!1,(jr!==null||as!==null)&&(Sn(),Mt())}}function un(o,l){var f=o.stateNode;if(f===null)return null;var v=sh(f);if(v===null)return null;f=v[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(o=o.type,v=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!v;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(n(231,l,typeof f));return f}var Ys=!1;if(u)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){Ys=!0}}),window.addEventListener("test",cn,cn),window.removeEventListener("test",cn,cn)}catch{Ys=!1}function Bn(o,l,f,v,b,C,I,V,W){var re=Array.prototype.slice.call(arguments,3);try{l.apply(f,re)}catch(fe){this.onError(fe)}}var Ts=!1,mr=null,xa=!1,gc=null,Nf={onError:function(o){Ts=!0,mr=o}};function M0(o,l,f,v,b,C,I,V,W){Ts=!1,mr=null,Bn.apply(Nf,arguments)}function O0(o,l,f,v,b,C,I,V,W){if(M0.apply(this,arguments),Ts){if(Ts){var re=mr;Ts=!1,mr=null}else throw Error(n(198));xa||(xa=!0,gc=re)}}function Rs(o){var l=o,f=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(f=l.return),o=l.return;while(o)}return l.tag===3?f:null}function jf(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function Ff(o){if(Rs(o)!==o)throw Error(n(188))}function L0(o){var l=o.alternate;if(!l){if(l=Rs(o),l===null)throw Error(n(188));return l!==o?null:o}for(var f=o,v=l;;){var b=f.return;if(b===null)break;var C=b.alternate;if(C===null){if(v=b.return,v!==null){f=v;continue}break}if(b.child===C.child){for(C=b.child;C;){if(C===f)return Ff(b),o;if(C===v)return Ff(b),l;C=C.sibling}throw Error(n(188))}if(f.return!==v.return)f=b,v=C;else{for(var I=!1,V=b.child;V;){if(V===f){I=!0,f=b,v=C;break}if(V===v){I=!0,v=b,f=C;break}V=V.sibling}if(!I){for(V=C.child;V;){if(V===f){I=!0,f=C,v=b;break}if(V===v){I=!0,v=C,f=b;break}V=V.sibling}if(!I)throw Error(n(189))}}if(f.alternate!==v)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?o:l}function Vf(o){return o=L0(o),o!==null?Il(o):null}function Il(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=Il(o);if(l!==null)return l;o=o.sibling}return null}var Ml=e.unstable_scheduleCallback,vc=e.unstable_cancelCallback,D0=e.unstable_shouldYield,Mw=e.unstable_requestPaint,_t=e.unstable_now,$f=e.unstable_getCurrentPriorityLevel,wa=e.unstable_ImmediatePriority,Hf=e.unstable_UserBlockingPriority,ba=e.unstable_NormalPriority,Ol=e.unstable_LowPriority,Ll=e.unstable_IdlePriority,Sa=null,Vr=null;function zf(o){if(Vr&&typeof Vr.onCommitFiberRoot=="function")try{Vr.onCommitFiberRoot(Sa,o,void 0,(o.current.flags&128)===128)}catch{}}var gr=Math.clz32?Math.clz32:Ie,z=Math.log,le=Math.LN2;function Ie(o){return o>>>=0,o===0?32:31-(z(o)/le|0)|0}var he=64,pe=4194304;function Pe(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Ke(o,l){var f=o.pendingLanes;if(f===0)return 0;var v=0,b=o.suspendedLanes,C=o.pingedLanes,I=f&268435455;if(I!==0){var V=I&~b;V!==0?v=Pe(V):(C&=I,C!==0&&(v=Pe(C)))}else I=f&~b,I!==0?v=Pe(I):C!==0&&(v=Pe(C));if(v===0)return 0;if(l!==0&&l!==v&&(l&b)===0&&(b=v&-v,C=l&-l,b>=C||b===16&&(C&4194240)!==0))return l;if((v&4)!==0&&(v|=f&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=v;0<l;)f=31-gr(l),b=1<<f,v|=o[f],l&=~b;return v}function Te(o,l){switch(o){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rr(o,l){for(var f=o.suspendedLanes,v=o.pingedLanes,b=o.expirationTimes,C=o.pendingLanes;0<C;){var I=31-gr(C),V=1<<I,W=b[I];W===-1?((V&f)===0||(V&v)!==0)&&(b[I]=Te(V,l)):W<=l&&(o.expiredLanes|=V),C&=~V}}function Wn(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function As(){var o=he;return he<<=1,(he&4194240)===0&&(he=64),o}function ls(o){for(var l=[],f=0;31>f;f++)l.push(o);return l}function vr(o,l,f){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-gr(l),o[l]=f}function On(o,l){var f=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var v=o.eventTimes;for(o=o.expirationTimes;0<f;){var b=31-gr(f),C=1<<b;l[b]=0,v[b]=-1,o[b]=-1,f&=~C}}function us(o,l){var f=o.entangledLanes|=l;for(o=o.entanglements;f;){var v=31-gr(f),b=1<<v;b&l|o[v]&l&&(o[v]|=l),f&=~b}}var lt=0;function Ow(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Lw,N0,Dw,Nw,jw,j0=!1,Uf=[],go=null,vo=null,yo=null,yc=new Map,_c=new Map,_o=[],XI="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fw(o,l){switch(o){case"focusin":case"focusout":go=null;break;case"dragenter":case"dragleave":vo=null;break;case"mouseover":case"mouseout":yo=null;break;case"pointerover":case"pointerout":yc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":_c.delete(l.pointerId)}}function xc(o,l,f,v,b,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:f,eventSystemFlags:v,nativeEvent:C,targetContainers:[b]},l!==null&&(l=Lc(l),l!==null&&N0(l)),o):(o.eventSystemFlags|=v,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function QI(o,l,f,v,b){switch(l){case"focusin":return go=xc(go,o,l,f,v,b),!0;case"dragenter":return vo=xc(vo,o,l,f,v,b),!0;case"mouseover":return yo=xc(yo,o,l,f,v,b),!0;case"pointerover":var C=b.pointerId;return yc.set(C,xc(yc.get(C)||null,o,l,f,v,b)),!0;case"gotpointercapture":return C=b.pointerId,_c.set(C,xc(_c.get(C)||null,o,l,f,v,b)),!0}return!1}function Vw(o){var l=Ea(o.target);if(l!==null){var f=Rs(l);if(f!==null){if(l=f.tag,l===13){if(l=jf(f),l!==null){o.blockedOn=l,jw(o.priority,function(){Dw(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Bf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var f=V0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(f===null){f=o.nativeEvent;var v=new f.constructor(f.type,f);os=v,f.target.dispatchEvent(v),os=null}else return l=Lc(f),l!==null&&N0(l),o.blockedOn=f,!1;l.shift()}return!0}function $w(o,l,f){Bf(o)&&f.delete(l)}function JI(){j0=!1,go!==null&&Bf(go)&&(go=null),vo!==null&&Bf(vo)&&(vo=null),yo!==null&&Bf(yo)&&(yo=null),yc.forEach($w),_c.forEach($w)}function wc(o,l){o.blockedOn===l&&(o.blockedOn=null,j0||(j0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,JI)))}function bc(o){function l(b){return wc(b,o)}if(0<Uf.length){wc(Uf[0],o);for(var f=1;f<Uf.length;f++){var v=Uf[f];v.blockedOn===o&&(v.blockedOn=null)}}for(go!==null&&wc(go,o),vo!==null&&wc(vo,o),yo!==null&&wc(yo,o),yc.forEach(l),_c.forEach(l),f=0;f<_o.length;f++)v=_o[f],v.blockedOn===o&&(v.blockedOn=null);for(;0<_o.length&&(f=_o[0],f.blockedOn===null);)Vw(f),f.blockedOn===null&&_o.shift()}var Dl=k.ReactCurrentBatchConfig,Wf=!0;function eM(o,l,f,v){var b=lt,C=Dl.transition;Dl.transition=null;try{lt=1,F0(o,l,f,v)}finally{lt=b,Dl.transition=C}}function tM(o,l,f,v){var b=lt,C=Dl.transition;Dl.transition=null;try{lt=4,F0(o,l,f,v)}finally{lt=b,Dl.transition=C}}function F0(o,l,f,v){if(Wf){var b=V0(o,l,f,v);if(b===null)ng(o,l,v,Gf,f),Fw(o,v);else if(QI(b,o,l,f,v))v.stopPropagation();else if(Fw(o,v),l&4&&-1<XI.indexOf(o)){for(;b!==null;){var C=Lc(b);if(C!==null&&Lw(C),C=V0(o,l,f,v),C===null&&ng(o,l,v,Gf,f),C===b)break;b=C}b!==null&&v.stopPropagation()}else ng(o,l,v,null,f)}}var Gf=null;function V0(o,l,f,v){if(Gf=null,o=yn(v),o=Ea(o),o!==null)if(l=Rs(o),l===null)o=null;else if(f=l.tag,f===13){if(o=jf(l),o!==null)return o;o=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Gf=o,null}function Hw(o){switch(o){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch($f()){case wa:return 1;case Hf:return 4;case ba:case Ol:return 16;case Ll:return 536870912;default:return 16}default:return 16}}var xo=null,$0=null,Kf=null;function zw(){if(Kf)return Kf;var o,l=$0,f=l.length,v,b="value"in xo?xo.value:xo.textContent,C=b.length;for(o=0;o<f&&l[o]===b[o];o++);var I=f-o;for(v=1;v<=I&&l[f-v]===b[C-v];v++);return Kf=b.slice(o,1<v?1-v:void 0)}function qf(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Zf(){return!0}function Uw(){return!1}function $r(o){function l(f,v,b,C,I){this._reactName=f,this._targetInst=b,this.type=v,this.nativeEvent=C,this.target=I,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(f=o[V],this[V]=f?f(C):C[V]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Zf:Uw,this.isPropagationStopped=Uw,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Zf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Zf)},persist:function(){},isPersistent:Zf}),l}var Nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},H0=$r(Nl),Sc=H({},Nl,{view:0,detail:0}),nM=$r(Sc),z0,U0,Ec,Yf=H({},Sc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:W0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Ec&&(Ec&&o.type==="mousemove"?(z0=o.screenX-Ec.screenX,U0=o.screenY-Ec.screenY):U0=z0=0,Ec=o),z0)},movementY:function(o){return"movementY"in o?o.movementY:U0}}),Bw=$r(Yf),rM=H({},Yf,{dataTransfer:0}),sM=$r(rM),iM=H({},Sc,{relatedTarget:0}),B0=$r(iM),oM=H({},Nl,{animationName:0,elapsedTime:0,pseudoElement:0}),aM=$r(oM),lM=H({},Nl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),uM=$r(lM),cM=H({},Nl,{data:0}),Ww=$r(cM),dM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fM={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},hM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pM(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=hM[o])?!!l[o]:!1}function W0(){return pM}var mM=H({},Sc,{key:function(o){if(o.key){var l=dM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=qf(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?fM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:W0,charCode:function(o){return o.type==="keypress"?qf(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?qf(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),gM=$r(mM),vM=H({},Yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gw=$r(vM),yM=H({},Sc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:W0}),_M=$r(yM),xM=H({},Nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),wM=$r(xM),bM=H({},Yf,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),SM=$r(bM),EM=[9,13,27,32],G0=u&&"CompositionEvent"in window,Cc=null;u&&"documentMode"in document&&(Cc=document.documentMode);var CM=u&&"TextEvent"in window&&!Cc,Kw=u&&(!G0||Cc&&8<Cc&&11>=Cc),qw=" ",Zw=!1;function Yw(o,l){switch(o){case"keyup":return EM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xw(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var jl=!1;function kM(o,l){switch(o){case"compositionend":return Xw(l);case"keypress":return l.which!==32?null:(Zw=!0,qw);case"textInput":return o=l.data,o===qw&&Zw?null:o;default:return null}}function PM(o,l){if(jl)return o==="compositionend"||!G0&&Yw(o,l)?(o=zw(),Kf=$0=xo=null,jl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Kw&&l.locale!=="ko"?null:l.data;default:return null}}var TM={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!TM[o.type]:l==="textarea"}function Jw(o,l,f,v){Ze(v),l=th(l,"onChange"),0<l.length&&(f=new H0("onChange","change",null,f,v),o.push({event:f,listeners:l}))}var kc=null,Pc=null;function RM(o){vb(o,0)}function Xf(o){var l=zl(o);if(Fe(l))return o}function AM(o,l){if(o==="change")return l}var eb=!1;if(u){var K0;if(u){var q0="oninput"in document;if(!q0){var tb=document.createElement("div");tb.setAttribute("oninput","return;"),q0=typeof tb.oninput=="function"}K0=q0}else K0=!1;eb=K0&&(!document.documentMode||9<document.documentMode)}function nb(){kc&&(kc.detachEvent("onpropertychange",rb),Pc=kc=null)}function rb(o){if(o.propertyName==="value"&&Xf(Pc)){var l=[];Jw(l,Pc,o,yn(o)),Xt(RM,l)}}function IM(o,l,f){o==="focusin"?(nb(),kc=l,Pc=f,kc.attachEvent("onpropertychange",rb)):o==="focusout"&&nb()}function MM(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Xf(Pc)}function OM(o,l){if(o==="click")return Xf(l)}function LM(o,l){if(o==="input"||o==="change")return Xf(l)}function DM(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Is=typeof Object.is=="function"?Object.is:DM;function Tc(o,l){if(Is(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var f=Object.keys(o),v=Object.keys(l);if(f.length!==v.length)return!1;for(v=0;v<f.length;v++){var b=f[v];if(!c.call(l,b)||!Is(o[b],l[b]))return!1}return!0}function sb(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function ib(o,l){var f=sb(o);o=0;for(var v;f;){if(f.nodeType===3){if(v=o+f.textContent.length,o<=l&&v>=l)return{node:f,offset:l-o};o=v}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=sb(f)}}function ob(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?ob(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function ab(){for(var o=window,l=Re();l instanceof o.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)o=l.contentWindow;else break;l=Re(o.document)}return l}function Z0(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function NM(o){var l=ab(),f=o.focusedElem,v=o.selectionRange;if(l!==f&&f&&f.ownerDocument&&ob(f.ownerDocument.documentElement,f)){if(v!==null&&Z0(f)){if(l=v.start,o=v.end,o===void 0&&(o=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(o,f.value.length);else if(o=(l=f.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var b=f.textContent.length,C=Math.min(v.start,b);v=v.end===void 0?C:Math.min(v.end,b),!o.extend&&C>v&&(b=v,v=C,C=b),b=ib(f,C);var I=ib(f,v);b&&I&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==I.node||o.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(b.node,b.offset),o.removeAllRanges(),C>v?(o.addRange(l),o.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),o.addRange(l)))}}for(l=[],o=f;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)o=l[f],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var jM=u&&"documentMode"in document&&11>=document.documentMode,Fl=null,Y0=null,Rc=null,X0=!1;function lb(o,l,f){var v=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;X0||Fl==null||Fl!==Re(v)||(v=Fl,"selectionStart"in v&&Z0(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Rc&&Tc(Rc,v)||(Rc=v,v=th(Y0,"onSelect"),0<v.length&&(l=new H0("onSelect","select",null,l,f),o.push({event:l,listeners:v}),l.target=Fl)))}function Qf(o,l){var f={};return f[o.toLowerCase()]=l.toLowerCase(),f["Webkit"+o]="webkit"+l,f["Moz"+o]="moz"+l,f}var Vl={animationend:Qf("Animation","AnimationEnd"),animationiteration:Qf("Animation","AnimationIteration"),animationstart:Qf("Animation","AnimationStart"),transitionend:Qf("Transition","TransitionEnd")},Q0={},ub={};u&&(ub=document.createElement("div").style,"AnimationEvent"in window||(delete Vl.animationend.animation,delete Vl.animationiteration.animation,delete Vl.animationstart.animation),"TransitionEvent"in window||delete Vl.transitionend.transition);function Jf(o){if(Q0[o])return Q0[o];if(!Vl[o])return o;var l=Vl[o],f;for(f in l)if(l.hasOwnProperty(f)&&f in ub)return Q0[o]=l[f];return o}var cb=Jf("animationend"),db=Jf("animationiteration"),fb=Jf("animationstart"),hb=Jf("transitionend"),pb=new Map,mb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function wo(o,l){pb.set(o,l),i(l,[o])}for(var J0=0;J0<mb.length;J0++){var eg=mb[J0],FM=eg.toLowerCase(),VM=eg[0].toUpperCase()+eg.slice(1);wo(FM,"on"+VM)}wo(cb,"onAnimationEnd"),wo(db,"onAnimationIteration"),wo(fb,"onAnimationStart"),wo("dblclick","onDoubleClick"),wo("focusin","onFocus"),wo("focusout","onBlur"),wo(hb,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ac="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$M=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ac));function gb(o,l,f){var v=o.type||"unknown-event";o.currentTarget=f,O0(v,l,void 0,o),o.currentTarget=null}function vb(o,l){l=(l&4)!==0;for(var f=0;f<o.length;f++){var v=o[f],b=v.event;v=v.listeners;e:{var C=void 0;if(l)for(var I=v.length-1;0<=I;I--){var V=v[I],W=V.instance,re=V.currentTarget;if(V=V.listener,W!==C&&b.isPropagationStopped())break e;gb(b,V,re),C=W}else for(I=0;I<v.length;I++){if(V=v[I],W=V.instance,re=V.currentTarget,V=V.listener,W!==C&&b.isPropagationStopped())break e;gb(b,V,re),C=W}}}if(xa)throw o=gc,xa=!1,gc=null,o}function Ot(o,l){var f=l[lg];f===void 0&&(f=l[lg]=new Set);var v=o+"__bubble";f.has(v)||(yb(l,o,2,!1),f.add(v))}function tg(o,l,f){var v=0;l&&(v|=4),yb(f,o,v,l)}var eh="_reactListening"+Math.random().toString(36).slice(2);function Ic(o){if(!o[eh]){o[eh]=!0,r.forEach(function(f){f!=="selectionchange"&&($M.has(f)||tg(f,!1,o),tg(f,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[eh]||(l[eh]=!0,tg("selectionchange",!1,l))}}function yb(o,l,f,v){switch(Hw(l)){case 1:var b=eM;break;case 4:b=tM;break;default:b=F0}f=b.bind(null,l,f,o),b=void 0,!Ys||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),v?b!==void 0?o.addEventListener(l,f,{capture:!0,passive:b}):o.addEventListener(l,f,!0):b!==void 0?o.addEventListener(l,f,{passive:b}):o.addEventListener(l,f,!1)}function ng(o,l,f,v,b){var C=v;if((l&1)===0&&(l&2)===0&&v!==null)e:for(;;){if(v===null)return;var I=v.tag;if(I===3||I===4){var V=v.stateNode.containerInfo;if(V===b||V.nodeType===8&&V.parentNode===b)break;if(I===4)for(I=v.return;I!==null;){var W=I.tag;if((W===3||W===4)&&(W=I.stateNode.containerInfo,W===b||W.nodeType===8&&W.parentNode===b))return;I=I.return}for(;V!==null;){if(I=Ea(V),I===null)return;if(W=I.tag,W===5||W===6){v=C=I;continue e}V=V.parentNode}}v=v.return}Xt(function(){var re=C,fe=yn(f),me=[];e:{var ce=pb.get(o);if(ce!==void 0){var Me=H0,Ne=o;switch(o){case"keypress":if(qf(f)===0)break e;case"keydown":case"keyup":Me=gM;break;case"focusin":Ne="focus",Me=B0;break;case"focusout":Ne="blur",Me=B0;break;case"beforeblur":case"afterblur":Me=B0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Me=Bw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Me=sM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Me=_M;break;case cb:case db:case fb:Me=aM;break;case hb:Me=wM;break;case"scroll":Me=nM;break;case"wheel":Me=SM;break;case"copy":case"cut":case"paste":Me=uM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Me=Gw}var Ve=(l&4)!==0,sn=!Ve&&o==="scroll",Q=Ve?ce!==null?ce+"Capture":null:ce;Ve=[];for(var q=re,ee;q!==null;){ee=q;var _e=ee.stateNode;if(ee.tag===5&&_e!==null&&(ee=_e,Q!==null&&(_e=un(q,Q),_e!=null&&Ve.push(Mc(q,_e,ee)))),sn)break;q=q.return}0<Ve.length&&(ce=new Me(ce,Ne,null,f,fe),me.push({event:ce,listeners:Ve}))}}if((l&7)===0){e:{if(ce=o==="mouseover"||o==="pointerover",Me=o==="mouseout"||o==="pointerout",ce&&f!==os&&(Ne=f.relatedTarget||f.fromElement)&&(Ea(Ne)||Ne[Ci]))break e;if((Me||ce)&&(ce=fe.window===fe?fe:(ce=fe.ownerDocument)?ce.defaultView||ce.parentWindow:window,Me?(Ne=f.relatedTarget||f.toElement,Me=re,Ne=Ne?Ea(Ne):null,Ne!==null&&(sn=Rs(Ne),Ne!==sn||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(Me=null,Ne=re),Me!==Ne)){if(Ve=Bw,_e="onMouseLeave",Q="onMouseEnter",q="mouse",(o==="pointerout"||o==="pointerover")&&(Ve=Gw,_e="onPointerLeave",Q="onPointerEnter",q="pointer"),sn=Me==null?ce:zl(Me),ee=Ne==null?ce:zl(Ne),ce=new Ve(_e,q+"leave",Me,f,fe),ce.target=sn,ce.relatedTarget=ee,_e=null,Ea(fe)===re&&(Ve=new Ve(Q,q+"enter",Ne,f,fe),Ve.target=ee,Ve.relatedTarget=sn,_e=Ve),sn=_e,Me&&Ne)t:{for(Ve=Me,Q=Ne,q=0,ee=Ve;ee;ee=$l(ee))q++;for(ee=0,_e=Q;_e;_e=$l(_e))ee++;for(;0<q-ee;)Ve=$l(Ve),q--;for(;0<ee-q;)Q=$l(Q),ee--;for(;q--;){if(Ve===Q||Q!==null&&Ve===Q.alternate)break t;Ve=$l(Ve),Q=$l(Q)}Ve=null}else Ve=null;Me!==null&&_b(me,ce,Me,Ve,!1),Ne!==null&&sn!==null&&_b(me,sn,Ne,Ve,!0)}}e:{if(ce=re?zl(re):window,Me=ce.nodeName&&ce.nodeName.toLowerCase(),Me==="select"||Me==="input"&&ce.type==="file")var $e=AM;else if(Qw(ce))if(eb)$e=LM;else{$e=MM;var Ue=IM}else(Me=ce.nodeName)&&Me.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&($e=OM);if($e&&($e=$e(o,re))){Jw(me,$e,f,fe);break e}Ue&&Ue(o,ce,re),o==="focusout"&&(Ue=ce._wrapperState)&&Ue.controlled&&ce.type==="number"&&Ee(ce,"number",ce.value)}switch(Ue=re?zl(re):window,o){case"focusin":(Qw(Ue)||Ue.contentEditable==="true")&&(Fl=Ue,Y0=re,Rc=null);break;case"focusout":Rc=Y0=Fl=null;break;case"mousedown":X0=!0;break;case"contextmenu":case"mouseup":case"dragend":X0=!1,lb(me,f,fe);break;case"selectionchange":if(jM)break;case"keydown":case"keyup":lb(me,f,fe)}var Be;if(G0)e:{switch(o){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else jl?Yw(o,f)&&(Qe="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Qe="onCompositionStart");Qe&&(Kw&&f.locale!=="ko"&&(jl||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&jl&&(Be=zw()):(xo=fe,$0="value"in xo?xo.value:xo.textContent,jl=!0)),Ue=th(re,Qe),0<Ue.length&&(Qe=new Ww(Qe,o,null,f,fe),me.push({event:Qe,listeners:Ue}),Be?Qe.data=Be:(Be=Xw(f),Be!==null&&(Qe.data=Be)))),(Be=CM?kM(o,f):PM(o,f))&&(re=th(re,"onBeforeInput"),0<re.length&&(fe=new Ww("onBeforeInput","beforeinput",null,f,fe),me.push({event:fe,listeners:re}),fe.data=Be))}vb(me,l)})}function Mc(o,l,f){return{instance:o,listener:l,currentTarget:f}}function th(o,l){for(var f=l+"Capture",v=[];o!==null;){var b=o,C=b.stateNode;b.tag===5&&C!==null&&(b=C,C=un(o,f),C!=null&&v.unshift(Mc(o,C,b)),C=un(o,l),C!=null&&v.push(Mc(o,C,b))),o=o.return}return v}function $l(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function _b(o,l,f,v,b){for(var C=l._reactName,I=[];f!==null&&f!==v;){var V=f,W=V.alternate,re=V.stateNode;if(W!==null&&W===v)break;V.tag===5&&re!==null&&(V=re,b?(W=un(f,C),W!=null&&I.unshift(Mc(f,W,V))):b||(W=un(f,C),W!=null&&I.push(Mc(f,W,V)))),f=f.return}I.length!==0&&o.push({event:l,listeners:I})}var HM=/\r\n?/g,zM=/\u0000|\uFFFD/g;function xb(o){return(typeof o=="string"?o:""+o).replace(HM,`
39
- `).replace(zM,"")}function nh(o,l,f){if(l=xb(l),xb(o)!==l&&f)throw Error(n(425))}function rh(){}var rg=null,sg=null;function ig(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var og=typeof setTimeout=="function"?setTimeout:void 0,UM=typeof clearTimeout=="function"?clearTimeout:void 0,wb=typeof Promise=="function"?Promise:void 0,BM=typeof queueMicrotask=="function"?queueMicrotask:typeof wb<"u"?function(o){return wb.resolve(null).then(o).catch(WM)}:og;function WM(o){setTimeout(function(){throw o})}function ag(o,l){var f=l,v=0;do{var b=f.nextSibling;if(o.removeChild(f),b&&b.nodeType===8)if(f=b.data,f==="/$"){if(v===0){o.removeChild(b),bc(l);return}v--}else f!=="$"&&f!=="$?"&&f!=="$!"||v++;f=b}while(f);bc(l)}function bo(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function bb(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return o;l--}else f==="/$"&&l++}o=o.previousSibling}return null}var Hl=Math.random().toString(36).slice(2),Xs="__reactFiber$"+Hl,Oc="__reactProps$"+Hl,Ci="__reactContainer$"+Hl,lg="__reactEvents$"+Hl,GM="__reactListeners$"+Hl,KM="__reactHandles$"+Hl;function Ea(o){var l=o[Xs];if(l)return l;for(var f=o.parentNode;f;){if(l=f[Ci]||f[Xs]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(o=bb(o);o!==null;){if(f=o[Xs])return f;o=bb(o)}return l}o=f,f=o.parentNode}return null}function Lc(o){return o=o[Xs]||o[Ci],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function zl(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function sh(o){return o[Oc]||null}var ug=[],Ul=-1;function So(o){return{current:o}}function Lt(o){0>Ul||(o.current=ug[Ul],ug[Ul]=null,Ul--)}function Rt(o,l){Ul++,ug[Ul]=o.current,o.current=l}var Eo={},Gn=So(Eo),yr=So(!1),Ca=Eo;function Bl(o,l){var f=o.type.contextTypes;if(!f)return Eo;var v=o.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===l)return v.__reactInternalMemoizedMaskedChildContext;var b={},C;for(C in f)b[C]=l[C];return v&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=b),b}function _r(o){return o=o.childContextTypes,o!=null}function ih(){Lt(yr),Lt(Gn)}function Sb(o,l,f){if(Gn.current!==Eo)throw Error(n(168));Rt(Gn,l),Rt(yr,f)}function Eb(o,l,f){var v=o.stateNode;if(l=l.childContextTypes,typeof v.getChildContext!="function")return f;v=v.getChildContext();for(var b in v)if(!(b in l))throw Error(n(108,Se(o)||"Unknown",b));return H({},f,v)}function oh(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Eo,Ca=Gn.current,Rt(Gn,o),Rt(yr,yr.current),!0}function Cb(o,l,f){var v=o.stateNode;if(!v)throw Error(n(169));f?(o=Eb(o,l,Ca),v.__reactInternalMemoizedMergedChildContext=o,Lt(yr),Lt(Gn),Rt(Gn,o)):Lt(yr),Rt(yr,f)}var ki=null,ah=!1,cg=!1;function kb(o){ki===null?ki=[o]:ki.push(o)}function qM(o){ah=!0,kb(o)}function Co(){if(!cg&&ki!==null){cg=!0;var o=0,l=lt;try{var f=ki;for(lt=1;o<f.length;o++){var v=f[o];do v=v(!0);while(v!==null)}ki=null,ah=!1}catch(b){throw ki!==null&&(ki=ki.slice(o+1)),Ml(wa,Co),b}finally{lt=l,cg=!1}}return null}var Wl=[],Gl=0,lh=null,uh=0,cs=[],ds=0,ka=null,Pi=1,Ti="";function Pa(o,l){Wl[Gl++]=uh,Wl[Gl++]=lh,lh=o,uh=l}function Pb(o,l,f){cs[ds++]=Pi,cs[ds++]=Ti,cs[ds++]=ka,ka=o;var v=Pi;o=Ti;var b=32-gr(v)-1;v&=~(1<<b),f+=1;var C=32-gr(l)+b;if(30<C){var I=b-b%5;C=(v&(1<<I)-1).toString(32),v>>=I,b-=I,Pi=1<<32-gr(l)+b|f<<b|v,Ti=C+o}else Pi=1<<C|f<<b|v,Ti=o}function dg(o){o.return!==null&&(Pa(o,1),Pb(o,1,0))}function fg(o){for(;o===lh;)lh=Wl[--Gl],Wl[Gl]=null,uh=Wl[--Gl],Wl[Gl]=null;for(;o===ka;)ka=cs[--ds],cs[ds]=null,Ti=cs[--ds],cs[ds]=null,Pi=cs[--ds],cs[ds]=null}var Hr=null,zr=null,$t=!1,Ms=null;function Tb(o,l){var f=ms(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=o,l=o.deletions,l===null?(o.deletions=[f],o.flags|=16):l.push(f)}function Rb(o,l){switch(o.tag){case 5:var f=o.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Hr=o,zr=bo(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Hr=o,zr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=ka!==null?{id:Pi,overflow:Ti}:null,o.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=ms(18,null,null,0),f.stateNode=l,f.return=o,o.child=f,Hr=o,zr=null,!0):!1;default:return!1}}function hg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function pg(o){if($t){var l=zr;if(l){var f=l;if(!Rb(o,l)){if(hg(o))throw Error(n(418));l=bo(f.nextSibling);var v=Hr;l&&Rb(o,l)?Tb(v,f):(o.flags=o.flags&-4097|2,$t=!1,Hr=o)}}else{if(hg(o))throw Error(n(418));o.flags=o.flags&-4097|2,$t=!1,Hr=o}}}function Ab(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Hr=o}function ch(o){if(o!==Hr)return!1;if(!$t)return Ab(o),$t=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!ig(o.type,o.memoizedProps)),l&&(l=zr)){if(hg(o))throw Ib(),Error(n(418));for(;l;)Tb(o,l),l=bo(l.nextSibling)}if(Ab(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"){if(l===0){zr=bo(o.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}o=o.nextSibling}zr=null}}else zr=Hr?bo(o.stateNode.nextSibling):null;return!0}function Ib(){for(var o=zr;o;)o=bo(o.nextSibling)}function Kl(){zr=Hr=null,$t=!1}function mg(o){Ms===null?Ms=[o]:Ms.push(o)}var ZM=k.ReactCurrentBatchConfig;function Dc(o,l,f){if(o=f.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var v=f.stateNode}if(!v)throw Error(n(147,o));var b=v,C=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(I){var V=b.refs;I===null?delete V[C]:V[C]=I},l._stringRef=C,l)}if(typeof o!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,o))}return o}function dh(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Mb(o){var l=o._init;return l(o._payload)}function Ob(o){function l(Q,q){if(o){var ee=Q.deletions;ee===null?(Q.deletions=[q],Q.flags|=16):ee.push(q)}}function f(Q,q){if(!o)return null;for(;q!==null;)l(Q,q),q=q.sibling;return null}function v(Q,q){for(Q=new Map;q!==null;)q.key!==null?Q.set(q.key,q):Q.set(q.index,q),q=q.sibling;return Q}function b(Q,q){return Q=Oo(Q,q),Q.index=0,Q.sibling=null,Q}function C(Q,q,ee){return Q.index=ee,o?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<q?(Q.flags|=2,q):ee):(Q.flags|=2,q)):(Q.flags|=1048576,q)}function I(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function V(Q,q,ee,_e){return q===null||q.tag!==6?(q=ov(ee,Q.mode,_e),q.return=Q,q):(q=b(q,ee),q.return=Q,q)}function W(Q,q,ee,_e){var $e=ee.type;return $e===O?fe(Q,q,ee.props.children,_e,ee.key):q!==null&&(q.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===B&&Mb($e)===q.type)?(_e=b(q,ee.props),_e.ref=Dc(Q,q,ee),_e.return=Q,_e):(_e=Dh(ee.type,ee.key,ee.props,null,Q.mode,_e),_e.ref=Dc(Q,q,ee),_e.return=Q,_e)}function re(Q,q,ee,_e){return q===null||q.tag!==4||q.stateNode.containerInfo!==ee.containerInfo||q.stateNode.implementation!==ee.implementation?(q=av(ee,Q.mode,_e),q.return=Q,q):(q=b(q,ee.children||[]),q.return=Q,q)}function fe(Q,q,ee,_e,$e){return q===null||q.tag!==7?(q=Da(ee,Q.mode,_e,$e),q.return=Q,q):(q=b(q,ee),q.return=Q,q)}function me(Q,q,ee){if(typeof q=="string"&&q!==""||typeof q=="number")return q=ov(""+q,Q.mode,ee),q.return=Q,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case R:return ee=Dh(q.type,q.key,q.props,null,Q.mode,ee),ee.ref=Dc(Q,null,q),ee.return=Q,ee;case L:return q=av(q,Q.mode,ee),q.return=Q,q;case B:var _e=q._init;return me(Q,_e(q._payload),ee)}if(Xe(q)||J(q))return q=Da(q,Q.mode,ee,null),q.return=Q,q;dh(Q,q)}return null}function ce(Q,q,ee,_e){var $e=q!==null?q.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return $e!==null?null:V(Q,q,""+ee,_e);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case R:return ee.key===$e?W(Q,q,ee,_e):null;case L:return ee.key===$e?re(Q,q,ee,_e):null;case B:return $e=ee._init,ce(Q,q,$e(ee._payload),_e)}if(Xe(ee)||J(ee))return $e!==null?null:fe(Q,q,ee,_e,null);dh(Q,ee)}return null}function Me(Q,q,ee,_e,$e){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return Q=Q.get(ee)||null,V(q,Q,""+_e,$e);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case R:return Q=Q.get(_e.key===null?ee:_e.key)||null,W(q,Q,_e,$e);case L:return Q=Q.get(_e.key===null?ee:_e.key)||null,re(q,Q,_e,$e);case B:var Ue=_e._init;return Me(Q,q,ee,Ue(_e._payload),$e)}if(Xe(_e)||J(_e))return Q=Q.get(ee)||null,fe(q,Q,_e,$e,null);dh(q,_e)}return null}function Ne(Q,q,ee,_e){for(var $e=null,Ue=null,Be=q,Qe=q=0,kn=null;Be!==null&&Qe<ee.length;Qe++){Be.index>Qe?(kn=Be,Be=null):kn=Be.sibling;var ht=ce(Q,Be,ee[Qe],_e);if(ht===null){Be===null&&(Be=kn);break}o&&Be&&ht.alternate===null&&l(Q,Be),q=C(ht,q,Qe),Ue===null?$e=ht:Ue.sibling=ht,Ue=ht,Be=kn}if(Qe===ee.length)return f(Q,Be),$t&&Pa(Q,Qe),$e;if(Be===null){for(;Qe<ee.length;Qe++)Be=me(Q,ee[Qe],_e),Be!==null&&(q=C(Be,q,Qe),Ue===null?$e=Be:Ue.sibling=Be,Ue=Be);return $t&&Pa(Q,Qe),$e}for(Be=v(Q,Be);Qe<ee.length;Qe++)kn=Me(Be,Q,Qe,ee[Qe],_e),kn!==null&&(o&&kn.alternate!==null&&Be.delete(kn.key===null?Qe:kn.key),q=C(kn,q,Qe),Ue===null?$e=kn:Ue.sibling=kn,Ue=kn);return o&&Be.forEach(function(Lo){return l(Q,Lo)}),$t&&Pa(Q,Qe),$e}function Ve(Q,q,ee,_e){var $e=J(ee);if(typeof $e!="function")throw Error(n(150));if(ee=$e.call(ee),ee==null)throw Error(n(151));for(var Ue=$e=null,Be=q,Qe=q=0,kn=null,ht=ee.next();Be!==null&&!ht.done;Qe++,ht=ee.next()){Be.index>Qe?(kn=Be,Be=null):kn=Be.sibling;var Lo=ce(Q,Be,ht.value,_e);if(Lo===null){Be===null&&(Be=kn);break}o&&Be&&Lo.alternate===null&&l(Q,Be),q=C(Lo,q,Qe),Ue===null?$e=Lo:Ue.sibling=Lo,Ue=Lo,Be=kn}if(ht.done)return f(Q,Be),$t&&Pa(Q,Qe),$e;if(Be===null){for(;!ht.done;Qe++,ht=ee.next())ht=me(Q,ht.value,_e),ht!==null&&(q=C(ht,q,Qe),Ue===null?$e=ht:Ue.sibling=ht,Ue=ht);return $t&&Pa(Q,Qe),$e}for(Be=v(Q,Be);!ht.done;Qe++,ht=ee.next())ht=Me(Be,Q,Qe,ht.value,_e),ht!==null&&(o&&ht.alternate!==null&&Be.delete(ht.key===null?Qe:ht.key),q=C(ht,q,Qe),Ue===null?$e=ht:Ue.sibling=ht,Ue=ht);return o&&Be.forEach(function(TO){return l(Q,TO)}),$t&&Pa(Q,Qe),$e}function sn(Q,q,ee,_e){if(typeof ee=="object"&&ee!==null&&ee.type===O&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case R:e:{for(var $e=ee.key,Ue=q;Ue!==null;){if(Ue.key===$e){if($e=ee.type,$e===O){if(Ue.tag===7){f(Q,Ue.sibling),q=b(Ue,ee.props.children),q.return=Q,Q=q;break e}}else if(Ue.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===B&&Mb($e)===Ue.type){f(Q,Ue.sibling),q=b(Ue,ee.props),q.ref=Dc(Q,Ue,ee),q.return=Q,Q=q;break e}f(Q,Ue);break}else l(Q,Ue);Ue=Ue.sibling}ee.type===O?(q=Da(ee.props.children,Q.mode,_e,ee.key),q.return=Q,Q=q):(_e=Dh(ee.type,ee.key,ee.props,null,Q.mode,_e),_e.ref=Dc(Q,q,ee),_e.return=Q,Q=_e)}return I(Q);case L:e:{for(Ue=ee.key;q!==null;){if(q.key===Ue)if(q.tag===4&&q.stateNode.containerInfo===ee.containerInfo&&q.stateNode.implementation===ee.implementation){f(Q,q.sibling),q=b(q,ee.children||[]),q.return=Q,Q=q;break e}else{f(Q,q);break}else l(Q,q);q=q.sibling}q=av(ee,Q.mode,_e),q.return=Q,Q=q}return I(Q);case B:return Ue=ee._init,sn(Q,q,Ue(ee._payload),_e)}if(Xe(ee))return Ne(Q,q,ee,_e);if(J(ee))return Ve(Q,q,ee,_e);dh(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,q!==null&&q.tag===6?(f(Q,q.sibling),q=b(q,ee),q.return=Q,Q=q):(f(Q,q),q=ov(ee,Q.mode,_e),q.return=Q,Q=q),I(Q)):f(Q,q)}return sn}var ql=Ob(!0),Lb=Ob(!1),fh=So(null),hh=null,Zl=null,gg=null;function vg(){gg=Zl=hh=null}function yg(o){var l=fh.current;Lt(fh),o._currentValue=l}function _g(o,l,f){for(;o!==null;){var v=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,v!==null&&(v.childLanes|=l)):v!==null&&(v.childLanes&l)!==l&&(v.childLanes|=l),o===f)break;o=o.return}}function Yl(o,l){hh=o,gg=Zl=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(xr=!0),o.firstContext=null)}function fs(o){var l=o._currentValue;if(gg!==o)if(o={context:o,memoizedValue:l,next:null},Zl===null){if(hh===null)throw Error(n(308));Zl=o,hh.dependencies={lanes:0,firstContext:o}}else Zl=Zl.next=o;return l}var Ta=null;function xg(o){Ta===null?Ta=[o]:Ta.push(o)}function Db(o,l,f,v){var b=l.interleaved;return b===null?(f.next=f,xg(l)):(f.next=b.next,b.next=f),l.interleaved=f,Ri(o,v)}function Ri(o,l){o.lanes|=l;var f=o.alternate;for(f!==null&&(f.lanes|=l),f=o,o=o.return;o!==null;)o.childLanes|=l,f=o.alternate,f!==null&&(f.childLanes|=l),f=o,o=o.return;return f.tag===3?f.stateNode:null}var ko=!1;function wg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nb(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Ai(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Po(o,l,f){var v=o.updateQueue;if(v===null)return null;if(v=v.shared,(ft&2)!==0){var b=v.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),v.pending=l,Ri(o,f)}return b=v.interleaved,b===null?(l.next=l,xg(v)):(l.next=b.next,b.next=l),v.interleaved=l,Ri(o,f)}function ph(o,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var v=l.lanes;v&=o.pendingLanes,f|=v,l.lanes=f,us(o,f)}}function jb(o,l){var f=o.updateQueue,v=o.alternate;if(v!==null&&(v=v.updateQueue,f===v)){var b=null,C=null;if(f=f.firstBaseUpdate,f!==null){do{var I={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};C===null?b=C=I:C=C.next=I,f=f.next}while(f!==null);C===null?b=C=l:C=C.next=l}else b=C=l;f={baseState:v.baseState,firstBaseUpdate:b,lastBaseUpdate:C,shared:v.shared,effects:v.effects},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=l:o.next=l,f.lastBaseUpdate=l}function mh(o,l,f,v){var b=o.updateQueue;ko=!1;var C=b.firstBaseUpdate,I=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var W=V,re=W.next;W.next=null,I===null?C=re:I.next=re,I=W;var fe=o.alternate;fe!==null&&(fe=fe.updateQueue,V=fe.lastBaseUpdate,V!==I&&(V===null?fe.firstBaseUpdate=re:V.next=re,fe.lastBaseUpdate=W))}if(C!==null){var me=b.baseState;I=0,fe=re=W=null,V=C;do{var ce=V.lane,Me=V.eventTime;if((v&ce)===ce){fe!==null&&(fe=fe.next={eventTime:Me,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var Ne=o,Ve=V;switch(ce=l,Me=f,Ve.tag){case 1:if(Ne=Ve.payload,typeof Ne=="function"){me=Ne.call(Me,me,ce);break e}me=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Ve.payload,ce=typeof Ne=="function"?Ne.call(Me,me,ce):Ne,ce==null)break e;me=H({},me,ce);break e;case 2:ko=!0}}V.callback!==null&&V.lane!==0&&(o.flags|=64,ce=b.effects,ce===null?b.effects=[V]:ce.push(V))}else Me={eventTime:Me,lane:ce,tag:V.tag,payload:V.payload,callback:V.callback,next:null},fe===null?(re=fe=Me,W=me):fe=fe.next=Me,I|=ce;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;ce=V,V=ce.next,ce.next=null,b.lastBaseUpdate=ce,b.shared.pending=null}}while(!0);if(fe===null&&(W=me),b.baseState=W,b.firstBaseUpdate=re,b.lastBaseUpdate=fe,l=b.shared.interleaved,l!==null){b=l;do I|=b.lane,b=b.next;while(b!==l)}else C===null&&(b.shared.lanes=0);Ia|=I,o.lanes=I,o.memoizedState=me}}function Fb(o,l,f){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var v=o[l],b=v.callback;if(b!==null){if(v.callback=null,v=f,typeof b!="function")throw Error(n(191,b));b.call(v)}}}var Nc={},Qs=So(Nc),jc=So(Nc),Fc=So(Nc);function Ra(o){if(o===Nc)throw Error(n(174));return o}function bg(o,l){switch(Rt(Fc,l),Rt(jc,o),Rt(Qs,Nc),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:ss(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=ss(l,o)}Lt(Qs),Rt(Qs,l)}function Xl(){Lt(Qs),Lt(jc),Lt(Fc)}function Vb(o){Ra(Fc.current);var l=Ra(Qs.current),f=ss(l,o.type);l!==f&&(Rt(jc,o),Rt(Qs,f))}function Sg(o){jc.current===o&&(Lt(Qs),Lt(jc))}var Gt=So(0);function gh(o){for(var l=o;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Eg=[];function Cg(){for(var o=0;o<Eg.length;o++)Eg[o]._workInProgressVersionPrimary=null;Eg.length=0}var vh=k.ReactCurrentDispatcher,kg=k.ReactCurrentBatchConfig,Aa=0,Kt=null,_n=null,En=null,yh=!1,Vc=!1,$c=0,YM=0;function Kn(){throw Error(n(321))}function Pg(o,l){if(l===null)return!1;for(var f=0;f<l.length&&f<o.length;f++)if(!Is(o[f],l[f]))return!1;return!0}function Tg(o,l,f,v,b,C){if(Aa=C,Kt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,vh.current=o===null||o.memoizedState===null?eO:tO,o=f(v,b),Vc){C=0;do{if(Vc=!1,$c=0,25<=C)throw Error(n(301));C+=1,En=_n=null,l.updateQueue=null,vh.current=nO,o=f(v,b)}while(Vc)}if(vh.current=wh,l=_n!==null&&_n.next!==null,Aa=0,En=_n=Kt=null,yh=!1,l)throw Error(n(300));return o}function Rg(){var o=$c!==0;return $c=0,o}function Js(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return En===null?Kt.memoizedState=En=o:En=En.next=o,En}function hs(){if(_n===null){var o=Kt.alternate;o=o!==null?o.memoizedState:null}else o=_n.next;var l=En===null?Kt.memoizedState:En.next;if(l!==null)En=l,_n=o;else{if(o===null)throw Error(n(310));_n=o,o={memoizedState:_n.memoizedState,baseState:_n.baseState,baseQueue:_n.baseQueue,queue:_n.queue,next:null},En===null?Kt.memoizedState=En=o:En=En.next=o}return En}function Hc(o,l){return typeof l=="function"?l(o):l}function Ag(o){var l=hs(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var v=_n,b=v.baseQueue,C=f.pending;if(C!==null){if(b!==null){var I=b.next;b.next=C.next,C.next=I}v.baseQueue=b=C,f.pending=null}if(b!==null){C=b.next,v=v.baseState;var V=I=null,W=null,re=C;do{var fe=re.lane;if((Aa&fe)===fe)W!==null&&(W=W.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),v=re.hasEagerState?re.eagerState:o(v,re.action);else{var me={lane:fe,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};W===null?(V=W=me,I=v):W=W.next=me,Kt.lanes|=fe,Ia|=fe}re=re.next}while(re!==null&&re!==C);W===null?I=v:W.next=V,Is(v,l.memoizedState)||(xr=!0),l.memoizedState=v,l.baseState=I,l.baseQueue=W,f.lastRenderedState=v}if(o=f.interleaved,o!==null){b=o;do C=b.lane,Kt.lanes|=C,Ia|=C,b=b.next;while(b!==o)}else b===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function Ig(o){var l=hs(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var v=f.dispatch,b=f.pending,C=l.memoizedState;if(b!==null){f.pending=null;var I=b=b.next;do C=o(C,I.action),I=I.next;while(I!==b);Is(C,l.memoizedState)||(xr=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),f.lastRenderedState=C}return[C,v]}function $b(){}function Hb(o,l){var f=Kt,v=hs(),b=l(),C=!Is(v.memoizedState,b);if(C&&(v.memoizedState=b,xr=!0),v=v.queue,Mg(Bb.bind(null,f,v,o),[o]),v.getSnapshot!==l||C||En!==null&&En.memoizedState.tag&1){if(f.flags|=2048,zc(9,Ub.bind(null,f,v,b,l),void 0,null),Cn===null)throw Error(n(349));(Aa&30)!==0||zb(f,l,b)}return b}function zb(o,l,f){o.flags|=16384,o={getSnapshot:l,value:f},l=Kt.updateQueue,l===null?(l={lastEffect:null,stores:null},Kt.updateQueue=l,l.stores=[o]):(f=l.stores,f===null?l.stores=[o]:f.push(o))}function Ub(o,l,f,v){l.value=f,l.getSnapshot=v,Wb(l)&&Gb(o)}function Bb(o,l,f){return f(function(){Wb(l)&&Gb(o)})}function Wb(o){var l=o.getSnapshot;o=o.value;try{var f=l();return!Is(o,f)}catch{return!0}}function Gb(o){var l=Ri(o,1);l!==null&&Ns(l,o,1,-1)}function Kb(o){var l=Js();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hc,lastRenderedState:o},l.queue=o,o=o.dispatch=JM.bind(null,Kt,o),[l.memoizedState,o]}function zc(o,l,f,v){return o={tag:o,create:l,destroy:f,deps:v,next:null},l=Kt.updateQueue,l===null?(l={lastEffect:null,stores:null},Kt.updateQueue=l,l.lastEffect=o.next=o):(f=l.lastEffect,f===null?l.lastEffect=o.next=o:(v=f.next,f.next=o,o.next=v,l.lastEffect=o)),o}function qb(){return hs().memoizedState}function _h(o,l,f,v){var b=Js();Kt.flags|=o,b.memoizedState=zc(1|l,f,void 0,v===void 0?null:v)}function xh(o,l,f,v){var b=hs();v=v===void 0?null:v;var C=void 0;if(_n!==null){var I=_n.memoizedState;if(C=I.destroy,v!==null&&Pg(v,I.deps)){b.memoizedState=zc(l,f,C,v);return}}Kt.flags|=o,b.memoizedState=zc(1|l,f,C,v)}function Zb(o,l){return _h(8390656,8,o,l)}function Mg(o,l){return xh(2048,8,o,l)}function Yb(o,l){return xh(4,2,o,l)}function Xb(o,l){return xh(4,4,o,l)}function Qb(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Jb(o,l,f){return f=f!=null?f.concat([o]):null,xh(4,4,Qb.bind(null,l,o),f)}function Og(){}function eS(o,l){var f=hs();l=l===void 0?null:l;var v=f.memoizedState;return v!==null&&l!==null&&Pg(l,v[1])?v[0]:(f.memoizedState=[o,l],o)}function tS(o,l){var f=hs();l=l===void 0?null:l;var v=f.memoizedState;return v!==null&&l!==null&&Pg(l,v[1])?v[0]:(o=o(),f.memoizedState=[o,l],o)}function nS(o,l,f){return(Aa&21)===0?(o.baseState&&(o.baseState=!1,xr=!0),o.memoizedState=f):(Is(f,l)||(f=As(),Kt.lanes|=f,Ia|=f,o.baseState=!0),l)}function XM(o,l){var f=lt;lt=f!==0&&4>f?f:4,o(!0);var v=kg.transition;kg.transition={};try{o(!1),l()}finally{lt=f,kg.transition=v}}function rS(){return hs().memoizedState}function QM(o,l,f){var v=Io(o);if(f={lane:v,action:f,hasEagerState:!1,eagerState:null,next:null},sS(o))iS(l,f);else if(f=Db(o,l,f,v),f!==null){var b=ir();Ns(f,o,v,b),oS(f,l,v)}}function JM(o,l,f){var v=Io(o),b={lane:v,action:f,hasEagerState:!1,eagerState:null,next:null};if(sS(o))iS(l,b);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var I=l.lastRenderedState,V=C(I,f);if(b.hasEagerState=!0,b.eagerState=V,Is(V,I)){var W=l.interleaved;W===null?(b.next=b,xg(l)):(b.next=W.next,W.next=b),l.interleaved=b;return}}catch{}finally{}f=Db(o,l,b,v),f!==null&&(b=ir(),Ns(f,o,v,b),oS(f,l,v))}}function sS(o){var l=o.alternate;return o===Kt||l!==null&&l===Kt}function iS(o,l){Vc=yh=!0;var f=o.pending;f===null?l.next=l:(l.next=f.next,f.next=l),o.pending=l}function oS(o,l,f){if((f&4194240)!==0){var v=l.lanes;v&=o.pendingLanes,f|=v,l.lanes=f,us(o,f)}}var wh={readContext:fs,useCallback:Kn,useContext:Kn,useEffect:Kn,useImperativeHandle:Kn,useInsertionEffect:Kn,useLayoutEffect:Kn,useMemo:Kn,useReducer:Kn,useRef:Kn,useState:Kn,useDebugValue:Kn,useDeferredValue:Kn,useTransition:Kn,useMutableSource:Kn,useSyncExternalStore:Kn,useId:Kn,unstable_isNewReconciler:!1},eO={readContext:fs,useCallback:function(o,l){return Js().memoizedState=[o,l===void 0?null:l],o},useContext:fs,useEffect:Zb,useImperativeHandle:function(o,l,f){return f=f!=null?f.concat([o]):null,_h(4194308,4,Qb.bind(null,l,o),f)},useLayoutEffect:function(o,l){return _h(4194308,4,o,l)},useInsertionEffect:function(o,l){return _h(4,2,o,l)},useMemo:function(o,l){var f=Js();return l=l===void 0?null:l,o=o(),f.memoizedState=[o,l],o},useReducer:function(o,l,f){var v=Js();return l=f!==void 0?f(l):l,v.memoizedState=v.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},v.queue=o,o=o.dispatch=QM.bind(null,Kt,o),[v.memoizedState,o]},useRef:function(o){var l=Js();return o={current:o},l.memoizedState=o},useState:Kb,useDebugValue:Og,useDeferredValue:function(o){return Js().memoizedState=o},useTransition:function(){var o=Kb(!1),l=o[0];return o=XM.bind(null,o[1]),Js().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,f){var v=Kt,b=Js();if($t){if(f===void 0)throw Error(n(407));f=f()}else{if(f=l(),Cn===null)throw Error(n(349));(Aa&30)!==0||zb(v,l,f)}b.memoizedState=f;var C={value:f,getSnapshot:l};return b.queue=C,Zb(Bb.bind(null,v,C,o),[o]),v.flags|=2048,zc(9,Ub.bind(null,v,C,f,l),void 0,null),f},useId:function(){var o=Js(),l=Cn.identifierPrefix;if($t){var f=Ti,v=Pi;f=(v&~(1<<32-gr(v)-1)).toString(32)+f,l=":"+l+"R"+f,f=$c++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=YM++,l=":"+l+"r"+f.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},tO={readContext:fs,useCallback:eS,useContext:fs,useEffect:Mg,useImperativeHandle:Jb,useInsertionEffect:Yb,useLayoutEffect:Xb,useMemo:tS,useReducer:Ag,useRef:qb,useState:function(){return Ag(Hc)},useDebugValue:Og,useDeferredValue:function(o){var l=hs();return nS(l,_n.memoizedState,o)},useTransition:function(){var o=Ag(Hc)[0],l=hs().memoizedState;return[o,l]},useMutableSource:$b,useSyncExternalStore:Hb,useId:rS,unstable_isNewReconciler:!1},nO={readContext:fs,useCallback:eS,useContext:fs,useEffect:Mg,useImperativeHandle:Jb,useInsertionEffect:Yb,useLayoutEffect:Xb,useMemo:tS,useReducer:Ig,useRef:qb,useState:function(){return Ig(Hc)},useDebugValue:Og,useDeferredValue:function(o){var l=hs();return _n===null?l.memoizedState=o:nS(l,_n.memoizedState,o)},useTransition:function(){var o=Ig(Hc)[0],l=hs().memoizedState;return[o,l]},useMutableSource:$b,useSyncExternalStore:Hb,useId:rS,unstable_isNewReconciler:!1};function Os(o,l){if(o&&o.defaultProps){l=H({},l),o=o.defaultProps;for(var f in o)l[f]===void 0&&(l[f]=o[f]);return l}return l}function Lg(o,l,f,v){l=o.memoizedState,f=f(v,l),f=f==null?l:H({},l,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var bh={isMounted:function(o){return(o=o._reactInternals)?Rs(o)===o:!1},enqueueSetState:function(o,l,f){o=o._reactInternals;var v=ir(),b=Io(o),C=Ai(v,b);C.payload=l,f!=null&&(C.callback=f),l=Po(o,C,b),l!==null&&(Ns(l,o,b,v),ph(l,o,b))},enqueueReplaceState:function(o,l,f){o=o._reactInternals;var v=ir(),b=Io(o),C=Ai(v,b);C.tag=1,C.payload=l,f!=null&&(C.callback=f),l=Po(o,C,b),l!==null&&(Ns(l,o,b,v),ph(l,o,b))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var f=ir(),v=Io(o),b=Ai(f,v);b.tag=2,l!=null&&(b.callback=l),l=Po(o,b,v),l!==null&&(Ns(l,o,v,f),ph(l,o,v))}};function aS(o,l,f,v,b,C,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(v,C,I):l.prototype&&l.prototype.isPureReactComponent?!Tc(f,v)||!Tc(b,C):!0}function lS(o,l,f){var v=!1,b=Eo,C=l.contextType;return typeof C=="object"&&C!==null?C=fs(C):(b=_r(l)?Ca:Gn.current,v=l.contextTypes,C=(v=v!=null)?Bl(o,b):Eo),l=new l(f,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=bh,o.stateNode=l,l._reactInternals=o,v&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=C),l}function uS(o,l,f,v){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,v),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,v),l.state!==o&&bh.enqueueReplaceState(l,l.state,null)}function Dg(o,l,f,v){var b=o.stateNode;b.props=f,b.state=o.memoizedState,b.refs={},wg(o);var C=l.contextType;typeof C=="object"&&C!==null?b.context=fs(C):(C=_r(l)?Ca:Gn.current,b.context=Bl(o,C)),b.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Lg(o,l,C,f),b.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(l=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),l!==b.state&&bh.enqueueReplaceState(b,b.state,null),mh(o,f,b,v),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function Ql(o,l){try{var f="",v=l;do f+=ae(v),v=v.return;while(v);var b=f}catch(C){b=`
40
- Error generating stack: `+C.message+`
41
- `+C.stack}return{value:o,source:l,stack:b,digest:null}}function Ng(o,l,f){return{value:o,source:null,stack:f??null,digest:l??null}}function jg(o,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var rO=typeof WeakMap=="function"?WeakMap:Map;function cS(o,l,f){f=Ai(-1,f),f.tag=3,f.payload={element:null};var v=l.value;return f.callback=function(){Rh||(Rh=!0,Qg=v),jg(o,l)},f}function dS(o,l,f){f=Ai(-1,f),f.tag=3;var v=o.type.getDerivedStateFromError;if(typeof v=="function"){var b=l.value;f.payload=function(){return v(b)},f.callback=function(){jg(o,l)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(f.callback=function(){jg(o,l),typeof v!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),f}function fS(o,l,f){var v=o.pingCache;if(v===null){v=o.pingCache=new rO;var b=new Set;v.set(l,b)}else b=v.get(l),b===void 0&&(b=new Set,v.set(l,b));b.has(f)||(b.add(f),o=vO.bind(null,o,l,f),l.then(o,o))}function hS(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function pS(o,l,f,v,b){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Ai(-1,1),l.tag=2,Po(f,l,1))),f.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var sO=k.ReactCurrentOwner,xr=!1;function sr(o,l,f,v){l.child=o===null?Lb(l,null,f,v):ql(l,o.child,f,v)}function mS(o,l,f,v,b){f=f.render;var C=l.ref;return Yl(l,b),v=Tg(o,l,f,v,C,b),f=Rg(),o!==null&&!xr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ii(o,l,b)):($t&&f&&dg(l),l.flags|=1,sr(o,l,v,b),l.child)}function gS(o,l,f,v,b){if(o===null){var C=f.type;return typeof C=="function"&&!iv(C)&&C.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=C,vS(o,l,C,v,b)):(o=Dh(f.type,null,v,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(C=o.child,(o.lanes&b)===0){var I=C.memoizedProps;if(f=f.compare,f=f!==null?f:Tc,f(I,v)&&o.ref===l.ref)return Ii(o,l,b)}return l.flags|=1,o=Oo(C,v),o.ref=l.ref,o.return=l,l.child=o}function vS(o,l,f,v,b){if(o!==null){var C=o.memoizedProps;if(Tc(C,v)&&o.ref===l.ref)if(xr=!1,l.pendingProps=v=C,(o.lanes&b)!==0)(o.flags&131072)!==0&&(xr=!0);else return l.lanes=o.lanes,Ii(o,l,b)}return Fg(o,l,f,v,b)}function yS(o,l,f){var v=l.pendingProps,b=v.children,C=o!==null?o.memoizedState:null;if(v.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(eu,Ur),Ur|=f;else{if((f&1073741824)===0)return o=C!==null?C.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Rt(eu,Ur),Ur|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=C!==null?C.baseLanes:f,Rt(eu,Ur),Ur|=v}else C!==null?(v=C.baseLanes|f,l.memoizedState=null):v=f,Rt(eu,Ur),Ur|=v;return sr(o,l,b,f),l.child}function _S(o,l){var f=l.ref;(o===null&&f!==null||o!==null&&o.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function Fg(o,l,f,v,b){var C=_r(f)?Ca:Gn.current;return C=Bl(l,C),Yl(l,b),f=Tg(o,l,f,v,C,b),v=Rg(),o!==null&&!xr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Ii(o,l,b)):($t&&v&&dg(l),l.flags|=1,sr(o,l,f,b),l.child)}function xS(o,l,f,v,b){if(_r(f)){var C=!0;oh(l)}else C=!1;if(Yl(l,b),l.stateNode===null)Eh(o,l),lS(l,f,v),Dg(l,f,v,b),v=!0;else if(o===null){var I=l.stateNode,V=l.memoizedProps;I.props=V;var W=I.context,re=f.contextType;typeof re=="object"&&re!==null?re=fs(re):(re=_r(f)?Ca:Gn.current,re=Bl(l,re));var fe=f.getDerivedStateFromProps,me=typeof fe=="function"||typeof I.getSnapshotBeforeUpdate=="function";me||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==v||W!==re)&&uS(l,I,v,re),ko=!1;var ce=l.memoizedState;I.state=ce,mh(l,v,I,b),W=l.memoizedState,V!==v||ce!==W||yr.current||ko?(typeof fe=="function"&&(Lg(l,f,fe,v),W=l.memoizedState),(V=ko||aS(l,f,V,v,ce,W,re))?(me||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=v,l.memoizedState=W),I.props=v,I.state=W,I.context=re,v=V):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),v=!1)}else{I=l.stateNode,Nb(o,l),V=l.memoizedProps,re=l.type===l.elementType?V:Os(l.type,V),I.props=re,me=l.pendingProps,ce=I.context,W=f.contextType,typeof W=="object"&&W!==null?W=fs(W):(W=_r(f)?Ca:Gn.current,W=Bl(l,W));var Me=f.getDerivedStateFromProps;(fe=typeof Me=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==me||ce!==W)&&uS(l,I,v,W),ko=!1,ce=l.memoizedState,I.state=ce,mh(l,v,I,b);var Ne=l.memoizedState;V!==me||ce!==Ne||yr.current||ko?(typeof Me=="function"&&(Lg(l,f,Me,v),Ne=l.memoizedState),(re=ko||aS(l,f,re,v,ce,Ne,W)||!1)?(fe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(v,Ne,W),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(v,Ne,W)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||V===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),l.memoizedProps=v,l.memoizedState=Ne),I.props=v,I.state=Ne,I.context=W,v=re):(typeof I.componentDidUpdate!="function"||V===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),v=!1)}return Vg(o,l,f,v,C,b)}function Vg(o,l,f,v,b,C){_S(o,l);var I=(l.flags&128)!==0;if(!v&&!I)return b&&Cb(l,f,!1),Ii(o,l,C);v=l.stateNode,sO.current=l;var V=I&&typeof f.getDerivedStateFromError!="function"?null:v.render();return l.flags|=1,o!==null&&I?(l.child=ql(l,o.child,null,C),l.child=ql(l,null,V,C)):sr(o,l,V,C),l.memoizedState=v.state,b&&Cb(l,f,!0),l.child}function wS(o){var l=o.stateNode;l.pendingContext?Sb(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Sb(o,l.context,!1),bg(o,l.containerInfo)}function bS(o,l,f,v,b){return Kl(),mg(b),l.flags|=256,sr(o,l,f,v),l.child}var $g={dehydrated:null,treeContext:null,retryLane:0};function Hg(o){return{baseLanes:o,cachePool:null,transitions:null}}function SS(o,l,f){var v=l.pendingProps,b=Gt.current,C=!1,I=(l.flags&128)!==0,V;if((V=I)||(V=o!==null&&o.memoizedState===null?!1:(b&2)!==0),V?(C=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),Rt(Gt,b&1),o===null)return pg(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=v.children,o=v.fallback,C?(v=l.mode,C=l.child,I={mode:"hidden",children:I},(v&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=I):C=Nh(I,v,0,null),o=Da(o,v,f,null),C.return=l,o.return=l,C.sibling=o,l.child=C,l.child.memoizedState=Hg(f),l.memoizedState=$g,o):zg(l,I));if(b=o.memoizedState,b!==null&&(V=b.dehydrated,V!==null))return iO(o,l,I,v,V,b,f);if(C){C=v.fallback,I=l.mode,b=o.child,V=b.sibling;var W={mode:"hidden",children:v.children};return(I&1)===0&&l.child!==b?(v=l.child,v.childLanes=0,v.pendingProps=W,l.deletions=null):(v=Oo(b,W),v.subtreeFlags=b.subtreeFlags&14680064),V!==null?C=Oo(V,C):(C=Da(C,I,f,null),C.flags|=2),C.return=l,v.return=l,v.sibling=C,l.child=v,v=C,C=l.child,I=o.child.memoizedState,I=I===null?Hg(f):{baseLanes:I.baseLanes|f,cachePool:null,transitions:I.transitions},C.memoizedState=I,C.childLanes=o.childLanes&~f,l.memoizedState=$g,v}return C=o.child,o=C.sibling,v=Oo(C,{mode:"visible",children:v.children}),(l.mode&1)===0&&(v.lanes=f),v.return=l,v.sibling=null,o!==null&&(f=l.deletions,f===null?(l.deletions=[o],l.flags|=16):f.push(o)),l.child=v,l.memoizedState=null,v}function zg(o,l){return l=Nh({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function Sh(o,l,f,v){return v!==null&&mg(v),ql(l,o.child,null,f),o=zg(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function iO(o,l,f,v,b,C,I){if(f)return l.flags&256?(l.flags&=-257,v=Ng(Error(n(422))),Sh(o,l,I,v)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(C=v.fallback,b=l.mode,v=Nh({mode:"visible",children:v.children},b,0,null),C=Da(C,b,I,null),C.flags|=2,v.return=l,C.return=l,v.sibling=C,l.child=v,(l.mode&1)!==0&&ql(l,o.child,null,I),l.child.memoizedState=Hg(I),l.memoizedState=$g,C);if((l.mode&1)===0)return Sh(o,l,I,null);if(b.data==="$!"){if(v=b.nextSibling&&b.nextSibling.dataset,v)var V=v.dgst;return v=V,C=Error(n(419)),v=Ng(C,v,void 0),Sh(o,l,I,v)}if(V=(I&o.childLanes)!==0,xr||V){if(v=Cn,v!==null){switch(I&-I){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(v.suspendedLanes|I))!==0?0:b,b!==0&&b!==C.retryLane&&(C.retryLane=b,Ri(o,b),Ns(v,o,b,-1))}return sv(),v=Ng(Error(n(421))),Sh(o,l,I,v)}return b.data==="$?"?(l.flags|=128,l.child=o.child,l=yO.bind(null,o),b._reactRetry=l,null):(o=C.treeContext,zr=bo(b.nextSibling),Hr=l,$t=!0,Ms=null,o!==null&&(cs[ds++]=Pi,cs[ds++]=Ti,cs[ds++]=ka,Pi=o.id,Ti=o.overflow,ka=l),l=zg(l,v.children),l.flags|=4096,l)}function ES(o,l,f){o.lanes|=l;var v=o.alternate;v!==null&&(v.lanes|=l),_g(o.return,l,f)}function Ug(o,l,f,v,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:v,tail:f,tailMode:b}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=v,C.tail=f,C.tailMode=b)}function CS(o,l,f){var v=l.pendingProps,b=v.revealOrder,C=v.tail;if(sr(o,l,v.children,f),v=Gt.current,(v&2)!==0)v=v&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&ES(o,f,l);else if(o.tag===19)ES(o,f,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}v&=1}if(Rt(Gt,v),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(f=l.child,b=null;f!==null;)o=f.alternate,o!==null&&gh(o)===null&&(b=f),f=f.sibling;f=b,f===null?(b=l.child,l.child=null):(b=f.sibling,f.sibling=null),Ug(l,!1,b,f,C);break;case"backwards":for(f=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&gh(o)===null){l.child=b;break}o=b.sibling,b.sibling=f,f=b,b=o}Ug(l,!0,f,null,C);break;case"together":Ug(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Eh(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Ii(o,l,f){if(o!==null&&(l.dependencies=o.dependencies),Ia|=l.lanes,(f&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,f=Oo(o,o.pendingProps),l.child=f,f.return=l;o.sibling!==null;)o=o.sibling,f=f.sibling=Oo(o,o.pendingProps),f.return=l;f.sibling=null}return l.child}function oO(o,l,f){switch(l.tag){case 3:wS(l),Kl();break;case 5:Vb(l);break;case 1:_r(l.type)&&oh(l);break;case 4:bg(l,l.stateNode.containerInfo);break;case 10:var v=l.type._context,b=l.memoizedProps.value;Rt(fh,v._currentValue),v._currentValue=b;break;case 13:if(v=l.memoizedState,v!==null)return v.dehydrated!==null?(Rt(Gt,Gt.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?SS(o,l,f):(Rt(Gt,Gt.current&1),o=Ii(o,l,f),o!==null?o.sibling:null);Rt(Gt,Gt.current&1);break;case 19:if(v=(f&l.childLanes)!==0,(o.flags&128)!==0){if(v)return CS(o,l,f);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Rt(Gt,Gt.current),v)break;return null;case 22:case 23:return l.lanes=0,yS(o,l,f)}return Ii(o,l,f)}var kS,Bg,PS,TS;kS=function(o,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)o.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Bg=function(){},PS=function(o,l,f,v){var b=o.memoizedProps;if(b!==v){o=l.stateNode,Ra(Qs.current);var C=null;switch(f){case"input":b=We(o,b),v=We(o,v),C=[];break;case"select":b=H({},b,{value:void 0}),v=H({},v,{value:void 0}),C=[];break;case"textarea":b=Ge(o,b),v=Ge(o,v),C=[];break;default:typeof b.onClick!="function"&&typeof v.onClick=="function"&&(o.onclick=rh)}Ps(f,v);var I;f=null;for(re in b)if(!v.hasOwnProperty(re)&&b.hasOwnProperty(re)&&b[re]!=null)if(re==="style"){var V=b[re];for(I in V)V.hasOwnProperty(I)&&(f||(f={}),f[I]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(s.hasOwnProperty(re)?C||(C=[]):(C=C||[]).push(re,null));for(re in v){var W=v[re];if(V=b!=null?b[re]:void 0,v.hasOwnProperty(re)&&W!==V&&(W!=null||V!=null))if(re==="style")if(V){for(I in V)!V.hasOwnProperty(I)||W&&W.hasOwnProperty(I)||(f||(f={}),f[I]="");for(I in W)W.hasOwnProperty(I)&&V[I]!==W[I]&&(f||(f={}),f[I]=W[I])}else f||(C||(C=[]),C.push(re,f)),f=W;else re==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,V=V?V.__html:void 0,W!=null&&V!==W&&(C=C||[]).push(re,W)):re==="children"?typeof W!="string"&&typeof W!="number"||(C=C||[]).push(re,""+W):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(s.hasOwnProperty(re)?(W!=null&&re==="onScroll"&&Ot("scroll",o),C||V===W||(C=[])):(C=C||[]).push(re,W))}f&&(C=C||[]).push("style",f);var re=C;(l.updateQueue=re)&&(l.flags|=4)}},TS=function(o,l,f,v){f!==v&&(l.flags|=4)};function Uc(o,l){if(!$t)switch(o.tailMode){case"hidden":l=o.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:v.sibling=null}}function qn(o){var l=o.alternate!==null&&o.alternate.child===o.child,f=0,v=0;if(l)for(var b=o.child;b!==null;)f|=b.lanes|b.childLanes,v|=b.subtreeFlags&14680064,v|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)f|=b.lanes|b.childLanes,v|=b.subtreeFlags,v|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=v,o.childLanes=f,l}function aO(o,l,f){var v=l.pendingProps;switch(fg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qn(l),null;case 1:return _r(l.type)&&ih(),qn(l),null;case 3:return v=l.stateNode,Xl(),Lt(yr),Lt(Gn),Cg(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(o===null||o.child===null)&&(ch(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ms!==null&&(tv(Ms),Ms=null))),Bg(o,l),qn(l),null;case 5:Sg(l);var b=Ra(Fc.current);if(f=l.type,o!==null&&l.stateNode!=null)PS(o,l,f,v,b),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!v){if(l.stateNode===null)throw Error(n(166));return qn(l),null}if(o=Ra(Qs.current),ch(l)){v=l.stateNode,f=l.type;var C=l.memoizedProps;switch(v[Xs]=l,v[Oc]=C,o=(l.mode&1)!==0,f){case"dialog":Ot("cancel",v),Ot("close",v);break;case"iframe":case"object":case"embed":Ot("load",v);break;case"video":case"audio":for(b=0;b<Ac.length;b++)Ot(Ac[b],v);break;case"source":Ot("error",v);break;case"img":case"image":case"link":Ot("error",v),Ot("load",v);break;case"details":Ot("toggle",v);break;case"input":Tt(v,C),Ot("invalid",v);break;case"select":v._wrapperState={wasMultiple:!!C.multiple},Ot("invalid",v);break;case"textarea":at(v,C),Ot("invalid",v)}Ps(f,C),b=null;for(var I in C)if(C.hasOwnProperty(I)){var V=C[I];I==="children"?typeof V=="string"?v.textContent!==V&&(C.suppressHydrationWarning!==!0&&nh(v.textContent,V,o),b=["children",V]):typeof V=="number"&&v.textContent!==""+V&&(C.suppressHydrationWarning!==!0&&nh(v.textContent,V,o),b=["children",""+V]):s.hasOwnProperty(I)&&V!=null&&I==="onScroll"&&Ot("scroll",v)}switch(f){case"input":be(v),It(v,C,!0);break;case"textarea":be(v),vn(v);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(v.onclick=rh)}v=b,l.updateQueue=v,v!==null&&(l.flags|=4)}else{I=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=Bt(f)),o==="http://www.w3.org/1999/xhtml"?f==="script"?(o=I.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof v.is=="string"?o=I.createElement(f,{is:v.is}):(o=I.createElement(f),f==="select"&&(I=o,v.multiple?I.multiple=!0:v.size&&(I.size=v.size))):o=I.createElementNS(o,f),o[Xs]=l,o[Oc]=v,kS(o,l,!1,!1),l.stateNode=o;e:{switch(I=Zs(f,v),f){case"dialog":Ot("cancel",o),Ot("close",o),b=v;break;case"iframe":case"object":case"embed":Ot("load",o),b=v;break;case"video":case"audio":for(b=0;b<Ac.length;b++)Ot(Ac[b],o);b=v;break;case"source":Ot("error",o),b=v;break;case"img":case"image":case"link":Ot("error",o),Ot("load",o),b=v;break;case"details":Ot("toggle",o),b=v;break;case"input":Tt(o,v),b=We(o,v),Ot("invalid",o);break;case"option":b=v;break;case"select":o._wrapperState={wasMultiple:!!v.multiple},b=H({},v,{value:void 0}),Ot("invalid",o);break;case"textarea":at(o,v),b=Ge(o,v),Ot("invalid",o);break;default:b=v}Ps(f,b),V=b;for(C in V)if(V.hasOwnProperty(C)){var W=V[C];C==="style"?Mn(o,W):C==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,W!=null&&is(o,W)):C==="children"?typeof W=="string"?(f!=="textarea"||W!=="")&&rn(o,W):typeof W=="number"&&rn(o,""+W):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?W!=null&&C==="onScroll"&&Ot("scroll",o):W!=null&&T(o,C,W,I))}switch(f){case"input":be(o),It(o,v,!1);break;case"textarea":be(o),vn(o);break;case"option":v.value!=null&&o.setAttribute("value",""+oe(v.value));break;case"select":o.multiple=!!v.multiple,C=v.value,C!=null?vt(o,!!v.multiple,C,!1):v.defaultValue!=null&&vt(o,!!v.multiple,v.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=rh)}switch(f){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}}v&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return qn(l),null;case 6:if(o&&l.stateNode!=null)TS(o,l,o.memoizedProps,v);else{if(typeof v!="string"&&l.stateNode===null)throw Error(n(166));if(f=Ra(Fc.current),Ra(Qs.current),ch(l)){if(v=l.stateNode,f=l.memoizedProps,v[Xs]=l,(C=v.nodeValue!==f)&&(o=Hr,o!==null))switch(o.tag){case 3:nh(v.nodeValue,f,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&nh(v.nodeValue,f,(o.mode&1)!==0)}C&&(l.flags|=4)}else v=(f.nodeType===9?f:f.ownerDocument).createTextNode(v),v[Xs]=l,l.stateNode=v}return qn(l),null;case 13:if(Lt(Gt),v=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if($t&&zr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Ib(),Kl(),l.flags|=98560,C=!1;else if(C=ch(l),v!==null&&v.dehydrated!==null){if(o===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Xs]=l}else Kl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;qn(l),C=!1}else Ms!==null&&(tv(Ms),Ms=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=f,l):(v=v!==null,v!==(o!==null&&o.memoizedState!==null)&&v&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Gt.current&1)!==0?xn===0&&(xn=3):sv())),l.updateQueue!==null&&(l.flags|=4),qn(l),null);case 4:return Xl(),Bg(o,l),o===null&&Ic(l.stateNode.containerInfo),qn(l),null;case 10:return yg(l.type._context),qn(l),null;case 17:return _r(l.type)&&ih(),qn(l),null;case 19:if(Lt(Gt),C=l.memoizedState,C===null)return qn(l),null;if(v=(l.flags&128)!==0,I=C.rendering,I===null)if(v)Uc(C,!1);else{if(xn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(I=gh(o),I!==null){for(l.flags|=128,Uc(C,!1),v=I.updateQueue,v!==null&&(l.updateQueue=v,l.flags|=4),l.subtreeFlags=0,v=f,f=l.child;f!==null;)C=f,o=v,C.flags&=14680066,I=C.alternate,I===null?(C.childLanes=0,C.lanes=o,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=I.childLanes,C.lanes=I.lanes,C.child=I.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=I.memoizedProps,C.memoizedState=I.memoizedState,C.updateQueue=I.updateQueue,C.type=I.type,o=I.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),f=f.sibling;return Rt(Gt,Gt.current&1|2),l.child}o=o.sibling}C.tail!==null&&_t()>tu&&(l.flags|=128,v=!0,Uc(C,!1),l.lanes=4194304)}else{if(!v)if(o=gh(I),o!==null){if(l.flags|=128,v=!0,f=o.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),Uc(C,!0),C.tail===null&&C.tailMode==="hidden"&&!I.alternate&&!$t)return qn(l),null}else 2*_t()-C.renderingStartTime>tu&&f!==1073741824&&(l.flags|=128,v=!0,Uc(C,!1),l.lanes=4194304);C.isBackwards?(I.sibling=l.child,l.child=I):(f=C.last,f!==null?f.sibling=I:l.child=I,C.last=I)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=_t(),l.sibling=null,f=Gt.current,Rt(Gt,v?f&1|2:f&1),l):(qn(l),null);case 22:case 23:return rv(),v=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==v&&(l.flags|=8192),v&&(l.mode&1)!==0?(Ur&1073741824)!==0&&(qn(l),l.subtreeFlags&6&&(l.flags|=8192)):qn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function lO(o,l){switch(fg(l),l.tag){case 1:return _r(l.type)&&ih(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Xl(),Lt(yr),Lt(Gn),Cg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Sg(l),null;case 13:if(Lt(Gt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Kl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Lt(Gt),null;case 4:return Xl(),null;case 10:return yg(l.type._context),null;case 22:case 23:return rv(),null;case 24:return null;default:return null}}var Ch=!1,Zn=!1,uO=typeof WeakSet=="function"?WeakSet:Set,Le=null;function Jl(o,l){var f=o.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(v){Qt(o,l,v)}else f.current=null}function Wg(o,l,f){try{f()}catch(v){Qt(o,l,v)}}var RS=!1;function cO(o,l){if(rg=Wf,o=ab(),Z0(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var v=f.getSelection&&f.getSelection();if(v&&v.rangeCount!==0){f=v.anchorNode;var b=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{f.nodeType,C.nodeType}catch{f=null;break e}var I=0,V=-1,W=-1,re=0,fe=0,me=o,ce=null;t:for(;;){for(var Me;me!==f||b!==0&&me.nodeType!==3||(V=I+b),me!==C||v!==0&&me.nodeType!==3||(W=I+v),me.nodeType===3&&(I+=me.nodeValue.length),(Me=me.firstChild)!==null;)ce=me,me=Me;for(;;){if(me===o)break t;if(ce===f&&++re===b&&(V=I),ce===C&&++fe===v&&(W=I),(Me=me.nextSibling)!==null)break;me=ce,ce=me.parentNode}me=Me}f=V===-1||W===-1?null:{start:V,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(sg={focusedElem:o,selectionRange:f},Wf=!1,Le=l;Le!==null;)if(l=Le,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Le=o;else for(;Le!==null;){l=Le;try{var Ne=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Ve=Ne.memoizedProps,sn=Ne.memoizedState,Q=l.stateNode,q=Q.getSnapshotBeforeUpdate(l.elementType===l.type?Ve:Os(l.type,Ve),sn);Q.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var ee=l.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(_e){Qt(l,l.return,_e)}if(o=l.sibling,o!==null){o.return=l.return,Le=o;break}Le=l.return}return Ne=RS,RS=!1,Ne}function Bc(o,l,f){var v=l.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var b=v=v.next;do{if((b.tag&o)===o){var C=b.destroy;b.destroy=void 0,C!==void 0&&Wg(l,f,C)}b=b.next}while(b!==v)}}function kh(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&o)===o){var v=f.create;f.destroy=v()}f=f.next}while(f!==l)}}function Gg(o){var l=o.ref;if(l!==null){var f=o.stateNode;switch(o.tag){case 5:o=f;break;default:o=f}typeof l=="function"?l(o):l.current=o}}function AS(o){var l=o.alternate;l!==null&&(o.alternate=null,AS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Xs],delete l[Oc],delete l[lg],delete l[GM],delete l[KM])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function IS(o){return o.tag===5||o.tag===3||o.tag===4}function MS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||IS(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Kg(o,l,f){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(o,l):f.insertBefore(o,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(o,f)):(l=f,l.appendChild(o)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=rh));else if(v!==4&&(o=o.child,o!==null))for(Kg(o,l,f),o=o.sibling;o!==null;)Kg(o,l,f),o=o.sibling}function qg(o,l,f){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?f.insertBefore(o,l):f.appendChild(o);else if(v!==4&&(o=o.child,o!==null))for(qg(o,l,f),o=o.sibling;o!==null;)qg(o,l,f),o=o.sibling}var Ln=null,Ls=!1;function To(o,l,f){for(f=f.child;f!==null;)OS(o,l,f),f=f.sibling}function OS(o,l,f){if(Vr&&typeof Vr.onCommitFiberUnmount=="function")try{Vr.onCommitFiberUnmount(Sa,f)}catch{}switch(f.tag){case 5:Zn||Jl(f,l);case 6:var v=Ln,b=Ls;Ln=null,To(o,l,f),Ln=v,Ls=b,Ln!==null&&(Ls?(o=Ln,f=f.stateNode,o.nodeType===8?o.parentNode.removeChild(f):o.removeChild(f)):Ln.removeChild(f.stateNode));break;case 18:Ln!==null&&(Ls?(o=Ln,f=f.stateNode,o.nodeType===8?ag(o.parentNode,f):o.nodeType===1&&ag(o,f),bc(o)):ag(Ln,f.stateNode));break;case 4:v=Ln,b=Ls,Ln=f.stateNode.containerInfo,Ls=!0,To(o,l,f),Ln=v,Ls=b;break;case 0:case 11:case 14:case 15:if(!Zn&&(v=f.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){b=v=v.next;do{var C=b,I=C.destroy;C=C.tag,I!==void 0&&((C&2)!==0||(C&4)!==0)&&Wg(f,l,I),b=b.next}while(b!==v)}To(o,l,f);break;case 1:if(!Zn&&(Jl(f,l),v=f.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=f.memoizedProps,v.state=f.memoizedState,v.componentWillUnmount()}catch(V){Qt(f,l,V)}To(o,l,f);break;case 21:To(o,l,f);break;case 22:f.mode&1?(Zn=(v=Zn)||f.memoizedState!==null,To(o,l,f),Zn=v):To(o,l,f);break;default:To(o,l,f)}}function LS(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var f=o.stateNode;f===null&&(f=o.stateNode=new uO),l.forEach(function(v){var b=_O.bind(null,o,v);f.has(v)||(f.add(v),v.then(b,b))})}}function Ds(o,l){var f=l.deletions;if(f!==null)for(var v=0;v<f.length;v++){var b=f[v];try{var C=o,I=l,V=I;e:for(;V!==null;){switch(V.tag){case 5:Ln=V.stateNode,Ls=!1;break e;case 3:Ln=V.stateNode.containerInfo,Ls=!0;break e;case 4:Ln=V.stateNode.containerInfo,Ls=!0;break e}V=V.return}if(Ln===null)throw Error(n(160));OS(C,I,b),Ln=null,Ls=!1;var W=b.alternate;W!==null&&(W.return=null),b.return=null}catch(re){Qt(b,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)DS(l,o),l=l.sibling}function DS(o,l){var f=o.alternate,v=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Ds(l,o),ei(o),v&4){try{Bc(3,o,o.return),kh(3,o)}catch(Ve){Qt(o,o.return,Ve)}try{Bc(5,o,o.return)}catch(Ve){Qt(o,o.return,Ve)}}break;case 1:Ds(l,o),ei(o),v&512&&f!==null&&Jl(f,f.return);break;case 5:if(Ds(l,o),ei(o),v&512&&f!==null&&Jl(f,f.return),o.flags&32){var b=o.stateNode;try{rn(b,"")}catch(Ve){Qt(o,o.return,Ve)}}if(v&4&&(b=o.stateNode,b!=null)){var C=o.memoizedProps,I=f!==null?f.memoizedProps:C,V=o.type,W=o.updateQueue;if(o.updateQueue=null,W!==null)try{V==="input"&&C.type==="radio"&&C.name!=null&&Ye(b,C),Zs(V,I);var re=Zs(V,C);for(I=0;I<W.length;I+=2){var fe=W[I],me=W[I+1];fe==="style"?Mn(b,me):fe==="dangerouslySetInnerHTML"?is(b,me):fe==="children"?rn(b,me):T(b,fe,me,re)}switch(V){case"input":we(b,C);break;case"textarea":tr(b,C);break;case"select":var ce=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!C.multiple;var Me=C.value;Me!=null?vt(b,!!C.multiple,Me,!1):ce!==!!C.multiple&&(C.defaultValue!=null?vt(b,!!C.multiple,C.defaultValue,!0):vt(b,!!C.multiple,C.multiple?[]:"",!1))}b[Oc]=C}catch(Ve){Qt(o,o.return,Ve)}}break;case 6:if(Ds(l,o),ei(o),v&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,C=o.memoizedProps;try{b.nodeValue=C}catch(Ve){Qt(o,o.return,Ve)}}break;case 3:if(Ds(l,o),ei(o),v&4&&f!==null&&f.memoizedState.isDehydrated)try{bc(l.containerInfo)}catch(Ve){Qt(o,o.return,Ve)}break;case 4:Ds(l,o),ei(o);break;case 13:Ds(l,o),ei(o),b=o.child,b.flags&8192&&(C=b.memoizedState!==null,b.stateNode.isHidden=C,!C||b.alternate!==null&&b.alternate.memoizedState!==null||(Xg=_t())),v&4&&LS(o);break;case 22:if(fe=f!==null&&f.memoizedState!==null,o.mode&1?(Zn=(re=Zn)||fe,Ds(l,o),Zn=re):Ds(l,o),ei(o),v&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!fe&&(o.mode&1)!==0)for(Le=o,fe=o.child;fe!==null;){for(me=Le=fe;Le!==null;){switch(ce=Le,Me=ce.child,ce.tag){case 0:case 11:case 14:case 15:Bc(4,ce,ce.return);break;case 1:Jl(ce,ce.return);var Ne=ce.stateNode;if(typeof Ne.componentWillUnmount=="function"){v=ce,f=ce.return;try{l=v,Ne.props=l.memoizedProps,Ne.state=l.memoizedState,Ne.componentWillUnmount()}catch(Ve){Qt(v,f,Ve)}}break;case 5:Jl(ce,ce.return);break;case 22:if(ce.memoizedState!==null){FS(me);continue}}Me!==null?(Me.return=ce,Le=Me):FS(me)}fe=fe.sibling}e:for(fe=null,me=o;;){if(me.tag===5){if(fe===null){fe=me;try{b=me.stateNode,re?(C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(V=me.stateNode,W=me.memoizedProps.style,I=W!=null&&W.hasOwnProperty("display")?W.display:null,V.style.display=Al("display",I))}catch(Ve){Qt(o,o.return,Ve)}}}else if(me.tag===6){if(fe===null)try{me.stateNode.nodeValue=re?"":me.memoizedProps}catch(Ve){Qt(o,o.return,Ve)}}else if((me.tag!==22&&me.tag!==23||me.memoizedState===null||me===o)&&me.child!==null){me.child.return=me,me=me.child;continue}if(me===o)break e;for(;me.sibling===null;){if(me.return===null||me.return===o)break e;fe===me&&(fe=null),me=me.return}fe===me&&(fe=null),me.sibling.return=me.return,me=me.sibling}}break;case 19:Ds(l,o),ei(o),v&4&&LS(o);break;case 21:break;default:Ds(l,o),ei(o)}}function ei(o){var l=o.flags;if(l&2){try{e:{for(var f=o.return;f!==null;){if(IS(f)){var v=f;break e}f=f.return}throw Error(n(160))}switch(v.tag){case 5:var b=v.stateNode;v.flags&32&&(rn(b,""),v.flags&=-33);var C=MS(o);qg(o,C,b);break;case 3:case 4:var I=v.stateNode.containerInfo,V=MS(o);Kg(o,V,I);break;default:throw Error(n(161))}}catch(W){Qt(o,o.return,W)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function dO(o,l,f){Le=o,NS(o)}function NS(o,l,f){for(var v=(o.mode&1)!==0;Le!==null;){var b=Le,C=b.child;if(b.tag===22&&v){var I=b.memoizedState!==null||Ch;if(!I){var V=b.alternate,W=V!==null&&V.memoizedState!==null||Zn;V=Ch;var re=Zn;if(Ch=I,(Zn=W)&&!re)for(Le=b;Le!==null;)I=Le,W=I.child,I.tag===22&&I.memoizedState!==null?VS(b):W!==null?(W.return=I,Le=W):VS(b);for(;C!==null;)Le=C,NS(C),C=C.sibling;Le=b,Ch=V,Zn=re}jS(o)}else(b.subtreeFlags&8772)!==0&&C!==null?(C.return=b,Le=C):jS(o)}}function jS(o){for(;Le!==null;){var l=Le;if((l.flags&8772)!==0){var f=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Zn||kh(5,l);break;case 1:var v=l.stateNode;if(l.flags&4&&!Zn)if(f===null)v.componentDidMount();else{var b=l.elementType===l.type?f.memoizedProps:Os(l.type,f.memoizedProps);v.componentDidUpdate(b,f.memoizedState,v.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&Fb(l,C,v);break;case 3:var I=l.updateQueue;if(I!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}Fb(l,I,f)}break;case 5:var V=l.stateNode;if(f===null&&l.flags&4){f=V;var W=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":W.autoFocus&&f.focus();break;case"img":W.src&&(f.src=W.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var fe=re.memoizedState;if(fe!==null){var me=fe.dehydrated;me!==null&&bc(me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Zn||l.flags&512&&Gg(l)}catch(ce){Qt(l,l.return,ce)}}if(l===o){Le=null;break}if(f=l.sibling,f!==null){f.return=l.return,Le=f;break}Le=l.return}}function FS(o){for(;Le!==null;){var l=Le;if(l===o){Le=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Le=f;break}Le=l.return}}function VS(o){for(;Le!==null;){var l=Le;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{kh(4,l)}catch(W){Qt(l,f,W)}break;case 1:var v=l.stateNode;if(typeof v.componentDidMount=="function"){var b=l.return;try{v.componentDidMount()}catch(W){Qt(l,b,W)}}var C=l.return;try{Gg(l)}catch(W){Qt(l,C,W)}break;case 5:var I=l.return;try{Gg(l)}catch(W){Qt(l,I,W)}}}catch(W){Qt(l,l.return,W)}if(l===o){Le=null;break}var V=l.sibling;if(V!==null){V.return=l.return,Le=V;break}Le=l.return}}var fO=Math.ceil,Ph=k.ReactCurrentDispatcher,Zg=k.ReactCurrentOwner,ps=k.ReactCurrentBatchConfig,ft=0,Cn=null,dn=null,Dn=0,Ur=0,eu=So(0),xn=0,Wc=null,Ia=0,Th=0,Yg=0,Gc=null,wr=null,Xg=0,tu=1/0,Mi=null,Rh=!1,Qg=null,Ro=null,Ah=!1,Ao=null,Ih=0,Kc=0,Jg=null,Mh=-1,Oh=0;function ir(){return(ft&6)!==0?_t():Mh!==-1?Mh:Mh=_t()}function Io(o){return(o.mode&1)===0?1:(ft&2)!==0&&Dn!==0?Dn&-Dn:ZM.transition!==null?(Oh===0&&(Oh=As()),Oh):(o=lt,o!==0||(o=window.event,o=o===void 0?16:Hw(o.type)),o)}function Ns(o,l,f,v){if(50<Kc)throw Kc=0,Jg=null,Error(n(185));vr(o,f,v),((ft&2)===0||o!==Cn)&&(o===Cn&&((ft&2)===0&&(Th|=f),xn===4&&Mo(o,Dn)),br(o,v),f===1&&ft===0&&(l.mode&1)===0&&(tu=_t()+500,ah&&Co()))}function br(o,l){var f=o.callbackNode;rr(o,l);var v=Ke(o,o===Cn?Dn:0);if(v===0)f!==null&&vc(f),o.callbackNode=null,o.callbackPriority=0;else if(l=v&-v,o.callbackPriority!==l){if(f!=null&&vc(f),l===1)o.tag===0?qM(HS.bind(null,o)):kb(HS.bind(null,o)),BM(function(){(ft&6)===0&&Co()}),f=null;else{switch(Ow(v)){case 1:f=wa;break;case 4:f=Hf;break;case 16:f=ba;break;case 536870912:f=Ll;break;default:f=ba}f=ZS(f,$S.bind(null,o))}o.callbackPriority=l,o.callbackNode=f}}function $S(o,l){if(Mh=-1,Oh=0,(ft&6)!==0)throw Error(n(327));var f=o.callbackNode;if(nu()&&o.callbackNode!==f)return null;var v=Ke(o,o===Cn?Dn:0);if(v===0)return null;if((v&30)!==0||(v&o.expiredLanes)!==0||l)l=Lh(o,v);else{l=v;var b=ft;ft|=2;var C=US();(Cn!==o||Dn!==l)&&(Mi=null,tu=_t()+500,Oa(o,l));do try{mO();break}catch(V){zS(o,V)}while(!0);vg(),Ph.current=C,ft=b,dn!==null?l=0:(Cn=null,Dn=0,l=xn)}if(l!==0){if(l===2&&(b=Wn(o),b!==0&&(v=b,l=ev(o,b))),l===1)throw f=Wc,Oa(o,0),Mo(o,v),br(o,_t()),f;if(l===6)Mo(o,v);else{if(b=o.current.alternate,(v&30)===0&&!hO(b)&&(l=Lh(o,v),l===2&&(C=Wn(o),C!==0&&(v=C,l=ev(o,C))),l===1))throw f=Wc,Oa(o,0),Mo(o,v),br(o,_t()),f;switch(o.finishedWork=b,o.finishedLanes=v,l){case 0:case 1:throw Error(n(345));case 2:La(o,wr,Mi);break;case 3:if(Mo(o,v),(v&130023424)===v&&(l=Xg+500-_t(),10<l)){if(Ke(o,0)!==0)break;if(b=o.suspendedLanes,(b&v)!==v){ir(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=og(La.bind(null,o,wr,Mi),l);break}La(o,wr,Mi);break;case 4:if(Mo(o,v),(v&4194240)===v)break;for(l=o.eventTimes,b=-1;0<v;){var I=31-gr(v);C=1<<I,I=l[I],I>b&&(b=I),v&=~C}if(v=b,v=_t()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*fO(v/1960))-v,10<v){o.timeoutHandle=og(La.bind(null,o,wr,Mi),v);break}La(o,wr,Mi);break;case 5:La(o,wr,Mi);break;default:throw Error(n(329))}}}return br(o,_t()),o.callbackNode===f?$S.bind(null,o):null}function ev(o,l){var f=Gc;return o.current.memoizedState.isDehydrated&&(Oa(o,l).flags|=256),o=Lh(o,l),o!==2&&(l=wr,wr=f,l!==null&&tv(l)),o}function tv(o){wr===null?wr=o:wr.push.apply(wr,o)}function hO(o){for(var l=o;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var v=0;v<f.length;v++){var b=f[v],C=b.getSnapshot;b=b.value;try{if(!Is(C(),b))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Mo(o,l){for(l&=~Yg,l&=~Th,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var f=31-gr(l),v=1<<f;o[f]=-1,l&=~v}}function HS(o){if((ft&6)!==0)throw Error(n(327));nu();var l=Ke(o,0);if((l&1)===0)return br(o,_t()),null;var f=Lh(o,l);if(o.tag!==0&&f===2){var v=Wn(o);v!==0&&(l=v,f=ev(o,v))}if(f===1)throw f=Wc,Oa(o,0),Mo(o,l),br(o,_t()),f;if(f===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,La(o,wr,Mi),br(o,_t()),null}function nv(o,l){var f=ft;ft|=1;try{return o(l)}finally{ft=f,ft===0&&(tu=_t()+500,ah&&Co())}}function Ma(o){Ao!==null&&Ao.tag===0&&(ft&6)===0&&nu();var l=ft;ft|=1;var f=ps.transition,v=lt;try{if(ps.transition=null,lt=1,o)return o()}finally{lt=v,ps.transition=f,ft=l,(ft&6)===0&&Co()}}function rv(){Ur=eu.current,Lt(eu)}function Oa(o,l){o.finishedWork=null,o.finishedLanes=0;var f=o.timeoutHandle;if(f!==-1&&(o.timeoutHandle=-1,UM(f)),dn!==null)for(f=dn.return;f!==null;){var v=f;switch(fg(v),v.tag){case 1:v=v.type.childContextTypes,v!=null&&ih();break;case 3:Xl(),Lt(yr),Lt(Gn),Cg();break;case 5:Sg(v);break;case 4:Xl();break;case 13:Lt(Gt);break;case 19:Lt(Gt);break;case 10:yg(v.type._context);break;case 22:case 23:rv()}f=f.return}if(Cn=o,dn=o=Oo(o.current,null),Dn=Ur=l,xn=0,Wc=null,Yg=Th=Ia=0,wr=Gc=null,Ta!==null){for(l=0;l<Ta.length;l++)if(f=Ta[l],v=f.interleaved,v!==null){f.interleaved=null;var b=v.next,C=f.pending;if(C!==null){var I=C.next;C.next=b,v.next=I}f.pending=v}Ta=null}return o}function zS(o,l){do{var f=dn;try{if(vg(),vh.current=wh,yh){for(var v=Kt.memoizedState;v!==null;){var b=v.queue;b!==null&&(b.pending=null),v=v.next}yh=!1}if(Aa=0,En=_n=Kt=null,Vc=!1,$c=0,Zg.current=null,f===null||f.return===null){xn=1,Wc=l,dn=null;break}e:{var C=o,I=f.return,V=f,W=l;if(l=Dn,V.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var re=W,fe=V,me=fe.tag;if((fe.mode&1)===0&&(me===0||me===11||me===15)){var ce=fe.alternate;ce?(fe.updateQueue=ce.updateQueue,fe.memoizedState=ce.memoizedState,fe.lanes=ce.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Me=hS(I);if(Me!==null){Me.flags&=-257,pS(Me,I,V,C,l),Me.mode&1&&fS(C,re,l),l=Me,W=re;var Ne=l.updateQueue;if(Ne===null){var Ve=new Set;Ve.add(W),l.updateQueue=Ve}else Ne.add(W);break e}else{if((l&1)===0){fS(C,re,l),sv();break e}W=Error(n(426))}}else if($t&&V.mode&1){var sn=hS(I);if(sn!==null){(sn.flags&65536)===0&&(sn.flags|=256),pS(sn,I,V,C,l),mg(Ql(W,V));break e}}C=W=Ql(W,V),xn!==4&&(xn=2),Gc===null?Gc=[C]:Gc.push(C),C=I;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var Q=cS(C,W,l);jb(C,Q);break e;case 1:V=W;var q=C.type,ee=C.stateNode;if((C.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(Ro===null||!Ro.has(ee)))){C.flags|=65536,l&=-l,C.lanes|=l;var _e=dS(C,V,l);jb(C,_e);break e}}C=C.return}while(C!==null)}WS(f)}catch($e){l=$e,dn===f&&f!==null&&(dn=f=f.return);continue}break}while(!0)}function US(){var o=Ph.current;return Ph.current=wh,o===null?wh:o}function sv(){(xn===0||xn===3||xn===2)&&(xn=4),Cn===null||(Ia&268435455)===0&&(Th&268435455)===0||Mo(Cn,Dn)}function Lh(o,l){var f=ft;ft|=2;var v=US();(Cn!==o||Dn!==l)&&(Mi=null,Oa(o,l));do try{pO();break}catch(b){zS(o,b)}while(!0);if(vg(),ft=f,Ph.current=v,dn!==null)throw Error(n(261));return Cn=null,Dn=0,xn}function pO(){for(;dn!==null;)BS(dn)}function mO(){for(;dn!==null&&!D0();)BS(dn)}function BS(o){var l=qS(o.alternate,o,Ur);o.memoizedProps=o.pendingProps,l===null?WS(o):dn=l,Zg.current=null}function WS(o){var l=o;do{var f=l.alternate;if(o=l.return,(l.flags&32768)===0){if(f=aO(f,l,Ur),f!==null){dn=f;return}}else{if(f=lO(f,l),f!==null){f.flags&=32767,dn=f;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{xn=6,dn=null;return}}if(l=l.sibling,l!==null){dn=l;return}dn=l=o}while(l!==null);xn===0&&(xn=5)}function La(o,l,f){var v=lt,b=ps.transition;try{ps.transition=null,lt=1,gO(o,l,f,v)}finally{ps.transition=b,lt=v}return null}function gO(o,l,f,v){do nu();while(Ao!==null);if((ft&6)!==0)throw Error(n(327));f=o.finishedWork;var b=o.finishedLanes;if(f===null)return null;if(o.finishedWork=null,o.finishedLanes=0,f===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=f.lanes|f.childLanes;if(On(o,C),o===Cn&&(dn=Cn=null,Dn=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Ah||(Ah=!0,ZS(ba,function(){return nu(),null})),C=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||C){C=ps.transition,ps.transition=null;var I=lt;lt=1;var V=ft;ft|=4,Zg.current=null,cO(o,f),DS(f,o),NM(sg),Wf=!!rg,sg=rg=null,o.current=f,dO(f),Mw(),ft=V,lt=I,ps.transition=C}else o.current=f;if(Ah&&(Ah=!1,Ao=o,Ih=b),C=o.pendingLanes,C===0&&(Ro=null),zf(f.stateNode),br(o,_t()),l!==null)for(v=o.onRecoverableError,f=0;f<l.length;f++)b=l[f],v(b.value,{componentStack:b.stack,digest:b.digest});if(Rh)throw Rh=!1,o=Qg,Qg=null,o;return(Ih&1)!==0&&o.tag!==0&&nu(),C=o.pendingLanes,(C&1)!==0?o===Jg?Kc++:(Kc=0,Jg=o):Kc=0,Co(),null}function nu(){if(Ao!==null){var o=Ow(Ih),l=ps.transition,f=lt;try{if(ps.transition=null,lt=16>o?16:o,Ao===null)var v=!1;else{if(o=Ao,Ao=null,Ih=0,(ft&6)!==0)throw Error(n(331));var b=ft;for(ft|=4,Le=o.current;Le!==null;){var C=Le,I=C.child;if((Le.flags&16)!==0){var V=C.deletions;if(V!==null){for(var W=0;W<V.length;W++){var re=V[W];for(Le=re;Le!==null;){var fe=Le;switch(fe.tag){case 0:case 11:case 15:Bc(8,fe,C)}var me=fe.child;if(me!==null)me.return=fe,Le=me;else for(;Le!==null;){fe=Le;var ce=fe.sibling,Me=fe.return;if(AS(fe),fe===re){Le=null;break}if(ce!==null){ce.return=Me,Le=ce;break}Le=Me}}}var Ne=C.alternate;if(Ne!==null){var Ve=Ne.child;if(Ve!==null){Ne.child=null;do{var sn=Ve.sibling;Ve.sibling=null,Ve=sn}while(Ve!==null)}}Le=C}}if((C.subtreeFlags&2064)!==0&&I!==null)I.return=C,Le=I;else e:for(;Le!==null;){if(C=Le,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:Bc(9,C,C.return)}var Q=C.sibling;if(Q!==null){Q.return=C.return,Le=Q;break e}Le=C.return}}var q=o.current;for(Le=q;Le!==null;){I=Le;var ee=I.child;if((I.subtreeFlags&2064)!==0&&ee!==null)ee.return=I,Le=ee;else e:for(I=q;Le!==null;){if(V=Le,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:kh(9,V)}}catch($e){Qt(V,V.return,$e)}if(V===I){Le=null;break e}var _e=V.sibling;if(_e!==null){_e.return=V.return,Le=_e;break e}Le=V.return}}if(ft=b,Co(),Vr&&typeof Vr.onPostCommitFiberRoot=="function")try{Vr.onPostCommitFiberRoot(Sa,o)}catch{}v=!0}return v}finally{lt=f,ps.transition=l}}return!1}function GS(o,l,f){l=Ql(f,l),l=cS(o,l,1),o=Po(o,l,1),l=ir(),o!==null&&(vr(o,1,l),br(o,l))}function Qt(o,l,f){if(o.tag===3)GS(o,o,f);else for(;l!==null;){if(l.tag===3){GS(l,o,f);break}else if(l.tag===1){var v=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Ro===null||!Ro.has(v))){o=Ql(f,o),o=dS(l,o,1),l=Po(l,o,1),o=ir(),l!==null&&(vr(l,1,o),br(l,o));break}}l=l.return}}function vO(o,l,f){var v=o.pingCache;v!==null&&v.delete(l),l=ir(),o.pingedLanes|=o.suspendedLanes&f,Cn===o&&(Dn&f)===f&&(xn===4||xn===3&&(Dn&130023424)===Dn&&500>_t()-Xg?Oa(o,0):Yg|=f),br(o,l)}function KS(o,l){l===0&&((o.mode&1)===0?l=1:(l=pe,pe<<=1,(pe&130023424)===0&&(pe=4194304)));var f=ir();o=Ri(o,l),o!==null&&(vr(o,l,f),br(o,f))}function yO(o){var l=o.memoizedState,f=0;l!==null&&(f=l.retryLane),KS(o,f)}function _O(o,l){var f=0;switch(o.tag){case 13:var v=o.stateNode,b=o.memoizedState;b!==null&&(f=b.retryLane);break;case 19:v=o.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(l),KS(o,f)}var qS;qS=function(o,l,f){if(o!==null)if(o.memoizedProps!==l.pendingProps||yr.current)xr=!0;else{if((o.lanes&f)===0&&(l.flags&128)===0)return xr=!1,oO(o,l,f);xr=(o.flags&131072)!==0}else xr=!1,$t&&(l.flags&1048576)!==0&&Pb(l,uh,l.index);switch(l.lanes=0,l.tag){case 2:var v=l.type;Eh(o,l),o=l.pendingProps;var b=Bl(l,Gn.current);Yl(l,f),b=Tg(null,l,v,o,b,f);var C=Rg();return l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,_r(v)?(C=!0,oh(l)):C=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,wg(l),b.updater=bh,l.stateNode=b,b._reactInternals=l,Dg(l,v,o,f),l=Vg(null,l,v,!0,C,f)):(l.tag=0,$t&&C&&dg(l),sr(null,l,b,f),l=l.child),l;case 16:v=l.elementType;e:{switch(Eh(o,l),o=l.pendingProps,b=v._init,v=b(v._payload),l.type=v,b=l.tag=wO(v),o=Os(v,o),b){case 0:l=Fg(null,l,v,o,f);break e;case 1:l=xS(null,l,v,o,f);break e;case 11:l=mS(null,l,v,o,f);break e;case 14:l=gS(null,l,v,Os(v.type,o),f);break e}throw Error(n(306,v,""))}return l;case 0:return v=l.type,b=l.pendingProps,b=l.elementType===v?b:Os(v,b),Fg(o,l,v,b,f);case 1:return v=l.type,b=l.pendingProps,b=l.elementType===v?b:Os(v,b),xS(o,l,v,b,f);case 3:e:{if(wS(l),o===null)throw Error(n(387));v=l.pendingProps,C=l.memoizedState,b=C.element,Nb(o,l),mh(l,v,null,f);var I=l.memoizedState;if(v=I.element,C.isDehydrated)if(C={element:v,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){b=Ql(Error(n(423)),l),l=bS(o,l,v,f,b);break e}else if(v!==b){b=Ql(Error(n(424)),l),l=bS(o,l,v,f,b);break e}else for(zr=bo(l.stateNode.containerInfo.firstChild),Hr=l,$t=!0,Ms=null,f=Lb(l,null,v,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Kl(),v===b){l=Ii(o,l,f);break e}sr(o,l,v,f)}l=l.child}return l;case 5:return Vb(l),o===null&&pg(l),v=l.type,b=l.pendingProps,C=o!==null?o.memoizedProps:null,I=b.children,ig(v,b)?I=null:C!==null&&ig(v,C)&&(l.flags|=32),_S(o,l),sr(o,l,I,f),l.child;case 6:return o===null&&pg(l),null;case 13:return SS(o,l,f);case 4:return bg(l,l.stateNode.containerInfo),v=l.pendingProps,o===null?l.child=ql(l,null,v,f):sr(o,l,v,f),l.child;case 11:return v=l.type,b=l.pendingProps,b=l.elementType===v?b:Os(v,b),mS(o,l,v,b,f);case 7:return sr(o,l,l.pendingProps,f),l.child;case 8:return sr(o,l,l.pendingProps.children,f),l.child;case 12:return sr(o,l,l.pendingProps.children,f),l.child;case 10:e:{if(v=l.type._context,b=l.pendingProps,C=l.memoizedProps,I=b.value,Rt(fh,v._currentValue),v._currentValue=I,C!==null)if(Is(C.value,I)){if(C.children===b.children&&!yr.current){l=Ii(o,l,f);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var V=C.dependencies;if(V!==null){I=C.child;for(var W=V.firstContext;W!==null;){if(W.context===v){if(C.tag===1){W=Ai(-1,f&-f),W.tag=2;var re=C.updateQueue;if(re!==null){re=re.shared;var fe=re.pending;fe===null?W.next=W:(W.next=fe.next,fe.next=W),re.pending=W}}C.lanes|=f,W=C.alternate,W!==null&&(W.lanes|=f),_g(C.return,f,l),V.lanes|=f;break}W=W.next}}else if(C.tag===10)I=C.type===l.type?null:C.child;else if(C.tag===18){if(I=C.return,I===null)throw Error(n(341));I.lanes|=f,V=I.alternate,V!==null&&(V.lanes|=f),_g(I,f,l),I=C.sibling}else I=C.child;if(I!==null)I.return=C;else for(I=C;I!==null;){if(I===l){I=null;break}if(C=I.sibling,C!==null){C.return=I.return,I=C;break}I=I.return}C=I}sr(o,l,b.children,f),l=l.child}return l;case 9:return b=l.type,v=l.pendingProps.children,Yl(l,f),b=fs(b),v=v(b),l.flags|=1,sr(o,l,v,f),l.child;case 14:return v=l.type,b=Os(v,l.pendingProps),b=Os(v.type,b),gS(o,l,v,b,f);case 15:return vS(o,l,l.type,l.pendingProps,f);case 17:return v=l.type,b=l.pendingProps,b=l.elementType===v?b:Os(v,b),Eh(o,l),l.tag=1,_r(v)?(o=!0,oh(l)):o=!1,Yl(l,f),lS(l,v,b),Dg(l,v,b,f),Vg(null,l,v,!0,o,f);case 19:return CS(o,l,f);case 22:return yS(o,l,f)}throw Error(n(156,l.tag))};function ZS(o,l){return Ml(o,l)}function xO(o,l,f,v){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ms(o,l,f,v){return new xO(o,l,f,v)}function iv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function wO(o){if(typeof o=="function")return iv(o)?1:0;if(o!=null){if(o=o.$$typeof,o===N)return 11;if(o===Y)return 14}return 2}function Oo(o,l){var f=o.alternate;return f===null?(f=ms(o.tag,l,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=l,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&14680064,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,l=o.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f}function Dh(o,l,f,v,b,C){var I=2;if(v=o,typeof o=="function")iv(o)&&(I=1);else if(typeof o=="string")I=5;else e:switch(o){case O:return Da(f.children,b,C,l);case A:I=8,b|=8;break;case M:return o=ms(12,f,l,b|2),o.elementType=M,o.lanes=C,o;case G:return o=ms(13,f,l,b),o.elementType=G,o.lanes=C,o;case Z:return o=ms(19,f,l,b),o.elementType=Z,o.lanes=C,o;case K:return Nh(f,b,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case D:I=10;break e;case F:I=9;break e;case N:I=11;break e;case Y:I=14;break e;case B:I=16,v=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ms(I,f,l,b),l.elementType=o,l.type=v,l.lanes=C,l}function Da(o,l,f,v){return o=ms(7,o,v,l),o.lanes=f,o}function Nh(o,l,f,v){return o=ms(22,o,v,l),o.elementType=K,o.lanes=f,o.stateNode={isHidden:!1},o}function ov(o,l,f){return o=ms(6,o,null,l),o.lanes=f,o}function av(o,l,f){return l=ms(4,o.children!==null?o.children:[],o.key,l),l.lanes=f,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function bO(o,l,f,v,b){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ls(0),this.expirationTimes=ls(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ls(0),this.identifierPrefix=v,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function lv(o,l,f,v,b,C,I,V,W){return o=new bO(o,l,f,V,W),l===1?(l=1,C===!0&&(l|=8)):l=0,C=ms(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:v,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},wg(C),o}function SO(o,l,f){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:v==null?null:""+v,children:o,containerInfo:l,implementation:f}}function YS(o){if(!o)return Eo;o=o._reactInternals;e:{if(Rs(o)!==o||o.tag!==1)throw Error(n(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(_r(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var f=o.type;if(_r(f))return Eb(o,f,l)}return l}function XS(o,l,f,v,b,C,I,V,W){return o=lv(f,v,!0,o,b,C,I,V,W),o.context=YS(null),f=o.current,v=ir(),b=Io(f),C=Ai(v,b),C.callback=l??null,Po(f,C,b),o.current.lanes=b,vr(o,b,v),br(o,v),o}function jh(o,l,f,v){var b=l.current,C=ir(),I=Io(b);return f=YS(f),l.context===null?l.context=f:l.pendingContext=f,l=Ai(C,I),l.payload={element:o},v=v===void 0?null:v,v!==null&&(l.callback=v),o=Po(b,l,I),o!==null&&(Ns(o,b,I,C),ph(o,b,I)),I}function Fh(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function QS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<l?f:l}}function uv(o,l){QS(o,l),(o=o.alternate)&&QS(o,l)}function EO(){return null}var JS=typeof reportError=="function"?reportError:function(o){console.error(o)};function cv(o){this._internalRoot=o}Vh.prototype.render=cv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));jh(o,l,null,null)},Vh.prototype.unmount=cv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Ma(function(){jh(null,o,null,null)}),l[Ci]=null}};function Vh(o){this._internalRoot=o}Vh.prototype.unstable_scheduleHydration=function(o){if(o){var l=Nw();o={blockedOn:null,target:o,priority:l};for(var f=0;f<_o.length&&l!==0&&l<_o[f].priority;f++);_o.splice(f,0,o),f===0&&Vw(o)}};function dv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function $h(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function eE(){}function CO(o,l,f,v,b){if(b){if(typeof v=="function"){var C=v;v=function(){var re=Fh(I);C.call(re)}}var I=XS(l,v,o,0,null,!1,!1,"",eE);return o._reactRootContainer=I,o[Ci]=I.current,Ic(o.nodeType===8?o.parentNode:o),Ma(),I}for(;b=o.lastChild;)o.removeChild(b);if(typeof v=="function"){var V=v;v=function(){var re=Fh(W);V.call(re)}}var W=lv(o,0,!1,null,null,!1,!1,"",eE);return o._reactRootContainer=W,o[Ci]=W.current,Ic(o.nodeType===8?o.parentNode:o),Ma(function(){jh(l,W,f,v)}),W}function Hh(o,l,f,v,b){var C=f._reactRootContainer;if(C){var I=C;if(typeof b=="function"){var V=b;b=function(){var W=Fh(I);V.call(W)}}jh(l,I,o,b)}else I=CO(f,l,o,b,v);return Fh(I)}Lw=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var f=Pe(l.pendingLanes);f!==0&&(us(l,f|1),br(l,_t()),(ft&6)===0&&(tu=_t()+500,Co()))}break;case 13:Ma(function(){var v=Ri(o,1);if(v!==null){var b=ir();Ns(v,o,1,b)}}),uv(o,1)}},N0=function(o){if(o.tag===13){var l=Ri(o,134217728);if(l!==null){var f=ir();Ns(l,o,134217728,f)}uv(o,134217728)}},Dw=function(o){if(o.tag===13){var l=Io(o),f=Ri(o,l);if(f!==null){var v=ir();Ns(f,o,l,v)}uv(o,l)}},Nw=function(){return lt},jw=function(o,l){var f=lt;try{return lt=o,l()}finally{lt=f}},mo=function(o,l,f){switch(l){case"input":if(we(o,f),l=f.name,f.type==="radio"&&l!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var v=f[l];if(v!==o&&v.form===o.form){var b=sh(v);if(!b)throw Error(n(90));Fe(v),we(v,b)}}}break;case"textarea":tr(o,f);break;case"select":l=f.value,l!=null&&vt(o,!!f.multiple,l,!1)}},Wt=nv,Sn=Ma;var kO={usingClientEntryPoint:!1,Events:[Lc,zl,sh,Ze,Mt,nv]},qc={findFiberByHostInstance:Ea,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},PO={bundleType:qc.bundleType,version:qc.version,rendererPackageName:qc.rendererPackageName,rendererConfig:qc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=Vf(o),o===null?null:o.stateNode},findFiberByHostInstance:qc.findFiberByHostInstance||EO,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zh.isDisabled&&zh.supportsFiber)try{Sa=zh.inject(PO),Vr=zh}catch{}}return Sr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=kO,Sr.createPortal=function(o,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dv(l))throw Error(n(200));return SO(o,l,null,f)},Sr.createRoot=function(o,l){if(!dv(o))throw Error(n(299));var f=!1,v="",b=JS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(v=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=lv(o,1,!1,null,null,f,!1,v,b),o[Ci]=l.current,Ic(o.nodeType===8?o.parentNode:o),new cv(l)},Sr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=Vf(l),o=o===null?null:o.stateNode,o},Sr.flushSync=function(o){return Ma(o)},Sr.hydrate=function(o,l,f){if(!$h(l))throw Error(n(200));return Hh(null,o,l,!0,f)},Sr.hydrateRoot=function(o,l,f){if(!dv(o))throw Error(n(405));var v=f!=null&&f.hydratedSources||null,b=!1,C="",I=JS;if(f!=null&&(f.unstable_strictMode===!0&&(b=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(I=f.onRecoverableError)),l=XS(l,null,o,1,f??null,b,!1,C,I),o[Ci]=l.current,Ic(o),v)for(o=0;o<v.length;o++)f=v[o],b=f._getVersion,b=b(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,b]:l.mutableSourceEagerHydrationData.push(f,b);return new Vh(l)},Sr.render=function(o,l,f){if(!$h(l))throw Error(n(200));return Hh(null,o,l,!1,f)},Sr.unmountComponentAtNode=function(o){if(!$h(o))throw Error(n(40));return o._reactRootContainer?(Ma(function(){Hh(null,null,o,!1,function(){o._reactRootContainer=null,o[Ci]=null})}),!0):!1},Sr.unstable_batchedUpdates=nv,Sr.unstable_renderSubtreeIntoContainer=function(o,l,f,v){if(!$h(f))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return Hh(o,l,f,!1,v)},Sr.version="18.3.1-next-f1338f8080-20240426",Sr}var EC;function FP(){if(EC)return Wv.exports;EC=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Wv.exports=ZN(),Wv.exports}var CC;function YN(){if(CC)return ep;CC=1;var t=FP();return ep.createRoot=t.createRoot,ep.hydrateRoot=t.hydrateRoot,ep}var XN=YN();const QN=t0(XN),eo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function VP(t){return"init"in t}function qy(t){return typeof t.write=="function"}function JN(t){return!!t.onMount}function kC(t){return"v"in t||"e"in t}function Sm(t){if("e"in t)throw t.e;if((eo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Em(t){return typeof(t==null?void 0:t.then)=="function"}function e9(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function $P(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function HP(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const a=new Set(s);for(const u of i)a.add(u);return a}function t9(t){return!!t.INTERNAL_onInit}const n9=(t,e,n,...r)=>n.read(...r),r9=(t,e,n,...r)=>n.write(...r),s9=(t,e,n)=>n.INTERNAL_onInit(e),i9=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},o9=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const a=t[6],u=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=a.i)==null||r.call(a,n),t9(n)&&u(t,e,n)}return i},a9=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],a=t[5],u=t[6],c=t[13];if(!u.f&&!s.size&&!i.size&&!a.size)return;const d=[],h=p=>{try{p()}catch(m){d.push(m)}};do{u.f&&h(u.f);const p=new Set;for(const m of s){const y=(n=r.get(m))==null?void 0:n.l;if(y)for(const x of y)p.add(x)}s.clear();for(const m of a)p.add(m);a.clear();for(const m of i)p.add(m);i.clear();for(const m of p)h(m);s.size&&c(t,e)}while(s.size||a.size||i.size);if(d.length)throw new AggregateError(d)},l9=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],a=t[14],u=t[17];if(!s.size)return;const c=[],d=[],h=new WeakSet,p=new WeakSet,m=[],y=[];for(const x of s)m.push(x),y.push(i(t,e,x));for(;m.length;){const x=m.length-1,_=m[x],w=y[x];if(p.has(_)){m.pop(),y.pop();continue}if(h.has(_)){if(r.get(_)===w.n)c.push(_),d.push(w);else if((eo?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),m.pop(),y.pop();continue}h.add(_);for(const E of HP(_,w,n))h.has(E)||(m.push(E),y.push(i(t,e,E)))}for(let x=c.length-1;x>=0;--x){const _=c[x],w=d[x];let E=!1;for(const P of w.d.keys())if(P!==_&&s.has(P)){E=!0;break}E&&(r.set(_,w.n),a(t,e,_),u(t,e,_)),r.delete(_)}},Zy=new WeakSet,u9=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],d=t[7],h=t[11],p=t[12],m=t[13],y=t[14],x=t[16],_=t[17],w=t[20],E=t[26],P=t[28],T=h(t,e,n),k=P[0];if(kC(T)){if(i.has(n)&&a.get(n)!==T.n||T.m===k)return T.m=k,T;let Y=!1;for(const[B,K]of T.d)if(y(t,e,B).n!==K){Y=!0;break}if(!Y)return T.m=k,T}let R=!0;const L=new Set(T.d.keys()),O=()=>{for(const Y of L)T.d.delete(Y)},A=()=>{if(i.has(n)){const Y=!u.size;_(t,e,n),Y&&(m(t,e),p(t,e))}},M=Y=>{var B;if(Y===n){const $=h(t,e,Y);if(!kC($))if(VP(Y))w(t,e,Y,Y.init);else throw new Error("no atom init");return Sm($)}const K=y(t,e,Y);try{return Sm(K)}finally{L.delete(Y),T.d.set(Y,K.n),Em(T.v)&&$P(n,T.v,K),i.has(n)&&((B=i.get(Y))==null||B.t.add(n)),R||A()}};let D,F;const N={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(eo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(eo?"production":void 0)!=="production"&&!qy(n)&&console.warn("setSelf function cannot be used with read-only atom"),!F&&qy(n)&&(F=(...Y)=>{if((eo?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return x(t,e,n,Y)}finally{m(t,e),p(t,e)}}),F}},G=T.n,Z=a.get(n)===G;try{(eo?"production":void 0)!=="production"&&Zy.delete(e);const Y=d(t,e,n,M,N);if((eo?"production":void 0)!=="production"&&Zy.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,Y),Em(Y)){E(t,e,Y,()=>D==null?void 0:D.abort());const B=()=>{O(),A()};Y.then(B,B)}else O();return(r=c.r)==null||r.call(c,n),T.m=k,T}catch(Y){if(e9(Y))throw Y;return delete T.v,T.e=Y,++T.n,T.m=k,T}finally{R=!1,T.n!==G&&Z&&(a.set(n,T.n),u.add(n),(s=c.c)==null||s.call(c,n))}},c9=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],a=[n];for(;a.length;){const u=a.pop(),c=i(t,e,u);for(const d of HP(u,c,r)){const h=i(t,e,d);s.get(d)!==h.n&&(s.set(d,h.n),a.push(d))}}},d9=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],d=t[13],h=t[14],p=t[15],m=t[16],y=t[17],x=t[20],_=t[28];let w=!0;const E=T=>Sm(h(t,e,T)),P=(T,...k)=>{var R;const L=u(t,e,T);try{if(T===n){if(!VP(T))throw new Error("atom not writable");(eo?"production":void 0)!=="production"&&Zy.add(e);const O=L.n,A=k[0];x(t,e,T,A),y(t,e,T),O!==L.n&&(++_[0],s.add(T),p(t,e,T),(R=i.c)==null||R.call(i,T));return}else return m(t,e,T,k)}finally{w||(d(t,e),c(t,e))}};try{return a(t,e,n,E,P,...r)}finally{w=!1}},f9=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],d=t[18],h=t[19],p=u(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[y,x]of p.d)if(!m.d.has(y)){const _=u(t,e,y);d(t,e,y).t.add(n),m.d.add(y),x!==_.n&&(i.add(y),c(t,e,y),(r=a.c)==null||r.call(a,y))}for(const y of m.d)if(!p.d.has(y)){m.d.delete(y);const x=h(t,e,y);x==null||x.t.delete(n)}}},h9=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],d=t[12],h=t[13],p=t[14],m=t[16],y=t[18],x=c(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const w of x.d.keys())y(t,e,w).t.add(n);if(_={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,_),qy(n)&&JN(n)){const w=()=>{let E=!0;const P=(...T)=>{try{return m(t,e,n,T)}finally{E||(h(t,e),d(t,e))}};try{const T=u(t,e,n,P);T&&(_.u=()=>{E=!0;try{T()}finally{E=!1}})}finally{E=!1}};i.add(w)}(r=a.m)==null||r.call(a,n)}return _},p9=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],d=t[19],h=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const y of p.t)if((r=i.get(y))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const y of h.d.keys()){const x=d(t,e,y);x==null||x.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},m9=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(Em(r))for(const d of a.d.keys())$P(n,r,s(t,e,d));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,Em(c)&&i(t,e,c))},g9=(t,e,n)=>{const r=t[14];return Sm(r(t,e,n))},v9=(t,e,n,...r)=>{const s=t[3],i=t[12],a=t[13],u=t[16],c=s.size;try{return u(t,e,n,r)}finally{s.size!==c&&(a(t,e),i(t,e))}},y9=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],u=t[19],d=a(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),u(t,e,n),i(t,e),s(t,e)}},_9=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const a=()=>s.delete(n);n.then(a,a)}i.add(r)},x9=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},zP=new WeakMap;function w9(t){const e=zP.get(t);if((eo?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function b9(...t){const e={get(a){return r(n,e,a)},set(a,...u){return s(n,e,a,...u)},sub(a,u){return i(n,e,a,u)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},n9,r9,s9,i9,o9,a9,l9,u9,c9,d9,f9,h9,p9,m9,g9,v9,y9,void 0,new WeakMap,_9,x9,[0]].map((a,u)=>t[u]||a);zP.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const UP={};let S9=0;function rt(t,e){const n=`atom${++S9}`,r={toString(){return(UP?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=E9,r.write=C9),e&&(r.write=e),r}function E9(t){return t(this)}function C9(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function k9(){return b9()}let ad;function P9(){return ad||(ad=k9(),(UP?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ad),globalThis.__JOTAI_DEFAULT_STORE__!==ad&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ad}const T9={},R9=g.createContext(void 0);function $2(t){return g.useContext(R9)||P9()}const Yy=t=>typeof(t==null?void 0:t.then)=="function",Xy=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},A9=ve.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Xy(t),t)}),qv=new WeakMap,PC=(t,e,n)=>{const r=w9(t),s=r[26];let i=qv.get(e);return i||(i=new Promise((a,u)=>{let c=e;const d=m=>y=>{c===m&&a(y)},h=m=>y=>{c===m&&u(y)},p=()=>{try{const m=n();Yy(m)?(qv.set(m,i),c=m,m.then(d(m),h(m)),s(r,t,m,p)):a(m)}catch(m){u(m)}};e.then(d(e),h(e)),s(r,t,e,p)}),qv.set(e,i)),i};function Je(t,e){const{delay:n,unstable_promiseStatus:r=!ve.use}={},s=$2(),[[i,a,u],c]=g.useReducer(h=>{const p=s.get(t);return Object.is(h[0],p)&&h[1]===s&&h[2]===t?h:[p,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((a!==s||u!==t)&&(c(),d=s.get(t)),g.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);Yy(p)&&Xy(PC(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
42
-
43
- Migration guide:
44
-
45
- Create a custom hook like the following.
46
-
47
- function useAtomValueWithDelay<Value>(
48
- atom: Atom<Value>,
49
- options: { delay: number },
50
- ): Value {
51
- const { delay } = options
52
- const store = useStore(options)
53
- const [value, setValue] = useState(() => store.get(atom))
54
- useEffect(() => {
55
- const unsub = store.sub(atom, () => {
56
- setTimeout(() => setValue(store.get(atom)), delay)
57
- })
58
- return unsub
59
- }, [store, atom, delay])
60
- return value
61
- }
62
- `),setTimeout(c,n);return}c()});return c(),h},[s,t,n,r]),g.useDebugValue(d),Yy(d)){const h=PC(s,d,()=>s.get(t));return r&&Xy(h),A9(h)}return d}function ot(t,e){const n=$2();return g.useCallback((...s)=>{if((T9?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function BP(t,e){return[Je(t),ot(t)]}const H2=g.createContext({});function z2(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const I9=typeof window<"u",U2=I9?g.useLayoutEffect:g.useEffect,o0=g.createContext(null);function B2(t,e){t.indexOf(e)===-1&&t.push(e)}function Cm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const vi=(t,e,n)=>n>e?e:n<t?t:n;let W2=()=>{};const ia={},WP=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),GP=t=>typeof t=="object"&&t!==null,KP=t=>/^0[^.\s]+$/u.test(t);function qP(t){let e;return()=>(e===void 0&&(e=t()),e)}const Cs=t=>t,Ef=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Gd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class G2{constructor(){this.subscriptions=[]}add(e){return B2(this.subscriptions,e),()=>Cm(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const a=this.subscriptions[i];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Jr=t=>t*1e3,ws=t=>t/1e3,ZP=(t,e)=>e?t*(1e3/e):0,YP=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,M9=1e-7,O9=12;function L9(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=YP(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>M9&&++u<O9);return a}function Cf(t,e,n,r){if(t===e&&n===r)return Cs;const s=i=>L9(i,0,1,t,n);return i=>i===0||i===1?i:YP(s(i),e,r)}const XP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,QP=t=>e=>1-t(1-e),JP=Cf(.33,1.53,.69,.99),K2=QP(JP),e3=XP(K2),t3=t=>t>=1?1:(t*=2)<1?.5*K2(t):.5*(2-Math.pow(2,-10*(t-1))),q2=t=>1-Math.sin(Math.acos(t)),n3=QP(q2),r3=XP(q2),D9=Cf(.42,0,1,1),N9=Cf(0,0,.58,1),s3=Cf(.42,0,.58,1),j9=t=>Array.isArray(t)&&typeof t[0]!="number",i3=t=>Array.isArray(t)&&typeof t[0]=="number",F9={linear:Cs,easeIn:D9,easeInOut:s3,easeOut:N9,circIn:q2,circInOut:r3,circOut:n3,backIn:K2,backInOut:e3,backOut:JP,anticipate:t3},V9=t=>typeof t=="string",TC=t=>{if(i3(t)){W2(t.length===4);const[e,n,r,s]=t;return Cf(e,n,r,s)}else if(V9(t))return F9[t];return t},tp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $9(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(d){i.has(d)&&(c.schedule(d),t()),d(a)}const c={schedule:(d,h=!1,p=!1)=>{const y=p&&r?e:n;return h&&i.add(d),y.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(a=d,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(u),e.clear(),r=!1,s&&(s=!1,c.process(d))}};return c}const H9=40;function o3(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=tp.reduce((T,k)=>(T[k]=$9(i),T),{}),{setup:u,read:c,resolveKeyframes:d,preUpdate:h,update:p,preRender:m,render:y,postRender:x}=a,_=()=>{const T=ia.useManualTiming,k=T?s.timestamp:performance.now();n=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,H9),1)),s.timestamp=k,s.isProcessing=!0,u.process(s),c.process(s),d.process(s),h.process(s),p.process(s),m.process(s),y.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},w=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:tp.reduce((T,k)=>{const R=a[k];return T[k]=(L,O=!1,A=!1)=>(n||w(),R.schedule(L,O,A)),T},{}),cancel:T=>{for(let k=0;k<tp.length;k++)a[tp[k]].cancel(T)},state:s,steps:a}}const{schedule:Pt,cancel:oa,state:jn,steps:Zv}=o3(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cs,!0);let Ap;function z9(){Ap=void 0}const ur={now:()=>(Ap===void 0&&ur.set(jn.isProcessing||ia.useManualTiming?jn.timestamp:performance.now()),Ap),set:t=>{Ap=t,queueMicrotask(z9)}},a3=t=>e=>typeof e=="string"&&e.startsWith(t),l3=a3("--"),U9=a3("var(--"),Z2=t=>U9(t)?B9.test(t.split("/*")[0].trim()):!1,B9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function RC(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const lc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Kd={...lc,transform:t=>vi(0,1,t)},np={...lc,default:1},Pd=t=>Math.round(t*1e5)/1e5,Y2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function W9(t){return t==null}const G9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,X2=(t,e)=>n=>!!(typeof n=="string"&&G9.test(n)&&n.startsWith(t)||e&&!W9(n)&&Object.prototype.hasOwnProperty.call(n,e)),u3=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(Y2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},K9=t=>vi(0,255,t),Yv={...lc,transform:t=>Math.round(K9(t))},sl={test:X2("rgb","red"),parse:u3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Yv.transform(t)+", "+Yv.transform(e)+", "+Yv.transform(n)+", "+Pd(Kd.transform(r))+")"};function q9(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Qy={test:X2("#"),parse:q9,transform:sl.transform},kf=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ui=kf("deg"),gi=kf("%"),je=kf("px"),Z9=kf("vh"),Y9=kf("vw"),AC={...gi,parse:t=>gi.parse(t)/100,transform:t=>gi.transform(t*100)},wu={test:X2("hsl","hue"),parse:u3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+gi.transform(Pd(e))+", "+gi.transform(Pd(n))+", "+Pd(Kd.transform(r))+")"},mn={test:t=>sl.test(t)||Qy.test(t)||wu.test(t),parse:t=>sl.test(t)?sl.parse(t):wu.test(t)?wu.parse(t):Qy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?sl.transform(t):wu.transform(t),getAnimatableNone:t=>{const e=mn.parse(t);return e.alpha=0,mn.transform(e)}},X9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Q9(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Y2))==null?void 0:e.length)||0)+(((n=t.match(X9))==null?void 0:n.length)||0)>0}const c3="number",d3="color",J9="var",ej="var(",IC="${}",tj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tc(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(tj,c=>(mn.test(c)?(r.color.push(i),s.push(d3),n.push(mn.parse(c))):c.startsWith(ej)?(r.var.push(i),s.push(J9),n.push(c)):(r.number.push(i),s.push(c3),n.push(parseFloat(c))),++i,IC)).split(IC);return{values:n,split:u,indexes:r,types:s}}function nj(t){return tc(t).values}function f3({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const a=e[i];a===c3?s+=Pd(r[i]):a===d3?s+=mn.transform(r[i]):s+=r[i]}return s}}function rj(t){return f3(tc(t))}const sj=t=>typeof t=="number"?0:mn.test(t)?mn.getAnimatableNone(t):t,ij=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:sj(t);function oj(t){const e=tc(t);return f3(e)(e.values.map((r,s)=>ij(r,e.split[s])))}const Ws={test:Q9,parse:nj,createTransformer:rj,getAnimatableNone:oj};function Xv(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function aj({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,a=0;if(!e)s=i=a=n;else{const u=n<.5?n*(1+e):n+e-n*e,c=2*n-u;s=Xv(c,u,t+1/3),i=Xv(c,u,t),a=Xv(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function km(t,e){return n=>n>0?e:t}const kt=(t,e,n)=>t+(e-t)*n,Qv=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},lj=[Qy,sl,wu],uj=t=>lj.find(e=>e.test(t));function MC(t){const e=uj(t);if(!e)return!1;let n=e.parse(t);return e===wu&&(n=aj(n)),n}const OC=(t,e)=>{const n=MC(t),r=MC(e);if(!n||!r)return km(t,e);const s={...n};return i=>(s.red=Qv(n.red,r.red,i),s.green=Qv(n.green,r.green,i),s.blue=Qv(n.blue,r.blue,i),s.alpha=kt(n.alpha,r.alpha,i),sl.transform(s))},Jy=new Set(["none","hidden"]);function cj(t,e){return Jy.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function dj(t,e){return n=>kt(t,e,n)}function Q2(t){return typeof t=="number"?dj:typeof t=="string"?Z2(t)?km:mn.test(t)?OC:pj:Array.isArray(t)?h3:typeof t=="object"?mn.test(t)?OC:fj:km}function h3(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>Q2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function fj(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Q2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function hj(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],a=t.indexes[i][r[i]],u=t.values[a]??0;n[s]=u,r[i]++}return n}const pj=(t,e)=>{const n=Ws.createTransformer(e),r=tc(t),s=tc(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Jy.has(t)&&!s.values.length||Jy.has(e)&&!r.values.length?cj(t,e):Ef(h3(hj(r,s),s.values),n):km(t,e)};function p3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?kt(t,e,n):Q2(t)(t,e)}const mj=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Pt.update(e,n),stop:()=>oa(e),now:()=>jn.isProcessing?jn.timestamp:ur.now()}},m3=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Pm=2e4;function J2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Pm;)e+=n,r=t.next(e);return e>=Pm?1/0:e}function gj(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(J2(r),Pm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:ws(s)}}const en={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function e_(t,e){return t*Math.sqrt(1-e*e)}const vj=12;function yj(t,e,n){let r=n;for(let s=1;s<vj;s++)r=r-t(r)/e(r);return r}const Jv=.001;function _j({duration:t=en.duration,bounce:e=en.bounce,velocity:n=en.velocity,mass:r=en.mass}){let s,i,a=1-e;a=vi(en.minDamping,en.maxDamping,a),t=vi(en.minDuration,en.maxDuration,ws(t)),a<1?(s=d=>{const h=d*a,p=h*t,m=h-n,y=e_(d,a),x=Math.exp(-p);return Jv-m/y*x},i=d=>{const p=d*a*t,m=p*n+n,y=Math.pow(a,2)*Math.pow(d,2)*t,x=Math.exp(-p),_=e_(Math.pow(d,2),a);return(-s(d)+Jv>0?-1:1)*((m-y)*x)/_}):(s=d=>{const h=Math.exp(-d*t),p=(d-n)*t+1;return-Jv+h*p},i=d=>{const h=Math.exp(-d*t),p=(n-d)*(t*t);return h*p});const u=5/t,c=yj(s,i,u);if(t=Jr(t),isNaN(c))return{stiffness:en.stiffness,damping:en.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:a*2*Math.sqrt(r*d),duration:t}}}const xj=["duration","bounce"],wj=["stiffness","damping","mass"];function LC(t,e){return e.some(n=>t[n]!==void 0)}function bj(t){let e={velocity:en.velocity,stiffness:en.stiffness,damping:en.damping,mass:en.mass,isResolvedFromDuration:!1,...t};if(!LC(t,wj)&&LC(t,xj))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*vi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:en.mass,stiffness:s,damping:i}}else{const n=_j({...t,velocity:0});e={...e,...n,mass:en.mass},e.isResolvedFromDuration=!0}return e}function Tm(t=en.visualDuration,e=en.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:i},{stiffness:c,damping:d,mass:h,duration:p,velocity:m,isResolvedFromDuration:y}=bj({...n,velocity:-ws(n.velocity||0)}),x=m||0,_=d/(2*Math.sqrt(c*h)),w=a-i,E=ws(Math.sqrt(c/h)),P=Math.abs(w)<5;r||(r=P?en.restSpeed.granular:en.restSpeed.default),s||(s=P?en.restDelta.granular:en.restDelta.default);let T,k,R,L,O,A;if(_<1)R=e_(E,_),L=(x+_*E*w)/R,T=D=>{const F=Math.exp(-_*E*D);return a-F*(L*Math.sin(R*D)+w*Math.cos(R*D))},O=_*E*L+w*R,A=_*E*w-L*R,k=D=>Math.exp(-_*E*D)*(O*Math.sin(R*D)+A*Math.cos(R*D));else if(_===1){T=F=>a-Math.exp(-E*F)*(w+(x+E*w)*F);const D=x+E*w;k=F=>Math.exp(-E*F)*(E*D*F-x)}else{const D=E*Math.sqrt(_*_-1);T=Z=>{const Y=Math.exp(-_*E*Z),B=Math.min(D*Z,300);return a-Y*((x+_*E*w)*Math.sinh(B)+D*w*Math.cosh(B))/D};const F=(x+_*E*w)/D,N=_*E*F-w*D,G=_*E*w-F*D;k=Z=>{const Y=Math.exp(-_*E*Z),B=Math.min(D*Z,300);return Y*(N*Math.sinh(B)+G*Math.cosh(B))}}const M={calculatedDuration:y&&p||null,velocity:D=>Jr(k(D)),next:D=>{if(!y&&_<1){const N=Math.exp(-_*E*D),G=Math.sin(R*D),Z=Math.cos(R*D),Y=a-N*(L*G+w*Z),B=Jr(N*(O*G+A*Z));return u.done=Math.abs(B)<=r&&Math.abs(a-Y)<=s,u.value=u.done?a:Y,u}const F=T(D);if(y)u.done=D>=p;else{const N=Jr(k(D));u.done=Math.abs(N)<=r&&Math.abs(a-F)<=s}return u.value=u.done?a:F,u},toString:()=>{const D=Math.min(J2(M),Pm),F=m3(N=>M.next(D*N).value,D,30);return D+"ms "+F},toTransition:()=>{}};return M}Tm.applyToOptions=t=>{const e=gj(t,100,Tm);return t.ease=e.ease,t.duration=Jr(e.duration),t.type="keyframes",t};const Sj=5;function g3(t,e,n){const r=Math.max(e-Sj,0);return ZP(n-t(r),e-r)}function t_({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:u,max:c,restDelta:d=.5,restSpeed:h}){const p=t[0],m={done:!1,value:p},y=A=>u!==void 0&&A<u||c!==void 0&&A>c,x=A=>u===void 0?c:c===void 0||Math.abs(u-A)<Math.abs(c-A)?u:c;let _=n*e;const w=p+_,E=a===void 0?w:a(w);E!==w&&(_=E-p);const P=A=>-_*Math.exp(-A/r),T=A=>E+P(A),k=A=>{const M=P(A),D=T(A);m.done=Math.abs(M)<=d,m.value=m.done?E:D};let R,L;const O=A=>{y(m.value)&&(R=A,L=Tm({keyframes:[m.value,x(m.value)],velocity:g3(T,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:h}))};return O(0),{calculatedDuration:null,next:A=>{let M=!1;return!L&&R===void 0&&(M=!0,k(A),O(A)),R!==void 0&&A>=R?L.next(A-R):(!M&&k(A),m)}}}function Ej(t,e,n){const r=[],s=n||ia.mix||p3,i=t.length-1;for(let a=0;a<i;a++){let u=s(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||Cs:e;u=Ef(c,u)}r.push(u)}return r}function Cj(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(W2(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const u=Ej(e,r,s),c=u.length,d=h=>{if(a&&h<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const m=Gd(t[p],t[p+1],h);return u[p](m)};return n?h=>d(vi(t[0],t[i-1],h)):d}function kj(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Gd(0,e,r);t.push(kt(n,1,s))}}function Pj(t){const e=[0];return kj(e,t.length-1),e}function Tj(t,e){return t.map(n=>n*e)}function Rj(t,e){return t.map(()=>e||s3).splice(0,t.length-1)}function Td({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=j9(r)?r.map(TC):TC(r),i={done:!1,value:e[0]},a=Tj(n&&n.length===e.length?n:Pj(e),t),u=Cj(a,e,{ease:Array.isArray(s)?s:Rj(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const Aj=t=>t!==null;function a0(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(Aj),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const Ij={decay:t_,inertia:t_,tween:Td,keyframes:Td,spring:Tm};function v3(t){typeof t.type=="string"&&(t.type=Ij[t.type])}class ex{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Mj=t=>t/100;class Rm extends ex{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==ur.now()&&this.tick(ur.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;v3(e);const{type:n=Td,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||Td;c!==Td&&typeof u[0]!="number"&&(this.mixKeyframes=Ef(Mj,p3(u[0],u[1])),u=[0,100]);const d=c({...e,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...u].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=J2(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:h,repeat:p,repeatType:m,repeatDelay:y,type:x,onUpdate:_,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-d*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,k=r;if(p){const A=Math.min(this.currentTime,s)/u;let M=Math.floor(A),D=A%1;!D&&A>=1&&(D=1),D===1&&M--,M=Math.min(M,p+1),!!(M%2)&&(m==="reverse"?(D=1-D,y&&(D-=y/u)):m==="mirror"&&(k=a)),T=vi(0,1,D)*u}let R;P?(this.delayState.value=h[0],R=this.delayState):R=k.next(T),i&&!P&&(R.value=i(R.value));let{done:L}=R;!P&&c!==null&&(L=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return O&&x!==t_&&(R.value=a0(h,this.options,w,this.speed)),_&&_(R.value),O&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return ws(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ws(e)}get time(){return ws(this.currentTime)}set time(e){e=Jr(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return g3(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(ur.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ws(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=mj,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ur.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Oj(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const il=t=>t*180/Math.PI,n_=t=>{const e=il(Math.atan2(t[1],t[0]));return r_(e)},Lj={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:n_,rotateZ:n_,skewX:t=>il(Math.atan(t[1])),skewY:t=>il(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},r_=t=>(t=t%360,t<0&&(t+=360),t),DC=n_,NC=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),jC=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Dj={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:NC,scaleY:jC,scale:t=>(NC(t)+jC(t))/2,rotateX:t=>r_(il(Math.atan2(t[6],t[5]))),rotateY:t=>r_(il(Math.atan2(-t[2],t[0]))),rotateZ:DC,rotate:DC,skewX:t=>il(Math.atan(t[4])),skewY:t=>il(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function s_(t){return t.includes("scale")?1:0}function i_(t,e){if(!t||t==="none")return s_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Dj,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Lj,s=u}if(!s)return s_(e);const i=r[e],a=s[1].split(",").map(jj);return typeof i=="function"?i(a):a[i]}const Nj=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return i_(n,e)};function jj(t){return parseFloat(t.trim())}const uc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cc=new Set([...uc,"pathRotation"]),FC=t=>t===lc||t===je,Fj=new Set(["x","y","z"]),Vj=uc.filter(t=>!Fj.has(t));function $j(t){const e=[];return Vj.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const qo={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>i_(e,"x"),y:(t,{transform:e})=>i_(e,"y")};qo.translateX=qo.x;qo.translateY=qo.y;const vl=new Set;let o_=!1,a_=!1,l_=!1;function y3(){if(a_){const t=Array.from(vl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=$j(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var u;(u=r.getValue(i))==null||u.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}a_=!1,o_=!1,vl.forEach(t=>t.complete(l_)),vl.clear()}function _3(){vl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(a_=!0)})}function Hj(){l_=!0,_3(),y3(),l_=!1}class tx{constructor(e,n,r,s,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(vl.add(this),o_||(o_=!0,Pt.read(_3),Pt.resolveKeyframes(y3))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const u=r.readValue(n,a);u!=null&&(e[0]=u)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}Oj(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),vl.delete(this)}cancel(){this.state==="scheduled"&&(vl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zj=t=>t.startsWith("--");function x3(t,e,n){zj(e)?t.style.setProperty(e,n):t.style[e]=n}const Uj={};function w3(t,e){const n=qP(t);return()=>Uj[e]??n()}const Bj=w3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),b3=w3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),yd=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,VC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yd([0,.65,.55,1]),circOut:yd([.55,0,1,.45]),backIn:yd([.31,.01,.66,-.59]),backOut:yd([.33,1.53,.69,.99])};function S3(t,e){if(t)return typeof t=="function"?b3()?m3(t,e):"ease-out":i3(t)?yd(t):Array.isArray(t)?t.map(n=>S3(n,e)||VC.easeOut):VC[t]}function Wj(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},d=void 0){const h={[e]:n};c&&(h.offset=c);const p=S3(u,s);Array.isArray(p)&&(h.easing=p);const m={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(h,m)}function E3(t){return typeof t=="function"&&"applyToOptions"in t}function Gj({type:t,...e}){return E3(t)&&b3()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class C3 extends ex{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:u,onComplete:c}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,W2(typeof e.type!="string");const d=Gj(e);this.animation=Wj(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=a0(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(h),x3(n,r,h),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ws(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ws(e)}get time(){return ws(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Jr(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Bj()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Cs):s(this)}}const k3={anticipate:t3,backInOut:e3,circInOut:r3};function Kj(t){return t in k3}function qj(t){typeof t.ease=="string"&&Kj(t.ease)&&(t.ease=k3[t.ease])}const e1=10;class Zj extends C3{constructor(e){qj(e),v3(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const u=new Rm({...a,autoplay:!1}),c=Math.max(e1,ur.now()-this.startTime),d=vi(0,e1,c-e1),h=u.sample(c).value,{name:p}=this.options;i&&p&&x3(i,p,h),n.setWithVelocity(u.sample(Math.max(0,c-d)).value,h,d),u.stop()}}const $C=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ws.test(t)||t==="0")&&!t.startsWith("url("));function Yj(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Xj(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],a=$C(s,e),u=$C(i,e);return!a||!u?!1:Yj(t)||(n==="spring"||E3(n))&&r}function u_(t){t.duration=0,t.type="keyframes"}const P3=new Set(["opacity","clipPath","filter","transform"]),Qj=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Jj(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Qj.test(t[e]))return!0;return!1}const e7=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),t7=qP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function n7(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:u}=t;if(!(((p=e==null?void 0:e.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:h}=e.owner.getProps();return t7()&&n&&(P3.has(n)||e7.has(n)&&Jj(u))&&(n!=="transform"||!h)&&!d&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const r7=40;class s7 extends ex{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:u,name:c,motionValue:d,element:h,...p}){var x;super(),this.stop=()=>{var _,w;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=ur.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:d,element:h,...p},y=(h==null?void 0:h.KeyframeResolver)||tx;this.keyframeResolver=new y(u,(_,w,E)=>this.onKeyframesResolved(_,w,m,!E),c,d,h),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var E,P;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:d,onUpdate:h}=r;this.resolvedAt=ur.now();let p=!0;Xj(e,i,a,u)||(p=!1,(ia.instantAnimations||!c)&&(h==null||h(a0(e,r,n))),e[0]=e[e.length-1],u_(r),r.repeat=0);const y={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>r7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!d&&n7(y),_=(P=(E=y.motionValue)==null?void 0:E.owner)==null?void 0:P.current;let w;if(x)try{w=new Zj({...y,element:_})}catch{w=new Rm(y)}else w=new Rm(y);w.finished.then(()=>{this.notifyFinished()}).catch(Cs),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Hj()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function T3(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,h)=>d.sortNodePosition(h)).indexOf(e),a=t.size,u=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:u-i*r}const HC=30,i7=t=>!isNaN(parseFloat(t));class o7{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ur.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ur.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=i7(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new G2);const r=this.events[e].add(n);return e==="change"?()=>{r(),Pt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ur.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>HC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,HC);return ZP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function nc(t,e){return new o7(t,e)}function R3(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function nx(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?R3(n,t):n}const a7={type:"spring",stiffness:500,damping:25,restSpeed:10},l7=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),u7={type:"keyframes",duration:.8},c7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},d7=(t,{keyframes:e})=>e.length>2?u7:cc.has(t)?t.startsWith("scale")?l7(e[1]):a7:c7,f7=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function h7(t){for(const e in t)if(!f7.has(e))return!0;return!1}const rx=(t,e,n,r={},s,i)=>a=>{const u=nx(r,t)||{},c=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Jr(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-d,onUpdate:m=>{e.set(m),u.onUpdate&&u.onUpdate(m)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:i?void 0:s};h7(u)||Object.assign(h,d7(t,h)),h.duration&&(h.duration=Jr(h.duration)),h.repeatDelay&&(h.repeatDelay=Jr(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(u_(h),h.delay===0&&(p=!0)),(ia.instantAnimations||ia.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,u_(h),h.delay=0),h.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const m=a0(h.keyframes,u);if(m!==void 0){Pt.update(()=>{h.onUpdate(m),h.onComplete()});return}}return u.isSync?new Rm(h):new s7(h)},p7=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function m7(t){const e=p7.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function A3(t,e,n=1){const[r,s]=m7(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return WP(a)?parseFloat(a):a}return Z2(s)?A3(s,e,n+1):s}function zC(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function sx(t,e,n,r){if(typeof e=="function"){const[s,i]=zC(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=zC(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function yl(t,e,n){const r=t.getProps();return sx(r,e,n!==void 0?n:r.custom,t)}const I3=new Set(["width","height","top","left","right","bottom",...uc]),c_=t=>Array.isArray(t);function g7(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,nc(n))}function v7(t){return c_(t)?t[t.length-1]||0:t}function y7(t,e){const n=yl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=v7(i[a]);g7(t,a,u)}}const $n=t=>!!(t&&t.getVelocity);function _7(t){return!!($n(t)&&t.add)}function d_(t,e){const n=t.getValue("willChange");if(_7(n))return n.add(e);if(!n&&ia.WillChange){const r=new ia.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function ix(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const x7="framerAppearId",M3="data-"+ix(x7);function O3(t){return t.props[M3]}function w7({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function L3(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?R3(i,c):c;const d=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&t.animationState&&t.animationState.getState()[s],y=i==null?void 0:i.path;y&&y.animateVisualElement(t,u,i,n,p);for(const x in u){const _=t.getValue(x,t.latestValues[x]??null),w=u[x];if(w===void 0||m&&w7(m,x))continue;const E={delay:n,...nx(i||{},x)};h&&(E.skipAnimations=!0);const P=_.get();if(P!==void 0&&!_.isAnimating()&&!Array.isArray(w)&&w===P&&!E.velocity){Pt.update(()=>_.set(w));continue}let T=!1;if(window.MotionHandoffAnimation){const L=O3(t);if(L){const O=window.MotionHandoffAnimation(L,x,Pt);O!==null&&(E.startTime=O,T=!0)}}d_(t,x);const k=d??t.shouldReduceMotion;_.start(rx(x,_,w,k&&I3.has(x)?{type:!1}:E,t,T));const R=_.animation;R&&p.push(R)}if(a){const x=()=>Pt.update(()=>{a&&y7(t,a)});p.length?Promise.all(p).then(x):x()}return p}function f_(t,e,n={}){var c;const r=yl(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(L3(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return b7(t,e,d,h,p,m,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,h]=u==="beforeChildren"?[i,a]:[a,i];return d().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function b7(t,e,n=0,r=0,s=0,i=1,a){const u=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),u.push(f_(c,e,{...a,delay:n+(typeof r=="function"?0:r)+T3(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function S7(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>f_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=f_(t,e,n);else{const s=typeof e=="function"?yl(t,e,n.custom):e;r=Promise.all(L3(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const E7={test:t=>t==="auto",parse:t=>t},D3=t=>e=>e.test(t),N3=[lc,je,gi,Ui,Y9,Z9,E7],UC=t=>N3.find(D3(t));function C7(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||KP(t):!0}const k7=new Set(["brightness","contrast","saturate","opacity"]);function P7(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Y2)||[];if(!r)return t;const s=n.replace(r,"");let i=k7.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const T7=/\b([a-z-]*)\(.*?\)/gu,h_={...Ws,getAnimatableNone:t=>{const e=t.match(T7);return e?e.map(P7).join(" "):t}},p_={...Ws,getAnimatableNone:t=>{const e=Ws.parse(t);return Ws.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},BC={...lc,transform:Math.round},R7={rotate:Ui,pathRotation:Ui,rotateX:Ui,rotateY:Ui,rotateZ:Ui,scale:np,scaleX:np,scaleY:np,scaleZ:np,skew:Ui,skewX:Ui,skewY:Ui,distance:je,translateX:je,translateY:je,translateZ:je,x:je,y:je,z:je,perspective:je,transformPerspective:je,opacity:Kd,originX:AC,originY:AC,originZ:je},Am={borderWidth:je,borderTopWidth:je,borderRightWidth:je,borderBottomWidth:je,borderLeftWidth:je,borderRadius:je,borderTopLeftRadius:je,borderTopRightRadius:je,borderBottomRightRadius:je,borderBottomLeftRadius:je,width:je,maxWidth:je,height:je,maxHeight:je,top:je,right:je,bottom:je,left:je,inset:je,insetBlock:je,insetBlockStart:je,insetBlockEnd:je,insetInline:je,insetInlineStart:je,insetInlineEnd:je,padding:je,paddingTop:je,paddingRight:je,paddingBottom:je,paddingLeft:je,paddingBlock:je,paddingBlockStart:je,paddingBlockEnd:je,paddingInline:je,paddingInlineStart:je,paddingInlineEnd:je,margin:je,marginTop:je,marginRight:je,marginBottom:je,marginLeft:je,marginBlock:je,marginBlockStart:je,marginBlockEnd:je,marginInline:je,marginInlineStart:je,marginInlineEnd:je,fontSize:je,backgroundPositionX:je,backgroundPositionY:je,...R7,zIndex:BC,fillOpacity:Kd,strokeOpacity:Kd,numOctaves:BC},A7={...Am,color:mn,backgroundColor:mn,outlineColor:mn,fill:mn,stroke:mn,borderColor:mn,borderTopColor:mn,borderRightColor:mn,borderBottomColor:mn,borderLeftColor:mn,filter:h_,WebkitFilter:h_,mask:p_,WebkitMask:p_},j3=t=>A7[t],I7=new Set([h_,p_]);function F3(t,e){let n=j3(t);return I7.has(n)||(n=Ws),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const M7=new Set(["auto","none","0"]);function O7(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!M7.has(i)&&tc(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=F3(n,s)}class L7 extends tx{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),Z2(p))){const m=A3(p,n.current);m!==void 0&&(e[h]=m),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!I3.has(r)||e.length!==2)return;const[s,i]=e,a=UC(s),u=UC(i),c=RC(s),d=RC(i);if(c!==d&&qo[r]){this.needsMeasurement=!0;return}if(a!==u)if(FC(a)&&FC(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else qo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||C7(e[s]))&&r.push(s);r.length&&O7(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=qo[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=qo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([c,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const ox=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function V3(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const m_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ip(t){return GP(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:ax}=o3(queueMicrotask,!1),$s={x:!1,y:!1};function $3(){return $s.x||$s.y}function D7(t){return t==="x"||t==="y"?$s[t]?null:($s[t]=!0,()=>{$s[t]=!1}):$s.x||$s.y?null:($s.x=$s.y=!0,()=>{$s.x=$s.y=!1})}function H3(t,e){const n=V3(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function N7(t){return!(t.pointerType==="touch"||$3())}function j7(t,e,n={}){const[r,s,i]=H3(t,n);return r.forEach(a=>{let u=!1,c=!1,d;const h=()=>{a.removeEventListener("pointerleave",x)},p=w=>{d&&(d(w),d=void 0),h()},m=w=>{u=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,p(w))},y=()=>{u=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},x=w=>{if(w.pointerType!=="touch"){if(u){c=!0;return}p(w)}},_=w=>{if(!N7(w))return;c=!1;const E=e(a,w);typeof E=="function"&&(d=E,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",_,s),a.addEventListener("pointerdown",y,s)}),i}const z3=(t,e)=>e?t===e?!0:z3(t,e.parentElement):!1,lx=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,F7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function V7(t){return F7.has(t.tagName)||t.isContentEditable===!0}const $7=new Set(["INPUT","SELECT","TEXTAREA"]);function H7(t){return $7.has(t.tagName)||t.isContentEditable===!0}const Mp=new WeakSet;function WC(t){return e=>{e.key==="Enter"&&t(e)}}function t1(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const z7=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=WC(()=>{if(Mp.has(n))return;t1(n,"down");const s=WC(()=>{t1(n,"up")}),i=()=>t1(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function GC(t){return lx(t)&&!$3()}const KC=new WeakSet;function U7(t,e,n={}){const[r,s,i]=H3(t,n),a=u=>{const c=u.currentTarget;if(!GC(u)||KC.has(u))return;Mp.add(c),n.stopPropagation&&KC.add(u);const d=e(c,u),h={...s,capture:!0},p=(x,_)=>{window.removeEventListener("pointerup",m,h),window.removeEventListener("pointercancel",y,h),Mp.has(c)&&Mp.delete(c),GC(x)&&typeof d=="function"&&d(x,{success:_})},m=x=>{p(x,c===window||c===document||n.useGlobalTarget||z3(c,x.target))},y=x=>{p(x,!1)};window.addEventListener("pointerup",m,h),window.addEventListener("pointercancel",y,h)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),Ip(u)&&(u.addEventListener("focus",d=>z7(d,s)),!V7(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function ux(t){return GP(t)&&"ownerSVGElement"in t}const Op=new WeakMap;let Fo;const U3=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:ux(r)&&"getBBox"in r?r.getBBox()[e]:r[n],B7=U3("inline","width","offsetWidth"),W7=U3("block","height","offsetHeight");function G7({target:t,borderBoxSize:e}){var n;(n=Op.get(t))==null||n.forEach(r=>{r(t,{get width(){return B7(t,e)},get height(){return W7(t,e)}})})}function K7(t){t.forEach(G7)}function q7(){typeof ResizeObserver>"u"||(Fo=new ResizeObserver(K7))}function Z7(t,e){Fo||q7();const n=V3(t);return n.forEach(r=>{let s=Op.get(r);s||(s=new Set,Op.set(r,s)),s.add(e),Fo==null||Fo.observe(r)}),()=>{n.forEach(r=>{const s=Op.get(r);s==null||s.delete(e),s!=null&&s.size||Fo==null||Fo.unobserve(r)})}}const Lp=new Set;let bu;function Y7(){bu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Lp.forEach(e=>e(t))},window.addEventListener("resize",bu)}function X7(t){return Lp.add(t),bu||Y7(),()=>{Lp.delete(t),!Lp.size&&typeof bu=="function"&&(window.removeEventListener("resize",bu),bu=void 0)}}function qC(t,e){return typeof t=="function"?X7(t):Z7(t,e)}function Q7(t){return ux(t)&&t.tagName==="svg"}const J7=[...N3,mn,Ws],eF=t=>J7.find(D3(t)),ZC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Su=()=>({x:ZC(),y:ZC()}),YC=()=>({min:0,max:0}),bn=()=>({x:YC(),y:YC()}),tF=new WeakMap;function l0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function qd(t){return typeof t=="string"||Array.isArray(t)}const cx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dx=["initial",...cx];function u0(t){return l0(t.animate)||dx.some(e=>qd(t[e]))}function B3(t){return!!(u0(t)||t.variants)}function nF(t,e,n){for(const r in e){const s=e[r],i=n[r];if($n(s))t.addValue(r,s);else if($n(i))t.addValue(r,nc(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=t.getStaticValue(r);t.addValue(r,nc(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Im={current:null},fx={current:!1},rF=typeof window<"u";function W3(){if(fx.current=!0,!!rF)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Im.current=t.matches;t.addEventListener("change",e),e()}else Im.current=!1}const XC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Mm={};function G3(t){Mm=t}function sF(){return Mm}class iF{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:u},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=tx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=ur.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Pt.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=u0(n),this.isVariantNode=B3(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const x=m[y];d[y]!==void 0&&$n(x)&&x.set(d[y])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,tF.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(fx.current||W3(),this.shouldReduceMotion=Im.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),oa(this.notifyUpdate),oa(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&P3.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:d,duration:h}=n.accelerate,p=new C3({element:this.current,name:e,keyframes:u,times:c,ease:d,duration:Jr(h)}),m=a(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=cc.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Pt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Mm){const n=Mm[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<XC.length;r++){const s=XC[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,a=e[i];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=nF(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=nc(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(WP(r)||KP(r))?r=parseFloat(r):!eF(r)&&Ws.test(n)&&(r=F3(e,n)),this.setBaseTarget(e,$n(r)?r.get():r)),$n(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=sx(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!$n(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new G2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){ax.render(this.render)}}class K3 extends iF{constructor(){super(...arguments),this.KeyframeResolver=L7}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;$n(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ha{constructor(e){this.isMounted=!1,this.node=e}update(){}}function q3({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function oF({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function aF(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function n1(t){return t===void 0||t===1}function g_({scale:t,scaleX:e,scaleY:n}){return!n1(t)||!n1(e)||!n1(n)}function Qa(t){return g_(t)||Z3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Z3(t){return QC(t.x)||QC(t.y)}function QC(t){return t&&t!=="0%"}function Om(t,e,n){const r=t-n,s=e*r;return n+s}function JC(t,e,n,r,s){return s!==void 0&&(t=Om(t,s,r)),Om(t,n,r)+e}function v_(t,e=0,n=1,r,s){t.min=JC(t.min,e,n,r,s),t.max=JC(t.max,e,n,r,s)}function Y3(t,{x:e,y:n}){v_(t.x,e.translate,e.scale,e.originPoint),v_(t.y,n.translate,n.scale,n.originPoint)}const e4=.999999999999,t4=1.0000000000001;function lF(t,e,n,r=!1){var u;const s=n.length;if(!s)return;e.x=e.y=1;let i,a;for(let c=0;c<s;c++){i=n[c],a=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(ci(t.x,-i.scroll.offset.x),ci(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,Y3(t,a)),r&&Qa(i.latestValues)&&Dp(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<t4&&e.x>e4&&(e.x=1),e.y<t4&&e.y>e4&&(e.y=1)}function ci(t,e){t.min+=e,t.max+=e}function n4(t,e,n,r,s=.5){const i=kt(t.min,t.max,s);v_(t,e,n,i,r)}function r4(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Dp(t,e,n){const r=n??t;n4(t.x,r4(e.x,r.x),e.scaleX,e.scale,e.originX),n4(t.y,r4(e.y,r.y),e.scaleY,e.scale,e.originY)}function X3(t,e){return q3(aF(t.getBoundingClientRect(),e))}function uF(t,e,n){const r=X3(t,n),{scroll:s}=e;return s&&(ci(r.x,s.offset.x),ci(r.y,s.offset.y)),r}const cF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dF=uc.length;function fF(t,e,n){let r="",s=!0;for(let a=0;a<dF;a++){const u=uc[a],c=t[u];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(u.startsWith("scale")?1:0);else{const h=parseFloat(c);d=u.startsWith("scale")?h===1:h===0}if(!d||n){const h=m_(c,Am[u]);if(!d){s=!1;const p=cF[u]||u;r+=`${p}(${h}) `}n&&(e[u]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${m_(i,Am.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function hx(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,u=!1;for(const c in e){const d=e[c];if(cc.has(c)){a=!0;continue}else if(l3(c)){s[c]=d;continue}else{const h=m_(d,Am[c]);c.startsWith("origin")?(u=!0,i[c]=h):r[c]=h}}if(e.transform||(a||n?r.transform=fF(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:d="50%",originZ:h=0}=i;r.transformOrigin=`${c} ${d} ${h}`}}function Q3(t,{style:e,vars:n},r,s){const i=t.style;let a;for(a in e)i[a]=e[a];s==null||s.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function s4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ld={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(je.test(t))t=parseFloat(t);else return t;const n=s4(t,e.target.x),r=s4(t,e.target.y);return`${n}% ${r}%`}},hF={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ws.parse(t);if(s.length>5)return r;const i=Ws.createTransformer(t),a=typeof s[0]!="number"?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+a]/=u,s[1+a]/=c;const d=kt(u,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=d),typeof s[3+a]=="number"&&(s[3+a]/=d),i(s)}},y_={borderRadius:{...ld,applyTo:[...ox]},borderTopLeftRadius:ld,borderTopRightRadius:ld,borderBottomLeftRadius:ld,borderBottomRightRadius:ld,boxShadow:hF};function J3(t,{layout:e,layoutId:n}){return cc.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!y_[t]||t==="opacity")}function px(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const u in r)($n(r[u])||s&&$n(s[u])||J3(u,t)||((a=n==null?void 0:n.getValue(u))==null?void 0:a.liveStyle)!==void 0)&&(i[u]=r[u]);return i}function pF(t){return window.getComputedStyle(t)}class mF extends K3{constructor(){super(...arguments),this.type="html",this.renderInstance=Q3}readValueFromInstance(e,n){var r;if(cc.has(n))return(r=this.projection)!=null&&r.isProjecting?s_(n):Nj(e,n);{const s=pF(e),i=(l3(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return X3(e,n)}build(e,n,r){hx(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return px(e,n,r)}}const gF={offset:"stroke-dashoffset",array:"stroke-dasharray"},vF={offset:"strokeDashoffset",array:"strokeDasharray"};function yF(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?gF:vF;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const _F=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eT(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,d,h){if(hx(t,u,d),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m}=t;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const y of _F)p[y]!==void 0&&(m[y]=p[y],delete p[y]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&yF(p,s,i,a,!1)}const tT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),nT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function xF(t,e,n,r){Q3(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(tT.has(s)?s:ix(s),e.attrs[s])}function rT(t,e,n){const r=px(t,e,n);for(const s in t)if($n(t[s])||$n(e[s])){const i=uc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class wF extends K3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(cc.has(n)){const r=j3(n);return r&&r.default||0}return n=tT.has(n)?n:ix(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return rT(e,n,r)}build(e,n,r){eT(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){xF(e,n,r,s)}mount(e){this.isSVGTag=nT(e.tagName),super.mount(e)}}const bF=dx.length;function sT(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?sT(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<bF;n++){const r=dx[n],s=t.props[r];(qd(s)||s===!1)&&(e[r]=s)}return e}function iT(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const SF=[...cx].reverse(),EF=cx.length;function CF(t){return e=>Promise.all(e.map(({animation:n,options:r})=>S7(t,n,r)))}function kF(t){let e=CF(t),n=i4(),r=!0,s=!1;const i=d=>(h,p)=>{var y;const m=yl(t,p,d==="exit"?(y=t.presenceContext)==null?void 0:y.custom:void 0);if(m){const{transition:x,transitionEnd:_,...w}=m;h={...h,...w,..._}}return h};function a(d){e=d(t)}function u(d){const{props:h}=t,p=sT(t.parent)||{},m=[],y=new Set;let x={},_=1/0;for(let E=0;E<EF;E++){const P=SF[E],T=n[P],k=h[P]!==void 0?h[P]:p[P],R=qd(k),L=P===d?T.isActive:null;L===!1&&(_=E);let O=k===p[P]&&k!==h[P]&&R;if(O&&(r||s)&&t.manuallyAnimateOnMount&&(O=!1),T.protectedKeys={...x},!T.isActive&&L===null||!k&&!T.prevProp||l0(k)||typeof k=="boolean")continue;if(P==="exit"&&T.isActive&&L!==!0){T.prevResolvedValues&&(x={...x,...T.prevResolvedValues});continue}const A=PF(T.prevProp,k);let M=A||P===d&&T.isActive&&!O&&R||E>_&&R,D=!1;const F=Array.isArray(k)?k:[k];let N=F.reduce(i(P),{});L===!1&&(N={});const{prevResolvedValues:G={}}=T,Z={...G,...N},Y=$=>{M=!0,y.has($)&&(D=!0,y.delete($)),T.needsAnimating[$]=!0;const J=t.getValue($);J&&(J.liveStyle=!1)};for(const $ in Z){const J=N[$],H=G[$];if(x.hasOwnProperty($))continue;let j=!1;c_(J)&&c_(H)?j=!iT(J,H)||A:j=J!==H,j?J!=null?Y($):y.add($):J!==void 0&&y.has($)?Y($):T.protectedKeys[$]=!0}T.prevProp=k,T.prevResolvedValues=N,T.isActive&&(x={...x,...N}),(r||s)&&t.blockInitialAnimation&&(M=!1);const B=O&&A;M&&(!B||D)&&m.push(...F.map($=>{const J={type:P};if(typeof $=="string"&&(r||s)&&!B&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,j=yl(H,$);if(H.enteringChildren&&j){const{delayChildren:X}=j.transition||{};J.delay=T3(H.enteringChildren,t,X)}}return{animation:$,options:J}}))}if(y.size){const E={};if(typeof h.initial!="boolean"){const P=yl(t,Array.isArray(h.initial)?h.initial[0]:h.initial);P&&P.transition&&(E.transition=P.transition)}y.forEach(P=>{const T=t.getBaseTarget(P),k=t.getValue(P);k&&(k.liveStyle=!0),E[P]=T??null}),m.push({animation:E})}let w=!!m.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?e(m):Promise.resolve()}function c(d,h){var m;if(n[d].isActive===h)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(y=>{var x;return(x=y.animationState)==null?void 0:x.setActive(d,h)}),n[d].isActive=h;const p=u(d);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=i4(),s=!0}}}function PF(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!iT(e,t):!1}function Ha(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function i4(){return{animate:Ha(!0),whileInView:Ha(),whileHover:Ha(),whileTap:Ha(),whileDrag:Ha(),whileFocus:Ha(),exit:Ha()}}function __(t,e){t.min=e.min,t.max=e.max}function js(t,e){__(t.x,e.x),__(t.y,e.y)}function o4(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const oT=1e-4,TF=1-oT,RF=1+oT,aT=.01,AF=0-aT,IF=0+aT;function cr(t){return t.max-t.min}function MF(t,e,n){return Math.abs(t-e)<=n}function a4(t,e,n,r=.5){t.origin=r,t.originPoint=kt(e.min,e.max,t.origin),t.scale=cr(n)/cr(e),t.translate=kt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=TF&&t.scale<=RF||isNaN(t.scale))&&(t.scale=1),(t.translate>=AF&&t.translate<=IF||isNaN(t.translate))&&(t.translate=0)}function Rd(t,e,n,r){a4(t.x,e.x,n.x,r?r.originX:void 0),a4(t.y,e.y,n.y,r?r.originY:void 0)}function l4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+cr(e)}function OF(t,e,n,r){l4(t.x,e.x,n.x,r==null?void 0:r.x),l4(t.y,e.y,n.y,r==null?void 0:r.y)}function u4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+cr(e)}function Lm(t,e,n,r){u4(t.x,e.x,n.x,r==null?void 0:r.x),u4(t.y,e.y,n.y,r==null?void 0:r.y)}function c4(t,e,n,r,s){return t-=e,t=Om(t,1/n,r),s!==void 0&&(t=Om(t,1/s,r)),t}function LF(t,e=0,n=1,r=.5,s,i=t,a=t){if(gi.test(e)&&(e=parseFloat(e),e=kt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=kt(i.min,i.max,r);t===i&&(u-=e),t.min=c4(t.min,e,n,u,s),t.max=c4(t.max,e,n,u,s)}function d4(t,e,[n,r,s],i,a){LF(t,e[n],e[r],e[s],e.scale,i,a)}const DF=["x","scaleX","originX"],NF=["y","scaleY","originY"];function f4(t,e,n,r){d4(t.x,e,DF,n?n.x:void 0,r?r.x:void 0),d4(t.y,e,NF,n?n.y:void 0,r?r.y:void 0)}function h4(t){return t.translate===0&&t.scale===1}function lT(t){return h4(t.x)&&h4(t.y)}function p4(t,e){return t.min===e.min&&t.max===e.max}function jF(t,e){return p4(t.x,e.x)&&p4(t.y,e.y)}function m4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function uT(t,e){return m4(t.x,e.x)&&m4(t.y,e.y)}function g4(t){return cr(t.x)/cr(t.y)}function v4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ii(t){return[t("x"),t("y")]}function FF(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:h,pathRotation:p,rotateX:m,rotateY:y,skewX:x,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),y&&(r+=`rotateY(${y}deg) `),x&&(r+=`skewX(${x}deg) `),_&&(r+=`skewY(${_}deg) `)}const u=t.x.scale*e.x,c=t.y.scale*e.y;return(u!==1||c!==1)&&(r+=`scale(${u}, ${c})`),r||"none"}const VF=ox.length,y4=t=>typeof t=="string"?parseFloat(t):t,_4=t=>typeof t=="number"||je.test(t);function $F(t,e,n,r,s,i){s?(t.opacity=kt(0,n.opacity??1,HF(r)),t.opacityExit=kt(e.opacity??1,0,zF(r))):i&&(t.opacity=kt(e.opacity??1,n.opacity??1,r));for(let a=0;a<VF;a++){const u=ox[a];let c=x4(e,u),d=x4(n,u);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||_4(c)===_4(d)?(t[u]=Math.max(kt(y4(c),y4(d),r),0),(gi.test(d)||gi.test(c))&&(t[u]+="%")):t[u]=d}(e.rotate||n.rotate)&&(t.rotate=kt(e.rotate||0,n.rotate||0,r))}function x4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const HF=cT(0,.5,n3),zF=cT(.5,.95,Cs);function cT(t,e,n){return r=>r<t?0:r>e?1:n(Gd(t,e,r))}function UF(t,e,n){const r=$n(t)?t:nc(t);return r.start(rx("",r,e,n)),r.animation}function Zd(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const BF=(t,e)=>t.depth-e.depth;class WF{constructor(){this.children=[],this.isDirty=!1}add(e){B2(this.children,e),this.isDirty=!0}remove(e){Cm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(BF),this.isDirty=!1,this.children.forEach(e)}}function GF(t,e){const n=ur.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(oa(r),t(i-e))};return Pt.setup(r,!0),()=>oa(r)}function Np(t){return $n(t)?t.get():t}class KF{constructor(){this.members=[]}add(e){B2(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Cm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Cm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:a}=e.options;(i===void 0||i!==a)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,a;(r=(n=e.options).onExitComplete)==null||r.call(n),(a=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const jp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},r1=["","X","Y","Z"],qF=1e3;let ZF=0;function s1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function dT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=O3(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Pt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&dT(r)}function fT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=ZF++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(QF),this.nodes.forEach(sV),this.nodes.forEach(iV),this.nodes.forEach(JF)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new WF)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new G2),this.eventHandlers.get(a).add(u)}notifyListeners(a,...u){const c=this.eventHandlers.get(a);c&&c.notify(...u)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=ux(a)&&!Q7(a),this.instance=a;const{layoutId:u,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||u)&&(this.isLayoutDirty=!0),t){let h,p=0;const m=()=>this.root.updateBlockedByResize=!1;Pt.read(()=>{p=window.innerWidth}),t(a,()=>{const y=window.innerWidth;y!==p&&(p=y,this.root.updateBlockedByResize=!0,h&&h(),h=GF(m,250),jp.hasAnimatedSinceResize&&(jp.hasAnimatedSinceResize=!1,this.nodes.forEach(S4)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&d&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||cV,{onLayoutAnimationStart:_,onLayoutAnimationComplete:w}=d.getProps(),E=!this.targetLayout||!uT(this.targetLayout,y),P=!p&&m;if(this.options.layoutRoot||this.resumeFrom||P||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...nx(x,"layout"),onPlay:_,onComplete:w};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,P,T.path)}else p||S4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),oa(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(oV),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:u,layout:c}=this.options;if(u===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(tV),this.nodes.forEach(w4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(b4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nV),this.nodes.forEach(rV),this.nodes.forEach(YF),this.nodes.forEach(XF)):this.nodes.forEach(b4),this.clearAllSnapshots();const u=ur.now();jn.delta=vi(0,1e3/60,u-jn.timestamp),jn.timestamp=u,jn.isProcessing=!0,Zv.update.process(jn),Zv.preRender.process(jn),Zv.render.process(jn),jn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ax.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eV),this.sharedNodes.forEach(aV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!cr(this.snapshot.measuredBox.x)&&!cr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=bn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(u=!1),u&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!lT(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;a&&this.instance&&(u||Qa(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let c=this.removeElementScroll(u);return a&&(c=this.removeTransform(c)),dV(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:a}=this.options;if(!a)return bn();const u=a.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(fV))){const{scroll:h}=this.root;h&&(ci(u.x,h.offset.x),ci(u.y,h.offset.y))}return u}removeElementScroll(a){var c;const u=bn();if(js(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&js(u,a),ci(u.x,p.offset.x),ci(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var h,p;const d=c||bn();js(d,a);for(let m=0;m<this.path.length;m++){const y=this.path[m];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(ci(d.x,-y.scroll.offset.x),ci(d.y,-y.scroll.offset.y)),Qa(y.latestValues)&&Dp(d,y.latestValues,(h=y.layout)==null?void 0:h.layoutBox)}return Qa(this.latestValues)&&Dp(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(a){var c;const u=bn();js(u,a);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!Qa(h.latestValues))continue;let p;h.instance&&(g_(h.latestValues)&&h.updateSnapshot(),p=bn(),js(p,h.measurePageBox())),f4(u,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,p)}return Qa(this.latestValues)&&f4(u,this.latestValues),u}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==jn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var y;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==u;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=jn.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=bn(),this.targetWithTransforms=bn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),OF(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):js(this.target,this.layout.layoutBox),Y3(this.target,this.targetDelta)):js(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||g_(this.parent.latestValues)||Z3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,u,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=bn(),this.relativeTargetOrigin=bn(),Lm(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),js(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===jn.timestamp&&(c=!1),c)return;const{layout:d,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||h))return;js(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;lF(this.layoutCorrected,this.treeScale,this.path,u),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=bn());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(o4(this.prevProjectionDelta.x,this.projectionDelta.x),o4(this.prevProjectionDelta.y,this.projectionDelta.y)),Rd(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!v4(this.projectionDelta.x,this.prevProjectionDelta.x)||!v4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var u;if((u=this.options.visualElement)==null||u.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Su(),this.projectionDelta=Su(),this.projectionDeltaWithTransform=Su()}setAnimationOrigin(a,u=!1,c){const d=this.snapshot,h=d?d.latestValues:{},p={...this.latestValues},m=Su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const y=bn(),x=d?d.source:void 0,_=this.layout?this.layout.source:void 0,w=x!==_,E=this.getStack(),P=!E||E.members.length<=1,T=!!(w&&!P&&this.options.crossfade===!0&&!this.path.some(uV));this.animationProgress=0;let k;const R=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=L=>{const O=L/1e3,A=R==null?void 0:R(O);A?(m.x.translate=A.x,m.x.scale=kt(a.x.scale,1,O),m.x.origin=a.x.origin,m.x.originPoint=a.x.originPoint,m.y.translate=A.y,m.y.scale=kt(a.y.scale,1,O),m.y.origin=a.y.origin,m.y.originPoint=a.y.originPoint):(E4(m.x,a.x,O),E4(m.y,a.y,O)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lm(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),lV(this.relativeTarget,this.relativeTargetOrigin,y,O),k&&jF(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=bn()),js(k,this.relativeTarget)),w&&(this.animationValues=p,$F(p,h,this.latestValues,O,T,P)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var u,c,d;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(oa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pt.update(()=>{jp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nc(0)),this.motionValue.jump(0,!1),this.currentAnimation=UF(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(qF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:d,latestValues:h}=a;if(!(!u||!c||!d)){if(this!==a&&this.layout&&d&&hT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||bn();const p=cr(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const m=cr(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+m}js(u,c),Dp(u,h),Rd(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new KF),this.sharedNodes.get(a).add(u);const d=u.options.initialPromotionConfig;u.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(u):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var u;const{layoutId:a}=this.options;return a?((u=this.getStack())==null?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:a}=this.options;return a?(u=this.getStack())==null?void 0:u.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:u,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let u=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(u=!0),!u)return;const d={};c.z&&s1("z",a,d,this.animationValues);for(let h=0;h<r1.length;h++)s1(`rotate${r1[h]}`,a,d,this.animationValues),s1(`skew${r1[h]}`,a,d,this.animationValues);a.render();for(const h in d)a.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[h]);a.scheduleRender()}applyProjectionStyles(a,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Np(u==null?void 0:u.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Np(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Qa(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=FF(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),a.transform=p;const{x:m,y}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,d.animationValues?a.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in y_){if(h[x]===void 0)continue;const{correct:_,applyTo:w,isCSSVariable:E}=y_[x],P=p==="none"?h[x]:_(h[x],d);if(w){const T=w.length;for(let k=0;k<T;k++)a[w[k]]=P}else E?this.options.visualElement.renderState.vars[x]=P:a[x]=P}this.options.layoutId&&(a.pointerEvents=d===this?Np(u==null?void 0:u.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var u;return(u=a.currentAnimation)==null?void 0:u.stop()}),this.root.nodes.forEach(w4),this.root.sharedNodes.clear()}}}function YF(t){t.updateLayout()}function XF(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,a=e.source!==t.layout.source;if(i==="size")ii(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],y=cr(m);m.min=r[p].min,m.max=m.min+y});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";__(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else hT(i,e.layoutBox,r)&&ii(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],y=cr(r[p]);m.max=m.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+y)});const u=Su();Rd(u,r,e.layoutBox);const c=Su();a?Rd(c,t.applyTransform(s,!0),e.measuredBox):Rd(c,r,e.layoutBox);const d=!lT(u);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:y}=p;if(m&&y){const x=t.options.layoutAnchor||void 0,_=bn();Lm(_,e.layoutBox,m.layoutBox,x);const w=bn();Lm(w,r,y.layoutBox,x),uT(_,w)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function QF(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function JF(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function eV(t){t.clearSnapshot()}function w4(t){t.clearMeasurements()}function tV(t){t.isLayoutDirty=!0,t.updateLayout()}function b4(t){t.isLayoutDirty=!1}function nV(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function rV(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function S4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function sV(t){t.resolveTargetDelta()}function iV(t){t.calcProjection()}function oV(t){t.resetSkewAndRotation()}function aV(t){t.removeLeadSnapshot()}function E4(t,e,n){t.translate=kt(e.translate,0,n),t.scale=kt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function C4(t,e,n,r){t.min=kt(e.min,n.min,r),t.max=kt(e.max,n.max,r)}function lV(t,e,n,r){C4(t.x,e.x,n.x,r),C4(t.y,e.y,n.y,r)}function uV(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const cV={duration:.45,ease:[.4,0,.1,1]},k4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),P4=k4("applewebkit/")&&!k4("chrome/")?Math.round:Cs;function T4(t){t.min=P4(t.min),t.max=P4(t.max)}function dV(t){T4(t.x),T4(t.y)}function hT(t,e,n){return t==="position"||t==="preserve-aspect"&&!MF(g4(e),g4(n),.2)}function fV(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const hV=fT({attachResizeListener:(t,e)=>Zd(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),i1={current:void 0},pT=fT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!i1.current){const t=new hV({});t.mount(window),t.setOptions({layoutScroll:!0}),i1.current=t}return i1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),mx=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function R4(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function pV(...t){return e=>{let n=!1;const r=t.map(s=>{const i=R4(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():R4(t[s],null)}}}}function mV(...t){return g.useCallback(pV(...t),t)}class gV extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Ip(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Ip(r)&&r.offsetWidth||0,i=Ip(r)&&r.offsetHeight||0,a=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(a.height),u.width=parseFloat(a.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=i-u.height-u.top,u.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function vV({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const a=g.useId(),u=g.useRef(null),c=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=g.useContext(mx),h=((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref),p=mV(u,h);return g.useInsertionEffect(()=>{const{width:y,height:x,top:_,left:w,right:E,bottom:P,direction:T}=c.current;if(e||i===!1||!u.current||!y||!x)return;const k=T==="rtl",R=n==="left"?k?`right: ${E}`:`left: ${w}`:k?`left: ${w}`:`right: ${E}`,L=r==="bottom"?`bottom: ${P}`:`top: ${_}`;u.current.dataset.motionPopId=a;const O=document.createElement("style");d&&(O.nonce=d);const A=s??document.head;return A.appendChild(O),O.sheet&&O.sheet.insertRule(`
63
- [data-motion-pop-id="${a}"] {
64
- position: absolute !important;
65
- width: ${y}px !important;
66
- height: ${x}px !important;
67
- ${R}px !important;
68
- ${L}px !important;
69
- }
70
- `),()=>{var M;(M=u.current)==null||M.removeAttribute("data-motion-pop-id"),A.contains(O)&&A.removeChild(O)}},[e]),S.jsx(gV,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:g.cloneElement(t,{ref:p})})}const yV=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:d})=>{const h=z2(_V),p=g.useId(),m=g.useRef(n),y=g.useRef(r);U2(()=>{m.current=n,y.current=r});let x=!0,_=g.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:w=>{h.set(w,!0);for(const E of h.values())if(!E)return;r&&r()},register:w=>(h.set(w,!1),()=>{var E;h.delete(w),!m.current&&!h.size&&((E=y.current)==null||E.call(y))})}),[n,h,r]);return i&&x&&(_={..._}),g.useMemo(()=>{h.forEach((w,E)=>h.set(E,!1))},[n]),g.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=S.jsx(vV,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:d,children:t}),S.jsx(o0.Provider,{value:_,children:t})};function _V(){return new Map}function mT(t=!0){const e=g.useContext(o0);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const a=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const rp=t=>t.key||"";function A4(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const ro=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:u="left",anchorY:c="top",root:d})=>{const[h,p]=mT(a),m=g.useMemo(()=>A4(t),[t]),y=a&&!h?[]:m.map(rp),x=g.useRef(!0),_=g.useRef(m),w=z2(()=>new Map),E=g.useRef(new Set),[P,T]=g.useState(m),[k,R]=g.useState(m);U2(()=>{x.current=!1,_.current=m;for(let A=0;A<k.length;A++){const M=rp(k[A]);y.includes(M)?(w.delete(M),E.current.delete(M)):w.get(M)!==!0&&w.set(M,!1)}},[k,y.length,y.join("-")]);const L=[];if(m!==P){let A=[...m];for(let M=0;M<k.length;M++){const D=k[M],F=rp(D);y.includes(F)||(A.splice(M,0,D),L.push(D))}return i==="wait"&&L.length&&(A=L),R(A4(A)),T(m),null}const{forceRender:O}=g.useContext(H2);return S.jsx(S.Fragment,{children:k.map(A=>{const M=rp(A),D=a&&!h?!1:m===k||y.includes(M),F=()=>{if(E.current.has(M))return;if(w.has(M))E.current.add(M),w.set(M,!0);else return;let N=!0;w.forEach(G=>{G||(N=!1)}),N&&(O==null||O(),R(_.current),a&&(p==null||p()),r&&r())};return S.jsx(yV,{isPresent:D,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:F,anchorX:u,anchorY:c,children:A},M)})})},gT=g.createContext({strict:!1}),I4={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let M4=!1;function xV(){if(M4)return;const t={};for(const e in I4)t[e]={isEnabled:n=>I4[e].some(r=>!!n[r])};G3(t),M4=!0}function vT(){return xV(),sF()}function wV(t){const e=vT();for(const n in t)e[n]={...e[n],...t[n]};G3(e)}const bV=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Dm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||bV.has(t)}let yT=t=>!Dm(t);function SV(t){typeof t=="function"&&(yT=e=>e.startsWith("on")?!Dm(e):t(e))}try{SV(require("@emotion/is-prop-valid").default)}catch{}function EV(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||$n(t[s])||(yT(s)||n===!0&&Dm(s)||!e&&!Dm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const c0=g.createContext({});function CV(t,e){if(u0(t)){const{initial:n,animate:r}=t;return{initial:n===!1||qd(n)?n:void 0,animate:qd(r)?r:void 0}}return t.inherit!==!1?e:{}}function kV(t){const{initial:e,animate:n}=CV(t,g.useContext(c0));return g.useMemo(()=>({initial:e,animate:n}),[O4(e),O4(n)])}function O4(t){return Array.isArray(t)?t.join(" "):t}const gx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _T(t,e,n){for(const r in e)!$n(e[r])&&!J3(r,n)&&(t[r]=e[r])}function PV({transformTemplate:t},e){return g.useMemo(()=>{const n=gx();return hx(n,e,t),Object.assign({},n.vars,n.style)},[e])}function TV(t,e){const n=t.style||{},r={};return _T(r,n,t),Object.assign(r,PV(t,e)),r}function RV(t,e){const n={},r=TV(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const xT=()=>({...gx(),attrs:{}});function AV(t,e,n,r){const s=g.useMemo(()=>{const i=xT();return eT(i,e,nT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};_T(i,t.style,t),s.style={...i,...s.style}}return s}const IV=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vx(t){return typeof t!="string"||t.includes("-")?!1:!!(IV.indexOf(t)>-1||/[A-Z]/u.test(t))}function MV(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??vx(t)?AV:RV)(e,r,s,t),d=EV(e,typeof t=="string",i),h=t!==g.Fragment?{...d,...c,ref:n}:{},{children:p}=e,m=g.useMemo(()=>$n(p)?p.get():p,[p]);return g.createElement(t,{...h,children:m})}function OV({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:LV(n,r,s,t),renderState:e()}}function LV(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Np(i[m]);let{initial:a,animate:u}=t;const c=u0(t),d=B3(t);e&&d&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),u===void 0&&(u=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const p=h?u:a;if(p&&typeof p!="boolean"&&!l0(p)){const m=Array.isArray(p)?p:[p];for(let y=0;y<m.length;y++){const x=sx(t,m[y]);if(x){const{transitionEnd:_,transition:w,...E}=x;for(const P in E){let T=E[P];if(Array.isArray(T)){const k=h?T.length-1:0;T=T[k]}T!==null&&(s[P]=T)}for(const P in _)s[P]=_[P]}}}return s}const wT=t=>(e,n)=>{const r=g.useContext(c0),s=g.useContext(o0),i=()=>OV(t,e,r,s);return n?i():z2(i)},DV=wT({scrapeMotionValuesFromProps:px,createRenderState:gx}),NV=wT({scrapeMotionValuesFromProps:rT,createRenderState:xT}),jV=Symbol.for("motionComponentSymbol");function FV(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var u;i&&((u=t.onMount)==null||u.call(t,i)),e&&(i?e.mount(i):e.unmount());const a=r.current;if(typeof a=="function")if(i){const c=a(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[e])}const bT=g.createContext({});function vu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function VV(t,e,n,r,s,i){var T,k;const{visualElement:a}=g.useContext(c0),u=g.useContext(gT),c=g.useContext(o0),d=g.useContext(mx),h=d.reducedMotion,p=d.skipAnimations,m=g.useRef(null),y=g.useRef(!1);r=r||u.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),y.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,_=g.useContext(bT);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&$V(m.current,n,s,_);const w=g.useRef(!1);g.useInsertionEffect(()=>{x&&w.current&&x.update(n,c)});const E=n[M3],P=g.useRef(!!E&&typeof window<"u"&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,E))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,E)));return U2(()=>{y.current=!0,x&&(w.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),P.current&&x.animationState&&x.animationState.animateChanges())}),g.useEffect(()=>{x&&(!P.current&&x.animationState&&x.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,E)}),P.current=!1),x.enteringChildren=void 0)}),x}function $V(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:d,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ST(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&vu(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:d,layoutAnchor:h})}function ST(t){if(t)return t.options.allowProjection!==!1?t.projection:ST(t.parent)}function o1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&wV(r);const i=n?n==="svg":vx(t),a=i?NV:DV;function u(d,h){let p;const m={...g.useContext(mx),...d,layoutId:HV(d)},{isStatic:y}=m,x=kV(d),_=a(d,y);if(!y&&typeof window<"u"){zV();const w=UV(m);p=w.MeasureLayout,x.visualElement=VV(t,_,m,s,w.ProjectionNode,i)}return S.jsxs(c0.Provider,{value:x,children:[p&&x.visualElement?S.jsx(p,{visualElement:x.visualElement,...m}):null,MV(t,d,FV(_,x.visualElement,h),_,y,e,i)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=g.forwardRef(u);return c[jV]=t,c}function HV({layoutId:t}){const e=g.useContext(H2).id;return e&&t!==void 0?e+"-"+t:t}function zV(t,e){g.useContext(gT).strict}function UV(t){const e=vT(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function BV(t,e){if(typeof Proxy>"u")return o1;const n=new Map,r=(i,a)=>o1(i,a,t,e),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,o1(a,void 0,t,e)),n.get(a))})}const WV=(t,e)=>e.isSVG??vx(t)?new wF(e):new mF(e,{allowProjection:t!==g.Fragment});class GV extends ha{constructor(e){super(e),e.animationState||(e.animationState=kF(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();l0(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let KV=0;class qV extends ha{constructor(){super(...arguments),this.id=KV++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:a,custom:u}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const c=yl(this.node,a,u);if(c){const{transition:d,transitionEnd:h,...p}=c;for(const m in p)(i=this.node.getValue(m))==null||i.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const ZV={animation:{Feature:GV},exit:{Feature:qV}};function Pf(t){return{point:{x:t.pageX,y:t.pageY}}}const YV=t=>e=>lx(e)&&t(e,Pf(e));function Ad(t,e,n,r){return Zd(t,e,YV(n),r)}const ET=({current:t})=>t?t.ownerDocument.defaultView:null,L4=(t,e)=>Math.abs(t-e);function XV(t,e){const n=L4(t.x,e.x),r=L4(t.y,e.y);return Math.sqrt(n**2+r**2)}const D4=new Set(["auto","scroll"]);class CT{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=sp(this.lastRawMoveEventInfo,this.transformPagePoint));const x=a1(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,w=XV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!w)return;const{point:E}=x,{timestamp:P}=jn;this.history.push({...E,timestamp:P});const{onStart:T,onMove:k}=this.handlers;_||(T&&T(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,x)},this.handlePointerMove=(x,_)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=sp(_,this.transformPagePoint),Pt.update(this.updatePoint,!0)},this.handlePointerUp=(x,_)=>{this.end();const{onEnd:w,onSessionEnd:E,resumeAnimation:P}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&P&&P(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=a1(x.type==="pointercancel"?this.lastMoveEventInfo:sp(_,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,T),E&&E(x,T)},!lx(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=Pf(e),d=sp(c,this.transformPagePoint),{point:h}=d,{timestamp:p}=jn;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,a1(d,this.history));const y={passive:!0,capture:!0};this.removeListeners=Ef(Ad(this.contextWindow,"pointermove",this.handlePointerMove,y),Ad(this.contextWindow,"pointerup",this.handlePointerUp,y),Ad(this.contextWindow,"pointercancel",this.handlePointerUp,y)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(D4.has(r.overflowX)||D4.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),Pt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),oa(this.updatePoint)}}function sp(t,e){return e?{point:e(t.point)}:t}function N4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function a1({point:t},e){return{point:t,delta:N4(t,kT(e)),offset:N4(t,QV(e)),velocity:JV(e,.1)}}function QV(t){return t[0]}function kT(t){return t[t.length-1]}function JV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=kT(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Jr(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Jr(e)*2&&(r=t[1]);const i=ws(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function e$(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?kt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?kt(n,t,r.max):Math.min(t,n)),t}function j4(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function t$(t,{top:e,left:n,bottom:r,right:s}){return{x:j4(t.x,n,s),y:j4(t.y,e,r)}}function F4(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function n$(t,e){return{x:F4(t.x,e.x),y:F4(t.y,e.y)}}function r$(t,e){let n=.5;const r=cr(t),s=cr(e);return s>r?n=Gd(e.min,e.max-r,t.min):r>s&&(n=Gd(t.min,t.max-s,e.min)),vi(0,1,n)}function s$(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const x_=.35;function i$(t=x_){return t===!1?t=0:t===!0&&(t=x_),{x:V4(t,"left","right"),y:V4(t,"top","bottom")}}function V4(t,e,n){return{min:$4(t,e),max:$4(t,n)}}function $4(t,e){return typeof t=="number"?t:t[e]||0}const o$=new WeakMap;class a${constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=bn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=p=>{n&&this.snapToCursor(Pf(p).point),this.stopAnimation()},a=(p,m)=>{const{drag:y,dragPropagation:x,onDragStart:_}=this.getProps();if(y&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=D7(y),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ii(E=>{let P=this.getAxisMotionValue(E).get()||0;if(gi.test(P)){const{projection:T}=this.visualElement;if(T&&T.layout){const k=T.layout.layoutBox[E];k&&(P=cr(k)*(parseFloat(P)/100))}}this.originPoint[E]=P}),_&&Pt.update(()=>_(p,m),!1,!0),d_(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:y,dragDirectionLock:x,onDirectionLock:_,onDrag:w}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:E}=m;if(x&&this.currentDirection===null){this.currentDirection=u$(E),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",m.point,E),this.updateAxis("y",m.point,E),this.visualElement.render(),w&&Pt.update(()=>w(p,m),!1,!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new CT(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:ET(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:u}=this.getProps();u&&Pt.postRender(()=>u(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!ip(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=e$(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&vu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=t$(r.layoutBox,e):this.constraints=!1,this.elastic=i$(n),s!==this.constraints&&!vu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&ii(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=s$(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!vu(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=uF(r,s.root,this.visualElement.getTransformPagePoint());let a=n$(s.layout.layoutBox,i);if(n){const u=n(oF(a));this.hasMutatedConstraints=!!u,u&&(a=q3(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},d=ii(h=>{if(!ip(h,n,this.currentDirection))return;let p=c&&c[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const m=s?200:1e6,y=s?40:1e7,x={type:"inertia",velocity:r?e[h]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,x)});return Promise.all(d).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return d_(this.visualElement,e),r.start(rx(e,r,0,n,this.visualElement,!1))}stopAnimation(){ii(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){ii(n=>{const{drag:r}=this.getProps();if(!ip(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:u}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-kt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!vu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ii(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=r$({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),ii(a=>{if(!ip(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:d}=this.constraints[a];u.set(kt(c,d,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;o$.set(this.visualElement,this);const e=this.visualElement.current,n=Ad(e,"pointerdown",d=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=d.target,y=m!==e&&H7(m);h&&p&&!y&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();vu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=l$(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Pt.read(s);const u=Zd(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(ii(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{u(),n(),a(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=x_,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function H4(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function l$(t,e,n){const r=qC(t,H4(n)),s=qC(e,H4(n));return()=>{r(),s()}}function ip(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function u$(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class c$ extends ha{constructor(e){super(e),this.removeGroupControls=Cs,this.removeListeners=Cs,this.controls=new a$(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cs}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const l1=t=>(e,n)=>{t&&Pt.update(()=>t(e,n),!1,!0)};class d$ extends ha{constructor(){super(...arguments),this.removePointerDownListener=Cs}onPointerDown(e){this.session=new CT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ET(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:l1(e),onStart:l1(n),onMove:l1(r),onEnd:(i,a)=>{delete this.session,s&&Pt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Ad(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let u1=!1;class f$ extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),u1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),jp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),u1=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Pt.postRender(()=>{const u=a.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),ax.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;u1=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function PT(t){const[e,n]=mT(),r=g.useContext(H2);return S.jsx(f$,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(bT),isPresent:e,safeToRemove:n})}const h$={pan:{Feature:d$},drag:{Feature:c$,ProjectionNode:pT,MeasureLayout:PT}};function z4(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Pt.postRender(()=>i(e,Pf(e)))}class p$ extends ha{mount(){const{current:e}=this.node;e&&(this.unmount=j7(e,(n,r)=>(z4(this.node,r,"Start"),s=>z4(this.node,s,"End"))))}unmount(){}}class m$ extends ha{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ef(Zd(this.node.current,"focus",()=>this.onFocus()),Zd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function U4(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Pt.postRender(()=>i(e,Pf(e)))}class g$ extends ha{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=U7(e,(s,i)=>(U4(this.node,i,"Start"),(a,{success:u})=>U4(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const w_=new WeakMap,c1=new WeakMap,v$=t=>{const e=w_.get(t.target);e&&e(t)},y$=t=>{t.forEach(v$)};function _$({root:t,...e}){const n=t||document;c1.has(n)||c1.set(n,{});const r=c1.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(y$,{root:t,...e})),r[s]}function x$(t,e,n){const r=_$(e);return w_.set(t,n),r.observe(t),()=>{w_.delete(t),r.unobserve(t)}}const w$={some:0,all:1};class b$ extends ha{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:w$[s]},u=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,i&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),y=h?p:m;y&&y(d)};this.stopObserver=x$(this.node.current,a,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(S$(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function S$({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const E$={inView:{Feature:b$},tap:{Feature:g$},focus:{Feature:m$},hover:{Feature:p$}},C$={layout:{ProjectionNode:pT,MeasureLayout:PT}},k$={...ZV,...E$,...h$,...C$},so=BV(k$,WV);function P$(){!fx.current&&W3();const[t]=g.useState(Im.current);return t}const _l=so;var d0=FP();const T$=t0(d0);function R$(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const A$=t=>{switch(t){case"success":return O$;case"info":return D$;case"warning":return L$;case"error":return N$;default:return null}},I$=Array(12).fill(0),M$=({visible:t,className:e})=>ve.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ve.createElement("div",{className:"sonner-spinner"},I$.map((n,r)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),O$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),L$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),D$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),N$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),j$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),F$=()=>{const[t,e]=ve.useState(document.hidden);return ve.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let b_=1;class V${constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:b_++,a=this.toasts.find(c=>c.id===i),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...e,id:i,title:r}),{...c,...e,id:i,dismissible:u,title:r}):c):this.addToast({title:r,...s,dismissible:u,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,a;const u=s.then(async d=>{if(a=["resolve",d],ve.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(H$(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...x})}}).catch(async d=>{if(a=["reject",d],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,y=typeof h=="object"&&!ve.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,h)=>u.then(()=>a[0]==="reject"?h(a[1]):d(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||b_++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const kr=new V$,$$=(t,e)=>{const n=(e==null?void 0:e.id)||b_++;return kr.addToast({title:t,...e,id:n}),n},H$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",z$=$$,U$=()=>kr.toasts,B$=()=>kr.getActiveToasts(),pt=Object.assign(z$,{success:kr.success,info:kr.info,warning:kr.warning,error:kr.error,custom:kr.custom,message:kr.message,promise:kr.promise,dismiss:kr.dismiss,loading:kr.loading},{getHistory:U$,getToasts:B$});R$("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function op(t){return t.label!==void 0}const W$=3,G$="24px",K$="16px",B4=4e3,q$=356,Z$=14,Y$=45,X$=200;function ni(...t){return t.filter(Boolean).join(" ")}function Q$(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const J$=t=>{var e,n,r,s,i,a,u,c,d;const{invert:h,toast:p,unstyled:m,interacting:y,setHeights:x,visibleToasts:_,heights:w,index:E,toasts:P,expanded:T,removeToast:k,defaultRichColors:R,closeButton:L,style:O,cancelButtonStyle:A,actionButtonStyle:M,className:D="",descriptionClassName:F="",duration:N,position:G,gap:Z,expandByDefault:Y,classNames:B,icons:K,closeButtonAriaLabel:$="Close toast"}=t,[J,H]=ve.useState(null),[j,X]=ve.useState(null),[te,ie]=ve.useState(!1),[ae,ue]=ve.useState(!1),[Se,oe]=ve.useState(!1),[se,ye]=ve.useState(!1),[be,Fe]=ve.useState(!1),[Re,We]=ve.useState(0),[Tt,Ye]=ve.useState(0),we=ve.useRef(p.duration||N||B4),It=ve.useRef(null),Ee=ve.useRef(null),Xe=E===0,vt=E+1<=_,Ge=p.type,at=p.dismissible!==!1,tr=p.className||"",vn=p.descriptionClassName||"",Bt=ve.useMemo(()=>w.findIndex(Ze=>Ze.toastId===p.id)||0,[w,p.id]),ss=ve.useMemo(()=>{var Ze;return(Ze=p.closeButton)!=null?Ze:L},[p.closeButton,L]),nr=ve.useMemo(()=>p.duration||N||B4,[p.duration,N]),is=ve.useRef(0),rn=ve.useRef(0),pr=ve.useRef(0),qs=ve.useRef(null),[Al,Mn]=G.split("-"),Si=ve.useMemo(()=>w.reduce((Ze,Mt,Wt)=>Wt>=Bt?Ze:Ze+Mt.height,0),[w,Bt]),Ps=F$(),Zs=p.invert||h,os=Ge==="loading";rn.current=ve.useMemo(()=>Bt*Z+Si,[Bt,Si]),ve.useEffect(()=>{we.current=nr},[nr]),ve.useEffect(()=>{ie(!0)},[]),ve.useEffect(()=>{const Ze=Ee.current;if(Ze){const Mt=Ze.getBoundingClientRect().height;return Ye(Mt),x(Wt=>[{toastId:p.id,height:Mt,position:p.position},...Wt]),()=>x(Wt=>Wt.filter(Sn=>Sn.toastId!==p.id))}},[x,p.id]),ve.useLayoutEffect(()=>{if(!te)return;const Ze=Ee.current,Mt=Ze.style.height;Ze.style.height="auto";const Wt=Ze.getBoundingClientRect().height;Ze.style.height=Mt,Ye(Wt),x(Sn=>Sn.find(Xt=>Xt.toastId===p.id)?Sn.map(Xt=>Xt.toastId===p.id?{...Xt,height:Wt}:Xt):[{toastId:p.id,height:Wt,position:p.position},...Sn])},[te,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const yn=ve.useCallback(()=>{ue(!0),We(rn.current),x(Ze=>Ze.filter(Mt=>Mt.toastId!==p.id)),setTimeout(()=>{k(p)},X$)},[p,k,x,rn]);ve.useEffect(()=>{if(p.promise&&Ge==="loading"||p.duration===1/0||p.type==="loading")return;let Ze;return T||y||Ps?(()=>{if(pr.current<is.current){const Sn=new Date().getTime()-is.current;we.current=we.current-Sn}pr.current=new Date().getTime()})():(()=>{we.current!==1/0&&(is.current=new Date().getTime(),Ze=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),yn()},we.current))})(),()=>clearTimeout(Ze)},[T,y,p,Ge,Ps,yn]),ve.useEffect(()=>{p.delete&&(yn(),p.onDismiss==null||p.onDismiss.call(p,p))},[yn,p.delete]);function mo(){var Ze;if(K!=null&&K.loading){var Mt;return ve.createElement("div",{className:ni(B==null?void 0:B.loader,p==null||(Mt=p.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":Ge==="loading"},K.loading)}return ve.createElement(M$,{className:ni(B==null?void 0:B.loader,p==null||(Ze=p.classNames)==null?void 0:Ze.loader),visible:Ge==="loading"})}const jr=p.icon||(K==null?void 0:K[Ge])||A$(Ge);var as,Ei;return ve.createElement("li",{tabIndex:0,ref:Ee,className:ni(D,tr,B==null?void 0:B.toast,p==null||(e=p.classNames)==null?void 0:e.toast,B==null?void 0:B.default,B==null?void 0:B[Ge],p==null||(n=p.classNames)==null?void 0:n[Ge]),"data-sonner-toast":"","data-rich-colors":(as=p.richColors)!=null?as:R,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":te,"data-promise":!!p.promise,"data-swiped":be,"data-removed":ae,"data-visible":vt,"data-y-position":Al,"data-x-position":Mn,"data-index":E,"data-front":Xe,"data-swiping":Se,"data-dismissible":at,"data-type":Ge,"data-invert":Zs,"data-swipe-out":se,"data-swipe-direction":j,"data-expanded":!!(T||Y&&te),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":P.length-E,"--offset":`${ae?Re:rn.current}px`,"--initial-height":Y?"auto":`${Tt}px`,...O,...p.style},onDragEnd:()=>{oe(!1),H(null),qs.current=null},onPointerDown:Ze=>{Ze.button!==2&&(os||!at||(It.current=new Date,We(rn.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(oe(!0),qs.current={x:Ze.clientX,y:Ze.clientY})))},onPointerUp:()=>{var Ze,Mt,Wt;if(se||!at)return;qs.current=null;const Sn=Number(((Ze=Ee.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fr=Number(((Mt=Ee.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xt=new Date().getTime()-((Wt=It.current)==null?void 0:Wt.getTime()),un=J==="x"?Sn:Fr,Ys=Math.abs(un)/Xt;if(Math.abs(un)>=Y$||Ys>.11){We(rn.current),p.onDismiss==null||p.onDismiss.call(p,p),X(J==="x"?Sn>0?"right":"left":Fr>0?"down":"up"),yn(),ye(!0);return}else{var cn,Bn;(cn=Ee.current)==null||cn.style.setProperty("--swipe-amount-x","0px"),(Bn=Ee.current)==null||Bn.style.setProperty("--swipe-amount-y","0px")}Fe(!1),oe(!1),H(null)},onPointerMove:Ze=>{var Mt,Wt,Sn;if(!qs.current||!at||((Mt=window.getSelection())==null?void 0:Mt.toString().length)>0)return;const Xt=Ze.clientY-qs.current.y,un=Ze.clientX-qs.current.x;var Ys;const cn=(Ys=t.swipeDirections)!=null?Ys:Q$(G);!J&&(Math.abs(un)>1||Math.abs(Xt)>1)&&H(Math.abs(un)>Math.abs(Xt)?"x":"y");let Bn={x:0,y:0};const Ts=mr=>1/(1.5+Math.abs(mr)/20);if(J==="y"){if(cn.includes("top")||cn.includes("bottom"))if(cn.includes("top")&&Xt<0||cn.includes("bottom")&&Xt>0)Bn.y=Xt;else{const mr=Xt*Ts(Xt);Bn.y=Math.abs(mr)<Math.abs(Xt)?mr:Xt}}else if(J==="x"&&(cn.includes("left")||cn.includes("right")))if(cn.includes("left")&&un<0||cn.includes("right")&&un>0)Bn.x=un;else{const mr=un*Ts(un);Bn.x=Math.abs(mr)<Math.abs(un)?mr:un}(Math.abs(Bn.x)>0||Math.abs(Bn.y)>0)&&Fe(!0),(Wt=Ee.current)==null||Wt.style.setProperty("--swipe-amount-x",`${Bn.x}px`),(Sn=Ee.current)==null||Sn.style.setProperty("--swipe-amount-y",`${Bn.y}px`)}},ss&&!p.jsx&&Ge!=="loading"?ve.createElement("button",{"aria-label":$,"data-disabled":os,"data-close-button":!0,onClick:os||!at?()=>{}:()=>{yn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ni(B==null?void 0:B.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Ei=K==null?void 0:K.close)!=null?Ei:j$):null,(Ge||p.icon||p.promise)&&p.icon!==null&&((K==null?void 0:K[Ge])!==null||p.icon)?ve.createElement("div",{"data-icon":"",className:ni(B==null?void 0:B.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||mo():null,p.type!=="loading"?jr:null):null,ve.createElement("div",{"data-content":"",className:ni(B==null?void 0:B.content,p==null||(i=p.classNames)==null?void 0:i.content)},ve.createElement("div",{"data-title":"",className:ni(B==null?void 0:B.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ve.createElement("div",{"data-description":"",className:ni(F,vn,B==null?void 0:B.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),ve.isValidElement(p.cancel)?p.cancel:p.cancel&&op(p.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:Ze=>{op(p.cancel)&&at&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ze),yn())},className:ni(B==null?void 0:B.cancelButton,p==null||(c=p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,ve.isValidElement(p.action)?p.action:p.action&&op(p.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:Ze=>{op(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ze),!Ze.defaultPrevented&&yn())},className:ni(B==null?void 0:B.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function W4(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function eH(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?K$:G$;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=u:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(u)}),n}const tH=ve.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:d,offset:h,mobileOffset:p,theme:m="light",richColors:y,duration:x,style:_,visibleToasts:w=W$,toastOptions:E,dir:P=W4(),gap:T=Z$,icons:k,containerAriaLabel:R="Notifications"}=e,[L,O]=ve.useState([]),A=ve.useMemo(()=>r?L.filter(te=>te.toasterId===r):L.filter(te=>!te.toasterId),[L,r]),M=ve.useMemo(()=>Array.from(new Set([i].concat(A.filter(te=>te.position).map(te=>te.position)))),[A,i]),[D,F]=ve.useState([]),[N,G]=ve.useState(!1),[Z,Y]=ve.useState(!1),[B,K]=ve.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ve.useRef(null),J=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ve.useRef(null),j=ve.useRef(!1),X=ve.useCallback(te=>{O(ie=>{var ae;return(ae=ie.find(ue=>ue.id===te.id))!=null&&ae.delete||kr.dismiss(te.id),ie.filter(({id:ue})=>ue!==te.id)})},[]);return ve.useEffect(()=>kr.subscribe(te=>{if(te.dismiss){requestAnimationFrame(()=>{O(ie=>ie.map(ae=>ae.id===te.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{T$.flushSync(()=>{O(ie=>{const ae=ie.findIndex(ue=>ue.id===te.id);return ae!==-1?[...ie.slice(0,ae),{...ie[ae],...te},...ie.slice(ae+1)]:[te,...ie]})})})}),[L]),ve.useEffect(()=>{if(m!=="system"){K(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:ie})=>{K(ie?"dark":"light")})}catch{te.addListener(({matches:ae})=>{try{K(ae?"dark":"light")}catch(ue){console.error(ue)}})}},[m]),ve.useEffect(()=>{L.length<=1&&G(!1)},[L]),ve.useEffect(()=>{const te=ie=>{var ae;if(a.every(oe=>ie[oe]||ie.code===oe)){var Se;G(!0),(Se=$.current)==null||Se.focus()}ie.code==="Escape"&&(document.activeElement===$.current||(ae=$.current)!=null&&ae.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[a]),ve.useEffect(()=>{if($.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,j.current=!1)}},[$.current]),ve.createElement("section",{ref:n,"aria-label":`${R} ${J}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((te,ie)=>{var ae;const[ue,Se]=te.split("-");return A.length?ve.createElement("ol",{key:te,dir:P==="auto"?W4():P,tabIndex:-1,ref:$,className:d,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":ue,"data-x-position":Se,style:{"--front-toast-height":`${((ae=D[0])==null?void 0:ae.height)||0}px`,"--width":`${q$}px`,"--gap":`${T}px`,..._,...eH(h,p)},onBlur:oe=>{j.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(j.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||j.current||(j.current=!0,H.current=oe.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{Z||G(!1)},onDragEnd:()=>G(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},A.filter(oe=>!oe.position&&ie===0||oe.position===te).map((oe,se)=>{var ye,be;return ve.createElement(J$,{key:oe.id,icons:k,index:se,toast:oe,defaultRichColors:y,duration:(ye=E==null?void 0:E.duration)!=null?ye:x,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:s,visibleToasts:w,closeButton:(be=E==null?void 0:E.closeButton)!=null?be:c,interacting:Z,position:te,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:X,toasts:A.filter(Fe=>Fe.position==oe.position),heights:D.filter(Fe=>Fe.position==oe.position),setHeights:F,expandByDefault:u,gap:T,expanded:N,swipeDirections:e.swipeDirections})})):null}))});var nH=Object.defineProperty,dc=(t,e)=>nH(t,"name",{value:e,configurable:!0}),TT=!!(typeof window<"u"&&window.document&&window.document.createElement);function Nt(t,e,{checkForDefaultPrevented:n=!0}={}){return dc(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}dc(Nt,"composeEventHandlers");function rH(t){var e;if(!TT)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}dc(rH,"getOwnerWindow");function S_(t){if(!TT)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}dc(S_,"getOwnerDocument");function RT(t,e=!1){const{activeElement:n}=S_(t);if(!(n!=null&&n.nodeName))return null;if(AT(n)&&n.contentDocument)return RT(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=S_(n).getElementById(r);if(s)return s}}return n}dc(RT,"getActiveElement");function AT(t){return t.tagName==="IFRAME"}dc(AT,"isFrame");var sH=Object.defineProperty,yx=(t,e)=>sH(t,"name",{value:e,configurable:!0});function E_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}yx(E_,"setRef");function IT(...t){return e=>{let n=!1;const r=t.map(s=>{const i=E_(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():E_(t[s],null)}}}}yx(IT,"composeRefs");function Ft(...t){return g.useCallback(IT(...t),t)}yx(Ft,"useComposedRefs");var iH=Object.defineProperty,xs=(t,e)=>iH(t,"name",{value:e,configurable:!0});function oH(t,e){const n=g.createContext(e);n.displayName=t+"Context";const r=xs(i=>{const{children:a,...u}=i,c=g.useMemo(()=>u,Object.values(u));return S.jsx(n.Provider,{value:c,children:a})},"Provider");r.displayName=t+"Provider";function s(i,a={}){const{optional:u=!1}=a,c=g.useContext(n);if(c)return c;if(e!==void 0)return e;if(!u)throw new Error(`\`${i}\` must be used within \`${t}\``)}return xs(s,"useContext"),[r,s]}xs(oH,"createContext");function wi(t,e=[]){let n=[];function r(i,a){const u=g.createContext(a);u.displayName=i+"Context";const c=n.length;n=[...n,a];const d=xs(p=>{var E;const{scope:m,children:y,...x}=p,_=((E=m==null?void 0:m[t])==null?void 0:E[c])||u,w=g.useMemo(()=>x,Object.values(x));return S.jsx(_.Provider,{value:w,children:y})},"Provider");d.displayName=i+"Provider";function h(p,m,y={}){var E;const{optional:x=!1}=y,_=((E=m==null?void 0:m[t])==null?void 0:E[c])||u,w=g.useContext(_);if(w)return w;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return xs(h,"useContext"),[d,h]}xs(r,"createContext");const s=xs(()=>{const i=n.map(a=>g.createContext(a));return xs(function(u){const c=(u==null?void 0:u[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])},"useScope")},"createScope");return s.scopeName=t,[r,MT(s,...e)]}xs(wi,"createContextScope");function MT(...t){const e=t[0];if(t.length===1)return e;const n=xs(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return xs(function(i){const a=r.reduce((u,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...u,...p}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}xs(MT,"composeContextScopes");var Ar=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},aH=Object.defineProperty,lH=(t,e)=>aH(t,"name",{value:e,configurable:!0}),uH=bf[" useId ".trim().toString()]||(()=>{}),cH=0;function Jo(t){const[e,n]=g.useState(uH());return Ar(()=>{t||n(r=>r??String(cH++))},[t]),t||(e?`radix-${e}`:"")}lH(Jo,"useId");var dH=Object.defineProperty,fH=(t,e)=>dH(t,"name",{value:e,configurable:!0}),G4=bf[" useEffectEvent ".trim().toString()],K4=bf[" useInsertionEffect ".trim().toString()];function OT(t){if(typeof G4=="function")return G4(t);const e=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof K4=="function"?K4(()=>{e.current=t}):Ar(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}fH(OT,"useEffectEvent");var hH=Object.defineProperty,Tf=(t,e)=>hH(t,"name",{value:e,configurable:!0}),pH=bf[" useInsertionEffect ".trim().toString()]||Ar;function pa({prop:t,defaultProp:e,onChange:n=Tf(()=>{},"onChange"),caller:r}){const[s,i,a]=LT({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s,d=g.useCallback(h=>{var p;if(u){const m=DT(h)?h(t):h;m!==t&&((p=a.current)==null||p.call(a,m))}else i(h)},[u,t,i,a]);return[c,d]}Tf(pa,"useControllableState");function LT({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return pH(()=>{i.current=e},[e]),g.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}Tf(LT,"useUncontrolledState");function DT(t){return typeof t=="function"}Tf(DT,"isFunction");var q4=Symbol("RADIX:SYNC_STATE");function mH(t,e,n,r){const{prop:s,defaultProp:i,onChange:a,caller:u}=e,c=s!==void 0,d=OT(a),h=[{...n,state:i}];r&&h.push(r);const[p,m]=g.useReducer((w,E)=>{if(E.type===q4)return{...w,state:E.state};const P=t(w,E);return c&&!Object.is(P.state,w.state)&&d(P.state),P},...h),y=p.state,x=g.useRef(y);g.useEffect(()=>{x.current!==y&&(x.current=y,c||d(y))},[y,x,c]);const _=g.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return g.useEffect(()=>{c&&!Object.is(s,p.state)&&m({type:q4,state:s})},[s,p.state,c]),[_,m]}Tf(mH,"useControllableStateReducer");var gH=Object.defineProperty,Gs=(t,e)=>gH(t,"name",{value:e,configurable:!0});function aa(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];C_(s)&&typeof ap=="function"&&(s=ap(s._payload)),g.Children.forEach(s,m=>{var y;if($T(m)){u=!0;const x=m;let _="child"in x.props?x.props.child:x.props.children;C_(_)&&typeof ap=="function"&&(_=ap(_._payload)),a=vH(x,_),c.push((y=a==null?void 0:a.props)==null?void 0:y.children)}else c.push(m)}),a?a=g.cloneElement(a,void 0,c):!u&&g.Children.count(s)===1&&g.isValidElement(s)&&(a=s);const d=a?VT(a):void 0,h=Ft(r,d);if(!a){if(s||s===0)throw new Error(u?xH(t):_H(t));return s}const p=FT(i,a.props??{});return a.type!==g.Fragment&&(p.ref=r?h:d),g.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}Gs(aa,"createSlot");var NT=Symbol.for("radix.slottable");function jT(t){const e=Gs(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=NT,e}Gs(jT,"createSlottable");var vH=Gs((t,e)=>{if("child"in t.props){const n=t.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,t.props.children(n.props.children)):null}return g.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function FT(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const c=i(...u);return s(...u),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}Gs(FT,"mergeProps");function VT(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Gs(VT,"getElementRef");function $T(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===NT}Gs($T,"isSlottable");var yH=Symbol.for("react.lazy");function C_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===yH&&"_payload"in t&&HT(t._payload)}Gs(C_,"isLazyComponent");function HT(t){return typeof t=="object"&&t!==null&&"then"in t}Gs(HT,"isPromiseLike");var _H=Gs(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),xH=Gs(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ap=bf[" use ".trim().toString()],wH=Object.defineProperty,bH=(t,e)=>wH(t,"name",{value:e,configurable:!0}),SH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=SH.reduce((t,e)=>{const n=aa(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:a,...u}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...u,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function zT(t,e){t&&d0.flushSync(()=>t.dispatchEvent(e))}bH(zT,"dispatchDiscreteCustomEvent");var EH=Object.defineProperty,CH=(t,e)=>EH(t,"name",{value:e,configurable:!0});function Cl(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}CH(Cl,"useCallbackRef");var kH=Object.defineProperty,Tn=(t,e)=>kH(t,"name",{value:e,configurable:!0}),k_="dismissableLayer.update",PH="dismissableLayer.pointerDownOutside",TH="dismissableLayer.focusOutside",Z4,UT=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_x=g.forwardRef(Tn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:u,onInteractOutside:c,onDismiss:d,...h}=e,p=g.useContext(UT),[m,y]=g.useState(null),x=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=g.useState({}),w=Ft(n,y),E=Array.from(p.layers),[P]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=P?E.indexOf(P):-1,k=m?E.indexOf(m):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,L=k>=T,O=g.useRef(!1),A=WT(N=>{a==null||a(N),c==null||c(N),N.defaultPrevented||d==null||d()},{ownerDocument:x,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(N=>{if(!(N instanceof Node))return!1;const G=[...p.branches].some(Z=>Z.contains(N));return L&&!G},[p.branches,L])}),M=GT(N=>{if(s&&O.current)return;const G=N.target;[...p.branches].some(Y=>Y.contains(G))||(u==null||u(N),c==null||c(N),N.defaultPrevented||d==null||d())},x),D=m?k===E.length-1:!1,F=Cl(N=>{N.key==="Escape"&&(i==null||i(N),!N.defaultPrevented&&d&&(N.preventDefault(),d()))});return g.useEffect(()=>{if(D)return x.addEventListener("keydown",F,{capture:!0}),()=>x.removeEventListener("keydown",F,{capture:!0})},[x,D,F]),g.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Z4=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),P_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=Z4))}},[m,x,r,p]),g.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),P_())},[m,p]),g.useEffect(()=>{const N=Tn(()=>_({}),"handleUpdate");return document.addEventListener(k_,N),()=>document.removeEventListener(k_,N)},[]),S.jsx(ln.div,{...h,ref:w,style:{pointerEvents:R?L?"auto":"none":void 0,...e.style},onFocusCapture:Nt(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Nt(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Nt(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function BT(){const t=g.useContext(UT),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Tn(BT,"useDismissableLayerSurface");var RH=Tn(()=>!0,"IS_TRUE");function WT(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=RH}=e,u=Cl(t),c=g.useRef(!1),d=g.useRef(!1),h=g.useRef(new Map),p=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,h.current.clear()}Tn(m,"resetOutsideInteraction");function y(){return Array.from(h.current.values()).some(Boolean)}Tn(y,"isOutsideInteractionIntercepted");function x(T){if(!d.current)return;const k=T.target;k instanceof Node&&[...i].some(L=>L.contains(k))||h.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}Tn(x,"handleInteractionCapture");function _(T){d.current&&h.current.set(T.type,!1)}Tn(_,"handleInteractionBubble");const w=Tn(T=>{if(T.target&&!c.current){let k=function(){n.removeEventListener("click",p.current);const L=y();m(),L||xx(PH,u,R,{discrete:!0})};if(Tn(k,"handleAndDispatchPointerDownOutsideEvent"),!a(T.target)){n.removeEventListener("click",p.current),m(),c.current=!1;return}const R={originalEvent:T};d.current=!0,s.current=r&&T.button===0,h.current.clear(),!r||T.button!==0?k():(n.removeEventListener("click",p.current),p.current=k,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();c.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of E)n.addEventListener(T,x,!0),n.addEventListener(T,_);const P=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(P),n.removeEventListener("pointerdown",w),n.removeEventListener("click",p.current);for(const T of E)n.removeEventListener(T,x,!0),n.removeEventListener(T,_)}},[n,u,r,s,i,a]),{onPointerDownCapture:Tn(()=>c.current=!0,"onPointerDownCapture")}}Tn(WT,"usePointerDownOutside");function GT(t,e=globalThis==null?void 0:globalThis.document){const n=Cl(t),r=g.useRef(!1);return g.useEffect(()=>{const s=Tn(i=>{i.target&&!r.current&&xx(TH,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Tn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Tn(()=>r.current=!1,"onBlurCapture")}}Tn(GT,"useFocusOutside");function P_(){const t=new CustomEvent(k_);document.dispatchEvent(t)}Tn(P_,"dispatchUpdate");function xx(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?zT(s,i):s.dispatchEvent(i)}Tn(xx,"handleAndDispatchCustomEvent");var AH=Object.defineProperty,dr=(t,e)=>AH(t,"name",{value:e,configurable:!0}),d1="focusScope.autoFocusOnMount",f1="focusScope.autoFocusOnUnmount",Y4={bubbles:!1,cancelable:!0},KT=g.forwardRef(dr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...u}=e,[c,d]=g.useState(null),h=Cl(i),p=Cl(a),m=g.useRef(null),y=Ft(n,d),x=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let w=function(k){if(x.paused||!c)return;const R=k.target;c.contains(R)?m.current=R:Wi(m.current,{select:!0})},E=function(k){if(x.paused||!c)return;const R=k.relatedTarget;R!==null&&(c.contains(R)||Wi(m.current,{select:!0}))},P=function(k){if(document.activeElement===document.body)for(const L of k)L.removedNodes.length>0&&Wi(c)};dr(w,"handleFocusIn"),dr(E,"handleFocusOut"),dr(P,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",E);const T=new MutationObserver(P);return c&&T.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E),T.disconnect()}}},[s,c,x.paused]),g.useEffect(()=>{if(c){X4.add(x);const w=document.activeElement;if(!c.contains(w)){const P=new CustomEvent(d1,Y4);c.addEventListener(d1,h),c.dispatchEvent(P),P.defaultPrevented||(qT(JT(wx(c)),{select:!0}),document.activeElement===w&&Wi(c))}return()=>{c.removeEventListener(d1,h),setTimeout(()=>{const P=new CustomEvent(f1,Y4);c.addEventListener(f1,p),c.dispatchEvent(P),P.defaultPrevented||Wi(w??document.body,{select:!0}),c.removeEventListener(f1,p),X4.remove(x)},0)}}},[c,h,p,x]);const _=g.useCallback(w=>{if(!r&&!s||x.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,P=document.activeElement;if(E&&P){const T=w.currentTarget,[k,R]=ZT(T);k&&R?!w.shiftKey&&P===R?(w.preventDefault(),r&&Wi(k,{select:!0})):w.shiftKey&&P===k&&(w.preventDefault(),r&&Wi(R,{select:!0})):P===T&&w.preventDefault()}},[r,s,x.paused]);return S.jsx(ln.div,{tabIndex:-1,...u,ref:y,onKeyDown:_})},"FocusScope"));function qT(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Wi(r,{select:e}),document.activeElement!==n)return}dr(qT,"focusFirst");function ZT(t){const e=wx(t),n=T_(e,t),r=T_(e.reverse(),t);return[n,r]}dr(ZT,"getTabbableEdges");function wx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:dr(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}dr(wx,"getTabbableCandidates");function T_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):YT(r,{upTo:e})))return r}dr(T_,"findVisible");function YT(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}dr(YT,"isHidden");function XT(t){return t instanceof HTMLInputElement&&"select"in t}dr(XT,"isSelectableInput");function Wi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&XT(t)&&e&&t.select()}}dr(Wi,"focus");var X4=QT();function QT(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=R_(t,e),t.unshift(e)},remove(e){var n;t=R_(t,e),(n=t[0])==null||n.resume()}}}dr(QT,"createFocusScopesStack");function R_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}dr(R_,"arrayRemove");function JT(t){return t.filter(e=>e.tagName!=="A")}dr(JT,"removeLinks");var IH=Object.defineProperty,MH=(t,e)=>IH(t,"name",{value:e,configurable:!0}),bx=g.forwardRef(MH(function(e,n){var c;const{container:r,...s}=e,[i,a]=g.useState(!1);Ar(()=>a(!0),[]);const u=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?d0.createPortal(S.jsx(ln.div,{...s,ref:n}),u):null},"Portal")),OH=Object.defineProperty,ao=(t,e)=>OH(t,"name",{value:e,configurable:!0});function eR(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}ao(eR,"useStateMachine");var ma=ao(t=>{const{present:e,children:n}=t,r=tR(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=nR(r.ref,rR(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function tR(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),a=g.useRef(void 0),u=t?"mounted":"unmounted",[c,d]=eR(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(i.current=a.current??yu(r.current),a.current=void 0):i.current="none"},[c]),Ar(()=>{const h=r.current,p=s.current;if(p!==t){const y=i.current,x=yu(h);t?(a.current=x,d("MOUNT")):x==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(p&&y!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Ar(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=ao(x=>{const w=yu(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&w&&(d("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},"handleAnimationEnd"),y=ao(x=>{x.target===e&&(i.current=yu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=yu(p)}else r.current=null;n(h)},[])}}ao(tR,"usePresence");function A_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}ao(A_,"setRef");function nR(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(a=>{const u=A_(a,n);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let a=0;a<i.length;a++){const u=i[a];typeof u=="function"?u():A_(r[a],null)}}},[])}ao(nR,"useStableComposedRefs");function yu(t){return(t==null?void 0:t.animationName)||"none"}ao(yu,"getAnimationName");function rR(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}ao(rR,"getElementRef");var LH=Object.defineProperty,Sx=(t,e)=>LH(t,"name",{value:e,configurable:!0}),lp=0,ri=null;function DH(t){return f0(),t.children}Sx(DH,"FocusGuards");function f0(){g.useEffect(()=>{ri||(ri={start:I_(),end:I_()});const{start:t,end:e}=ri;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),lp++,()=>{lp===1&&(ri==null||ri.start.remove(),ri==null||ri.end.remove(),ri=null),lp=Math.max(0,lp-1)}},[])}Sx(f0,"useFocusGuards");function I_(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Sx(I_,"createFocusGuard");var di=function(){return di=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},di.apply(this,arguments)};function sR(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function NH(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Fp="right-scroll-bar-position",Vp="width-before-scroll-bar",jH="with-scroll-bars-hidden",FH="--removed-body-scroll-bar-size";function h1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function VH(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var $H=typeof window<"u"?g.useLayoutEffect:g.useEffect,Q4=new WeakMap;function HH(t,e){var n=VH(null,function(r){return t.forEach(function(s){return h1(s,r)})});return $H(function(){var r=Q4.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||h1(u,null)}),i.forEach(function(u){s.has(u)||h1(u,a)})}Q4.set(n,t)},[t]),n}function zH(t){return t}function UH(t,e){e===void 0&&(e=zH);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(i),a=n}var c=function(){var h=a;a=[],h.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return s}function BH(t){t===void 0&&(t={});var e=UH(null);return e.options=di({async:!0,ssr:!1},t),e}var iR=function(t){var e=t.sideCar,n=sR(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,di({},n))};iR.isSideCarExport=!0;function WH(t,e){return t.useMedium(e),iR}var oR=BH(),p1=function(){},h0=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:p1,onWheelCapture:p1,onTouchMoveCapture:p1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,d=t.removeScrollBar,h=t.enabled,p=t.shards,m=t.sideCar,y=t.noRelative,x=t.noIsolation,_=t.inert,w=t.allowPinchZoom,E=t.as,P=E===void 0?"div":E,T=t.gapMode,k=sR(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,L=HH([n,e]),O=di(di({},k),s);return g.createElement(g.Fragment,null,h&&g.createElement(R,{sideCar:oR,removeScrollBar:d,shards:p,noRelative:y,noIsolation:x,inert:_,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:T}),a?g.cloneElement(g.Children.only(u),di(di({},O),{ref:L})):g.createElement(P,di({},O,{className:c,ref:L}),u))});h0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};h0.classNames={fullWidth:Vp,zeroRight:Fp};var GH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function KH(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=GH();return e&&t.setAttribute("nonce",e),t}function qH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function ZH(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var YH=function(){var t=0,e=null;return{add:function(n){t==0&&(e=KH())&&(qH(e,n),ZH(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},XH=function(){var t=YH();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},aR=function(){var t=XH(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},QH={left:0,top:0,right:0,gap:0},m1=function(t){return parseInt(t||"",10)||0},JH=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[m1(n),m1(r),m1(s)]},ez=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return QH;var e=JH(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},tz=aR(),Tu="data-scroll-locked",nz=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
71
- .`.concat(jH,` {
72
- overflow: hidden `).concat(r,`;
73
- padding-right: `).concat(u,"px ").concat(r,`;
74
- }
75
- body[`).concat(Tu,`] {
76
- overflow: hidden `).concat(r,`;
77
- overscroll-behavior: contain;
78
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
79
- padding-left: `.concat(s,`px;
80
- padding-top: `).concat(i,`px;
81
- padding-right: `).concat(a,`px;
82
- margin-left:0;
83
- margin-top:0;
84
- margin-right: `).concat(u,"px ").concat(r,`;
85
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
86
- }
87
-
88
- .`).concat(Fp,` {
89
- right: `).concat(u,"px ").concat(r,`;
90
- }
91
-
92
- .`).concat(Vp,` {
93
- margin-right: `).concat(u,"px ").concat(r,`;
94
- }
95
-
96
- .`).concat(Fp," .").concat(Fp,` {
97
- right: 0 `).concat(r,`;
98
- }
99
-
100
- .`).concat(Vp," .").concat(Vp,` {
101
- margin-right: 0 `).concat(r,`;
102
- }
103
-
104
- body[`).concat(Tu,`] {
105
- `).concat(FH,": ").concat(u,`px;
106
- }
107
- `)},J4=function(){var t=parseInt(document.body.getAttribute(Tu)||"0",10);return isFinite(t)?t:0},rz=function(){g.useEffect(function(){return document.body.setAttribute(Tu,(J4()+1).toString()),function(){var t=J4()-1;t<=0?document.body.removeAttribute(Tu):document.body.setAttribute(Tu,t.toString())}},[])},sz=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;rz();var i=g.useMemo(function(){return ez(s)},[s]);return g.createElement(tz,{styles:nz(i,!e,s,n?"":"!important")})},M_=!1;if(typeof window<"u")try{var up=Object.defineProperty({},"passive",{get:function(){return M_=!0,!0}});window.addEventListener("test",up,up),window.removeEventListener("test",up,up)}catch{M_=!1}var lu=M_?{passive:!1}:!1,iz=function(t){return t.tagName==="TEXTAREA"},lR=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!iz(t)&&n[e]==="visible")},oz=function(t){return lR(t,"overflowY")},az=function(t){return lR(t,"overflowX")},ek=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=uR(t,r);if(s){var i=cR(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},uz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},uR=function(t,e){return t==="v"?oz(e):az(e)},cR=function(t,e){return t==="v"?lz(e):uz(e)},cz=function(t,e){return t==="h"&&e==="rtl"?-1:1},dz=function(t,e,n,r,s){var i=cz(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),d=!1,h=a>0,p=0,m=0;do{if(!u)break;var y=cR(t,u),x=y[0],_=y[1],w=y[2],E=_-w-i*x;(x||E)&&uR(t,u)&&(p+=E,m+=x);var P=u.parentNode;u=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!c&&u!==document.body||c&&(e.contains(u)||e===u));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(d=!0),d},cp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},tk=function(t){return[t.deltaX,t.deltaY]},nk=function(t){return t&&"current"in t?t.current:t},fz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},hz=function(t){return`
108
- .block-interactivity-`.concat(t,` {pointer-events: none;}
109
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
110
- `)},pz=0,uu=[];function mz(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(pz++)[0],i=g.useState(aR)[0],a=g.useRef(t);g.useEffect(function(){a.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=NH([t.lockRef.current],(t.shards||[]).map(nk),!0).filter(Boolean);return _.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=g.useCallback(function(_,w){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!a.current.allowPinchZoom;var E=cp(_),P=n.current,T="deltaX"in _?_.deltaX:P[0]-E[0],k="deltaY"in _?_.deltaY:P[1]-E[1],R,L=_.target,O=Math.abs(T)>Math.abs(k)?"h":"v";if("touches"in _&&O==="h"&&L.type==="range")return!1;var A=window.getSelection(),M=A&&A.anchorNode,D=M?M===L||M.contains(L):!1;if(D)return!1;var F=ek(O,L);if(!F)return!0;if(F?R=O:(R=O==="v"?"h":"v",F=ek(O,L)),!F)return!1;if(!r.current&&"changedTouches"in _&&(T||k)&&(r.current=R),!R)return!0;var N=r.current||R;return dz(N,w,_,N==="h"?T:k)},[]),c=g.useCallback(function(_){var w=_;if(!(!uu.length||uu[uu.length-1]!==i)){var E="deltaY"in w?tk(w):cp(w),P=e.current.filter(function(R){return R.name===w.type&&(R.target===w.target||w.target===R.shadowParent)&&fz(R.delta,E)})[0];if(P&&P.should){w.cancelable&&w.preventDefault();return}if(!P){var T=(a.current.shards||[]).map(nk).filter(Boolean).filter(function(R){return R.contains(w.target)}),k=T.length>0?u(w,T[0]):!a.current.noIsolation;k&&w.cancelable&&w.preventDefault()}}},[]),d=g.useCallback(function(_,w,E,P){var T={name:_,delta:w,target:E,should:P,shadowParent:gz(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(k){return k!==T})},1)},[]),h=g.useCallback(function(_){n.current=cp(_),r.current=void 0},[]),p=g.useCallback(function(_){d(_.type,tk(_),_.target,u(_,t.lockRef.current))},[]),m=g.useCallback(function(_){d(_.type,cp(_),_.target,u(_,t.lockRef.current))},[]);g.useEffect(function(){return uu.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,lu),document.addEventListener("touchmove",c,lu),document.addEventListener("touchstart",h,lu),function(){uu=uu.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,lu),document.removeEventListener("touchmove",c,lu),document.removeEventListener("touchstart",h,lu)}},[]);var y=t.removeScrollBar,x=t.inert;return g.createElement(g.Fragment,null,x?g.createElement(i,{styles:hz(s)}):null,y?g.createElement(sz,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function gz(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const vz=WH(oR,mz);var Ex=g.forwardRef(function(t,e){return g.createElement(h0,di({},t,{ref:e,sideCar:vz}))});Ex.classNames=h0.classNames;var yz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},cu=new WeakMap,dp=new WeakMap,fp={},g1=0,dR=function(t){return t&&(t.host||dR(t.parentNode))},_z=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=dR(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},xz=function(t,e,n,r){var s=_z(e,Array.isArray(t)?t:[t]);fp[n]||(fp[n]=new WeakMap);var i=fp[n],a=[],u=new Set,c=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))h(m);else try{var y=m.getAttribute(r),x=y!==null&&y!=="false",_=(cu.get(m)||0)+1,w=(i.get(m)||0)+1;cu.set(m,_),i.set(m,w),a.push(m),_===1&&x&&dp.set(m,!0),w===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",m,E)}})};return h(e),u.clear(),g1++,function(){a.forEach(function(p){var m=cu.get(p)-1,y=i.get(p)-1;cu.set(p,m),i.set(p,y),m||(dp.has(p)||p.removeAttribute(r),dp.delete(p)),y||p.removeAttribute(n)}),g1--,g1||(cu=new WeakMap,cu=new WeakMap,dp=new WeakMap,fp={})}},fR=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=yz(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),xz(r,s,n,"aria-hidden")):function(){return null}},wz=Object.defineProperty,Ks=(t,e)=>wz(t,"name",{value:e,configurable:!0}),Cx="Dialog",[hR,YJ]=wi(Cx),[bz,ho]=hR(Cx),kx=Ks(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=g.useRef(null),c=g.useRef(null),[d,h]=pa({prop:r,defaultProp:s??!1,onChange:i,caller:Cx}),[p,m]=g.useState(0),[y,x]=g.useState(0);return S.jsx(bz,{scope:e,triggerRef:u,contentRef:c,contentId:Jo(),titleId:Jo(),descriptionId:Jo(),titlePresent:p>0,descriptionPresent:y>0,setTitleCount:m,setDescriptionCount:x,open:d,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(_=>!_),[h]),modal:a,children:n})},"Dialog"),pR="DialogPortal",[Sz,mR]=hR(pR,{forceMount:void 0}),Px=Ks(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=ho(pR,e);return S.jsx(Sz,{scope:e,forceMount:n,children:g.Children.map(r,a=>S.jsx(ma,{present:n||i.open,children:S.jsx(bx,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),O_="DialogOverlay",Tx=g.forwardRef(Ks(function(e,n){const r=mR(O_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=ho(O_,e.__scopeDialog);return a.modal?S.jsx(ma,{present:s||a.open,children:S.jsx(Cz,{...i,ref:n})}):null},"DialogOverlay")),Ez=aa("DialogOverlay.RemoveScroll"),Cz=g.forwardRef(Ks(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(O_,r),a=BT(),u=Ft(n,a);return S.jsx(Ex,{as:Ez,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(ln.div,{"data-state":Mx(i.open),...s,ref:u,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Yd="DialogContent",Rx=g.forwardRef(Ks(function(e,n){const r=mR(Yd,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=ho(Yd,e.__scopeDialog);return S.jsx(ma,{present:s||a.open,children:a.modal?S.jsx(kz,{...i,ref:n}):S.jsx(Pz,{...i,ref:n})})},"DialogContent")),kz=g.forwardRef(Ks(function(e,n){const r=ho(Yd,e.__scopeDialog),s=g.useRef(null),i=Ft(n,r.contentRef,s);return g.useEffect(()=>{const a=s.current;if(a)return fR(a)},[]),S.jsx(gR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Nt(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Nt(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&a.preventDefault()}),onFocusOutside:Nt(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),Pz=g.forwardRef(Ks(function(e,n){const r=ho(Yd,e.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(gR,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),gR=g.forwardRef(Ks(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...u}=e,c=ho(Yd,r);return f0(),S.jsx(S.Fragment,{children:S.jsx(KT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:S.jsx(_x,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Mx(c.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),Tz="DialogTitle",Ax=g.forwardRef(Ks(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(Tz,r),{setTitleCount:a}=i;return Ar(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),S.jsx(ln.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),Rz="DialogDescription",Ix=g.forwardRef(Ks(function(e,n){const{__scopeDialog:r,...s}=e,i=ho(Rz,r),{setDescriptionCount:a}=i;return Ar(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),S.jsx(ln.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function Mx(t){return t?"open":"closed"}Ks(Mx,"getState");const Az=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),g.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),Iz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),g.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),Mz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),Oz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),Lz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),Dz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Nz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),jz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),Fz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),g.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),Vz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),$z=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),Hz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),zz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),Uz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),Bz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),Wz=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),Gz=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Un=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...d}=t,{color:h="currentColor",size:p,weight:m="regular",mirrored:y=!1,...x}=g.useContext(Gz);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??h,viewBox:"0 0 256 256",transform:a||y?"scale(-1, 1)":void 0,...x,...d},!!n&&g.createElement("title",null,n),u,c.get(i??m))});Un.displayName="IconBase";const vR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Az}));vR.displayName="ArrowLeftIcon";const Kz=vR,yR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Iz}));yR.displayName="ArrowSquareOutIcon";const qz=yR,_R=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Mz}));_R.displayName="ArrowUpIcon";const Zz=_R,xR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Oz}));xR.displayName="CaretDownIcon";const Yz=xR,wR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Lz}));wR.displayName="ChatCircleIcon";const Xz=wR,bR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Dz}));bR.displayName="CheckIcon";const SR=bR,ER=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Nz}));ER.displayName="CircleNotchIcon";const p0=ER,CR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:jz}));CR.displayName="CopyIcon";const Xd=CR,kR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Fz}));kR.displayName="MagnifyingGlassIcon";const Qz=kR,PR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Vz}));PR.displayName="PencilSimpleIcon";const Jz=PR,TR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:$z}));TR.displayName="SidebarSimpleIcon";const eU=TR,RR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Hz}));RR.displayName="SignOutIcon";const tU=RR,AR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:zz}));AR.displayName="SparkleIcon";const v1=AR,IR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Uz}));IR.displayName="SwatchesIcon";const MR=IR,OR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Bz}));OR.displayName="TrashIcon";const nU=OR,LR=g.forwardRef((t,e)=>g.createElement(Un,{ref:e,...t,weights:Wz}));LR.displayName="XIcon";const DR=LR;function NR(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=NR(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function rU(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=NR(t))&&(r&&(r+=" "),r+=e);return r}const sU=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},iU=(t,e)=>({classGroupId:t,validator:e}),jR=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Nm="-",rk=[],oU="arbitrary..",aU=t=>{const e=uU(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return lU(a);const u=a.split(Nm),c=u[0]===""&&u.length>1?1:0;return FR(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],d=n[a];return c?d?sU(d,c):c:d||rk}return n[a]||rk}}},FR=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=FR(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(Nm):t.slice(e).join(Nm),c=a.length;for(let d=0;d<c;d++){const h=a[d];if(h.validator(u))return h.classGroupId}},lU=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?oU+r:void 0})(),uU=t=>{const{theme:e,classGroups:n}=t;return cU(n,e)},cU=(t,e)=>{const n=jR();for(const r in t){const s=t[r];Ox(s,n,r,e)}return n},Ox=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];dU(a,e,n,r)}},dU=(t,e,n,r)=>{if(typeof t=="string"){fU(t,e,n);return}if(typeof t=="function"){hU(t,e,n,r);return}pU(t,e,n,r)},fU=(t,e,n)=>{const r=t===""?e:VR(e,t);r.classGroupId=n},hU=(t,e,n,r)=>{if(mU(t)){Ox(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(iU(n,t))},pU=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];Ox(c,VR(e,u),n,r)}},VR=(t,e)=>{let n=t;const r=e.split(Nm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=jR(),n.nextPart.set(a,u)),n=u}return n},mU=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,gU=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},L_="!",sk=":",vU=[],ik=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),yU=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,d;const h=s.length;for(let _=0;_<h;_++){const w=s[_];if(a===0&&u===0){if(w===sk){i.push(s.slice(c,_)),c=_+1;continue}if(w==="/"){d=_;continue}}w==="["?a++:w==="]"?a--:w==="("?u++:w===")"&&u--}const p=i.length===0?s:s.slice(c);let m=p,y=!1;p.endsWith(L_)?(m=p.slice(0,-1),y=!0):p.startsWith(L_)&&(m=p.slice(1),y=!0);const x=d&&d>c?d-c:void 0;return ik(i,y,m,x)};if(e){const s=e+sk,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):ik(vU,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},_U=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const a=n[i],u=a[0]==="[",c=e.has(a);u||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},xU=t=>({cache:gU(t.cacheSize),parseClassName:yU(t),sortModifiers:_U(t),postfixLookupClassGroupIds:wU(t),...aU(t)}),wU=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},bU=/\s+/,SU=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split(bU);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:m,modifiers:y,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:w}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let E=!!w,P;if(E){const O=_.substring(0,w);P=r(O);const A=P&&a[P]?r(_):void 0;A&&A!==P&&(P=A,E=!1)}else P=r(_);if(!P){if(!E){d=p+(d.length>0?" "+d:d);continue}if(P=r(_),!P){d=p+(d.length>0?" "+d:d);continue}E=!1}const T=y.length===0?"":y.length===1?y[0]:i(y).join(":"),k=x?T+L_:T,R=k+P;if(u.indexOf(R)>-1)continue;u.push(R);const L=s(P,E);for(let O=0;O<L.length;++O){const A=L[O];u.push(k+A)}d=p+(d.length>0?" "+d:d)}return d},EU=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=$R(n))&&(s&&(s+=" "),s+=r);return s},$R=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=$R(t[r]))&&(n&&(n+=" "),n+=e);return n},CU=(t,...e)=>{let n,r,s,i;const a=c=>{const d=e.reduce((h,p)=>p(h),t());return n=xU(d),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const d=r(c);if(d)return d;const h=SU(c,n);return s(c,h),h};return i=a,(...c)=>i(EU(...c))},kU=[],wn=t=>{const e=n=>n[t]||kU;return e.isThemeGetter=!0,e},HR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PU=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RU=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,AU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,No=t=>PU.test(t),st=t=>!!t&&!Number.isNaN(Number(t)),si=t=>!!t&&Number.isInteger(Number(t)),y1=t=>t.endsWith("%")&&st(t.slice(0,-1)),Ni=t=>TU.test(t),UR=()=>!0,OU=t=>RU.test(t)&&!AU.test(t),Lx=()=>!1,LU=t=>IU.test(t),DU=t=>MU.test(t),NU=t=>!Oe(t)&&!De(t),jU=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),FU=t=>ga(t,GR,Lx),Oe=t=>HR.test(t),za=t=>ga(t,KR,OU),ok=t=>ga(t,GU,st),VU=t=>ga(t,ZR,UR),$U=t=>ga(t,qR,Lx),ak=t=>ga(t,BR,Lx),HU=t=>ga(t,WR,DU),hp=t=>ga(t,YR,LU),De=t=>zR.test(t),ud=t=>Tl(t,KR),zU=t=>Tl(t,qR),lk=t=>Tl(t,BR),UU=t=>Tl(t,GR),BU=t=>Tl(t,WR),pp=t=>Tl(t,YR,!0),WU=t=>Tl(t,ZR,!0),ga=(t,e,n)=>{const r=HR.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Tl=(t,e,n=!1)=>{const r=zR.exec(t);return r?r[1]?e(r[1]):n:!1},BR=t=>t==="position"||t==="percentage",WR=t=>t==="image"||t==="url",GR=t=>t==="length"||t==="size"||t==="bg-size",KR=t=>t==="length",GU=t=>t==="number",qR=t=>t==="family-name",ZR=t=>t==="number"||t==="weight",YR=t=>t==="shadow",KU=()=>{const t=wn("color"),e=wn("font"),n=wn("text"),r=wn("font-weight"),s=wn("tracking"),i=wn("leading"),a=wn("breakpoint"),u=wn("container"),c=wn("spacing"),d=wn("radius"),h=wn("shadow"),p=wn("inset-shadow"),m=wn("text-shadow"),y=wn("drop-shadow"),x=wn("blur"),_=wn("perspective"),w=wn("aspect"),E=wn("ease"),P=wn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...k(),De,Oe],L=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],A=()=>[De,Oe,c],M=()=>[No,"full","auto",...A()],D=()=>[si,"none","subgrid",De,Oe],F=()=>["auto",{span:["full",si,De,Oe]},si,De,Oe],N=()=>[si,"auto",De,Oe],G=()=>["auto","min","max","fr",De,Oe],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],K=()=>[No,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[No,"screen","full","dvw","lvw","svw","min","max","fit",...A()],J=()=>[No,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],H=()=>[t,De,Oe],j=()=>[...k(),lk,ak,{position:[De,Oe]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",UU,FU,{size:[De,Oe]}],ie=()=>[y1,ud,za],ae=()=>["","none","full",d,De,Oe],ue=()=>["",st,ud,za],Se=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[st,y1,lk,ak],ye=()=>["","none",x,De,Oe],be=()=>["none",st,De,Oe],Fe=()=>["none",st,De,Oe],Re=()=>[st,De,Oe],We=()=>[No,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ni],breakpoint:[Ni],color:[UR],container:[Ni],"drop-shadow":[Ni],ease:["in","out","in-out"],font:[NU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ni],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ni],shadow:[Ni],spacing:["px",st],text:[Ni],"text-shadow":[Ni],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",No,Oe,De,w]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Oe]}],"container-named":[jU],columns:[{columns:[st,Oe,De,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[si,"auto",De,Oe]}],basis:[{basis:[No,"full","auto",u,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,No,"auto","initial","none",Oe]}],grow:[{grow:["",st,De,Oe]}],shrink:[{shrink:["",st,De,Oe]}],order:[{order:[si,"first","last","none",De,Oe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[u,"screen",...K()]}],"min-w":[{"min-w":[u,"screen","none",...K()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,ud,za]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,WU,VU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",y1,Oe]}],"font-family":[{font:[zU,$U,e]}],"font-features":[{"font-features":[Oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,De,Oe]}],"line-clamp":[{"line-clamp":[st,"none",De,ok]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",De,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[st,"from-font","auto",De,za]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[st,"auto",De,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[si,De,Oe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",De,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},si,De,Oe],radial:["",De,Oe],conic:[si,De,Oe]},BU,HU]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[st,De,Oe]}],"outline-w":[{outline:["",st,ud,za]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,pp,hp]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,pp,hp]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[st,za]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",m,pp,hp]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[st,De,Oe]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[st]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[De,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Oe]}],filter:[{filter:["","none",De,Oe]}],blur:[{blur:ye()}],brightness:[{brightness:[st,De,Oe]}],contrast:[{contrast:[st,De,Oe]}],"drop-shadow":[{"drop-shadow":["","none",y,pp,hp]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",st,De,Oe]}],"hue-rotate":[{"hue-rotate":[st,De,Oe]}],invert:[{invert:["",st,De,Oe]}],saturate:[{saturate:[st,De,Oe]}],sepia:[{sepia:["",st,De,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Oe]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[st,De,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[st,De,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,De,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,De,Oe]}],"backdrop-invert":[{"backdrop-invert":["",st,De,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[st,De,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[st,De,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",st,De,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",De,Oe]}],ease:[{ease:["linear","initial",E,De,Oe]}],delay:[{delay:[st,De,Oe]}],animate:[{animate:["none",P,De,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,De,Oe]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Fe()}],"scale-x":[{"scale-x":Fe()}],"scale-y":[{"scale-y":Fe()}],"scale-z":[{"scale-z":Fe()}],"scale-3d":["scale-3d"],skew:[{skew:Re()}],"skew-x":[{"skew-x":Re()}],"skew-y":[{"skew-y":Re()}],transform:[{transform:[De,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:We()}],"translate-x":[{"translate-x":We()}],"translate-y":[{"translate-y":We()}],"translate-z":[{"translate-z":We()}],"translate-none":["translate-none"],zoom:[{zoom:[si,De,Oe]}],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",De,Oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",De,Oe]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[st,ud,za,ok]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},qU=CU(KU);function hr(...t){return qU(rU(t))}const Qd={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},uk=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function XR(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=uk[Math.abs(e)%uk.length];return{color:n,backgroundColor:`${n}22`}}function QR(t,e={}){const{axis:n="y"}=e,r=g.useRef(new Map),[s,i]=g.useState(null),[a,u]=g.useState([]),c=g.useRef([]),d=g.useRef(0),h=g.useRef(null),p=g.useRef(null),m=g.useCallback(()=>{if(!t.current)return;const P=[];r.current.forEach((T,k)=>{P[k]={top:T.offsetTop,height:T.offsetHeight,left:T.offsetLeft,width:T.offsetWidth}}),c.current=P,u(P)},[t]),y=g.useCallback((E,P)=>{P?r.current.set(E,P):r.current.delete(E),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,m()})},[m]),x=g.useCallback(E=>{const P=E.clientX,T=E.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const k=t.current;if(!k)return;const R=k.getBoundingClientRect(),L=n==="x"?P:T;let O=null,A=1/0,M=null;const D=c.current,F=n==="x"?k.scrollLeft:k.scrollTop,N=n==="x"?k.clientLeft:k.clientTop,G=n==="x"?R.left:R.top,Z=n==="x"?k.offsetWidth:k.offsetHeight,Y=n==="x"?R.width:R.height,B=Z>0?Y/Z:1;for(let K=0;K<D.length;K++){const $=D[K];if(!$)continue;const J=n==="x"?$.left:$.top,H=G+(N+J-F)*B,j=(n==="x"?$.width:$.height)*B,X=H+j;L>=H&&L<=X&&(M=K);const te=H+j/2,ie=Math.abs(L-te);ie<A&&(A=ie,O=K)}i(M??O)})},[n,t]),_=g.useCallback(()=>{d.current+=1,m()},[m]),w=g.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i(null)},[]);return g.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:d,handlers:{onMouseMove:x,onMouseEnter:_,onMouseLeave:w},registerItem:y,measureItems:m}}function ZU(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const JR=(t,e)=>`style:${t}:${e}`,e5=t=>`text:${t}`,t5=t=>{const e=[t.rivetId,t.xpath,t.cssSelector].filter(n=>!!n).map(n=>n.trim()).filter(Boolean);return e.length>0?[...new Set(e)]:["unknown"]},n5=t=>t5(t)[0],mp=(t,e)=>t5(t).includes(e),YU=t=>{const e=n5(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${JR(e,t.property)}${n}`:`${e5(e)}${n}`},Nn=[];for(let t=0;t<256;++t)Nn.push((t+256).toString(16).slice(1));function XU(t,e=0){return(Nn[t[e+0]]+Nn[t[e+1]]+Nn[t[e+2]]+Nn[t[e+3]]+"-"+Nn[t[e+4]]+Nn[t[e+5]]+"-"+Nn[t[e+6]]+Nn[t[e+7]]+"-"+Nn[t[e+8]]+Nn[t[e+9]]+"-"+Nn[t[e+10]]+Nn[t[e+11]]+Nn[t[e+12]]+Nn[t[e+13]]+Nn[t[e+14]]+Nn[t[e+15]]).toLowerCase()}const QU=new Uint8Array(16);function JU(){return crypto.getRandomValues(QU)}function ck(t,e,n){return crypto.randomUUID?crypto.randomUUID():eB(t)}function eB(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??JU();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,XU(r)}const tB=300;class nB{constructor(){Do(this,"history",{current:new Map,past:[],future:[]});Do(this,"pendingChanges",new Map);Do(this,"currentBatchId",null);Do(this,"debounceTimer",null);Do(this,"onChangeCallbacks",[]);Do(this,"stateBeforePending",null);Do(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=ck(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=n5(e.elementId),r=e.type==="style"?JR(n,e.property):e5(n),s=Array.from(this.history.current.entries()).find(([a])=>a===r||a.startsWith(`${r}:`));if(s){const a=s[1];e.type==="style"&&a.type==="style"?e.oldValue=a.oldValue:e.type==="text"&&a.type==="text"&&(e.oldText=a.oldText)}const i=YU(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},tB),this.notifyChange()}flushPending(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.commitPending()}removeChange(e){const n=this.history.current.get(e)??this.pendingChanges.get(e)??null,r=this.history.current.has(e),s=this.pendingChanges.has(e);return!r&&!s?null:(r&&this.history.current.delete(e),s&&this.pendingChanges.delete(e),n&&this.stateBeforePending&&(this.stateBeforePending=this.removeChangeFromSnapshotById(this.stateBeforePending,n.id)),s&&this.pendingChanges.size===0&&(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.stateBeforePending=null,this.currentBatchId=null),r&&(this.history.future=[]),n&&(this.history.past=this.history.past.map(i=>this.removeChangeFromSnapshotById(i,n.id)).filter(i=>i.size>0)),this.notifyChange(),n)}removeChangeById(e){const n=Array.from(this.history.current.entries()).find(([,s])=>s.id===e);if(n)return this.removeChange(n[0]);const r=Array.from(this.pendingChanges.entries()).find(([,s])=>s.id===e);return r?this.removeChange(r[0]):null}removeChangeFromSnapshotById(e,n){return new Map(Array.from(e.entries()).filter(([,r])=>r.id!==n))}commitPending(){this.pendingChanges.size===0||!this.stateBeforePending||this.transactionDepth>0||(this.history.past.push(this.stateBeforePending),this.history.future=[],this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange())}undo(){if(this.pendingChanges.size>0&&this.commitPending(),this.history.past.length===0)return null;const e=new Map(this.history.current);this.history.future.push(e),this.history.current=this.history.past.pop(),this.notifyChange();const n=[];for(const[r,s]of e)this.history.current.has(r)||n.push(s);return n}redo(){if(this.history.future.length===0)return null;const e=new Map(this.history.current);this.history.past.push(e),this.history.current=this.history.future.pop(),this.notifyChange();const n=[];for(const[r,s]of this.history.current)e.has(r)||n.push(s);return n}getChanges(){return Array.from(this.history.current.values())}getStyleChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="style")}getTextChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="text")}getChangeCount(){return this.getUniqueBatchCount(this.history.current.values())}getStyleBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="style"))}getTextBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="text"))}getUniqueBatchCount(e){const n=new Set;for(const r of e)r.batchId?n.add(r.batchId):n.add(r.id);return n.size}canUndo(){return this.history.past.length>0||this.pendingChanges.size>0}canRedo(){return this.history.future.length>0}clear(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.history={current:new Map,past:[],future:[]},this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange()}getStyleChange(e,n){return Array.from(this.history.current.values()).filter(s=>s.type==="style"&&mp(s.elementId,e)&&s.property===n).sort((s,i)=>i.timestamp-s.timestamp)[0]}getTextChange(e){return Array.from(this.history.current.values()).filter(r=>r.type==="text"&&mp(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>mp(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>mp(n.elementId,e))}onChange(e){return this.onChangeCallbacks.push(e),()=>{const n=this.onChangeCallbacks.indexOf(e);n!==-1&&this.onChangeCallbacks.splice(n,1)}}notifyChange(){this.onChangeCallbacks.forEach(e=>e())}export(){return{current:Array.from(this.history.current.entries()),past:this.history.past.map(e=>Array.from(e.entries())),future:this.history.future.map(e=>Array.from(e.entries()))}}import(e){this.history={current:new Map(e.current),past:e.past.map(n=>new Map(n)),future:e.future.map(n=>new Map(n))},this.notifyChange()}async transaction(e){const n=this.pendingChanges.size===0;n&&(this.currentBatchId=ck(),this.stateBeforePending=new Map(this.history.current)),this.transactionDepth++;try{await e()}catch(r){throw n&&this.stateBeforePending&&(this.history.current=new Map(this.stateBeforePending),this.pendingChanges.clear(),this.currentBatchId=null,this.stateBeforePending=null),r}finally{this.transactionDepth--,n&&this.transactionDepth===0&&this.flushPending()}}}const jm={kind:"base"};function Jd(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function rB(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const sB={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},desktopForceUpgrade:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},r5=Object.fromEntries(Object.entries(sB).map(([t,e])=>[t,{isEnabled:e.default}]));rt("view");const s5=rt(!0),i5=rt(null),iB=rt("chat"),o5=rt(0),a5=rt({name:null,email:null}),dk=rt(jm);rt(null);const ef=new Map,oB=t=>{const e=Jd(t);let n=ef.get(e);return n||(n=new nB,ef.set(e,n)),n};rt(t=>oB(t(dk)),(t,e,n)=>{ef.set(Jd(t(dk)),n)});const aB=t=>{for(const e of[...ef.keys()])e==="base"||t.has(e)||ef.delete(e)},tf=rt(new Map),fk=rt(null);rt(null);const D_=rt(0),Fm=rt(null),N_=rt(!1),j_=rt(null),l5=rt(!1),u5=rt(!1),F_=rt(null),V_=rt(null),nf=rt(null),Dx=rt(null),lo=rt(null),Rf=rt({active:!1}),c5=rt([]),hk=rt(null),lB=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&rB(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},uB=rt(null,(t,e,n)=>{const r=c=>{const d=c??jm;return d.kind==="variant"&&!n.has(Jd(d))},s=t(tf);let i=null;for(const[c,d]of s)r(d.target)&&(i??(i=new Set)).add(c);if(i){const c=new Map(s);for(const d of i)c.delete(d);e(tf,c)}const a=t(fk);a&&r(a.target)&&(e(fk,null),e(hB,!1));const u=t(hk);u&&(i!=null&&i.has(u.commentId))&&e(hk,null),aB(n)}),$_=rt(r5),cB=rt(!1),d5=rt(null),Af=rt(!0),fc=rt(!1),f5=rt(!1),h5=rt(!1),p5=rt(null),dB=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},m0=rt(dB()),fB=rt(null),hB=rt(!1);rt(0);rt(0);var $p={exports:{}},pB=$p.exports,pk;function mB(){return pk||(pk=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(pB,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},a=null;function u(_,w){var E=_[w];if(typeof E.bind=="function")return E.bind(_);try{return Function.prototype.bind.call(E,_)}catch{return function(){return Function.prototype.apply.apply(E,[_,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?c:console[_]!==void 0?u(console,_):console.log!==void 0?u(console,"log"):e}function h(){for(var _=this.getLevel(),w=0;w<s.length;w++){var E=s[w];this[E]=w<_?e:this.methodFactory(E,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(h.call(this),this[_].apply(this,arguments))}}function m(_,w,E){return d(_)||p.apply(this,arguments)}function y(_,w){var E=this,P,T,k,R="loglevel";typeof _=="string"?R+=":"+_:typeof _=="symbol"&&(R=void 0);function L(F){var N=(s[F]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=N;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+N+";"}catch{}}}function O(){var F;if(!(typeof window===n||!R)){try{F=window.localStorage[R]}catch{}if(typeof F===n)try{var N=window.document.cookie,G=encodeURIComponent(R),Z=N.indexOf(G+"=");Z!==-1&&(F=/^([^;]+)/.exec(N.slice(Z+G.length+1))[1])}catch{}return E.levels[F]===void 0&&(F=void 0),F}}function A(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function M(F){var N=F;if(typeof N=="string"&&E.levels[N.toUpperCase()]!==void 0&&(N=E.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=E.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+F)}E.name=_,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=w||m,E.getLevel=function(){return k??T??P},E.setLevel=function(F,N){return k=M(F),N!==!1&&L(k),h.call(E)},E.setDefaultLevel=function(F){T=M(F),O()||E.setLevel(F,!1)},E.resetLevel=function(){k=null,A(),h.call(E)},E.enableAll=function(F){E.setLevel(E.levels.TRACE,F)},E.disableAll=function(F){E.setLevel(E.levels.SILENT,F)},E.rebuild=function(){if(a!==E&&(P=M(a.getLevel())),h.call(E),a===E)for(var F in i)i[F].rebuild()},P=M(a?a.getLevel():"WARN");var D=O();D!=null&&(k=M(D)),h.call(E)}a=new y,a.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var E=i[w];return E||(E=i[w]=new y(w,a.methodFactory)),E};var x=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=x),a},a.getLoggers=function(){return i},a.default=a,a})})($p)),$p.exports}var gB=mB();const Hs=t0(gB),vB="INFO",yB=vB.toUpperCase();Hs.setLevel(Hs.levels[yB]||Hs.levels.INFO);const ks=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>Hs.trace(`${e}${n}`,...r),debug:(n,...r)=>Hs.debug(`${e}${n}`,...r),info:(n,...r)=>Hs.info(`${e}${n}`,...r),warn:(n,...r)=>Hs.warn(`${e}${n}`,...r),error:(n,...r)=>{Hs.error(`${e}${n}`,...r);try{const i=r.map(u=>u instanceof Error?u.message:String(u)).join(" ").slice(0,512),a={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Ce.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Hs.info(`${e}API: ${n}`,...r),hook:(n,...r)=>Hs.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>Hs.debug(`${e}Mount: ${n}`,...r)}};let Hp=0;const _B=()=>{Hp+=1;let t=!1;return()=>{t||(t=!0,Hp=Math.max(0,Hp-1))}},xB=()=>Hp>0;function wB(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const bB=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Nx=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:bB.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),SB=["top","right","bottom","left"],la=Math.min,io=Math.max,Vm=Math.round,gp=Math.floor,oo=t=>({x:t,y:t}),EB={left:"right",right:"left",bottom:"top",top:"bottom"};function m5(t,e,n){return io(t,la(e,n))}function uo(t,e){return typeof t=="function"?t(e):t}function ua(t){return t.split("-")[0]}function hc(t){return t.split("-")[1]}function jx(t){return t==="x"?"y":"x"}function Fx(t){return t==="y"?"height":"width"}function pi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Vx(t){return jx(pi(t))}function CB(t,e,n){n===void 0&&(n=!1);const r=hc(t),s=Vx(t),i=Fx(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=$m(a)),[a,$m(a)]}function kB(t){const e=$m(t);return[H_(t),e,H_(e)]}function H_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const mk=["left","right"],gk=["right","left"],PB=["top","bottom"],TB=["bottom","top"];function RB(t,e,n){switch(t){case"top":case"bottom":return n?e?gk:mk:e?mk:gk;case"left":case"right":return e?PB:TB;default:return[]}}function AB(t,e,n,r){const s=hc(t);let i=RB(ua(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(H_)))),i}function $m(t){const e=ua(t);return EB[e]+t.slice(e.length)}function IB(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function g5(t){return typeof t!="number"?IB(t):{top:t,right:t,bottom:t,left:t}}function Hm(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function vk(t,e,n){let{reference:r,floating:s}=t;const i=pi(e),a=Vx(e),u=Fx(a),c=ua(e),d=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[u]/2-s[u]/2;let y;switch(c){case"top":y={x:h,y:r.y-s.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}const x=hc(e);return x&&(y[a]+=m*(x==="end"?1:-1)*(n&&d?-1:1)),y}async function MB(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:y=0}=uo(e,t),x=g5(y),w=u[m?p==="floating"?"reference":"floating":p],E=Hm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:d,rootBoundary:h,strategy:c})),P=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),k=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},R=Hm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:P,offsetParent:T,strategy:c}):P);return{top:(E.top-R.top+x.top)/k.y,bottom:(R.bottom-E.bottom+x.bottom)/k.y,left:(E.left-R.left+x.left)/k.x,right:(R.right-E.right+x.right)/k.x}}const OB=50,LB=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:MB},c=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=vk(d,r,c),m=r,y=0;const x={};for(let _=0;_<i.length;_++){const w=i[_];if(!w)continue;const{name:E,fn:P}=w,{x:T,y:k,data:R,reset:L}=await P({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:x,rects:d,platform:u,elements:{reference:t,floating:e}});h=T??h,p=k??p,x[E]={...x[E],...R},L&&y<OB&&(y++,typeof L=="object"&&(L.placement&&(m=L.placement),L.rects&&(d=L.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):L.rects),{x:h,y:p}=vk(d,m,c)),_=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:x}},DB=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:u,middlewareData:c}=e,{element:d,padding:h=0}=uo(t,e)||{};if(d==null)return{};const p=g5(h),m={x:n,y:r},y=Vx(s),x=Fx(y),_=await a.getDimensions(d),w=y==="y",E=w?"top":"left",P=w?"bottom":"right",T=w?"clientHeight":"clientWidth",k=i.reference[x]+i.reference[y]-m[y]-i.floating[x],R=m[y]-i.reference[y],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let O=L?L[T]:0;(!O||!await(a.isElement==null?void 0:a.isElement(L)))&&(O=u.floating[T]||i.floating[x]);const A=k/2-R/2,M=O/2-_[x]/2-1,D=la(p[E],M),F=la(p[P],M),N=O-_[x]-F,G=O/2-_[x]/2+A,Z=m5(D,G,N),Y=!c.arrow&&hc(s)!=null&&G!==Z&&i.reference[x]/2-(G<D?D:F)-_[x]/2<0,B=Y?G<D?G-D:G-N:0;return{[y]:m[y]+B,data:{[y]:Z,centerOffset:G-Z-B,...Y&&{alignmentOffset:B}},reset:Y}}}),NB=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:u,platform:c,elements:d}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...w}=uo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=ua(s),P=pi(u),T=ua(u)===u,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),R=m||(T||!_?[$m(u)]:kB(u)),L=x!=="none";!m&&L&&R.push(...AB(u,_,x,k));const O=[u,...R],A=await c.detectOverflow(e,w),M=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&M.push(A[E]),p){const Z=CB(s,a,k);M.push(A[Z[0]],A[Z[1]])}if(D=[...D,{placement:s,overflows:M}],!M.every(Z=>Z<=0)){var F,N;const Z=(((F=i.flip)==null?void 0:F.index)||0)+1,Y=O[Z];if(Y&&(!(p==="alignment"?P!==pi(Y):!1)||D.every($=>pi($.placement)===P?$.overflows[0]>0:!0)))return{data:{index:Z,overflows:D},reset:{placement:Y}};let B=(N=D.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:N.placement;if(!B)switch(y){case"bestFit":{var G;const K=(G=D.filter($=>{if(L){const J=pi($.placement);return J===P||J==="y"}return!0}).map($=>[$.placement,$.overflows.filter(J=>J>0).reduce((J,H)=>J+H,0)]).sort(($,J)=>$[1]-J[1])[0])==null?void 0:G[0];K&&(B=K);break}case"initialPlacement":B=u;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function yk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _k(t){return SB.some(e=>t[e]>=0)}const jB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=uo(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=yk(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:_k(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=yk(a,n.floating);return{data:{escapedOffsets:u,escaped:_k(u)}}}default:return{}}}}},v5=new Set(["left","top"]);async function FB(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=ua(n),u=hc(n),c=pi(n)==="y",d=v5.has(a)?-1:1,h=i&&c?-1:1,p=uo(e,t);let{mainAxis:m,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof x=="number"&&(y=u==="end"?x*-1:x),c?{x:y*h,y:m*d}:{x:m*d,y:y*h}}const VB=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:u}=e,c=await FB(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},$B=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:a=!0,crossAxis:u=!1,limiter:c={fn:P=>{let{x:T,y:k}=P;return{x:T,y:k}}},...d}=uo(t,e),h={x:n,y:r},p=await i.detectOverflow(e,d),m=pi(s),y=jx(m);let x=h[y],_=h[m];const w=(P,T)=>m5(T+p[P==="y"?"top":"left"],T,T-p[P==="y"?"bottom":"right"]);a&&(x=w(y,x)),u&&(_=w(m,_));const E=c.fn({...e,[y]:x,[m]:_});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[y]:a,[m]:u}}}}}},HB=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:a,rects:u,middlewareData:c}=e,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=uo(t,e),m={x:s,y:i},y=pi(a),x=jx(y);let _=m[x],w=m[y];const E=uo(d,e),P=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(n=E.mainAxis)!=null?n:0,crossAxis:(r=E.crossAxis)!=null?r:0};if(h){const R=x==="y"?"height":"width",L=u.reference[x]-u.floating[R]+P.mainAxis,O=u.reference[x]+u.reference[R]-P.mainAxis;_<L?_=L:_>O&&(_=O)}if(p){var T,k;const R=x==="y"?"width":"height",L=v5.has(ua(a)),O=u.reference[y]-u.floating[R]+(L&&((T=c.offset)==null?void 0:T[y])||0)+(L?0:P.crossAxis),A=u.reference[y]+u.reference[R]+(L?0:((k=c.offset)==null?void 0:k[y])||0)-(L?P.crossAxis:0);w<O?w=O:w>A&&(w=A)}return{[x]:_,[y]:w}}}},zB=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:a=()=>{},...u}=uo(t,e),c=await s.detectOverflow(e,u),d=ua(n),h=hc(n),p=pi(n)==="y",{width:m,height:y}=r.floating;let x,_;d==="top"||d==="bottom"?(x=d,_=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,x=h==="end"?"top":"bottom");const w=y-c.top-c.bottom,E=m-c.left-c.right,P=la(y-c[x],w),T=la(m-c[_],E),k=e.middlewareData.shift,R=!k;let L=P,O=T;k!=null&&k.enabled.x&&(O=E),k!=null&&k.enabled.y&&(L=w),R&&!h&&(p?O=m-2*io(c.left,c.right):L=y-2*io(c.top,c.bottom)),await a({...e,availableWidth:O,availableHeight:L});const A=await s.getDimensions(i.floating);return m!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function g0(){return typeof window<"u"}function pc(t){return y5(t)?(t.nodeName||"").toLowerCase():"#document"}function Ir(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function po(t){var e;return(e=(y5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function y5(t){return g0()?t instanceof Node||t instanceof Ir(t).Node:!1}function yi(t){return g0()?t instanceof Element||t instanceof Ir(t).Element:!1}function va(t){return g0()?t instanceof HTMLElement||t instanceof Ir(t).HTMLElement:!1}function xk(t){return!g0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ir(t).ShadowRoot}function v0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=_i(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function UB(t){return/^(table|td|th)$/.test(pc(t))}function y0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const BB=/transform|translate|scale|rotate|perspective|filter/,WB=/paint|layout|strict|content/,Ua=t=>!!t&&t!=="none";let _1;function $x(t){const e=yi(t)?_i(t):t;return Ua(e.transform)||Ua(e.translate)||Ua(e.scale)||Ua(e.rotate)||Ua(e.perspective)||!Hx()&&(Ua(e.backdropFilter)||Ua(e.filter))||BB.test(e.willChange||"")||WB.test(e.contain||"")}function GB(t){let e=kl(t);for(;va(e)&&!rf(e);){if($x(e))return e;if(y0(e))return null;e=kl(e)}return null}function Hx(){return _1==null&&(_1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_1}function rf(t){return/^(html|body|#document)$/.test(pc(t))}function _i(t){return Ir(t).getComputedStyle(t)}function _0(t){return yi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function kl(t){if(pc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xk(t)&&t.host||po(t);return xk(e)?e.host:e}function _5(t){const e=kl(t);return rf(e)?(t.ownerDocument||t).body:va(e)&&v0(e)?e:_5(e)}function sf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=_5(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Ir(s);if(i){const u=z_(a);return e.concat(a,a.visualViewport||[],v0(s)?s:[],u&&n?sf(u):[])}else return e.concat(s,sf(s,[],n))}function z_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function x5(t){const e=_i(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=va(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=Vm(n)!==i||Vm(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function zx(t){return yi(t)?t:t.contextElement}function Ru(t){const e=zx(t);if(!va(e))return oo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=x5(e);let a=(i?Vm(n.width):n.width)/r,u=(i?Vm(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const KB=oo(0);function w5(t){const e=Ir(t);return!Hx()||!e.visualViewport?KB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qB(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Ir(t)}function Pl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=zx(t);let a=oo(1);e&&(r?yi(r)&&(a=Ru(r)):a=Ru(t));const u=qB(i,n,r)?w5(i):oo(0);let c=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const m=Ir(i),y=yi(r)?Ir(r):r;let x=m,_=z_(x);for(;_&&y!==x;){const w=Ru(_),E=_.getBoundingClientRect(),P=_i(_),T=E.left+(_.clientLeft+parseFloat(P.paddingLeft))*w.x,k=E.top+(_.clientTop+parseFloat(P.paddingTop))*w.y;c*=w.x,d*=w.y,h*=w.x,p*=w.y,c+=T,d+=k,x=Ir(_),_=z_(x)}}return Hm({width:h,height:p,x:c,y:d})}function x0(t,e){const n=_0(t).scrollLeft;return e?e.left+n:Pl(po(t)).left+n}function b5(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-x0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function ZB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=po(r),u=e?y0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},d=oo(1);const h=oo(0),p=va(r);if((p||!i)&&((pc(r)!=="body"||v0(a))&&(c=_0(r)),p)){const y=Pl(r);d=Ru(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const m=a&&!p&&!i?b5(a,c):oo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-c.scrollTop*d.y+h.y+m.y}}function YB(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function XB(t){const e=_0(t),n=t.ownerDocument.body,r=io(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=io(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+x0(t);const a=-e.scrollTop;return _i(n).direction==="rtl"&&(i+=io(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const QB=25;function JB(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Ir(t),i=po(t),a=s.visualViewport;let u=i.clientWidth,c=i.clientHeight,d=0,h=0;if(a){const m=!Hx()||e==="fixed";r?m||(d=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,m&&(d=a.offsetLeft,h=a.offsetTop))}if(x0(i)<=0){const m=i.ownerDocument,y=m.body,x=getComputedStyle(y),_=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-y.clientWidth-_),E=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;E<=QB&&(u-=E)}return{width:u,height:c,x:d,y:h}}function eW(t,e){const n=Pl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Ru(t),a=t.clientWidth*i.x,u=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:a,height:u,x:c,y:d}}function wk(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=JB(t,n,e);else if(e==="document")r=XB(po(t));else if(yi(e))r=eW(e,n);else{const s=w5(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Hm(r)}function tW(t,e){const n=e.get(t);if(n)return n;let r=sf(t,[],!1).filter(u=>yi(u)&&pc(u)!=="body"),s=null;const i=_i(t).position==="fixed";let a=i?kl(t):t;for(;yi(a)&&!rf(a);){const u=_i(a),c=$x(a),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):s=u,a=kl(a)}return e.set(t,r),r}function nW(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?y0(e)?[]:tW(e,this._c):[].concat(n),r],u=wk(e,a[0],s);let c=u.top,d=u.right,h=u.bottom,p=u.left;for(let m=1;m<a.length;m++){const y=wk(e,a[m],s);c=io(y.top,c),d=la(y.right,d),h=la(y.bottom,h),p=io(y.left,p)}return{width:d-p,height:h-c,x:p,y:c}}function rW(t){const{width:e,height:n}=x5(t);return{width:e,height:n}}function sW(t,e,n){const r=va(e),s=po(e),i=n==="fixed",a=Pl(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=oo(0);if((r||!i)&&((pc(e)!=="body"||v0(s))&&(u=_0(e)),r)){const m=Pl(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=x0(s));const d=s&&!r&&!i?b5(s,u):oo(0),h=a.left+u.scrollLeft-c.x-d.x,p=a.top+u.scrollTop-c.y-d.y;return{x:h,y:p,width:a.width,height:a.height}}function x1(t){return _i(t).position==="static"}function bk(t,e){if(!va(t)||_i(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return po(t)===n&&(n=n.ownerDocument.body),n}function S5(t,e){const n=Ir(t);if(y0(t))return n;if(!va(t)){let s=kl(t);for(;s&&!rf(s);){if(yi(s)&&!x1(s))return s;s=kl(s)}return n}let r=bk(t,e);for(;r&&UB(r)&&x1(r);)r=bk(r,e);return r&&rf(r)&&x1(r)&&!$x(r)?n:r||GB(t)||n}const iW=async function(t){const e=this.getOffsetParent||S5,n=this.getDimensions,r=await n(t.floating);return{reference:sW(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oW(t){return _i(t).direction==="rtl"}const aW={convertOffsetParentRelativeRectToViewportRelativeRect:ZB,getDocumentElement:po,getClippingRect:nW,getOffsetParent:S5,getElementRects:iW,getClientRects:YB,getDimensions:rW,getScale:Ru,isElement:yi,isRTL:oW};function E5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function lW(t,e,n){let r=null,s;const i=po(t);function a(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function u(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:y,top:x,width:_,height:w}=m;if(h||e(),!_||!w)return;const E=gp(x),P=gp(i.clientWidth-(y+_)),T=gp(i.clientHeight-(x+w)),k=gp(y),L={rootMargin:-E+"px "+-P+"px "+-T+"px "+-k+"px",threshold:io(0,la(1,p))||1};let O=!0;function A(M){const D=M[0].intersectionRatio;if(!E5(m,t.getBoundingClientRect()))return u();if(D!==p){if(!O)return u();D?u(!1,D):s=setTimeout(()=>{u(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(A,{...L,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,L)}r.observe(t)}const c=Ir(t),d=()=>u(n);return c.addEventListener("resize",d),u(!0),()=>{c.removeEventListener("resize",d),a()}}function uW(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=zx(t),h=s||i?[...d?sf(d):[],...e?sf(e):[]]:[];h.forEach(E=>{s&&E.addEventListener("scroll",n),i&&E.addEventListener("resize",n)});const p=d&&u?lW(d,n,i):null;let m=-1,y=null;a&&(y=new ResizeObserver(E=>{let[P]=E;P&&P.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=y)==null||T.observe(e)})),n()}),d&&!c&&y.observe(d),e&&y.observe(e));let x,_=c?Pl(t):null;c&&w();function w(){const E=Pl(t);_&&!E5(_,E)&&n(),_=E,x=requestAnimationFrame(w)}return n(),()=>{var E;h.forEach(P=>{s&&P.removeEventListener("scroll",n),i&&P.removeEventListener("resize",n)}),p==null||p(),(E=y)==null||E.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const cW=VB,dW=$B,fW=NB,hW=zB,pW=jB,Sk=DB,mW=HB,gW=(t,e,n)=>{const r=new Map,s=n??{},i={...aW,...s.platform,_c:r};return LB(t,e,{...s,platform:i})};var vW=typeof document<"u",yW=function(){},zp=vW?g.useLayoutEffect:yW;function zm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!zm(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!zm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function C5(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ek(t,e){const n=C5(t);return Math.round(e*n)/n}function w1(t){const e=g.useRef(t);return zp(()=>{e.current=t}),e}function _W(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:u=!0,whileElementsMounted:c,open:d}=t,[h,p]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,y]=g.useState(r);zm(m,r)||y(r);const[x,_]=g.useState(null),[w,E]=g.useState(null),P=g.useCallback($=>{$!==L.current&&(L.current=$,_($))},[]),T=g.useCallback($=>{$!==O.current&&(O.current=$,E($))},[]),k=i||x,R=a||w,L=g.useRef(null),O=g.useRef(null),A=g.useRef(h),M=c!=null,D=w1(c),F=w1(s),N=w1(d),G=g.useCallback(()=>{if(!L.current||!O.current)return;const $={placement:e,strategy:n,middleware:m};F.current&&($.platform=F.current),gW(L.current,O.current,$).then(J=>{const H={...J,isPositioned:N.current!==!1};Z.current&&!zm(A.current,H)&&(A.current=H,d0.flushSync(()=>{p(H)}))})},[m,e,n,F,N]);zp(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[d]);const Z=g.useRef(!1);zp(()=>(Z.current=!0,()=>{Z.current=!1}),[]),zp(()=>{if(k&&(L.current=k),R&&(O.current=R),k&&R){if(D.current)return D.current(k,R,G);G()}},[k,R,G,D,M]);const Y=g.useMemo(()=>({reference:L,floating:O,setReference:P,setFloating:T}),[P,T]),B=g.useMemo(()=>({reference:k,floating:R}),[k,R]),K=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const J=Ek(B.floating,h.x),H=Ek(B.floating,h.y);return u?{...$,transform:"translate("+J+"px, "+H+"px)",...C5(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:H}},[n,u,B.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:G,refs:Y,elements:B,floatingStyles:K}),[h,G,Y,B,K])}const xW=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Sk({element:r.current,padding:s}).fn(n):{}:r?Sk({element:r,padding:s}).fn(n):{}}}},wW=(t,e)=>{const n=cW(t);return{name:n.name,fn:n.fn,options:[t,e]}},bW=(t,e)=>{const n=dW(t);return{name:n.name,fn:n.fn,options:[t,e]}},SW=(t,e)=>({fn:mW(t).fn,options:[t,e]}),EW=(t,e)=>{const n=fW(t);return{name:n.name,fn:n.fn,options:[t,e]}},CW=(t,e)=>{const n=hW(t);return{name:n.name,fn:n.fn,options:[t,e]}},kW=(t,e)=>{const n=pW(t);return{name:n.name,fn:n.fn,options:[t,e]}},PW=(t,e)=>{const n=xW(t);return{name:n.name,fn:n.fn,options:[t,e]}};var TW=Object.defineProperty,RW=(t,e)=>TW(t,"name",{value:e,configurable:!0});function Ux(t){const[e,n]=g.useState(void 0);return Ar(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,u;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,u=d.blockSize}else a=t.offsetWidth,u=t.offsetHeight;n({width:a,height:u})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}RW(Ux,"useSize");var AW=Object.defineProperty,ea=(t,e)=>AW(t,"name",{value:e,configurable:!0}),k5="Popper",[P5,w0]=wi(k5),[IW,T5]=P5(k5),MW=ea(t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,a]=g.useState(void 0);return S.jsx(IW,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})},"Popper"),OW="PopperAnchor",LW=g.forwardRef(ea(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,a=T5(OW,r),u=g.useRef(null),c=a.onAnchorChange,d=g.useCallback(_=>{u.current=_,_&&c(_)},[c]),h=Ft(n,d),p=g.useRef(null);g.useEffect(()=>{if(!s)return;const _=p.current;p.current=s.current,_!==p.current&&c(p.current)});const m=a.placementState&&b0(a.placementState),y=m==null?void 0:m[0],x=m==null?void 0:m[1];return s?null:S.jsx(ln.div,{"data-radix-popper-side":y,"data-radix-popper-align":x,...i,ref:h})},"PopperAnchor")),R5="PopperContent",[DW,XJ]=P5(R5),NW=g.forwardRef(ea(function(e,n){var se,ye,be,Fe,Re,We,Tt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:x="optimized",onPlaced:_,...w}=e,E=T5(R5,r),[P,T]=g.useState(null),k=Ft(n,T),[R,L]=g.useState(null),O=Ux(R),A=(O==null?void 0:O.width)??0,M=(O==null?void 0:O.height)??0,D=s+(a!=="center"?"-"+a:""),F=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(h)?h:[h],G=N.length>0,Z={padding:F,boundary:N.filter(A5),altBoundary:G},{refs:Y,floatingStyles:B,placement:K,isPositioned:$,middlewareData:J}=_W({strategy:"fixed",placement:D,whileElementsMounted:ea((...Ye)=>uW(...Ye,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[wW({mainAxis:i+M,alignmentAxis:u}),d&&bW({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?SW():void 0,...Z}),d&&EW({...Z}),CW({...Z,apply:ea(({elements:Ye,rects:we,availableWidth:It,availableHeight:Ee})=>{const{width:Xe,height:vt}=we.reference,Ge=Ye.floating.style;Ge.setProperty("--radix-popper-available-width",`${It}px`),Ge.setProperty("--radix-popper-available-height",`${Ee}px`),Ge.setProperty("--radix-popper-anchor-width",`${Xe}px`),Ge.setProperty("--radix-popper-anchor-height",`${vt}px`)},"apply")}),R&&PW({element:R,padding:c}),jW({arrowWidth:A,arrowHeight:M}),y&&kW({strategy:"referenceHidden",...Z,boundary:G?Z.boundary:void 0})]}),H=E.setPlacementState;Ar(()=>(H(K),()=>{H(void 0)}),[K,H]);const[j,X]=b0(K),te=Cl(_);Ar(()=>{$&&(te==null||te())},[$,te]);const ie=(se=J.arrow)==null?void 0:se.x,ae=(ye=J.arrow)==null?void 0:ye.y,ue=((be=J.arrow)==null?void 0:be.centerOffset)!==0,[Se,oe]=g.useState();return Ar(()=>{P&&oe(window.getComputedStyle(P).zIndex)},[P]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:$?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(Fe=J.transformOrigin)==null?void 0:Fe.x,(Re=J.transformOrigin)==null?void 0:Re.y].join(" "),...((We=J.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(DW,{scope:r,placedSide:j,placedAlign:X,onArrowChange:L,arrowX:ie,arrowY:ae,shouldHideArrow:ue,children:S.jsx(ln.div,{"data-side":j,"data-align":X,...w,ref:k,style:{...w.style,animation:$?(Tt=w.style)==null?void 0:Tt.animation:"none"}})})})},"PopperContent"));function A5(t){return t!==null}ea(A5,"isNotNull");var jW=ea(t=>({name:"transformOrigin",options:t,fn(e){var w,E,P;const{placement:n,rects:r,middlewareData:s}=e,a=((w=s.arrow)==null?void 0:w.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[d,h]=b0(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((E=s.arrow)==null?void 0:E.x)??0)+u/2,y=(((P=s.arrow)==null?void 0:P.y)??0)+c/2;let x="",_="";return d==="bottom"?(x=a?p:`${m}px`,_=`${-c}px`):d==="top"?(x=a?p:`${m}px`,_=`${r.floating.height+c}px`):d==="right"?(x=`${-c}px`,_=a?p:`${y}px`):d==="left"&&(x=`${r.floating.width+c}px`,_=a?p:`${y}px`),{data:{x,y:_}}}}),"transformOrigin");function b0(t){const[e,n="center"]=t.split("-");return[e,n]}ea(b0,"getSideAndAlignFromPlacement");var I5=MW,M5=LW,O5=NW,FW=Object.defineProperty,ya=(t,e)=>FW(t,"name",{value:e,configurable:!0}),Bx="Popover",[L5,QJ]=wi(Bx,[w0]),Wx=w0(),[VW,mc]=L5(Bx),$W=ya(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=Wx(e),c=g.useRef(null),[d,h]=g.useState(!1),[p,m]=pa({prop:r,defaultProp:s??!1,onChange:i,caller:Bx});return S.jsx(I5,{...u,children:S.jsx(VW,{scope:e,contentId:Jo(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(y=>!y),[m]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>h(!0),[]),onCustomAnchorRemove:g.useCallback(()=>h(!1),[]),modal:a,children:n})})},"Popover"),HW="PopoverTrigger",zW=g.forwardRef(ya(function(e,n){const{__scopePopover:r,...s}=e,i=mc(HW,r),a=Wx(r),u=Ft(n,i.triggerRef),c=S.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Gx(i.open),...s,ref:u,onClick:Nt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:S.jsx(M5,{asChild:!0,...a,children:c})},"PopoverTrigger")),D5="PopoverPortal",[UW,BW]=L5(D5,{forceMount:void 0}),WW=ya(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=mc(D5,e);return S.jsx(UW,{scope:e,forceMount:n,children:S.jsx(ma,{present:n||i.open,children:S.jsx(bx,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),of="PopoverContent",GW=g.forwardRef(ya(function(e,n){const r=BW(of,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,a=mc(of,e.__scopePopover);return S.jsx(ma,{present:s||a.open,children:a.modal?S.jsx(qW,{...i,ref:n}):S.jsx(ZW,{...i,ref:n})})},"PopoverContent")),KW=aa("PopoverContent.RemoveScroll"),qW=g.forwardRef(ya(function(e,n){const r=mc(of,e.__scopePopover),s=g.useRef(null),i=Ft(n,s),a=g.useRef(!1);return g.useEffect(()=>{const u=s.current;if(u)return fR(u)},[]),S.jsx(Ex,{as:KW,allowPinchZoom:!0,children:S.jsx(N5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nt(e.onCloseAutoFocus,u=>{var c;u.preventDefault(),a.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Nt(e.onPointerDownOutside,u=>{const c=u.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Nt(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),ZW=g.forwardRef(ya(function(e,n){const r=mc(of,e.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(N5,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"PopoverContentNonModal")),N5=g.forwardRef(ya(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...m}=e,y=mc(of,r),x=Wx(r);return f0(),S.jsx(KT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:S.jsx(_x,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(O5,{"data-state":Gx(y.open),role:"dialog",id:y.contentId,...x,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function Gx(t){return t?"open":"closed"}ya(Gx,"getState");var j5=$W,F5=zW,V5=WW,$5=GW;const H5=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:u="More actions",dropdownItems:c})=>{const[d,h]=g.useState(!1),p=i?a??t:t,m=c.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?S.jsxs(j5,{open:d,onOpenChange:h,children:[S.jsx(F5,{asChild:!0,children:S.jsx("button",{"aria-label":u,disabled:s||i,title:u,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(Yz,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(V5,{children:S.jsx($5,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(y=>{const x=y.icon;return S.jsxs("button",{onClick:()=>{y.isDisabled||(y.onClick(),h(!1))},disabled:y.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[x?S.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,y.label]},y.label)})})})]}):null]})};var YW=Object.defineProperty,XW=(t,e)=>YW(t,"name",{value:e,configurable:!0}),QW=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"}),JW=g.forwardRef(XW(function(e,n){return S.jsx(ln.span,{...e,ref:n,style:{...QW,...e.style}})},"VisuallyHidden")),eG=JW,tG=Object.defineProperty,An=(t,e)=>tG(t,"name",{value:e,configurable:!0}),[Kx,JJ]=wi("Tooltip",[w0]),qx=w0(),nG="TooltipProvider",rG=700,U_="tooltip.open",[sG,Zx]=Kx(nG),iG=An(t=>{const{__scopeTooltip:e,delayDuration:n=rG,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=g.useRef(!0),u=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),S.jsx(sG,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:g.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),B_="Tooltip",[oG,If]=Kx(B_),aG=An(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=Zx(B_,t.__scopeTooltip),d=qx(e),[h,p]=g.useState(null),[m,y]=g.useState(void 0),x=Jo(),_=g.useRef(0),w=a??c.disableHoverableContent,E=u??c.delayDuration,P=g.useRef(!1),[T,k]=pa({prop:r,defaultProp:s??!1,onChange:An(D=>{D?(c.onOpen(),document.dispatchEvent(new CustomEvent(U_))):c.onClose(),i==null||i(D)},"onChange"),caller:B_}),R=g.useMemo(()=>T?P.current?"delayed-open":"instant-open":"closed",[T]),L=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,P.current=!1,k(!0)},[k]),O=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k(!1)},[k]),A=g.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{P.current=!0,k(!0),_.current=0},E)},[E,k]);g.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const M=m??x;return S.jsx(I5,{...d,children:S.jsx(oG,{scope:e,contentId:M,setContentId:y,open:T,stateAttribute:R,trigger:h,onTriggerChange:p,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?A():L()},[c.isOpenDelayedRef,A,L]),onTriggerLeave:g.useCallback(()=>{w?O():(window.clearTimeout(_.current),_.current=0)},[O,w]),onOpen:L,onClose:O,disableHoverableContent:w,children:n})})},"Tooltip"),Ck="TooltipTrigger",lG=g.forwardRef(An(function(e,n){const{__scopeTooltip:r,...s}=e,i=If(Ck,r),a=Zx(Ck,r),u=qx(r),c=g.useRef(null),d=Ft(n,c,i.onTriggerChange),h=g.useRef(!1),p=g.useRef(!1),m=g.useCallback(()=>h.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(M5,{asChild:!0,...u,children:S.jsx(ln.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:Nt(e.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Nt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Nt(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Nt(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:Nt(e.onBlur,i.onClose),onClick:Nt(e.onClick,i.onClose)})})},"TooltipTrigger")),z5="TooltipPortal",[uG,cG]=Kx(z5,{forceMount:void 0}),dG=An(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=If(z5,e);return S.jsx(uG,{scope:e,forceMount:n,children:S.jsx(ma,{present:n||i.open,children:S.jsx(bx,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),af="TooltipContent",fG=g.forwardRef(An(function(e,n){const r=cG(af,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...a}=e,u=If(af,e.__scopeTooltip);return S.jsx(ma,{present:s||u.open,children:u.disableHoverableContent?S.jsx(U5,{side:i,...a,ref:n}):S.jsx(hG,{side:i,...a,ref:n})})},"TooltipContent")),hG=g.forwardRef(An(function(e,n){const r=If(af,e.__scopeTooltip),s=Zx(af,e.__scopeTooltip),i=g.useRef(null),a=Ft(n,i),[u,c]=g.useState(null),{trigger:d,onClose:h}=r,p=i.current,{onPointerInTransitChange:m}=s,y=g.useCallback(()=>{c(null),m(!1)},[m]),x=g.useCallback((_,w)=>{const E=_.currentTarget,P={x:_.clientX,y:_.clientY},T=B5(P,E.getBoundingClientRect()),k=W5(P,T),R=G5(w.getBoundingClientRect()),L=q5([...k,...R]);c(L),m(!0)},[m]);return g.useEffect(()=>()=>y(),[y]),g.useEffect(()=>{if(d&&p){const _=An(E=>x(E,p),"handleTriggerLeave"),w=An(E=>x(E,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",w)}}},[d,p,x,y]),g.useEffect(()=>{if(u){const _=An(w=>{const E=w.target,P={x:w.clientX,y:w.clientY},T=(d==null?void 0:d.contains(E))||(p==null?void 0:p.contains(E)),k=!K5(P,u);T?y():k&&(y(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,u,h,y]),S.jsx(U5,{...e,ref:a})},"TooltipContentHoverable")),pG=jT("TooltipContent"),U5=g.forwardRef(An(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:a,onEscapeKeyDown:u,onPointerDownOutside:c,...d}=e,h=If(af,r),p=qx(r),{onClose:m}=h;g.useEffect(()=>(document.addEventListener(U_,m),()=>document.removeEventListener(U_,m)),[m]),g.useEffect(()=>{if(h.trigger){const x=An(_=>{_.target instanceof Node&&_.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[h.trigger,m]);const{setContentId:y}=h;return Ar(()=>(y(a),()=>{y(void 0)}),[a,y]),S.jsx(_x,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:S.jsxs(O5,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(pG,{children:s}),i?S.jsx(eG,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function B5(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}An(B5,"getExitSideFromRect");function W5(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}An(W5,"getPaddedExitPoints");function G5(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}An(G5,"getPointsFromRect");function K5(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const u=e[i],c=e[a],d=u.x,h=u.y,p=c.x,m=c.y;h>r!=m>r&&n<(p-d)*(r-h)/(m-h)+d&&(s=!s)}return s}An(K5,"isPointInPolygon");function q5(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Z5(e)}An(q5,"getHull");function Z5(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}An(Z5,"getHullPresorted");var mG=iG,gG=aG,vG=lG,yG=dG,_G=fG;const Id={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},Y5={pill:{item:"rounded-[20px]",bg:"rounded-[20px]",focusRing:"rounded-[22px]",mergedBg:"rounded-2xl",container:"rounded-3xl",button:"rounded-[20px]",input:"rounded-[20px]"},rounded:{item:"rounded-lg",bg:"rounded-lg",focusRing:"rounded-[10px]",mergedBg:"rounded-lg",container:"rounded-xl",button:"rounded-lg",input:"rounded-lg"}},X5=g.createContext(null);function S0(){const t=g.useContext(X5);return t?t.classes:Y5.pill}function xG(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function wG({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{xG(()=>r(i))},[]);return S.jsx(X5.Provider,{value:{shape:n,setShape:s,classes:Y5[n]},children:t})}const Q5=g.createContext(null);function J5({value:t,children:e}){return S.jsx(Q5.Provider,{value:t,children:e})}function bG(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Yx({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:u}){const[c,d]=g.useState(!1),h=a!==void 0?a:c,[p,m]=g.useState(!1),y=S0(),x=g.useContext(Q5);g.useEffect(()=>{h&&m(!0)},[h]);const _=()=>{h||m(!1)},w=bG(n);return S.jsx(mG,{delayDuration:s,children:S.jsxs(gG,{open:h,onOpenChange:E=>{d(E),u==null||u(E)},children:[S.jsx(vG,{asChild:!0,children:e}),p&&S.jsx(yG,{forceMount:!0,container:x??void 0,children:S.jsx(_G,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(so.div,{className:hr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",y.bg,i),style:{fontVariationSettings:Id.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const to=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(Yx,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),E0="/__rivet/preview",kk=`${E0}/variant/`,Pk=`${E0}/history/`,eA=t=>t?t.startsWith("/")?t:`/${t}`:"/",SG=t=>`${E0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${eA(t.routePath)}`,EG=t=>`${E0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${eA(t.routePath)}`,CG=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(kk)||e.pathname.startsWith(Pk)}catch{return t.startsWith(kk)||t.startsWith(Pk)}},Tk=t=>{var s,i,a,u;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?SG({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((a=r.executionPlan)==null?void 0:a.mode)!=="vite_app"&&((u=n.preview)==null?void 0:u.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},Rk="/rivet/",tA=t=>{if(!t.startsWith(Rk))return null;const e=t.slice(Rk.length);return!e||e==="/"?null:`/${e}`},lf=(t,e=fetch)=>{if((t==null?void 0:t.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:t.sessionId,variantId:t.variantId});e(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},kG=(t,e=fetch)=>{const n=new Set;for(const r of[t==null?void 0:t.left,t==null?void 0:t.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),lf(r,e))}},Um=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},Ak=6,W_="original",Xx="Original",Qx="The original state of your app before any variants were generated.",Ik=200,hn=ks("AgentVariantsPanel"),b1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},PG=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,du=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},TG=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Au(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function ji(t){try{const e=await t.json();return{message:typeof e.message=="string"?e.message:null,errorCode:typeof e.errorCode=="string"?e.errorCode:null}}catch{return{message:null,errorCode:null}}}const RG=t=>{var n,r;const e=((r=(n=t.actions)==null?void 0:n.commit)==null?void 0:r.enabled)??t.status==="succeeded";return t.status==="succeeded"&&e},tl=t=>{var e,n;return t.status!=="succeeded"?!1:((n=(e=t.actions)==null?void 0:e.view)==null?void 0:n.enabled)??(!!t.preview||typeof t.port=="number")},nA=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},rA=t=>t.status==="succeeded"&&!tl(t)&&(!t.previewUnavailable||nA(t)),S1=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static_artifact"?"static_artifact":((n=t.preview)==null?void 0:n.kind)==="dev_server"||typeof t.port=="number"?"dev_server":"none"},Mk=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},AG=t=>{var e;return RG(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},Ok=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),IG=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,a;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.label===s.label&&n.brief===s.brief&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((a=s.serve)==null?void 0:a.kind)&&n.hasTree===s.hasTree}),MG=()=>{var Sa,Vr,zf,gr;const t=Je(Rf),e=Je(c5),n=Je(d5),r=Je(Af),s=Je($_),i=((Sa=s.deployPrototype)==null?void 0:Sa.isEnabled)??!1,a=((Vr=s.canvasShare)==null?void 0:Vr.isEnabled)??!1,u=((zf=s.variantSend)==null?void 0:zf.isEnabled)??!1,c=((gr=s.designContextViewer)==null?void 0:gr.isEnabled)??!1,d=Je(h5),h=Je(p5),p=ot(D_),m=ot(Fm),y=ot(N_),x=ot(j_),_=ot(l5),w=ot(u5),E=ot(nf),P=ot(Dx),T=ot(i5);g.useEffect(()=>(T("Directions"),()=>T(null)),[T]);const k=Je(lo),R=Je(fc),L=ot(lo),O=g.useCallback((z=!1)=>{if(kG(k),L(null),z&&k&&!R){const le=Um("ended",k);Ce.capture(le.event,le.properties)}},[R,L,k]),A=Je(F_),M=ot(F_),D=Je(V_),F=ot(V_),N=D?`${D.sessionId}:${D.variantId}`:null,[G,Z]=g.useState(""),[Y,B]=g.useState(null),[K,$]=g.useState(null),[J,H]=g.useState({}),[j,X]=g.useState(null),[te,ie]=g.useState({}),[ae,ue]=g.useState(null),[Se,oe]=g.useState([]),se=g.useRef([]);se.current=Se;const[ye,be]=g.useState(!1),Fe=g.useRef(!1);Fe.current=D!==null||A!==null||ye;const Re=g.useMemo(()=>t.active?t.variants:[],[t]),We=g.useMemo(()=>Re.filter(AG),[Re]),Tt=g.useMemo(()=>Ok(We,J),[We,J]),Ye=(j==null?void 0:j.key)===Tt?j.shareUrl:null,we=t.active?t.sessionId:null,It=g.useMemo(()=>{const z=new Set;if(!we)return z;for(const le of Re)z.add(`${we}:${le.workItemId}`),le.adoptedSource&&z.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return z},[we,Re]),Ee=g.useMemo(()=>[...Se.filter(le=>!It.has(`${le.sessionId}:${le.variantId}`))].sort((le,Ie)=>{const he=new Date(le.createdAt).getTime(),pe=new Date(Ie.createdAt).getTime();return(Number.isNaN(pe)?0:pe)-(Number.isNaN(he)?0:he)}),[Se,It]),Xe=g.useMemo(()=>D?Re.find(z=>{var le,Ie;return((le=z.adoptedSource)==null?void 0:le.sessionId)===D.sessionId&&((Ie=z.adoptedSource)==null?void 0:Ie.variantId)===D.variantId})??null:null,[D,Re]),vt=g.useMemo(()=>D?Ee.find(z=>z.sessionId===D.sessionId&&z.variantId===D.variantId)??null:null,[D,Ee]),Ge=t.active?t.projectContext:null,at=(Ge==null?void 0:Ge.kind)==="fresh"?Ge.workspacePath:n,tr=!t.active&&Ee.length>0&&Ee.every(z=>z.projectKind==="fresh"),vn=t.active?TG(Ge):!!n&&!tr,Bt=g.useMemo(()=>at?`?projectPath=${encodeURIComponent(at)}`:"",[at]),ss=g.useRef(null),nr=g.useRef(null),is=typeof window>"u"?"/":tA(window.location.pathname)??"/",rn=g.useRef(null),pr=g.useRef(!1),qs=g.useCallback((z,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),b1(),rn.current={kind:"live",variantId:z,startX:le.clientX,startY:le.clientY,committed:!1})},[]),Al=g.useCallback((z,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),b1(),rn.current={kind:"past",entry:z,startX:le.clientX,startY:le.clientY,committed:!1})},[]);g.useEffect(()=>{const z=he=>{const pe=rn.current;if(!pe)return;const Pe=he.clientX-pe.startX,Ke=he.clientY-pe.startY;if(!pe.committed){if(Pe*Pe+Ke*Ke<Ak*Ak)return;if(b1(),pe.kind==="live"){const Te=Re.find(Wn=>Wn.workItemId===pe.variantId);if(!Te||Te.status!=="succeeded"){rn.current=null;return}const rr=Tk({sessionId:we,variant:Te,projectContext:Ge,routePath:is});E({sessionId:we??"",variantId:Te.workItemId,label:Te.label||"Direction",url:rr,source:"live",runLabel:Te.runLabel,description:Te.description})}else{const{entry:Te}=pe,rr=du(Te),Wn=rr?EG({sessionId:Te.sessionId,variantId:Te.variantId,routePath:is}):`/api/variants/history/${encodeURIComponent(Te.sessionId)}/${encodeURIComponent(Te.variantId)}/preview${Bt}`;if(E({sessionId:Te.sessionId,variantId:Te.variantId,label:Te.label||"Direction",url:Wn,source:rr?"history-dev-server":"history-static",runLabel:Te.runLabel,description:Te.brief}),rr){const As=Mk(`/api/variants/history/${encodeURIComponent(Te.sessionId)}/${encodeURIComponent(Te.variantId)}/run${Bt}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(As,{method:"POST"})).ok)return;const vr=Mk(Wn,"replay",String(Date.now()));E(On=>!On||On.sessionId!==Te.sessionId||On.variantId!==Te.variantId||On.source!=="history-dev-server"?On:{...On,url:vr}),L(On=>{if(!On)return On;const us=lt=>!lt||lt.sessionId!==Te.sessionId||lt.variantId!==Te.variantId?lt:{...lt,url:vr};return{...On,left:us(On.left),right:us(On.right)}})}catch(ls){hn.warn("history replay drag boot failed",ls)}})()}}pe.committed=!0}P({x:he.clientX,y:he.clientY})},le=()=>{const he=rn.current;he!=null&&he.committed&&(pr.current=!0),rn.current=null,P(null)},Ie=he=>{if(he.key!=="Escape")return;const pe=rn.current;pe!=null&&pe.committed&&(pe.kind==="past"&&du(pe.entry)&&lf({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),rn.current=null,E(null),P(null))};return window.addEventListener("pointermove",z),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",Ie),()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",Ie)}},[Re,we,Ge,is,Bt,E,P,L]);const Mn=g.useMemo(()=>{var le;if(ye||N)return null;const z=A?Re.find(Ie=>Ie.workItemId===A):null;return A&&!z?null:z?tl(z)?z.workItemId:null:t.active?((le=Re.find(Ie=>{var he,pe;return tl(Ie)&&(((he=Ie.preview)==null?void 0:he.kind)==="static_artifact"||((pe=Ie.preview)==null?void 0:pe.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[A,N,ye,t,Re]),Si=g.useCallback(async z=>{var Ie,he,pe,Pe;if(!we)return;const le=(z==null?void 0:z.workItemId)??null;B({kind:"switch",variantId:le??void 0});try{if(((Ie=z==null?void 0:z.preview)==null?void 0:Ie.kind)==="static_artifact"){if(y(!1),x(null),((he=z.refinement)==null?void 0:he.status)==="succeeded"){const Te=z.preview.url.includes("?")?"&":"?";m(`${z.preview.url}${Te}refinement=${encodeURIComponent(z.refinement.workItemId)}`)}else m(z.preview.url);p(Te=>Te+1);return}if(le&&we&&t.active&&t.projectContext.kind==="fresh"&&((pe=t.projectContext.executionPlan)==null?void 0:pe.mode)!=="vite_app"&&((Pe=z==null?void 0:z.preview)==null?void 0:Pe.kind)!=="dev_server"){y(!1),x(null),m(`/api/variants/${we}/static/${le}`),p(Te=>Te+1);return}const Ke=z&&le?Tk({sessionId:we,variant:z,projectContext:t.active?t.projectContext:null,routePath:is}):null;if(Ke){y(!1),x(null),m(Ke),p(Te=>Te+1);return}Ce.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:le,previewKind:z?S1(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),x(null)}catch(Ke){hn.warn("preview display failed",Ke),Ce.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:le,previewKind:z?S1(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:Ke instanceof Error?Ke.message:String(Ke)}),y(!1),x(null)}finally{B(null)}},[we,t,is,p,m,y,x]),Ps=g.useRef(!1),Zs=g.useRef(null),os=g.useRef(0),yn=g.useCallback(()=>{if(os.current++,_(!1),w(!1),!Ps.current)return;const z=Zs.current;Ps.current=!1,Zs.current=null;const le=z?new URLSearchParams({sessionId:z.sessionId,variantId:z.variantId}):null,Ie=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(Ie,{method:"POST"}).catch(he=>hn.warn("history replay stop failed",he))},[_,w]),mo=g.useCallback(async z=>{if(we){B({kind:"switch",variantId:z.workItemId});try{const le=await fetch(`/api/variants/${we}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:z.workItemId})});if(!le.ok){const Ie=await ji(le);throw new Error(Ie.message??`Preview restoration failed (${le.status})`)}}catch(le){hn.warn("preview restoration failed",le),Ce.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:z.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{B(null)}}},[we]),jr=g.useCallback(z=>{var Pe,Ke,Te,rr,Wn;if(pr.current){pr.current=!1;return}const le=tl(z),Ie=z.status==="pending"||z.status==="running"||rA(z);if(!le&&!Ie)return;yn();const he=S1(z),pe=Re.find(As=>As.workItemId===A);Ce.capture("variants_panel.preview_requested",{sessionId:we,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:z.workItemId,variantStatus:z.status,isPreviewReady:le,isArmed:Ie,previewKind:he,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((Ke=(Pe=z.actions)==null?void 0:Pe.view)==null?void 0:Ke.enabled)??null,previewUnavailableReason:((Te=z.previewUnavailable)==null?void 0:Te.reason)??null}),M(z.workItemId),F(null),le?(nr.current=z.workItemId,be(!1),O(!0),Si(z)):(nr.current=null,be(!1),m(null),y(!1),Ce.capture("variants_panel.preview_armed",{sessionId:we,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:z.workItemId,variantStatus:z.status,previewKind:he,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((Wn=(rr=z.actions)==null?void 0:rr.view)==null?void 0:Wn.enabled)??null}),nA(z)&&mo(z)),Ce.capture("variants_panel.preview_switched",{sessionId:we,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:z.workItemId,armed:Ie})},[A,we,O,M,F,yn,mo,Si,Re,m,y]),as=t.active?`${t.sessionId}:${t.stage}`:"inactive",Ei=g.useRef(!1);g.useEffect(()=>{if(r)return;let z=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${Bt}`,{credentials:"same-origin"});if(!le.ok)return;const Ie=await le.json();if(z)return;const he=(Ie.variants??[]).filter(pe=>{var Pe,Ke;return((Pe=pe.preview)==null?void 0:Pe.kind)==="static"||((Ke=pe.serve)==null?void 0:Ke.kind)==="static"||du(pe)});if(!Ei.current&&!Fe.current&&as==="inactive"&&he.length>0&&he.every(pe=>pe.projectKind==="fresh")){const pe=[...he].sort((Pe,Ke)=>new Date(Ke.createdAt).getTime()-new Date(Pe.createdAt).getTime()).find(Pe=>!du(Pe));pe&&(Ei.current=!0,F({sessionId:pe.sessionId,variantId:pe.variantId,previewKind:"static"}),be(!1),m(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/preview${Bt}`))}if(IG(se.current,he))return;se.current=he,oe(he)}catch(le){hn.warn("Failed to load past variants",le)}})(),()=>{z=!0}},[r,as,Bt]);const Ze=g.useCallback(()=>{Ps.current=!1,Zs.current=null,_(!1),w(!1),F(null),M(null),be(!0),y(!1),x(null),m(null),p(z=>z+1)},[M,_,w,p,m,x,F,y]),Mt=g.useCallback(z=>{if(pr.current){pr.current=!1;return}if(O(!0),F({sessionId:z.sessionId,variantId:z.variantId,previewKind:du(z)?"dev_server":"static"}),M(null),be(!1),du(z)){const le=++os.current;Ps.current=!0,Zs.current={sessionId:z.sessionId,variantId:z.variantId},_(!0),w(!0),(async()=>{B({kind:"switch"}),Ce.capture("variants_panel.history_replay_started",{sessionId:z.sessionId,variantId:z.variantId});const Ie=he=>Ce.capture("variants_panel.history_replay_failed",{sessionId:z.sessionId,variantId:z.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/run${Bt}`,{method:"POST"});if(le!==os.current)return;if(!he.ok){const{errorCode:pe}=await ji(he);hn.warn(`history replay failed: HTTP ${he.status} ${pe??""}`),Ie({httpStatus:he.status,errorCode:pe}),Ze();return}w(!1),y(!0),x(null),m(null),p(pe=>pe+1),Ce.capture("variants_panel.history_replay_ready",{sessionId:z.sessionId,variantId:z.variantId})}catch(he){if(le!==os.current)return;hn.warn("history replay failed",he),Ie({errorMessage:he instanceof Error?he.message:String(he)}),Ze()}finally{B(null)}})();return}yn(),y(!1),x(null),m(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/preview${Bt}`)},[Ze,B,_,w,p,F,M,m,x,O,y,yn,Bt]),Wt=g.useCallback(async()=>{yn();const z=()=>{O(!0),M(null),F(null),be(!0),nr.current=null,y(!1),x(null),m(null),p(le=>le+1)};if(!we){z();return}B({kind:"switch"});try{const le=await fetch(`/api/variants/${we}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){hn.warn(`switch to original failed: HTTP ${le.status}`);return}z(),y(!0),Ce.capture("variants_panel.preview_switched",{sessionId:we,fromVariantId:A,toVariantId:null,target:"original",armed:!1})}catch(le){hn.warn("preview-port original switch failed",le)}finally{B(null)}},[A,we,M,F,p,m,x,O,y,yn]),Sn=g.useCallback(async z=>{var Ie,he;const le=((he=(Ie=z.actions)==null?void 0:Ie.commit)==null?void 0:he.enabled)??z.status==="succeeded";if(!(!we||!le)){Ce.capture("variants_panel.commit_clicked",{sessionId:we,variantId:z.workItemId,variantLabel:z.label}),B({kind:"commit",variantId:z.workItemId});try{const pe=await fetch(`/api/variants/${we}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:z.workItemId})});if(!pe.ok){const{message:Ke,errorCode:Te}=await ji(pe);hn.warn(`commit failed: HTTP ${pe.status} ${Te??""} ${Ke??""}`),Ce.capture("variants_panel.commit_failed",{sessionId:we,variantId:z.workItemId,httpStatus:pe.status,errorCode:Te??null,errorMessage:Ke??null}),pt.error("Couldn't send direction",{description:Ke??`The server rejected the request (HTTP ${pe.status}). Try again, or pick a different direction.`});return}const Pe=await pe.json().catch(()=>null);Ce.capture("variants_panel.commit_succeeded",{sessionId:we,variantId:z.workItemId,payloadKind:(Pe==null?void 0:Pe.payloadKind)??null,duplicate:(Pe==null?void 0:Pe.duplicate)??!1}),pt.success(`Sent "${z.label}" to your project`,{description:(Pe==null?void 0:Pe.payloadKind)==="project-created"?`Project created at ${(Pe==null?void 0:Pe.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Pe==null?void 0:Pe.payloadKind)!=="project-created"&&(m(null),y(!1),p(Ke=>Ke+1))}catch(pe){hn.warn("commit failed",pe),Ce.capture("variants_panel.commit_failed",{sessionId:we,variantId:z.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),pt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{B(null)}}},[we,p,m,y]),Fr=g.useCallback(async(z,le,Ie)=>{Ce.capture("variants_panel.deploy_clicked",{sessionId:z,variantId:le,variantLabel:Ie});try{const he=await fetch(`/api/variants/${z}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...n?{projectPath:n}:{}})});if(!he.ok){const{message:Ke,errorCode:Te}=await ji(he);return hn.warn(`deploy failed: HTTP ${he.status} ${Te??""} ${Ke??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:z,variantId:le,httpStatus:he.status,errorCode:Te??null,errorMessage:Ke??null}),pt.error("Couldn't deploy this direction",{description:Ke??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const pe=await he.json().catch(()=>null),Pe=pe==null?void 0:pe.shareUrl;return Pe?(await navigator.clipboard.writeText(Pe).catch(()=>{}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:z,variantId:le}),pt.success(`"${Ie}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Pe,"_blank","noopener")}}),Pe):(pt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return hn.warn("deploy failed",he),Ce.capture("variants_panel.deploy_failed",{sessionId:z,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),pt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),Xt=g.useCallback(async z=>{if(!we)return;const le=J[z.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),pt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}B({kind:"deploy",variantId:z.workItemId});try{const Ie=await Fr(we,z.workItemId,z.label);Ie&&H(he=>({...he,[z.workItemId]:Ie}))}finally{B(null)}},[we,J,Fr]),un=g.useCallback(async()=>{if(!(!we||We.length===0)){if(Ye){await navigator.clipboard.writeText(Ye).catch(()=>{}),pt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Ye,"_blank","noopener")}});return}Ce.capture("variants_panel.deploy_clicked",{sessionId:we,variantId:"canvas",variantLabel:"Canvas",variantCount:We.length}),B({kind:"deploy-canvas"});try{const z=await fetch(`/api/variants/${we}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:We.map(Pe=>Pe.workItemId),...n?{projectPath:n}:{}})});if(!z.ok){const{message:Pe,errorCode:Ke}=await ji(z);hn.warn(`canvas deploy failed: HTTP ${z.status} ${Ke??""} ${Pe??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:we,variantId:"canvas",httpStatus:z.status,errorCode:Ke??null,errorMessage:Pe??null,variantCount:We.length}),pt.error("Couldn't share this canvas",{description:Pe??`The server rejected the request (HTTP ${z.status}). Try again.`});return}const le=await z.json().catch(()=>null),Ie=le==null?void 0:le.shareUrl;if(!Ie){pt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(Pe=>typeof Pe.variantId=="string"&&typeof Pe.shareUrl=="string").map(Pe=>[Pe.variantId,Pe.shareUrl])),pe=Object.keys(he).length>0?{...J,...he}:J;pe!==J&&H(pe),await navigator.clipboard.writeText(Ie).catch(()=>{}),X({key:Ok(We,pe),shareUrl:Ie}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:we,variantId:"canvas",variantCount:We.length}),pt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ie,"_blank","noopener")}})}catch(z){hn.warn("canvas deploy failed",z),Ce.capture("variants_panel.deploy_failed",{sessionId:we,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:z instanceof Error?z.message:String(z),variantCount:We.length}),pt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{B(null)}}},[Ye,We,J,n,we]),Ys=g.useCallback(async z=>{const le=`${z.sessionId}:${z.variantId}`,Ie=te[le];if(Ie){await navigator.clipboard.writeText(Ie).catch(()=>{}),pt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ie,"_blank","noopener")}});return}ue(le);try{const he=await Fr(z.sessionId,z.variantId,z.label);he&&ie(pe=>({...pe,[le]:he}))}finally{ue(null)}},[te,Fr]),cn=g.useCallback(async z=>{if(we){Ce.capture("variants_panel.remove_clicked",{sessionId:we,variantId:z.workItemId,variantLabelLength:z.label.length}),B({kind:"remove",variantId:z.workItemId});try{const le=await fetch(`/api/variants/${we}/${z.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:Ie}=await ji(le);hn.warn(`remove failed: HTTP ${le.status} ${Ie??""}`),pt.error("Couldn't remove direction",{description:Ie??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(z.workItemId===Mn||z.workItemId===A)&&(M(null),m(null),y(!1),p(Ie=>Ie+1))}catch(le){hn.warn("remove failed",le),pt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{B(null)}}},[we,A,Mn,M,m,y,p]),Bn=g.useCallback(async z=>{if(!at){pt.error("Couldn't remove direction",{description:"No project path available."});return}Ce.capture("variants_panel.remove_past_clicked",{sessionId:z.sessionId,variantId:z.variantId});const le=`${z.sessionId}:${z.variantId}`,Ie=he=>he.sessionId===z.sessionId&&he.variantId===z.variantId;B({kind:"remove",variantId:le}),oe(he=>he.filter(pe=>!Ie(pe))),N===le&&(F(null),m(null),y(!1),p(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:at})});if(!he.ok){const{message:pe}=await ji(he);oe(Pe=>Pe.some(Ie)?Pe:[...Pe,z]),pt.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){hn.warn("remove past failed",he),oe(pe=>pe.some(Ie)?pe:[...pe,z]),pt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{B(null)}},[at,N,F,m,y,p]),Ts=g.useCallback(z=>{$(z)},[]),mr=g.useCallback(async()=>{if(K)try{K.kind==="active"?await cn(K.variant):await Bn(K.entry)}finally{$(null)}},[K,cn,Bn]),xa=PG(K),gc=(Y==null?void 0:Y.kind)==="remove"&&Y.variantId===xa,[Nf,M0]=g.useState(null),[O0,Rs]=g.useState(null),jf=g.useCallback(z=>{Rs(z)},[]),Ff=g.useCallback(()=>{Rs(null)},[]),L0=g.useCallback(async z=>{const le=z.trim();if(le)try{await navigator.clipboard.writeText(le),pt.success("Copied")}catch{pt.error("Couldn't copy")}},[]),Vf=g.useCallback(async(z,le)=>{Rs(null);const Ie=le.trim();if(!Ie||z.kind==="original")return;if(z.kind==="active"){if(!we||Ie===z.variant.label)return;Ce.capture("variants_panel.rename",{sessionId:we,variantId:z.variant.workItemId,labelLength:Ie.length,past:!1});try{const Pe=await fetch(`/api/variants/${we}/${z.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ie})});if(!Pe.ok){const{message:Ke}=await ji(Pe);pt.error("Couldn't rename direction",{description:Ke??`The server rejected the request (HTTP ${Pe.status}). Try again.`})}}catch(Pe){hn.warn("rename failed",Pe),pt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=z;if(Ie===he.label.trim())return;if(!at){pt.error("Couldn't rename direction",{description:"No project path available."});return}Ce.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:Ie.length,past:!0});const pe=Pe=>Pe.sessionId===he.sessionId&&Pe.variantId===he.variantId;oe(Pe=>Pe.map(Ke=>pe(Ke)?{...Ke,label:Ie}:Ke));try{const Pe=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ie,projectPath:at})});if(!Pe.ok){const{message:Ke}=await ji(Pe);oe(Te=>Te.map(rr=>pe(rr)?{...rr,label:he.label}:rr)),pt.error("Couldn't rename direction",{description:Ke??`The server rejected the request (HTTP ${Pe.status}). Try again.`})}}catch(Pe){hn.warn("rename failed",Pe),oe(Ke=>Ke.map(Te=>pe(Te)?{...Te,label:he.label}:Te)),pt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[we,at]);g.useEffect(()=>{if(ss.current!==we){const le=ss.current===null;if(ss.current=we,nr.current=null,X(null),m(null),y(!1),x(null),O(),M(null),F(null),be(!1),Ei.current=!1,!le)return}if(N||ye||!Mn||t.active!==!0||nr.current===Mn)return;const z=Re.find(le=>le.workItemId===Mn);z&&(nr.current=Mn,O(),Si(z))},[we,N,ye,Mn,t,Re,Si,O,M,F,m,x,y]),g.useEffect(()=>{!D||!Xe||(nr.current=null,F(null),M(Xe.workItemId),be(!1))},[Xe,D,we,M,F]),g.useEffect(()=>{!D||Xe||vt||F(null)},[Xe,D,vt,we,F,Ee]),g.useEffect(()=>{const z=G.trim().toLowerCase(),le=Re.filter(Te=>tl(Te)&&Au(z,Te.label,Te.runLabel)),Ie=Ee.filter(Te=>Au(z,Te.label,Te.runLabel,Te.brief)),he=vn&&Au(z,Xx,Qx);if(le.length===0&&Ie.length===0&&!he)return;const pe=[...le.map(Te=>({source:"live",variant:Te})),...Ie.map(Te=>({source:"past",entry:Te})),...he?[{source:"original"}]:[]],Pe=Te=>Te.source==="live"?`live:${Te.variant.workItemId}`:Te.source==="past"?`past:${Te.entry.sessionId}:${Te.entry.variantId}`:W_,Ke=Te=>{if(xB())return;if(Te.key==="Enter"){const us=Re.find(lt=>lt.workItemId===Nf);us&&tl(us)&&(Te.preventDefault(),jr(us));return}if(Te.key!=="ArrowUp"&&Te.key!=="ArrowDown")return;Te.preventDefault();let Wn=Mn?`live:${Mn}`:null;N?Wn=`past:${N}`:ye&&(Wn=W_);const As=Wn?pe.findIndex(us=>Pe(us)===Wn):-1;let ls;if(As===-1?ls=Te.key==="ArrowDown"?0:pe.length-1:Te.key==="ArrowDown"?ls=Math.min(As+1,pe.length-1):ls=Math.max(As-1,0),ls===As)return;const vr=pe[ls];vr.source==="live"?jr(vr.variant):vr.source==="past"?Mt(vr.entry):Wt();const On=document.querySelector(`[data-variant-key="${Pe(vr)}"]`);On instanceof HTMLElement&&On.focus({preventScroll:!0})};return window.addEventListener("keydown",Ke),()=>window.removeEventListener("keydown",Ke)},[Re,Ee,G,vn,N,ye,Mn,Nf,jr,Mt,Wt]);const Il=Re.find(z=>z.workItemId===Mn)??null,Ml=N?Ee.find(z=>`${z.sessionId}:${z.variantId}`===N)??null:null,vc=!!Ml,D0=t.active?t.artifacts??[]:[],_t=[...(t.active?Re.filter(z=>z.status!=="cancelled"):[]).map(z=>({kind:"active",variant:z})),...Ee.map(z=>({kind:"past",entry:z})),...vn?[{kind:"original"}]:[]],$f=G.trim().toLowerCase(),wa=$f?_t.filter(z=>NG(z,$f)):_t,Hf=new Set(Re.map(z=>z.requestId).filter(Boolean)),ba=e.filter(z=>!Hf.has(z.requestId)),Ol=ba.length>0,Ll=r&&!Ol&&_t.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[_t.length>0?S.jsx("div",{className:"px-3 pt-2 pb-1",children:S.jsxs("div",{className:"relative",children:[S.jsx(Qz,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:G,onChange:z=>Z(z.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[Ol?S.jsx(YG,{groups:ba}):null,Ll?S.jsx(XG,{}):null,t.active&&_t.length===0&&!Ol&&!Ll?S.jsx(QG,{}):null,!t.active&&!Ol&&!Ll&&Ee.length===0&&!vn?S.jsx(JG,{isMCPSession:d,mcpEditor:h}):null,_t.length>0&&wa.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",G.trim(),"”."]}):null,wa.length>0?S.jsx($G,{rows:wa,activeVariantId:A??Mn,activePastKey:N,isOriginalSelected:ye,busy:Y,editingKey:O0,onSelectActive:jr,onSelectPast:Mt,onSelectOriginal:Wt,onActivePointerDown:qs,onPastPointerDown:Al,onHover:M0,onRemove:z=>Ts({kind:"active",variant:z}),onRemovePast:z=>Ts({kind:"past",entry:z}),onStartRename:jf,onCommitRename:Vf,onCancelRename:Ff,onCopyVariantContext:L0,activeSessionId:t.active?t.sessionId:null,projectPath:at}):null,t.active&&c?S.jsx(GG,{artifacts:D0}):null]}),vc&&Ml?S.jsx(UG,{entry:Ml,deploying:ae===N,deployedUrl:N?te[N]??null:null,onDeploy:Ys,isDeployDisabled:!i}):null,!vc&&t.active?S.jsx(ZG,{selectedVariant:Il,busy:Y,onSend:Sn,onDeploy:Xt,onDeployCanvas:un,canDeploy:i&&(Ge==null?void 0:Ge.kind)==="fresh",canDeployCanvas:i&&a&&(Ge==null?void 0:Ge.kind)==="fresh",canSendToAgent:u,canvasVariantCount:We.length,canvasDeployedUrl:Ye,deployedUrl:Il?J[Il.workItemId]??null:null}):null,S.jsx(LG,{target:K,isConfirming:gc,onCancel:()=>$(null),onConfirm:mr})]})},OG=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",LG=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=OG(t);return S.jsx(kx,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:S.jsxs(Px,{children:[S.jsx(Tx,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(Rx,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(Ax,{className:"text-content text-base font-medium",children:"Remove direction?"}),S.jsxs(Ix,{className:"text-content-subtle text-sm leading-5",children:['This removes "',s,'" from the directions list.']}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":"Remove direction"})]})]})})]})})},DG=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:W_,NG=(t,e)=>t.kind==="active"?Au(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Au(e,t.entry.label,t.entry.runLabel,t.entry.brief):Au(e,Xx,Qx),jG=t=>t.length<=Ik?t:`${t.slice(0,Ik-1)}…`,FG=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,VG=t=>{var i,a;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(u=>!!u).join(`
111
- `);if(!t.reference)return e;const n=((a=t.projectPath)==null?void 0:a.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
112
- `);return e?`${e}
113
-
114
- ${s}`:s},$G=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:y,onStartRename:x,onCommitRename:_,onCancelRename:w,onCopyVariantContext:E,activeSessionId:P,projectPath:T})=>{const k=g.useRef(null),{activeIndex:R,itemRects:L,sessionRef:O,handlers:A,registerItem:M}=QR(k),D=(s==null?void 0:s.kind)==="switch",F=R!==null?L[R]:null;return S.jsxs("div",{ref:k,className:"relative",onMouseEnter:A.onMouseEnter,onMouseMove:A.onMouseMove,onMouseLeave:A.onMouseLeave,children:[S.jsx(ro,{children:F&&S.jsx(_l.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:F.top,left:F.left,width:F.width,height:F.height},animate:{opacity:1,top:F.top,left:F.left,width:F.width,height:F.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Qd.fast,opacity:{duration:.08}}},O.current)}),S.jsx("ul",{className:"relative",children:t.map((N,G)=>{const Z=DG(N);let Y=!1;return N.kind==="active"?Y=N.variant.workItemId===e:N.kind==="past"?Y=`${N.entry.sessionId}:${N.entry.variantId}`===n:Y=r,S.jsx(HG,{rowKey:Z,row:N,index:G,isSelected:Y,isEditing:i===Z,isSwitchInFlight:D,busy:s,registerItem:M,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:y,onStartRename:x,onCommitRename:_,onCancelRename:w,onCopyVariantContext:E,activeSessionId:P,projectPath:T},Z)})})]})},HG=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isSwitchInFlight:i,busy:a,registerItem:u,onSelectActive:c,onSelectPast:d,onSelectOriginal:h,onActivePointerDown:p,onPastPointerDown:m,onHover:y,onRemove:x,onRemovePast:_,onStartRename:w,onCommitRename:E,onCancelRename:P,onCopyVariantContext:T,activeSessionId:k,projectPath:R})=>{var Se,oe;const L=g.useRef(null);ZU(u,n,L);const O=e.kind==="active",A=e.kind==="original",M=e.kind==="active"?e.variant:null,D=e.kind==="past"?e.entry:null,F=O?M.status==="succeeded":!0,N=O?tl(M):!0,G=O?rA(M):!1,Z=O&&(M.status==="pending"||M.status==="running"),Y=O?F&&(N||G)||Z:!0,B=O&&M.status==="failed",K=O&&M.status==="cancelled",$=O&&(!Y||i),J=O&&(a==null?void 0:a.kind)==="remove"&&a.variantId===M.workItemId,H=O&&(((Se=M.refinement)==null?void 0:Se.status)==="pending"||((oe=M.refinement)==null?void 0:oe.status)==="running");let j=Xx;O?j=M.label||`Direction ${n+1}`:D&&(j=D.label.trim()||"Untitled direction");let X;O?X=M.runLabel:D&&(X=D.runLabel);let te=Qx;O?te=M.description:D&&(te=D.brief);const ie=te?jG(te):null,ae=FG(e,k),ue=ae?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:L,"data-proximity-index":n,className:"group relative z-10",children:S.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(zG,{initial:j,onCommit:se=>E(e,se),onCancel:P}),ie&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:ie})]})})}):S.jsxs("li",{ref:L,"data-proximity-index":n,className:"group relative z-10",children:[S.jsx("div",{role:"button",tabIndex:Y?0:-1,"data-variant-id":O?M.workItemId:void 0,"data-variant-key":t,onClick:()=>{if($)return;const se=window.getSelection();se&&!se.isCollapsed||(e.kind==="active"?c(e.variant):e.kind==="past"?d(e.entry):h())},onKeyDown:se=>{$||(se.key==="Enter"||se.key===" ")&&(se.preventDefault(),se.stopPropagation(),e.kind==="active"?c(e.variant):e.kind==="past"?d(e.entry):h())},onPointerDown:se=>{$||(e.kind==="active"?F&&p(e.variant.workItemId,se):e.kind==="past"&&m(e.entry,se))},"aria-pressed":Y?r:void 0,"aria-disabled":O?!Y:void 0,"aria-busy":Z||H,onMouseEnter:O?()=>y(M.workItemId):void 0,onMouseLeave:O?()=>y(null):void 0,className:hr("focus-visible:ring-content-muted/40 flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors focus:outline-none focus-visible:ring-1",r&&"bg-main-input ring-content-muted/40 ring-1 ring-inset",F&&N&&"cursor-grab active:cursor-grabbing",(Z||G)&&"cursor-pointer",!F&&!Z&&!G&&"cursor-not-allowed opacity-60",$&&"cursor-not-allowed opacity-50"),style:F?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[(Z||H)&&S.jsx(Nx,{className:"text-content-muted shrink-0 text-sm","data-testid":H&&!Z?"variant-refining":void 0}),S.jsx(to,{label:"Double-click to rename",disabled:A,children:S.jsx("span",{onDoubleClick:se=>{se.stopPropagation(),A||w(t)},className:hr("min-w-0 flex-1 truncate text-sm font-medium select-text",A?"cursor-default":"cursor-text",F||r?"text-content":"text-content-muted"),children:j})}),B&&S.jsx(to,{label:M.errorMessage??M.errorCode??"Failed",disabled:!M.errorMessage&&!M.errorCode,children:S.jsx("span",{className:"shrink-0",children:S.jsx(Lk,{label:"Failed"})})}),K&&S.jsx(Lk,{label:"Cancelled"}),X&&S.jsx("span",{className:"ml-auto max-w-[8rem] shrink-0 truncate rounded px-1.5 py-0.5 text-[10px] font-medium opacity-100 transition-opacity duration-150 group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:XR(X),children:X})]}),ie&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:ie})]})}),S.jsxs("div",{className:hr("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100"),children:[te||ae?S.jsx(to,{label:ue,children:S.jsx("button",{type:"button","aria-label":ue,onClick:se=>{se.stopPropagation(),T(VG({label:j,description:te,reference:ae,projectPath:R}))},onPointerDown:se=>se.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(Xd,{size:13,weight:"bold"})})}):null,!A&&S.jsx(to,{label:"Rename",children:S.jsx("button",{type:"button","aria-label":"Rename direction",onClick:se=>{se.stopPropagation(),w(t)},onPointerDown:se=>se.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(Jz,{size:13,weight:"bold"})})}),!A&&S.jsx(to,{label:"Remove",children:S.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:J,onClick:se=>{se.stopPropagation(),e.kind==="active"?x(e.variant):_(e.entry)},onPointerDown:se=>se.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(nU,{size:13,weight:"bold"})})})]})]})},zG=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),a=g.useCallback(c=>{c&&(c.focus(),c.select())},[]),u=c=>{i.current||(i.current=!0,c?e(r):n())};return S.jsx("input",{ref:a,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),u(!0)):c.key==="Escape"&&(c.preventDefault(),u(!1))},onBlur:()=>u(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},Lk=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),UG=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(Xd,{size:12,weight:"bold"}):null,a]})]})},BG={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},WG={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},GG=({artifacts:t})=>{const[e,n]=g.useState(null),r=g.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(a=>a===i?null:i)};return S.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[S.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),S.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>S.jsx(KG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},KG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=Je(fc),s=WG[t.kind],i=t.source?BG[t.source]:null,a=[t.kind==="design_context"?null:i,t.summary].filter(Boolean).join(" · "),u=t.kind==="design_context"&&!!t.viewUrl,c=`${e?"Hide":"View"} ${s} artifact${t.label?`: ${t.label}`:""}`;return u?S.jsx("li",{className:"border-main-border rounded-md border",children:S.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:s}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),a?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:a}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{r||Ce.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${s} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:S.jsx(qz,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):S.jsxs("li",{className:"border-main-border rounded-md border",children:[S.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":c,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:s}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),a?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:a}):null]}),S.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?S.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:S.jsx(qG,{artifact:t})}):null]})},qG=({artifact:t})=>S.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?S.jsx("p",{children:t.summary}):null,t.path?S.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?S.jsx("p",{children:"No inline content available for this artifact."}):null]}),ZG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:d,deployedUrl:h})=>{var O,A,M,D;const p=t?((A=(O=t.actions)==null?void 0:O.commit)==null?void 0:A.enabled)??t.status==="succeeded":!1,m=p&&e===null,y=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",w=!i||!p||e!==null,E=a&&c>0,T=x?"Deploying…":h?"Copy link":"Share",R=_?"Sharing…":d?"Copy canvas link":"Share canvas",L=y?"Applying…":"Apply to project";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[S.jsx(H5,{primaryLabel:T,primaryIcon:h&&!x?Xd:void 0,primaryAction:()=>{t&&r(t)},isDisabled:w,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:E?[{label:R,icon:d&&!_?Xd:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!m,title:(D=(M=t==null?void 0:t.actions)==null?void 0:M.commit)==null?void 0:D.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:L}):null]})]})},sA=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(Nx,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),YG=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(sA,{},`${e.requestId}-${r}`)))}),XG=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(sA,{},e))}),QG=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),Dk="Try different ways to create a dropdown that feels fluid and dynamic",JG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=wB(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(Dk).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",Dk,"”"]}),S.jsx("button",{type:"button",onClick:a,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(SR,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(Xd,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},eK=({onClose:t})=>{const e=Je(i5);return t?S.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{}),S.jsx(to,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:S.jsx(eU,{className:"h-4 w-4",weight:"bold"})})})]}):null},tK='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',nK=({itemSelector:t=tK,loop:e=!1}={})=>{const n=g.useRef(null),r=g.useRef(null),s=g.useCallback(a=>{var u;n.current=a,a?r.current=_B():((u=r.current)==null||u.call(r),r.current=null)},[]),i=g.useCallback(a=>{var x;const{key:u}=a;if(u!=="ArrowDown"&&u!=="ArrowUp"&&u!=="Home"&&u!=="End")return;const c=n.current;if(!c)return;const d=Array.from(c.querySelectorAll(t));if(d.length===0)return;a.preventDefault(),a.stopPropagation();const h=d.indexOf(document.activeElement),p=d.length-1,m=_=>{if(h===-1)return _===1?0:p;const w=h+_;return e?(w+d.length)%d.length:Math.min(Math.max(w,0),p)};let y;u==="Home"?y=0:u==="End"?y=p:u==="ArrowDown"?y=m(1):y=m(-1),(x=d[y])==null||x.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},Nk="/assets/arena-Db0j1set.png",rK=ks("useIntegrations"),E1=["integrations"],sK="rivet:connect-result",iK=t=>typeof t=="object"&&t!==null&&t.type===sK,oK=rt(null),jk=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},aK=()=>{const t=Q8(),[e,n]=BP(oK),r=oy({queryKey:E1,queryFn:jk,staleTime:1e4}),s=g.useCallback(async()=>(await t.invalidateQueries({queryKey:E1,refetchType:"none"}),t.fetchQuery({queryKey:E1,queryFn:jk})),[t]),i=g.useCallback(async u=>{const c=window.open("","_blank","width=560,height=720");if(!c)throw new Error("Popup blocked. Allow popups to connect.");n(u);try{const d=await fetch(`/api/integrations/${u}/connect`,{method:"POST"}),h=await d.json().catch(()=>({}));if(!d.ok||!h.authUrl)throw c.close(),new Error(h.error||`Could not connect ${u}`);return c.location.href=h.authUrl,await new Promise(p=>{let m=!1,y=null;const x=async(w,E=!1)=>{if(!m){m=!0,window.removeEventListener("message",_),y&&clearInterval(y);try{const T=(await s()).some(k=>k.provider===u&&k.status==="connected");p(E&&T?"connected":w)}catch{p(w)}}},_=w=>{if(iK(w.data)&&w.data.provider===u){if(w.data.status==="error"){rK.warn(`Connect failed for ${u}:`,w.data.message),x("failed");return}x("connected")}};window.addEventListener("message",_),y=setInterval(()=>{c.closed&&x("closed",!0)},500)})}finally{n(null)}},[s,n]),a=g.useCallback(async u=>{n(u);try{const c=await fetch(`/api/integrations/${u}`,{method:"DELETE"});if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.error||`Could not disconnect ${u}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:a,refetch:s}},Iu=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":u})=>{const c=S.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":u,children:r});return e?S.jsx(Yx,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:e}),n?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:c}):c},Ba=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),Fk=ks("ConnectorsModal"),lK=()=>S.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})}),uK=()=>S.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Nk})`,maskImage:`url(${Nk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),cK=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(lK,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(uK,{})}],dK=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const a=(e==null?void 0:e.status)==="connected",u=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[S.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"mt-4 flex-1",children:[S.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?S.jsx(SR,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),S.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&u?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:u}):null]}),a?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):S.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},G_=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:d}=aK(),h=i0(),[p,m]=g.useState(null),y=E=>s.find(P=>P.provider===E),x=g.useCallback(E=>{const P=Date.now(),T=Ba({action:"connect",outcome:"started",provider:E,entryPoint:n});h==null||h.capture(T.event,T.properties),c(E).then(k=>{const R=Date.now()-P;if(k==="connected"){const O=Ba({action:"connect",outcome:"completed",provider:E,entryPoint:n,durationMs:R});h==null||h.capture(O.event,O.properties);return}const L=Ba({action:"connect",outcome:"failed",provider:E,entryPoint:n,durationMs:R,failureReason:k==="closed"?"popup_closed":"provider_failed"});h==null||h.capture(L.event,L.properties)}).catch(k=>{const R=k instanceof Error?k.message:"Could not connect.",L=Ba({action:"connect",outcome:"failed",provider:E,entryPoint:n,durationMs:Date.now()-P,failureReason:R.includes("Popup blocked")?"popup_blocked":"request_failed"});h==null||h.capture(L.event,L.properties),Fk.warn(`Connect error for ${E}:`,R),pt.error(R)})},[c,n,h]),_=g.useCallback(E=>{const P=Date.now(),T=Ba({action:"disconnect",outcome:"started",provider:E,entryPoint:n});h==null||h.capture(T.event,T.properties),d(E).then(()=>{const k=Ba({action:"disconnect",outcome:"completed",provider:E,entryPoint:n,durationMs:Date.now()-P});h==null||h.capture(k.event,k.properties)}).catch(k=>{const R=k instanceof Error?k.message:"Could not disconnect.",L=Ba({action:"disconnect",outcome:"failed",provider:E,entryPoint:n,durationMs:Date.now()-P,failureReason:"request_failed"});h==null||h.capture(L.event,L.properties),Fk.warn(`Disconnect error for ${E}:`,R),pt.error(R)})},[n,d,h]),w=n==="onboarding";return S.jsx(kx,{open:t,onOpenChange:E=>!E&&e(),children:S.jsxs(Px,{children:[S.jsx(Tx,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(Rx,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(J5,{value:p,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(Ax,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(Iu,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:S.jsx(DR,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(Ix,{className:"text-content-subtle text-sm",children:"Connect your design references to use them with Rivet’s MCP."}),a?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,S.jsx("div",{className:"grid grid-cols-2 gap-4",children:cK.map(E=>S.jsx(dK,{meta:E,integration:y(E.provider),isPending:i||u===E.provider,isHighlighted:r===E.provider,onConnect:()=>x(E.provider),onDisconnect:()=>_(E.provider)},E.provider))}),w?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})})},Vk=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),fK=ks("SupportTicketModal"),$k=5e3,C1="feedback",hK=t=>{var r;if(!t)return null;const e=(r=t.formErrors)==null?void 0:r[0];if(e)return e;const n=t.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},pK=async t=>{let e;try{e=await t.json()}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=hK(e.details);if(n)return n}return"Please check your feedback and try again."}return t.status>=500?typeof(e==null?void 0:e.details)=="string"&&e.details.trim()?e.details:"Could not send feedback right now. Please try again later.":typeof(e==null?void 0:e.error)=="string"&&e.error.trim()?e.error:`HTTP ${t.status}`},mK=({isOpen:t,onClose:e,contactEmail:n})=>{const r=i0(),[s,i]=g.useState(""),[a,u]=g.useState(!1),[c,d]=g.useState(null),h=g.useCallback(()=>{i("")},[]),p=g.useCallback(()=>{a||(h(),e())},[a,e,h]),m=g.useCallback(async()=>{const w=s.trim();if(!(!w||a)){u(!0);try{const E=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,P=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,T=n==null?void 0:n.trim(),k=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:C1,message:w,contactEmail:T||void 0,metadata:{posthogSessionId:E??void 0,posthogDistinctId:P??void 0,appVersion:"0.14.12",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!k.ok){const R=await pK(k);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:C1,has_posthog_session_id:!!E}),pt.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(E){const P=E instanceof Error?E.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:C1,error:P}),fK.error("Failed to submit support ticket:",P),pt.error("Could not send feedback",{description:P})}finally{u(!1)}}},[n,a,s,e,r,h]),y=g.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())},[m]),x=$k-s.length,_=a||s.trim().length===0;return S.jsx(kx,{open:t,onOpenChange:w=>!w&&p(),children:S.jsxs(Px,{children:[S.jsx(Tx,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(Rx,{ref:d,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(J5,{value:c,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(Ax,{className:"text-base font-medium text-content",children:"Send feedback"}),S.jsx(Iu,{onClick:p,disabled:a,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(DR,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(Ix,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:w=>i(w.target.value),onKeyDown:y,maxLength:$k,rows:6,disabled:a,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[S.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&S.jsx("span",{className:"text-xs text-content-subtle",children:x}),S.jsx(Iu,{onClick:m,disabled:_,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:a?S.jsx(p0,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(Zz,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},gK=ks("ProfileAvatar"),iA=(t,e)=>{const n=(t??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((e??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},vK=(t,e)=>iA(t,e).charAt(0).toUpperCase(),yK=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=Je(a5),i=Je(f5),a=Je(fc),[u,c]=g.useState(!1),[d,h]=g.useState(!1),[p,m]=g.useState(!1),[y,x]=g.useState(!1),{containerRef:_,onKeyDown:w}=nK(),E=Je(Af),P=vK(r,s);if(!P)return E?S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(Vk,{className:"h-7 w-7 rounded-full"}),S.jsx(Vk,{className:"h-3 w-16"})]}):null;const T=iA(r,s),k=(r==null?void 0:r.trim())||null,R=(s==null?void 0:s.trim())||null,L=async()=>{x(!0);try{const O=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!O.ok)throw new Error(`Logout failed: ${O.status}`)}catch(O){gK.warn("Logout request failed",O),pt.error("Could not log out. Please try again."),x(!1);return}window.location.reload()};return S.jsxs(S.Fragment,{children:[S.jsxs(j5,{open:u,onOpenChange:c,children:[S.jsx(F5,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account",className:`flex shrink-0 select-none items-center gap-2 text-content-muted transition-colors hover:text-content ${t}`,children:[S.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-main-border bg-main-input text-[11px] font-semibold leading-none",children:P}),T?S.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:T}):null]})}),S.jsx(V5,{children:S.jsxs($5,{ref:_,onKeyDown:w,role:"menu",className:"z-[60] min-w-[180px] rounded-lg bg-surface-2 p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[k||R?S.jsxs("div",{className:"border-b border-main-border px-3 py-2",children:[k?S.jsx("div",{className:"truncate text-xs font-medium text-content",children:k}):null,R?S.jsx("div",{className:"truncate text-[11px] text-content-muted",children:R}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),h(!0)},disabled:!i||a,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(MR,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),m(!0)},className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none",children:[S.jsx(Xz,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:L,disabled:y,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(tU,{className:"h-3.5 w-3.5",weight:"bold"}),y?"Logging out…":"Log out"]})]})})]}),S.jsx(G_,{isOpen:d,onClose:()=>h(!1)}),S.jsx(mK,{isOpen:p,onClose:()=>m(!1),contactEmail:s??void 0})]})},_K=({onClose:t})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(eK,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(MG,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:S.jsx(yK,{side:"top",align:"start"})})]}),xK=ks("useServerConfig"),wK=()=>{const[t,e]=g.useState(null),[n,r]=g.useState(!0),[s,i]=g.useState(null),a=g.useCallback(async()=>{var u;try{r(!0),i(null);const c=await fetch("/api/health");if(!c.ok)throw new Error(`Failed to fetch config: ${c.status}`);const d=await c.json();if(!d.framework)throw new Error("Server did not return framework information");const h={userPort:((u=d.ports)==null?void 0:u.userDevServer)||3e3,framework:d.framework};return e(h),h}catch(c){const d=c instanceof Error?c.message:"Failed to fetch server config";throw i(d),xK.warn("Error fetching server config:",c),c}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},bK="#1C1C20",Fi=[118,118,124],Hk=.85,SK=3,EK=.15,vp=36,CK=4.4,kK=.7,PK=3.5,TK=.8,zk=9,RK=11,AK=[1.35,1.12,.95,.85],IK=[0,1.1,2.3,3.1],MK=[0,.35,.16,.13],OK=[.9,.5,.4,.35],Wa=3,k1=[[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.23,level:1},{x1:.14,y1:.28,x2:.3,y2:.87,level:1},{x1:.34,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.155,x2:.225,y2:.205,level:2},{x1:.7,y1:.155,x2:.755,y2:.205,level:2},{x1:.775,y1:.155,x2:.83,y2:.205,level:2},{x1:.165,y1:.32,x2:.275,y2:.375,level:2},{x1:.165,y1:.415,x2:.275,y2:.47,level:2},{x1:.165,y1:.51,x2:.275,y2:.565,level:2},{x1:.37,y1:.32,x2:.585,y2:.56,level:2},{x1:.615,y1:.32,x2:.83,y2:.56,level:2},{x1:.37,y1:.61,x2:.83,y2:.83,level:2},{hline:!0,x1:.39,x2:.81,y:.685,level:3},{hline:!0,x1:.39,x2:.75,y:.755,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.16,y1:.17,x2:.52,y2:.45,level:1},{x1:.58,y1:.17,x2:.685,y2:.29,level:1},{x1:.715,y1:.17,x2:.84,y2:.29,level:1},{x1:.58,y1:.33,x2:.685,y2:.45,level:1},{x1:.715,y1:.33,x2:.84,y2:.45,level:1},{x1:.16,y1:.55,x2:.84,y2:.85,level:1},{x1:.19,y1:.21,x2:.36,y2:.33,level:2},{hline:!0,x1:.19,x2:.48,y:.37,level:3},{hline:!0,x1:.19,x2:.42,y:.42,level:3},{x1:.19,y1:.6,x2:.49,y2:.8,level:2},{hline:!0,x1:.53,x2:.8,y:.63,level:3},{hline:!0,x1:.53,x2:.76,y:.7,level:3},{hline:!0,x1:.53,x2:.79,y:.77,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.22,level:1},{x1:.14,y1:.28,x2:.36,y2:.87,level:1},{x1:.39,y1:.28,x2:.61,y2:.87,level:1},{x1:.64,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.15,x2:.225,y2:.2,level:2},{x1:.165,y1:.32,x2:.335,y2:.52,level:2},{x1:.415,y1:.32,x2:.585,y2:.52,level:2},{x1:.665,y1:.32,x2:.835,y2:.52,level:2},{hline:!0,x1:.165,x2:.335,y:.6,level:3},{hline:!0,x1:.165,x2:.3,y:.67,level:3},{hline:!0,x1:.415,x2:.585,y:.6,level:3},{hline:!0,x1:.415,x2:.55,y:.67,level:3},{hline:!0,x1:.665,x2:.835,y:.6,level:3},{hline:!0,x1:.665,x2:.8,y:.67,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.3,y1:.22,x2:.7,y2:.74,level:1},{x1:.34,y1:.27,x2:.55,y2:.34,level:2},{hline:!0,x1:.36,x2:.64,y:.42,level:3},{hline:!0,x1:.36,x2:.6,y:.49,level:3},{hline:!0,x1:.36,x2:.62,y:.56,level:3},{x1:.5,y1:.63,x2:.575,y2:.69,level:2},{x1:.595,y1:.63,x2:.66,y2:.69,level:2}]],yp=t=>{let e=t|0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),e^=e>>>16,(e>>>0)/4294967296},Up=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Ga=(t,e)=>(Math.round(t/e-.5)+.5)*e,LK=Math.sin(Math.PI/3),Uk=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*LK;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},DK=(t,e,n)=>{let r;if(n.hline){const s=Math.max(n.x1-t,t-n.x2,0),i=Math.abs(e-n.y1);r=Math.hypot(s,i)-zk}else{const s=Math.max(n.x1-t,t-n.x2,0),i=Math.max(n.y1-e,e-n.y2,0);s===0&&i===0?r=-Math.min(t-n.x1,n.x2-t,e-n.y1,n.y2-e):r=Math.hypot(s,i),r=Math.abs(r)-zk}return Up(.5-r/(2*RK))},oA=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=ot(o5),r=g.useRef(null),s=g.useCallback(i=>{var D;if((D=r.current)==null||D.call(r),r.current=null,!i)return;const a=i.getContext("2d");if(!a)return;e&&n(F=>F+1);const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],d=0,h=0,p=vp,m=vp,y=null,x=null,_=0,w=-1;const E=new Array(33),P=F=>{const N=Math.round(F*32);let G=E[N];if(!G){const Z=N/32,Y=Math.round(Fi[0]+(255-Fi[0])*Z),B=Math.round(Fi[1]+(255-Fi[1])*Z),K=Math.round(Fi[2]+(255-Fi[2])*Z);G=`rgba(${Y}, ${B}, ${K}, ${Hk})`,E[N]=G}return G},T=F=>{const N=1-.35*F,G=Math.round(Fi[0]*N),Z=Math.round(Fi[1]*N),Y=Math.round(Fi[2]*N);return`rgba(${G}, ${Z}, ${Y}, ${Hk})`},k=F=>{let N=Math.floor(Math.random()*k1.length);N===w&&(N=(N+1)%k1.length),w=N;const G=[0,0,0,0],Z=k1[N].map((j,X)=>{const te=j.level,ie=G[te]++,ae=IK[te]+ie*MK[te],ue=OK[te]+yp(N*131+X*17+5)*.2;if(j.hline){const se=Ga((j.y??0)*h,m);return{hline:!0,x1:Ga(j.x1*d,p),x2:Ga(j.x2*d,p),y1:se,y2:se,level:te,start:ae,dur:ue}}const Se=Ga(j.x1*d,p),oe=Ga((j.y1??0)*h,m);return{hline:!1,x1:Se,y1:oe,x2:Math.max(Ga(j.x2*d,p),Se+p),y2:Math.max(Ga((j.y2??0)*h,m),oe+m),level:te,start:ae,dur:ue}}),Y=Z.reduce((j,X)=>Math.max(j,X.start+X.dur),0),B=c.length,K=new Float32Array(B*Wa),$=new Int16Array(B*Wa).fill(-1),J=new Uint8Array(B),H=Z[0];for(let j=0;j<B;j++){const X=c[j];X.x>H.x1&&X.x<H.x2&&X.y>H.y1&&X.y<H.y2&&(J[j]=1);const te=j*Wa;for(let ie=0;ie<Z.length;ie++){const ae=DK(X.x,X.y,Z[ie]);if(ae<=.02)continue;let ue=te;for(let Se=te;Se<te+Wa;Se++){if($[Se]===-1){ue=Se;break}K[Se]<K[ue]&&(ue=Se)}($[ue]===-1||ae>K[ue])&&(K[ue]=ae,$[ue]=ie)}}return{startT:F,buildEnd:Y,els:Z,frame:H,cellQ:K,cellEl:$,inFrame:J}},R=()=>{const F=i.getBoundingClientRect();d=Math.max(1,F.width),h=Math.max(1,F.height);const N=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*N),i.height=Math.round(h*N),a.setTransform(N,0,0,N,0,0);const G=Math.max(8,Math.round(d/vp)),Z=Math.max(6,Math.round(h/vp));p=d/G,m=h/Z,c=[];for(let Y=0;Y<Z;Y++){const B=Z>1?Y/(Z-1):.5,K=CK*(1+kK*.4*(B*2-1));for(let $=0;$<G;$++){const J=Y*8191+$*131+1,H={x:($+.5)*p,y:(Y+.5)*m,size:K,seed:J,phase:yp(J),kind:0};H.kind=Math.floor(yp(J*97)*3),c.push(H)}}x=null,y=null},L=new Float32Array(32),O=F=>{a.fillStyle=bK,a.fillRect(0,0,d,h),y||(y=k(F+.2)),F>=y.startT+y.buildEnd+PK&&(x=y,_=F,y=k(F+.2));let N=0;x&&(N=1-Up((F-_)/TK),N<=0&&(x=null));const G=y;for(let H=0;H<G.els.length;H++){const j=G.els[H];L[H]=Up(Math.min(1,Math.max(0,(F-G.startT-j.start)/j.dur)))}const Z=L[0],Y=T(0),B=T(Z),K=N>0?T(N):Y,$=N>0?T(Math.max(Z,N)):B,J=c.length;for(let H=0;H<J;H++){const j=c[H];let X=0,te=0;const ie=H*Wa;for(let be=ie;be<ie+Wa;be++){const Fe=G.cellEl[be];if(Fe<0)break;const Re=G.cellQ[be]*L[Fe];Re>X&&(X=Re,te=G.els[Fe].level)}if(x)for(let be=ie;be<ie+Wa;be++){const Fe=x.cellEl[be];if(Fe<0)break;const Re=x.cellQ[be]*N;Re>X&&(X=Re,te=x.els[Fe].level)}const ae=F/SK+j.phase,ue=Math.floor(ae),Se=ae-ue,oe=Up(Math.min(Se,1-Se)/EK),se=Math.floor(yp(j.seed*97+ue*7919)*3);se!==j.kind&&X<.02&&oe<.05&&(j.kind=se);const ye=Math.max(oe*(1-X),X);if(!(ye<.01))if(X<.02){const be=G.inFrame[H]===1,Fe=x?x.inFrame[H]===1:!1;be?a.fillStyle=Fe?$:B:a.fillStyle=Fe?K:Y;const Re=Math.max(be?Z:0,Fe?N:0);Uk(a,j.kind,j.x,j.y,j.size*ye*(1-.2*Re))}else{a.fillStyle=P(X);const be=1+(AK[te]-1)*X;Uk(a,j.kind,j.x,j.y,j.size*ye*be)}}};R();let A=0;if(u)y=k(-100),O(0);else{const F=performance.now(),N=G=>{O((G-F)/1e3),A=requestAnimationFrame(N)};A=requestAnimationFrame(N)}const M=new ResizeObserver(()=>{R(),u&&(y=k(-100),O(0))});M.observe(i),r.current=()=>{cancelAnimationFrame(A),M.disconnect(),e&&n(F=>F-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},NK=async(t=null)=>{if(t)return jK(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return _p();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return _p()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:_p()},aA=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},jK=t=>aA(t),_p=()=>aA("/"),P1=ks("usePreviewUpstreamHealth"),FK=500,VK=4e3,$K=15e3,HK=3,zK=(t,e={})=>{const n=g.useRef(null),r=g.useRef(null),s=e.probeMsWhileDown??FK,i=e.probeMsWhileUp??VK,a=e.firstUnreachableCaptureAfterMs??$K,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,d=e.skip??!1,h=g.useRef(e.onPersistentUpstreamServerErrors);h.current=e.onPersistentUpstreamServerErrors;const[p,m]=g.useState(t==="static"),[y,x]=g.useState(0),[_,w]=g.useState(null),[E,P]=g.useState(0),[T,k]=g.useState(!1),[R,L]=g.useState(!1),[O,A]=g.useState(t==="static"?null:"upstream_unreachable");return g.useEffect(()=>{if(t==="static"){m(!0),w(null),P(0),k(!1),L(!0),A(null);return}if(d){m(!1),w(null),P(0),k(!1),L(!0),A("upstream_unreachable"),n.current=null;return}let M=!0;const D=Date.now();w(D),P(0),k(!1),m(!1),L(!1),A("upstream_unreachable");const F={current:!1},N={current:!1},G={current:!1},Z={current:null},Y={current:!1},B={current:!1},K={current:0},$={current:!1},J={current:null};let H=null;const j=()=>{G.current||(G.current=!0,M&&L(!0))},X=()=>{H!==null&&(clearTimeout(H),H=null)},te=(ae,ue)=>{X(),H=setTimeout(ue,ae)},ie=async()=>{var Re;if(!M)return;P(We=>We+1);const{isOk:ae,unavailableReason:ue,upstreamStatus:Se}=await NK(c);if(!M)return;j(),J.current=Se;const oe=ae&&Se!==null&&Se>=500;oe&&B.current?K.current+=1:ae&&!oe&&(K.current=0);const se=K.current>=HK;if(se&&!$.current&&Se!==null&&($.current=!0,Ce==null||Ce.capture("preview_upstream_error_responses",{framework:t,upstream_status:Se,consecutive_count:K.current}),P1.warn(`Preview upstream is listening but has served ${K.current} consecutive ${Se} responses`),(Re=h.current)==null||Re.call(h,{upstreamStatus:Se,consecutiveCount:K.current})),ae&&!se){oe||(B.current=!0,$.current=!1);const We=!Y.current;Y.current=!0,m(!0),A(null),Z.current=null,N.current=!1,k(!1),F.current?We&&(Ce==null||Ce.capture("preview_upstream_restored",{framework:t})):(F.current=!0,Ce==null||Ce.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),te(i,ie);return}const be=Y.current;Y.current=!1,m(!1),A(ue),Z.current===null&&(Z.current=Date.now(),N.current=!1,k(!1)),be&&(Ce==null||Ce.capture("preview_upstream_lost",{framework:t,upstream_status:Se}),x(We=>We+1),P1.warn("Preview upstream became unavailable after it was ready"));const Fe=Date.now()-Z.current;Fe>=a&&!N.current&&(N.current=!0,k(!0),Ce==null||Ce.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Fe,upstream_status:J.current}),P1.warn("Dev server did not become ready within timeout window")),te(s,ie)};return n.current=()=>te(0,ie),te(0,ie),()=>{M=!1,n.current=null,X()}},[t,s,i,a,c,d]),g.useEffect(()=>{var D;if(t==="static"||u===void 0)return;const M=r.current;r.current=u,M!==null&&M!==u&&((D=n.current)==null||D.call(n))},[t,u]),{isUpstreamReady:p,iframeRemountKey:y,probeStartedAt:_,probeAttemptCount:E,isFirstUnreachableWindowExceeded:T,initialProbeComplete:R,unavailableReason:O}};function UK(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const lA=t=>{var e;return t!=="embedded"||typeof window>"u"?"":((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.previewOrigin)??`${window.location.protocol}//localhost:${window.location.port}`},uA=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${lA(t)}${e}`:e,BK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",WK=t=>BK,GK=ks("PreviewSurface"),Bk=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",cA=({target:t,src:e,framework:n,remountKey:r})=>(Je(m0),S.jsx("div",{className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:WK(),onLoad:()=>{Ce==null||Ce.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Ce==null||Ce.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Bk(e,t),framework:n}))},onError:()=>{Ce==null||Ce.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Ce==null||Ce.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Bk(e,t),framework:n})),GK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),KK="modulepreload",qK=function(t){return"/"+t},Wk={},ZK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=a(n.map(d=>{if(d=qK(d),d in Wk)return;Wk[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":KK,h||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),h)return new Promise((y,x)=>{m.addEventListener("load",y),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return s.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return e().catch(i)})},YK=g.lazy(()=>ZK(()=>Promise.resolve().then(()=>TZ),void 0)),XK={surface:"relative flex h-full w-full items-center justify-center bg-main px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-main/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-main px-6"},QK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},JK={neutral:"rounded-md border border-divider bg-transparent px-5 py-2 text-sm font-medium text-content transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-content-muted transition-colors hover:text-content"},Md=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:d,role:h="status",busy:p=!1,className:m=""})=>{const y=g.useCallback(_=>{_&&d&&(Ce==null||Ce.capture("status_surface_shown",{state:d,tone:i,fill:a}))},[d,i,a]),x=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:y,className:`${XK[a]} ${m}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,x?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:QK[u],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:JK[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},K_=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Md,{...r,size:n,busy:!0,backdrop:S.jsx(oA,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Md,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(YK,{className:"absolute inset-0"})})}):S.jsx(Md,{...r,size:n,busy:!0,media:S.jsx(p0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),dA=({icon:t,...e})=>S.jsx(Md,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Bm=t=>S.jsx(Md,{...t,tone:"error",role:"alert"}),Gk="/static/",eq=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(Gk)}catch{return t.endsWith(Gk)}},tq=({isInteractionDisabled:t=!1,framework:e,userPort:n,activeDemoSessionId:r=null,holdPreviewNavigation:s=!1})=>{const i=Je(D_),a=ot(D_),u=Je(Fm),c=ot(Fm),d=Je(Rf),h=Je(m0),p=Je(N_),m=Je(j_),y=Je(l5),x=Je(u5),_=ot(j_),w=Je(lo),E=Je(V_),P=ot(N_),T=d.active&&d.projectContext.kind==="fresh",k=Je(F_),R=d.active?d.variants.find(Ee=>Ee.workItemId===k&&(Ee.status==="pending"||Ee.status==="running"||Ee.status==="succeeded"&&!Ee.preview&&typeof Ee.port!="number"&&(!Ee.previewUnavailable||Ee.previewUnavailable.reason==="idle_timeout")))??null:null,L=d.active&&d.variants.some(Ee=>Ee.status==="pending"||Ee.status==="running"),O=T||L,A=d.active?d.variants.find(Ee=>{var Xe;return Ee.workItemId===k&&Ee.status==="succeeded"&&!!Ee.previewUnavailable&&((Xe=Ee.previewUnavailable)==null?void 0:Xe.reason)!=="idle_timeout"})??null:null,M=e==="static"&&u!==null&&eq(u);g.useEffect(()=>{d.active||P(!1)},[d.active,P]);const D=g.useRef(!1);g.useEffect(()=>{const Ee=!!(w!=null&&w.left||w!=null&&w.right),Xe=Ee&&!D.current;D.current=Ee;const vt=d.active?d.sessionId:null;!vt||!UK({enteringSplit:Xe,isExistingSession:d.active&&d.projectContext.kind==="existing",hasActiveVariantProxy:p&&m!==null})||(P(!1),_(null),a(Ge=>Ge+1),fetch(`/api/variants/${encodeURIComponent(vt)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,d,p,m,P,_,a]);const N=g.useMemo(()=>{var tr;if(p||u&&!M||!d.active)return null;const{stage:Ee,variants:Xe}=d,vt=Ee==="ready"||Ee==="degraded",Ge=Xe.some(vn=>{var Bt,ss;return((Bt=vn.refinement)==null?void 0:Bt.status)==="pending"||((ss=vn.refinement)==null?void 0:ss.status)==="running"});if(!vt&&!Ge)return null;const at=Xe.find(vn=>{var Bt;return vn.status==="succeeded"&&((Bt=vn.preview)==null?void 0:Bt.kind)==="static_artifact"});return((tr=at==null?void 0:at.preview)==null?void 0:tr.kind)==="static_artifact"?at.preview.url:null},[M,u,p,d])??u,G=g.useMemo(()=>!d.active||!N?null:d.variants.find(Ee=>{var Xe;return((Xe=Ee.preview)==null?void 0:Xe.kind)==="static_artifact"&&N.startsWith(Ee.preview.url)})??null,[N,d]),Z=g.useMemo(()=>{if((E==null?void 0:E.previewKind)==="static")return{kind:"variant",sessionId:E.sessionId,variantId:E.variantId};if(!d.active)return jm;if(G)return{kind:"variant",sessionId:d.sessionId,variantId:G.workItemId};if(N){const Xe=N.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),vt=Xe!=null&&Xe[1]?decodeURIComponent(Xe[1]):null,Ge=Xe!=null&&Xe[2]?decodeURIComponent(Xe[2]):null;if(vt===d.sessionId&&Ge&&d.variants.some(vn=>vn.workItemId===Ge))return{kind:"variant",sessionId:d.sessionId,variantId:Ge};const at=N.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),tr=at!=null&&at[1]?decodeURIComponent(at[1]):null;if(tr&&d.variants.some(vn=>vn.workItemId===tr))return{kind:"variant",sessionId:d.sessionId,variantId:tr}}const Ee=!!(w!=null&&w.left||w!=null&&w.right);return(!Ee||T)&&!N&&p&&m&&d.variants.some(Xe=>Xe.workItemId===m)?{kind:"variant",sessionId:d.sessionId,variantId:m}:(!Ee||T)&&!N&&k&&d.variants.some(Xe=>Xe.workItemId===k)?{kind:"variant",sessionId:d.sessionId,variantId:k}:jm},[E,G,d,p,m,N,w,T,k]),Y=g.useRef(null);g.useEffect(()=>{var Ge,at;if(!G||((Ge=G.preview)==null?void 0:Ge.kind)!=="static_artifact"||((at=G.refinement)==null?void 0:at.status)!=="succeeded")return;const Ee=`${G.workItemId}:${G.refinement.workItemId}`;if(Y.current===Ee)return;Y.current=Ee;const Xe=G.preview.url.includes("?")?"&":"?",vt=`${G.preview.url}${Xe}refinement=${encodeURIComponent(G.refinement.workItemId)}`;N!==vt&&(c(vt),a(tr=>tr+1))},[N,G,a,c,d]);const B=N!==null&&CG(N),K=N!==null&&!B||T&&!p&&!B,{isUpstreamReady:$,iframeRemountKey:J,probeAttemptCount:H,initialProbeComplete:j}=zK(e,{rerunProbeImmediatelyOnVersion:i,probePath:B?N:null,skip:K}),[X,te]=g.useState(()=>y&&$?i:null),ie=g.useRef(null);g.useEffect(()=>{if(!y){ie.current=null,te(null);return}if(X===i){ie.current=null;return}const Ee=ie.current;if(!Ee||Ee.remountKey!==i){ie.current={remountKey:i,probeAttemptCount:H};return}$&&H>Ee.probeAttemptCount&&(ie.current=null,te(i))},[X,i,y,H,$]);const ue=N!==null&&!B||$,oe=x||y&&X!==i||y&&!ue,se=`${J}:${i}`,ye=r?`/try/${encodeURIComponent(r)}`:"",be=tA(window.location.pathname),Fe=e==="static"?`${ye}/static${be??"/"}`:`${ye}${be??"/"}`,Re=lA(h);let We=null;N&&(We=uA({agentApplyMode:h,url:N}));const Ye=R||oe?"about:blank":(B&&!ue?"about:blank":We)??(s||!ue?"about:blank":`${Re}${Fe}`),we=!!R||!!A||!ue&&j;let It=null;return oe?It=S.jsx(K_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):R?It=S.jsx(K_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})}):A?It=S.jsx(Bm,{fill:"overlay",state:"preview_unavailable",title:"Preview couldn’t start",description:"Its preview server didn’t start.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}):we&&(It=O?S.jsx(dA,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Bm,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),S.jsxs("div",{className:"relative h-full w-full",children:[It,S.jsx(cA,{target:Z,src:Ye,framework:e,remountKey:se})]})};function Kk({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var k;const u=Je(lo),c=ot(lo),d=Je(fc),h=i0(),p=Je(Rf),m=Je(m0),y=g.useRef(!1),x=g.useCallback(()=>{y.current||(y.current=!0,lf({source:i,sessionId:e,variantId:n}))},[i,e,n]),_=g.useCallback(()=>{if(a){if(c(null),!d){const O=Um("ended",u);h==null||h.capture(O.event,O.properties)}return}x();const R={...u};delete R[t];const L=R.left||R.right?R:null;if(c(L),!d){const O=Um(L?"updated":"ended",L??u);h==null||h.capture(O.event,O.properties)}},[a,d,h,c,t,u,x]),w=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),E=g.useMemo(()=>!p.active||p.sessionId!==e?null:p.variants.find(R=>R.workItemId===n)??null,[e,n,p]),P=g.useMemo(()=>{var L,O;let R=r;if(((L=E==null?void 0:E.preview)==null?void 0:L.kind)==="static_artifact"&&((O=E.refinement)==null?void 0:O.status)==="succeeded"){const A=E.preview.url.includes("?")?"&":"?";R=`${E.preview.url}${A}refinement=${encodeURIComponent(E.refinement.workItemId)}`}return uA({agentApplyMode:m,url:R})},[m,E,r]),T=((k=E==null?void 0:E.refinement)==null?void 0:k.status)==="succeeded"?`${n}:${E.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(to,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:_,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(cA,{target:w,src:P,framework:"static",remountKey:T})})]})}const qk=240;function nq(){const t=Je(nf),e=Je(Dx),n=g.useRef(null);return g.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-qk/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:S.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:qk},children:S.jsxs("div",{className:"variant-drag-ghost-body",children:[S.jsxs("div",{className:"variant-drag-ghost-row",children:[S.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?S.jsx("div",{className:"variant-drag-ghost-tag",style:XR(t.runLabel),children:t.runLabel}):null]}),t.description?S.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function rq(){const t=Je(nf),e=Je(Dx),n=Je(lo),r=Je(fc),s=ot(nf),i=ot(lo),a=i0(),u=g.useRef(null),[c,d]=g.useState(null),[h,p]=g.useState("hidden");g.useEffect(()=>{if(!t){p("hidden"),d(null);return}const x=requestAnimationFrame(()=>p("visible"));return()=>cancelAnimationFrame(x)},[t]);const m=g.useCallback((x,_)=>{const w=u.current;if(!w)return null;const E=w.getBoundingClientRect();return x<E.left||x>E.right||_<E.top||_>E.bottom?null:x<(E.left+E.right)/2?"left":"right"},[]);if(g.useEffect(()=>{if(!t||!e)return;const x=m(e.x,e.y);d(_=>_===x?_:x)},[t,e,m]),g.useEffect(()=>{if(!t)return;const x=_=>{const w=m(_.clientX,_.clientY);if(w&&t.url){const E={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},P=n==null?void 0:n[w];P&&(P.sessionId!==E.sessionId||P.variantId!==E.variantId)&&lf(P);const T={...n??{},[w]:E};if(i(T),!r){const k=Um(n?"updated":"started",T);a==null||a.capture(k.event,k.properties)}p("exiting"),window.setTimeout(()=>s(null),220)}else lf(t),p("exiting"),window.setTimeout(()=>s(null),220)};return window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x),()=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x)}},[t,m,r,a,s,i,n]),!t)return null;const y=["variant-drop-zones",h==="visible"&&"is-visible",h==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:u,className:y,"aria-hidden":"true",children:[S.jsx(Zk,{side:"left",hovered:c==="left",canDrop:!!t.url,label:t.label}),S.jsx(Zk,{side:"right",hovered:c==="right",canDrop:!!t.url,label:t.label})]})}function Zk({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const fA=(t,e,n)=>{var i,a;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(u=>u.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((a=r.refinement)==null?void 0:a.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},Yk=(t,e)=>{if(!t)return;const n=fA(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},sq=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(oA,{trackGlobalLoaderCount:!1})})}),iq=({isLoading:t=!1,isInteractionDisabled:e=!1,activeDemoSessionId:n=null,holdHostedTryoutPreviewNavigation:r=!1})=>{const{config:s,fetchConfig:i,isLoading:a,error:u}=wK();return g.useEffect(()=>{i().catch(c=>{Ce==null||Ce.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})},[i]),a?r?S.jsx("div",{className:"bg-main flex h-full min-h-0 w-full flex-1","aria-busy":"true"}):S.jsx(sq,{}):u||!s?S.jsx(Bm,{fill:"surface",size:"sm",state:"preview_config_error",title:"Couldn't load preview",description:"We couldn't load the preview configuration.",actions:[{label:"Retry",onClick:()=>{Ce==null||Ce.capture("preview_config_retry_clicked"),i().catch(c=>{Ce==null||Ce.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})}}]}):S.jsx(oq,{isLoading:t,isInteractionDisabled:e,framework:s.framework,userPort:s.userPort,activeDemoSessionId:n,holdHostedTryoutPreviewNavigation:r})};function oq(t){const e=Je(lo),n=Je(nf),r=Je(Rf),s=Je(Fm),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=g.useMemo(()=>{var R,L;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const _=(R=i??a)==null?void 0:R.variantId,w=r.variants.filter(O=>{var A;return O.status==="succeeded"&&((A=O.preview)==null?void 0:A.kind)==="static_artifact"&&O.workItemId!==_}),E=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),T=w.find(O=>{var A;return((A=O.preview)==null?void 0:A.kind)==="static_artifact"&&O.preview.url===E})??w[0];if(((L=T==null?void 0:T.preview)==null?void 0:L.kind)!=="static_artifact")return;const k=fA(r,r.sessionId,T.workItemId);if(k)return{sessionId:r.sessionId,variantId:T.workItemId,label:T.label,url:k,source:"live"}},[r,i,a,s]),c=Yk(i,r)??(a?u:void 0),d=Yk(a,r)??(i?u:void 0),h=!i&&!!c,p=!a&&!!d,m=!!(c||d),y=S.jsx(tq,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort,activeDemoSessionId:t.activeDemoSessionId,holdPreviewNavigation:t.holdHostedTryoutPreviewNavigation});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(Kk,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:h},`left-${c.sessionId}:${c.variantId}:${c.url}`),!(c&&d)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:y}),d&&S.jsx(Kk,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(rq,{}),S.jsx(nq,{})]})})}const hA=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(p0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]});function Gi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
115
- * GSAP 3.15.0
116
- * https://gsap.com
117
- *
118
- * @license Copyright 2008-2026, GreenSock. All rights reserved.
119
- * Subject to the terms at https://gsap.com/standard-license
120
- * @author: Jack Doyle, jack@greensock.com
121
- */var es={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},uf={duration:.5,overwrite:!1,delay:0},Jx,zn,Ut,bs=1e8,Ct=1/bs,q_=Math.PI*2,aq=q_/4,lq=0,mA=Math.sqrt,uq=Math.cos,cq=Math.sin,In=function(e){return typeof e=="string"},nn=function(e){return typeof e=="function"},co=function(e){return typeof e=="number"},ew=function(e){return typeof e>"u"},xi=function(e){return typeof e=="object"},Mr=function(e){return e!==!1},tw=function(){return typeof window<"u"},xp=function(e){return nn(e)||In(e)},gA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},er=Array.isArray,dq=/random\([^)]+\)/g,fq=/,\s*/g,Xk=/(?:-?\.?\d|\.)+/gi,vA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Eu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,T1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,yA=/[+-]=-?[.\d]+/,hq=/[^,'"\[\]\s]+/gi,pq=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Zt,oi,Z_,nw,ns={},Wm={},_A,xA=function(e){return(Wm=rc(e,ns))&&Nr},rw=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},cf=function(e,n){return!n&&console.warn(e)},wA=function(e,n){return e&&(ns[e]=n)&&Wm&&(Wm[e]=n)||ns},df=function(){return 0},mq={suppressEvents:!0,isStart:!0,kill:!1},Bp={suppressEvents:!0,kill:!1},gq={suppressEvents:!0},sw={},ta=[],Y_={},bA,Kr={},R1={},Qk=30,Wp=[],iw="",ow=function(e){var n=e[0],r,s;if(xi(n)||nn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Wp.length;s--&&!Wp[s].targetTest(n););r=Wp[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new BA(e[s],r)))||e.splice(s,1);return e},xl=function(e){return e._gsap||ow(Ss(e))[0]._gsap},SA=function(e,n,r){return(r=e[n])&&nn(r)?e[n]():ew(r)&&e.getAttribute&&e.getAttribute(n)||r},Or=function(e,n){return(e=e.split(",")).forEach(n)||e},an=function(e){return Math.round(e*1e5)/1e5||0},qt=function(e){return Math.round(e*1e7)/1e7||0},Mu=function(e,n){var r=n.charAt(0),s=parseFloat(n.substr(2));return e=parseFloat(e),r==="+"?e+s:r==="-"?e-s:r==="*"?e*s:e/s},vq=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Gm=function(){var e=ta.length,n=ta.slice(0),r,s;for(Y_={},ta.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},aw=function(e){return!!(e._initted||e._startAt||e.add)},EA=function(e,n,r,s){ta.length&&!zn&&Gm(),e.render(n,r,!!(zn&&n<0&&aw(e))),ta.length&&!zn&&Gm()},CA=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(hq).length<2?n:In(e)?e.trim():e},kA=function(e){return e},rs=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},yq=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},rc=function(e,n){for(var r in n)e[r]=n[r];return e},Jk=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=xi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Km=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Od=function(e){var n=e.parent||Zt,r=e.keyframes?yq(er(e.keyframes)):rs;if(Mr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},_q=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},PA=function(e,n,r,s,i){var a=e[s],u;if(i)for(u=n[i];a&&a[i]>u;)a=a._prev;return a?(n._next=a._next,a._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=a,n.parent=n._dp=e,n},C0=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,a=n._next;i?i._next=a:e[r]===n&&(e[r]=a),a?a._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},ca=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},wl=function(e,n){if(e&&(!n||n._end>e._dur||n._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},xq=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},X_=function(e,n,r,s){return e._startAt&&(zn?e._startAt.revert(Bp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},wq=function t(e){return!e||e._ts&&t(e.parent)},e8=function(e){return e._repeat?sc(e._tTime,e=e.duration()+e._rDelay)*e:0},sc=function(e,n){var r=Math.floor(e=qt(e/n));return e&&r===e?r-1:r},qm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},k0=function(e){return e._end=qt(e._start+(e._tDur/Math.abs(e._ts||e._rts||Ct)||0))},P0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=qt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),k0(e),r._dirty||wl(r,e)),e},TA=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=qm(e.rawTime(),n),(!n._dur||Mf(0,n.totalDuration(),r)-n._tTime>Ct)&&n.render(r,!0)),wl(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-Ct}},fi=function(e,n,r,s){return n.parent&&ca(n),n._start=qt((co(r)?r:r||e!==Zt?vs(e,r,n):e._time)+n._delay),n._end=qt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),PA(e,n,"_first","_last",e._sort?"_start":0),Q_(n)||(e._recent=n),s||TA(e,n),e._ts<0&&P0(e,e._tTime),e},RA=function(e,n){return(ns.ScrollTrigger||rw("scrollTrigger",n))&&ns.ScrollTrigger.create(n,e)},AA=function(e,n,r,s,i){if(uw(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!zn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&bA!==qr.frame)return ta.push(e),e._lazy=[i,s],1},bq=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},Q_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},Sq=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&bq(e)&&!(!e._initted&&Q_(e))||(e._ts<0||e._dp._ts<0)&&!Q_(e))?0:1,u=e._rDelay,c=0,d,h,p;if(u&&e._repeat&&(c=Mf(0,e._tDur,n),h=sc(c,u),e._yoyo&&h&1&&(a=1-a),h!==sc(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||zn||s||e._zTime===Ct||!n&&e._zTime){if(!e._initted&&AA(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?Ct:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,d=e._pt;d;)d.r(a,d.d),d=d._next;n<0&&X_(e,n,r,!0),e._onUpdate&&!r&&Yr(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&Yr(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&ca(e,1),!r&&!zn&&(Yr(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},Eq=function(e,n,r){var s;if(r>n)for(s=e._first;s&&s._start<=r;){if(s.data==="isPause"&&s._start>n)return s;s=s._next}else for(s=e._last;s&&s._start>=r;){if(s.data==="isPause"&&s._start<n)return s;s=s._prev}},ic=function(e,n,r,s){var i=e._repeat,a=qt(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:qt(a*(i+1)+e._rDelay*i):a,u>0&&!s&&P0(e,e._tTime=e._tDur*u),e.parent&&k0(e),r||wl(e.parent,e),e},t8=function(e){return e instanceof Tr?wl(e):ic(e,e._dur)},Cq={_start:0,endTime:df,totalDuration:df},vs=function t(e,n,r){var s=e.labels,i=e._recent||Cq,a=e.duration()>=bs?i.endTime(!1):e._dur,u,c,d;return In(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),d=n.substr(-1)==="%",u=n.indexOf("="),c==="<"||c===">"?(u>=0&&(n=n.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(u<0?i:r).totalDuration()/100:1)):u<0?(n in s||(s[n]=a),s[n]):(c=parseFloat(n.charAt(u-1)+n.substr(u+1)),d&&r&&(c=c/100*(er(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},Ld=function(e,n,r){var s=co(n[1]),i=(s?2:1)+(e<2?0:1),a=n[i],u,c;if(s&&(a.duration=n[1]),a.parent=r,e){for(u=a,c=r;c&&!("immediateRender"in u);)u=c.vars.defaults||{},c=Mr(c.vars.inherit)&&c.parent;a.immediateRender=Mr(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new gn(n[0],a,n[i+1])},_a=function(e,n){return e||e===0?n(e):n},Mf=function(e,n,r){return r<e?e:r>n?n:r},Qn=function(e,n){return!In(e)||!(n=pq.exec(e))?"":n[1]},kq=function(e,n,r){return _a(r,function(s){return Mf(e,n,s)})},J_=[].slice,IA=function(e,n){return e&&xi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&xi(e[0]))&&!e.nodeType&&e!==oi},Pq=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return In(s)&&!n||IA(s,1)?(i=r).push.apply(i,Ss(s)):r.push(s)})||r},Ss=function(e,n,r){return Ut&&!n&&Ut.selector?Ut.selector(e):In(e)&&!r&&(Z_||!oc())?J_.call((n||nw).querySelectorAll(e),0):er(e)?Pq(e,r):IA(e)?J_.call(e,0):e?[e]:[]},e2=function(e){return e=Ss(e)[0]||cf("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Ss(n,r.querySelectorAll?r:r===e?cf("Invalid scope")||nw.createElement("div"):e)}},MA=function(e){return e.sort(function(){return .5-Math.random()})},OA=function(e){if(nn(e))return e;var n=xi(e)?e:{each:e},r=bl(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,d=n.axis,h=s,p=s;return In(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(h=s[0],p=s[1]),function(m,y,x){var _=(x||n).length,w=a[_],E,P,T,k,R,L,O,A,M;if(!w){if(M=n.grid==="auto"?0:(n.grid||[1,bs])[1],!M){for(O=-bs;O<(O=x[M++].getBoundingClientRect().left)&&M<_;);M<_&&M--}for(w=a[_]=[],E=c?Math.min(M,_)*h-.5:s%M,P=M===bs?0:c?_*p/M-.5:s/M|0,O=0,A=bs,L=0;L<_;L++)T=L%M-E,k=P-(L/M|0),w[L]=R=d?Math.abs(d==="y"?k:T):mA(T*T+k*k),R>O&&(O=R),R<A&&(A=R);s==="random"&&MA(w),w.max=O-A,w.min=A,w.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(M>_?_-1:d?d==="y"?_/M:M:Math.max(M,_/M))||0)*(s==="edges"?-1:1),w.b=_<0?i-_:i,w.u=Qn(n.amount||n.each)||0,r=r&&_<0?$q(r):r}return _=(w[m]-w.min)/w.max||0,qt(w.b+(r?r(_):_)*w.v)+w.u}},t2=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=qt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(co(r)?0:Qn(r))}},LA=function(e,n){var r=er(e),s,i;return!r&&xi(e)&&(s=r=e.radius||bs,e.values?(e=Ss(e.values),(i=!co(e[0]))&&(s*=s)):e=t2(e.increment)),_a(n,r?nn(e)?function(a){return i=e(a),Math.abs(i-a)<=s?i:a}:function(a){for(var u=parseFloat(i?a.x:a),c=parseFloat(i?a.y:0),d=bs,h=0,p=e.length,m,y;p--;)i?(m=e[p].x-u,y=e[p].y-c,m=m*m+y*y):m=Math.abs(e[p]-u),m<d&&(d=m,h=p);return h=!s||d<=s?e[h]:a,i||h===a||co(a)?h:h+Qn(a)}:t2(e))},DA=function(e,n,r,s){return _a(er(e)?!n:r===!0?!!(r=0):!s,function(){return er(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(s=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(n-e+r*.99))/r)*r*s)/s})},Tq=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,a){return a(i)},s)}},Rq=function(e,n){return function(r){return e(parseFloat(r))+(n||Qn(r))}},Aq=function(e,n,r){return jA(e,n,0,1,r)},NA=function(e,n,r){return _a(r,function(s){return e[~~n(s)]})},Iq=function t(e,n,r){var s=n-e;return er(e)?NA(e,t(0,e.length),n):_a(r,function(i){return(s+(i-e)%s)%s+e})},Mq=function t(e,n,r){var s=n-e,i=s*2;return er(e)?NA(e,t(0,e.length-1),n):_a(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},ff=function(e){return e.replace(dq,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(fq);return DA(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},jA=function(e,n,r,s,i){var a=n-e,u=s-r;return _a(i,function(c){return r+((c-e)/a*u||0)})},Oq=function t(e,n,r,s){var i=isNaN(e+n)?0:function(y){return(1-y)*e+y*n};if(!i){var a=In(e),u={},c,d,h,p,m;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(er(e)&&!er(n)){for(h=[],p=e.length,m=p-2,d=1;d<p;d++)h.push(t(e[d-1],e[d]));p--,i=function(x){x*=p;var _=Math.min(m,~~x);return h[_](x-_)},r=n}else s||(e=rc(er(e)?[]:{},e));if(!h){for(c in n)lw.call(u,e,c,"get",n[c]);i=function(x){return fw(x,u)||(a?e.p:e)}}}return _a(r,i)},n8=function(e,n,r){var s=e.labels,i=bs,a,u,c;for(a in s)u=s[a]-n,u<0==!!r&&u&&i>(u=Math.abs(u))&&(c=a,i=u);return c},Yr=function(e,n,r){var s=e.vars,i=s[n],a=Ut,u=e._ctx,c,d,h;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&ta.length&&Gm(),u&&(Ut=u),h=c?i.apply(d,c):i.call(d),Ut=a,h},_d=function(e){return ca(e),e.scrollTrigger&&e.scrollTrigger.kill(!!zn),e.progress()<1&&Yr(e,"onInterrupt"),e},Cu,FA=[],VA=function(e){if(e)if(e=!e.name&&e.default||e,tw()||e.headless){var n=e.name,r=nn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:df,render:fw,add:lw,kill:Yq,modifier:Zq,rawVars:0},a={targetTest:0,get:0,getSetter:dw,aliases:{},register:0};if(oc(),e!==s){if(Kr[n])return;rs(s,rs(Km(e,i),a)),rc(s.prototype,rc(i,Km(e,a))),Kr[s.prop=n]=s,e.targetTest&&(Wp.push(s),sw[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}wA(n,s),e.register&&e.register(Nr,s,Lr)}else FA.push(e)},St=255,xd={aqua:[0,St,St],lime:[0,St,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,St],navy:[0,0,128],white:[St,St,St],olive:[128,128,0],yellow:[St,St,0],orange:[St,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[St,0,0],pink:[St,192,203],cyan:[0,St,St],transparent:[St,St,St,0]},A1=function(e,n,r){return e+=e<0?1:e>1?-1:0,(e*6<1?n+(r-n)*e*6:e<.5?r:e*3<2?n+(r-n)*(2/3-e)*6:n)*St+.5|0},$A=function(e,n,r){var s=e?co(e)?[e>>16,e>>8&St,e&St]:0:xd.black,i,a,u,c,d,h,p,m,y,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),xd[e])s=xd[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),u=e.charAt(3),e="#"+i+i+a+a+u+u+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&St,s&St,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&St,e&St]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(Xk),!n)c=+s[0]%360/360,d=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(d+1):h+d-h*d,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=A1(c+1/3,i,a),s[1]=A1(c,i,a),s[2]=A1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match(vA),r&&s.length<4&&(s[3]=1),s}else s=e.match(Xk)||xd.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/St,a=s[1]/St,u=s[2]/St,p=Math.max(i,a,u),m=Math.min(i,a,u),h=(p+m)/2,p===m?c=d=0:(y=p-m,d=h>.5?y/(2-p-m):y/(p+m),c=p===i?(a-u)/y+(a<u?6:0):p===a?(u-i)/y+2:(i-a)/y+4,c*=60),s[0]=~~(c+.5),s[1]=~~(d*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},HA=function(e){var n=[],r=[],s=-1;return e.split(na).forEach(function(i){var a=i.match(Eu)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},r8=function(e,n,r){var s="",i=(e+s).match(na),a=n?"hsla(":"rgba(",u=0,c,d,h,p;if(!i)return e;if(i=i.map(function(m){return(m=$A(m,n,1))&&a+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(h=HA(e),c=r.c,c.join(s)!==h.c.join(s)))for(d=e.replace(na,"1").split(Eu),p=d.length-1;u<p;u++)s+=d[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!d)for(d=e.split(na),p=d.length-1;u<p;u++)s+=d[u]+i[u];return s+d[p]},na=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in xd)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),Lq=/hsl[a]?\(/,zA=function(e){var n=e.join(" "),r;if(na.lastIndex=0,na.test(n))return r=Lq.test(n),e[1]=r8(e[1],r),e[0]=r8(e[0],r,HA(e[1])),!0},hf,qr=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,d,h,p,m,y,x=function _(w){var E=t()-s,P=w===!0,T,k,R,L;if((E>e||E<0)&&(r+=E-n),s+=E,R=s-r,T=R-a,(T>0||P)&&(L=++p.frame,m=R-p.time*1e3,p.time=R=R/1e3,a+=T+(T>=i?4:i-T),k=1),P||(c=d(_)),k)for(y=0;y<u.length;y++)u[y](R,m,L,w)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(w){return m/(1e3/(w||60))},wake:function(){_A&&(!Z_&&tw()&&(oi=Z_=window,nw=oi.document||{},ns.gsap=Nr,(oi.gsapVersions||(oi.gsapVersions=[])).push(Nr.version),xA(Wm||oi.GreenSockGlobals||!oi.gsap&&oi||{}),FA.forEach(VA)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),d=h||function(w){return setTimeout(w,a-p.time*1e3+1|0)},hf=1,x(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(c),hf=0,d=df},lagSmoothing:function(w,E){e=w||1/0,n=Math.min(E||33,e)},fps:function(w){i=1e3/(w||240),a=p.time*1e3+i},add:function(w,E,P){var T=E?function(k,R,L,O){w(k,R,L,O),p.remove(T)}:w;return p.remove(w),u[P?"unshift":"push"](T),oc(),T},remove:function(w,E){~(E=u.indexOf(w))&&u.splice(E,1)&&y>=E&&y--},_listeners:u},p})(),oc=function(){return!hf&&qr.wake()},dt={},Dq=/^[\d.\-M][\d.\-,\s]/,Nq=/["']/g,jq=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,u,c,d;i<a;i++)c=r[i],u=i!==a-1?c.lastIndexOf(","):c.length,d=c.substr(0,u),n[s]=isNaN(d)?d.replace(Nq,"").trim():+d,s=c.substr(u+1).trim();return n},Fq=function(e){var n=e.indexOf("(")+1,r=e.indexOf(")"),s=e.indexOf("(",n);return e.substring(n,~s&&s<r?e.indexOf(")",r+1):r)},Vq=function(e){var n=(e+"").split("("),r=dt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[jq(n[1])]:Fq(e).split(",").map(CA)):dt._CE&&Dq.test(e)?dt._CE("",e):r},$q=function(e){return function(n){return 1-e(1-n)}},bl=function(e,n){return e&&(nn(e)?e:dt[e]||Vq(e))||n},Rl=function(e,n,r,s){r===void 0&&(r=function(c){return 1-n(1-c)}),s===void 0&&(s=function(c){return c<.5?n(c*2)/2:1-n((1-c)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},a;return Or(e,function(u){dt[u]=ns[u]=i,dt[a=u.toLowerCase()]=r;for(var c in i)dt[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=dt[u+"."+c]=i[c]}),i},UA=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},I1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/q_*(Math.asin(1/s)||0),u=function(h){return h===1?1:s*Math.pow(2,-10*h)*cq((h-a)*i)+1},c=e==="out"?u:e==="in"?function(d){return 1-u(1-d)}:UA(u);return i=q_/i,c.config=function(d,h){return t(e,d,h)},c},M1=function t(e,n){n===void 0&&(n=1.70158);var r=function(a){return a?--a*a*((n+1)*a+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:UA(r);return s.config=function(i){return t(e,i)},s};Or("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Rl(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});dt.Linear.easeNone=dt.none=dt.Linear.easeIn;Rl("Elastic",I1("in"),I1("out"),I1());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(u){return u<n?t*u*u:u<r?t*Math.pow(u-1.5/e,2)+.75:u<s?t*(u-=2.25/e)*u+.9375:t*Math.pow(u-2.625/e,2)+.984375};Rl("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);Rl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Rl("Circ",function(t){return-(mA(1-t*t)-1)});Rl("Sine",function(t){return t===1?1:-uq(t*aq)+1});Rl("Back",M1("in"),M1("out"),M1());dt.SteppedEase=dt.steps=ns.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,a=1-Ct;return function(u){return((s*Mf(0,a,u)|0)+i)*r}}};uf.ease=dt["quad.out"];Or("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return iw+=t+","+t+"Params,"});var BA=function(e,n){this.id=lq++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:SA,this.set=n?n.getSetter:dw},pf=(function(){function t(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,ic(this,+n.duration,1,1),this.data=n.data,Ut&&(this._ctx=Ut,Ut.data.push(this)),hf||qr.wake()}var e=t.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,ic(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(oc(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(P0(this,r),!i._dp||i.parent||TA(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&fi(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Ct||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),EA(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+e8(this))%(this._dur+this._rDelay)||(r?this._dur:0),s):this._time},e.totalProgress=function(r,s){return arguments.length?this.totalTime(this.totalDuration()*r,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+e8(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,s):this._repeat?sc(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-Ct?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?qm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Ct?0:this._rts,this.totalTime(Mf(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),k0(this),xq(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(oc(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ct&&(this._tTime-=Ct)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=qt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&fi(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Mr(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var s=this.parent||this._dp;return s?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?qm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=gq);var s=zn;return zn=r,aw(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),zn=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,t8(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,t8(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(vs(this,r),Mr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Mr(s)),this._dur||(this._zTime=-Ct),this},e.play=function(r,s){return r!=null&&this.seek(r,s),this.reversed(!1).paused(!1)},e.reverse=function(r,s){return r!=null&&this.seek(r||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(r,s){return r!=null&&this.seek(r,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Ct:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ct,this},e.isActive=function(){var r=this.parent||this._dp,s=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=s&&i<this.endTime(!0)-Ct)},e.eventCallback=function(r,s,i){var a=this.vars;return arguments.length>1?(s?(a[r]=s,i&&(a[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete a[r],this):a[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(a){var u=nn(r)?r:kA,c=function(){var h=s.then;s.then=null,i&&i(),nn(u)&&(u=u(s))&&(u.then||u===s)&&(s.then=h),a(u),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){_d(this)},t})();rs(pf.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Ct,_prom:0,_ps:!1,_rts:1});var Tr=(function(t){pA(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=Mr(r.sortChildren),Zt&&fi(r.parent||Zt,Gi(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&RA(Gi(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return Ld(0,arguments,this),this},n.from=function(s,i,a){return Ld(1,arguments,this),this},n.fromTo=function(s,i,a,u){return Ld(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,Od(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new gn(s,i,vs(this,a),1),this},n.call=function(s,i,a){return fi(this,gn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,d,h){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=d,a.onCompleteParams=h,a.parent=this,new gn(s,a,vs(this,c)),this},n.staggerFrom=function(s,i,a,u,c,d,h){return a.runBackwards=1,Od(a).immediateRender=Mr(a.immediateRender),this.staggerTo(s,i,a,u,c,d,h)},n.staggerFromTo=function(s,i,a,u,c,d,h,p){return u.startAt=a,Od(u).immediateRender=Mr(u.immediateRender),this.staggerTo(s,i,u,c,d,h,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,h=s<=0?0:qt(s),p=this._zTime<0!=s<0&&(this._initted||!d),m,y,x,_,w,E,P,T,k,R,L,O;if(this!==Zt&&h>c&&s>=0&&(h=c),h!==this._tTime||a||p){if(u!==this._time&&d&&(h+=this._time-u,s+=this._time-u),m=h,k=this._start,T=this._ts,E=!T,p&&(d||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(L=this._yoyo,w=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,a);if(m=qt(h%w),h===c?(_=this._repeat,m=d):(R=qt(h/w),_=~~R,_&&_===R&&(m=d,_--),m>d&&(m=d)),R=sc(this._tTime,w),!u&&this._tTime&&R!==_&&this._tTime-R*w-this._dur<=0&&(R=_),L&&_&1&&(m=d-m,O=1),_!==R&&!this._lock){var A=L&&R&1,M=A===(L&&_&1);if(_<R&&(A=!A),u=A?0:h%d?d:h,this._lock=1,this.render(u||(O?0:qt(_*w)),i,!d)._lock=0,this._tTime=h,!i&&this.parent&&Yr(this,"onRepeat"),this.vars.repeatRefresh&&!O&&(this.invalidate()._lock=1,R=_),u&&u!==this._time||E!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,M&&(this._lock=2,u=A?d:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!O&&this.invalidate()),this._lock=0,!this._ts&&!E)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(P=Eq(this,qt(u),qt(m)),P&&(h-=m-(m=P._start))),this._tTime=h,this._time=m,this._act=!!T,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&h&&d&&!i&&!R&&(Yr(this,"onStart"),this._tTime!==h))return this;if(m>=u&&s>=0)for(y=this._first;y;){if(x=y._next,(y._act||m>=y._start)&&y._ts&&P!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(m-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(m-y._start)*y._ts,i,a),m!==this._time||!this._ts&&!E){P=0,x&&(h+=this._zTime=-Ct);break}}y=x}else{y=this._last;for(var D=s<0?s:m;y;){if(x=y._prev,(y._act||D<=y._end)&&y._ts&&P!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(D-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(D-y._start)*y._ts,i,a||zn&&aw(y)),m!==this._time||!this._ts&&!E){P=0,x&&(h+=this._zTime=D?-Ct:Ct);break}}y=x}}if(P&&!i&&(this.pause(),P.render(m>=u?0:-Ct)._zTime=m>=u?1:-1,this._ts))return this._start=k,k0(this),this.render(s,i,a);this._onUpdate&&!i&&Yr(this,"onUpdate",!0),(h===c&&this._tTime>=this.totalDuration()||!h&&u)&&(k===this._start||Math.abs(T)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(h===c&&this._ts>0||!h&&this._ts<0)&&ca(this,1),!i&&!(s<0&&!u)&&(h||u||!c)&&(Yr(this,h===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var a=this;if(co(i)||(i=vs(this,i,s)),!(s instanceof pf)){if(er(s))return s.forEach(function(u){return a.add(u,i)}),this;if(In(s))return this.addLabel(s,i);if(nn(s))s=gn.delayedCall(0,s);else return this}return this!==s?fi(this,s,i):this},n.getChildren=function(s,i,a,u){s===void 0&&(s=!0),i===void 0&&(i=!0),a===void 0&&(a=!0),u===void 0&&(u=-bs);for(var c=[],d=this._first;d;)d._start>=u&&(d instanceof gn?i&&c.push(d):(a&&c.push(d),s&&c.push.apply(c,d.getChildren(!0,i,a)))),d=d._next;return c},n.getById=function(s){for(var i=this.getChildren(1,1,1),a=i.length;a--;)if(i[a].vars.id===s)return i[a]},n.remove=function(s){return In(s)?this.removeLabel(s):nn(s)?this.killTweensOf(s):(s.parent===this&&C0(this,s),s===this._recent&&(this._recent=this._last),wl(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=qt(qr.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},n.addLabel=function(s,i){return this.labels[s]=vs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=gn.delayedCall(0,i||df,a);return u.data="isPause",this._hasPause=1,fi(this,u,vs(this,s))},n.removePause=function(s){var i=this._first;for(s=vs(this,s);i;)i._start===s&&i.data==="isPause"&&ca(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)Zo!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=Ss(s),c=this._first,d=co(i),h;c;)c instanceof gn?vq(c._targets,u)&&(d?(!Zo||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&a.push(c):(h=c.getTweensOf(u,i)).length&&a.push.apply(a,h),c=c._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,u=vs(a,s),c=i,d=c.startAt,h=c.onStart,p=c.onStartParams,m=c.immediateRender,y,x=gn.to(a,rs({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale())||Ct,onStart:function(){if(a.pause(),!y){var w=i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale());x._dur!==w&&ic(x,w,0,1).render(x._time,!0,!0),y=1}h&&h.apply(x,p||[])}},i));return m?x.render(0):x},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,rs({startAt:{time:vs(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),n8(this,vs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),n8(this,vs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Ct)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,d;for(s=qt(s);u;)u._start>=a&&(u._start+=s,u._end+=s),u=u._next;if(i)for(d in c)c[d]>=a&&(c[d]+=s);return wl(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,a;i;)a=i._next,this.remove(i),i=a;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),wl(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=bs,d,h,p;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-s:s));if(a._dirty){for(p=a.parent;u;)d=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,fi(a,u,h-u._delay,1)._lock=0):c=h,h<0&&u._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=qt(h/a._ts),a._time-=h,a._tTime-=h),a.shiftChildren(-h,!1,-1/0),c=0),u._end>i&&u._ts&&(i=u._end),u=d;ic(a,a===Zt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(Zt._ts&&(EA(Zt,qm(s,Zt)),bA=qr.frame),qr.frame>=Qk){Qk+=es.autoSleep||120;var i=Zt._first;if((!i||!i._ts)&&es.autoSleep&&qr._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||qr.sleep()}}},e})(pf);rs(Tr.prototype,{_lock:0,_hasPause:0,_forcing:0});var Hq=function(e,n,r,s,i,a,u){var c=new Lr(this._pt,e,n,0,1,YA,null,i),d=0,h=0,p,m,y,x,_,w,E,P;for(c.b=r,c.e=s,r+="",s+="",(E=~s.indexOf("random("))&&(s=ff(s)),a&&(P=[r,s],a(P,e,n),r=P[0],s=P[1]),m=r.match(T1)||[];p=T1.exec(s);)x=p[0],_=s.substring(d,p.index),y?y=(y+1)%5:_.substr(-5)==="rgba("&&(y=1),x!==m[h++]&&(w=parseFloat(m[h-1])||0,c._pt={_next:c._pt,p:_||h===1?_:",",s:w,c:x.charAt(1)==="="?Mu(w,x)-w:parseFloat(x)-w,m:y&&y<4?Math.round:0},d=T1.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=u,(yA.test(s)||E)&&(c.e=0),this._pt=c,c},lw=function(e,n,r,s,i,a,u,c,d,h){nn(s)&&(s=s(i||0,e,a));var p=e[n],m=r!=="get"?r:nn(p)?d?e[n.indexOf("set")||!nn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,y=nn(p)?d?Gq:qA:cw,x;if(In(s)&&(~s.indexOf("random(")&&(s=ff(s)),s.charAt(1)==="="&&(x=Mu(m,s)+(Qn(m)||0),(x||x===0)&&(s=x))),!h||m!==s||n2)return!isNaN(m*s)&&s!==""?(x=new Lr(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?qq:ZA,0,y),d&&(x.fp=d),u&&x.modifier(u,this,e),this._pt=x):(!p&&!(n in e)&&rw(n,s),Hq.call(this,e,n,m,s,y,c||es.stringFilter,d))},zq=function(e,n,r,s,i){if(nn(e)&&(e=Dd(e,i,n,r,s)),!xi(e)||e.style&&e.nodeType||er(e)||gA(e))return In(e)?Dd(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=Dd(e[u],i,n,r,s);return a},WA=function(e,n,r,s,i,a){var u,c,d,h;if(Kr[e]&&(u=new Kr[e]).init(i,u.rawVars?n[e]:zq(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new Lr(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==Cu))for(d=r._ptLookup[r._targets.indexOf(i)],h=u._props.length;h--;)d[u._props[h]]=c;return u},Zo,n2,uw=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,d=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,m=s.keyframes,y=s.autoRevert,x=e._dur,_=e._startAt,w=e._targets,E=e.parent,P=E&&E.data==="nested"?E.vars.targets:w,T=e._overwrite==="auto"&&!Jx,k=e.timeline,R=s.easeReverse||p,L,O,A,M,D,F,N,G,Z,Y,B,K,$;if(k&&(!m||!i)&&(i="none"),e._ease=bl(i,uf.ease),e._rEase=R&&(bl(R)||e._ease),e._from=!k&&!!s.runBackwards,e._from&&(e.ratio=1),!k||m&&!s.stagger){if(G=w[0]?xl(w[0]).harness:0,K=G&&s[G.prop],L=Km(s,sw),_&&(_._zTime<0&&_.progress(1),n<0&&h&&u&&!y?_.render(-1,!0):_.revert(h&&x?Bp:mq),_._lazy=0),a){if(ca(e._startAt=gn.set(w,rs({data:"isStart",overwrite:!1,parent:E,immediateRender:!0,lazy:!_&&Mr(c),startAt:null,delay:0,onUpdate:d&&function(){return Yr(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(zn||!u&&!y)&&e._startAt.revert(Bp),u&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&x&&!_){if(n&&(u=!1),A=rs({overwrite:!1,data:"isFromStart",lazy:u&&!_&&Mr(c),immediateRender:u,stagger:0,parent:E},L),K&&(A[G.prop]=K),ca(e._startAt=gn.set(w,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(zn?e._startAt.revert(Bp):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,Ct,Ct);else if(!n)return}for(e._pt=e._ptCache=0,c=x&&Mr(c)||c&&!x,O=0;O<w.length;O++){if(D=w[O],N=D._gsap||ow(w)[O]._gsap,e._ptLookup[O]=Y={},Y_[N.id]&&ta.length&&Gm(),B=P===w?O:P.indexOf(D),G&&(Z=new G).init(D,K||L,e,B,P)!==!1&&(e._pt=M=new Lr(e._pt,D,Z.name,0,1,Z.render,Z,0,Z.priority),Z._props.forEach(function(J){Y[J]=M}),Z.priority&&(F=1)),!G||K)for(A in L)Kr[A]&&(Z=WA(A,L,e,B,D,P))?Z.priority&&(F=1):Y[A]=M=lw.call(e,D,A,"get",L[A],B,P,0,s.stringFilter);e._op&&e._op[O]&&e.kill(D,e._op[O]),T&&e._pt&&(Zo=e,Zt.killTweensOf(D,Y,e.globalTime(n)),$=!e.parent,Zo=0),e._pt&&c&&(Y_[N.id]=1)}F&&XA(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!$,m&&n<=0&&k.render(bs,!0,!0)},Uq=function(e,n,r,s,i,a,u,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,m,y;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,y=e._targets.length;y--;){if(h=m[y][n],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==n&&h.fp!==n;)h=h._next;if(!h)return n2=1,e.vars[n]="+=0",uw(e,u),n2=0,c?cf(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(h)}for(y=d.length;y--;)p=d[y],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+a*h.c,h.c=r-h.s,p.e&&(p.e=an(r)+Qn(p.e)),p.b&&(p.b=h.s+Qn(p.b))},Bq=function(e,n){var r=e[0]?xl(e[0]).harness:0,s=r&&r.aliases,i,a,u,c;if(!s)return n;i=rc({},n);for(a in s)if(a in i)for(c=s[a].split(","),u=c.length;u--;)i[c[u]]=i[a];return i},Wq=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(er(n))u=r[e]||(r[e]=[]),n.forEach(function(c,d){return u.push({t:d/(n.length-1)*100,v:c,e:i})});else for(a in n)u=r[a]||(r[a]=[]),a==="ease"||u.push({t:parseFloat(e),v:n[a],e:i})},Dd=function(e,n,r,s,i){return nn(e)?e.call(n,r,s,i):In(e)&&~e.indexOf("random(")?ff(e):e},GA=iw+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",KA={};Or(GA+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return KA[t]=1});var gn=(function(t){pA(e,t);function e(r,s,i,a){var u;typeof s=="number"&&(i.duration=s,s=i,i=null),u=t.call(this,a?s:Od(s))||this;var c=u.vars,d=c.duration,h=c.delay,p=c.immediateRender,m=c.stagger,y=c.overwrite,x=c.keyframes,_=c.defaults,w=c.scrollTrigger,E=s.parent||Zt,P=(er(r)||gA(r)?co(r[0]):"length"in s)?[r]:Ss(r),T,k,R,L,O,A,M,D;if(u._targets=P.length?ow(P):cf("GSAP target "+r+" not found. https://gsap.com",!es.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=y,x||m||xp(d)||xp(h)){s=u.vars;var F=s.easeReverse||s.yoyoEase;if(T=u.timeline=new Tr({data:"nested",defaults:_||{},targets:E&&E.data==="nested"?E.vars.targets:P}),T.kill(),T.parent=T._dp=Gi(u),T._start=0,m||xp(d)||xp(h)){if(L=P.length,M=m&&OA(m),xi(m))for(O in m)~GA.indexOf(O)&&(D||(D={}),D[O]=m[O]);for(k=0;k<L;k++)R=Km(s,KA),R.stagger=0,F&&(R.easeReverse=F),D&&rc(R,D),A=P[k],R.duration=+Dd(d,Gi(u),k,A,P),R.delay=(+Dd(h,Gi(u),k,A,P)||0)-u._delay,!m&&L===1&&R.delay&&(u._delay=h=R.delay,u._start+=h,R.delay=0),T.to(A,R,M?M(k,A,P):0),T._ease=dt.none;T.duration()?d=h=0:u.timeline=0}else if(x){Od(rs(T.vars.defaults,{ease:"none"})),T._ease=bl(x.ease||s.ease||"none");var N=0,G,Z,Y;if(er(x))x.forEach(function(B){return T.to(P,B,">")}),T.duration();else{R={};for(O in x)O==="ease"||O==="easeEach"||Wq(O,x[O],R,x.easeEach);for(O in R)for(G=R[O].sort(function(B,K){return B.t-K.t}),N=0,k=0;k<G.length;k++)Z=G[k],Y={ease:Z.e,duration:(Z.t-(k?G[k-1].t:0))/100*d},Y[O]=Z.v,T.to(P,Y,N),N+=Y.duration;T.duration()<d&&T.to({},{duration:d-T.duration()})}}d||u.duration(d=T.duration())}else u.timeline=0;return y===!0&&!Jx&&(Zo=Gi(u),Zt.killTweensOf(P),Zo=0),fi(E,Gi(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!d&&!x&&u._start===qt(E._time)&&Mr(p)&&wq(Gi(u))&&E.data!=="nested")&&(u._tTime=-Ct,u.render(Math.max(0,-h)||0)),w&&RA(Gi(u),w),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,d=this._dur,h=s<0,p=s>c-Ct&&!h?c:s<Ct?0:s,m,y,x,_,w,E,P,T;if(!d)Sq(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(m=p,T=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&h)return this.totalTime(_*100+s,i,a);if(m=qt(p%_),p===c?(x=this._repeat,m=d):(w=qt(p/_),x=~~w,x&&x===w?(m=d,x--):m>d&&(m=d)),E=this._yoyo&&x&1,E&&(m=d-m),w=sc(this._tTime,_),m===u&&!a&&this._initted&&x===w)return this._tTime=p,this;x!==w&&this.vars.repeatRefresh&&!E&&!this._lock&&m!==_&&this._initted&&(this._lock=a=1,this.render(qt(_*x),!0).invalidate()._lock=0)}if(!this._initted){if(AA(this,h?s:m,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&x!==w))return this;if(d!==this._dur)return this.render(s,i,a)}if(this._rEase){var k=m<u;if(k!==this._inv){var R=k?u:d-u;this._inv=k,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=R?(k?-1:1)/R:0,this._invScale=k?-this.ratio:1-this.ratio,this._invEase=k?this._rEase:this._ease}this.ratio=P=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=P=this._ease(m/d);if(this._from&&(this.ratio=P=1-P),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!w&&(Yr(this,"onStart"),this._tTime!==p))return this;for(y=this._pt;y;)y.r(P,y.d),y=y._next;T&&T.render(s<0?s:T._dur*T._ease(m/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&X_(this,s,i,a),Yr(this,"onUpdate")),this._repeat&&x!==w&&this.vars.onRepeat&&!i&&this.parent&&Yr(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&X_(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&ca(this,1),!i&&!(h&&!u)&&(p||u||E)&&(Yr(this,p===c?"onComplete":"onReverseComplete",!0),this._prom&&!(p<c&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,a,u,c){hf||qr.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||uw(this,d),h=this._ease(d/this._dur),Uq(this,s,i,a,u,h,d,c)?this.resetTo(s,i,a,u,1):(P0(this,0),this.parent||PA(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?_d(this):this.scrollTrigger&&this.scrollTrigger.kill(!!zn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Zo&&Zo.vars.overwrite!==!0)._first||_d(this),this.parent&&a!==this.timeline.totalDuration()&&ic(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?Ss(s):u,d=this._ptLookup,h=this._pt,p,m,y,x,_,w,E;if((!i||i==="all")&&_q(u,c))return i==="all"&&(this._pt=0),_d(this);for(p=this._op=this._op||[],i!=="all"&&(In(i)&&(_={},Or(i,function(P){return _[P]=1}),i=_),i=Bq(u,i)),E=u.length;E--;)if(~c.indexOf(u[E])){m=d[E],i==="all"?(p[E]=i,x=m,y={}):(y=p[E]=p[E]||{},x=i);for(_ in x)w=m&&m[_],w&&((!("kill"in w.d)||w.d.kill(_)===!0)&&C0(this,w,"_pt"),delete m[_]),y!=="all"&&(y[_]=1)}return this._initted&&!this._pt&&h&&_d(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Ld(1,arguments)},e.delayedCall=function(s,i,a,u){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:u})},e.fromTo=function(s,i,a){return Ld(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,a){return Zt.killTweensOf(s,i,a)},e})(pf);rs(gn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Or("staggerTo,staggerFrom,staggerFromTo",function(t){gn[t]=function(){var e=new Tr,n=J_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var cw=function(e,n,r){return e[n]=r},qA=function(e,n,r){return e[n](r)},Gq=function(e,n,r,s){return e[n](s.fp,r)},Kq=function(e,n,r){return e.setAttribute(n,r)},dw=function(e,n){return nn(e[n])?qA:ew(e[n])&&e.setAttribute?Kq:cw},ZA=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},qq=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},YA=function(e,n){var r=n._pt,s="";if(!e&&n.b)s=n.b;else if(e===1&&n.e)s=n.e;else{for(;r;)s=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+s,r=r._next;s+=n.c}n.set(n.t,n.p,s,n)},fw=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},Zq=function(e,n,r,s){for(var i=this._pt,a;i;)a=i._next,i.p===s&&i.modifier(e,n,r),i=a},Yq=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?C0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},Xq=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},XA=function(e){for(var n=e._pt,r,s,i,a;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:a)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:a=n,n=r}e._pt=i},Lr=(function(){function t(n,r,s,i,a,u,c,d,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||ZA,this.d=c||this,this.set=d||cw,this.pr=h||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=Xq,this.m=r,this.mt=i,this.tween=s},t})();Or(iw+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(t){return sw[t]=1});ns.TweenMax=ns.TweenLite=gn;ns.TimelineLite=ns.TimelineMax=Tr;Zt=new Tr({sortChildren:!1,defaults:uf,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});es.stringFilter=zA;var Sl=[],Gp={},Qq=[],s8=0,Jq=0,O1=function(e){return(Gp[e]||Qq).map(function(n){return n()})},r2=function(){var e=Date.now(),n=[];e-s8>2&&(O1("matchMediaInit"),Sl.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,d;for(u in s)a=oi.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,d=1);d&&(r.revert(),c&&n.push(r))}),O1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),s8=e,O1("matchMedia"))},QA=(function(){function t(n,r){this.selector=r&&e2(r),this.data=[],this._r=[],this.isReverted=!1,this.id=Jq++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){nn(r)&&(i=s,s=r,r=nn);var a=this,u=function(){var d=Ut,h=a.selector,p;return d&&d!==a&&d.data.push(a),i&&(a.selector=e2(i)),Ut=a,p=s.apply(a,arguments),nn(p)&&a._r.push(p),Ut=d,a.selector=h,a.isReverted=!1,p};return a.last=u,r===nn?u(a,function(c){return a.add(null,c)}):r?a[r]=u:u},e.ignore=function(r){var s=Ut;Ut=null,r(this),Ut=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof gn&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var u=i.getTweens(),c=i.data.length,d;c--;)d=i.data[c],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(h){return u.splice(u.indexOf(h),1)}));for(u.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,p){return p.g-h.g||-1/0}).forEach(function(h){return h.t.revert(r)}),c=i.data.length;c--;)d=i.data[c],d instanceof Tr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof gn)&&d.revert&&d.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(u){return u.kill&&u.kill()}),this.clear(),s)for(var a=Sl.length;a--;)Sl[a].id===this.id&&Sl.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),eZ=(function(){function t(n){this.contexts=[],this.scope=n,Ut&&Ut.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){xi(r)||(r={matches:r});var a=new QA(0,i||this.scope),u=a.conditions={},c,d,h;Ut&&!a.selector&&(a.selector=Ut.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(d in r)d==="all"?h=1:(c=oi.matchMedia(r[d]),c&&(Sl.indexOf(a)<0&&Sl.push(a),(u[d]=c.matches)&&(h=1),c.addListener?c.addListener(r2):c.addEventListener("change",r2)));return h&&s(a,function(p){return a.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),Zm={registerPlugin:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(s){return VA(s)})},timeline:function(e){return new Tr(e)},getTweensOf:function(e,n){return Zt.getTweensOf(e,n)},getProperty:function(e,n,r,s){In(e)&&(e=Ss(e)[0]);var i=xl(e||{}).get,a=r?kA:CA;return r==="native"&&(r=""),e&&(n?a((Kr[n]&&Kr[n].get||i)(e,n,r,s)):function(u,c,d){return a((Kr[u]&&Kr[u].get||i)(e,u,c,d))})},quickSetter:function(e,n,r){if(e=Ss(e),e.length>1){var s=e.map(function(h){return Nr.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=Kr[n],u=xl(e),c=u.harness&&(u.harness.aliases||{})[n]||n,d=a?function(h){var p=new a;Cu._pt=0,p.init(e,r?h+r:h,Cu,0,[e]),p.render(1,p),Cu._pt&&fw(1,Cu)}:u.set(e,c);return a?d:function(h){return d(e,c,r?h+r:h,u,1)}},quickTo:function(e,n,r){var s,i=Nr.to(e,rs((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,d,h){return i.resetTo(n,c,d,h)};return a.tween=i,a},isTweening:function(e){return Zt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=bl(e.ease,uf.ease)),Jk(uf,e||{})},config:function(e){return Jk(es,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,a=e.extendTimeline;(s||"").split(",").forEach(function(u){return u&&!Kr[u]&&!ns[u]&&cf(n+" effect requires "+u+" plugin.")}),R1[n]=function(u,c,d){return r(Ss(u),rs(c||{},i),d)},a&&(Tr.prototype[n]=function(u,c,d){return this.add(R1[n](u,xi(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){dt[e]=bl(n)},parseEase:function(e,n){return arguments.length?bl(e,n):dt},getById:function(e){return Zt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Tr(e),s,i;for(r.smoothChildTiming=Mr(e.smoothChildTiming),Zt.remove(r),r._dp=0,r._time=r._tTime=Zt._time,s=Zt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof gn&&s.vars.onComplete===s._targets[0]))&&fi(r,s,s._start-s._delay),s=i;return fi(Zt,r,0),r},context:function(e,n){return e?new QA(e,n):Ut},matchMedia:function(e){return new eZ(e)},matchMediaRefresh:function(){return Sl.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||r2()},addEventListener:function(e,n){var r=Gp[e]||(Gp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Gp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:Iq,wrapYoyo:Mq,distribute:OA,random:DA,snap:LA,normalize:Aq,getUnit:Qn,clamp:kq,splitColor:$A,toArray:Ss,selector:e2,mapRange:jA,pipe:Tq,unitize:Rq,interpolate:Oq,shuffle:MA},install:xA,effects:R1,ticker:qr,updateRoot:Tr.updateRoot,plugins:Kr,globalTimeline:Zt,core:{PropTween:Lr,globals:wA,Tween:gn,Timeline:Tr,Animation:pf,getCache:xl,_removeLinkedListItem:C0,reverting:function(){return zn},context:function(e){return e&&Ut&&(Ut.data.push(e),e._ctx=Ut),Ut},suppressOverwrites:function(e){return Jx=e}}};Or("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Zm[t]=gn[t]});qr.add(Tr.updateRoot);Cu=Zm.to({},{duration:0});var tZ=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},nZ=function(e,n){var r=e._targets,s,i,a;for(s in n)for(i=r.length;i--;)a=e._ptLookup[i][s],a&&(a=a.d)&&(a._pt&&(a=tZ(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},L1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(u){var c,d;if(In(i)&&(c={},Or(i,function(h){return c[h]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}nZ(u,i)}}}},Nr=Zm.registerPlugin({name:"attr",init:function(e,n,r,s,i){var a,u,c;this.tween=r;for(a in n)c=e.getAttribute(a)||"",u=this.add(e,"setAttribute",(c||0)+"",n[a],s,i,0,0,a),u.op=a,u.b=c,this._props.push(a)},render:function(e,n){for(var r=n._pt;r;)zn?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,n){for(var r=n.length;r--;)this.add(e,r,e[r]||0,n[r],0,0,0,0,0,1)}},L1("roundProps",t2),L1("modifiers"),L1("snap",LA))||Zm;gn.version=Tr.version=Nr.version="3.15.0";_A=1;tw()&&oc();dt.Power0;dt.Power1;dt.Power2;dt.Power3;dt.Power4;dt.Linear;dt.Quad;dt.Cubic;dt.Quart;dt.Quint;dt.Strong;dt.Elastic;dt.Back;dt.SteppedEase;dt.Bounce;dt.Sine;dt.Expo;dt.Circ;/*!
122
- * CSSPlugin 3.15.0
123
- * https://gsap.com
124
- *
125
- * Copyright 2008-2026, GreenSock. All rights reserved.
126
- * Subject to the terms at https://gsap.com/standard-license
127
- * @author: Jack Doyle, jack@greensock.com
128
- */var i8,Yo,Ou,hw,ol,o8,pw,rZ=function(){return typeof window<"u"},fo={},Ja=180/Math.PI,Lu=Math.PI/180,fu=Math.atan2,a8=1e8,mw=/([A-Z])/g,sZ=/(left|right|width|margin|padding|x)/i,iZ=/[\s,\(]\S/,mi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},s2=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},oZ=function(e,n){return n.set(n.t,n.p,e===1?n.e:Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},aZ=function(e,n){return n.set(n.t,n.p,e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},lZ=function(e,n){return n.set(n.t,n.p,e===1?n.e:e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},uZ=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},JA=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},eI=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},cZ=function(e,n,r){return e.style[n]=r},dZ=function(e,n,r){return e.style.setProperty(n,r)},fZ=function(e,n,r){return e._gsap[n]=r},hZ=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},pZ=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},mZ=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Yt="transform",Dr=Yt+"Origin",gZ=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in fo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=mi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=qi(s,u)}):this.tfm[e]=a.x?a[e]:qi(s,e),e===Dr&&(this.tfm.zOrigin=a.zOrigin);else return mi.transform.split(",").forEach(function(u){return t.call(r,u,n)});if(this.props.indexOf(Yt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Dr,n,"")),e=Yt}(i||n)&&this.props.push(e,n,i[e])},tI=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},vZ=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,a;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(mw,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)s[a]=this.tfm[a];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=pw(),(!i||!i.isStart)&&!r[Yt]&&(tI(r),s.zOrigin&&r[Dr]&&(r[Dr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},nI=function(e,n){var r={target:e,props:[],revert:vZ,save:gZ};return e._gsap||Nr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},rI,i2=function(e,n){var r=Yo.createElementNS?Yo.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Yo.createElement(e);return r&&r.style?r:Yo.createElement(e)},Xr=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(mw,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,ac(n)||n,1)||""},l8="O,Moz,ms,Ms,Webkit".split(","),ac=function(e,n,r){var s=n||ol,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(l8[a]+e in i););return a<0?null:(a===3?"ms":a>=0?l8[a]:"")+e},o2=function(){rZ()&&window.document&&(i8=window,Yo=i8.document,Ou=Yo.documentElement,ol=i2("div")||{style:{}},i2("div"),Yt=ac(Yt),Dr=Yt+"Origin",ol.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",rI=!!ac("perspective"),pw=Nr.core.reverting,hw=1)},u8=function(e){var n=e.ownerSVGElement,r=i2("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Ou.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Ou.removeChild(r),i},c8=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},sI=function(e){var n,r;try{n=e.getBBox()}catch{n=u8(e),r=1}return n&&(n.width||n.height)||r||(n=u8(e)),n&&!n.width&&!n.x&&!n.y?{x:+c8(e,["x","cx","x1"])||0,y:+c8(e,["y","cy","y1"])||0,width:0,height:0}:n},iI=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&sI(e))},da=function(e,n){if(n){var r=e.style,s;n in fo&&n!==Dr&&(n=Yt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(mw,"-$1").toLowerCase())):r.removeAttribute(n)}},Xo=function(e,n,r,s,i,a){var u=new Lr(e._pt,n,r,0,1,a?eI:JA);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},d8={deg:1,rad:1,turn:1},yZ={grid:1,flex:1},fa=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=ol.style,c=sZ.test(n),d=e.tagName.toLowerCase()==="svg",h=(d?"client":"offset")+(c?"Width":"Height"),p=100,m=s==="px",y=s==="%",x,_,w,E;if(s===a||!i||d8[s]||d8[a])return i;if(a!=="px"&&!m&&(i=t(e,n,r,"px")),E=e.getCTM&&iI(e),(y||a==="%")&&(fo[n]||~n.indexOf("adius")))return x=E?e.getBBox()[c?"width":"height"]:e[h],an(y?i/x*p:i/100*x);if(u[c?"width":"height"]=p+(m?a:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,E&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Yo||!_.appendChild)&&(_=Yo.body),w=_._gsap,w&&y&&w.width&&c&&w.time===qr.time&&!w.uncache)return an(i/w.width*p);if(y&&(n==="height"||n==="width")){var P=e.style[n];e.style[n]=p+s,x=e[h],P?e.style[n]=P:da(e,n)}else(y||a==="%")&&!yZ[Xr(_,"display")]&&(u.position=Xr(e,"position")),_===e&&(u.position="static"),_.appendChild(ol),x=ol[h],_.removeChild(ol),u.position="absolute";return c&&y&&(w=xl(_),w.time=qr.time,w.width=_[h]),an(m?x*i/p:x&&i?p/x*i:0)},qi=function(e,n,r,s){var i;return hw||o2(),n in mi&&n!=="transform"&&(n=mi[n],~n.indexOf(",")&&(n=n.split(",")[0])),fo[n]&&n!=="transform"?(i=gf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Xm(Xr(e,Dr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Ym[n]&&Ym[n](e,n,r)||Xr(e,n)||SA(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?fa(e,n,i,r)+r:i},_Z=function(e,n,r,s){if(!r||r==="none"){var i=ac(n,e,1),a=i&&Xr(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=Xr(e,"borderTopColor"))}var u=new Lr(this._pt,e.style,n,0,1,YA),c=0,d=0,h,p,m,y,x,_,w,E,P,T,k,R;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Xr(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=Xr(e,n)||s,_?e.style[n]=_:da(e,n)),h=[r,s],zA(h),r=h[0],s=h[1],m=r.match(Eu)||[],R=s.match(Eu)||[],R.length){for(;p=Eu.exec(s);)w=p[0],P=s.substring(c,p.index),x?x=(x+1)%5:(P.substr(-5)==="rgba("||P.substr(-5)==="hsla(")&&(x=1),w!==(_=m[d++]||"")&&(y=parseFloat(_)||0,k=_.substr((y+"").length),w.charAt(1)==="="&&(w=Mu(y,w)+k),E=parseFloat(w),T=w.substr((E+"").length),c=Eu.lastIndex-T.length,T||(T=T||es.units[n]||k,c===s.length&&(s+=T,u.e+=T)),k!==T&&(y=fa(e,n,_,T)||0),u._pt={_next:u._pt,p:P||d===1?P:",",s:y,c:E-y,m:x&&x<4||n==="zIndex"?Math.round:0});u.c=c<s.length?s.substring(c,s.length):""}else u.r=n==="display"&&s==="none"?eI:JA;return yA.test(s)&&(u.e=0),this._pt=u,u},f8={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},xZ=function(e){var n=e.split(" "),r=n[0],s=n[1]||"50%";return(r==="top"||r==="bottom"||s==="left"||s==="right")&&(e=r,r=s,s=e),n[0]=f8[r]||r,n[1]=f8[s]||s,n.join(" ")},wZ=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,a=r._gsap,u,c,d;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),d=i.length;--d>-1;)u=i[d],fo[u]&&(c=1,u=u==="transformOrigin"?Dr:Yt),da(r,u);c&&(da(r,Yt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",gf(r,1),a.uncache=1,tI(s)))}},Ym={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Lr(e._pt,n,r,0,0,wZ);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},mf=[1,0,0,1,0,0],oI={},aI=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},h8=function(e){var n=Xr(e,Yt);return aI(n)?mf:n.substr(7).match(vA).map(an)},gw=function(e,n){var r=e._gsap||xl(e),s=e.style,i=h8(e),a,u,c,d;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?mf:i):(i===mf&&!e.offsetParent&&e!==Ou&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,u=e.nextElementSibling,Ou.appendChild(e)),i=h8(e),c?s.display=c:da(e,"display"),d&&(u?a.insertBefore(e,u):a?a.appendChild(e):Ou.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},a2=function(e,n,r,s,i,a){var u=e._gsap,c=i||gw(e,!0),d=u.xOrigin||0,h=u.yOrigin||0,p=u.xOffset||0,m=u.yOffset||0,y=c[0],x=c[1],_=c[2],w=c[3],E=c[4],P=c[5],T=n.split(" "),k=parseFloat(T[0])||0,R=parseFloat(T[1])||0,L,O,A,M;r?c!==mf&&(O=y*w-x*_)&&(A=k*(w/O)+R*(-_/O)+(_*P-w*E)/O,M=k*(-x/O)+R*(y/O)-(y*P-x*E)/O,k=A,R=M):(L=sI(e),k=L.x+(~T[0].indexOf("%")?k/100*L.width:k),R=L.y+(~(T[1]||T[0]).indexOf("%")?R/100*L.height:R)),s||s!==!1&&u.smooth?(E=k-d,P=R-h,u.xOffset=p+(E*y+P*_)-E,u.yOffset=m+(E*x+P*w)-P):u.xOffset=u.yOffset=0,u.xOrigin=k,u.yOrigin=R,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[Dr]="0px 0px",a&&(Xo(a,u,"xOrigin",d,k),Xo(a,u,"yOrigin",h,R),Xo(a,u,"xOffset",p,u.xOffset),Xo(a,u,"yOffset",m,u.yOffset)),e.setAttribute("data-svg-origin",k+" "+R)},gf=function(e,n){var r=e._gsap||new BA(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,a="px",u="deg",c=getComputedStyle(e),d=Xr(e,Dr)||"0",h,p,m,y,x,_,w,E,P,T,k,R,L,O,A,M,D,F,N,G,Z,Y,B,K,$,J,H,j,X,te,ie,ae;return h=p=m=_=w=E=P=T=k=0,y=x=1,r.svg=!!(e.getCTM&&iI(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[Yt]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Yt]!=="none"?c[Yt]:"")),s.scale=s.rotate=s.translate="none"),O=gw(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),d=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",K=""):K=!n&&e.getAttribute("data-svg-origin"),a2(e,K||d,!!K||r.originIsAbsolute,r.smooth!==!1,O)),R=r.xOrigin||0,L=r.yOrigin||0,O!==mf&&(F=O[0],N=O[1],G=O[2],Z=O[3],h=Y=O[4],p=B=O[5],O.length===6?(y=Math.sqrt(F*F+N*N),x=Math.sqrt(Z*Z+G*G),_=F||N?fu(N,F)*Ja:0,P=G||Z?fu(G,Z)*Ja+_:0,P&&(x*=Math.abs(Math.cos(P*Lu))),r.svg&&(h-=R-(R*F+L*G),p-=L-(R*N+L*Z))):(ae=O[6],te=O[7],H=O[8],j=O[9],X=O[10],ie=O[11],h=O[12],p=O[13],m=O[14],A=fu(ae,X),w=A*Ja,A&&(M=Math.cos(-A),D=Math.sin(-A),K=Y*M+H*D,$=B*M+j*D,J=ae*M+X*D,H=Y*-D+H*M,j=B*-D+j*M,X=ae*-D+X*M,ie=te*-D+ie*M,Y=K,B=$,ae=J),A=fu(-G,X),E=A*Ja,A&&(M=Math.cos(-A),D=Math.sin(-A),K=F*M-H*D,$=N*M-j*D,J=G*M-X*D,ie=Z*D+ie*M,F=K,N=$,G=J),A=fu(N,F),_=A*Ja,A&&(M=Math.cos(A),D=Math.sin(A),K=F*M+N*D,$=Y*M+B*D,N=N*M-F*D,B=B*M-Y*D,F=K,Y=$),w&&Math.abs(w)+Math.abs(_)>359.9&&(w=_=0,E=180-E),y=an(Math.sqrt(F*F+N*N+G*G)),x=an(Math.sqrt(B*B+ae*ae)),A=fu(Y,B),P=Math.abs(A)>2e-4?A*Ja:0,k=ie?1/(ie<0?-ie:ie):0),r.svg&&(K=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!aI(Xr(e,Yt)),K&&e.setAttribute("transform",K))),Math.abs(P)>90&&Math.abs(P)<270&&(i?(y*=-1,P+=_<=0?180:-180,_+=_<=0?180:-180):(x*=-1,P+=P<=0?180:-180)),n=n||r.uncache,r.x=h-((r.xPercent=h&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+a,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+a,r.z=m+a,r.scaleX=an(y),r.scaleY=an(x),r.rotation=an(_)+u,r.rotationX=an(w)+u,r.rotationY=an(E)+u,r.skewX=P+u,r.skewY=T+u,r.transformPerspective=k+a,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Dr]=Xm(d)),r.xOffset=r.yOffset=0,r.force3D=es.force3D,r.renderTransform=r.svg?SZ:rI?lI:bZ,r.uncache=0,r},Xm=function(e){return(e=e.split(" "))[0]+" "+e[1]},D1=function(e,n,r){var s=Qn(n);return an(parseFloat(n)+parseFloat(fa(e,"x",r+"px",s)))+s},bZ=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,lI(e,n)},Ka="0deg",cd="0px",qa=") ",lI=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.z,d=r.rotation,h=r.rotationY,p=r.rotationX,m=r.skewX,y=r.skewY,x=r.scaleX,_=r.scaleY,w=r.transformPerspective,E=r.force3D,P=r.target,T=r.zOrigin,k="",R=E==="auto"&&e&&e!==1||E===!0;if(T&&(p!==Ka||h!==Ka)){var L=parseFloat(h)*Lu,O=Math.sin(L),A=Math.cos(L),M;L=parseFloat(p)*Lu,M=Math.cos(L),a=D1(P,a,O*M*-T),u=D1(P,u,-Math.sin(L)*-T),c=D1(P,c,A*M*-T+T)}w!==cd&&(k+="perspective("+w+qa),(s||i)&&(k+="translate("+s+"%, "+i+"%) "),(R||a!==cd||u!==cd||c!==cd)&&(k+=c!==cd||R?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+qa),d!==Ka&&(k+="rotate("+d+qa),h!==Ka&&(k+="rotateY("+h+qa),p!==Ka&&(k+="rotateX("+p+qa),(m!==Ka||y!==Ka)&&(k+="skew("+m+", "+y+qa),(x!==1||_!==1)&&(k+="scale("+x+", "+_+qa),P.style[Yt]=k||"translate(0, 0)"},SZ=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.rotation,d=r.skewX,h=r.skewY,p=r.scaleX,m=r.scaleY,y=r.target,x=r.xOrigin,_=r.yOrigin,w=r.xOffset,E=r.yOffset,P=r.forceCSS,T=parseFloat(a),k=parseFloat(u),R,L,O,A,M;c=parseFloat(c),d=parseFloat(d),h=parseFloat(h),h&&(h=parseFloat(h),d+=h,c+=h),c||d?(c*=Lu,d*=Lu,R=Math.cos(c)*p,L=Math.sin(c)*p,O=Math.sin(c-d)*-m,A=Math.cos(c-d)*m,d&&(h*=Lu,M=Math.tan(d-h),M=Math.sqrt(1+M*M),O*=M,A*=M,h&&(M=Math.tan(h),M=Math.sqrt(1+M*M),R*=M,L*=M)),R=an(R),L=an(L),O=an(O),A=an(A)):(R=p,A=m,L=O=0),(T&&!~(a+"").indexOf("px")||k&&!~(u+"").indexOf("px"))&&(T=fa(y,"x",a,"px"),k=fa(y,"y",u,"px")),(x||_||w||E)&&(T=an(T+x-(x*R+_*O)+w),k=an(k+_-(x*L+_*A)+E)),(s||i)&&(M=y.getBBox(),T=an(T+s/100*M.width),k=an(k+i/100*M.height)),M="matrix("+R+","+L+","+O+","+A+","+T+","+k+")",y.setAttribute("transform",M),P&&(y.style[Yt]=M)},EZ=function(e,n,r,s,i){var a=360,u=In(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?Ja:1),d=c-s,h=s+d+"deg",p,m;return u&&(p=i.split("_")[1],p==="short"&&(d%=a,d!==d%(a/2)&&(d+=d<0?a:-a)),p==="cw"&&d<0?d=(d+a*a8)%a-~~(d/a)*a:p==="ccw"&&d>0&&(d=(d-a*a8)%a-~~(d/a)*a)),e._pt=m=new Lr(e._pt,n,r,s,d,oZ),m.e=h,m.u="deg",e._props.push(r),m},p8=function(e,n){for(var r in n)e[r]=n[r];return e},CZ=function(e,n,r){var s=p8({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,d,h,p,m,y,x;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),a[Yt]=n,u=gf(r,1),da(r,Yt),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Yt],a[Yt]=n,u=gf(r,1),a[Yt]=d);for(c in fo)d=s[c],h=u[c],d!==h&&i.indexOf(c)<0&&(y=Qn(d),x=Qn(h),p=y!==x?fa(r,c,d,x):parseFloat(d),m=parseFloat(h),e._pt=new Lr(e._pt,u,c,p,m-p,s2),e._pt.u=x||0,e._props.push(c));p8(u,s)};Or("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",a=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(u){return e<2?t+u:"border"+u+t});Ym[e>1?"border"+t:t]=function(u,c,d,h,p){var m,y;if(arguments.length<4)return m=a.map(function(x){return qi(u,x,d)}),y=m.join(" "),y.split(m[0]).length===5?m[0]:y;m=(h+"").split(" "),y={},a.forEach(function(x,_){return y[x]=m[_]=m[_]||m[(_-1)/2|0]}),u.init(c,y,p)}});var uI={name:"css",register:o2,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var a=this._props,u=e.style,c=r.vars.startAt,d,h,p,m,y,x,_,w,E,P,T,k,R,L,O,A,M;hw||o2(),this.styles=this.styles||nI(e),A=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(h=n[_],!(Kr[_]&&WA(_,n,r,s,e,i)))){if(y=typeof h,x=Ym[_],y==="function"&&(h=h.call(r,s,e,i),y=typeof h),y==="string"&&~h.indexOf("random(")&&(h=ff(h)),x)x(this,e,_,h,r)&&(O=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),h+="",na.lastIndex=0,na.test(d)||(w=Qn(d),E=Qn(h),E?w!==E&&(d=fa(e,_,d,E)+E):w&&(h+=w)),this.add(u,"setProperty",d,h,s,i,0,0,_),a.push(_),A.push(_,0,u[_]);else if(y!=="undefined"){if(c&&_ in c?(d=typeof c[_]=="function"?c[_].call(r,s,e,i):c[_],In(d)&&~d.indexOf("random(")&&(d=ff(d)),Qn(d+"")||d==="auto"||(d+=es.units[_]||Qn(qi(e,_))||""),(d+"").charAt(1)==="="&&(d=qi(e,_))):d=qi(e,_),m=parseFloat(d),P=y==="string"&&h.charAt(1)==="="&&h.substr(0,2),P&&(h=h.substr(2)),p=parseFloat(h),_ in mi&&(_==="autoAlpha"&&(m===1&&qi(e,"visibility")==="hidden"&&p&&(m=0),A.push("visibility",0,u.visibility),Xo(this,u,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=mi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),T=_ in fo,T){if(this.styles.save(_),M=h,y==="string"&&h.substring(0,6)==="var(--"){if(h=Xr(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=h,h=Xr(e,"perspective"),D?e.style.perspective=D:da(e,"perspective")}p=parseFloat(h)}if(k||(R=e._gsap,R.renderTransform&&!n.parseTransform||gf(e,n.parseTransform),L=n.smoothOrigin!==!1&&R.smooth,k=this._pt=new Lr(this._pt,u,Yt,0,1,R.renderTransform,R,0,-1),k.dep=1),_==="scale")this._pt=new Lr(this._pt,R,"scaleY",R.scaleY,(P?Mu(R.scaleY,P+p):p)-R.scaleY||0,s2),this._pt.u=0,a.push("scaleY",_),_+="X";else if(_==="transformOrigin"){A.push(Dr,0,u[Dr]),h=xZ(h),R.svg?a2(e,h,0,L,0,this):(E=parseFloat(h.split(" ")[2])||0,E!==R.zOrigin&&Xo(this,R,"zOrigin",R.zOrigin,E),Xo(this,u,_,Xm(d),Xm(h)));continue}else if(_==="svgOrigin"){a2(e,h,1,L,0,this);continue}else if(_ in oI){EZ(this,R,_,m,P?Mu(m,P+h):h);continue}else if(_==="smoothOrigin"){Xo(this,R,"smooth",R.smooth,h);continue}else if(_==="force3D"){R[_]=h;continue}else if(_==="transform"){CZ(this,h,e);continue}}else _ in u||(_=ac(_)||_);if(T||(p||p===0)&&(m||m===0)&&!iZ.test(h)&&_ in u)w=(d+"").substr((m+"").length),p||(p=0),E=Qn(h)||(_ in es.units?es.units[_]:w),w!==E&&(m=fa(e,_,d,E)),this._pt=new Lr(this._pt,T?R:u,_,m,(P?Mu(m,P+p):p)-m,!T&&(E==="px"||_==="zIndex")&&n.autoRound!==!1?uZ:s2),this._pt.u=E||0,T&&M!==h?(this._pt.b=d,this._pt.e=M,this._pt.r=lZ):w!==E&&E!=="%"&&(this._pt.b=d,this._pt.r=aZ);else if(_ in u)_Z.call(this,e,_,d,P?P+h:h);else if(_ in e)this.add(e,_,d||e[_],P?P+h:h,s,i);else if(_!=="parseTransform"){rw(_,h);continue}T||(_ in u?A.push(_,0,u[_]):typeof e[_]=="function"?A.push(_,2,e[_]()):A.push(_,1,d||e[_])),a.push(_)}}O&&XA(this)},render:function(e,n){if(n.tween._time||!pw())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:qi,aliases:mi,getSetter:function(e,n,r){var s=mi[n];return s&&s.indexOf(",")<0&&(n=s),n in fo&&n!==Dr&&(e._gsap.x||qi(e,"x"))?r&&o8===r?n==="scale"?hZ:fZ:(o8=r||{})&&(n==="scale"?pZ:mZ):e.style&&!ew(e.style[n])?cZ:~n.indexOf("-")?dZ:dw(e,n)},core:{_removeProperty:da,_getMatrix:gw}};Nr.utils.checkPrefix=ac;Nr.core.getStyleSaver=nI;(function(t,e,n,r){var s=Or(t+","+e+","+n,function(i){fo[i]=1});Or(e,function(i){es.units[i]="deg",oI[i]=1}),mi[s[13]]=t+","+e,Or(r,function(i){var a=i.split(":");mi[a[1]]=s[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Or("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){es.units[t]="px"});Nr.registerPlugin(uI);var Fs=Nr.registerPlugin(uI)||Nr;Fs.core.Tween;const Kp="/assets/logo-animation",N1=1280,kZ=[{id:"eraser",src:`${Kp}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Kp}/clasp.png`,cssW:170,cssH:170,rot:-248,fit:205,flip:!0,localX:188,localY:97,seaX:.8,seaY:.24,seaRot:-18},{id:"ball",src:`${Kp}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],PZ=[{k:"pot",x:.075,y:.2,r:-12,w:152},{k:"chair",x:.1,y:.52,r:8,w:150},{k:"mug",x:.11,y:.84,r:-6,w:140},{k:"cart",x:.3,y:.13,r:10,w:178},{k:"terracotta-1",x:.345,y:.45,r:-18,w:122},{k:"pitcher",x:.285,y:.71,r:14,w:128},{k:"desk",x:.46,y:.25,r:-8,w:198},{k:"startac",x:.475,y:.55,r:16,w:140},{k:"vhsplant",x:.4,y:.9,r:-6,w:188},{k:"bubblephone",x:.63,y:.12,r:12,w:150},{k:"terracotta-2",x:.61,y:.43,r:20,w:122},{k:"pot",x:.675,y:.68,r:14,w:140},{k:"chair",x:.71,y:.91,r:-12,w:140},{k:"mug",x:.91,y:.15,r:8,w:136},{k:"cart",x:.905,y:.47,r:-10,w:166},{k:"startac",x:.88,y:.76,r:18,w:136}],l2=({className:t})=>{const e=g.useRef(null),n=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{const s=e.current,i=n.current,a=r.current;if(!s||!i||!a)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(E,P)=>E+Math.random()*(P-E);let d=null,h,p=1;const m=kZ.map(E=>({...E})),y=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const E=s.getBoundingClientRect(),P=E.width||N1,T=E.height||N1*.64;p=P/N1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const R=250*p/337,L=[],O=(A,M,D)=>{const F=document.createElement("div");return F.className="la-obj",F.style.width=`${M}px`,F.innerHTML=`<img src="${A}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(F),F};return PZ.forEach((A,M)=>{const D=A.w*p,F=O(`${Kp}/sea/${A.k}.png`,D,M%2===0);Fs.set(F,{x:A.x*P-D/2,y:A.y*T-D/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),L.push({el:F,hero:!1,rest:1})}),m.forEach(A=>{const M=A.cssW*p;A.el=O(A.src,M,!!A.flip),A.finalScale=A.fit*R/(A.cssW*p),Fs.set(A.el,{x:A.seaX*P-M/2,y:A.seaY*T-A.cssH*p/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),L.push({el:A.el,hero:!0,rest:150/A.cssW})}),L},x=(E,P)=>{const T=s.getBoundingClientRect(),k=a.getBoundingClientRect();return{x:k.left-T.left+E/326*k.width,y:k.top-T.top+P/337*k.height}},_=()=>{d&&d.revert();const E=y();if(u){d=Fs.context(()=>{E.filter(k=>!k.hero).forEach(k=>Fs.set(k.el,{scale:0})),m.forEach(k=>{if(!k.el)return;const R=x(k.localX,k.localY);Fs.set(k.el,{x:R.x-k.cssW*p/2,y:R.y-k.cssH*p/2,rotation:k.rot,scale:k.finalScale})})},s);return}const P=[],T=[];d=Fs.context(()=>{const k=Fs.timeline();k.to(E.map(R=>R.el),{scale:R=>E[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),k.add(()=>{E.forEach(({el:R,hero:L},O)=>{const A=L?P:T,M=O%2?1:-1;A.push(Fs.to(R,{rotation:"+="+c(2.5,6)*M,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),Fs.to(R,{y:"+="+c(5,11)*M,x:"+="+c(4,9)*-M,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),k.to({},{duration:1.1}),k.add("pick"),m.forEach((R,L)=>{R.el&&k.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+L*.08)}),k.add("clear","pick+=0.7"),k.add(()=>T.forEach(R=>R.kill()),"clear"),k.to(E.filter(R=>!R.hero).map(R=>R.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),k.add("assemble","clear+=0.25"),k.add(()=>P.forEach(R=>R.kill()),"assemble"),m.forEach((R,L)=>{if(!R.el||R.finalScale===void 0)return;const O=x(R.localX,R.localY);k.to(R.el,{x:O.x-R.cssW*p/2,y:O.y-R.cssH*p/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+L*.12)}),m.forEach(R=>{!R.el||R.finalScale===void 0||k.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};Fs.ticker.fps(12),_();const w=()=>{clearTimeout(h),h=setTimeout(_,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),clearTimeout(h),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(E=>E.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},TZ=Object.freeze(Object.defineProperty({__proto__:null,default:l2},Symbol.toStringTag,{value:"Module"})),m8=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),cI=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(l2,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(m8,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?S.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,S.jsx(l2,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(m8,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),RZ="data:image/svg+xml,%3csvg%20width='94'%20height='24'%20viewBox='0%200%2094%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M-0.000156164%2023.832V7.704H5.11184L6.47984%208.424C7.58384%207.704%209.04784%207.344%2010.8718%207.344C12.0718%207.344%2013.1278%207.476%2014.0398%207.74C14.9518%207.98%2015.6838%208.244%2016.2358%208.532C16.8118%208.82%2017.1718%209.024%2017.3158%209.144L15.5158%2013.824C15.2758%2013.656%2014.8198%2013.428%2014.1478%2013.14C13.4998%2012.852%2012.7318%2012.588%2011.8438%2012.348C10.9558%2012.084%2010.0198%2011.952%209.03584%2011.952H8.63984C7.96784%2011.952%207.45184%2012.072%207.09184%2012.312C6.73184%2012.528%206.55184%2013.02%206.55184%2013.788V23.832H-0.000156164ZM23.464%206.156C21.04%206.156%2019.828%205.124%2019.828%203.06C19.828%201.908%2020.128%201.116%2020.728%200.684C21.352%200.227999%2022.264%20-1.43051e-06%2023.464%20-1.43051e-06C24.736%20-1.43051e-06%2025.66%200.227999%2026.236%200.684C26.836%201.116%2027.136%201.908%2027.136%203.06C27.136%205.124%2025.912%206.156%2023.464%206.156ZM20.152%2023.832V7.704H26.704V23.832H20.152ZM37.4767%2023.832L29.6647%207.704H36.9007L40.3207%2016.524L41.2567%2019.116H41.6167L42.5527%2016.524L46.0087%207.704H53.1727L52.5967%209.9L45.4327%2023.832H37.4767ZM61.1953%2023.832C59.6113%2023.832%2058.3873%2023.604%2057.5233%2023.148C56.6833%2022.692%2056.1073%2022.068%2055.7953%2021.276C55.4833%2020.46%2055.3273%2019.524%2055.3273%2018.468V13.032C55.3273%2012.072%2055.4833%2011.196%2055.7953%2010.404C56.1313%209.588%2056.7193%208.94%2057.5593%208.46C58.3993%207.956%2059.6113%207.704%2061.1953%207.704H68.6473C70.5193%207.704%2071.9473%207.932%2072.9313%208.388C73.9393%208.82%2074.6233%209.444%2074.9833%2010.26C75.3673%2011.052%2075.5593%2011.976%2075.5593%2013.032V17.64H69.2593C67.0993%2017.64%2065.4553%2017.592%2064.3273%2017.496C63.2233%2017.4%2062.4433%2017.34%2061.9873%2017.316V17.856C61.9633%2018.816%2062.5393%2019.296%2063.7153%2019.296H64.8313C66.7513%2019.296%2068.5273%2019.26%2070.1593%2019.188C71.7913%2019.092%2073.0033%2019.008%2073.7953%2018.936L75.9553%2022.356C75.9553%2022.596%2075.7513%2022.824%2075.3433%2023.04C74.9353%2023.256%2074.2153%2023.448%2073.1833%2023.616C72.1753%2023.76%2070.7353%2023.832%2068.8633%2023.832H61.1953ZM61.9873%2014.184H68.8993V13.68C68.8993%2013.2%2068.8513%2012.864%2068.7553%2012.672C68.6833%2012.48%2068.4313%2012.36%2067.9993%2012.312C67.5673%2012.264%2066.8353%2012.24%2065.8033%2012.24H63.7153C62.5633%2012.24%2061.9873%2012.72%2061.9873%2013.68V14.184ZM85.8224%2023.832C83.9984%2023.832%2082.7504%2023.448%2082.0784%2022.68C81.4064%2021.912%2081.0704%2020.76%2081.0704%2019.224V12.24H78.1184V7.704H79.6304C80.0384%207.704%2080.3624%207.632%2080.6024%207.488C80.8664%207.32%2081.0344%207.032%2081.1064%206.624L81.7904%202.772H87.6944V7.704H93.7064V12.24H87.6944V17.82C87.6944%2018.42%2087.8384%2018.816%2088.1264%2019.008C88.4144%2019.2%2088.8464%2019.296%2089.4224%2019.296H93.0224L93.7424%2023.472C93.2384%2023.544%2092.4704%2023.628%2091.4384%2023.724C90.4064%2023.796%2089.2784%2023.832%2088.0544%2023.832H85.8224Z'%20fill='%23FF3300'/%3e%3c/svg%3e",AZ=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:RZ,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(p0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),IZ="data:image/svg+xml,%3csvg%20width='548'%20height='565'%20viewBox='0%200%20548%20565'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M136.53%20-0.00177124C170.301%20-0.00177124%20197.687%2027.3551%20197.724%2061.1255L198.089%20394.976C198.189%20486.214%20124.253%20560.23%2033.0153%20560.23C14.7818%20560.23%200.000557184%20545.449%200.000557184%20527.216V61.1923C0.000557184%2027.3957%2027.3981%20-0.00177124%2061.1947%20-0.00177124H136.53Z'%20fill='white'/%3e%3cpath%20d='M271.092%20463.876C271.092%20530.762%20310.368%20564.205%20388.919%20564.205C468.248%20564.205%20507.913%20530.762%20507.913%20463.876C507.913%20426.545%20498.191%20400.88%20478.748%20386.88C460.082%20372.103%20430.139%20364.715%20388.919%20364.715C350.032%20364.715%20320.478%20372.103%20300.257%20386.88C280.814%20400.88%20271.092%20426.545%20271.092%20463.876Z'%20fill='white'/%3e%3cpath%20d='M405.25%200.917969C408.273%200.917973%20411.331%201.11183%20414.358%201.66895C437.891%205.99962%20471.151%2018.8698%20498.612%2044.5137C526.065%2070.1496%20547.676%20108.515%20547.992%20163.691C547.992%20163.693%20547.994%20163.695%20547.997%20163.695C547.999%20163.695%20548.001%20163.697%20548.001%20163.7L547.996%20164.612L548.001%20165.526C548.001%20165.528%20547.999%20165.53%20547.997%20165.53C547.994%20165.53%20547.992%20165.532%20547.992%20165.535C547.665%20222.498%20524.643%20261.54%20495.935%20287.156C467.223%20312.776%20432.863%20324.939%20409.917%20328.291C409.844%20328.302%20409.769%20328.308%20409.695%20328.308H283.146C254.52%20328.308%20231.314%20305.102%20231.314%20276.477C231.315%20244.265%20255.799%20218.161%20287.447%20213.026C309.663%20209.422%20329.612%20204.399%20344.084%20196.322C354.361%20190.586%20359.717%20184.074%20362.521%20178.421C365.332%20172.756%20365.636%20167.843%20365.636%20165.225V163.994C365.635%20161.374%20365.33%20156.465%20362.521%20150.805C359.717%20145.152%20354.361%20138.639%20344.084%20132.903C329.612%20124.826%20309.663%20119.803%20287.447%20116.199C255.799%20111.065%20231.315%2084.9602%20231.314%2052.749C231.314%2024.1235%20254.52%200.917969%20283.146%200.917969H405.25Z'%20fill='white'/%3e%3c/svg%3e",Qm=44,dd=8,wp=16,MZ=4,g8=-18,OZ=.18,LZ=[.22,1,.36,1],v8=.92,DZ=1,NZ=.95,jZ=.4,FZ=[.19,1,.22,1],j1=0,VZ=1,$Z=0,HZ=0,zZ=0,dI=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+dd,s=Math.max(r,e.width-Qm-dd),i=Math.max(dd,e.height-Qm-dd);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(dd,t.y))}},vw=()=>({width:window.innerWidth,height:window.innerHeight}),UZ=({position:t,boundsLeftPx:e=0})=>dI({position:t,viewport:vw(),boundsLeft:e}),BZ=()=>{if(typeof window>"u")return{x:wp,y:wp};const t=vw();return{x:t.width-Qm-wp,y:t.height-Qm-wp}},WZ=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=MZ,GZ=t=>t.button===void 0||t.button<=zZ,y8=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},KZ=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const u=g.useRef(null),c=g.useRef(!1),[d,h]=g.useState(!1),[p,m]=g.useState(!1),y=n?!1:{opacity:j1,scale:v8,x:g8},x=n?{opacity:j1}:{opacity:j1,scale:v8,x:g8},_=n?{duration:HZ}:{duration:OZ,ease:LZ,scale:{duration:jZ,ease:FZ}},w=g.useCallback(()=>{const R=u.current;R&&(c.current=R.hasMoved),u.current=null,h(!1)},[]),E=g.useCallback(R=>{const L=u.current;if(!L)return;const O=y8(R),A=O.x-L.startPointer.x,M=O.y-L.startPointer.y,D=L.hasMoved||WZ({deltaX:A,deltaY:M});u.current={...L,hasMoved:D},D&&a(dI({position:{x:L.startPosition.x+A,y:L.startPosition.y+M},viewport:vw(),boundsLeft:s}))},[a,s]),P=g.useCallback(R=>{if(u.current||!GZ(R))return;const L=y8(R);u.current={startPointer:L,startPosition:r,hasMoved:!1},h(!0)},[r]),T=g.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),k=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:E,onPointerUp:w,onPointerCancel:w,onMouseMove:E,onMouseUp:w}):null,S.jsx(ro,{children:t?S.jsx(to,{label:k,side:"top",forceOpen:p&&!d?void 0:!1,children:S.jsx(_l.button,{type:"button","aria-label":k,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:y,animate:{opacity:VZ,scale:DZ,x:$Z},whileTap:{scale:NZ},exit:x,transition:_,onPointerDown:P,onMouseDown:P,onPointerMove:E,onPointerUp:w,onPointerCancel:w,onMouseMove:E,onMouseUp:w,onClick:T,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:IZ,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},F1=ks("useConfig"),qZ=300*1e3,ZZ=1800*1e3,YZ=60*1e3,XZ=300*1e3,QZ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},JZ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},eY=t=>({...r5,...t??{}}),tY=()=>{const t=Je($_),e=ot($_),n=ot(h5),r=ot(p5),s=ot(m0),i=ot(fB),a=ot(f5),u=ot(cB),c=ot(Af),d=ot(a5),h=ot(fc),p=g.useCallback(P=>{a(P.agentModeAvailable),d({name:P.name??null,email:P.email??null}),h(P.demoMode===!0),P.isMCPSession&&n(!0),P.mcpEditor&&r(P.mcpEditor),s(P.agentApplyMode??JZ()??null),i(P.queueAccessToken??QZ())},[s,a,h,n,r,i,d]),m=oy({queryKey:["rivet-config"],queryFn:async()=>{const P=await fetch("/api/config");if(!P.ok)throw new Error(`Failed to fetch config: ${P.statusText}`);return await P.json()},staleTime:qZ,gcTime:ZZ}),y=oy({queryKey:["rivet-feature-flags"],queryFn:async()=>{const P=await fetch("/api/feature-flags");if(!P.ok)throw new Error(`Failed to fetch feature flags: ${P.statusText}`);return await P.json()},staleTime:YZ,gcTime:XZ}),{refetch:x}=m,{refetch:_}=y;g.useLayoutEffect(()=>{m.data&&(p(m.data),c(!1),F1.info("Config loaded:",m.data)),y.data&&(e(eY(y.data.featureFlags)),u(!0))},[m.data,y.data,p,c,e,u]),g.useLayoutEffect(()=>{m.error&&(u(!0),c(!1),F1.warn("Failed to load config:",m.error instanceof Error?m.error.message:"Failed to load config")),y.error&&(u(!0),F1.warn("Failed to load feature flags:",y.error instanceof Error?y.error.message:"Failed to load feature flags"))},[m.error,y.error,c,u]);const w=g.useCallback(async()=>{const[P]=await Promise.all([x(),_()]);return P.data?P.data:null},[x,_]);let E=null;return m.error instanceof Error?E=m.error.message:m.error&&(E="Failed to load config"),{config:m.data??null,featureFlags:t,loading:m.isPending||!m.error&&y.isPending,error:E,refetchConfig:w}},qp="rivet_just_signed_in",hu=ks("useOAuthCallback"),nY="https://rivet-proxy.onrender.com",rY=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var u,c,d;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{hu.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),m=h.get("refresh_token"),x=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");hu.info(`Completing OAuth with session: ${x}`);const _=await fetch(`${nY}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:m}),signal:n.signal}),w=await _.json();if(!_.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(hu.info("OAuth authentication completed successfully"),r)return;if((u=w.user)!=null&&u.id?(Ce.identify(w.user.id,{...w.user.email?{email:w.user.email}:{}}),w.user.email&&Ce.alias(w.user.email,w.user.id)):(c=w.user)!=null&&c.email&&Ce.identify(w.user.email,{email:w.user.email}),(d=w.user)!=null&&d.email&&p)try{const P=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:p,refreshToken:m,userId:w.user.id}),signal:n.signal});P.ok||hu.warn(`Local auth store returned ${P.status}`)}catch(P){if(r)return;hu.warn("Failed to store auth locally:",P)}if(r)return;window.sessionStorage.setItem(qp,"1");const E=window.location.pathname;window.history.replaceState({},document.title,E),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";hu.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},V1=ks("useAgentVariantsSession"),sY=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,_8=(t,e,n)=>{e.size===0&&!n||t.set(tf,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[a,u]of r)u.status==="sending"&&u.variantRequestId&&(e.has(u.variantRequestId)||n&&u.variantRequest!==void 0)&&(s.delete(a),i=!0);return i?s:r})},iY=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,a]of t){if(a.status!=="sending"||!a.awaitingSnapshotOutcome||a.variantRequest!==void 0)continue;const u=a.target;if(!u||u.kind!=="variant"||u.sessionId!==e.sessionId)continue;const c=(s=e.variants.find(d=>d.workItemId===u.variantId))==null?void 0:s.refinement;c&&(c.status==="succeeded"?(r.set(i,{...a,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(c.status==="failed"||c.status==="cancelled")&&(r.set(i,{...a,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},oY=({enabled:t=!0}={})=>{const e=ot(Rf),n=ot(s5),r=ot(iB),s=ot(c5),i=ot(uB),a=$2(),u=g.useRef(null);g.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=d=>{try{const h=JSON.parse(d.data),p=u.current;if(h.active){const x=new Set(h.variants.map(_=>_.requestId).filter(_=>!!_));s(_=>_.filter(E=>!x.has(E.requestId))),_8(a,x,!1),a.set(tf,_=>{let w=_;for(const E of h.variants){const P=E.adoptedSource;P&&(w=lB(w,{kind:"variant",sessionId:P.sessionId,variantId:P.variantId},{kind:"variant",sessionId:h.sessionId,variantId:E.workItemId}))}return w}),a.set(tf,_=>iY(_,h)),h.sessionId!==u.current&&(u.current=h.sessionId,n(!0),r("directions"))}else u.current=null,_8(a,new Set,sY(h));e(h);const m=!h.active&&p!==null,y=h.active&&h.sessionId!==p;if(y&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(x=>V1.warn("failed to reset preview-port on session switch",x)),m||y){const x=new Set;if(h.active)for(const w of h.variants)x.add(Jd({kind:"variant",sessionId:h.sessionId,variantId:w.workItemId}));const _=a.get(lo);for(const w of[_==null?void 0:_.left,_==null?void 0:_.right])w&&x.add(Jd({kind:"variant",sessionId:w.sessionId,variantId:w.variantId}));i(x)}}catch(h){V1.warn("failed to parse SSE event payload",h)}},c.onerror=d=>{V1.warn("SSE error (auto-reconnects)",d)},()=>{c.close()}},[t,e,n,r,s,i,a])};var aY=Object.defineProperty,Rn=(t,e)=>aY(t,"name",{value:e,configurable:!0});function yw(t){const e=t+"CollectionProvider",[n,r]=wi(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=Rn(_=>{const{scope:w,children:E}=_,P=g.useRef(null),T=g.useRef(new Map).current;return S.jsx(s,{scope:w,itemMap:T,collectionRef:P,children:E})},"CollectionProvider");a.displayName=e;const u=t+"CollectionSlot",c=aa(u),d=g.forwardRef((_,w)=>{const{scope:E,children:P}=_,T=i(u,E),k=Ft(w,T.collectionRef);return S.jsx(c,{ref:k,children:P})});d.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",m=aa(h),y=g.forwardRef((_,w)=>{const{scope:E,children:P,...T}=_,k=g.useRef(null),R=Ft(w,k),L=i(h,E);return g.useEffect(()=>(L.itemMap.set(k,{ref:k,...T}),()=>void L.itemMap.delete(k))),S.jsx(m,{[p]:"",ref:R,children:P})});y.displayName=h;function x(_){const w=i(t+"CollectionConsumer",_);return g.useCallback(()=>{const P=w.collectionRef.current;if(!P)return[];const T=Array.from(P.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((L,O)=>T.indexOf(L.ref.current)-T.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return Rn(x,"useCollection"),[{Provider:a,Slot:d,ItemSlot:y},x,r]}Rn(yw,"createCollection");var x8=new WeakMap,pn,Wr,$1=(Wr=class extends Map{constructor(n){super(n);ze(this,pn);Ae(this,pn,[...super.keys()]),x8.set(this,!0)}set(n,r){return x8.get(this)&&(this.has(n)?U(this,pn)[U(this,pn).indexOf(n)]=n:U(this,pn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),a=U(this,pn).length,u=_w(n);let c=u>=0?u:a+u;const d=c<0||c>=a?-1:c;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const h=this.size+(i?0:1);u<0&&c++;const p=[...U(this,pn)];let m,y=!1;for(let x=c;x<h;x++)if(c===x){let _=p[x];p[x]===r&&(_=p[x+1]),i&&this.delete(r),m=this.get(_),this.set(r,s)}else{!y&&p[x-1]===r&&(y=!0);const _=p[y?x:x-1],w=m;m=this.get(_),this.delete(_),this.set(_,w)}return this}with(n,r,s){const i=new Wr(this);return i.insert(n,r,s),i}before(n){const r=U(this,pn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=U(this,pn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=U(this,pn).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=U(this,pn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ae(this,pn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&U(this,pn).splice(U(this,pn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Zp(U(this,pn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Zp(U(this,pn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return U(this,pn).indexOf(n)}keyAt(n){return Zp(U(this,pn),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const a of this)Reflect.apply(n,r,[a,i,this])&&s.push(a),i++;return new Wr(s)}map(n,r){const s=[];let i=0;for(const a of this)s.push([a[0],Reflect.apply(n,r,[a,i,this])]),i++;return new Wr(s)}reduce(...n){const[r,s]=n;let i=0,a=s??this.at(0);for(const u of this)i===0&&n.length===1?a=u:a=Reflect.apply(r,this,[a,u,i,this]),i++;return a}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let a=this.size-1;a>=0;a--){const u=this.at(a);a===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,a,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Wr(r)}toReversed(){const n=new Wr;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Wr(r)}slice(n,r){const s=new Wr;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let a=n;a<=i;a++){const u=this.keyAt(a),c=this.get(u);s.set(u,c)}return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},pn=new WeakMap,Rn(Wr,"OrderedDict"),Wr);function Zp(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=fI(t,e);return n===-1?void 0:t[n]}Rn(Zp,"at");function fI(t,e){const n=t.length,r=_w(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Rn(fI,"toSafeIndex");function _w(t){return t!==t||t===0?0:Math.trunc(t)}Rn(_w,"toSafeInteger");function lY(t){const e=t+"CollectionProvider",[n,r]=wi(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new $1,setItemMap:Rn(()=>{},"setItemMap")}),a=Rn(({state:T,...k})=>T?S.jsx(c,{...k,state:T}):S.jsx(u,{...k}),"CollectionProvider");a.displayName=e;const u=Rn(T=>{const k=w();return S.jsx(c,{...T,state:k})},"CollectionInit");u.displayName=e+"Init";const c=Rn(T=>{const{scope:k,children:R,state:L}=T,O=g.useRef(null),[A,M]=g.useState(null),D=Ft(O,M),[F,N]=L;return g.useEffect(()=>{if(!A)return;const G=mI(()=>{});return G.observe(A,{childList:!0,subtree:!0}),()=>{G.disconnect()}},[A]),S.jsx(s,{scope:k,itemMap:F,setItemMap:N,collectionRef:D,collectionRefObject:O,collectionElement:A,children:R})},"CollectionProviderImpl");c.displayName=e+"Impl";const d=t+"CollectionSlot",h=aa(d),p=g.forwardRef((T,k)=>{const{scope:R,children:L}=T,O=i(d,R),A=Ft(k,O.collectionRef);return S.jsx(h,{ref:A,children:L})});p.displayName=d;const m=t+"CollectionItemSlot",y="data-radix-collection-item",x=aa(m),_=g.forwardRef((T,k)=>{const{scope:R,children:L,...O}=T,A=g.useRef(null),[M,D]=g.useState(null),F=Ft(k,A,D),N=i(m,R),{setItemMap:G}=N,Z=g.useRef(O);hI(Z.current,O)||(Z.current=O);const Y=Z.current;return g.useEffect(()=>{const B=Y;return G(K=>M?K.has(M)?K.set(M,{...B,element:M}).toSorted(u2):(K.set(M,{...B,element:M}),K.toSorted(u2)):K),()=>{G(K=>!M||!K.has(M)?K:(K.delete(M),new $1(K)))}},[M,Y,G]),S.jsx(x,{[y]:"",ref:F,children:L})});_.displayName=m;function w(){return g.useState(new $1)}Rn(w,"useInitCollection");function E(T){const{itemMap:k}=i(t+"CollectionConsumer",T);return k}return Rn(E,"useCollection"),[{Provider:a,Slot:p,ItemSlot:_},{createCollectionScope:r,useCollection:E,useInitCollection:w}]}Rn(lY,"createCollection");function hI(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}Rn(hI,"shallowEqual");function pI(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Rn(pI,"isElementPreceding");function u2(t,e){return!t[1].element||!e[1].element?0:pI(t[1].element,e[1].element)?-1:1}Rn(u2,"sortByDocumentPosition");function mI(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Rn(mI,"getChildListObserver");var uY=Object.defineProperty,Of=(t,e)=>uY(t,"name",{value:e,configurable:!0}),xw="Collapsible",[cY,gI]=wi(xw),[dY,ww]=cY(xw),fY=g.forwardRef(Of(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:a,onOpenChange:u,...c}=e,[d,h]=pa({prop:s,defaultProp:i??!1,onChange:u,caller:xw});return S.jsx(dY,{scope:r,disabled:a,contentId:Jo(),open:d,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),children:S.jsx(ln.div,{"data-state":T0(d),"data-disabled":a?"":void 0,...c,ref:n})})},"Collapsible")),hY="CollapsibleTrigger",pY=g.forwardRef(Of(function(e,n){const{__scopeCollapsible:r,...s}=e,i=ww(hY,r);return S.jsx(ln.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":T0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Nt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),vI="CollapsibleContent",mY=g.forwardRef(Of(function(e,n){const{forceMount:r,...s}=e,i=ww(vI,e.__scopeCollapsible);return S.jsx(ma,{present:r||i.open,children:({present:a})=>S.jsx(gY,{...s,ref:n,present:a})})},"CollapsibleContent")),gY=g.forwardRef(Of(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...a}=e,u=ww(vI,r),[c,d]=g.useState(s),h=g.useRef(null),p=Ft(n,h),m=g.useRef(0),y=m.current,x=g.useRef(0),_=x.current,w=u.open||c,E=g.useRef(w),P=g.useRef(void 0);return g.useEffect(()=>{const T=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(T)},[]),Ar(()=>{const T=h.current;if(T){P.current=P.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const k=T.getBoundingClientRect();m.current=k.height,x.current=k.width,E.current||(T.style.transitionDuration=P.current.transitionDuration,T.style.animationName=P.current.animationName),d(s)}},[u.open,s]),S.jsx(ln.div,{"data-state":T0(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...a,ref:p,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function T0(t){return t?"open":"closed"}Of(T0,"getState");var vY=fY,yY=pY,_Y=mY,xY=Object.defineProperty,wY=(t,e)=>xY(t,"name",{value:e,configurable:!0}),bY=g.createContext(void 0);function bw(t){const e=g.useContext(bY);return t||e||"ltr"}wY(bw,"useDirection");var SY=Object.defineProperty,ts=(t,e)=>SY(t,"name",{value:e,configurable:!0}),bi="Accordion",EY=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Sw,CY,kY]=yw(bi),[R0,eee]=wi(bi,[kY,gI]),Ew=gI(),PY=g.forwardRef(ts(function(e,n){const{type:r,...s}=e,i=s,a=s;return S.jsx(Sw.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?S.jsx(IY,{...a,ref:n}):S.jsx(AY,{...i,ref:n})})},"Accordion")),[yI,TY]=R0(bi),[_I,RY]=R0(bi,{collapsible:!1}),AY=g.forwardRef(ts(function(e,n){const{value:r,defaultValue:s,onValueChange:i=ts(()=>{},"onValueChange"),collapsible:a=!1,...u}=e,[c,d]=pa({prop:r,defaultProp:s??"",onChange:i,caller:bi});return S.jsx(yI,{scope:e.__scopeAccordion,value:g.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:g.useCallback(()=>a&&d(""),[a,d]),children:S.jsx(_I,{scope:e.__scopeAccordion,collapsible:a,children:S.jsx(xI,{...u,ref:n})})})},"AccordionImplSingle")),IY=g.forwardRef(ts(function(e,n){const{value:r,defaultValue:s,onValueChange:i=ts(()=>{},"onValueChange"),...a}=e,[u,c]=pa({prop:r,defaultProp:s??[],onChange:i,caller:bi}),d=g.useCallback(p=>c((m=[])=>[...m,p]),[c]),h=g.useCallback(p=>c((m=[])=>m.filter(y=>y!==p)),[c]);return S.jsx(yI,{scope:e.__scopeAccordion,value:u,onItemOpen:d,onItemClose:h,children:S.jsx(_I,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(xI,{...a,ref:n})})})},"AccordionImplMultiple")),[MY,A0]=R0(bi),xI=g.forwardRef(ts(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:a="vertical",...u}=e,c=g.useRef(null),d=Ft(c,n),h=CY(r),m=bw(i)==="ltr",y=Nt(e.onKeyDown,x=>{var M;if(!EY.includes(x.key))return;const _=x.target,w=h().filter(D=>{var F;return!((F=D.ref.current)!=null&&F.disabled)}),E=w.findIndex(D=>D.ref.current===_),P=w.length;if(E===-1)return;x.preventDefault();let T=E;const k=0,R=P-1,L=ts(()=>{T=E+1,T>R&&(T=k)},"moveNext"),O=ts(()=>{T=E-1,T<k&&(T=R)},"movePrev");switch(x.key){case"Home":T=k;break;case"End":T=R;break;case"ArrowRight":a==="horizontal"&&(m?L():O());break;case"ArrowDown":a==="vertical"&&L();break;case"ArrowLeft":a==="horizontal"&&(m?O():L());break;case"ArrowUp":a==="vertical"&&O();break}const A=T%P;(M=w[A].ref.current)==null||M.focus()});return S.jsx(MY,{scope:r,disabled:s,direction:i,orientation:a,children:S.jsx(Sw.Slot,{scope:r,children:S.jsx(ln.div,{...u,"data-orientation":a,ref:d,onKeyDown:s?void 0:y})})})},"AccordionImpl")),c2="AccordionItem",[OY,Cw]=R0(c2),LY=g.forwardRef(ts(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,a=A0(c2,r),u=TY(c2,r),c=Ew(r),d=Jo(),h=s&&u.value.includes(s)||!1,p=a.disabled||e.disabled;return S.jsx(OY,{scope:r,open:h,disabled:p,triggerId:d,children:S.jsx(vY,{"data-orientation":a.orientation,"data-state":kw(h),...c,...i,ref:n,disabled:p,open:h,onOpenChange:m=>{m?u.onItemOpen(s):u.onItemClose(s)}})})},"AccordionItem")),DY="AccordionHeader",NY=g.forwardRef(ts(function(e,n){const{__scopeAccordion:r,...s}=e,i=A0(bi,r),a=Cw(DY,r);return S.jsx(ln.h3,{"data-orientation":i.orientation,"data-state":kw(a.open),"data-disabled":a.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),w8="AccordionTrigger",jY=g.forwardRef(ts(function(e,n){const{__scopeAccordion:r,...s}=e,i=A0(bi,r),a=Cw(w8,r),u=RY(w8,r),c=Ew(r);return S.jsx(Sw.ItemSlot,{scope:r,children:S.jsx(yY,{"aria-disabled":a.open&&!u.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),FY="AccordionContent",VY=g.forwardRef(ts(function(e,n){const{__scopeAccordion:r,...s}=e,i=A0(bi,r),a=Cw(FY,r),u=Ew(r);return S.jsx(_Y,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...u,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function kw(t){return t?"open":"closed"}ts(kw,"getState");var wI=PY,$Y=LY,HY=NY,zY=jY,UY=VY;/**
129
- * @license lucide-react v1.26.0 - ISC
130
- *
131
- * This source code is licensed under the ISC license.
132
- * See the LICENSE file in the root directory of this source tree.
133
- */const bI=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
134
- * @license lucide-react v1.26.0 - ISC
135
- *
136
- * This source code is licensed under the ISC license.
137
- * See the LICENSE file in the root directory of this source tree.
138
- */const BY=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
139
- * @license lucide-react v1.26.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */const WY=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
144
- * @license lucide-react v1.26.0 - ISC
145
- *
146
- * This source code is licensed under the ISC license.
147
- * See the LICENSE file in the root directory of this source tree.
148
- */const b8=t=>{const e=WY(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
149
- * @license lucide-react v1.26.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */var H1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
154
- * @license lucide-react v1.26.0 - ISC
155
- *
156
- * This source code is licensed under the ISC license.
157
- * See the LICENSE file in the root directory of this source tree.
158
- */const GY=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},KY=g.createContext({}),qY=()=>g.useContext(KY),ZY=g.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:y=""}=qY()??{},x=r??p?Number(n??h)*24/Number(e??d):n??h;return g.createElement("svg",{ref:c,...H1,width:e??d??H1.width,height:e??d??H1.height,stroke:t??m,strokeWidth:x,className:bI("lucide",y,s),...!i&&!GY(u)&&{"aria-hidden":"true"},...u},[...a.map(([_,w])=>g.createElement(_,w)),...Array.isArray(i)?i:[i]])});/**
159
- * @license lucide-react v1.26.0 - ISC
160
- *
161
- * This source code is licensed under the ISC license.
162
- * See the LICENSE file in the root directory of this source tree.
163
- */const et=(t,e)=>{const n=g.forwardRef(({className:r,...s},i)=>g.createElement(ZY,{ref:i,iconNode:e,className:bI(`lucide-${BY(b8(t))}`,`lucide-${t}`,r),...s}));return n.displayName=b8(t),n};/**
164
- * @license lucide-react v1.26.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */const YY=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],XY=et("arrow-left",YY);/**
169
- * @license lucide-react v1.26.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */const QY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],JY=et("arrow-right",QY);/**
174
- * @license lucide-react v1.26.0 - ISC
175
- *
176
- * This source code is licensed under the ISC license.
177
- * See the LICENSE file in the root directory of this source tree.
178
- */const eX=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],tX=et("arrow-up",eX);/**
179
- * @license lucide-react v1.26.0 - ISC
180
- *
181
- * This source code is licensed under the ISC license.
182
- * See the LICENSE file in the root directory of this source tree.
183
- */const nX=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],rX=et("bell",nX);/**
184
- * @license lucide-react v1.26.0 - ISC
185
- *
186
- * This source code is licensed under the ISC license.
187
- * See the LICENSE file in the root directory of this source tree.
188
- */const sX=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],iX=et("brain",sX);/**
189
- * @license lucide-react v1.26.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */const oX=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],aX=et("check",oX);/**
194
- * @license lucide-react v1.26.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */const lX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],uX=et("chevron-down",lX);/**
199
- * @license lucide-react v1.26.0 - ISC
200
- *
201
- * This source code is licensed under the ISC license.
202
- * See the LICENSE file in the root directory of this source tree.
203
- */const cX=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],dX=et("chevron-right",cX);/**
204
- * @license lucide-react v1.26.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */const fX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],hX=et("circle",fX);/**
209
- * @license lucide-react v1.26.0 - ISC
210
- *
211
- * This source code is licensed under the ISC license.
212
- * See the LICENSE file in the root directory of this source tree.
213
- */const pX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],mX=et("clock",pX);/**
214
- * @license lucide-react v1.26.0 - ISC
215
- *
216
- * This source code is licensed under the ISC license.
217
- * See the LICENSE file in the root directory of this source tree.
218
- */const gX=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],vX=et("copy",gX);/**
219
- * @license lucide-react v1.26.0 - ISC
220
- *
221
- * This source code is licensed under the ISC license.
222
- * See the LICENSE file in the root directory of this source tree.
223
- */const yX=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],_X=et("dot",yX);/**
224
- * @license lucide-react v1.26.0 - ISC
225
- *
226
- * This source code is licensed under the ISC license.
227
- * See the LICENSE file in the root directory of this source tree.
228
- */const xX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],wX=et("globe",xX);/**
229
- * @license lucide-react v1.26.0 - ISC
230
- *
231
- * This source code is licensed under the ISC license.
232
- * See the LICENSE file in the root directory of this source tree.
233
- */const bX=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],SX=et("heart",bX);/**
234
- * @license lucide-react v1.26.0 - ISC
235
- *
236
- * This source code is licensed under the ISC license.
237
- * See the LICENSE file in the root directory of this source tree.
238
- */const EX=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],CX=et("house",EX);/**
239
- * @license lucide-react v1.26.0 - ISC
240
- *
241
- * This source code is licensed under the ISC license.
242
- * See the LICENSE file in the root directory of this source tree.
243
- */const kX=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],PX=et("image",kX);/**
244
- * @license lucide-react v1.26.0 - ISC
245
- *
246
- * This source code is licensed under the ISC license.
247
- * See the LICENSE file in the root directory of this source tree.
248
- */const TX=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],RX=et("inbox",TX);/**
249
- * @license lucide-react v1.26.0 - ISC
250
- *
251
- * This source code is licensed under the ISC license.
252
- * See the LICENSE file in the root directory of this source tree.
253
- */const AX=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],IX=et("lightbulb",AX);/**
254
- * @license lucide-react v1.26.0 - ISC
255
- *
256
- * This source code is licensed under the ISC license.
257
- * See the LICENSE file in the root directory of this source tree.
258
- */const MX=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],OX=et("link",MX);/**
259
- * @license lucide-react v1.26.0 - ISC
260
- *
261
- * This source code is licensed under the ISC license.
262
- * See the LICENSE file in the root directory of this source tree.
263
- */const LX=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],DX=et("loader",LX);/**
264
- * @license lucide-react v1.26.0 - ISC
265
- *
266
- * This source code is licensed under the ISC license.
267
- * See the LICENSE file in the root directory of this source tree.
268
- */const NX=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],jX=et("lock",NX);/**
269
- * @license lucide-react v1.26.0 - ISC
270
- *
271
- * This source code is licensed under the ISC license.
272
- * See the LICENSE file in the root directory of this source tree.
273
- */const FX=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],VX=et("mail",FX);/**
274
- * @license lucide-react v1.26.0 - ISC
275
- *
276
- * This source code is licensed under the ISC license.
277
- * See the LICENSE file in the root directory of this source tree.
278
- */const $X=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],HX=et("menu",$X);/**
279
- * @license lucide-react v1.26.0 - ISC
280
- *
281
- * This source code is licensed under the ISC license.
282
- * See the LICENSE file in the root directory of this source tree.
283
- */const zX=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],UX=et("message-circle",zX);/**
284
- * @license lucide-react v1.26.0 - ISC
285
- *
286
- * This source code is licensed under the ISC license.
287
- * See the LICENSE file in the root directory of this source tree.
288
- */const BX=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],WX=et("monitor",BX);/**
289
- * @license lucide-react v1.26.0 - ISC
290
- *
291
- * This source code is licensed under the ISC license.
292
- * See the LICENSE file in the root directory of this source tree.
293
- */const GX=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],KX=et("moon",GX);/**
294
- * @license lucide-react v1.26.0 - ISC
295
- *
296
- * This source code is licensed under the ISC license.
297
- * See the LICENSE file in the root directory of this source tree.
298
- */const qX=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],ZX=et("paintbrush",qX);/**
299
- * @license lucide-react v1.26.0 - ISC
300
- *
301
- * This source code is licensed under the ISC license.
302
- * See the LICENSE file in the root directory of this source tree.
303
- */const YX=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],XX=et("palette",YX);/**
304
- * @license lucide-react v1.26.0 - ISC
305
- *
306
- * This source code is licensed under the ISC license.
307
- * See the LICENSE file in the root directory of this source tree.
308
- */const QX=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],JX=et("pause",QX);/**
309
- * @license lucide-react v1.26.0 - ISC
310
- *
311
- * This source code is licensed under the ISC license.
312
- * See the LICENSE file in the root directory of this source tree.
313
- */const eQ=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],tQ=et("pencil",eQ);/**
314
- * @license lucide-react v1.26.0 - ISC
315
- *
316
- * This source code is licensed under the ISC license.
317
- * See the LICENSE file in the root directory of this source tree.
318
- */const nQ=[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]],rQ=et("pipette",nQ);/**
319
- * @license lucide-react v1.26.0 - ISC
320
- *
321
- * This source code is licensed under the ISC license.
322
- * See the LICENSE file in the root directory of this source tree.
323
- */const sQ=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],iQ=et("play",sQ);/**
324
- * @license lucide-react v1.26.0 - ISC
325
- *
326
- * This source code is licensed under the ISC license.
327
- * See the LICENSE file in the root directory of this source tree.
328
- */const oQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],aQ=et("plus",oQ);/**
329
- * @license lucide-react v1.26.0 - ISC
330
- *
331
- * This source code is licensed under the ISC license.
332
- * See the LICENSE file in the root directory of this source tree.
333
- */const lQ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],uQ=et("rectangle-horizontal",lQ);/**
334
- * @license lucide-react v1.26.0 - ISC
335
- *
336
- * This source code is licensed under the ISC license.
337
- * See the LICENSE file in the root directory of this source tree.
338
- */const cQ=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],dQ=et("rocket",cQ);/**
339
- * @license lucide-react v1.26.0 - ISC
340
- *
341
- * This source code is licensed under the ISC license.
342
- * See the LICENSE file in the root directory of this source tree.
343
- */const fQ=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],hQ=et("rotate-ccw",fQ);/**
344
- * @license lucide-react v1.26.0 - ISC
345
- *
346
- * This source code is licensed under the ISC license.
347
- * See the LICENSE file in the root directory of this source tree.
348
- */const pQ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],mQ=et("search",pQ);/**
349
- * @license lucide-react v1.26.0 - ISC
350
- *
351
- * This source code is licensed under the ISC license.
352
- * See the LICENSE file in the root directory of this source tree.
353
- */const gQ=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vQ=et("settings",gQ);/**
354
- * @license lucide-react v1.26.0 - ISC
355
- *
356
- * This source code is licensed under the ISC license.
357
- * See the LICENSE file in the root directory of this source tree.
358
- */const yQ=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],_Q=et("shield",yQ);/**
359
- * @license lucide-react v1.26.0 - ISC
360
- *
361
- * This source code is licensed under the ISC license.
362
- * See the LICENSE file in the root directory of this source tree.
363
- */const xQ=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],wQ=et("skip-forward",xQ);/**
364
- * @license lucide-react v1.26.0 - ISC
365
- *
366
- * This source code is licensed under the ISC license.
367
- * See the LICENSE file in the root directory of this source tree.
368
- */const bQ=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],SQ=et("square-library",bQ);/**
369
- * @license lucide-react v1.26.0 - ISC
370
- *
371
- * This source code is licensed under the ISC license.
372
- * See the LICENSE file in the root directory of this source tree.
373
- */const EQ=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],CQ=et("star",EQ);/**
374
- * @license lucide-react v1.26.0 - ISC
375
- *
376
- * This source code is licensed under the ISC license.
377
- * See the LICENSE file in the root directory of this source tree.
378
- */const kQ=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],PQ=et("sun",kQ);/**
379
- * @license lucide-react v1.26.0 - ISC
380
- *
381
- * This source code is licensed under the ISC license.
382
- * See the LICENSE file in the root directory of this source tree.
383
- */const TQ=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],RQ=et("user",TQ);/**
384
- * @license lucide-react v1.26.0 - ISC
385
- *
386
- * This source code is licensed under the ISC license.
387
- * See the LICENSE file in the root directory of this source tree.
388
- */const AQ=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],IQ=et("users",AQ);/**
389
- * @license lucide-react v1.26.0 - ISC
390
- *
391
- * This source code is licensed under the ISC license.
392
- * See the LICENSE file in the root directory of this source tree.
393
- */const MQ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],OQ=et("x",MQ),LQ={"chevron-right":dX,"chevron-down":uX,pipette:rQ,x:OQ,copy:vX,menu:HX,dot:_X,monitor:WX,sun:PQ,moon:KX,"rectangle-horizontal":uQ,circle:hX,"square-library":SQ,clock:mX,star:CQ,settings:vQ,plus:aQ,"arrow-left":XY,"arrow-right":JY,"arrow-up":tX,search:mQ,loader:DX,users:IQ,lock:jX,mail:VX,bell:rX,shield:_Q,palette:XX,lightbulb:IX,rocket:dQ,heart:SX,paintbrush:ZX,brain:iX,globe:wX,user:RQ,image:PX,link:OX,check:aX,"rotate-ccw":hQ,play:iQ,pause:JX,home:CX,"message-circle":UX,inbox:RX,pencil:tQ,"skip-forward":wQ},S8={lucide:LQ},SI=g.createContext(null);function DQ(t){const e=g.useContext(SI);return e?S8[e.iconLibrary][t]:S8.lucide[t]}function NQ({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(SI.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const EI=g.createContext(null);function Pw(){return g.useContext(EI)}const CI=g.createContext(null);function kI(){const t=g.useContext(CI);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const jQ=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=g.useRef(null),u=g.useRef(new Map),[c,d]=g.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:m,sessionRef:y,handlers:x,registerItem:_,measureItems:w}=QR(a),E=g.useCallback((oe,se)=>{se?u.current.set(oe,se):u.current.delete(oe)},[]),P=g.useCallback(()=>{if(!a.current)return;const oe=new Map;u.current.forEach((se,ye)=>{oe.set(ye,{top:se.offsetTop,left:se.offsetLeft,width:se.offsetWidth,height:se.offsetHeight})}),d(oe)},[]),[T,k]=g.useState(()=>r==="single"?t.defaultValue??"":""),[R,L]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),O=t.onValueChange,A=t.onValueChange,M=t.value,D=new Set(r==="multiple"?t.value??R:(()=>{const oe=t.value??T;return oe?[oe]:[]})()),F=g.useCallback(oe=>{const se=t;se.onValueChange?se.onValueChange(oe):k(oe)},[O]),N=g.useCallback(oe=>{const se=t;se.onValueChange?se.onValueChange(oe):L(oe)},[A]),G=g.useCallback(oe=>{if(r==="multiple"){const se=t.value??R;N(se.filter(ye=>ye!==oe))}else F("")},[r,F,N,R,M]);g.useEffect(()=>{w(),P()},[w,P,n]);const Z=[...D].join(",");g.useEffect(()=>{w(),P()},[w,P,Z]);const[Y,B]=g.useState(null),K=h!==null?m[h]:null,$=Y!==null?m[Y]:null,J=h!==null&&!c.has(h),H=S0(),{value:j,defaultValue:X,onValueChange:te,collapsible:ie,type:ae,...ue}=i,Se=r==="multiple"?{type:"multiple",value:t.value??R,onValueChange:N}:{type:"single",collapsible:t.collapsible??!0,value:t.value??T,onValueChange:F};return S.jsx(EI.Provider,{value:{registerItem:_,registerFullItem:E,activeIndex:h,grouped:!0,remeasure:()=>{w(),P()},openValues:D,openItemRects:c,toggleValue:G},children:S.jsx(wI,{...Se,asChild:!0,children:S.jsxs("div",{ref:oe=>{a.current=oe,typeof e=="function"?e(oe):e&&(e.current=oe)},onMouseEnter:x.onMouseEnter,onMouseMove:oe=>{const se=a.current;if(se){const ye=se.getBoundingClientRect(),be=se.offsetHeight,Fe=ye.height,Re=be>0?Fe/be:1,We=(oe.clientY-ye.top)/Re+se.scrollTop;for(const[Tt,Ye]of c){const we=m[Tt];if(!we)continue;const It=we.top+we.height,Ee=Ye.top+Ye.height;if(We>=It&&We<=Ee){p(null);return}}}x.onMouseMove(oe)},onMouseLeave:x.onMouseLeave,onFocus:oe=>{var ye;const se=(ye=oe.target.closest("[data-proximity-index]"))==null?void 0:ye.getAttribute("data-proximity-index");if(se!=null){const be=Number(se);p(be),B(oe.target.matches(":focus-visible")?be:null)}},onBlur:oe=>{var se;(se=a.current)!=null&&se.contains(oe.relatedTarget)||(B(null),p(null))},className:hr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ue,children:[S.jsx(ro,{children:[...c.entries()].map(([oe,se])=>S.jsx(so.div,{className:`absolute ${H.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:se.top,left:se.left,width:se.width,height:se.height,opacity:J?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${oe}`))}),S.jsx(ro,{children:K&&S.jsx(so.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:K.top,left:K.left,width:K.width,height:K.height},animate:{opacity:1,top:K.top,left:K.left,width:K.width,height:K.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Qd.fast,opacity:{duration:.08}}},y.current)}),S.jsx(ro,{children:$&&S.jsx(so.div,{className:`absolute ${H.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:$.left-2,top:$.top-2,width:$.width+4,height:$.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Qd.fast,opacity:{duration:.08}}})}),n]})})})});jQ.displayName="AccordionGroup";const PI=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[d,h]=g.useState(()=>e==="single"?r??"":""),[p,m]=g.useState(()=>e==="multiple"?r??[]:[]),y=new Set(e==="multiple"?s??p:(()=>{const P=s??d;return P?[P]:[]})()),x=g.useCallback(P=>{i?i(P):h(P)},[i]),_=g.useCallback(P=>{i?i(P):m(P)},[i]),w=g.useCallback(P=>{e==="multiple"?_((s??p).filter(k=>k!==P)):x("")},[e,s,p,x,_]),E=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:x};return S.jsx(wI,{...E,asChild:!0,children:S.jsx("div",{ref:c,className:hr("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:S.jsx(TI.Provider,{value:y,children:S.jsx(RI.Provider,{value:w,children:t})})})})});PI.displayName="Accordion";const TI=g.createContext(new Set),RI=g.createContext(()=>{}),AI=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=g.useRef(null),c=Pw(),d=g.useContext(TI),h=g.useContext(RI),p=S0(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),y=g.useRef(null),x=g.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):h(t)},[c,h,t]);return g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,y.current),()=>c.registerItem(e,null)},[e,c]),g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return m?c.registerFullItem(e,u.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,m]),S.jsx(CI.Provider,{value:{index:e,value:t,isOpen:m,onToggle:x,triggerRef:y},children:S.jsxs($Y,{ref:_=>{u.current=_,typeof a=="function"?a(_):a&&(a.current=_)},value:t,disabled:n,"data-proximity-index":e,className:hr(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(ro,{children:m&&S.jsx(so.div,{className:`absolute inset-0 ${p.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),r]})})});AI.displayName="AccordionItem";const II=g.forwardRef(({children:t,className:e,...n},r)=>{const s=DQ("chevron-right"),i=Pw(),{index:a,isOpen:u,triggerRef:c}=kI(),d=S0(),[h,p]=g.useState(!1),m=i!=null&&i.grouped?i.activeIndex===a:h,y=S.jsx(HY,{asChild:!0,children:S.jsx("div",{children:S.jsxs(zY,{ref:r,className:hr(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Id.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:hr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?Id.semibold:Id.normal},children:t})]}),S.jsx(so.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:Qd.fast,children:S.jsx(s,{size:16,strokeWidth:u||m?2:1.5,className:hr("transition-[color,stroke-width] duration-80",u||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:y}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(ro,{children:h&&S.jsx(so.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),y]})});II.displayName="AccordionTrigger";const MI=g.forwardRef(({children:t,className:e,...n},r)=>{const s=Pw(),{isOpen:i}=kI();return S.jsx(ro,{initial:!1,children:i&&S.jsx(UY,{forceMount:!0,asChild:!0,...n,children:S.jsx(so.div,{ref:r,className:hr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Qd.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});MI.displayName="AccordionContent";const Yp=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(PI,{type:"multiple",defaultValue:e,className:hr("w-full",n),children:t}),FQ=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return S.jsxs(AI,{value:t,className:hr("w-full",!u&&"border-t border-main-border"),children:[S.jsxs(II,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(MI,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Yp.Item=FQ;const VQ=()=>{const t=g.useRef(Date.now()),[e,n]=g.useState(0);return g.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},$Q=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},E8="M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z",C8="M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",HQ="M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z",Xp=["Applying","Thinking","Planning","Crafting"],zQ=Xp.reduce((t,e)=>t.length>=e.length?t:e),UQ=20,BQ="Still working — runs can take a few minutes.",WQ=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=VQ();g.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%Xp.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=UQ?BQ:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(_l.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(_l.path,{animate:{d:[E8,C8,HQ,C8,E8]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Id.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:zQ}),S.jsx(ro,{mode:"popLayout",initial:!1,children:S.jsx(_l.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:Xp[n]},Xp[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:$Q(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var GQ=Object.defineProperty,KQ=(t,e)=>GQ(t,"name",{value:e,configurable:!0});function Tw(t,[e,n]){return Math.min(n,Math.max(e,t))}KQ(Tw,"clamp");var qQ=Object.defineProperty,ZQ=(t,e)=>qQ(t,"name",{value:e,configurable:!0});function OI(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}ZQ(OI,"usePrevious");var YQ=Object.defineProperty,mt=(t,e)=>YQ(t,"name",{value:e,configurable:!0}),LI=["PageUp","PageDown"],DI=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],NI={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Lf="Slider",[d2,XQ,QQ]=yw(Lf),[Rw,tee]=wi(Lf,[QQ]),[JQ,Df]=Rw(Lf),eJ=g.forwardRef(mt(function(e,n){const{name:r,min:s=0,max:i=100,step:a=1,orientation:u="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[s],value:p,onValueChange:m=mt(()=>{},"onValueChange"),onValueCommit:y=mt(()=>{},"onValueCommit"),inverted:x=!1,form:_,...w}=e,E=g.useRef(new Set),P=g.useRef(0),T=g.useRef(!1),R=u==="horizontal"?tJ:nJ,[L,O]=g.useState(null),A=Ft(n,O),[M=[],D]=pa({prop:p,defaultProp:h,onChange:mt(K=>{var J;(J=[...E.current][P.current])==null||J.focus({preventScroll:!0,focusVisible:T.current}),T.current=!1,m(K)},"onChange")}),F=g.useRef(M),N=g.useRef(M);g.useEffect(()=>{const K=_?L==null?void 0:L.ownerDocument.getElementById(_):L==null?void 0:L.closest("form");if(K instanceof HTMLFormElement){const $=mt(()=>D(N.current),"reset");return K.addEventListener("reset",$),()=>K.removeEventListener("reset",$)}},[L,_,D]);function G(K){const $=BI(M,K);B(K,$)}mt(G,"handleSlideStart");function Z(K){B(K,P.current)}mt(Z,"handleSlideMove");function Y(){String(M)!==String(F.current)&&y(M)}mt(Y,"handleSlideEnd");function B(K,$,{commit:J}={commit:!1}){const H=Iw(a),j=Nd(Math.round((K-s)/a)*a+s,H),X=Tw(j,[s,i]);D((te=[])=>{const ie=zI(te,X,$);if(KI(ie,d*a)){P.current=ie.indexOf(X);const ae=String(ie)!==String(te);return ae&&J&&y(ie),ae?ie:te}else return te})}return mt(B,"updateValues"),S.jsx(JQ,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:P,thumbs:E.current,values:M,orientation:u,form:_,children:S.jsx(d2.Provider,{scope:e.__scopeSlider,children:S.jsx(d2.Slot,{scope:e.__scopeSlider,children:S.jsx(R,{"aria-disabled":c,"data-disabled":c?"":void 0,...w,ref:A,onPointerDown:Nt(w.onPointerDown,()=>{c||(F.current=M,T.current=!1)}),min:s,max:i,inverted:x,onSlideStart:c?void 0:G,onSlideMove:c?void 0:Z,onSlideEnd:c?void 0:Y,onHomeKeyDown:()=>{c||(T.current=!0,B(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(T.current=!0,B(i,M.length-1,{commit:!0}))},onStepKeyDown:({event:K,direction:$})=>{if(!c){T.current=!0;const j=LI.includes(K.key)||K.shiftKey&&DI.includes(K.key)?10:1,X=P.current,te=M[X],ie=qI(te,{min:s,step:a,direction:$,multiplier:j});B(ie,X,{commit:!0})}}})})})})},"Slider")),[jI,FI]=Rw(Lf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tJ=g.forwardRef(mt(function(e,n){const{min:r,max:s,dir:i,inverted:a,onSlideStart:u,onSlideMove:c,onSlideEnd:d,onStepKeyDown:h,...p}=e,[m,y]=g.useState(null),x=Ft(n,y),_=g.useRef(void 0),w=bw(i),E=w==="ltr",P=E&&!a||!E&&a;function T(k){const R=_.current||m.getBoundingClientRect(),L=[0,R.width],A=I0(L,P?[r,s]:[s,r]);return _.current=R,A(k-R.left)}return mt(T,"getValueFromPointer"),S.jsx(jI,{scope:e.__scopeSlider,startEdge:P?"left":"right",endEdge:P?"right":"left",direction:P?1:-1,size:"width",children:S.jsx(VI,{dir:w,"data-orientation":"horizontal",...p,ref:x,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const R=T(k.clientX);u==null||u(R)},onSlideMove:k=>{const R=T(k.clientX);c==null||c(R)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:k=>{const L=NI[P?"from-left":"from-right"].includes(k.key);h==null||h({event:k,direction:L?-1:1})}})})},"SliderHorizontal")),nJ=g.forwardRef(mt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:d,...h}=e,p=g.useRef(null),m=Ft(n,p),y=g.useRef(void 0),x=!i;function _(w){const E=y.current||p.current.getBoundingClientRect(),P=[0,E.height],k=I0(P,x?[s,r]:[r,s]);return y.current=E,k(w-E.top)}return mt(_,"getValueFromPointer"),S.jsx(jI,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:S.jsx(VI,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const E=_(w.clientY);a==null||a(E)},onSlideMove:w=>{const E=_(w.clientY);u==null||u(E)},onSlideEnd:()=>{y.current=void 0,c==null||c()},onStepKeyDown:w=>{const P=NI[x?"from-bottom":"from-top"].includes(w.key);d==null||d({event:w,direction:P?-1:1})}})})},"SliderVertical")),VI=g.forwardRef(mt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:u,onEndKeyDown:c,onStepKeyDown:d,...h}=e,p=Df(Lf,r);return S.jsx(ln.span,{...h,ref:n,onKeyDown:Nt(e.onKeyDown,m=>{m.key==="Home"?(u(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):LI.concat(DI).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:Nt(e.onPointerDown,m=>{const y=m.target;y.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(y)?y.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:Nt(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:Nt(e.onPointerUp,m=>{const y=m.target;y.hasPointerCapture(m.pointerId)&&(y.releasePointerCapture(m.pointerId),a(m))})})},"SliderImpl")),rJ="SliderTrack",sJ=g.forwardRef(mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Df(rJ,r);return S.jsx(ln.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),k8="SliderRange",iJ=g.forwardRef(mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Df(k8,r),a=FI(k8,r),u=g.useRef(null),c=Ft(n,u),d=i.values.length,h=i.values.map(y=>Aw(y,i.min,i.max)),p=d>1?Math.min(...h):0,m=100-Math.max(...h);return S.jsx(ln.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})},"SliderRange")),oJ="SliderThumb",[aJ,$I]=Rw(oJ),lJ="SliderThumbProvider";function HI(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=Df(lJ,e),a=XQ(e),[u,c]=g.useState(null),d=g.useMemo(()=>u?a().findIndex(w=>w.ref.current===u):-1,[a,u]),h=Ux(u),p=u?!!i.form||!!u.closest("form"):!0,m=i.values[d],y=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=m===void 0?0:Aw(m,i.min,i.max);g.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const _={value:m,name:y,form:i.form,isFormControl:p,index:d,thumb:u,onThumbChange:c,percent:x,size:h};return S.jsx(aJ,{scope:e,..._,children:ZI(s)?s(_):r})}mt(HI,"SliderThumbProvider");var z1="SliderThumbTrigger",uJ=g.forwardRef(mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Df(z1,r),a=FI(z1,r),{index:u,value:c,percent:d,size:h,onThumbChange:p}=$I(z1,r),m=Ft(n,p),y=UI(u,i.values.length),x=h==null?void 0:h[a.size],_=x?WI(x,d,a.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${d}% + ${_}px)`},children:S.jsx(d2.ItemSlot,{scope:r,children:S.jsx(ln.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:c===void 0?{display:"none"}:e.style,onFocus:Nt(e.onFocus,()=>{i.valueIndexToChangeRef.current=u})})})})},"SliderThumbTrigger")),cJ=g.forwardRef(mt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(HI,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:a,isFormControl:u})=>S.jsxs(S.Fragment,{children:[S.jsx(uJ,{...i,ref:n,__scopeSlider:r}),u?S.jsx(fJ,{__scopeSlider:r},a):null]})})},"SliderThumb")),dJ="SliderBubbleInput",fJ=g.forwardRef(mt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:a}=$I(dJ,e),u=g.useRef(null),c=Ft(u,r),d=OI(s);return g.useEffect(()=>{const h=u.current;if(!h)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&y){const x=new Event("input",{bubbles:!0});y.call(h,s),h.dispatchEvent(x)}},[d,s]),S.jsx(ln.input,{style:{display:"none"},name:i,form:a,...n,ref:c,defaultValue:s})},"SliderBubbleInput"));function zI(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}mt(zI,"getNextSortedValues");function Aw(t,e,n){const i=100/(n-e)*(t-e);return Tw(i,[0,100])}mt(Aw,"convertValueToPercentage");function UI(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}mt(UI,"getLabel");function BI(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}mt(BI,"getClosestValueIndex");function WI(t,e,n){const r=t/2,i=I0([0,50],[0,r]);return(r-i(e)*n)*n}mt(WI,"getThumbInBoundsOffset");function GI(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}mt(GI,"getStepsBetweenValues");function KI(t,e){if(e>0){const n=GI(t);return Math.min(...n)>=e}return!0}mt(KI,"hasMinStepsBetweenValues");function I0(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}mt(I0,"linearScale");function Iw(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",a=Number(s);return Math.max(0,i.length-a)}const n=e.split(".")[1];return n?n.length:0}mt(Iw,"getDecimalCount");function Nd(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}mt(Nd,"roundValue");function qI(t,{min:e,step:n,direction:r,multiplier:s}){const i=Iw(n),a=(t-e)/n,u=Math.round(a),c=Nd(u*n+e,i)===Nd(t,i);let d;return c?d=u+s*r:r>0?d=Math.ceil(a):d=Math.floor(a),Nd(d*n+e,i)}mt(qI,"getNextStepValue");function ZI(t){return typeof t=="function"}mt(ZI,"isFunction");const f2=g.forwardRef(({className:t,...e},n)=>S.jsxs(eJ,{ref:n,className:hr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(sJ,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(iJ,{className:"absolute h-full bg-primary"})}),S.jsx(cJ,{className:hr("block h-3.5 w-3.5 rounded-full border border-border bg-foreground shadow-sm","transition-transform hover:scale-110 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#6B97FF]","disabled:pointer-events-none")})]}));f2.displayName="Slider";const hJ=[{name:"surface-1",utility:"bg-surface-1",className:"bg-surface-1"},{name:"surface-2",utility:"bg-surface-2",className:"bg-surface-2"},{name:"surface-3",utility:"bg-surface-3",className:"bg-surface-3"},{name:"surface-4",utility:"bg-surface-4",className:"bg-surface-4"},{name:"surface-5",utility:"bg-surface-5",className:"bg-surface-5"},{name:"surface-6",utility:"bg-surface-6",className:"bg-surface-6"}],pJ=[{name:"primary",utility:"bg-primary",className:"bg-primary"},{name:"selected",utility:"bg-selected",className:"bg-selected"},{name:"accent",utility:"bg-accent",className:"bg-accent"},{name:"success",utility:"bg-accent-success",className:"bg-accent-success"},{name:"warning",utility:"bg-accent-warning",className:"bg-accent-warning"},{name:"error",utility:"bg-accent-error",className:"bg-accent-error"}],mJ=[{name:"gap-1",className:"w-1"},{name:"gap-2",className:"w-2"},{name:"gap-3",className:"w-3"},{name:"gap-4",className:"w-4"},{name:"gap-6",className:"w-6"},{name:"gap-8",className:"w-8"}],bp=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"CommentMarker",path:"components/CommentMarker.tsx",status:"feature-only",note:"Preview overlay marker tied to comment positions."},{name:"CommentMarkerLayer",path:"components/CommentMarkerLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to comment collections."},{name:"CommentPopover",path:"components/CommentPopover.tsx",status:"feature-only",note:"Comment workflow popover tied to editor state."},{name:"CommentReferenceChip",path:"components/CommentReferenceChip.tsx",status:"feature-only",note:"Comment workflow chip tied to selected references."},{name:"CommentReferencePicker",path:"components/CommentReferencePicker.tsx",status:"feature-only",note:"Comment workflow picker tied to preview elements."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],gJ=()=>{window.location.hash=""},Vi=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),P8=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),vJ=t=>t==="showcased"?"border-accent-success/40 bg-accent-success/10 text-accent-success":t==="cataloged"?"border-primary/40 bg-primary/10 text-primary":t==="generated"?"border-accent/40 bg-accent/10 text-accent":t==="unsuitable"?"border-accent-warning/40 bg-accent-warning/10 text-accent-warning":"border-border bg-surface-4 text-content-muted",yJ=()=>{const t=bp.filter(n=>n.status==="showcased").length,e=bp.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:gJ,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(Kz,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(MR,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Vi,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(Iu,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),S.jsx(Iu,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),S.jsx(Iu,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),S.jsx(H5,{primaryLabel:"Ship",primaryIcon:v1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(to,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(Yx,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(Vi,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(P8,{swatches:hJ})}),S.jsx(Vi,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(P8,{swatches:pJ})}),S.jsx(Vi,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(Vi,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:mJ.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(Vi,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(Yp,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(Yp.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(v1,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(Yp.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(f2,{defaultValue:[64],max:100,step:1}),S.jsx(f2,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Vi,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(hA,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(Nx,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(WQ,{hint:"Reading selected elements"})})]})}),S.jsx(Vi,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(K_,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(dA,{icon:S.jsx(v1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(Bm,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Vi,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:bp.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:bp.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${vJ(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},_J=64,Jm=new Set;let Qp=null;const xJ=()=>{Qp=null;for(const t of Jm)t()},wJ=()=>{Jm.size!==0&&(Qp!==null&&clearTimeout(Qp),Qp=setTimeout(xJ,_J))},bJ=t=>(Jm.add(t),()=>{Jm.delete(t)}),SJ=(t,e)=>typeof URL<"u"&&t instanceof URL?t:typeof Request<"u"&&t instanceof Request?new URL(t.url):new URL(String(t),e),EJ=(t,e)=>{try{const n=SJ(t,e);return n.origin!==e?!1:n.pathname.startsWith("/api/")}catch{return!1}},CJ=({nativeFetch:t,pageOrigin:e,getShouldIntercept:n})=>{const r=(s,i)=>t(s,i).then(a=>(a.status===401&&n()&&EJ(s,e)&&wJ(),a));return window.fetch=r,()=>{window.fetch=t}},kJ=t=>!t.hasConfig||t.configLoading||t.demoMode!==!0||t.agentModeAvailable!==!0||t.pathnameDemoSessionId!==null?!1:(t.activeDemoSessionId??t.configuredDemoSessionId??null)===null,PJ=(t,e,n)=>t===!0&&e!==!0?null:n,TJ=t=>t?"Preparing your demo session…":null,RJ=t=>!(t==="/rivet"||t.startsWith("/rivet/")),AJ=t=>!RJ(t.pathname)||t.hasConfig?!1:!t.configLoading&&!t.isRetryingConfig,IJ=t=>{const e=t.match(/^\/try\/([^/]+)/);return e!=null&&e[1]?decodeURIComponent(e[1]):null},MJ=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",OJ=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},U1=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:"editor_gate",method:"google_oauth",...s?{failure_reason:s}:{}}}),B1=ks("App"),LJ=2e3,DJ=60,T8="Connecting to Google...",R8="https://rivet-proxy.onrender.com",NJ=`<!doctype html>
394
- <html lang="en">
395
- <head>
396
- <meta charset="utf-8" />
397
- <meta name="viewport" content="width=device-width, initial-scale=1" />
398
- <title>${T8}</title>
399
- <style>
400
- :root { color-scheme: light dark; }
401
- body {
402
- margin: 0;
403
- min-height: 100vh;
404
- display: grid;
405
- place-items: center;
406
- font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
407
- background: #111215;
408
- color: #f3f4f6;
409
- }
410
- .panel {
411
- border: 1px solid rgba(255, 255, 255, 0.16);
412
- border-radius: 12px;
413
- padding: 18px 22px;
414
- background: rgba(255, 255, 255, 0.06);
415
- font-size: 14px;
416
- }
417
- </style>
418
- </head>
419
- <body>
420
- <div class="panel">${T8}</div>
421
- </body>
422
- </html>`,jJ="Too many people are trying Rivet right now. Please try again in a few minutes.",YI="Failed to start an isolated demo session.",FJ=async t=>{if(t.status===429)return jJ;try{const e=await t.json();if(e.error)return e.error;if(e.message)return e.message}catch{}return YI},h2=274,e0=395,W1=Math.min(e0,Math.round((h2+e0)/2*1.1)),A8="rivet:panelWidth:v2",VJ=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},$J=({projectPath:t,activeDemoSessionId:e=null,showLoginGate:n=!1,onStartLogin:r,isStartingLogin:s=!1,loginError:i=null,fullPageHostedLoginProgressMessage:a=null,holdHostedTryoutPreviewNavigation:u=!1,hostedTryoutPreviewHoldMessage:c=null,deferInspectorUntilPreviewReady:d=!1})=>{const h=Je(o5)>0,[p,m]=BP(s5),y=P$(),[x,_]=g.useState(()=>{if(typeof window>"u")return W1;const Z=Number(window.localStorage.getItem(A8));return Number.isFinite(Z)&&Z>=h2&&Z<=e0?Z:W1}),[w,E]=g.useState(!1),[P,T]=g.useState(BZ),k=p?x:0,[R,L]=g.useState(p);g.useEffect(()=>{if(!p){L(!1);return}T(Z=>UZ({position:Z,boundsLeftPx:x}))},[p,x]),g.useEffect(()=>{window.localStorage.setItem(A8,String(x))},[x]),g.useEffect(()=>{if(!p)return;const Z=Y=>{Y.key==="Escape"&&(VJ(Y.target)||(Y.preventDefault(),m(!1)))};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[p,m]);const O=g.useCallback(Z=>{Z.preventDefault(),Z.stopPropagation();const Y=Z.clientX,B=x;E(!0);const K=J=>{const H=Math.min(e0,Math.max(h2,B+(J.clientX-Y)));_(H)},$=()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$),E(!1)};window.addEventListener("pointermove",K),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$)},[x]),A=g.useCallback(()=>_(W1),[]),M=rY(),D=Je(Af);oY({enabled:!D});const F=M.isProcessing?"Completing authentication...":a,N=F!==null,G=ot(d5);return g.useEffect(()=>{G(t??null)},[t,G]),g.useEffect(()=>{n&&(document.body.style.cursor="auto")},[n]),S.jsxs(_l.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[F!==null&&!n?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(AZ,{message:F})}):null,n?S.jsx("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-black/45 backdrop-blur-[2px]",children:S.jsx(cI,{isSigningIn:s||N,onStartSignIn:()=>{r==null||r()},errorMessage:i,displayMode:"modal"})}):null,S.jsxs("div",{className:`relative flex min-w-0 flex-1 flex-col ${n?"pointer-events-none select-none":""}`,children:[S.jsx(iq,{holdHostedTryoutPreviewNavigation:u,isInteractionDisabled:n,activeDemoSessionId:e}),u&&c?S.jsx("div",{className:"bg-main absolute inset-0 z-30 flex items-center justify-center",children:S.jsx("div",{className:"border-divider bg-main-light rounded-lg border p-6 shadow-lg",children:S.jsx(hA,{message:c})})}):null]}),n?null:S.jsx(S.Fragment,{children:!d&&!h?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:R?x:0},children:S.jsxs(_l.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:p?0:-x},transition:y?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{p&&L(!0)},style:{width:x,willChange:"transform"},children:[S.jsx(_K,{onClose:()=>m(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:O,onDoubleClick:A,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${w?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),w&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(KZ,{isVisible:!0,isPanelOpen:p,isReducedMotion:!!y,position:P,dragBoundsLeftPx:k,onPositionChange:T,onToggle:()=>m(Z=>!Z)})]}):null}),S.jsx(tH,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},p2="rivet_connect_deep_link",HJ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(p2);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(p2,n),e){t.delete("connect");const r=t.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},zJ=HJ(),UJ=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(qp)==="1"),[r,s]=g.useState(!1),[i,a]=g.useState(zJ);g.useEffect(()=>{n&&window.sessionStorage.removeItem(qp)},[n]);const{config:u,refetchConfig:c,loading:d,error:h}=tY(),p=ot(Af),[m,y]=g.useState(!1),[x,_]=g.useState(null),[w,E]=g.useState(!1),[P,T]=g.useState(!1),[k,R]=g.useState(null),[L,O]=g.useState(!1),A=g.useRef(!1),M=g.useRef(!1),D=IJ(window.location.pathname),F=(u==null?void 0:u.activeDemoSessionId)??null,N=D??k??F,G=g.useMemo(()=>PJ(u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,N),[u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,N]),Z=g.useMemo(()=>kJ({configLoading:d,hasConfig:u!==null,demoMode:u==null?void 0:u.demoMode,agentModeAvailable:u==null?void 0:u.agentModeAvailable,pathnameDemoSessionId:D,activeDemoSessionId:k,configuredDemoSessionId:F}),[u,d,D,k,F]);g.useLayoutEffect(()=>{if(!Z){O(!1);return}O(!0)},[Z]);const Y=L,B=g.useMemo(()=>TJ(Y),[Y]),K=(u==null?void 0:u.demoMode)===!0&&Y,$=g.useRef(null);$.current=N;const J=g.useCallback(async()=>{if(!A.current)return;R(null);const ye=await c();if((ye==null?void 0:ye.demoMode)===!0&&ye.agentModeAvailable!==!0){T(!1);return}(ye==null?void 0:ye.demoMode)===!0&&T(!0)},[c]);g.useEffect(()=>{if((u==null?void 0:u.demoMode)===!0)return bJ(()=>{J()})},[u==null?void 0:u.demoMode,J]),g.useEffect(()=>{if(A.current=(u==null?void 0:u.demoMode)===!0,(u==null?void 0:u.demoMode)!==!0)return;const ye=window.fetch.bind(window);return CJ({nativeFetch:ye,pageOrigin:window.location.origin,getShouldIntercept:()=>A.current})},[u==null?void 0:u.demoMode]),g.useEffect(()=>{(u==null?void 0:u.agentModeAvailable)===!0&&T(!1)},[u==null?void 0:u.agentModeAvailable]);const H=g.useCallback(async ye=>{const be=$.current;if(!(ye!=null&&ye.forceRefresh)&&be)return be;if(M.current)return"";M.current=!0;try{const Fe=await fetch("/api/demo/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!Fe.ok){const We=await FJ(Fe);throw new Error(We)}const Re=await Fe.json();if(!Re.sessionId)throw new Error("Demo session response missing session id.");return R(Re.sessionId),Re.sessionId}finally{M.current=!1}},[]);g.useEffect(()=>{F&&R(F)},[F]),g.useEffect(()=>{u!=null&&u.userId?(Ce.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Ce.alias(u.email,u.userId)):u!=null&&u.email&&Ce.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),g.useEffect(()=>{if(!u)return;const ye=!!u.demoMode,be=ye?N:null;Ce.register({source:"visual_editor",surface:"visual_editor",demo_mode:ye,...be?{demo_session_id:be}:{}})},[u,N]);const j=g.useCallback(async()=>{var We;const ye=globalThis.crypto.randomUUID(),be=Date.now();y(!0),_(null);const Fe=(u==null?void 0:u.demoMode)!==!0;if(Fe){const Tt=U1({outcome:"started",authAttemptId:ye,startedAt:be,now:be});Ce.capture(Tt.event,Tt.properties)}let Re=null;try{if(Re=window.open("","_blank"),!Re)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{Re.document.open(),Re.document.write(NJ),Re.document.close()}catch(we){B1.warn("Failed to render loading state in auth popup:",we)}const Tt=await fetch(`${R8}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),Ye=await Tt.json();if(!Tt.ok||!Ye.success||!Ye.authUrl||!Ye.sessionId||!Ye.pollSecret)throw new Error(Ye.error||Ye.message||"Failed to start Google login");if(Re.closed)throw new Error("Sign-in window was closed before Google login started.");Re.location.href=Ye.authUrl;for(let we=0;we<DJ;we+=1){if(Re.closed)throw new Error("Sign-in window was closed before authentication completed.");const Ee=await(await fetch(`${R8}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:Ye.sessionId,pollSecret:Ye.pollSecret})})).json();if(Ee.success&&Ee.token&&((We=Ee.user)!=null&&We.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Ee.user.email,token:Ee.token,refreshToken:Ee.refreshToken,userId:Ee.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");if(Re.close(),window.sessionStorage.setItem(qp,"1"),Fe){const vt=U1({outcome:"completed",authAttemptId:ye,startedAt:be,now:Date.now()});Ce.capture(vt.event,vt.properties)}if((u==null?void 0:u.demoMode)===!0){await H({forceRefresh:!0}),window.location.reload();return}window.location.reload();return}if(Ee.error&&Ee.error!=="Pending")throw new Error(Ee.error||"Google login failed");await new Promise(Xe=>setTimeout(Xe,LJ))}throw new Error("Authentication timed out. Please try again.")}catch(Tt){Re&&!Re.closed&&Re.close();const Ye=Tt instanceof Error?Tt.message:"Failed to start login flow";if(B1.warn("Hosted login failed:",Ye),Fe){const we=U1({outcome:"failed",authAttemptId:ye,startedAt:be,now:Date.now(),failureReason:OJ(Ye)});Ce.capture(we.event,we.properties)}_(Ye),y(!1)}},[u==null?void 0:u.demoMode,H]),X=(u==null?void 0:u.demoMode)===!0&&((u==null?void 0:u.agentModeAvailable)!==!0||P||m),te=u!=null&&u.agentModeAvailable!==!0,ie=MJ(t),ae=g.useCallback(async()=>{E(!0),p(!0);try{await c()}finally{p(!1),E(!1)}},[c,p]);if(g.useEffect(()=>{if(!Z)return;let ye=!1;return H({forceRefresh:!0}).catch(be=>{const Fe=be instanceof Error?be.message:YI;B1.warn("Hosted session bootstrap failed:",Fe),_(Fe),pt.error(Fe)}).finally(()=>{ye||O(!1)}),()=>{ye=!0}},[Z,H]),g.useEffect(()=>{const ye=()=>{const be=window.location.hash;e(be)};return window.addEventListener("hashchange",ye),()=>window.removeEventListener("hashchange",ye)},[]),ie==="design-system")return S.jsx(yJ,{});const ue={pathname:window.location.pathname,configLoading:d,hasConfig:u!==null,isRetryingConfig:w};if(AJ(ue)){const ye=h||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-dim mt-2 text-xs",children:ye}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{ae()},children:"Retry"})]})})}if(te)return S.jsx(cI,{isSigningIn:m,onStartSignIn:()=>{j()},errorMessage:x,displayMode:"full"});const oe=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&i!==null,se=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&n&&!r&&!oe;return S.jsxs(S.Fragment,{children:[S.jsx($J,{projectPath:u==null?void 0:u.projectPath,activeDemoSessionId:G,showLoginGate:X,onStartLogin:j,isStartingLogin:m,loginError:x,fullPageHostedLoginProgressMessage:(u==null?void 0:u.demoMode)===!0&&m?"Completing sign-in...":null,holdHostedTryoutPreviewNavigation:Y,hostedTryoutPreviewHoldMessage:B,deferInspectorUntilPreviewReady:K}),S.jsx(G_,{context:"onboarding",isOpen:se,onClose:()=>s(!0)}),S.jsx(G_,{context:"menu",isOpen:oe,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(p2),a(null)}})]})},BJ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",WJ=new oL,GJ={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},KJ=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});QN.createRoot(document.getElementById("root")).render(S.jsx(ve.StrictMode,{children:S.jsx(zN,{apiKey:BJ,options:{api_host:"https://rivet-proxy.onrender.com/ingest",ui_host:"https://us.posthog.com",person_profiles:"always",capture_exceptions:!0,autocapture:!0,capture_pageview:!0,capture_performance:!0,persistence:"localStorage",...GJ,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.14.12",env:"production"})}},children:S.jsx(GN,{fallback:S.jsx(KJ,{}),children:S.jsx(aL,{client:WJ,children:S.jsx(wG,{defaultShape:"rounded",children:S.jsx(NQ,{defaultLibrary:"lucide",children:S.jsx(UJ,{})})})})})})}));